:root{
  --ink:#10233f;--muted:#6e7f95;--line:#e4eaf1;--surface:#fff;--canvas:#f3f6fa;
  --navy:#0b2b52;--navy-2:#103d70;--blue:#1769c2;--blue-2:#0f58a7;--green:#16834a;
  --danger:#b42318;--warning:#b26a00;--shadow:0 14px 38px rgba(15,35,64,.08);
  --shadow-lg:0 30px 80px rgba(3,21,44,.22);--radius:18px;
}
*{box-sizing:border-box}html,body{min-height:100%}body{margin:0;background:var(--canvas);font-family:Inter,"Segoe UI",Tahoma,Arial,sans-serif;color:var(--ink);font-size:14px;-webkit-font-smoothing:antialiased}a{color:var(--blue)}a:hover{color:var(--blue-2)}
.btn{border-radius:10px;font-weight:650;min-height:40px;padding:.55rem .95rem}.btn-sm{min-height:32px;padding:.35rem .7rem}.btn-primary{background:linear-gradient(135deg,var(--blue),#0e559f);border-color:transparent;box-shadow:0 7px 18px rgba(23,105,194,.2)}.btn-primary:hover{background:linear-gradient(135deg,#0e5bab,#0b477f);border-color:transparent;transform:translateY(-1px)}.btn-outline-professional{border:1px solid #cad6e4;color:var(--ink);background:#fff}.btn-outline-professional:hover{background:#f6f9fc;border-color:#9fb2c8;color:var(--ink)}
.form-control,.form-select{border:1px solid #d5deea;border-radius:10px;min-height:43px;padding:.62rem .78rem;color:var(--ink);background-color:#fff;box-shadow:none}.form-control:focus,.form-select:focus{border-color:#6ca6de;box-shadow:0 0 0 .22rem rgba(23,105,194,.1)}label{font-weight:650;color:#344861;margin-bottom:.38rem}.form-help{display:block;color:var(--muted);margin-top:.35rem}.ltr-field{direction:ltr;text-align:left}
.card{background:var(--surface);border:1px solid rgba(219,228,239,.8);border-radius:var(--radius);box-shadow:var(--shadow)}.app-alert{border:0;border-radius:12px;box-shadow:0 5px 18px rgba(15,35,64,.05)}

/* Auth experience */
.auth-body{background:#edf3f9}.auth-page{min-height:100vh;display:grid;grid-template-columns:minmax(420px,44%) 1fr;background:#fff}.auth-brand-panel{position:relative;overflow:hidden;padding:38px 48px;display:flex;flex-direction:column;color:#fff;background:linear-gradient(145deg,#061b36 0%,#0b315f 50%,#0d477b 100%)}.auth-brand-panel:before{content:"";position:absolute;width:520px;height:520px;border-radius:50%;right:-230px;top:80px;border:1px solid rgba(255,255,255,.1);box-shadow:0 0 0 75px rgba(255,255,255,.025),0 0 0 150px rgba(255,255,255,.018)}.auth-brand-panel:after{content:"";position:absolute;inset:auto -10% -25% 18%;height:45%;background:radial-gradient(circle,rgba(41,169,105,.18),transparent 68%);pointer-events:none}.auth-brand-top,.auth-brand-copy,.auth-provider{position:relative;z-index:1}.auth-brand-top{display:flex;align-items:flex-start;justify-content:space-between;gap:20px}.brand-lockup,.brand{display:flex;align-items:center;gap:13px}.brand-emblem{width:64px;height:64px;border-radius:19px;display:grid;place-items:center;background:linear-gradient(145deg,#1fa05d,#117a43);color:#fff;font-weight:900;letter-spacing:1.2px;font-size:18px;box-shadow:0 13px 28px rgba(0,0,0,.18),inset 0 1px 0 rgba(255,255,255,.28)}.brand-emblem-sm{width:46px;height:46px;border-radius:14px;font-size:14px}.brand-main-logo{width:64px;height:64px;object-fit:contain;flex:0 0 auto;filter:drop-shadow(0 10px 18px rgba(0,0,0,.18))}.brand-kicker{font-size:12px;text-transform:uppercase;letter-spacing:1.4px;color:#acc7e3;margin-top:7px}.brand-name{font-size:17px;font-weight:800;letter-spacing:.1px}.auth-brand-copy{margin:auto 0;max-width:620px}.auth-brand-copy .eyebrow{display:inline-flex;padding:7px 12px;border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.06);border-radius:999px;font-size:12px;letter-spacing:.4px;color:#dceaf7}.auth-brand-copy h1{font-size:clamp(34px,4vw,58px);line-height:1.06;letter-spacing:-1.5px;margin:20px 0 18px;font-weight:800}.auth-brand-copy>p{font-size:17px;line-height:1.7;color:#bfd0e2;max-width:570px}.auth-feature-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:32px}.auth-feature{display:flex;gap:12px;align-items:center;padding:14px 15px;border:1px solid rgba(255,255,255,.1);background:rgba(255,255,255,.055);border-radius:14px;backdrop-filter:blur(6px)}.feature-icon{width:32px;height:32px;border-radius:10px;display:grid;place-items:center;background:rgba(32,184,105,.18);color:#7be1ad;font-weight:900;flex:0 0 auto}.auth-feature b{display:block;font-size:13px}.auth-feature small{display:block;color:#acc2d8;margin-top:2px;font-size:11px}.auth-provider{margin-top:auto;padding-top:26px;color:#9fb8d1}.auth-provider span{display:block;font-size:10px;text-transform:uppercase;letter-spacing:1.2px}.auth-provider strong{display:block;color:#fff;font-size:13px;letter-spacing:.8px;margin-top:4px}.auth-form-panel{min-width:0;display:flex;flex-direction:column;justify-content:center;padding:38px clamp(24px,5vw,78px);background:radial-gradient(circle at 100% 0,#f5f9fd 0,transparent 35%),#fff}.auth-form-wrap{width:min(660px,100%);margin:auto}.auth-card{background:#fff}.auth-card-login{max-width:500px;margin:auto}.auth-card-wide{max-width:760px;margin:auto}.auth-card-heading{margin-bottom:28px}.auth-card-heading h2{font-size:31px;letter-spacing:-.6px;margin:.35rem 0 .5rem;font-weight:800;color:#112b4b}.auth-card-heading p{color:var(--muted);font-size:14px;line-height:1.65;margin:0}.auth-card-kicker{font-size:11px;text-transform:uppercase;letter-spacing:1.3px;color:var(--blue);font-weight:800}.auth-form .form-field{margin-bottom:15px}.label-row{display:flex;justify-content:space-between;gap:10px;align-items:center}.field-hint{font-size:11px;color:#91a0b2}.input-shell{position:relative}.input-shell .form-control{padding-inline-start:43px}.input-icon{position:absolute;inset-inline-start:14px;top:50%;transform:translateY(-50%);color:#7890aa;font-weight:800;z-index:2}.password-toggle{position:absolute;inset-inline-end:9px;top:50%;transform:translateY(-50%);border:0;background:transparent;color:#71849b;padding:6px 8px}.password-toggle+*{} .auth-submit{width:100%;display:flex;align-items:center;justify-content:center;gap:12px;margin-top:8px;min-height:48px}.auth-divider{display:flex;align-items:center;gap:12px;color:#95a2b0;font-size:11px;margin:24px 0 15px}.auth-divider:before,.auth-divider:after{content:"";height:1px;background:#e4eaf1;flex:1}.security-note{display:flex;gap:10px;align-items:flex-start;margin-top:22px;padding:13px 14px;background:#f3f8fc;border-radius:12px;color:#60738a;font-size:11px;line-height:1.55}.security-note span{color:var(--green);font-weight:900}.security-note p{margin:0}.validation-summary ul{margin:0 0 15px;padding-inline-start:18px}.auth-back-link{text-align:center;margin-top:23px;color:var(--muted);font-size:13px}.auth-back-link a{font-weight:700;text-decoration:none}.auth-footer{text-align:center;color:#94a1b0;font-size:11px;margin-top:30px}.verification-icon{width:62px;height:62px;border-radius:19px;display:grid;place-items:center;margin:0 auto 18px;background:#e9f8f0;color:var(--green);font-size:28px;font-weight:900}.otp-input{text-align:center;font-size:22px;letter-spacing:8px;font-weight:750;direction:ltr}.language-switch{display:flex;gap:5px;align-items:center;padding:4px;background:rgba(255,255,255,.09);border-radius:10px}.language-switch form{margin:0}.language-btn{border:0;background:transparent;color:inherit;border-radius:7px;font-size:11px;font-weight:800;padding:6px 9px;line-height:1.2}.auth-language .language-btn{color:#cfe0f0}.auth-language .language-btn.active{background:#fff;color:#12385f}.language-switch.compact{background:#edf3f8}.language-switch.compact .language-btn{color:#6b7f96}.language-switch.compact .language-btn.active{background:#fff;color:#113c67;box-shadow:0 2px 7px rgba(19,51,84,.11)}

/* Authenticated application */
.app-shell{min-height:100vh;display:grid;grid-template-columns:272px minmax(0,1fr)}.sidebar{position:sticky;top:0;height:100vh;background:linear-gradient(180deg,#081d38,#0c315c);color:#fff;padding:20px 15px;display:flex;flex-direction:column;z-index:30;box-shadow:8px 0 28px rgba(3,24,48,.08)}.sidebar-header{display:flex;align-items:center;justify-content:space-between;padding:1px 7px 18px}.brand{color:#fff}.brand:hover{color:#fff}.brand-copy strong{display:block;font-size:14px}.brand-copy small{display:block;color:#a8bfd6;font-size:10px;margin-top:2px}.sidebar-section-label{font-size:9px;text-transform:uppercase;letter-spacing:1.5px;color:#6f91b2;padding:18px 12px 7px;font-weight:800}.sidebar-nav{display:flex;flex-direction:column;gap:4px}.sidebar-nav .nav-link{display:flex;align-items:center;gap:11px;padding:10px 12px;border-radius:10px;color:#c9d8e7;text-decoration:none;font-weight:600;font-size:13px;transition:.18s ease}.sidebar-nav .nav-link:hover{color:#fff;background:rgba(255,255,255,.07)}.sidebar-nav .nav-link.active{color:#fff;background:linear-gradient(90deg,rgba(47,139,224,.26),rgba(47,139,224,.1));box-shadow:inset 3px 0 0 #50a3ee}.nav-icon{width:23px;height:23px;display:grid;place-items:center;border-radius:7px;background:rgba(255,255,255,.055);font-size:12px}.sidebar-provider{margin-top:auto;padding:16px 11px 4px;border-top:1px solid rgba(255,255,255,.1);display:flex;align-items:center;gap:10px}.provider-dot{width:8px;height:8px;border-radius:50%;background:#35c67a;box-shadow:0 0 0 5px rgba(53,198,122,.1)}.sidebar-provider span{display:block;color:#829fbb;font-size:9px;text-transform:uppercase;letter-spacing:1px}.sidebar-provider strong{display:block;color:#fff;font-size:11px;letter-spacing:.5px;margin-top:2px}.sidebar-close{border:0;background:rgba(255,255,255,.08);color:#fff;border-radius:8px;width:34px;height:34px}.sidebar-overlay{display:none}.main-area{min-width:0;display:flex;flex-direction:column;min-height:100vh}.topbar{height:78px;background:rgba(255,255,255,.94);backdrop-filter:blur(10px);border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;padding:0 28px;position:sticky;top:0;z-index:20}.topbar-left,.topbar-actions{display:flex;align-items:center;gap:12px}.topbar-kicker{display:block;font-size:9px;text-transform:uppercase;letter-spacing:1.4px;color:#8da0b5;font-weight:750}.topbar-title{margin:2px 0 0;font-size:18px;font-weight:800;letter-spacing:-.2px}.status-pill{display:inline-flex;align-items:center;gap:7px;border:1px solid #dce7e1;background:#f2faf6;color:#376a4e;padding:7px 10px;border-radius:999px;font-size:10px;font-weight:750}.status-dot{width:7px;height:7px;background:#22a85e;border-radius:50%;box-shadow:0 0 0 4px rgba(34,168,94,.1)}.user-chip{display:flex;align-items:center;gap:9px;border-inline-start:1px solid #e5ebf2;padding-inline-start:13px}.user-avatar{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:#e8f1fa;color:#174d7d;font-weight:850}.user-meta{max-width:180px}.user-meta strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px}.user-meta span{display:block;color:#8797a9;font-size:9px}.btn-logout{border:1px solid #dde5ee;background:#fff;color:#5b6d82;min-height:34px;font-size:11px}.btn-logout:hover{background:#f7f9fb;border-color:#bdcbd9}.content{padding:28px;flex:1}.app-footer{padding:15px 28px 20px;color:#8998a8;font-size:10px;display:flex;justify-content:space-between;gap:20px;border-top:1px solid rgba(224,231,239,.7)}.menu-toggle{border:1px solid #dbe4ee;background:#fff;border-radius:9px;width:38px;height:38px;color:#36516e}

.metric{height:100%;background:#fff;border:1px solid rgba(219,228,239,.82);border-radius:16px;padding:19px 20px;box-shadow:0 8px 25px rgba(15,35,64,.05);position:relative;overflow:hidden}.metric:after{content:"";position:absolute;width:70px;height:70px;border-radius:50%;background:#edf5fc;right:-26px;top:-26px}.metric.danger:after{background:#fff0ef}.metric span{display:block;color:var(--muted);font-size:11px;font-weight:650;margin-bottom:7px}.metric strong{display:block;font-size:22px;letter-spacing:-.4px}.page-actions{display:flex;gap:9px;align-items:center;flex-wrap:wrap;margin-bottom:16px}.table-responsive{overflow-x:auto}.table{margin-bottom:0;vertical-align:middle}.table thead th{font-size:9px;text-transform:uppercase;letter-spacing:.65px;color:#7d8da0;background:#f8fafc;border-bottom:1px solid #e4ebf2;padding:12px 13px;white-space:nowrap}.table tbody td{padding:12px 13px;border-color:#edf1f5;color:#354960}.table-hover tbody tr:hover>*{background:#f8fbfe}.invoice-grid input{width:112px;border:1px solid #d8e1eb;border-radius:8px;padding:7px}.invoice-grid td:nth-child(2) input{width:210px}.empty-state{padding:50px;text-align:center;max-width:620px;margin:50px auto}.empty-icon{width:62px;height:62px;border-radius:18px;background:#fff2ef;color:#b33a27;display:grid;place-items:center;margin:0 auto 18px;font-size:28px;font-weight:900}.empty-state p{color:var(--muted);margin-bottom:22px}

html[dir="rtl"] body{font-family:"Segoe UI",Tahoma,Arial,sans-serif}html[dir="rtl"] .sidebar-nav .nav-link.active{box-shadow:inset -3px 0 0 #50a3ee}html[dir="rtl"] .auth-brand-panel:before{right:auto;left:-230px}html[dir="rtl"] .auth-brand-panel:after{inset:auto 18% -25% -10%}html[dir="rtl"] .ltr-field,html[dir="rtl"] input[type="email"],html[dir="rtl"] input[type="tel"]{direction:ltr;text-align:right}

@media(max-width:1100px){.topbar-actions .user-meta{display:none}.app-shell{grid-template-columns:238px minmax(0,1fr)}.sidebar{padding-inline:12px}.content{padding:22px}}
@media(max-width:991.98px){.auth-page{grid-template-columns:1fr}.auth-brand-panel{min-height:auto;padding:24px 24px 30px}.auth-brand-copy{margin:45px 0 18px}.auth-brand-copy h1{font-size:36px}.auth-feature-grid{display:none}.auth-provider{display:none}.auth-form-panel{padding:34px 20px}.app-shell{display:block}.sidebar{position:fixed;inset-block:0;inset-inline-start:0;width:270px;transform:translateX(-105%);transition:.22s ease}.sidebar.open{transform:translateX(0)}html[dir="rtl"] .sidebar{transform:translateX(105%)}html[dir="rtl"] .sidebar.open{transform:translateX(0)}.sidebar-overlay{position:fixed;inset:0;background:rgba(7,24,43,.45);z-index:25}.sidebar-overlay.show{display:block}.content{padding:18px}.topbar{padding:0 18px}.status-pill{display:none}}
@media(max-width:680px){.auth-brand-panel{padding:19px}.brand-kicker{display:none}.auth-brand-copy{margin:35px 0 5px}.auth-brand-copy h1{font-size:29px}.auth-brand-copy>p{font-size:14px}.auth-form-panel{padding:28px 17px}.auth-card-heading h2{font-size:26px}.topbar{height:68px}.topbar-title{font-size:15px}.topbar-kicker,.user-chip,.logout-form{display:none}.content{padding:14px}.app-footer{padding:13px 14px;display:block}.app-footer span{display:block;margin:3px 0}.language-switch.compact{margin-inline-start:auto}.metric strong{font-size:19px}}

/* Two-step credential -> OTP login flow */
.login-flow-note{display:flex;align-items:center;gap:12px;margin:6px 0 18px;padding:12px 14px;border:1px solid #dde7f0;background:#f7fafc;border-radius:12px;color:#53677d}.login-flow-note-success{border-color:#cfe9dc;background:#f3fbf7}.login-flow-step{width:28px;height:28px;border-radius:9px;display:grid;place-items:center;flex:0 0 auto;background:#123f6d;color:#fff;font-size:12px;font-weight:800}.login-flow-note-success .login-flow-step{background:#168653}.login-flow-note strong{display:block;color:#173553;font-size:12px}.login-flow-note small{display:block;margin-top:2px;font-size:11px;line-height:1.45;color:#75879a}.otp-stage-card{max-width:500px}.otp-stage-card .auth-card-heading{margin-bottom:20px}

/* ===== Sales Tax Invoice entry workspace ===== */
.invoice-entry-shell{background:#fff;border:1px solid #dbe5ee;border-radius:18px;overflow:hidden;box-shadow:0 18px 45px rgba(15,39,71,.08)}
.invoice-titlebar{display:flex;justify-content:space-between;align-items:center;gap:20px;flex-wrap:wrap;padding:22px 26px;background:linear-gradient(120deg,#073b5c,#0b5f68 58%,#157a6e);color:#fff}
.invoice-titlebar h3{margin:3px 0 4px;font-weight:800;letter-spacing:-.02em}.invoice-titlebar p{margin:0;color:rgba(255,255,255,.78);font-size:.9rem}
.invoice-titlebar-kicker{display:block;font-size:.7rem;font-weight:800;letter-spacing:.16em;color:#9ee9d9}.invoice-title-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.invoice-csv-form{display:flex;gap:7px;align-items:center}.invoice-csv-form .form-control{max-width:230px;background:#fff}
.invoice-section{padding:20px 24px;border-bottom:1px solid #e8eef3}.invoice-header-section{background:#fbfdff}.buyer-section{background:#f8fcfa}.invoice-lines-section{padding-left:0;padding-right:0;padding-bottom:0}
.invoice-section-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px;padding:0 0}.invoice-lines-section .invoice-section-heading{padding:0 24px}
.invoice-section-heading>div{display:flex;align-items:center;gap:10px}.invoice-section-heading strong{display:block;color:#153149;font-size:.95rem}.invoice-section-heading small{display:block;color:#708598;font-size:.76rem;margin-top:2px}.step-number{display:inline-flex;width:34px;height:34px;border-radius:10px;align-items:center;justify-content:center;background:#e4f3ef;color:#0d6b5b;font-size:.76rem;font-weight:800}
.invoice-readonly{background:#f5f8fa!important;color:#27465f!important}.btn-fbr{background:#08775e;border-color:#08775e;color:#fff;white-space:nowrap}.btn-fbr:hover{background:#065f4c;color:#fff}.btn-fbr:disabled{opacity:.65}
.invoice-status-badge{font-size:.75rem;font-weight:700;padding:7px 10px;border-radius:999px}.invoice-status-badge.neutral{background:#eef3f7;color:#546a7c}.invoice-status-badge.success{background:#dcf5e9;color:#136b48}.invoice-status-badge.danger{background:#fde8e8;color:#a12626}.invoice-status-badge.working{background:#fff2cc;color:#7a5b00}
.buyer-fbr-result{min-height:38px;border-radius:9px;padding:9px 11px;background:#eef3f7;color:#526a7d;font-size:.78rem;border:1px solid #e0e8ee}.buyer-fbr-result.success{background:#e8f8ef;color:#176b49;border-color:#bee7ce}.buyer-fbr-result.danger{background:#fff0f0;color:#a13030;border-color:#f1c7c7}.buyer-fbr-result.working{background:#fff7da;color:#765d07;border-color:#f0dc9d}
.invoice-grid-wrap{overflow-x:auto;border-top:1px solid #e4ebf0}.invoice-entry-grid{min-width:2050px;margin-bottom:0;font-size:.76rem}.invoice-entry-grid thead th{position:sticky;top:0;z-index:2;background:#eaf2f5;color:#1e455a;padding:9px 6px;white-space:nowrap;text-align:center;border-color:#d7e1e7;font-weight:800}.invoice-entry-grid td{padding:3px;border-color:#e0e7ec;vertical-align:middle;background:#fff}.invoice-entry-grid tbody tr:hover td{background:#fbfdfd}.invoice-entry-grid .form-control,.invoice-entry-grid .form-select{border:1px solid transparent;border-radius:5px;min-height:32px;padding:4px 6px;font-size:.76rem;background:#fff}.invoice-entry-grid .form-control:focus,.invoice-entry-grid .form-select:focus{border-color:#4ba58e;box-shadow:0 0 0 2px rgba(75,165,142,.12)}.invoice-entry-grid .computed-cell{background:#fffbe8;color:#283c47;font-weight:700;text-align:right}.invoice-entry-grid .lookup-working{background:#fff6d5!important}.invoice-entry-grid .line-description{min-width:190px}.invoice-entry-grid .code-col{min-width:105px}.invoice-entry-grid .desc-col{min-width:210px}.invoice-entry-grid .number-col{min-width:88px}.invoice-entry-grid .unit-col{min-width:150px}.invoice-entry-grid .sn-col{min-width:46px}.invoice-entry-grid .action-col{min-width:46px}.invoice-entry-grid .line-serial{text-align:center;font-weight:800;color:#476577;background:#f6f9fb}.invoice-entry-grid .number-input{text-align:right}.invoice-entry-grid .computed-head{background:#f6efc8}
.invoice-entry-grid tfoot th{background:#163f53;color:#fff;border-color:#244e61;padding:10px 7px;text-align:right;font-size:.8rem}.invoice-total-row th:first-child{letter-spacing:.05em}.invoice-inline-message{min-height:34px;padding:8px 24px;font-size:.8rem;color:#667e8f;background:#fafcfd;border-top:1px solid #e7edf1}.invoice-inline-message.success{color:#136b48;background:#f0fbf5}.invoice-inline-message.danger{color:#a12626;background:#fff5f5}.invoice-inline-message.working{color:#7a5b00;background:#fff9e7}
.invoice-bottom-actions{display:flex;justify-content:space-between;align-items:center;gap:18px;flex-wrap:wrap;padding:20px 24px;background:#f8fafb}.invoice-help-note{display:flex;flex-direction:column;max-width:700px}.invoice-help-note strong{font-size:.82rem;color:#1d4659}.invoice-help-note span{font-size:.75rem;color:#708595;margin-top:2px}
@media(max-width:768px){.invoice-titlebar,.invoice-section,.invoice-bottom-actions{padding:16px}.invoice-lines-section{padding-left:0;padding-right:0}.invoice-lines-section .invoice-section-heading{padding:0 16px}.invoice-title-actions,.invoice-csv-form{width:100%}.invoice-csv-form .form-control{max-width:none;flex:1}.invoice-bottom-actions{align-items:stretch}.invoice-bottom-actions>.d-flex{width:100%}.invoice-bottom-actions .btn{flex:1}}
[dir="rtl"] .invoice-entry-grid .number-input,[dir="rtl"] .invoice-entry-grid .computed-cell{text-align:left}

/* ===== Compact legacy-style invoice item grid =====
   Keep all invoice columns visible on normal desktop widths, while retaining
   horizontal scrolling only on genuinely small screens. */
@media (min-width:1200px){
  .invoice-grid-wrap{overflow-x:hidden}
  .invoice-entry-grid{width:100%;min-width:0;table-layout:fixed;font-size:.66rem}
  .invoice-entry-grid thead th{
    padding:5px 2px;
    font-size:.61rem;
    letter-spacing:.015em;
    line-height:1.08;
    white-space:normal;
    overflow:hidden;
  }
  .invoice-entry-grid td{padding:1px 2px;overflow:hidden}
  .invoice-entry-grid .form-control,
  .invoice-entry-grid .form-select{
    width:100%;
    min-width:0;
    min-height:27px;
    height:27px;
    padding:1px 3px;
    border-radius:3px;
    font-size:.67rem;
    line-height:1.15;
  }
  .invoice-entry-grid .form-select{
    padding-inline-end:15px;
    background-position:right 2px center;
    background-size:10px 8px;
  }
  [dir="rtl"] .invoice-entry-grid .form-select{background-position:left 2px center}
  .invoice-entry-grid .line-description,
  .invoice-entry-grid .code-col,
  .invoice-entry-grid .desc-col,
  .invoice-entry-grid .number-col,
  .invoice-entry-grid .unit-col,
  .invoice-entry-grid .sn-col,
  .invoice-entry-grid .action-col{min-width:0}
  .invoice-entry-grid .line-description{font-size:.64rem}
  .invoice-entry-grid .remove-line{min-height:25px;height:25px;min-width:25px;padding:0 4px;border-radius:4px;font-size:.7rem}
  .invoice-entry-grid tfoot th{padding:6px 2px;font-size:.68rem;white-space:nowrap;overflow:hidden}

  /* Column proportions tuned to the original accounting-entry screen. */
  .invoice-entry-grid th:nth-child(1), .invoice-entry-grid td:nth-child(1){width:2.2%}
  .invoice-entry-grid th:nth-child(2), .invoice-entry-grid td:nth-child(2){width:5.5%}
  .invoice-entry-grid th:nth-child(3), .invoice-entry-grid td:nth-child(3){width:9%}
  .invoice-entry-grid th:nth-child(4), .invoice-entry-grid td:nth-child(4){width:3.8%}
  .invoice-entry-grid th:nth-child(5), .invoice-entry-grid td:nth-child(5){width:5.2%}
  .invoice-entry-grid th:nth-child(6), .invoice-entry-grid td:nth-child(6){width:4.4%}
  .invoice-entry-grid th:nth-child(7), .invoice-entry-grid td:nth-child(7){width:4.4%}
  .invoice-entry-grid th:nth-child(8), .invoice-entry-grid td:nth-child(8){width:4.5%}
  .invoice-entry-grid th:nth-child(9), .invoice-entry-grid td:nth-child(9){width:5.7%}
  .invoice-entry-grid th:nth-child(10), .invoice-entry-grid td:nth-child(10){width:5.2%}
  .invoice-entry-grid th:nth-child(11), .invoice-entry-grid td:nth-child(11){width:3.7%}
  .invoice-entry-grid th:nth-child(12), .invoice-entry-grid td:nth-child(12){width:5%}
  .invoice-entry-grid th:nth-child(13), .invoice-entry-grid td:nth-child(13){width:3.8%}
  .invoice-entry-grid th:nth-child(14), .invoice-entry-grid td:nth-child(14){width:4.8%}
  .invoice-entry-grid th:nth-child(15), .invoice-entry-grid td:nth-child(15){width:3.7%}
  .invoice-entry-grid th:nth-child(16), .invoice-entry-grid td:nth-child(16){width:4.8%}
  .invoice-entry-grid th:nth-child(17), .invoice-entry-grid td:nth-child(17){width:4.3%}
  .invoice-entry-grid th:nth-child(18), .invoice-entry-grid td:nth-child(18){width:3.8%}
  .invoice-entry-grid th:nth-child(19), .invoice-entry-grid td:nth-child(19){width:5.2%}
  .invoice-entry-grid th:nth-child(20), .invoice-entry-grid td:nth-child(20){width:4.7%}
  .invoice-entry-grid th:nth-child(21), .invoice-entry-grid td:nth-child(21){width:4.3%}
  .invoice-entry-grid th:nth-child(22), .invoice-entry-grid td:nth-child(22){width:2.3%}
}

@media (max-width:1199.98px){
  .invoice-grid-wrap{overflow-x:auto}
  .invoice-entry-grid{min-width:1280px}
}

/* Remove browser spinner arrows from invoice numeric fields. */
.invoice-entry-grid input[type="number"]{-moz-appearance:textfield;appearance:textfield}
.invoice-entry-grid input[type="number"]::-webkit-outer-spin-button,
.invoice-entry-grid input[type="number"]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}

/* ===== Selected invoice-row editor =====
   Keep the grid compact, but show every editor in the selected row without
   requiring the user to click each individual field first. */
.invoice-entry-grid tbody .invoice-line-row{cursor:default;transition:background-color .12s ease}
.invoice-entry-grid tbody .invoice-line-row td{transition:background-color .12s ease,border-color .12s ease}
.invoice-entry-grid tbody .invoice-line-row.is-selected td{
  background:#f1fbf8;
  border-top-color:#99d6c7;
  border-bottom-color:#99d6c7;
}
.invoice-entry-grid tbody .invoice-line-row.is-selected .line-serial{
  background:#dff4ee;
  color:#0b6d59;
}
.invoice-entry-grid tbody .invoice-line-row.is-selected .form-control,
.invoice-entry-grid tbody .invoice-line-row.is-selected .form-select{
  border-color:#73bfae;
  background-color:#fff;
  box-shadow:inset 0 0 0 1px rgba(16,124,101,.04);
}
.invoice-entry-grid tbody .invoice-line-row.is-selected .computed-cell{
  border-color:#d8c96a;
  background:#fffbe8;
}
.invoice-entry-grid tbody .invoice-line-row.is-selected .form-control:focus,
.invoice-entry-grid tbody .invoice-line-row.is-selected .form-select:focus{
  border-color:#16866f;
  box-shadow:0 0 0 2px rgba(22,134,111,.14);
}
.invoice-entry-grid tbody .invoice-line-row:not(.is-selected) .form-control,
.invoice-entry-grid tbody .invoice-line-row:not(.is-selected) .form-select{
  border-color:transparent;
  box-shadow:none;
}
.invoice-entry-grid tbody .invoice-line-row:not(.is-selected) .computed-cell{
  background:#fffbe8;
}


/* Sales invoice customer picker */
.customer-picker-modal .modal-content{border:0;border-radius:18px;overflow:hidden;box-shadow:0 24px 70px rgba(12,44,67,.24)}
.customer-picker-modal .modal-header{background:linear-gradient(135deg,#f8fbfc,#eef7f6);border-bottom:1px solid #e3ecef;padding:1.1rem 1.25rem}
.customer-picker-modal .modal-title{font-weight:800;color:#12344d}
.customer-picker-search{background:#fff}
.customer-picker-table-wrap{max-height:56vh}
.customer-picker-table thead th{font-size:.76rem;text-transform:uppercase;letter-spacing:.04em;color:#36556b;white-space:nowrap}
.customer-picker-row{cursor:pointer;transition:background-color .12s ease}
.customer-picker-row:hover,.customer-picker-row:focus{background:#edf8f5;outline:0}
.customer-picker-row td{vertical-align:middle}
.customer-picker-row .customer-select-btn{min-width:76px}
[dir="rtl"] .customer-picker-row .text-end{text-align:left!important}

/* Authenticated organization identity in the top bar. */
.organization-pill {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .organization-pill { max-width: 160px; }
}


/* ===== Prominent authenticated organization identity ===== */
.organization-identity{
    min-width:240px;
    max-width:420px;
    margin-inline:auto 18px;
    padding:8px 15px;
    border:1px solid #cfe0ef;
    border-radius:12px;
    background:linear-gradient(135deg,#edf6ff,#f5fbf9);
    box-shadow:0 5px 16px rgba(13,65,105,.07);
}
.organization-identity-label{
    display:block;
    color:#6d8498;
    font-size:9px;
    font-weight:800;
    letter-spacing:1.2px;
    text-transform:uppercase;
    line-height:1;
    margin-bottom:4px;
}
.organization-identity-name{
    display:block;
    color:#123f64;
    font-size:15px;
    font-weight:900;
    line-height:1.15;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.sidebar-organization{
    margin:0 6px 4px;
    padding:11px 12px;
    border:1px solid rgba(126,184,235,.22);
    border-radius:11px;
    background:rgba(44,126,201,.13);
}
.sidebar-organization span{
    display:block;
    color:#78a7d1;
    font-size:8px;
    font-weight:800;
    letter-spacing:1.3px;
    text-transform:uppercase;
}
.sidebar-organization strong{
    display:block;
    color:#fff;
    font-size:12px;
    font-weight:800;
    margin-top:4px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.organization-otp-form{
    padding:7px 9px;
    border:1px solid #e0e8ef;
    border-radius:10px;
    background:#fbfcfd;
}
@media(max-width:1200px){
    .organization-identity{min-width:190px;max-width:280px;margin-inline:auto 8px}
    .organization-identity-name{font-size:13px}
}
@media(max-width:991.98px){
    .organization-identity{margin-inline-start:auto;min-width:160px;max-width:230px}
}
@media(max-width:680px){
    .organization-identity{min-width:0;max-width:150px;padding:7px 9px;margin-inline-start:auto;margin-inline-end:4px}
    .organization-identity-label{display:none}
    .organization-identity-name{font-size:11px}
}

/* Invoice PDF format picker */
.invoice-pdf-menu { min-width: 320px; }
.invoice-pdf-menu .dropdown-item { white-space: normal; line-height: 1.15; }
.invoice-pdf-menu .dropdown-item small { display: inline-block; margin-top: .2rem; }


/* FBR invoice request/response history and inline print preview */
.invoice-legacy-actions .btn {
    min-width: 132px;
    font-weight: 700;
}

.fbr-json-view {
    margin: 0;
    padding: .9rem 1rem;
    max-height: 420px;
    overflow: auto;
    border: 1px solid #dbe5ea;
    border-radius: .65rem;
    background: #f7fafb;
    color: #12324a;
    font-size: .78rem;
    line-height: 1.45;
    direction: ltr;
    text-align: left;
    white-space: pre-wrap;
    word-break: break-word;
}

.print-preview-shell {
    min-height: calc(100vh - 130px);
}

.invoice-preview-frame {
    width: 100%;
    height: calc(100vh - 255px);
    min-height: 680px;
    border: 1px solid #ccd9df;
    border-radius: .6rem;
    background: #e9eef1;
}

/* Prominent invoice/application feedback */
.app-alert.alert-danger,
.invoice-entry-shell .alert-danger,
.invoice-result-message.alert-danger,
#fbrQueueStatusPanel .alert-danger{
  background:#fff!important;
  color:#b42318!important;
  border:2px solid #dc3545!important;
  border-left-width:6px!important;
  font-weight:700;
  box-shadow:0 8px 22px rgba(180,35,24,.10)!important;
}
.app-alert.alert-success,
.invoice-entry-shell .alert-success,
.invoice-result-message.alert-success,
#fbrQueueStatusPanel .alert-success{
  background:#edfdf3!important;
  color:#137a45!important;
  border:2px solid #27a861!important;
  border-left-width:6px!important;
  font-weight:700;
  box-shadow:0 8px 22px rgba(19,122,69,.10)!important;
}
.invoice-inline-message.danger{
  background:#fff!important;
  color:#b42318!important;
  border:1px solid #dc3545!important;
  border-left-width:5px!important;
  font-weight:700;
}
.invoice-inline-message.success{
  background:#edfdf3!important;
  color:#137a45!important;
  border:1px solid #27a861!important;
  border-left-width:5px!important;
  font-weight:700;
}

/* Buyer FBR registration diagnostics shown directly on the sales-invoice page. */
.buyer-fbr-diagnostics{margin-top:2px;background:#fff;border:1px solid #dfe7ee;border-radius:12px;padding:12px 14px;box-shadow:0 2px 8px rgba(20,48,71,.04)}
.buyer-fbr-diagnostics-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:10px}
.buyer-fbr-diagnostics-head strong{display:block;color:#17344b;font-size:.88rem}.buyer-fbr-diagnostics-head small{display:block;color:#6c8193;font-size:.73rem;margin-top:2px}
.buyer-fbr-diagnostic-card{height:100%;background:#fff;border:1px solid #dfe7ee;border-radius:9px;overflow:hidden}
.buyer-fbr-diagnostic-title{font-size:.72rem;font-weight:800;letter-spacing:.035em;text-transform:uppercase;padding:7px 9px;background:#f7f9fb;border-bottom:1px solid #e7edf2;color:#4a6072}
.buyer-fbr-diagnostic-card pre{margin:0;min-height:96px;max-height:220px;overflow:auto;padding:9px;background:#fff;color:#263b4c;font-size:.72rem;line-height:1.45;white-space:pre-wrap;word-break:break-word;font-family:Consolas,"Courier New",monospace}
.buyer-fbr-endpoint{padding:6px 9px 0;color:#667b8c;font-size:.68rem;font-family:Consolas,"Courier New",monospace;background:#fff}
.buyer-fbr-diagnostic-card.response.success{border-color:#9fd8b7}.buyer-fbr-diagnostic-card.response.success .buyer-fbr-diagnostic-title{color:#176b49;background:#f3fbf6}.buyer-fbr-diagnostic-card.response.success pre{color:#176b49}
.buyer-fbr-diagnostic-card.response.failed{border-color:#e4a5a5}.buyer-fbr-diagnostic-card.response.failed .buyer-fbr-diagnostic-title{color:#b42318;background:#fff}.buyer-fbr-diagnostic-card.response.failed pre{color:#b42318;background:#fff}
.buyer-fbr-diagnostic-card.exception.has-error{border-color:#e4a5a5}.buyer-fbr-diagnostic-card.exception.has-error .buyer-fbr-diagnostic-title{color:#b42318;background:#fff}.buyer-fbr-diagnostic-card.exception.has-error pre{color:#b42318;background:#fff;font-weight:600}
@media(max-width:992px){.buyer-fbr-diagnostics-head{flex-direction:column}.buyer-fbr-diagnostic-card pre{max-height:180px}}

/* Buyer FBR validation details are shown on demand in a modal. */
.buyer-fbr-request-link{display:inline-flex;align-items:center;gap:.35rem;margin-top:.4rem;font-size:.78rem;font-weight:700;color:#0b63a8;text-decoration:none}
.buyer-fbr-request-link:hover{text-decoration:underline;color:#084f86}
#buyerFbrRequestModal .modal-content{border:0;border-radius:16px;box-shadow:0 20px 60px rgba(15,39,58,.22)}
#buyerFbrRequestModal .modal-body{background:#f7fafc}
#buyerFbrRequestModal .buyer-fbr-diagnostic-card{min-height:0}
#buyerFbrRequestModal .buyer-fbr-diagnostic-card pre{max-height:280px;white-space:pre-wrap;word-break:break-word}

/* ===== Themed application error pages ===== */
.app-error-wrap{display:flex;align-items:center;justify-content:center;min-height:calc(100vh - 235px);padding:28px 0}
.app-error-card{width:min(860px,100%);display:flex;align-items:flex-start;gap:24px;padding:34px;background:#fff;border:1px solid #dfe8f1;border-radius:20px;box-shadow:0 18px 48px rgba(15,35,64,.10)}
.app-error-icon{flex:0 0 66px;width:66px;height:66px;border-radius:20px;display:grid;place-items:center;background:#fff1f1;border:1px solid #f1caca;color:#b42318;font-size:34px;font-weight:900;line-height:1;box-shadow:0 8px 22px rgba(180,35,24,.08)}
.app-error-content{min-width:0;flex:1}.app-error-kicker{margin-bottom:7px;color:#b42318;font-size:.72rem;font-weight:850;letter-spacing:.12em;text-transform:uppercase}.app-error-content h2{margin:0;color:#14334f;font-size:1.65rem;font-weight:850;letter-spacing:-.02em}.app-error-message{max-width:680px;margin:11px 0 0;color:#64788b;font-size:.96rem;line-height:1.65}.app-error-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:24px}.app-error-reference{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin-top:24px;padding-top:18px;border-top:1px solid #e9eef3;color:#8191a0;font-size:.73rem}.app-error-reference span{font-weight:750;text-transform:uppercase;letter-spacing:.08em}.app-error-reference code{max-width:100%;overflow-wrap:anywhere;color:#536a7f;background:#f4f7fa;border:1px solid #e4eaf0;border-radius:7px;padding:4px 7px}
.auth-form-panel .app-error-wrap{min-height:auto;padding:0}.auth-form-panel .app-error-card{padding:30px;gap:18px;box-shadow:var(--shadow)}.auth-form-panel .app-error-icon{flex-basis:58px;width:58px;height:58px;border-radius:17px;font-size:29px}.auth-form-panel .app-error-actions .btn{flex:1 1 160px}
@media(max-width:680px){.app-error-wrap{padding:12px 0;align-items:flex-start}.app-error-card{padding:24px 20px;gap:16px;flex-direction:column}.app-error-icon{width:56px;height:56px;flex-basis:56px;border-radius:16px;font-size:28px}.app-error-content h2{font-size:1.4rem}.app-error-actions{width:100%}.app-error-actions .btn{flex:1 1 100%}}


/* ===== IndusCore Technologies application-provider branding ===== */
.provider-brand{min-width:0;width:100%}
.provider-logo{display:block;max-width:100%;height:auto;object-fit:contain;object-position:left center}
.provider-logo-sidebar{width:166px;margin:6px 0 3px}
.sidebar-provider{align-items:flex-start}
.sidebar-provider .provider-brand>span{display:block;color:#829fbb;font-size:9px;text-transform:uppercase;letter-spacing:1px}
.sidebar-provider .provider-brand>strong{display:block;color:#fff;font-size:10px;letter-spacing:.25px;margin-top:3px;font-weight:700}
.provider-logo-auth{width:230px;margin:8px 0 4px}
.auth-provider>strong{font-size:12px;letter-spacing:.45px;margin-top:3px}
@media(max-width:991.98px){.provider-logo-auth{width:205px}}

.audit-json {
    margin: .35rem 0 .7rem;
    padding: .65rem .75rem;
    max-width: 520px;
    max-height: 240px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    background: #f7f9fc;
    border: 1px solid #e2e8f0;
    border-radius: .5rem;
    font-size: .75rem;
}


/* ===== Logged-in IndusCore header branding ===== */
.sidebar-brand-lockup{display:flex;align-items:center;gap:11px;min-width:0}
.sidebar-brand-logo{width:46px;height:46px;object-fit:contain;flex:0 0 46px;filter:drop-shadow(0 7px 13px rgba(0,0,0,.18))}
.sidebar-brand-copy{display:flex;flex-direction:column;min-width:0;line-height:1.15}
.sidebar-brand-kicker{display:block;color:#acc7e3;font-size:8.5px;font-weight:700;letter-spacing:.75px;text-transform:uppercase;white-space:nowrap}
.sidebar-brand-name{display:block;color:#fff;font-size:13px;font-weight:800;letter-spacing:.05px;margin-top:4px;white-space:nowrap}
@media(max-width:1199.98px){.sidebar-brand-kicker{font-size:8px;letter-spacing:.55px}.sidebar-brand-name{font-size:12.5px}}

/* ===== Financial-year selector in authenticated header ===== */
.financial-year-selector{display:flex;align-items:center;gap:8px;min-width:220px;padding:7px 9px;border:1px solid #dce8f2;background:#f7fbff;border-radius:12px;box-shadow:0 4px 14px rgba(19,65,105,.04)}
.financial-year-form{display:grid;grid-template-columns:auto minmax(120px,1fr);align-items:center;gap:1px 8px;min-width:0;flex:1}
.financial-year-label{grid-column:1/-1;color:#7690aa;font-size:8px;font-weight:850;letter-spacing:1.15px;line-height:1;text-transform:uppercase}
.financial-year-select{border:0;background:transparent;color:#123d67;font-size:12px;font-weight:850;min-width:0;max-width:175px;padding:1px 22px 1px 0;outline:0;cursor:pointer}
.financial-year-form small{grid-column:1/-1;color:#7b8fa2;font-size:8.5px;line-height:1.05;white-space:nowrap}
.financial-year-manage{width:28px;height:28px;display:grid;place-items:center;flex:0 0 28px;border-radius:8px;text-decoration:none;color:#4b6e8f;background:#eaf3fb;font-size:12px}
.financial-year-manage:hover{background:#dcecf8;color:#174f80}
.financial-year-empty{justify-content:space-between;color:#526b82;text-decoration:none}.financial-year-empty span{display:flex;flex-direction:column}.financial-year-empty b{font-size:8px;letter-spacing:1px}.financial-year-empty small{font-size:10px}.financial-year-empty strong{font-size:18px;color:#1d6fbd}
@media(max-width:1300px){.financial-year-selector{min-width:190px}.financial-year-select{max-width:145px}.financial-year-form small{display:none}}
@media(max-width:1100px){.financial-year-selector{min-width:165px}.financial-year-select{max-width:120px}.financial-year-manage{display:none}}
@media(max-width:850px){.financial-year-selector{min-width:145px;padding:6px 8px}.financial-year-label{display:none}.financial-year-form{display:block}.financial-year-select{max-width:125px;font-size:11px}}
@media(max-width:680px){.financial-year-selector{margin-inline-start:auto;min-width:130px}.financial-year-select{max-width:112px}}
