/* ═══════════════════════════════════════════════════════════════════════════
   XYNEX DESKTOP — Professional Web Application Layout
   Makes Xynex look like Zoho Books / Tally / QuickBooks — a real website
   ═══════════════════════════════════════════════════════════════════════════ */

@media (min-width: 768px) {

  /* ─── GLOBAL RESETS ─────────────────────────────────────────── */
  * { box-sizing: border-box; }

  body {
    overflow: hidden;
    height: 100vh;
    margin: 0;
    background: #f0f2f5;
  }

  .container {
    max-width: 100% !important;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border-radius: 0;
    box-shadow: none;
  }

  /* ─── SCREEN VISIBILITY ─────────────────────────────────────── */
  .screen { display: none !important; }
  .screen.active { display: flex !important; flex-direction: column; height: 100vh; }

  /* ─── ONBOARDING SCREEN — ULTIMATE DESIGN ───────────────────── */
  @keyframes heroFloat { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }
  @keyframes heroGlow { 0%,100%{box-shadow:0 0 30px rgba(37,211,102,.15)} 50%{box-shadow:0 0 60px rgba(37,211,102,.3)} }
  @keyframes gradientShift { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }
  @keyframes featureSlideIn { from{opacity:0;transform:translateX(-20px)} to{opacity:1;transform:translateX(0)} }
  @keyframes cardFloat { 0%,100%{transform:translateY(0) scale(1)} 50%{transform:translateY(-6px) scale(1.01)} }
  @keyframes shimmer { 0%{background-position:-200% 0} 100%{background-position:200% 0} }
  @keyframes orbitSlow { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }

  #scr-onboard.active {
    display: flex !important;
    flex-direction: row !important;
    background: linear-gradient(135deg, #021B35 0%, #042C53 30%, #0a4a8a 60%, #185FA5 100%);
    background-size: 300% 300%;
    animation: gradientShift 12s ease infinite;
    height: 100vh;
    overflow: hidden;
    position: relative;
  }

  /* Animated background particles */
  #scr-onboard.active::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
      radial-gradient(2px 2px at 15% 20%, rgba(255,255,255,.25), transparent),
      radial-gradient(2px 2px at 85% 15%, rgba(255,255,255,.2), transparent),
      radial-gradient(1.5px 1.5px at 45% 75%, rgba(255,255,255,.15), transparent),
      radial-gradient(2px 2px at 70% 55%, rgba(37,211,102,.2), transparent),
      radial-gradient(1.5px 1.5px at 25% 90%, rgba(255,255,255,.12), transparent),
      radial-gradient(2px 2px at 90% 80%, rgba(37,211,102,.15), transparent),
      radial-gradient(1px 1px at 60% 30%, rgba(255,255,255,.18), transparent),
      radial-gradient(1.5px 1.5px at 35% 45%, rgba(255,255,255,.1), transparent),
      radial-gradient(2px 2px at 55% 10%, rgba(37,211,102,.12), transparent),
      radial-gradient(1px 1px at 80% 40%, rgba(255,255,255,.15), transparent);
    pointer-events: none;
    z-index: 1;
    animation: orbitSlow 120s linear infinite;
  }

  /* Left hero panel — feature showcase */
  #scr-onboard .onb-header {
    position: relative;
    width: 48%;
    min-width: 420px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 50px;
    z-index: 10;
    top: auto;
    left: auto;
  }

  #scr-onboard .onb-header h1 {
    color: #fff;
    font-size: 44px;
    font-weight: 900;
    letter-spacing: -1px;
    margin-bottom: 6px;
    text-shadow: 0 2px 20px rgba(0,0,0,.3);
    text-align: left;
  }

  #scr-onboard .onb-header p {
    color: rgba(255,255,255,0.65);
    font-size: 17px;
    margin-top: 0;
    margin-bottom: 36px;
    font-weight: 400;
    text-align: left;
  }

  /* Feature cards on left panel */
  #scr-onboard .onb-header .hero-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  #scr-onboard .onb-header .hero-feat {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 14px;
    padding: 14px 18px;
    animation: featureSlideIn .6s ease-out backwards;
    transition: all .3s;
  }
  #scr-onboard .onb-header .hero-feat:nth-child(1) { animation-delay:.1s; }
  #scr-onboard .onb-header .hero-feat:nth-child(2) { animation-delay:.25s; }
  #scr-onboard .onb-header .hero-feat:nth-child(3) { animation-delay:.4s; }
  #scr-onboard .onb-header .hero-feat:nth-child(4) { animation-delay:.55s; }
  #scr-onboard .onb-header .hero-feat:nth-child(5) { animation-delay:.7s; }
  #scr-onboard .onb-header .hero-feat:hover {
    background: rgba(255,255,255,.14);
    transform: translateX(6px);
    border-color: rgba(37,211,102,.3);
  }

  #scr-onboard .onb-header .hero-feat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(37,211,102,.2), rgba(37,211,102,.05));
    border: 1px solid rgba(37,211,102,.2);
  }

  #scr-onboard .onb-header .hero-feat-text {
    flex: 1;
  }

  #scr-onboard .onb-header .hero-feat-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
    text-align: left;
  }

  #scr-onboard .onb-header .hero-feat-desc {
    font-size: 11.5px;
    color: rgba(255,255,255,.55);
    line-height: 1.4;
    text-align: left;
  }

  /* Trust bar */
  #scr-onboard .onb-header .hero-trust {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,.1);
  }

  #scr-onboard .onb-header .hero-trust-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: rgba(255,255,255,.5);
    font-weight: 600;
  }

  #scr-onboard .onb-header .hero-trust-item span:first-child {
    font-size: 16px;
  }

  /* Right side — card */
  #scr-onboard .onb-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    z-index: 10;
  }

  #scr-onboard .onb-step {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.1);
    animation: cardFloat 6s ease-in-out infinite;
  }

  #scr-onboard .doc-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  #scr-onboard .doc-card {
    padding: 24px;
    min-height: 100px;
    border-radius: 16px;
    transition: all .3s;
  }
  #scr-onboard .doc-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(4,44,83,.12);
  }

  #scr-onboard .upload-zone {
    padding: 34px;
    margin: 20px 0;
    border-radius: 16px;
    transition: all .3s;
  }
  #scr-onboard .upload-zone:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(24,95,165,.1);
  }

  /* Manual setup form */
  #scr-onboard .form-group { margin-bottom: 16px; }
  #scr-onboard .form-input,
  #scr-onboard select {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 16px;
    font-size: 14px;
  }

  /* Confirmation card in onboarding */
  #scr-onboard .confirm-card {
    max-width: 100%;
  }

  /* ─── LOGIN SCREEN ──────────────────────────────────────────── */
  #scr-login.active {
    display: flex !important;
    flex-direction: row !important;
    background: linear-gradient(135deg, #042C53 0%, #0a4a8a 50%, #1a6fc4 100%);
    height: 100vh;
    overflow: hidden;
    align-items: center;
    justify-content: center;
  }

  /* Left branding panel */
  #scr-login .login-header {
    position: absolute;
    top: 40px;
    left: 50px;
    z-index: 10;
  }
  #scr-login .login-header h1 { color: #fff; font-size: 36px; }
  #scr-login .login-header p { color: rgba(255,255,255,0.7); font-size: 16px; }

  /* Login step containers — the white card */
  #scr-login .login-step {
    display: none;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    margin-left: auto;
    margin-right: 10%;
  }

  #scr-login .login-step.active {
    display: flex !important;
    flex-direction: column !important;
  }

  /* Tab switcher inside login */
  #scr-login .tab-switcher {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
  }
  #scr-login .tab-btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 14px;
    border-radius: 10px;
    text-align: center;
  }

  /* Country code row */
  #scr-login .country-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
  }
  #scr-login .cc-chip { padding: 10px 14px; font-size: 13px; border-radius: 8px; }

  /* Login form inputs */
  #scr-login input[type="tel"],
  #scr-login input[type="email"],
  #scr-login input[type="text"],
  #scr-login input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border-radius: 10px;
  }

  #scr-login .form-group { margin-bottom: 16px; }
  #scr-login .btn { font-size: 15px; padding: 14px; border-radius: 10px; width: 100%; }
  #scr-login .btn-full { display: block; width: 100%; }
  #scr-login .login-divider { text-align: center; margin: 16px 0; font-size: 13px; color: #999; }

  /* OTP inputs */
  #scr-login .otp-inputs { display: flex; gap: 10px; justify-content: center; margin: 16px 0; }

  /* PIN keypad */
  #scr-login .keypad { max-width: 280px; margin: 0 auto; }
  #scr-login .pin-dots { display: flex; gap: 12px; justify-content: center; margin: 16px 0; }

  /* ─── APP SCREEN — MAIN DASHBOARD ──────────────────────────── */
  #scr-app.active {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh;
    overflow: hidden;
    margin-left: 240px;
    background: #f0f2f5;
  }

  /* ─── SIDEBAR NAVIGATION ─────────────────────────────────────── */
  .bottom-nav {
    position: fixed !important;
    left: 0;
    top: 0;
    bottom: 0;
    right: auto;
    width: 240px;
    max-width: none;
    background: linear-gradient(180deg, #042C53 0%, #021a33 100%);
    border-top: none;
    border-right: 1px solid rgba(255,255,255,0.08);
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    margin: 0;
    z-index: 100;
    overflow-y: auto;
  }

  /* Sidebar logo area */
  .bottom-nav::before {
    content: '⚡ Xynex';
    display: flex;
    align-items: center;
    height: 60px;
    padding: 0 20px;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
    letter-spacing: -0.5px;
  }

  .nav-item {
    flex: 0 0 auto;
    padding: 12px 20px;
    margin: 2px 10px;
    text-align: left;
    cursor: pointer;
    color: rgba(255,255,255,0.55);
    font-size: 13px;
    font-weight: 600;
    border: none;
    background: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    transition: all 0.15s;
    border-radius: 8px;
    white-space: nowrap;
  }

  .nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
  }

  .nav-item.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
  }

  .nav-item .nav-icon {
    font-size: 18px;
    min-width: 24px;
    text-align: center;
    flex-shrink: 0;
  }

  .nav-item span:last-child {
    font-size: 13px;
  }

  .nav-badge {
    background: #E24B4A;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 20px;
    min-width: 18px;
    text-align: center;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  /* ─── TOP BAR ────────────────────────────────────────────────── */
  .app-topbar {
    position: sticky;
    top: 0;
    width: 100%;
    height: 60px;
    background: #fff;
    color: var(--text);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    z-index: 50;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  }

  .app-brand {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--blue);
  }

  .app-biz-info {
    text-align: right;
    font-size: 12px;
    flex: 1;
    margin: 0 20px;
    color: var(--text2);
  }

  .app-biz-name {
    font-weight: 700;
    display: block;
    font-size: 14px;
    color: var(--text);
  }

  .app-biz-type { font-size: 11px; opacity: 0.7; }

  .app-user-chip {
    background: var(--blue);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
  }
  .app-user-chip:hover { background: var(--blue2); }

  /* Dark mode toggle */
  .theme-toggle {
    background: #f0f2f5;
    border: 1px solid #e5e7eb;
  }

  /* ─── COMMAND/SEARCH BAR ─────────────────────────────────────── */
  .input-zone {
    position: sticky;
    top: 60px;
    width: 100%;
    padding: 12px 24px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    z-index: 40;
    display: flex;
    gap: 8px;
  }

  .text-input {
    flex: 1;
    padding: 10px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: #f9fafb;
    transition: border-color 0.2s;
  }
  .text-input:focus { border-color: var(--blue); background: #fff; }

  .send-btn {
    border-radius: 8px;
    width: 40px;
    height: 40px;
  }

  /* ─── MAIN CONTENT AREA ──────────────────────────────────────── */
  .app-content {
    flex: 1;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    background: #f0f2f5;
    display: flex;
    flex-direction: column;
  }

  /* ─── PAGES ──────────────────────────────────────────────────── */
  .page {
    display: none;
    padding: 24px;
    flex: 1;
    overflow-y: auto;
    animation: fadeIn 0.2s ease-out;
  }
  .page.active { display: block; }

  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

  .section-title {
    font-size: 16px;
    font-weight: 700;
    margin: 24px 0 12px;
    color: var(--text);
  }

  /* ─── DASHBOARD ──────────────────────────────────────────────── */
  #pg-dash .action-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
  }

  .action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 16px;
    border: none;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    min-height: 110px;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  }
  .action-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
  .action-icon { font-size: 28px; }

  /* Dashboard sales grid */
  .dash-sales-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 28px;
  }

  .stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 22px 24px 18px;
    border: 1px solid rgba(0,0,0,.06);
    box-shadow: 0 2px 12px rgba(0,0,0,.04);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
  }
  .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.08);
  }

  .stat-icon-wrap {
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
  }
  .today-icon { background: var(--blue3); }
  .month-icon { background: #E1F5EE; }
  .year-icon { background: #FFF3E0; }
  .outstanding-icon { background: var(--red2); }

  .stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: #6B7280;
    font-weight: 700;
    margin-bottom: 6px;
  }
  .stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--blue);
    margin: 4px 0 2px;
    line-height: 1.2;
  }
  .stat-value.red { color: var(--red); }
  .stat-value.green { color: var(--green); }
  .stat-subtext {
    font-size: 12px;
    color: #9CA3AF;
    margin-bottom: 12px;
  }

  /* Previous year comparison */
  .stat-prev {
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  .stat-prev-label {
    font-size: 10px;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
  }
  .stat-prev-val {
    font-size: 13px;
    font-weight: 700;
    color: #6B7280;
  }
  .stat-change {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: auto;
  }
  .stat-change.up {
    color: #059669;
    background: #ECFDF5;
  }
  .stat-change.down {
    color: #DC2626;
    background: #FEF2F2;
  }
  .stat-change.flat {
    color: #6B7280;
    background: #F3F4F6;
  }

  /* Legacy compat */
  .stat-cards-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
  }
  .stat-sub { font-size: 12px; color: var(--text2); }

  /* ═══ Order Book Desktop ═══ */
  .orders-header { gap: 16px; }
  .orders-tabs { max-width: 480px; }
  .order-card { padding: 20px 24px; border-radius: 16px; }
  .order-card-customer { font-size: 16px; }
  .order-card-amount { font-size: 22px; }
  .order-card-items { font-size: 13px; }
  .order-actions { gap: 10px; }
  .order-act-btn { padding: 10px 16px; font-size: 12px; border-radius: 12px; }

  .order-items-header { grid-template-columns: 2.5fr 1fr 1fr 1fr 40px; font-size: 11px; }
  .order-line-item { grid-template-columns: 2.5fr 1fr 1fr 1fr 40px; }

  .catalog-link-box .form-input { font-size: 13px; }
  .catalog-qr-wrap svg { width: 200px; height: 200px; }
  .share-buttons-grid { max-width: 400px; }

  /* Activity list */
  .activity-list, .txn-list { list-style: none; padding: 0; margin: 0; }

  .txn-item, .activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 8px;
    transition: background 0.15s;
  }
  .txn-item:hover, .activity-item:hover { background: #f9fafb; }

  .txn-amt.in { color: var(--green); font-weight: 700; }
  .txn-amt.out { color: var(--red); font-weight: 700; }

  /* ─── LEDGER PAGE ────────────────────────────────────────────── */
  #pg-ledger .chip-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
  }

  .chip {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    transition: all 0.15s;
  }
  .chip:hover, .chip.active { background: var(--blue); color: #fff; border-color: var(--blue); }

  .party-card, .item-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    transition: box-shadow 0.15s;
  }
  .party-card:hover, .item-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

  /* ─── STOCK PAGE ─────────────────────────────────────────────── */
  .stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
  }

  /* ─── FORM MODALS — FULL PAGE PREMIUM ─────────────────────────── */
  .form-modal {
    position: fixed;
    top: 0;
    left: 0 !important;
    right: 0;
    bottom: 0;
    width: 100vw !important;
    height: 100vh !important;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%) !important;
    z-index: 9999 !important;
    display: none !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    padding: 0 !important;
    overflow: hidden;
  }
  .form-modal.active { display: flex !important; }

  .form-modal-header {
    padding: 20px 48px !important;
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue2) 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 24px rgba(4,44,83,.18) !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    z-index: 10;
  }
  .form-modal-header h2 { font-size: 22px !important; font-weight: 700; color: #fff !important; }
  .form-modal-header .modal-subtitle { font-size: 13px; opacity: 0.8; }

  .form-modal-close {
    background: rgba(255,255,255,.15) !important;
    color: #fff !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    font-size: 20px !important;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
  }
  .form-modal-close:hover { background: rgba(255,255,255,.25) !important; }

  .form-modal-body {
    flex: 1 !important;
    padding: 32px 48px !important;
    overflow-y: auto !important;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
  }

  .form-modal-footer {
    padding: 18px 48px 24px !important;
    background: linear-gradient(180deg, rgba(248,250,252,0) 0%, #f0f2f5 30%) !important;
    backdrop-filter: blur(12px);
    flex-shrink: 0;
  }
  .form-modal-footer .btn-group {
    max-width: 1100px;
    margin: 0 auto;
  }

  /* Section cards inside modals */
  .modal-section {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,.04);
    border: 1px solid #e5e7eb;
  }
  .modal-section-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 18px;
  }

  .form-group { margin-bottom: 18px; }
  .form-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--blue); margin-bottom: 6px; display: block; }

  .form-input, .form-select {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    background: #fff;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.03);
  }
  .form-input:focus, .form-select:focus {
    border-color: var(--blue);
    outline: none;
    box-shadow: 0 0 0 4px rgba(4,44,83,.08), 0 2px 8px rgba(4,44,83,.06);
  }

  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  /* Line items in sale/purchase forms — desktop premium */
  .line-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 14px;
    background: #fff;
    border-radius: 14px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    border: 1px solid #e5e7eb;
  }
  .line-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,.07); }

  .line-item-gst {
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 0.8fr 1fr 0.4fr !important;
    gap: 10px !important;
    padding: 16px !important;
    background: #fff !important;
    border-radius: 14px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.04) !important;
    border: 1px solid #e5e7eb !important;
    margin-bottom: 10px !important;
  }

  /* Pay type buttons — desktop premium */
  .pay-type-toggle { gap: 12px; }
  .pay-type-btn {
    padding: 14px 24px;
    border-radius: 14px;
    font-size: 14px;
    border: 2px solid #e5e7eb;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.03);
    transition: all 0.2s;
  }
  .pay-type-btn:hover { border-color: var(--blue2); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
  .pay-type-btn.active { border-color: var(--blue); background: linear-gradient(135deg, var(--blue), var(--blue2)); color: #fff; box-shadow: 0 4px 16px rgba(4,44,83,.2); }

  /* Amount display */
  .amount-display { font-size: 28px; padding: 20px; border-radius: 16px; }

  /* GST tax summary & total — desktop */
  .gst-tax-summary { padding: 20px !important; border-radius: 16px !important; }
  .gst-total-box { padding: 22px !important; border-radius: 16px !important; }
  .gst-total-row span:last-child { font-size: 22px !important; }

  /* Sale summary — desktop */
  .sale-summary { padding: 22px; border-radius: 16px; }
  .sale-summary-total { font-size: 22px; }

  /* Buttons in modal footer — desktop */
  .form-modal-footer .btn { border-radius: 14px; font-size: 14px; min-height: 52px; font-weight: 700; }
  .btn-group.three-col { grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

  /* ─── GENERAL MODALS (non-form) ──────────────────────────────── */
  .modal-overlay {
    z-index: 9998;
    left: 0 !important;
    width: 100vw !important;
  }
  .modal-overlay .modal {
    max-width: 480px;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  }

  /* ─── BUTTONS ────────────────────────────────────────────────── */
  .btn { border-radius: 8px; font-size: 14px; padding: 12px 20px; transition: all 0.15s; }
  .btn-primary { box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
  .btn-primary:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.15); transform: translateY(-1px); }

  /* ─── INVOICE SHEET ──────────────────────────────────────────── */
  #inv-sheet {
    width: 480px;
    max-width: 480px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  }

  /* ─── FVP STATUS CARD ────────────────────────────────────────── */
  .fvp-status-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  }

  .fvp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
  }

  .fvp-btn {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  }
  .fvp-btn:hover { border-color: var(--blue); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

  .fvp-log-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 13px;
  }

  /* ─── VOICE FAB ──────────────────────────────────────────────── */
  .voice-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 90;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  }

  .voice-panel {
    position: fixed;
    bottom: 84px;
    right: 24px;
    width: 360px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  }

  /* ─── HIDE MOBILE-ONLY ELEMENTS ──────────────────────────────── */
  .bottom-nav .nav-item .nav-icon { font-size: 18px; }

  /* ─── SCROLLBAR STYLING ──────────────────────────────────────── */
  ::-webkit-scrollbar { width: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 3px; }
  ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

  /* ─── SCHEME & TEAM CARDS ────────────────────────────────────── */
  .scheme-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 8px;
  }

  .team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
  }

  .team-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px;
  }

  /* ─── BANK & UPI PAGES ───────────────────────────────────────── */
  .bank-actions, .btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
  }

  #qr-display {
    max-width: 280px;
    margin: 0 auto;
  }

} /* end @media */

/* ─── LARGE DESKTOPS (1200px+) ─────────────────────────────────── */
@media (min-width: 1200px) {
  #pg-dash .action-grid { grid-template-columns: repeat(4, 1fr); }
  .stat-cards-row { grid-template-columns: repeat(4, 1fr); }
  .fvp-grid { grid-template-columns: repeat(6, 1fr); }
  .stock-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
