  :root{
    --navy-950:#082A3D;
    --navy-900:#0C3F58;
    --navy-850:#0F4E6C;
    --teal-600:#12A6A0;
    --teal-500:#1FC3B9;
    --teal-300:#7FE3D6;
    --ink-900:#0E1B22;
    --ink-600:#4C5E67;
    --ink-400:#8298A1;
    --paper:#F5FBFA;
    --line:#E2EEEE;
    --danger:#E4572E;
    --radius-lg:20px;
    --radius-md:12px;
  }
  *{box-sizing:border-box;}
  body input:where([type=checkbox]) {
    appearance: auto;
  }
  body{margin:0;}
  html,body{
    min-height:100vh;
    background:linear-gradient(180deg,#EDF6F5 0%, #F5FBFA 100%);
    font-family:'Inter',sans-serif;
    color:var(--ink-900);
  }
  .page{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:48px 24px;
  }
  .card{
    width:100%;
    max-width:1040px;
    display:grid;
    grid-template-columns:1.05fr 1fr;
    background:#fff;
    border-radius:var(--radius-lg);
    box-shadow:0 30px 70px -30px rgba(8,42,61,0.35);
    overflow:hidden;
  }
  .auth-success,
  .success-message,
  .success{
    color: #096;
    padding: 5px 0;
  }
  .input-error,.error{
    color: #F00;
    padding: 5px 0;
  }
  /* ---------- LEFT PANEL ---------- */
  .brand{
    position:relative;
    background:radial-gradient(120% 140% at 15% 0%, var(--navy-850) 0%, var(--navy-900) 45%, var(--navy-950) 100%);
    color:#fff;
    padding:44px 40px 36px;
    display:flex;
    flex-direction:column;
    overflow:hidden;
  }
  .brand-top{position:relative; z-index:2;}
  .brand-mark{
    display:flex;
    align-items:center;
    gap:10px;
    font-family:'Sora',sans-serif;
    font-weight:700;
    font-size:15px;
    letter-spacing:.02em;
    margin-bottom:38px;
  }
  .brand-mark .dot{
    width:30px;height:30px;border-radius:9px;
    background:linear-gradient(145deg,var(--teal-300),var(--teal-600));
    display:flex;align-items:center;justify-content:center;
    box-shadow:0 6px 16px -4px rgba(31,195,185,0.6);
  }
  .brand-mark .dot svg{width:16px;height:16px;}

  .brand-heading{
    font-family:'Sora',sans-serif;
    font-weight:800;
    font-size:32px;
    line-height:1.15;
    letter-spacing:-0.01em;
    margin:0 0 14px;
  }
  .brand-heading span{color:var(--teal-300);}
  .brand-sub{
    font-size:14.5px;
    line-height:1.65;
    color:#C9DEE1;
    max-width:340px;
    margin:0 0 30px;
  }

  /* animated bottle */
  .bottle-wrap{
    position:absolute;
    right:-18px;
    top:50%;
    transform:translateY(-50%);
    width:230px;
    height:300px;
    z-index:1;
    opacity:0.95;
  }
  .bottle-wrap svg{width:100%;height:100%;display:block;}
  @media (prefers-reduced-motion: reduce){
    .wave{animation:none !important;}
    .bubble{animation:none !important;}
  }
  .wave{
    animation:waveMove 6s linear infinite;
  }
  @keyframes waveMove{
    from{transform:translateX(0);}
    to{transform:translateX(-50%);}
  }
  .bubble{
    animation:bubbleUp 4.5s ease-in infinite;
    opacity:0;
  }
  .bubble.b2{animation-delay:1.4s;}
  .bubble.b3{animation-delay:2.7s;}
  @keyframes bubbleUp{
    0%{transform:translateY(0);opacity:0;}
    10%{opacity:.7;}
    90%{opacity:.4;}
    100%{transform:translateY(-90px);opacity:0;}
  }

  .features{
    position:relative;
    z-index:2;
    margin-top:32px;
    display:flex;
    flex-direction:column;
    gap:12px;
    max-width:300px;
  }
  .feature{
    background:rgba(255,255,255,0.08);
    border:1px solid rgba(255,255,255,0.14);
    backdrop-filter:blur(6px);
    border-radius:var(--radius-md);
    padding:14px 16px;
  }
  .feature-title{
    display:flex;align-items:center;gap:8px;
    font-family:'Sora',sans-serif;
    font-weight:700;
    font-size:14px;
    margin-bottom:4px;
  }
  .feature-title svg{width:16px;height:16px;flex:none;color:var(--teal-300);}
  .feature-desc{
    font-size:12.5px;
    line-height:1.5;
    color:#BFD8DB;
  }

  /* ---------- RIGHT PANEL ---------- */
  .form-side{
    padding:46px 44px 38px;
    display:flex;
    flex-direction:column;
  }
  .form-title{
    font-family:'Sora',sans-serif;
    font-weight:800;
    font-size:27px;
    margin:0 0 6px;
    color:var(--ink-900);
  }
  .form-sub{
    font-size:13.5px;
    color:var(--ink-400);
    margin:0 0 28px;
  }
  label{
    display:block;
    font-size:13px;
    font-weight:600;
    color:var(--ink-900);
    margin-bottom:7px;
  }
  .row-between{
    display:flex;
    align-items:center;
    justify-content:space-between;
  }
  .field{
    display:flex;
    align-items:center;
    border:1.5px solid var(--line);
    border-radius:10px;
    margin-bottom:18px;
    overflow:hidden;
    transition:border-color .15s ease, box-shadow .15s ease;
  }
  .field:focus-within{
    border-color:var(--teal-600);
    box-shadow:0 0 0 4px rgba(18,166,160,0.14);
  }
  .field .icon{
    width:44px;height:44px;
    display:flex;align-items:center;justify-content:center;
    color:var(--ink-400);
    border-right:1.5px solid var(--line);
    flex:none;
  }
  .field:focus-within .icon{color:var(--teal-600);}
  .field input{
    border:none;outline:none;
    width:100%;
    padding:12px 14px;
    font-size:14px;
    font-family:'Inter',sans-serif;
    color:var(--ink-900);
    background:transparent;
  }
  .forgot-link{
    font-size:12.5px;
    font-weight:600;
    color:var(--teal-600);
    text-decoration:none;
  }
  .forgot-link:hover{text-decoration:underline;}

  .remember{
    display:flex;align-items:center;gap:9px;
    font-size:13.5px;
    color:var(--ink-600);
    margin:2px 0 18px;
    user-select:none;
  }
  .remember input[type="checkbox"]{
    width:17px;height:17px;
    accent-color:var(--teal-600);
    border-radius:4px;
  }

  .captcha{
    display:flex;align-items:center;justify-content:space-between;
    border:1.5px solid var(--line);
    border-radius:10px;
    padding:12px 14px;
    margin-bottom:22px;
    background:#FAFEFE;
  }
  .captcha-left{display:flex;align-items:center;gap:10px;}
  .captcha-left input[type="checkbox"]{
    width:19px;height:19px;
    accent-color:var(--teal-600);
    border-radius:4px;
  }
  .captcha-left span{font-size:13.5px;color:var(--ink-600);}
  .captcha-badge{
    width:30px;height:30px;
    border-radius:50%;
    background:conic-gradient(var(--teal-500) 0 60%, var(--line) 0 100%);
    flex:none;
  }

  .btn-primary{
    width:100%;
    border:none;
    background:linear-gradient(135deg,var(--teal-500),var(--teal-600));
    color:#fff;
    font-family:'Sora',sans-serif;
    font-weight:700;
    font-size:15px;
    padding:14px;
    border-radius:11px;
    cursor:pointer;
    box-shadow:0 12px 24px -10px rgba(18,166,160,0.55);
    transition:transform .12s ease, box-shadow .12s ease;
  }
  .btn-primary:hover{transform:translateY(-1px); box-shadow:0 16px 28px -10px rgba(18,166,160,0.6);}
  .btn-primary:active{transform:translateY(0);}
  .btn-primary:focus-visible{outline:3px solid var(--teal-300); outline-offset:2px;}

  .switch-line{
    text-align:center;
    font-size:13px;
    color:var(--ink-400);
    margin-top:20px;
  }
  .switch-line a{
    color:var(--teal-600);
    font-weight:700;
    text-decoration:none;
  }
  .switch-line a:hover{text-decoration:underline;}

  .footer{
    text-align:center;
    margin-top:26px;
    font-size:12px;
    color:var(--ink-400);
  }
  .footer-brand{
    display:flex;align-items:center;justify-content:center;gap:8px;
    margin-top:6px;
    font-family:'Sora',sans-serif;
    font-weight:700;
    font-size:15px;
    color:var(--navy-900);
  }
  .footer-brand .mark{
    width:22px;height:22px;
    border-radius:7px;
    background:linear-gradient(145deg,var(--teal-300),var(--teal-600));
    display:flex;align-items:center;justify-content:center;
  }
  .footer-brand .mark svg{width:12px;height:12px;color:#fff;}
  .footer-tag{font-size:11.5px;color:var(--ink-400);margin-top:2px;}

  @media (max-width:1050px){
    .bottle-wrap {
      display: none;
    }
  }
  @media (max-width:880px){
    .page{padding:0;}
    .card{
      grid-template-columns:1fr;
      border-radius:0;
      max-width:100%;
      min-height:100vh;
    }
    .brand{padding:32px 28px 120px;}
    .bottle-wrap{width:150px;height:190px;right:8px;bottom:16px;top:auto;transform:none;opacity:0.5;}
    .features{max-width:100%;}
    .form-side{padding:34px 26px 40px;}
    .card .form-side {
      order: 1;
    }
    .card .brand {
      order: 2;
    }
  }
  @media (max-width:420px){
    .form-title{font-size:23px;}
    .brand-heading{font-size:26px;}
  }

  /* ---------- shared: form side scroll on short/registration pages ---------- */
  .form-side.tall{padding-top:40px;padding-bottom:32px;}
  .hint{
    font-size:11.5px;
    color:var(--ink-400);
    margin:-12px 0 18px;
  }
  .hint.error{color:var(--danger);}

  /* ---------- Dashboard layout ---------- */
  .dash-wrap{display:flex;min-height:100vh;background:var(--paper);}
  .sidebar{
    width:250px;flex:none;
    background:linear-gradient(180deg,var(--navy-950),var(--navy-900));
    color:#fff;
    padding:22px 18px;
    display:flex;flex-direction:column;
    position:sticky;top:0;height:100vh;
  }
  .sidebar .brand-mark{margin-bottom:34px;font-size:14.5px;}
  .nav-link{
    display:flex;align-items:center;gap:11px;
    padding:11px 12px;
    border-radius:10px;
    font-size:13.5px;font-weight:600;
    color:#B9D3D6;
    text-decoration:none;
    margin-bottom:4px;
    transition:background .15s ease,color .15s ease;
    width: 100%;
    background:transparent;
    border: none;
    cursor: pointer;
  }
  .nav-link svg{width:17px;height:17px;flex:none;}
  .nav-link:hover{background:rgba(255,255,255,0.06);color:#fff;}
  .nav-link.active{
    background:linear-gradient(135deg,var(--teal-500),var(--teal-600));
    color:#fff;
    box-shadow:0 10px 20px -8px rgba(18,166,160,0.6);
  }
  .sidebar-foot{margin-top:auto;font-size:11px;color:#7396A3;}

  /* mobile top row + hamburger + off-canvas sidebar (hidden on desktop) */
  .mobile-topbar{
    display:none;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    background:linear-gradient(180deg,var(--navy-950),var(--navy-900));
    color:#fff;
    padding:14px 18px;
    position:sticky;top:0;z-index:35;
  }
  .mobile-topbar .brand-mark{margin-bottom:0;font-size:13.5px;}
  .hamburger-btn{
    flex:none;
    width:38px;height:38px;
    border-radius:9px;
    border:1px solid rgba(255,255,255,0.18);
    background:rgba(255,255,255,0.08);
    color:#fff;
    display:flex;align-items:center;justify-content:center;
    cursor:pointer;
  }
  .hamburger-btn svg{width:19px;height:19px;}
  .sidebar-close{
    display:none;
    width:32px;height:32px;
    border-radius:8px;
    border:1px solid rgba(255,255,255,0.18);
    background:rgba(255,255,255,0.06);
    color:#fff;
    align-items:center;justify-content:center;
    cursor:pointer;
    margin-left:auto;
  }
  .sidebar-close svg{width:16px;height:16px;}
  .sidebar-overlay{
    display:none;
    position:fixed;inset:0;
    background:rgba(6,18,26,0.55);
    z-index:39;
  }
  .sidebar-overlay.show{display:block;}

  .dash-main{flex:1;min-width:0;}
  .topbar{
    display:flex;align-items:center;justify-content:space-between;
    padding:20px 32px;
    background:#fff;
    border-bottom:1px solid var(--line);
  }
  .topbar h1{
    font-family:'Sora',sans-serif;font-size:21px;margin:0 0 2px;color:var(--ink-900);
  }
  .topbar p{margin:0;font-size:12.5px;color:var(--ink-400);}
  .user-chip{display:flex;align-items:center;gap:10px;}
  .user-chip img{width:38px;height:38px;border-radius:50%;object-fit:cover;border:2px solid var(--teal-300);}
  .user-chip .name{font-size:13.5px;font-weight:700;color:var(--ink-900);line-height:1.2;}
  .user-chip .role{font-size:11.5px;color:var(--ink-400);}

  .dash-body{padding:28px 32px 48px;}
  .welcome-card{
    background:#fff;border:1px solid var(--line);border-radius:var(--radius-md);
    padding:20px 24px;margin-bottom:26px;
    box-shadow:0 8px 24px -18px rgba(8,42,61,0.25);
  }
  .welcome-card h2{margin:0 0 4px;font-family:'Sora',sans-serif;font-size:18px;color:var(--ink-900);}
  .welcome-card p{margin:0;font-size:13px;color:var(--ink-600);}
  .welcome-card b{color:var(--navy-900);}

  .section-title{
    font-family:'Sora',sans-serif;font-weight:800;font-size:16px;
    color:var(--navy-900);margin:0 0 14px;
    padding:10px 14px;
    background:linear-gradient(90deg,#E4F6F5,transparent);
    border-left:4px solid var(--teal-500);
    border-radius:6px;
  }
  .stat-grid{
    display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:30px;
  }
  .stat-card{
    border-radius:var(--radius-md);
    padding:18px 18px 16px;
    border-left:4px solid transparent;
    background:#fff;border:1px solid var(--line);
  }
  .stat-card .label{
    font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;
    margin-bottom:10px;opacity:.85;
  }
  .stat-card .value{font-family:'Sora',sans-serif;font-weight:800;font-size:28px;}
  .stat-card.plain{background:#fff;color:var(--ink-900);border-left-color:var(--teal-500);}
  .stat-card.plain .label{color:var(--ink-400);}
  .stat-card.green{background:#12A6A0;color:#fff;}
  .stat-card.blue{background:var(--navy-850);color:#fff;}
  .stat-card.amber{background:#E4572E;color:#fff;}
  .stat-card.teal{background:linear-gradient(135deg,#1FC3B9,#12A6A0);color:#fff;}

  @media (max-width:1080px){
    .stat-grid{grid-template-columns:repeat(2,1fr);}
  }
  @media (max-width:880px){
    .mobile-topbar{display:flex;}
    .dash-wrap{flex-direction:column;}
    .sidebar{
      position:fixed;top:0;left:0;
      width:270px;max-width:80vw;
      height:100vh;
      flex-direction:column;
      align-items:stretch;
      flex-wrap:nowrap;
      padding:18px 16px;
      transform:translateX(-100%);
      transition:transform .28s ease;
      z-index:40;
      box-shadow:24px 0 48px -20px rgba(4,14,20,0.55);
    }
    .sidebar.open{transform:translateX(0);}
    .sidebar .brand-mark{display:none;}
    .sidebar-close{display:flex;}
    .sidebar-top{display:flex;align-items:center;margin-bottom:22px;}
    .sidebar-top .sidebar-title{
      font-family:'Sora',sans-serif;font-weight:700;font-size:14px;color:#fff;
    }
    .nav-link{padding:11px 12px;}
    .sidebar-foot{display:block;}
    .topbar{padding:16px 20px;}
    .dash-body{padding:20px;}
  }
  @media (max-width:520px){
    .stat-grid{grid-template-columns:1fr;}
  }

  /* ---------- Page head + toolbar (list pages) ---------- */
  .page-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-bottom:20px;}
  .page-head h2{font-family:'Sora',sans-serif;font-size:19px;margin:0;color:var(--ink-900);}
  .page-head p{margin:2px 0 0;font-size:12.5px;color:var(--ink-400);}
  .btn-add{
    display:inline-flex;align-items:center;gap:8px;
    background:linear-gradient(135deg,var(--teal-500),var(--teal-600));
    color:#fff;border:none;padding:11px 18px;border-radius:10px;
    font-weight:700;font-size:13.5px;font-family:'Sora',sans-serif;cursor:pointer;
    text-decoration:none;box-shadow:0 10px 20px -10px rgba(18,166,160,0.6);
    transition:transform .12s ease;
  }
  .btn-add svg{width:16px;height:16px;}
  .btn-add:hover{transform:translateY(-1px);}

  .toolbar{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:18px;}
  .search-box{
    display:flex;align-items:center;gap:8px;
    background:#fff;border:1.5px solid var(--line);border-radius:10px;
    padding:0 12px;flex:1;min-width:200px;
    height: 40px;
  }
  .search-box svg{width:16px;height:16px;color:var(--ink-400);flex:none;}
  .search-box input{border:none;outline:none;padding:10px 0;font-size:13.5px;width:100%;font-family:'Inter',sans-serif;}
  .filter-select{
    border:1.5px solid var(--line);border-radius:10px;padding:10px 14px;
    font-size:13px;font-family:'Inter',sans-serif;color:var(--ink-600);background:#fff;
  }

  /* ---------- Data table ---------- */
  .table-card{
    background:#fff;border:1px solid var(--line);border-radius:var(--radius-md);
    overflow:hidden;box-shadow:0 8px 24px -18px rgba(8,42,61,0.2);
  }
  .table-scroll{overflow-x:auto;}
  table.data-table{width:100%;border-collapse:collapse;min-width:680px;}
  .data-table thead th,.data-table tfoot td{
    text-align:left;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;
    color:var(--ink-400);background:#F5FBFA;padding:13px 18px;border-bottom:1px solid var(--line);white-space:nowrap;
  }
  .data-table tbody td{padding:14px 18px;font-size:13.5px;color:var(--ink-900);border-bottom:1px solid var(--line);white-space:nowrap; max-width: 215px;}
  .data-table tbody tr:last-child td{border-bottom:none;}
  .data-table tbody tr:hover{background:#FAFEFE;}
  .cell-strong{font-weight:700;}
  .cell-muted{color:var(--ink-400);}

  .badge{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;border-radius:99px;font-size:11px;font-weight:700;}
  .badge.green{background:#E1F7F0;color:#0E9166;}
  .badge.amber{background:#FDEBE3;color:#C1441F;}
  .badge.blue{background:#E6F1F8;color:#1D5D8C;}

  .icon-btn{
    width:32px;height:32px;border-radius:8px;border:1px solid var(--line);background:#fff;
    display:inline-flex;align-items:center;justify-content:center;color:var(--ink-600);cursor:pointer;text-decoration:none;
  }
  .icon-btn svg{width:15px;height:15px;}
  .icon-btn:hover{background:#F5FBFA;border-color:var(--teal-500);color:var(--teal-600);}
  .row-actions{display:flex;gap:8px;}

  .pagination{
    display:flex;align-items:center;justify-content:space-between;padding:14px 18px;
    border-top:1px solid var(--line);font-size:12.5px;color:var(--ink-400);flex-wrap:wrap;gap:10px;
  }
  .page-btns{display:flex;gap:6px;}
  .page-btns button{width:30px;height:30px;border-radius:7px;border:1px solid var(--line);background:#fff;font-size:12.5px;cursor:pointer;color:var(--ink-600);}
  .page-btns button.active{background:var(--teal-600);border-color:var(--teal-600);color:#fff;font-weight:700;}

  /* ---------- Form card (Add/Edit pages) ---------- */
  .form-card{
    background:#fff;border:1px solid var(--line);border-radius:var(--radius-md);
    padding:26px 28px;max-width:100%;box-shadow:0 8px 24px -18px rgba(8,42,61,0.2);
  }
  .form-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px 20px;}
  .form-grid .full{grid-column:1/-1;}
  .form-card label{display:block;font-size:12.5px;font-weight:700;color:var(--ink-900);margin-bottom:10px;}
  .form-card input, .form-card select, .form-card textarea{
    width:100%;border:1.5px solid var(--line);border-radius:10px;padding:11px 13px;
    font-size:13.5px;font-family:'Inter',sans-serif;color:var(--ink-900);outline:none;
    transition:border-color .15s ease, box-shadow .15s ease;background:#fff;
  }
  .form-card input:focus, .form-card select:focus, .form-card textarea:focus{
    border-color:var(--teal-600);box-shadow:0 0 0 4px rgba(18,166,160,0.14);
  }
  .form-card textarea{resize:vertical;min-height:80px;}
  .form-total-box{
    grid-column:1/-1;background:#F5FBFA;border:1.5px dashed var(--teal-300);border-radius:12px;
    padding:16px 18px;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;
  }
  .form-total-box .label{font-size:13px;font-weight:700;color:var(--ink-600);}
  .form-total-box .amount{font-family:'Sora',sans-serif;font-weight:800;font-size:22px;color:var(--navy-900);}
  .form-actions{display:flex;gap:12px;margin-top:24px;flex-wrap:wrap;}
  .btn-secondary{
    background:#fff;border:1.5px solid var(--line);color:var(--ink-600);font-weight:700;font-size:13.5px;
    padding:12px 20px;border-radius:10px;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;
  }
  .btn-secondary:hover{border-color:var(--ink-400);}
  .form-actions .btn-primary{flex:none;padding:12px 26px;width:auto;}

  /* ---------- Invoice / print view ---------- */
  .invoice-wrap{max-width:760px;margin:0 auto;}
  .invoice-card{
    background:#fff;border:1px solid var(--line);border-radius:var(--radius-md);
    padding:38px 40px;box-shadow:0 8px 24px -18px rgba(8,42,61,0.2);
  }
  .invoice-top{
    display:flex;justify-content:space-between;align-items:flex-start;flex-wrap:wrap;gap:20px;
    border-bottom:2px solid var(--ink-900);padding-bottom:22px;margin-bottom:22px;
  }
  .invoice-brand{display:flex;align-items:center;gap:10px;font-family:'Sora',sans-serif;font-weight:800;font-size:17px;color:var(--navy-900);}
  .invoice-brand .dot{
    width:32px;height:32px;border-radius:9px;background:linear-gradient(145deg,var(--teal-300),var(--teal-600));
    display:flex;align-items:center;justify-content:center;flex:none;
  }
  .invoice-brand .dot svg{width:17px;height:17px;color:#fff;}
  .invoice-meta{text-align:right;font-size:12.5px;color:var(--ink-400);}
  .invoice-meta .inv-no{font-family:'Sora',sans-serif;font-weight:800;font-size:15px;color:var(--ink-900);margin-bottom:4px;}
  .invoice-parties{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-bottom:26px;}
  .invoice-parties .block-label{font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--ink-400);margin-bottom:6px;}
  .invoice-parties .block-name{font-weight:700;font-size:14px;color:var(--ink-900);margin-bottom:2px;}
  .invoice-parties .block-sub{font-size:12.5px;color:var(--ink-600);line-height:1.5;}
  table.invoice-table{width:100%;border-collapse:collapse;margin-bottom:22px;}
  .invoice-table thead th{text-align:left;font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:#fff;background:var(--navy-900);padding:11px 14px;}
  .invoice-table thead th:last-child, .invoice-table tbody td:last-child{text-align:right;}
  .invoice-table tbody td{padding:13px 14px;font-size:13.5px;border-bottom:1px solid var(--line);}
  .invoice-totals{margin-left:auto;max-width:280px;}
  .invoice-totals .t-row{display:flex;justify-content:space-between;font-size:13.5px;color:var(--ink-600);padding:7px 0;}
  .invoice-totals .t-row.grand{border-top:2px solid var(--ink-900);margin-top:6px;padding-top:12px;font-family:'Sora',sans-serif;font-weight:800;font-size:17px;color:var(--navy-900);}
  .invoice-foot{margin-top:30px;padding-top:18px;border-top:1px dashed var(--line);font-size:12px;color:var(--ink-400);text-align:center;}
  .invoice-actions{display:flex;gap:12px;justify-content:center;margin-top:22px;}

  @media print{
    .mobile-topbar,.sidebar,.sidebar-overlay,.topbar,.invoice-actions{display:none !important;}
    .dash-main{width:100%!important;}
    .dash-body{padding:0!important;}
    .invoice-card{box-shadow:none;border:none;padding:0;}
    body{background:#fff!important;}
  }

  @media (max-width:880px){
    .form-grid{grid-template-columns:1fr;}
    .invoice-card{padding:24px 20px;}
    .invoice-parties{grid-template-columns:1fr;}
  }

  /* ---------- POS-style Sale form ---------- */
  .pos-grid{display:grid;grid-template-columns:1.3fr 1fr;gap:20px;align-items:start;}
  .pos-card{
    background:#fff;border:1px solid var(--line);border-radius:var(--radius-md);
    padding:22px 24px;box-shadow:0 8px 24px -18px rgba(8,42,61,0.2);
  }
  .pos-card h3{
    font-family:'Sora',sans-serif;font-size:15px;margin:0 0 16px;color:var(--ink-900);
    display:flex;align-items:center;gap:8px;
  }
  .pos-card h3 svg{width:17px;height:17px;color:var(--teal-600);}
  .pos-card label{display:block;font-size:12.5px;font-weight:700;color:var(--ink-900);margin-bottom:7px;}
  .pos-card input, .pos-card select, .pos-card textarea{
    width:100%;border:1.5px solid var(--line);border-radius:10px;padding:11px 13px;
    font-size:13.5px;font-family:'Inter',sans-serif;color:var(--ink-900);outline:none;
    transition:border-color .15s ease, box-shadow .15s ease;background:#fff;
  }
  .pos-card input:focus, .pos-card select:focus, .pos-card textarea:focus{
    border-color:var(--teal-600);box-shadow:0 0 0 4px rgba(18,166,160,0.14);
  }
  .pos-card textarea{resize:vertical;min-height:70px;}

  .segmented{display:flex;border:1.5px solid var(--line);border-radius:10px;overflow:hidden;margin-bottom:18px;}
  .segmented button{
    flex:1;padding:11px;background:#fff;border:none;border-right:1.5px solid var(--line);
    font-weight:700;font-size:13.5px;color:var(--ink-600);cursor:pointer;font-family:'Inter',sans-serif;
  }
  .segmented button:last-child{border-right:none;}
  .segmented button.active{background:linear-gradient(135deg,var(--teal-500),var(--teal-600));color:#fff;}

  .add-item-row{display:grid;grid-template-columns:1.4fr 0.8fr 0.8fr auto;gap:10px;align-items:end;margin-bottom:16px;}
  .add-item-row label{font-size:11.5px;}
  .btn-icon-add{
    width:44px;height:44px;border-radius:10px;border:none;
    background:linear-gradient(135deg,var(--teal-500),var(--teal-600));color:#fff;
    display:flex;align-items:center;justify-content:center;cursor:pointer;flex:none;
  }
  .btn-icon-add svg{width:18px;height:18px;}

  table.cart-table{width:100%;border-collapse:collapse;margin-bottom:6px;}
  .cart-table thead th{
    text-align:left;font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;
    color:var(--ink-400);padding:9px 8px;border-bottom:1px solid var(--line);
  }
  .cart-table tbody td{padding:11px 8px;font-size:13px;color:var(--ink-900);border-bottom:1px solid var(--line);}
  .cart-table tbody tr:last-child td{border-bottom:none;}
  .cart-empty{text-align:center;color:var(--ink-400);font-size:12.5px;padding:22px 0;}
  .remove-btn{
    width:26px;height:26px;border-radius:7px;border:1px solid var(--line);background:#fff;
    color:var(--danger);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;
  }
  .remove-btn svg{width:13px;height:13px;}

  .summary-box{border-top:1.5px dashed var(--line);margin-top:8px;padding-top:14px;}
  .summary-row{display:flex;justify-content:space-between;font-size:13.5px;color:var(--ink-600);padding:5px 0;}
  .summary-row.grand{
    font-family:'Sora',sans-serif;font-weight:800;font-size:19px;color:var(--navy-900);
    border-top:2px solid var(--ink-900);margin-top:6px;padding-top:12px;
  }

  .conditional-block{display:none;}
  .conditional-block.show{display:block;}
  .field-note{font-size:11.5px;color:var(--ink-400);}
  .due-preview{
    background:#FDEBE3;border:1.5px dashed #E4572E;border-radius:10px;
    padding:12px 14px;display:flex;justify-content:space-between;align-items:center;
    font-size:13px;color:#C1441F;font-weight:700;margin-top:4px;
  }

  @media (max-width:1080px){
    .pos-grid{grid-template-columns:1fr;}
  }
  @media (max-width:560px){
    .add-item-row{grid-template-columns:1fr 1fr;}
    .add-item-row .btn-icon-add{grid-column:1/-1;width:100%;}
  }

  /* ---------- Customer profile header (Ledger page) ---------- */
  .cust-header{
    display:flex;align-items:center;gap:16px;flex-wrap:wrap;
    background:#fff;border:1px solid var(--line);border-radius:var(--radius-md);
    padding:20px 22px;margin-bottom:22px;box-shadow:0 8px 24px -18px rgba(8,42,61,0.2);
  }
  .cust-avatar{
    width:56px;height:56px;border-radius:50%;flex:none;
    background:linear-gradient(135deg,var(--teal-300),var(--teal-600));color:#fff;
    display:flex;align-items:center;justify-content:center;font-family:'Sora',sans-serif;font-weight:800;font-size:20px;
  }
  .cust-info{flex:1;min-width:180px;}
  .cust-info h3{margin:0 0 3px;font-family:'Sora',sans-serif;font-size:17px;color:var(--ink-900);}
  .cust-info p{margin:0;font-size:12.5px;color:var(--ink-400);}
  .cust-header .badge{flex:none;}

  .text-right{text-align:right;}

  /* ---------- Balance Sheet ---------- */
  .filter-bar{
    display:flex;align-items:end;gap:14px;flex-wrap:wrap;
    background:#fff;border:1px solid var(--line);border-radius:var(--radius-md);
    padding:16px 18px;margin-bottom:22px;box-shadow:0 8px 24px -18px rgba(8,42,61,0.2);
  }
  .filter-bar .fb-field{display:flex;flex-direction:column;gap:6px;}
  .filter-bar label{font-size:11.5px;font-weight:700;color:var(--ink-600);}
  .filter-bar input, .filter-bar select{
    border:1.5px solid var(--line);border-radius:9px;padding:9px 12px;font-size:13px;font-family:'Inter',sans-serif;color:var(--ink-900);
  }

  .balance-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:24px;}
  .balance-card{
    background:#fff;border:1px solid var(--line);border-radius:var(--radius-md);
    padding:20px 22px;box-shadow:0 8px 24px -18px rgba(8,42,61,0.2);
  }
  .balance-card .bc-title{
    display:flex;align-items:center;gap:8px;font-family:'Sora',sans-serif;font-weight:800;
    font-size:14.5px;color:var(--ink-900);margin-bottom:14px;
  }
  .balance-card .bc-title svg{width:17px;height:17px;color:var(--teal-600);flex:none;}
  .bc-row{display:flex;justify-content:space-between;font-size:13px;color:var(--ink-600);padding:7px 0;border-bottom:1px dashed var(--line);}
  .bc-row:last-child{border-bottom:none;}
  .bc-row .val{font-weight:700;color:var(--ink-900);}
  .bc-total{
    display:flex;justify-content:space-between;margin-top:10px;padding-top:10px;
    border-top:2px solid var(--ink-900);font-family:'Sora',sans-serif;font-weight:800;font-size:16px;color:var(--navy-900);
  }

  .pl-card{
    background:linear-gradient(135deg,var(--navy-900),var(--navy-950));color:#fff;
    border-radius:var(--radius-md);padding:26px 28px;margin-bottom:24px;
  }
  .pl-card.loss{background:linear-gradient(135deg,#7A2412,#5A1A0D);}
  .pl-badge{display:inline-block;padding:5px 14px;border-radius:99px;background:rgba(255,255,255,0.15);font-size:11.5px;font-weight:700;margin-bottom:14px;}
  .pl-row{display:flex;justify-content:space-between;font-size:14px;padding:8px 0;border-bottom:1px solid rgba(255,255,255,0.15);}
  .pl-row .val{font-weight:700;}
  .pl-final{
    display:flex;justify-content:space-between;align-items:center;margin-top:14px;padding-top:14px;
    border-top:2px solid rgba(255,255,255,0.4);font-family:'Sora',sans-serif;font-weight:800;font-size:24px;flex-wrap:wrap;gap:8px;
  }

  @media (max-width:1080px){
    .balance-grid{grid-template-columns:1fr;}
  }

  /* ---------- Users / Permissions ---------- */
  .perm-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:6px;}
  .perm-item{
    display:flex;align-items:center;gap:10px;
    border:1.5px solid var(--line);border-radius:10px;padding:11px 13px;background:#fff;
    transition:opacity .15s ease, border-color .15s ease;
  }
  .perm-item input[type="checkbox"]{width:17px;height:17px;accent-color:var(--teal-600);flex:none;}
  .perm-item label{font-size:12.5px;font-weight:600;color:var(--ink-900);margin:0;cursor:pointer;}
  .perm-item.locked{opacity:0.5;}
  .perm-note{
    display:flex;align-items:center;gap:8px;font-size:12px;color:var(--ink-400);
    background:#F5FBFA;border:1px dashed var(--teal-300);border-radius:10px;padding:10px 12px;margin-top:12px;
  }
  .perm-note svg{width:15px;height:15px;color:var(--teal-600);flex:none;}
  .chip-list{display:flex;flex-wrap:wrap;gap:6px;}
  .chip{
    display:inline-flex;align-items:center;padding:3px 9px;border-radius:99px;
    background:#F5FBFA;border:1px solid var(--line);font-size:11px;font-weight:600;color:var(--ink-600);
  }

  @media (max-width:700px){
    .perm-grid{grid-template-columns:1fr 1fr;}
  }
  @media (max-width:460px){
    .perm-grid{grid-template-columns:1fr;}
  }

  /* ---------- Profile page ---------- */
  .profile-card{
    background:#fff;border:1px solid var(--line);border-radius:var(--radius-md);
    padding:26px 28px;max-width:720px;box-shadow:0 8px 24px -18px rgba(8,42,61,0.2);
    display:flex;align-items:center;gap:20px;flex-wrap:wrap;margin-bottom:22px;
  }
  .profile-card img{width:74px;height:74px;border-radius:50%;object-fit:cover;border:3px solid var(--teal-300);flex:none;}
  .profile-card .p-name{font-family:'Sora',sans-serif;font-weight:800;font-size:19px;color:var(--ink-900);margin:0 0 3px;}
  .profile-card .p-role{font-size:12.5px;color:var(--ink-400);margin:0;}
  .profile-card .btn-secondary{margin-left:auto;}

  /* ---------- Branding upload (Settings page) ---------- */
  .upload-row{display:flex;gap:20px;flex-wrap:wrap;}
  .upload-box{
    flex:1;min-width:220px;
    border:1.5px dashed var(--line);border-radius:12px;padding:14px;
    display:flex;align-items:center;gap:14px;background:#FAFEFE;
  }
  .upload-preview{
    width:60px;height:60px;border-radius:10px;flex:none;
    background:#fff;border:1px solid var(--line);
    display:flex;align-items:center;justify-content:center;overflow:hidden;
  }
  .upload-preview.round{border-radius:50%;}
  .upload-preview img{width:100%;height:100%;object-fit:contain;}
  .upload-preview svg{width:22px;height:22px;color:var(--ink-400);}
  .upload-info{flex:1;min-width:0;}
  .upload-info .u-label{font-size:12.5px;font-weight:700;color:var(--ink-900);margin-bottom:4px;}
  .upload-info .u-hint{font-size:11px;color:var(--ink-400);margin-bottom:8px;}
  .upload-info input[type="file"]{font-size:12px;max-width:100%;}

  /* ---------- Stock level bar ---------- */
  .stock-bar{width:100%;height:8px;border-radius:99px;background:var(--line);overflow:hidden;margin-top:8px;}
  .stock-bar-fill{height:100%;border-radius:99px;background:linear-gradient(90deg,var(--teal-500),var(--teal-600));}
  .stock-bar-fill.low{background:linear-gradient(90deg,#E4572E,#C1441F);}
  .stock-bar-label{display:flex;justify-content:space-between;font-size:11px;color:var(--ink-400);margin-top:5px;}

  /* ---------- 404 Error Page ---------- */
  .error-wrap{
    min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px;
    background:linear-gradient(180deg,#EDF6F5 0%, #F5FBFA 100%);
  }
  .error-card{
    max-width:460px;width:100%;text-align:center;background:#fff;
    border:1px solid var(--line);border-radius:var(--radius-lg);
    padding:40px 36px 36px;box-shadow:0 30px 70px -30px rgba(8,42,61,0.3);
  }
  .error-bottle{width:120px;margin:0 auto 18px;}
  .error-code{
    font-family:'Sora',sans-serif;font-weight:800;font-size:64px;line-height:1;
    background:linear-gradient(135deg,var(--teal-500),var(--navy-900));
    -webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;
    margin-bottom:8px;
  }
  .error-title{font-family:'Sora',sans-serif;font-weight:800;font-size:19px;color:var(--ink-900);margin:0 0 8px;}
  .error-desc{font-size:13.5px;color:var(--ink-400);margin:0 0 26px;line-height:1.6;}
  .error-actions{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;}
  .error-actions .btn-primary{width:auto;padding:12px 24px;}
  .error-footnote{margin-top:24px;font-size:11.5px;color:var(--ink-400);}



/* =========================================================
   PROFILE PAGE
   ========================================================= */

.profile-page {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 10px 0 40px;
}


/* =========================================================
   COMMON PROFILE CARD
   ========================================================= */

.profile-information,
.update-password,
.delete-account {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    margin-bottom: 24px;
    overflow: hidden;
}


/* Section inner spacing */
.profile-information > *,
.update-password > *,
.delete-account > * {
    width: 100%;
}


/* =========================================================
   HEADINGS
   ========================================================= */

.profile-page h2 {
    margin: 0;
    color: #111827;
    font-size: 18px;
    font-weight: 700;
}

.profile-page h3 {
    margin: 0;
    color: #111827;
    font-size: 16px;
    font-weight: 700;
}

.profile-page p {
    color: #6b7280;
    font-size: 13px;
    line-height: 1.6;
}


/* =========================================================
   FORM
   ========================================================= */

.profile-page .profile-information,
.profile-page .update-password,
.profile-page .delete-account {
    padding: 24px;
}


/* Form field */
.profile-page label {
    display: block;
    margin-bottom: 7px;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
}


/* Inputs */
.profile-page input[type="text"],
.profile-page input[type="email"],
.profile-page input[type="password"] {
    width: 100%;
    height: 44px;
    padding: 0 13px;

    box-sizing: border-box;

    border: 1px solid #d1d5db;
    border-radius: 8px;

    background: #ffffff;
    color: #111827;

    font-size: 14px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


/* Focus */
.profile-page input[type="text"]:focus,
.profile-page input[type="email"]:focus,
.profile-page input[type="password"]:focus {
    border-color: #2563eb;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.10);
}


/* Disabled */
.profile-page input:disabled {
    background: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
}


/* =========================================================
   FORM GROUP SPACING
   ========================================================= */

.profile-page form > div {
    margin-bottom: 20px;
}

.profile-page form > div:last-child {
    margin-bottom: 0;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.profile-page button,
.profile-page input[type="submit"] {
    min-height: 40px;
    padding: 0 17px;

    border: none;
    border-radius: 8px;

    background: #12a6a0;
    color: #ffffff;

    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition:background 0.2s ease,
    transform 0.1s ease;
}

.profile-page button:hover,
.profile-page input[type="submit"]:hover {
    background: #12a6a0;
}

.profile-page button:active,
.profile-page input[type="submit"]:active {
    transform: translateY(1px);
}


/* =========================================================
   ERROR MESSAGE
   ========================================================= */

.profile-page .text-red-600,
.profile-page .text-red-500 {
    margin-top: 5px;
    color: #dc2626 !important;
    font-size: 12px;
}


/* =========================================================
   SUCCESS MESSAGE
   ========================================================= */

.profile-page .text-green-600,
.profile-page .text-green-500 {
    color: #059669 !important;
    font-size: 13px;
}


/* =========================================================
   DELETE ACCOUNT
   ========================================================= */

.delete-account {
    border-color: #fecaca;
}

.delete-account h2,
.delete-account h3 {
    color: #991b1b;
}

.delete-account button {
    background: #dc2626;
}

.delete-account button:hover {
    background: #b91c1c;
}


/* =========================================================
   PROFILE INFORMATION
   ========================================================= */

.profile-information {
    position: relative;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 768px) {

    .profile-page {
        padding: 0 15px 30px;
        box-sizing: border-box;
    }

    .profile-information,
    .update-password,
    .delete-account {
        margin-bottom: 18px;
        border-radius: 12px;
    }

    .profile-page form {
        padding: 20px;
    }

}


@media (max-width: 480px) {

    .profile-page {
        padding: 0 10px 25px;
    }

    .profile-page form {
        padding: 16px;
    }

    .profile-page input[type="text"],
    .profile-page input[type="email"],
    .profile-page input[type="password"] {
        height: 42px;
    }

    .profile-page button,
    .profile-page input[type="submit"] {
        width: 100%;
    }

}

.settings-heading{
  font-family:'Sora',sans-serif;
  font-size:15px;
  margin:0 0 6px;color:var(--ink-900);
}
.settings-form{
  max-width:100%;
  margin-bottom:24px;
}
.settings-paragraph{
  margin:0 0 20px;
  color:var(--ink-500);
  font-size:13px;
}
.add-role .add-role-wrap{
  display:flex;
  gap:10px;
}
.roles-view-section{
  margin-top:24px;
}
.roles-view-section label{
  margin-bottom:12px;
}
.roles-view-section .wrap{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  padding:12px 14px;
  margin-bottom:8px;
  border:1px solid #e5e7eb;
  border-radius:9px;
  background:#fafafa;
}

.role-name{
  font-size:14px;
  font-weight:600;
  color:var(--ink-900);
}
.role-default{
  margin-left:8px;
  font-size:11px;
  padding:3px 8px;
  border-radius:20px;
  background:#f3f4f6;
  color:#6b7280;
}
.no-role-avilabel{
  padding:20px;
  text-align:center;
  color:#6b7280;
  font-size:13px;
  border:1px dashed #d1d5db;
  border-radius:9px;
}
.default-text{
  font-size:12px;
  color:#9ca3af;
}

.status-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
    vertical-align: middle;
}

.status-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.status-slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: #cbd5e1;
    border-radius: 999px;
    transition: 0.2s;
}

.status-slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
}

.status-switch input:checked + .status-slider {
    background: #16a34a;
}

.status-switch input:checked + .status-slider::before {
    transform: translateX(20px);
}

.status-switch input:disabled + .status-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.status-text {
    margin-left: 8px;
    font-size: 13px;
    font-weight: 600;
}

.status-text.active {
    color: #16a34a;
}

.status-text.inactive {
  color: #F00;
}
.table-card tr.inactive{
  border-bottom: 2px solid #F00;
}
.btn-secondary.trash{
  color: #F00;
  margin-bottom: 10px;
}
.btn-secondary.trash svg,
.btn-secondary.print svg{
  width: 20px;
  margin-right: 10px;
}
input[type="date"]{
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: var(--ink-600);
  background: #fff;
}