@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* --- CSS Variables & Custom Theme --- */
:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Outfit', sans-serif;

  /* Color Palette - Solid Light Slate / Navy Corporate Theme */
  --bg-primary: #f2f4f8; /* Light gray-blue backdrop */
  --bg-secondary: #ffffff; /* Pure white panels */
  --bg-tertiary: #0a225c; /* Midnight navy header */
  
  --border-glass: #d6e3f2; /* Soft ice-blue border line */
  --border-glass-hover: #b5cce6; /* Darker ice-blue hover line */
  
  --text-primary: #0a225c; /* Midnight navy primary text */
  --text-secondary: #475569; /* Slate gray info text */
  --text-muted: #64748b; /* Muted steel text */

  --accent-primary: #1552a4; /* Solid corporate royal blue */
  --accent-secondary: #0a225c; /* Midnight navy accent */
  --accent-success: #059669; /* Solid emerald green */
  --accent-danger: #dc2626; /* Solid corporate red */

  /* App Icon Colors - Glossy 3D gradients (jewel tones) */
  --grad-sale-order: linear-gradient(135deg, #60a5fa 0%, #2563eb 50%, #1e40af 100%);
  --grad-sales-invoice: linear-gradient(135deg, #fbbf24 0%, #d97706 50%, #854d0e 100%);
  --grad-purchase-order: linear-gradient(135deg, #c084fc 0%, #7c3aed 50%, #5b21b6 100%);
  --grad-purchase-invoice: linear-gradient(135deg, #2dd4bf 0%, #0d9488 50%, #115e59 100%);
  --grad-payment: linear-gradient(135deg, #f43f5e 0%, #e11d48 50%, #9f1239 100%);
  --grad-receipt: linear-gradient(135deg, #fb923c 0%, #ea580c 50%, #9a3412 100%);
  --grad-journal: linear-gradient(135deg, #94a3b8 0%, #475569 50%, #1e293b 100%);
  --grad-stock: linear-gradient(135deg, #34d399 0%, #059669 50%, #065f46 100%);
  --grad-contra: linear-gradient(135deg, #818cf8 0%, #4f46e5 50%, #3730a3 100%);

  /* Radius & Borders - Sleek 3D rounded corners */
  --radius-squircle: 22px;
  --radius-window: 16px;
  --radius-sm: 6px;
  --radius-md: 12px;

  /* Premium 3D matching colored glow shadows */
  --shadow-icon-sale-order: 0 10px 20px -5px rgba(37, 99, 235, 0.45);
  --shadow-icon-sales-invoice: 0 10px 20px -5px rgba(217, 119, 6, 0.45);
  --shadow-icon-purchase-order: 0 10px 20px -5px rgba(124, 58, 237, 0.45);
  --shadow-icon-purchase-invoice: 0 10px 20px -5px rgba(13, 148, 136, 0.45);
  --shadow-icon-payment: 0 10px 20px -5px rgba(225, 29, 72, 0.45);
  --shadow-icon-receipt: 0 10px 20px -5px rgba(234, 88, 12, 0.45);
  --shadow-icon-journal: 0 10px 20px -5px rgba(71, 85, 105, 0.4);
  --shadow-icon-stock: 0 10px 20px -5px rgba(5, 150, 105, 0.45);
  --shadow-icon-contra: 0 10px 20px -5px rgba(79, 70, 229, 0.45);

  --transition-normal: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-spring: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- Base Resets --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
  background-image: radial-gradient(rgba(21, 82, 164, 0.05) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  background-attachment: fixed;
}

input, button, select {
  font-family: inherit;
  font-size: inherit;
  outline: none;
  border: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

/* --- Login Page Styles --- */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.login-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  width: 1000px;
  min-height: 600px;
  border-radius: var(--radius-window);
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(10, 34, 92, 0.12);
  background: #ffffff;
  border: 1px solid var(--border-glass);
}

.login-visual {
  background: var(--bg-tertiary);
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--border-glass);
}

.login-visual::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: var(--accent-primary);
  filter: blur(100px);
  opacity: 0.15;
  border-radius: 50%;
}

.visual-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
}

.visual-logo span {
  font-weight: 400;
  font-size: 1rem;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.06);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
}

.visual-art-wrapper {
  margin: auto 0;
  text-align: center;
  position: relative;
  z-index: 2;
}

.visual-art-wrapper svg {
  width: 70%;
  max-height: 240px;
  filter: drop-shadow(0 15px 25px rgba(99, 102, 241, 0.25));
  animation: float 6s ease-in-out infinite;
}

.visual-footer {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.login-form-pane {
  padding: 3.5rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-header h2 {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.login-header p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.toggle-wrapper {
  display: flex;
  background: #e2ecf7;
  border: 1px solid var(--border-glass);
  padding: 0.35rem;
  border-radius: 9999px;
  position: relative;
  margin-bottom: 2rem;
  width: 100%;
}

.toggle-option {
  flex: 1;
  text-align: center;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  z-index: 2;
  transition: color var(--transition-normal);
  border-radius: 9999px;
}

.toggle-option.active {
  color: #ffffff;
}

.toggle-slider {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  bottom: 0.35rem;
  width: calc(50% - 0.35rem);
  background: var(--accent-primary);
  border-radius: 9999px;
  z-index: 1;
  transition: transform var(--transition-normal);
  box-shadow: 0 4px 12px rgba(21, 82, 164, 0.25);
}

.toggle-wrapper.employee-selected .toggle-slider {
  transform: translateX(100%);
}

.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: 0.9rem 1rem 0.9rem 2.75rem;
  background: #ffffff;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all var(--transition-normal);
}

.form-input:focus {
  border-color: var(--accent-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(21, 82, 164, 0.15);
}

.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  font-size: 0.88rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.forgot-link {
  color: var(--accent-primary);
  font-weight: 500;
}

.btn-primary {
  width: 100%;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: var(--accent-primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 15px rgba(21, 82, 164, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.45);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}


/* --- Web OS Dashboard Layout --- */
.os-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  position: relative;
  overflow: hidden;
}

/* Status Top Bar (Desktop/Mobile Nav Bar) */
.os-topbar {
  height: 70px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  z-index: 100;
  flex-shrink: 0;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.hub-brand-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hub-header-title {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  display: flex;
  gap: 0.25rem;
}

.hub-header-title .prefix {
  color: #0f172a;
}

.hub-header-title .suffix {
  color: #4f46e5;
}

.hub-header-login-time {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Navigation Tabs inside Header */
.hub-nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: #f8fafc;
  padding: 0.25rem;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
}

.nav-tab {
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  background: transparent;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.nav-tab:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.nav-tab.active {
  background-color: #eff6ff;
  border-color: #3b82f6;
  color: #2563eb;
  font-weight: 700;
}

/* Far Right Search & Notification controls */
.hub-controls-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hub-search-wrapper {
  position: relative;
  width: 210px;
}

.hub-search-wrapper .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: #94a3b8;
  pointer-events: none;
}

.hub-search-wrapper input {
  width: 100%;
  padding: 0.45rem 0.75rem 0.45rem 2rem;
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  font-size: 0.82rem;
  background: #f8fafc;
  color: #0f172a;
  transition: all 0.3s ease;
}

.hub-search-wrapper input:focus {
  border-color: #3b82f6;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.hub-btn-notify {
  position: relative;
  background: #ffffff;
  color: #64748b;
  border: 1.5px solid #e2e8f0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.hub-btn-notify:hover {
  color: #0f172a;
  border-color: #cbd5e1;
  background: #f8fafc;
}

.hub-btn-notify svg {
  width: 18px;
  height: 18px;
}

.hub-btn-notify .notify-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  background: #ef4444;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
}

/* ---------------------------------------------------- */
/* APP DRAWER / LAUNCHPAD WORKSPACE                     */
/* ---------------------------------------------------- */
.os-workspace {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 1.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}

.app-drawer-container {
  max-width: 1000px;
  width: 100%;
  margin: auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.launcher-workspace-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(10, 34, 92, 0.05);
  padding: 3rem 4rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
}

.app-drawer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem 2.5rem;
  width: 100%;
  justify-items: center;
}

/* App Icon & Layout styling matching shared screenshot */
.app-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  width: 120px;
  position: relative;
  transition: transform var(--transition-spring);
}

.app-item:hover {
  transform: scale(1.08);
}

.app-item:active {
  transform: scale(0.95);
}

/* Squircle card definition matching clean 3D card menu screenshot */
.app-icon {
  width: 104px;
  height: 104px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background-color: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: 
    0 10px 20px -5px rgba(0, 0, 0, 0.04),
    0 4px 6px -2px rgba(0, 0, 0, 0.02);
}

.app-icon img, .app-icon svg {
  width: 76px;
  height: 76px;
  object-fit: contain;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.app-item {
  cursor: pointer;
}

.app-item:hover .app-icon img, .app-item:hover .app-icon svg {
  transform: scale(1.16) rotate(-3deg);
}

.app-item:hover .app-icon {
  transform: translateY(-8px) scale(1.05);
  border-color: rgba(203, 213, 225, 1);
  box-shadow: 
    0 20px 25px -5px rgba(10, 34, 92, 0.08),
    0 10px 10px -5px rgba(10, 34, 92, 0.04);
}

/* Custom Gradients and Glowing Shadows for each squircle */
.icon-sale-order { background: var(--grad-sale-order); box-shadow: var(--shadow-icon-sale-order); }
.icon-sales-invoice { background: var(--grad-sales-invoice); box-shadow: var(--shadow-icon-sales-invoice); }
.icon-purchase-order { background: var(--grad-purchase-order); box-shadow: var(--shadow-icon-purchase-order); }
.icon-purchase-invoice { background: var(--grad-purchase-invoice); box-shadow: var(--shadow-icon-purchase-invoice); }
.icon-payment { background: var(--grad-payment); box-shadow: var(--shadow-icon-payment); }
.icon-receipt { background: var(--grad-receipt); box-shadow: var(--shadow-icon-receipt); }
.icon-journal { background: var(--grad-journal); box-shadow: var(--shadow-icon-journal); }
.icon-stock { background: var(--grad-stock); box-shadow: var(--shadow-icon-stock); }
.icon-contra { background: var(--grad-contra); box-shadow: var(--shadow-icon-contra); }

/* App Label directly underneath */
.app-label {
  margin-top: 0.75rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  white-space: nowrap;
  font-family: var(--font-display);
}

/* Notification badge */
.app-badge {
  position: absolute;
  top: -6px;
  right: 12px;
  background: var(--accent-danger);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  border: 2px solid var(--bg-primary);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

/* Clean White Card Menu Shadows */
.shadow-sale-order { box-shadow: 0 10px 20px -5px rgba(220, 38, 38, 0.06); }
.shadow-sales-invoice { box-shadow: 0 10px 20px -5px rgba(217, 119, 6, 0.06); }
.shadow-purchase-order { box-shadow: 0 10px 20px -5px rgba(5, 150, 105, 0.06); }
.shadow-purchase-invoice { box-shadow: 0 10px 20px -5px rgba(10, 34, 92, 0.06); }
.shadow-payment { box-shadow: 0 10px 20px -5px rgba(220, 38, 38, 0.06); }
.shadow-receipt { box-shadow: 0 10px 20px -5px rgba(220, 38, 38, 0.06); }
.shadow-journal { box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.06); }
.shadow-stock { box-shadow: 0 10px 20px -5px rgba(217, 119, 6, 0.06); }
.shadow-contra { box-shadow: 0 10px 20px -5px rgba(107, 114, 128, 0.06); }

/* ---------------------------------------------------- */
/* FULL SCREEN WEB OS APP WINDOWS                       */
/* ---------------------------------------------------- */
.app-window-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.app-window {
  width: 90%;
  max-width: 1000px;
  height: 80vh;
  border-radius: var(--radius-window);
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  box-shadow: 0 15px 35px rgba(10, 34, 92, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.85);
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.app-window.open {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

/* App Window Header Bar */
.window-header {
  height: 65px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-glass);
  background: #f2f4f8;
}

.window-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.window-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.window-icon svg {
  width: 18px;
  height: 18px;
}

.window-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
}

.btn-close-window {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
}

.btn-close-window:hover {
  background: var(--accent-danger);
  color: white;
  border-color: transparent;
}

/* App Window Content Layout */
.window-body {
  flex-grow: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100% - 65px);
  overflow: hidden;
}

/* Window Sidebar Controls */
.window-sidebar {
  background: #f8fafc;
  border-right: 1px solid var(--border-glass);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.window-summary-box {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--border-glass);
}

.summary-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.summary-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.8rem;
}

.window-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.window-nav-btn {
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.window-nav-btn:hover {
  background: rgba(21, 82, 164, 0.04);
  color: var(--text-primary);
}

.window-nav-btn.active {
  background: rgba(21, 82, 164, 0.08);
  color: var(--text-primary);
  border-left: 3px solid var(--accent-primary);
}

/* Window Workpane */
.window-pane-container {
  padding: 1.5rem;
  overflow-y: auto;
  height: 100%;
}

.window-tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.window-tab-pane.active {
  display: block;
}

/* Data Table Grid within App Window */
.data-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: #f2f4f8;
  padding: 0.85rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-glass);
}

.data-table td {
  padding: 0.9rem 1.25rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-glass);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(21, 82, 164, 0.04);
}

.status-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge.success { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.status-badge.normal { background: #e2ecf7; color: var(--text-primary); }

/* Modal Backdrop */
.window-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.window-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* ---------------------------------------------------- */
/* RESPONSIVE LAYOUT & MEDIA ADJUSTMENTS                */
/* ---------------------------------------------------- */
@media (max-width: 900px) {
  .app-drawer-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem 1.5rem;
  }
  .app-window {
    width: 95%;
    height: 90vh;
  }
}

@media (max-width: 768px) {
  .app-drawer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem 1rem;
  }
  .window-body {
    grid-template-columns: 1fr;
  }
  .window-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border-glass);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
  }
  .window-summary-box {
    padding: 0.5rem 1rem;
  }
  .summary-value {
    font-size: 1.4rem;
  }
  .window-nav {
    flex-direction: row;
    gap: 0.5rem;
  }
  .window-nav-btn {
    padding: 0.5rem 0.85rem;
  }
  .login-card {
    grid-template-columns: 1fr;
    width: 450px;
  }
  .login-visual {
    display: none;
  }
}

@media (max-width: 480px) {
  .app-drawer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 0.5rem;
  }
  .app-icon {
    width: 76px;
    height: 76px;
  }
  .app-icon svg {
    width: 36px;
    height: 36px;
  }
  .app-label {
    font-size: 0.85rem;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Floating custom toast notifications */
.erp-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 1rem 2rem;
  border-radius: var(--radius-sm);
  background: rgba(15, 22, 38, 0.85);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border-left: 4px solid var(--accent-primary);
  border-top: 1px solid var(--border-glass);
  opacity: 0;
  transition: all var(--transition-normal);
}
.erp-toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* --- Sales Hub Sub-menu Page Styles --- */
.sales-hub-view {
  width: 100%;
  max-width: 1200px;
  height: 100%;
  display: none; /* Controlled via JS */
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 0.4s ease;
}

/* Breadcrumbs with interactive back link */
.os-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.os-breadcrumb-back {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color var(--transition-normal);
  font-weight: 600;
}

.os-breadcrumb-back:hover {
  color: var(--accent-primary);
}

.os-breadcrumb-back svg {
  width: 16px;
  height: 16px;
}

.breadcrumb-separator {
  color: var(--text-muted);
}

.os-breadcrumb-current {
  color: var(--text-primary);
  font-weight: 700;
}

/* Hub 3-Column Grid */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  width: 100%;
}

.hub-column-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 10px 30px rgba(10, 34, 92, 0.05);
}

.hub-column-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 0.75rem;
}

.column-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Indicators by column */
.ind-orders { background: #8b5cf6; }
.ind-logistics { background: #f59e0b; }
.ind-audits { background: #1552a4; }

.hub-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Sleek list items */
.hub-item-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.hub-item-card:hover {
  background: #e2ecf7;
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(10, 34, 92, 0.05);
}

.hub-item-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  transition: all var(--transition-normal);
  flex-shrink: 0;
}

.hub-item-card:hover .hub-item-icon-box {
  color: var(--accent-primary);
  background: #ffffff;
}

.hub-item-icon-box svg {
  width: 18px;
  height: 18px;
}

.hub-item-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.hub-item-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.1rem;
}

.hub-item-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Badge counts inside rows */
.hub-item-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-family: var(--font-display);
}

.hub-item-badge.active-green {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.hub-item-badge.count-blue {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}

.hub-item-badge.count-purple {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
}

.hub-item-badge.count-green {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

/* Hub Responsive queries */
@media (max-width: 1100px) {
  .hub-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hub-grid {
    grid-template-columns: 1fr;
  }
  .hub-column-card {
    padding: 1.25rem;
  }
}

/* --- Sale Orders Grid Page Styles --- */
.grid-view-container {
  width: 100%;
  height: 100%;
  display: none; /* Controlled via JS */
  flex-direction: column;
  gap: 1rem;
  animation: fadeIn 0.4s ease;
}

/* Toolbar Bar */
.grid-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(10, 34, 92, 0.05);
}

.grid-toolbar-left, .grid-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.saved-view-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.saved-view-select {
  background: #ffffff;
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 0.4rem 1.75rem 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%230a225c' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 4px center;
  background-size: 18px;
}

.btn-toolbar-action {
  background: #ffffff;
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-normal);
}

.btn-toolbar-action:hover {
  background: #f2f4f8;
  border-color: var(--border-glass-hover);
}

.btn-toolbar-primary {
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 4px 12px rgba(21, 82, 164, 0.2);
  transition: all var(--transition-normal);
}

.btn-toolbar-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(21, 82, 164, 0.3);
}

/* Custom Table design inside grid card */
.grid-table-card {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(10, 34, 92, 0.06);
}

.grid-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  background: #ffffff;
  border-bottom: 1px solid var(--border-glass);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.grid-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

.grid-card-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.grid-total-pill {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.btn-grid-primary {
  background: var(--accent-primary);
  color: #ffffff;
  border: none;
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
  box-shadow: 0 3px 10px rgba(21, 82, 164, 0.2);
}

.btn-grid-primary:hover {
  background: #174587;
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(21, 82, 164, 0.3);
}

.btn-grid-secondary {
  background: #ffffff;
  border: 1px solid #2563eb;
  color: #2563eb;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}

.btn-grid-secondary:hover {
  background: #eff6ff;
  border-color: #1d4ed8;
}

.btn-grid-icon {
  background: #ffffff;
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-grid-icon:hover {
  background: #f2f4f8;
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.os-breadcrumbs {
  display: flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-primary);
  letter-spacing: 0.02em;
}

.os-breadcrumb-back {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.os-breadcrumb-back:hover {
  background: rgba(21, 82, 164, 0.08);
}

.grid-table-scroll {
  flex-grow: 1;
  overflow-y: auto;
  overflow-x: auto;
}

.grid-table, .erp-grid-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.grid-table th, .erp-grid-table th {
  background: #f2f4f8;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-glass);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.grid-table td, .erp-grid-table td {
  padding: 0.45rem 0.75rem;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--border-glass);
  white-space: nowrap;
}

.grid-table tbody tr, .erp-grid-table tbody tr {
  transition: background var(--transition-fast);
}

.grid-table tbody tr:hover, .erp-grid-table tbody tr:hover {
  background: rgba(21, 82, 164, 0.04);
}

.grid-table tbody tr:hover {
  background: rgba(21, 82, 164, 0.04);
}

.grid-table tbody tr.row-selected {
  background: rgba(21, 82, 164, 0.08);
}

/* Checkbox alignment */
.checkbox-td {
  width: 40px;
  text-align: center;
  padding-right: 0 !important;
}

.grid-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.link-id {
  color: var(--accent-primary);
  font-weight: 700;
  cursor: pointer;
}

.link-id:hover {
  text-decoration: underline;
}

/* Status pills matching the screenshot colors */
.badge-status {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 9999px;
  font-size: 0.70rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.02em;
}

.badge-status.bg-completed {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.badge-status.bg-converted {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}

.badge-status.bg-pending {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.badge-status.bg-assigned {
  background: rgba(6, 182, 212, 0.12);
  color: #06b6d4;
}

/* Vertical Action Dots */
.btn-action-dots {
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.btn-action-dots:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

/* Pagination Footer Bar */
.grid-pagination-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid var(--border-glass);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.pagination-size {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pagination-size-select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-weight: 700;
  cursor: pointer;
}

.pagination-size-select option {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-page-nav {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-page-nav:hover:not(:disabled) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-page-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-page-nav svg {
  width: 18px;
  height: 18px;
}

/* Responsive Overrides */
@media (max-width: 900px) {
  .grid-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .grid-toolbar-left, .grid-toolbar-right {
    justify-content: space-between;
  }
}

/* --- Sales Invoice Sub-Page Custom Styles --- */
.invoice-worth-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.invoice-worth-stats span {
  color: var(--text-primary);
  font-weight: 800;
}

.btn-sync-tally {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--text-primary);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-normal);
}

.btn-sync-tally:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.5);
}

.row-collapse-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.row-collapse-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.row-collapse-btn svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
}

.row-collapse-btn.collapsed svg {
  transform: rotate(-90deg);
}

/* --- Sales Invoice Creation Custom Sizing --- */
.create-view-grid-row {
  display: grid;
  gap: 0.75rem;
  width: 100%;
}

.form-input-compact {
  background: #ffffff;
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  transition: all var(--transition-fast);
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

.form-input-compact:focus {
  border-color: var(--accent-primary);
  background: #ffffff;
}

.form-label-compact {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
  display: block;
}

.btn-action-trash {
  background: transparent;
  color: #ef4444;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.btn-action-trash:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.btn-action-trash svg {
  width: 14px;
  height: 14px;
}

/* Scroll area compact selectors */
.scroll-compact::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.scroll-compact::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.scroll-compact::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* --- Sales Order Creation Custom Styles --- */
.consolidated-totals-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid var(--border-glass);
  padding: 0.45rem 1rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.consolidated-totals-bar span {
  color: var(--accent-secondary);
  font-weight: 800;
  font-size: 0.85rem;
}

.btn-save-order {
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: 0.4rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  transition: all var(--transition-normal);
}

.btn-save-order:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}/* --- Light Theme Modal, Drawer, & Scrollbar overrides --- */
.detail-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 550px;
  max-width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-left: 1px solid var(--border-glass) !important;
  box-shadow: -10px 0 30px rgba(10, 34, 92, 0.1) !important;
}

.drawer-header {
  border-bottom: 1px solid var(--border-glass) !important;
  background: #f2f4f8 !important;
  color: var(--text-primary) !important;
}

.btn-close-drawer {
  color: var(--text-secondary) !important;
}

.drawer-content {
  background: var(--bg-secondary) !important;
}

.drawer-content .form-input {
  background: #ffffff !important;
  border: 1px solid var(--border-glass) !important;
  color: var(--text-primary) !important;
}

.grid-pagination-bar {
  background: #f2f4f8 !important;
  border-top: 1px solid var(--border-glass) !important;
  color: var(--text-secondary) !important;
}

.pagination-size-select {
  color: var(--text-primary) !important;
}

.pagination-size-select option {
  background: #ffffff !important;
  color: var(--text-primary) !important;
}

.scroll-compact::-webkit-scrollbar-thumb {
  background: rgba(10, 34, 92, 0.15) !important;
}

.scroll-compact::-webkit-scrollbar-thumb:hover {
  background: rgba(10, 34, 92, 0.3) !important;
}

/* --- Purchase Hub Action Pills Bar Styles --- */
.purchase-pills-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  width: 100%;
}

.purchase-pill-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  background: #ffffff;
  border: 1px solid var(--border-glass);
  padding: 0.6rem 1.15rem;
  border-radius: 30px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 12px rgba(10, 34, 92, 0.04);
}

.purchase-pill-btn:hover {
  background: #e2ecf7;
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(21, 82, 164, 0.12);
}

.purchase-pill-btn .pill-chevron {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.purchase-pill-btn:hover .pill-chevron {
  color: var(--accent-primary);
}

/* Radio Mode selector for PO creation */
.po-mode-radio {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  justify-content: center;
  padding: 0.25rem 0;
}

.po-radio-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.po-radio-label input[type="radio"] {
  accent-color: var(--accent-primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Stepper Wizard Styling matching checkout flow */
.stepper-wizard-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  user-select: none;
}

.step-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #cbd5e1;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  transition: all 0.3s ease;
}

.step-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.step-line {
  flex-grow: 1;
  height: 2px;
  background-color: #e2e8f0;
  margin: 0 0.75rem;
  transition: all 0.3s ease;
}

/* Active State */
.step-item.active .step-circle {
  background-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.step-item.active .step-label {
  color: #2563eb;
  font-weight: 700;
}

/* Completed State */
.step-item.completed .step-circle {
  background-color: #10b981;
}

.step-item.completed .step-label {
  color: #10b981;
}

.step-line.completed {
  background-color: #10b981;
}

.create-info-panel {
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem 0.75rem;
  align-content: start; /* PACKS ROWS TIGHTLY AT TOP TO ELIMINATE VERTICAL STRETCH */
  flex-grow: 1;
  overflow-y: auto;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.create-info-panel.active {
  display: grid;
}

/* Compact navigation buttons for grid create panels */
.btn-grid-primary {
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 0.3rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-grid-primary:hover {
  background: #1d4ed8;
}

.btn-grid-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  padding: 0.3rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-grid-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* ---------------------------------------------------- */
/* RESPONSIVE MEDIA QUERIES FOR LAPTOPS, TABLETS, MOBILES */
/* ---------------------------------------------------- */
@media (max-width: 1250px) {
  .os-topbar {
    flex-direction: column !important;
    height: auto !important;
    padding: 0.75rem 1rem !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }
  .hub-nav-tabs {
    width: 100% !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    justify-content: flex-start !important;
    padding: 0.35rem !important;
    display: flex !important;
    gap: 0.35rem !important;
    -webkit-overflow-scrolling: touch;
  }
  .hub-nav-tabs::-webkit-scrollbar {
    display: none !important;
  }
  .hub-controls-section {
    justify-content: space-between !important;
    width: 100% !important;
  }
  .hub-search-wrapper {
    width: 100% !important;
    max-width: 100% !important;
  }
}

@media (max-width: 1024px) {
  /* Dynamic Columns wrapper in wizards & creation views */
  #salesInvoiceCreateView,
  #salesOrderCreateView,
  #purchaseOrderCreateView {
    height: auto !important;
    overflow-y: visible !important;
    flex-direction: column !important;
    gap: 1.25rem !important;
  }
  
  #salesInvoiceCreateView > div[style*="display: grid"],
  #salesOrderCreateView > div[style*="display: grid"],
  #purchaseOrderCreateView > div[style*="display: grid"] {
    grid-template-columns: 1fr !important;
    height: auto !important;
    overflow: visible !important;
  }
  
  .grid-table-card {
    height: auto !important;
    min-height: 220px !important;
    overflow: visible !important;
  }
  
  .scroll-compact {
    max-height: 300px !important;
    overflow-y: auto !important;
    overflow-x: auto !important;
  }

  .launcher-workspace-card {
    padding: 2rem !important;
  }

  .create-info-panel {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (max-width: 900px) {
  .create-info-panel {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .launcher-workspace-card {
    padding: 1.5rem 1rem !important;
    gap: 1.5rem !important;
  }
  .app-drawer-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)) !important;
    gap: 1.5rem 1rem !important;
    width: 100% !important;
  }
  .stepper-wizard-container {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.5rem !important;
  }
  .step-line {
    display: none !important;
  }
}

@media (max-width: 600px) {
  .create-info-panel {
    grid-template-columns: 1fr !important;
  }
  .create-info-panel > div[style*="grid-column"] {
    grid-column: span 1 !important;
  }
  .detail-drawer {
    width: 100% !important;
  }
}

/* ---------------------------------------------------- */
/* TRIP SHEET CUSTOM LAYOUT RULES */
/* ---------------------------------------------------- */
.creation-layout-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.25rem;
}
@media (max-width: 1024px) {
  .creation-layout-grid {
    grid-template-columns: 1fr;
  }
}

.fields-4-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}

.fields-2-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.form-sub-card {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 1rem;
}
.form-sub-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}

.compact-table th, .compact-table td {
  padding: 0.5rem 0.75rem !important;
  font-size: 0.825rem !important;
}

.form-input-compact {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border-glass);
  border-radius: 4px;
  font-size: 0.825rem;
  background: #ffffff;
  color: var(--text-primary);
}
.form-input-compact:focus {
  border-color: var(--accent-primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.btn-action-clear {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-glass);
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-action-clear:hover {
  background: rgba(0, 0, 0, 0.05);
}

.btn-action-add-manual {
  background: transparent;
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-action-add-manual:hover {
  background: rgba(37, 99, 235, 0.05);
}

.btn-action-trash {
  background: transparent;
  color: #dc2626;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.btn-action-trash:hover {
  background: rgba(220, 38, 38, 0.1);
}

/* 3-Dot Action Dropdown Menu */
.grid-action-dropdown {
  position: absolute;
  background: #ffffff;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem 0;
  min-width: 180px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
}
.grid-action-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  background: transparent;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}
.grid-action-item:hover {
  background: rgba(37, 99, 235, 0.05);
  color: var(--accent-primary);
}
.grid-action-item svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: color 0.15s ease;
}
.grid-action-item:hover svg {
  color: var(--accent-primary);
}

/* Custom Modal Overlay to ensure clickability */
.custom-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10005;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  pointer-events: auto !important;
}

/* Table Inline Totals Header Row Style */
.table-totals-row {
  background: rgba(30, 41, 59, 0.6) !important;
  border-bottom: 2.5px solid rgba(139, 92, 246, 0.4) !important;
}

.table-totals-row th {
  padding-top: 0.65rem !important;
  padding-bottom: 0.65rem !important;
  font-size: 0.85rem !important;
  color: #8b5cf6 !important;
  border-bottom: 1.5px solid rgba(139, 92, 246, 0.25) !important;
}

/* Stepper New Layout Styles */
.step-item-new {
  display: flex;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  font-weight: 500;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}
.step-item-new:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}
.step-item-new.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.25);
  font-weight: 700;
}
.step-item-new.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.step-item-new.completed .step-circle-new {
  background: #10b981 !important;
  color: white !important;
}
.step-circle-new {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}
.step-item-new.active .step-circle-new {
  background: var(--accent-primary);
  color: white;
}

.eligibility-card small {
  color: var(--text-muted);
}
.status-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}
.status-badge.eligible {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}
.status-badge.blocked {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Responsive Grid Table layout adaptations for smaller screen/laptops */
.grid-customer-cell {
  font-weight: 600;
  min-width: 150px;
  max-width: 280px;
  white-space: normal !important;
  word-break: break-word;
}

@media (max-width: 1440px) {
  .grid-table th, .erp-grid-table th {
    padding: 0.4rem 0.5rem !important;
    font-size: 0.68rem !important;
  }
  
  .grid-table td, .erp-grid-table td {
    padding: 0.35rem 0.5rem !important;
    font-size: 0.72rem !important;
  }

  .grid-customer-cell {
    max-width: 180px !important;
    min-width: 110px !important;
  }

  .badge-status {
    padding: 0.15rem 0.35rem !important;
    font-size: 0.65rem !important;
  }
  
  /* Make sure columns with links or codes are readable */
  .link-id {
    font-size: 0.72rem !important;
  }
  
  /* Shrink right-aligned cells padding for totals and actions */
  .grid-table td[style*="text-align: right"], .grid-table th[style*="text-align: right"] {
    padding-right: 0.75rem !important;
  }
}





