:root{--blue:#4273b9;--accent:#008ecc;--navy:#153c69;--ink:#222;--muted:#65758b;--line:#dde5ef;--bg:#f3f6fa;--green:#16836b;--red:#b63535;font-family:Segoe UI,Arial,sans-serif;color:var(--ink);background:var(--bg);font-size:16px}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button,a,input,select,textarea{outline-offset:3px}button{cursor:pointer}a{color:var(--blue)}button{border:1px solid var(--line);background:white;border-radius:8px;padding:10px 15px;color:var(--navy);font-weight:600}button:hover{background:#eaf2fb}button:disabled{opacity:.55;cursor:wait}.primary{background:var(--blue);color:white;border-color:var(--blue)}.primary:hover{background:var(--navy)}.quiet{background:transparent;border-color:transparent}.danger{color:var(--red)}input,select,textarea{width:100%;border:1px solid #bac8d9;padding:11px 12px;border-radius:7px;background:white;color:var(--ink);min-height:44px}label{display:grid;gap:7px;font-size:.875rem;font-weight:600}input:focus,select:focus,textarea:focus{border-color:var(--accent)}.login{min-height:100vh;display:grid;grid-template-columns:1fr 1fr}.brand-panel{background:var(--navy);color:white;padding:8vw 6vw;display:flex;flex-direction:column;justify-content:center;position:relative;border-bottom:10px solid var(--accent)}.brand-panel img{width:120px;height:120px;background:white;border-radius:18px;padding:7px}.brand-panel h1{font-size:clamp(2rem,4vw,3.6rem);letter-spacing:-.04em;line-height:1.05;margin:28px 0 14px}.brand-panel p{color:#d1e3f6;font-size:1.15rem;line-height:1.6;max-width:420px}.brand-panel .branch-tags{display:flex;flex-wrap:wrap;gap:9px;margin-top:30px}.branch-tags span{border:1px solid #6486ae;border-radius:6px;padding:8px 12px;font-size:.875rem}.login-panel{display:flex;align-items:center;justify-content:center;padding:35px}.login-card{width:100%;max-width:390px}.eyebrow{font-size:.8rem;font-weight:700;letter-spacing:.13em;text-transform:uppercase;color:var(--accent)}h2{font-size:1.8rem;letter-spacing:-.04em;margin:12px 0}p.muted,.muted{color:var(--muted)}.login-card form{display:grid;gap:20px;margin-top:28px}.login-card button{margin-top:5px}.fine{font-size:.85rem;line-height:1.5;color:var(--muted)}.shell{display:grid;grid-template-columns:242px minmax(0,1fr);min-height:100vh}.sidebar{background:var(--navy);color:white;position:sticky;top:0;height:100vh;display:flex;flex-direction:column;padding:23px 16px;overflow:auto}.brand{display:flex;align-items:center;gap:11px;padding:0 4px 25px}.brand img{width:48px;height:48px;object-fit:contain;background:white;border-radius:9px;padding:2px}.brand strong{font-size:.93rem;letter-spacing:.025em}.brand small{display:block;font-size:.75rem;color:#bdd0e5;margin-top:4px}.nav-caption{font-size:.72rem;letter-spacing:.12em;color:#96b4d5;margin:17px 12px 9px}.nav{display:grid;gap:5px}.nav button{background:none;border:0;color:#d9e6f5;text-align:left;font-weight:400;padding:12px;display:flex;align-items:center;gap:12px;font-size:.92rem}.nav button.selected{background:#315e93;color:white;border-left:3px solid #48c6ff;padding-left:9px}.nav button:hover{background:#254f80}.nav .icon{width:21px;font-size:1.15rem}.sidebar-foot{margin-top:auto;padding:25px 10px 0;color:#b9cee4;font-size:.78rem}.topbar{background:white;border-bottom:1px solid var(--line);min-height:82px;display:flex;justify-content:space-between;align-items:center;padding:17px 34px;gap:20px}.topbar select{width:min(380px,100%);font-size:.9rem;font-weight:600}.topbar .right{display:flex;align-items:center;gap:12px;font-size:.9rem}.avatar{background:#e7eff9;color:var(--navy);padding:10px 12px;border-radius:50%;font-weight:700}.live{display:inline-flex;align-items:center;gap:7px;color:var(--green);font-size:.8rem}.live:before{content:'';width:7px;height:7px;background:var(--green);border-radius:50%}.workspace{padding:30px 34px;max-width:1600px;margin:auto}.page-head{display:flex;justify-content:space-between;gap:20px;align-items:center;margin-bottom:24px}.page-head h1{font-size:1.85rem;letter-spacing:-.04em;margin:0 0 7px}.page-head p{margin:0;color:var(--muted);font-size:.92rem}.actions{display:flex;gap:9px;align-items:center;flex-wrap:wrap}.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:18px;margin-bottom:23px}.card,.panel{background:white;border:1px solid var(--line);border-radius:12px}.card{padding:22px;box-shadow:0 3px 9px #17375504}.card .label{font-size:.88rem;color:var(--muted)}.card .value{font-size:1.8rem;font-weight:700;letter-spacing:-.04em;margin:13px 0 8px;color:var(--navy)}.card .hint{font-size:.8rem;color:var(--muted)}.panel{overflow:hidden;margin-bottom:22px}.panel-head{display:flex;justify-content:space-between;align-items:center;padding:18px 22px;border-bottom:1px solid var(--line);gap:14px}.panel-head h3{font-size:1rem;margin:0}.panel-body{padding:22px}.columns{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(290px,1fr);gap:22px}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;text-align:left;white-space:nowrap}th{font-size:.78rem;letter-spacing:.025em;font-weight:600;background:#f8fafc;color:var(--muted);padding:14px 20px;border-bottom:1px solid var(--line)}td{font-size:.88rem;padding:15px 20px;border-bottom:1px solid #edf1f6}tr:last-child td{border-bottom:0}tbody tr:hover{background:#fafcff}td button{padding:6px 10px;font-size:.8rem}.badge{border-radius:5px;font-size:.75rem;padding:5px 8px;display:inline-block;color:#52677d;background:#ecf0f5}.badge.posted,.badge.active{background:#e6f5ee;color:#167554}.badge.draft{background:#fff2d7;color:#896622}.empty{text-align:center;color:var(--muted);padding:48px 24px;white-space:normal}.empty strong{display:block;color:var(--ink);font-size:1rem;margin-bottom:8px}.bar{height:8px;background:#eaf0f7;border-radius:5px;overflow:hidden;margin:12px 0 20px}.bar i{height:100%;display:block;background:var(--accent);width:0}.quick-list{display:grid;gap:12px}.quick-list button{text-align:left;padding:14px 16px;font-weight:500}.activity{padding:13px 0;border-bottom:1px solid var(--line);font-size:.875rem}.activity small{display:block;color:var(--muted);margin-top:6px}.banner{background:#e9f3fc;border:1px solid #bfdaf0;border-radius:10px;padding:16px 20px;color:var(--navy);margin-bottom:22px;font-size:.9rem;display:flex;justify-content:space-between;align-items:center;gap:15px}.search{max-width:320px}.error{padding:14px;background:#ffeded;border:1px solid #f4c4c4;color:#9e2525;border-radius:8px;font-size:.9rem;margin:14px 0}.boot{padding:80px;text-align:center;color:var(--muted)}dialog{border:1px solid var(--line);border-radius:14px;box-shadow:0 24px 100px #001a3e33;width:min(960px,calc(100% - 30px));max-height:90vh;padding:0;color:var(--ink)}dialog::backdrop{background:#0b254a88}dialog .modal-head{padding:21px 24px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center}dialog h2{margin:0;font-size:1.35rem}dialog form,.modal-body{padding:24px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.full{grid-column:1/-1}.form-footer{display:flex;justify-content:flex-end;gap:10px;border-top:1px solid var(--line);margin-top:24px;padding-top:20px}.line-grid{display:grid;grid-template-columns:minmax(170px,2fr) 90px 110px 85px 80px 40px;gap:9px;align-items:end;margin:12px 0}.line-grid label{font-size:.75rem}.line-grid input,.line-grid select{font-size:.85rem;padding:9px}.totals{text-align:right;padding:18px 0;font-size:1.2rem;font-weight:700}.check-list label{display:flex;align-items:center;gap:9px;padding:9px 0}.check-list input{width:18px;min-height:18px}#notice{position:fixed;right:25px;bottom:25px;z-index:1000;max-width:420px;background:#183d66;color:white;border-radius:9px;padding:0;box-shadow:0 10px 35px #16314a33}#notice.show{padding:15px 22px}.mobile-menu{display:none}.tab-row{display:flex;gap:8px;padding:12px 20px;border-bottom:1px solid var(--line)}.numeric{text-align:right}.receipt{padding:28px}.receipt-head{display:flex;justify-content:space-between;gap:20px}.receipt-head img{width:90px}.receipt h1{color:var(--navy);font-size:1.8rem}.receipt .meta{display:grid;grid-template-columns:1fr 1fr;gap:15px;margin:25px 0}.receipt table{margin:20px 0}.receipt-total{text-align:right;font-size:1.3rem;font-weight:700}.report-grid{display:grid;grid-template-columns:1fr 1fr;gap:22px}.offline{background:#fff0d9;color:#86591b;padding:10px 20px;text-align:center}.hide{display:none!important}@media(max-width:1150px){.cards{grid-template-columns:1fr 1fr}.columns{grid-template-columns:1fr}.workspace{padding:25px 22px}.topbar{padding:15px 22px}.topbar .user-name{display:none}}@media(max-width:760px){.login{grid-template-columns:1fr}.brand-panel{padding:28px}.brand-panel img{width:70px;height:70px}.brand-panel h1{font-size:2rem;margin:17px 0 0}.brand-panel p,.branch-tags{display:none!important}.login-panel{padding:28px}.shell{display:block}.sidebar{display:none;position:fixed;z-index:90;width:242px;box-shadow:10px 0 40px #1235}.sidebar.open{display:flex}.mobile-menu{display:block}.topbar{padding:12px;gap:10px}.topbar select{font-size:.8rem;max-width:210px}.topbar .avatar,.topbar .live{display:none}.topbar button{font-size:.8rem;padding:9px}.workspace{padding:22px 14px}.page-head{align-items:flex-start}.page-head h1{font-size:1.45rem}.page-head p{font-size:.85rem}.page-head .actions{justify-content:flex-end}.page-head button{font-size:.8rem}.cards{gap:10px}.card{padding:16px}.card .value{font-size:1.45rem}.card .label{font-size:.78rem}.form-grid,.report-grid{grid-template-columns:1fr}.full{grid-column:auto}.line-grid{grid-template-columns:1fr 1fr 1fr;gap:8px;border-bottom:1px solid var(--line);padding-bottom:16px}.line-grid label:first-child{grid-column:1/-1}.banner{align-items:flex-start;flex-direction:column}.receipt{padding:12px}.receipt .meta{grid-template-columns:1fr}.topbar .right{gap:0}th,td{padding:12px 14px}dialog form,.modal-body{padding:18px}}@media print{body{background:white}.shell,.login,#notice{display:none!important}dialog[open]{position:static;display:block;border:0;box-shadow:none;max-height:none;width:100%;margin:0}dialog::backdrop{display:none}.modal-head,.form-footer,.no-print{display:none!important}dialog .modal-body{padding:0}.receipt table{white-space:normal}.receipt{padding:0}}

.receipt{background:#fff;color:#23334a;padding:28px}.document-brand{display:flex;justify-content:space-between;gap:24px;padding-bottom:24px;border-bottom:4px solid #4273b9}.document-company{display:flex;align-items:center;gap:16px}.document-company img{width:76px;height:76px;object-fit:contain}.document-company strong{display:block;font-size:19px;color:#153c69}.document-company span{display:block;font-size:11px;margin-top:7px;overflow-wrap:anywhere}.document-title{text-align:right;max-width:45%}.document-title h1{font-size:24px;letter-spacing:.04em;margin:6px 0 12px}.document-title p{font-size:13px;color:#65758b}.document-status{padding:8px 12px;font-size:11px;letter-spacing:.1em;background:#e6f5ee;color:#167554;margin-top:16px;display:inline-block}.document-status.is-draft{background:#fff2d7;color:#896622}.document-meta{display:grid;grid-template-columns:1fr 1fr;gap:30px;margin:28px 0}.document-meta h2{font-size:20px;line-height:1.4}.document-meta dl,.document-amounts{display:grid;grid-template-columns:1fr auto;gap:12px 24px;font-size:13px;margin:0}.document-meta dt{color:#65758b}.document-meta dd,.document-amounts dd{margin:0;text-align:right;font-variant-numeric:tabular-nums}.receipt table{white-space:normal;width:100%;margin:20px 0}.receipt th{background:#153c69;color:white;font-size:10px;padding:12px 9px}.receipt td{padding:12px 9px;font-size:11px;overflow-wrap:anywhere}.invoice-document th:nth-child(n+3),.invoice-document td:nth-child(n+3){text-align:right;font-variant-numeric:tabular-nums}.invoice-document th:nth-child(2){width:29%}.document-bottom{display:grid;grid-template-columns:1fr 300px;gap:30px;margin-top:24px}.document-bottom h3{font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:#65758b}.document-bottom p{font-size:12px;white-space:pre-wrap;overflow-wrap:anywhere}.document-amounts .grand{border-top:1px solid #b8cce4;padding-top:12px;font-size:16px;font-weight:700;color:#153c69}.signature-row{display:flex;justify-content:space-between;gap:24px;margin-top:65px}.signature-row span{border-top:1px solid #a3b4c9;padding-top:10px;width:30%;font-size:10px;color:#65758b}.document-footer{display:flex;justify-content:space-between;gap:15px;margin-top:32px;padding-top:13px;border-top:1px solid #dde5ef;font-size:10px;color:#65758b}.report-print-content>.page-head,.report-print-content>.panel:has(#report-filter){display:none}.report-document .report-grid{grid-template-columns:1fr}.report-document .card .value{font-size:19px}.report-document .panel{border-radius:0}.report-document .panel-head h3{color:#153c69}.report-document .cards{margin-top:24px}.report-document .table-wrap{overflow:visible}.report-document td:last-child,.report-document th:last-child{text-align:right}.report-document .card{box-shadow:none;border-top:3px solid #4273b9}.report-document .report-totals .card .label{font-size:11px}.report-document .report-totals .card{padding:13px}
@media(max-width:600px){.document-brand,.document-meta,.document-bottom{display:block}.document-title{max-width:none;text-align:left;margin-top:18px}.document-meta dl{margin-top:20px}.document-amounts{margin-top:24px}.document-company strong{font-size:16px}.document-company img{width:58px;height:58px}.receipt{padding:8px}.document-footer{flex-direction:column}.signature-row{gap:10px}.receipt td,.receipt th{padding:8px 4px;font-size:10px}}
@media print{@page{size:A4;margin:14mm}html,body{height:auto!important;overflow:visible!important}dialog[open]{overflow:visible!important;max-width:none!important;max-height:none!important;position:static!important}.modal-body{overflow:visible!important}.receipt{font-size:11px;print-color-adjust:exact;-webkit-print-color-adjust:exact}.receipt .table-wrap{overflow:visible}.receipt table{table-layout:auto}.receipt thead{display:table-header-group}.receipt tr{break-inside:avoid}.receipt .panel{overflow:visible;border:0}.receipt .card,.document-brand,.document-meta,.document-bottom,.signature-row,.document-footer{break-inside:avoid}.receipt .report-grid{display:block}.receipt .panel-head{break-after:avoid}.receipt .cards{display:grid;grid-template-columns:repeat(4,1fr)}.receipt .document-meta{display:grid;grid-template-columns:1fr 1fr}.receipt .document-bottom{display:grid;grid-template-columns:1fr 280px}.receipt .document-brand{display:flex}.receipt .document-title{text-align:right;max-width:45%}.receipt .document-footer{flex-direction:row}.receipt button,.receipt form{display:none!important}}

.line-grid{grid-template-columns:minmax(150px,1.4fr) minmax(190px,2fr) 80px 100px 85px 80px 40px}.line-description input{min-width:0}@media(max-width:1000px){.line-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.line-grid label:first-child,.line-grid .line-description{grid-column:1/-1}}

.line-grid{grid-template-columns:minmax(170px,2fr) 70px minmax(90px,1fr) minmax(90px,1fr);padding:16px;border:1px solid var(--line);border-radius:10px}.line-grid .line-description{grid-column:1/-1}.invoice-document th:nth-child(2){width:auto}.invoice-document th:nth-child(n+3),.invoice-document td:nth-child(n+3){text-align:left}.invoice-document th:nth-child(2),.invoice-document td:nth-child(2),.invoice-document th:nth-child(n+6),.invoice-document td:nth-child(n+6){text-align:right}.invoice-document th:nth-child(5){width:24%}@media(max-width:760px){.line-grid{grid-template-columns:1fr 1fr}.line-grid label:first-child,.line-grid .line-description{grid-column:1/-1}}

.sales-document th:nth-child(3),.sales-document td:nth-child(3){text-align:left}.sales-document th:nth-child(n+4),.sales-document td:nth-child(n+4){text-align:right}.sales-document th:nth-child(5){width:auto}.sales-document th:nth-child(3){width:30%}

.cashbook-date-controls{display:flex;align-items:flex-end;gap:8px}.cashbook-date-controls button{min-width:42px;font-size:20px}.cashbook-opening{margin-left:auto;display:flex;flex-direction:column;gap:4px;padding:12px 20px;background:#edf5fc;border:1px solid #c7d9ec;border-radius:8px}.cashbook-opening strong{font-size:22px;color:#173d65}.cashbook-opening small{color:#526477}@media(max-width:700px){.cashbook-opening{margin-left:0;width:100%}.cashbook-filter{align-items:stretch}}

.daybook-sheet{background:white;color:#000;padding:22px;font-family:'Times New Roman',serif}.daybook-heading,.daybook-subheading{display:flex;justify-content:space-between;gap:20px;margin-bottom:10px}.daybook-heading{font-size:17px}.daybook-subheading{font-size:13px}.daybook-table{width:100%;table-layout:fixed;border-collapse:collapse;font-size:12px}.daybook-table th{background:#1676e8!important;color:white!important;padding:6px 3px;text-transform:none}.daybook-table td{padding:4px 3px;white-space:normal;overflow-wrap:anywhere;border-bottom:1px dotted #bbb;vertical-align:top}.daybook-table .number{text-align:right;white-space:nowrap}.daybook-table .daybook-section td{font-weight:bold;border:0;color:navy;padding-top:10px}.daybook-section td:last-child{text-align:right;color:black}.daybook-table .daybook-total td{border-top:1px solid black;border-bottom:0;font-weight:bold}.daybook-grand td{border-top:3px double #888;font-weight:bold;font-size:15px;text-align:right}.daybook-table tbody tr:hover{background:transparent}@media print{.daybook-sheet{padding:0}.daybook-table{font-size:9pt}.daybook-table th{-webkit-print-color-adjust:exact;print-color-adjust:exact}.daybook-table thead{display:table-header-group}.daybook-table tbody{break-inside:auto}.daybook-table tr{break-inside:avoid}.daybook-heading{font-size:12pt}.daybook-subheading{font-size:9pt}}

@media print{body:has(.daybook-sheet){background:white!important}.daybook-sheet .daybook-section td:last-child{white-space:nowrap}@page{ @bottom-right{content:"Page " counter(page);font:9pt Times New Roman;} }}

.sale-entry-header{background:#edf6ff;border:2px solid #2588e8;border-radius:8px;padding:18px}.sale-entry-header label{color:#173d65;font-weight:600}.sale-entry-header #return-source{grid-column:1/-1}.line-grid>input[type=hidden]{display:none}

.sale-entry-header{background:#238bf0;border-color:#1459a4}.sale-entry-header label,.sale-entry-header .fine{color:white}.sale-entry-header input,.sale-entry-header select{background:white;color:#172b43;font-weight:400}

@media(min-width:1100px){dialog:has(.sale-entry-header){width:1400px;max-width:96vw}.sale-entry-header{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.sale-entry-header label:has([name=serial]){order:-4}.sale-entry-header label:has([name=date]){order:-3}.sale-entry-header label:has([name=payment_choice]){order:-2}.sale-entry-header label:has([name=invoice_type]){order:-1}dialog:has(.sale-entry-header) .line-grid{grid-template-columns:minmax(170px,1.4fr) 70px minmax(220px,2fr) 110px 100px 100px 40px;gap:10px}dialog:has(.sale-entry-header) .line-description{grid-column:auto}}@media(max-width:760px){.line-grid label:has([data-field=item_id]){grid-column:1/-1}}

.sale-extra-details{grid-column:1/-1;order:2;color:white}.sale-extra-details summary{cursor:pointer;font-size:14px;padding:4px 0}.sale-extra-details>.form-grid{margin-top:12px}.invoice-items-heading{display:flex;align-items:center;gap:18px;margin:14px 0 8px}.invoice-items-heading h3{margin:0}.invoice-items-heading span{font-size:13px;color:#526477}dialog:has(.sale-entry-header) .line-grid label{min-width:0}dialog:has(.sale-entry-header) .line-grid select{min-width:0}@media(min-width:761px){.sale-entry-header{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:14px}.sale-entry-header input,.sale-entry-header select{padding:8px;min-height:38px}dialog:has(.sale-entry-header){width:1400px;max-width:96vw}dialog:has(.sale-entry-header) .modal-head{padding:14px 20px}dialog:has(.sale-entry-header) form{padding:18px}}@media(max-width:760px){.invoice-items-heading{display:block}.invoice-items-heading span{display:block;margin-top:6px}}

.stock-availability{color:#176954;font-size:12px;font-weight:600;white-space:normal}@media print{.stock-availability{display:none!important}}

.sale-entry-header label[hidden]{display:none!important}

.account-heads{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:20px}.account-head{border:2px solid #1765ad;background:#eff8ff;border-radius:8px;overflow:hidden;padding-bottom:12px}.account-head h3{margin:0;padding:12px;background:#1765ad;color:white}.account-head td{padding:8px}.account-head tbody tr:nth-child(even){background:#d9effc}.account-head .table-wrap{max-height:320px;overflow:auto}.account-list-heading{display:flex;justify-content:space-between;align-items:center}@media(max-width:800px){.account-heads{grid-template-columns:1fr}}

.account-context-menu{position:fixed;z-index:10000;background:white;border:1px solid #8497ac;box-shadow:0 6px 24px #0003;min-width:175px;padding:5px;border-radius:5px}.account-context-menu button{display:block;width:100%;text-align:left;border:0;background:white;padding:9px 16px;color:#183d66}.account-context-menu button:hover,.account-context-menu button:focus{background:#d9efff}@media print{.account-context-menu{display:none}}

.sale-entry .line-grid:has(.sale-line-number),.line-grid:has(.sale-line-number){grid-template-columns:24px minmax(150px,2fr) minmax(180px,2.5fr) minmax(60px,.7fr) repeat(3,minmax(70px,1fr)) 32px}.sale-line-number{align-self:center;font-weight:700}@media(max-width:800px){.line-grid:has(.sale-line-number){grid-template-columns:repeat(2,minmax(0,1fr))}}

/* White brand mark on the original logo blue, login and workspace. */
.brand-panel,.sidebar{background:#4273b9;color:#fff}
.brand-panel img,.sidebar .brand img{filter:grayscale(1) invert(1) contrast(20);mix-blend-mode:screen;background:#fff;border-radius:0}
.brand-panel p,.sidebar .brand strong,.sidebar .brand small,.sidebar .nav-caption,.sidebar .sidebar-foot,.sidebar .nav button{color:#fff}
.branch-tags span{border-color:rgba(255,255,255,.65)}
.sidebar .nav button.selected{background:rgba(0,0,0,.22);border-left-color:#fff}
.sidebar .nav button:hover{background:rgba(0,0,0,.15)}


/* Match the sidebar to the installed app title bar. */
.sidebar{background:#153c69}


.sample-invoice{font-family:"Times New Roman",serif;color:#000;background:white;padding:0!important;font-size:12px;max-width:100%;border:0!important}.sample-letterhead{display:block;width:100%;height:auto;margin:0 0 10px}.sample-meta{display:grid;grid-template-columns:2fr 1fr;gap:8px 20px;margin:12px 0}.sample-meta>div{display:flex;gap:8px;min-width:0}.sample-meta b{white-space:nowrap}.sample-meta span{flex:1;border-bottom:1px solid #222;overflow-wrap:anywhere}.sample-invoice .sample-items{width:100%;border-collapse:collapse;table-layout:fixed;font-size:11px}.sample-invoice .sample-items th{background:#e2e2e2;color:black;padding:7px 3px;border:0;white-space:normal}.sample-invoice .sample-items td{padding:7px 3px;border:0;border-bottom:1px dotted #aaa;white-space:normal;overflow-wrap:anywhere}.sample-items th:nth-child(1){width:5%}.sample-items th:nth-child(2){width:18%}.sample-items th:nth-child(3){width:28%}.sample-items th:nth-child(4){width:6%}.sample-items th:nth-child(n+5){width:10.75%}.sample-items td:nth-child(n+4){text-align:right}.sample-totals{border-top:1px solid black;margin-top:6px;break-inside:avoid}.sample-totals>div{display:flex;justify-content:space-between;gap:12px;width:53%;margin-left:auto;padding:4px}.sample-totals>div:nth-child(4),.sample-totals>div:nth-child(6){border-top:1px solid black}.sample-note{font-size:17px;text-align:left;border-top:1px solid #000;margin:7px 0}.sample-staff{border-top:1px solid #888;padding-top:7px;font-size:10px;break-inside:avoid}.sample-draft{font-weight:bold;text-align:center}@media print{.sample-invoice{font-size:10pt}.sample-invoice .sample-items{font-size:8pt}.sample-invoice thead{display:table-header-group}.sample-invoice tr{break-inside:avoid}}

/* Keep invoice headings and values on the same alignment axis. */
.sample-invoice .sample-items th,.sample-invoice .sample-items td{vertical-align:top}
.sample-invoice .sample-items th:nth-child(-n+3),.sample-invoice .sample-items td:nth-child(-n+3){text-align:left}
.sample-invoice .sample-items th:nth-child(4),.sample-invoice .sample-items td:nth-child(4){text-align:center}
.sample-invoice .sample-items th:nth-child(n+5),.sample-invoice .sample-items td:nth-child(n+5){text-align:right;font-variant-numeric:tabular-nums}


.sample-invoice .sample-items th:nth-child(1){width:18%}.sample-invoice .sample-items th:nth-child(2){width:13%}.sample-invoice .sample-items th:nth-child(3){width:33%}.sample-invoice .sample-items th:nth-child(4){width:8%}.sample-invoice .sample-items th:nth-child(5),.sample-invoice .sample-items th:nth-child(6){width:14%}.sample-invoice .sample-items td:nth-child(3){white-space:pre-wrap}.line-grid:has(.sale-line-number){grid-template-columns:20px 1.5fr 1fr 2fr .6fr 1fr 1fr 1fr 30px}@media(max-width:800px){.line-grid:has(.sale-line-number){grid-template-columns:repeat(2,minmax(0,1fr))}}

.inline-category{display:grid;gap:6px;margin-top:6px}.inline-category small{font-weight:400}.line-grid input[type=search]{min-width:0}

.customer-picker{position:relative;min-width:0}.customer-matches{position:absolute;z-index:20;top:70px;left:0;right:0;max-height:260px;overflow:auto;background:#fff;border:1px solid #b9cbe0;border-radius:8px;box-shadow:0 5px 18px #173d6926;color:#173d69}.customer-matches button{display:block;width:100%;border:0;border-radius:0;text-align:left;padding:12px;white-space:normal;background:white;color:#173d69}.customer-matches button:hover,.customer-matches button:focus{background:#e8f1fc}.customer-matches .fine{padding:12px}.sale-entry-header .customer-picker .fine{color:inherit}

.cashbook-blue{background:#218cf2;color:white;display:flex;justify-content:space-between;gap:16px;padding:18px;flex-wrap:wrap}.cashbook-sheet{border:2px solid #153c69}.cashbook-sheet th{background:#218cf2;color:white}.cashbook-sheet tbody tr:nth-child(even){background:#c8f4f4}.cashbook-entry{display:grid;grid-template-columns:1fr 2fr 1fr 2fr 1fr 1fr auto;gap:10px;align-items:end;margin-top:20px}.cashbook-entry input,.cashbook-entry select{min-width:0}.cashbook-bottom{justify-content:flex-end}.cashbook-sheet td:nth-child(5),.cashbook-sheet td:nth-child(6){text-align:right}@media(max-width:1100px){.cashbook-entry{grid-template-columns:1fr 1fr}}@media(max-width:600px){.cashbook-entry{grid-template-columns:1fr}}@media print{.cashbook-blue{background:white;color:black;border-bottom:1px solid #222}.cashbook-sheet{border:1px solid #222}}
.item-profit-checks {display:flex;flex-wrap:wrap;gap:12px;max-height:260px;overflow:auto;margin:12px 0}.item-profit-checks label {display:flex;align-items:center;gap:6px;padding:8px;border:1px solid #dce5ef;border-radius:6px}.item-profit-checks input[type=checkbox],#item-profit-filter input[type=checkbox]{width:auto}#item-profit-filter [hidden]{display:none}

@page item-profit {size:A4 landscape;margin:10mm}
@media print {.item-profit-document{page:item-profit;padding:0!important;width:100%!important;max-width:none!important}.item-profit-document table{font-size:8pt;table-layout:fixed;width:100%;min-width:0}.item-profit-document th,.item-profit-document td{white-space:normal;overflow-wrap:anywhere;padding:4px}.item-profit-document .table-wrap{overflow:visible}.item-profit-document thead{display:table-header-group}.item-profit-document tr{break-inside:avoid}}


/* Keep horizontal scrolling available while viewing long wide tables */
.floating-table-scrollbar{
  position:fixed;
  bottom:0;
  height:20px;
  overflow-x:auto;
  overflow-y:hidden;
  z-index:10000;
  background:#fff;
  border-top:1px solid var(--line);
  box-shadow:0 -2px 8px rgba(0,0,0,.14);
  display:none;
}

.floating-table-scrollbar.active{
  display:block;
}

.floating-table-scrollbar-inner{
  height:1px;
}

@media print{
  .floating-table-scrollbar{
    display:none!important;
  }
}


/* Mandatory staff email verification */
.email-verify-screen{
  position:fixed;
  inset:0;
  z-index:20000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  overflow:auto;
  background:
    radial-gradient(circle at 20% 15%,rgba(59,130,246,.26),transparent 34%),
    radial-gradient(circle at 80% 85%,rgba(14,165,233,.18),transparent 32%),
    linear-gradient(145deg,#071426,#0b2343 52%,#071627);
}

.email-verify-glow{
  position:fixed;
  border-radius:999px;
  filter:blur(80px);
  pointer-events:none;
  opacity:.55;
}

.email-verify-glow-one{
  width:330px;
  height:330px;
  left:-80px;
  top:-80px;
  background:rgba(37,99,235,.46);
}

.email-verify-glow-two{
  width:300px;
  height:300px;
  right:-60px;
  bottom:-80px;
  background:rgba(6,182,212,.32);
}

.email-verify-card{
  position:relative;
  width:min(100%,480px);
  padding:34px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.16);
  border-radius:26px;
  background:rgba(255,255,255,.095);
  box-shadow:0 30px 80px rgba(0,0,0,.35);
  backdrop-filter:blur(24px);
  -webkit-backdrop-filter:blur(24px);
  color:#fff;
}

.email-verify-brand{
  display:flex;
  align-items:center;
  gap:11px;
  margin-bottom:32px;
}

.email-verify-brand-mark{
  display:grid;
  place-items:center;
  width:40px;
  height:40px;
  border-radius:12px;
  background:linear-gradient(145deg,#3b82f6,#06b6d4);
  font-weight:800;
  font-size:20px;
  box-shadow:0 8px 24px rgba(59,130,246,.28);
}

.email-verify-brand strong,
.email-verify-brand small{
  display:block;
}

.email-verify-brand strong{
  letter-spacing:.04em;
  font-size:14px;
}

.email-verify-brand small{
  margin-top:2px;
  color:rgba(255,255,255,.62);
  font-size:11px;
}

.email-verify-icon{
  display:grid;
  place-items:center;
  width:58px;
  height:58px;
  margin-bottom:22px;
  border:1px solid rgba(125,211,252,.28);
  border-radius:18px;
  background:rgba(59,130,246,.14);
}

.email-verify-icon svg{
  width:28px;
  height:28px;
  fill:#7dd3fc;
}

.email-verify-step{
  margin-bottom:7px;
  color:#7dd3fc;
  font-size:11px;
  font-weight:800;
  letter-spacing:.15em;
}

.email-verify-card h1{
  margin:0 0 12px;
  color:#fff;
  font-size:30px;
  line-height:1.1;
}

.email-verify-description{
  margin:0 0 25px;
  color:rgba(255,255,255,.7);
  line-height:1.65;
}

.email-verify-description strong{
  color:#fff;
}

.email-verify-label{
  display:block;
  margin-bottom:8px;
  color:rgba(255,255,255,.86);
  font-size:13px;
  font-weight:650;
}

.email-verify-email-input{
  width:100%;
  box-sizing:border-box;
  height:52px;
  padding:0 15px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:13px;
  outline:none;
  background:rgba(255,255,255,.08);
  color:#fff;
  font-size:15px;
  transition:.2s ease;
}

.email-verify-email-input::placeholder{
  color:rgba(255,255,255,.35);
}

.email-verify-email-input:focus{
  border-color:#60a5fa;
  box-shadow:0 0 0 4px rgba(59,130,246,.14);
}

.email-verify-help,
.email-verify-security{
  margin:10px 0 0;
  color:rgba(255,255,255,.48);
  font-size:12px;
  line-height:1.55;
}

.email-verify-primary{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  width:100%;
  min-height:52px;
  margin-top:20px;
  border:0;
  border-radius:13px;
  cursor:pointer;
  background:linear-gradient(135deg,#2563eb,#0284c7);
  color:#fff;
  font-size:14px;
  font-weight:750;
  box-shadow:0 12px 30px rgba(37,99,235,.26);
  transition:transform .18s ease,opacity .18s ease;
}

.email-verify-primary:hover:not(:disabled){
  transform:translateY(-1px);
}

.email-verify-primary:disabled{
  cursor:not-allowed;
  opacity:.7;
}

.email-otp-group{
  display:grid;
  grid-template-columns:repeat(6,1fr);
  gap:9px;
  margin:25px 0 10px;
}

.email-otp{
  width:100%;
  min-width:0;
  aspect-ratio:1/1.08;
  box-sizing:border-box;
  border:1px solid rgba(255,255,255,.2);
  border-radius:12px;
  outline:none;
  background:rgba(255,255,255,.08);
  color:#fff;
  text-align:center;
  font-size:22px;
  font-weight:800;
  transition:.18s ease;
}

.email-otp:focus{
  border-color:#60a5fa;
  background:rgba(59,130,246,.14);
  box-shadow:0 0 0 4px rgba(59,130,246,.13);
  transform:translateY(-2px);
}

.email-verify-error{
  min-height:20px;
  margin-top:10px;
  color:#fca5a5;
  font-size:12px;
  line-height:1.5;
}

.email-verify-actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  margin-top:18px;
}

.email-verify-link,
.email-verify-signout{
  border:0;
  background:none;
  color:#93c5fd;
  cursor:pointer;
  font:inherit;
  font-size:12px;
}

.email-verify-link:disabled{
  color:rgba(255,255,255,.35);
  cursor:not-allowed;
}

.email-verify-signout{
  display:block;
  margin:27px auto 0;
  color:rgba(255,255,255,.5);
}

.email-verify-hidden{
  display:none!important;
}

.email-button-spinner{
  width:16px;
  height:16px;
  border:2px solid rgba(255,255,255,.35);
  border-top-color:#fff;
  border-radius:50%;
  animation:emailVerifySpin .65s linear infinite;
}

.email-verify-success{
  padding:30px 0 15px;
  text-align:center;
}

.email-verify-success-check{
  display:grid;
  place-items:center;
  width:82px;
  height:82px;
  margin:0 auto 25px;
  border-radius:50%;
  background:rgba(34,197,94,.15);
  box-shadow:0 0 0 9px rgba(34,197,94,.06);
  animation:emailVerifySuccess .42s ease-out both;
}

.email-verify-success-check svg{
  width:44px;
  height:44px;
  fill:#4ade80;
}

.email-verify-success p{
  color:rgba(255,255,255,.65);
}

.email-success-loader{
  width:130px;
  height:3px;
  margin:28px auto 0;
  overflow:hidden;
  border-radius:999px;
  background:rgba(255,255,255,.12);
}

.email-success-loader span{
  display:block;
  width:45%;
  height:100%;
  border-radius:999px;
  background:#4ade80;
  animation:emailVerifyProgress 1s ease-in-out infinite;
}

@keyframes emailVerifySpin{
  to{transform:rotate(360deg)}
}

@keyframes emailVerifySuccess{
  from{opacity:0;transform:scale(.65)}
  to{opacity:1;transform:scale(1)}
}

@keyframes emailVerifyProgress{
  from{transform:translateX(-110%)}
  to{transform:translateX(260%)}
}

@media(max-width:560px){
  .email-verify-screen{
    padding:14px;
  }

  .email-verify-card{
    padding:26px 20px;
    border-radius:21px;
  }

  .email-verify-card h1{
    font-size:27px;
  }

  .email-otp-group{
    gap:6px;
  }

  .email-otp{
    border-radius:10px;
    font-size:19px;
  }
}

/* Password recovery form spacing */
.recovery-confirm-label{
  margin-top:18px;
}

/* My Account — security design only. Dashboard/Overview unchanged. */
.account-security-card{
  width:min(100%,560px);
}

.account-security-heading{
  margin-bottom:22px;
}

.account-security-heading h1{
  margin-bottom:10px;
}

.account-email-status{
  display:inline-flex;
  align-items:center;
  margin-top:2px;
  padding:7px 11px;
  border-radius:999px;
  font-size:11px;
  font-weight:750;
}

.account-email-status.verified{
  color:#86efac;
  border:1px solid rgba(34,197,94,.34);
  background:rgba(34,197,94,.12);
}

.account-email-status.unverified{
  color:#fcd34d;
  border:1px solid rgba(245,158,11,.32);
  background:rgba(245,158,11,.1);
}

.account-field-label{
  margin-top:18px;
}

.account-security-divider{
  height:1px;
  margin:26px 0;
  background:rgba(255,255,255,.12);
}

.account-password-wrap{
  position:relative;
}

.account-password-wrap .email-verify-email-input{
  padding-right:72px;
}

.account-password-eye{
  position:absolute;
  right:12px;
  top:50%;
  transform:translateY(-50%);
  border:0;
  background:transparent;
  color:#93c5fd;
  cursor:pointer;
  font-size:12px;
  font-weight:750;
}


/* Create Staff Account — glass security design */
.staff-security-card{
  width:min(100%,680px);
}

.staff-security-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
}

.staff-security-field{
  margin-top:18px;
}

.staff-password-wrap{
  position:relative;
}

.staff-password-wrap .email-verify-email-input{
  padding-right:70px;
}

.staff-password-show{
  position:absolute;
  right:12px;
  top:50%;
  transform:translateY(-50%);
  border:0;
  background:transparent;
  color:#93c5fd;
  cursor:pointer;
  font-size:12px;
  font-weight:750;
}

.staff-security-select{
  width:100%;
  height:52px;
  padding:0 14px;
  box-sizing:border-box;
  border:1px solid rgba(255,255,255,.18);
  border-radius:13px;
  outline:none;
  background:rgba(255,255,255,.08);
  color:#fff;
  font-size:14px;
}

.staff-security-select:focus{
  border-color:#60a5fa;
  box-shadow:0 0 0 4px rgba(59,130,246,.14);
}

.staff-security-select option{
  color:#111827;
  background:#fff;
}

.staff-role-note{
  margin-top:10px;
  padding:12px 14px;
  border:1px solid rgba(96,165,250,.16);
  border-radius:12px;
  background:rgba(59,130,246,.08);
  color:rgba(255,255,255,.62);
  font-size:12px;
  line-height:1.55;
}

.staff-branches-heading{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:15px;
  margin:28px 0 12px;
}

.staff-branches-heading strong{
  color:#fff;
  font-size:14px;
}

.staff-branch-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}

.staff-branch-card{
  display:flex;
  align-items:center;
  gap:12px;
  padding:13px;
  border:1px solid rgba(255,255,255,.13);
  border-radius:13px;
  background:rgba(255,255,255,.055);
  cursor:pointer;
}

.staff-branch-card input{
  width:18px;
  height:18px;
  accent-color:#3b82f6;
}

.staff-branch-card span,
.staff-branch-card strong,
.staff-branch-card small{
  display:block;
}

.staff-branch-card strong{
  color:#fff;
  font-size:13px;
}

.staff-branch-card small{
  margin-top:3px;
  color:rgba(255,255,255,.46);
  font-size:11px;
}

.staff-first-login{
  display:grid;
  gap:6px;
  margin-top:22px;
  padding:15px;
  border:1px solid rgba(34,197,94,.18);
  border-radius:13px;
  background:rgba(34,197,94,.075);
}

.staff-first-login strong{
  color:#86efac;
  font-size:12px;
}

.staff-first-login span{
  color:rgba(255,255,255,.62);
  font-size:12px;
}

@media(max-width:640px){
  .staff-security-grid,
  .staff-branch-grid{
    grid-template-columns:1fr;
  }
}

/* Keep tall security forms fully reachable on smaller screens */
.staff-security-screen,
.account-security-screen{
  align-items:flex-start;
  overflow-y:auto;
  padding-top:24px;
  padding-bottom:24px;
}

.staff-security-card,
.account-security-card{
  flex:0 0 auto;
}

/* First-login password screen */
.password-setup-card{
  width:min(100%,520px);
}
.password-setup-label{
  display:block;
  margin-top:18px;
}
.password-setup-screen{
  align-items:flex-start;
  overflow-y:auto;
  padding-top:24px;
  padding-bottom:24px;
}

/* ==========================================================
   LOW STOCK ALERT CENTER
   ========================================================== */

.ls-bell{
  position:fixed;
  right:24px;
  bottom:24px;
  z-index:900;
  width:58px;
  height:58px;
  border:1px solid rgba(122,190,255,.24);
  border-radius:18px;
  background:
    linear-gradient(145deg,rgba(14,50,91,.96),rgba(5,25,53,.96));
  box-shadow:0 16px 45px rgba(0,0,0,.32);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  backdrop-filter:blur(18px);
  transition:.2s ease;
}

.ls-bell:hover{
  transform:translateY(-2px);
  border-color:rgba(82,188,255,.65);
}

.ls-bell svg{
  width:25px;
  height:25px;
}

.ls-bell-count{
  position:absolute;
  top:-7px;
  right:-7px;
  min-width:23px;
  height:23px;
  padding:0 6px;
  border-radius:999px;
  background:#ef4444;
  border:2px solid #08284d;
  color:#fff;
  font-size:11px;
  font-weight:800;
  display:flex;
  align-items:center;
  justify-content:center;
}

.ls-bell-count:empty{
  display:none;
}

.ls-overlay{
  position:fixed;
  inset:0;
  z-index:1400;
  padding:24px;
  overflow:auto;
  background:
    radial-gradient(circle at 15% 15%,rgba(19,111,195,.25),transparent 34%),
    radial-gradient(circle at 85% 80%,rgba(0,151,220,.16),transparent 30%),
    rgba(3,18,39,.90);
  backdrop-filter:blur(13px);
  display:flex;
  justify-content:center;
  align-items:flex-start;
}

.ls-card{
  width:min(100%,920px);
  margin:auto;
  border:1px solid rgba(138,194,255,.19);
  border-radius:28px;
  background:
    linear-gradient(145deg,rgba(13,49,88,.94),rgba(5,27,57,.96));
  box-shadow:0 28px 80px rgba(0,0,0,.38);
  color:#f5f9ff;
  overflow:hidden;
}

.ls-card-inner{
  padding:30px;
}

.ls-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:20px;
  margin-bottom:24px;
}

.ls-kicker{
  font-size:12px;
  letter-spacing:.14em;
  text-transform:uppercase;
  font-weight:800;
  color:#57c2ff;
}

.ls-title{
  margin:5px 0 6px;
  font-size:29px;
  line-height:1.15;
}

.ls-sub{
  margin:0;
  color:#a9bfd7;
  line-height:1.6;
}

.ls-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.ls-btn{
  border:1px solid rgba(124,190,255,.22);
  border-radius:13px;
  padding:10px 15px;
  background:rgba(255,255,255,.065);
  color:#eef7ff;
  font-weight:700;
  cursor:pointer;
}

.ls-btn:hover{
  background:rgba(57,164,255,.14);
}

.ls-btn-primary{
  border-color:#238ed8;
  background:linear-gradient(135deg,#1586d4,#0c66b5);
}

.ls-btn-danger{
  border-color:rgba(248,113,113,.30);
  background:rgba(153,27,27,.20);
}

.ls-list{
  display:grid;
  gap:12px;
}

.ls-alert{
  display:grid;
  grid-template-columns:48px 1fr auto;
  align-items:center;
  gap:15px;
  padding:16px;
  border-radius:18px;
  border:1px solid rgba(255,184,76,.18);
  background:rgba(255,160,37,.075);
}

.ls-alert.out{
  border-color:rgba(248,113,113,.25);
  background:rgba(185,28,28,.11);
}

.ls-alert.read{
  opacity:.68;
}

.ls-alert-icon{
  width:44px;
  height:44px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:21px;
  background:rgba(245,158,11,.16);
  color:#fbbf24;
}

.ls-alert.out .ls-alert-icon{
  background:rgba(239,68,68,.15);
  color:#fb7185;
}

.ls-alert-name{
  font-size:16px;
  font-weight:800;
}

.ls-alert-meta{
  margin-top:5px;
  color:#a9bfd7;
  font-size:13px;
  line-height:1.5;
}

.ls-qty{
  min-width:80px;
  text-align:center;
}

.ls-qty strong{
  display:block;
  font-size:24px;
  color:#fbbf24;
}

.ls-alert.out .ls-qty strong{
  color:#fb7185;
}

.ls-empty{
  text-align:center;
  padding:48px 18px;
  border:1px dashed rgba(144,190,231,.20);
  border-radius:20px;
  color:#a9bfd7;
}

.ls-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
}

.ls-box{
  padding:18px;
  border:1px solid rgba(132,190,241,.16);
  border-radius:18px;
  background:rgba(255,255,255,.035);
}

.ls-box h3{
  margin:0 0 6px;
  font-size:15px;
}

.ls-box-note{
  color:#99b2ca;
  font-size:12px;
  margin-bottom:14px;
}

.ls-option{
  display:flex;
  align-items:flex-start;
  gap:11px;
  padding:11px 10px;
  margin:4px 0;
  border-radius:12px;
  cursor:pointer;
}

.ls-option:hover{
  background:rgba(255,255,255,.045);
}

.ls-option input{
  width:18px;
  height:18px;
  margin-top:1px;
  accent-color:#168bd7;
}

.ls-option small{
  display:block;
  margin-top:3px;
  color:#8fa9c1;
}

.ls-field{
  margin-bottom:20px;
}

.ls-field label{
  display:block;
  margin-bottom:8px;
  font-size:13px;
  font-weight:800;
  color:#cfe4f8;
}

.ls-field input{
  width:100%;
  border:1px solid rgba(126,188,240,.20);
  border-radius:14px;
  padding:13px 14px;
  background:rgba(2,19,42,.55);
  color:#fff;
  outline:none;
}

.ls-field input:focus{
  border-color:#249de8;
  box-shadow:0 0 0 3px rgba(36,157,232,.12);
}

.ls-success{
  width:min(100%,520px);
  margin:auto;
  padding:45px 30px;
  text-align:center;
}

.ls-success-icon{
  width:82px;
  height:82px;
  margin:0 auto 22px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:38px;
  color:#68f0a1;
  border:1px solid rgba(74,222,128,.32);
  background:rgba(34,197,94,.12);
  box-shadow:0 0 50px rgba(34,197,94,.13);
}

.ls-success h2{
  margin:0 0 9px;
  font-size:28px;
}

.ls-success p{
  margin:0 0 24px;
  color:#a9bfd7;
}

.ls-toast{
  position:fixed;
  top:22px;
  right:22px;
  z-index:1600;
  width:min(390px,calc(100vw - 32px));
  padding:16px 18px;
  border-radius:17px;
  border:1px solid rgba(251,191,36,.28);
  background:rgba(72,45,7,.95);
  box-shadow:0 20px 55px rgba(0,0,0,.34);
  color:#fff7db;
}

@media(max-width:720px){
  .ls-overlay{padding:12px}
  .ls-card-inner{padding:20px}
  .ls-head{display:block}
  .ls-actions{margin-top:16px}
  .ls-grid{grid-template-columns:1fr}
  .ls-alert{grid-template-columns:42px 1fr}
  .ls-qty{grid-column:2;text-align:left}
  .ls-bell{right:16px;bottom:16px}
}

/* Low Stock Alerts — sidebar entry */
.low-stock-nav{
  position:relative;
}

.low-stock-nav .icon{
  color:#fbbf24;
}

.low-stock-nav-label{
  flex:1;
  text-align:left;
}

.low-stock-nav-count{
  margin-left:auto;
  min-width:22px;
  height:22px;
  padding:0 6px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#ef4444;
  color:#fff;
  font-size:11px;
  font-weight:800;
}

.low-stock-nav-count:empty{
  display:none;
}


/* Login — isolated My Account security style */
.login-security-screen{
  align-items:flex-start;
  overflow-y:auto;
  padding:32px 18px;
}

.login-security-card{
  width:min(100%,520px);
  flex:0 0 auto;
}

.login-security-heading{
  margin-bottom:22px;
}

.login-security-heading h1{
  margin:0 0 10px;
  color:#fff;
  font-size:30px;
  letter-spacing:-.03em;
}

.login-security-form{
  display:grid;
  gap:0;
}

.login-security-field{
  margin-top:18px;
}

.login-security-select{
  width:100%;
  height:52px;
  padding:0 14px;
  box-sizing:border-box;
  border:1px solid rgba(255,255,255,.18);
  border-radius:13px;
  outline:none;
  background:rgba(255,255,255,.08);
  color:#fff;
  font-size:14px;
}

.login-security-select:focus{
  border-color:#60a5fa;
  box-shadow:0 0 0 4px rgba(59,130,246,.14);
}

.login-security-select option{
  color:#111827;
  background:#fff;
}

.login-security-submit{
  margin-top:24px;
}

.login-security-actions{
  display:flex;
  justify-content:center;
  margin-top:16px;
}

.login-recovery-link{
  padding:8px 12px;
}

.login-security-footer{
  margin-top:22px;
  text-align:center;
}

@media(max-width:640px){
  .login-security-screen{
    padding:20px 14px;
  }

  .login-security-card{
    width:100%;
  }

  .login-security-heading h1{
    font-size:26px;
  }
}

@media print{
  .login-security-screen{
    display:none!important;
  }
}


/* Smart selector search — v2 */
.smart-choice-box{
  position:relative;
  width:100%;
}

.smart-choice-search{
  width:100%;
  min-height:46px;
  padding:11px 14px 11px 42px;
  border:1px solid #cbd8e8;
  border-radius:11px;
  background:#fff;
  color:#172033;
  box-shadow:0 2px 8px rgba(15,23,42,.04);
  transition:border-color .16s ease,box-shadow .16s ease,background .16s ease;
}

.smart-choice-search::placeholder{
  color:#8a98ab;
}

.smart-choice-search:focus{
  border-color:#5b8def;
  background:#fff;
  box-shadow:0 0 0 4px rgba(59,130,246,.10);
}

.smart-choice-box::before{
  content:'⌕';
  position:absolute;
  z-index:3;
  left:14px;
  top:9px;
  color:#64748b;
  font-size:20px;
  line-height:28px;
  pointer-events:none;
}

.smart-choice-menu{
  position:absolute;
  z-index:10020;
  top:calc(100% + 6px);
  left:0;
  right:0;
  max-height:330px;
  overflow:auto;
  padding:6px;
  border:1px solid #d7e1ee;
  border-radius:13px;
  background:#fff;
  box-shadow:0 18px 50px rgba(15,23,42,.18);
}

.smart-choice-menu[hidden]{
  display:none!important;
}

.smart-choice-option{
  display:grid;
  width:100%;
  gap:4px;
  padding:11px 12px;
  border:0;
  border-radius:9px;
  background:transparent;
  text-align:left;
  color:#172033;
  cursor:pointer;
}

.smart-choice-option:hover,
.smart-choice-option.active{
  background:#eef5ff;
  box-shadow:inset 3px 0 0 #4f7fe8;
}

.smart-choice-title{
  display:block;
  font-size:13px;
  font-weight:700;
  line-height:1.35;
}

.smart-choice-meta{
  display:block;
  color:#64748b;
  font-size:11px;
  font-weight:500;
  line-height:1.45;
}

.smart-choice-native{
  margin-top:7px;
  min-height:39px;
  padding:7px 10px;
  border-color:#e2e8f0;
  background:#f8fafc;
  color:#475569;
  font-size:12px;
}

.smart-choice-status{
  display:block;
  margin-top:5px;
  color:#718096;
  line-height:1.4;
}

.line-grid .smart-choice-box{
  min-width:0;
}

@media(max-width:760px){
  .smart-choice-menu{
    max-height:260px;
  }
}

/* Sales Invoice — expanded product browser */
.sales-smart-product-row .sales-product-picker{
  grid-column:1 / -1 !important;
  width:100%;
  min-width:0;
}

.sales-product-picker-box{
  position:relative;
  width:100%;
}

.sales-product-picker-box .smart-choice-search{
  min-height:54px;
  padding-right:175px;
  font-size:15px;
  font-weight:600;
}

.sales-product-picker .smart-choice-native{
  display:none;
}

.sales-product-picker .smart-choice-status{
  margin-top:8px;
  font-size:12px;
  white-space:normal;
}

.sales-product-browser-toggle{
  position:absolute;
  z-index:8;
  top:7px;
  right:8px;
  height:40px;
  min-width:150px;
  padding:0 16px;
  border:1px solid #cbd8e8;
  border-radius:9px;
  background:#f8fafc;
  color:#24334b;
  font-weight:700;
  cursor:pointer;
}

.sales-product-browser-toggle:hover{
  background:#eef5ff;
  border-color:#9bb8ea;
}

.sales-product-picker .smart-choice-menu{
  max-height:360px;
  padding:8px;
}

.sales-product-browser-open{
  z-index:10030;
}

.sales-product-browser-open .smart-choice-menu{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:6px;
  max-height:520px;
  padding:10px;
  border-color:#a9bee0;
  border-radius:14px;
  box-shadow:0 24px 65px rgba(15,23,42,.24);
}

.sales-product-browser-open .smart-choice-option{
  min-height:68px;
  padding:13px 15px;
  border:1px solid #edf1f7;
}

.sales-product-browser-open .smart-choice-title{
  font-size:14px;
}

.sales-product-browser-open .smart-choice-meta{
  font-size:12px;
}

@media(max-width:760px){
  .sales-product-picker-box .smart-choice-search{
    padding-right:14px;
  }

  .sales-product-browser-toggle{
    position:relative;
    top:auto;
    right:auto;
    width:100%;
    margin-top:8px;
  }

  .sales-product-browser-open .smart-choice-menu{
    grid-template-columns:1fr;
    max-height:380px;
  }
}

/* Sales Invoice — corrected item field proportions */
@media(min-width:900px){

  dialog:has(.sale-entry-header) .sales-smart-product-row{
    grid-template-columns:repeat(12,minmax(0,1fr)) !important;
    gap:12px;
    align-items:end;
  }

  /* Product search takes the complete first row */
  dialog:has(.sale-entry-header)
  .sales-smart-product-row .sales-product-picker{
    grid-column:1 / -1 !important;
  }

  /* Part number */
  dialog:has(.sale-entry-header)
  .sales-smart-product-row label:has([data-field="part_number"]){
    grid-column:1 / span 2 !important;
  }

  /* Description must be the widest data-entry field */
  dialog:has(.sale-entry-header)
  .sales-smart-product-row .line-description{
    grid-column:3 / span 4 !important;
  }

  /* Quantity must stay compact */
  dialog:has(.sale-entry-header)
  .sales-smart-product-row label:has([data-field="quantity"]){
    grid-column:7 / span 1 !important;
  }

  /* Unit price */
  dialog:has(.sale-entry-header)
  .sales-smart-product-row label:has([data-field="unit_price"]){
    grid-column:8 / span 2 !important;
  }

  /* Discount */
  dialog:has(.sale-entry-header)
  .sales-smart-product-row label:has([data-field="discount"]){
    grid-column:10 / span 1 !important;
  }

  /* Tax */
  dialog:has(.sale-entry-header)
  .sales-smart-product-row label:has([data-field="tax"]){
    grid-column:11 / span 1 !important;
  }

  /* Remove line button */
  dialog:has(.sale-entry-header)
  .sales-smart-product-row [data-action="remove-line"]{
    grid-column:12 / span 1 !important;
    width:100%;
  }

  /* Total below the pricing area */
  dialog:has(.sale-entry-header)
  .sales-smart-product-row label:has(> output){
    grid-column:8 / span 4 !important;
    justify-self:stretch;
  }

  dialog:has(.sale-entry-header)
  .sales-smart-product-row input,
  dialog:has(.sale-entry-header)
  .sales-smart-product-row textarea{
    width:100%;
    min-width:0;
  }
}


/* =========================================================
   Sales Invoice — Premium 2026 redesign
   Scoped only to Sales Invoice dialog
   ========================================================= */

dialog:has(.sale-entry-header){
  width:min(1500px,96vw) !important;
  max-width:1500px !important;
  max-height:94vh;
  padding:0 !important;
  overflow:hidden;
  border:0;
  border-radius:22px;
  background:#f6f9fd;
  box-shadow:
    0 28px 80px rgba(15,23,42,.24),
    0 2px 8px rgba(15,23,42,.08);
}

/* ---------- Modal heading ---------- */

dialog:has(.sale-entry-header) .modal-head{
  position:relative;
  padding:24px 28px 22px;
  border-bottom:1px solid #e6edf6;
  background:
    radial-gradient(circle at 92% 0%,rgba(87,145,255,.17),transparent 30%),
    linear-gradient(135deg,#ffffff 0%,#f8fbff 58%,#edf5ff 100%);
}

dialog:has(.sale-entry-header) .modal-head::before{
  content:'';
  display:inline-flex;
  width:42px;
  height:42px;
  margin-right:13px;
  vertical-align:middle;
  border-radius:13px;
  background:
    linear-gradient(135deg,#e4efff,#f2f7ff);
  box-shadow:
    inset 0 0 0 1px #ccdcf4,
    0 4px 12px rgba(49,98,173,.10);
}

dialog:has(.sale-entry-header) .modal-head h2{
  display:inline-block;
  margin:0;
  vertical-align:middle;
  color:#15243a;
  font-size:24px;
  font-weight:760;
  letter-spacing:-.35px;
}

dialog:has(.sale-entry-header) .modal-head h2::after{
  content:'Create a new sales invoice and add the items below.';
  display:block;
  margin-top:4px;
  color:#74839a;
  font-size:12px;
  font-weight:500;
  letter-spacing:0;
}

dialog:has(.sale-entry-header) .modal-head [data-action="close"]{
  position:absolute;
  top:20px;
  right:22px;
  width:38px;
  min-width:38px;
  height:38px;
  padding:0;
  border:1px solid #dce5ef;
  border-radius:50%;
  background:#fff;
  color:#5b6879;
  box-shadow:0 3px 10px rgba(15,23,42,.05);
}

/* ---------- Main form ---------- */

dialog:has(.sale-entry-header) #modal-form{
  max-height:calc(94vh - 92px);
  overflow:auto;
  padding:22px 26px 0;
  background:#f6f9fd;
}

/* ---------- Invoice details card ---------- */

dialog:has(.sale-entry-header) .sale-entry-header{
  position:relative;
  display:grid !important;
  grid-template-columns:repeat(12,minmax(0,1fr)) !important;
  gap:14px 16px !important;
  padding:66px 20px 20px !important;
  margin:0 0 18px;
  border:1px solid #e1e9f3;
  border-radius:17px;
  background:#fff !important;
  color:#24344b !important;
  box-shadow:
    0 8px 26px rgba(24,49,83,.055),
    inset 0 1px 0 rgba(255,255,255,.8);
}

dialog:has(.sale-entry-header) .sale-entry-header::before{
  content:'Invoice details';
  position:absolute;
  top:17px;
  left:20px;
  color:#17263b;
  font-size:16px;
  font-weight:750;
}

dialog:has(.sale-entry-header) .sale-entry-header::after{
  content:'Enter the invoice information and customer details.';
  position:absolute;
  top:39px;
  left:20px;
  color:#7a889c;
  font-size:11px;
  font-weight:500;
}

/* field labels */

dialog:has(.sale-entry-header) .sale-entry-header label,
dialog:has(.sale-entry-header) .sale-entry-header .customer-picker{
  color:#536278 !important;
  font-size:11px;
  font-weight:680;
}

dialog:has(.sale-entry-header) .sale-entry-header input,
dialog:has(.sale-entry-header) .sale-entry-header select,
dialog:has(.sale-entry-header) .sale-entry-header textarea{
  min-height:44px;
  margin-top:6px;
  padding:10px 12px;
  border:1px solid #dce5f0 !important;
  border-radius:10px !important;
  background:#fff !important;
  color:#22324a !important;
  box-shadow:
    0 1px 2px rgba(15,23,42,.025),
    inset 0 1px 1px rgba(15,23,42,.015);
}

dialog:has(.sale-entry-header) .sale-entry-header input:focus,
dialog:has(.sale-entry-header) .sale-entry-header select:focus,
dialog:has(.sale-entry-header) .sale-entry-header textarea:focus{
  border-color:#7aa6ef !important;
  outline:0;
  box-shadow:0 0 0 4px rgba(78,132,226,.10) !important;
}

/* Invoice details positioning */

dialog:has(.sale-entry-header)
.sale-entry-header label:has([name="serial"]){
  grid-column:1 / span 3 !important;
  order:0 !important;
}

dialog:has(.sale-entry-header)
.sale-entry-header label:has([name="date"]){
  grid-column:4 / span 3 !important;
  order:0 !important;
}

dialog:has(.sale-entry-header)
.sale-entry-header label:has([name="payment_choice"]){
  grid-column:7 / span 3 !important;
  order:0 !important;
}

dialog:has(.sale-entry-header)
.sale-entry-header label:has([name="invoice_type"]){
  grid-column:10 / span 3 !important;
  order:0 !important;
}

dialog:has(.sale-entry-header)
.sale-entry-header .customer-picker{
  grid-column:1 / span 5 !important;
}

dialog:has(.sale-entry-header)
.sale-entry-header label:has([name="due_date"]){
  grid-column:6 / span 3 !important;
}

dialog:has(.sale-entry-header)
.sale-entry-header label:has([name="notes"]){
  grid-column:9 / span 4 !important;
}

/* Customer picker */

dialog:has(.sale-entry-header) .customer-picker{
  position:relative;
}

dialog:has(.sale-entry-header) .customer-picker input{
  width:100%;
}

dialog:has(.sale-entry-header) .customer-picker .fine{
  display:block;
  margin:6px 2px 0;
  color:#8592a4;
  font-size:10px;
}

/* ---------- Reference / transport accordion ---------- */

dialog:has(.sale-entry-header) .sale-extra-details{
  grid-column:1 / -1 !important;
  margin-top:2px;
  border:1px solid #dce9fa !important;
  border-radius:11px !important;
  background:linear-gradient(90deg,#f5f9ff,#f9fbff) !important;
  color:#44638e !important;
  overflow:hidden;
}

dialog:has(.sale-entry-header) .sale-extra-details summary{
  padding:13px 15px;
  color:#4a6c9b !important;
  font-size:11px;
  font-weight:700;
  cursor:pointer;
}

dialog:has(.sale-entry-header) .sale-extra-details[open] summary{
  border-bottom:1px solid #e2ecf9;
  background:#f2f7ff;
}

dialog:has(.sale-entry-header) .sale-extra-details .form-grid{
  padding:15px;
}

/* ---------- Items section ---------- */

dialog:has(.sale-entry-header) .invoice-items-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin:0;
  padding:17px 19px;
  border:1px solid #e1e9f3;
  border-bottom:0;
  border-radius:17px 17px 0 0;
  background:#fff;
}

dialog:has(.sale-entry-header) .invoice-items-heading h3,
dialog:has(.sale-entry-header) .invoice-items-heading strong{
  margin:0;
  color:#17263b;
  font-size:17px;
  font-weight:760;
}

/* Warehouse field directly following item heading */

dialog:has(.sale-entry-header)
.invoice-items-heading + label,
dialog:has(.sale-entry-header)
label:has([name="warehouse_id"]){
  display:block;
  margin:0;
  padding:16px 18px 17px;
  border-left:1px solid #e1e9f3;
  border-right:1px solid #e1e9f3;
  background:#fff;
  color:#56677d;
  font-size:11px;
  font-weight:700;
}

dialog:has(.sale-entry-header)
label:has([name="warehouse_id"]) select{
  width:100%;
  min-height:44px;
  margin-top:7px;
  padding:10px 13px;
  border:1px solid #dae4ef;
  border-radius:10px;
  background:#fbfdff;
}

/* ---------- Sales item card ---------- */

dialog:has(.sale-entry-header) #lines{
  padding:0 18px 18px;
  border:1px solid #e1e9f3;
  border-top:0;
  border-radius:0 0 17px 17px;
  background:#fff;
}

dialog:has(.sale-entry-header) .sales-smart-product-row{
  position:relative;
  margin-top:0;
  padding:22px 18px 18px !important;
  border:1px solid #dce6f2;
  border-radius:14px;
  background:
    linear-gradient(180deg,#fbfdff 0%,#ffffff 100%);
  box-shadow:
    0 5px 18px rgba(19,48,82,.045);
}

/* Line number badge */

dialog:has(.sale-entry-header) .sale-line-number{
  position:absolute;
  top:-13px;
  left:-10px;
  display:flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:28px;
  border:1px solid #bcd1ed;
  border-radius:50%;
  background:#eaf3ff;
  color:#3c6ead;
  font-size:12px;
  font-weight:800;
  box-shadow:0 3px 9px rgba(42,87,145,.10);
}

/* Product picker */

dialog:has(.sale-entry-header) .sales-product-picker{
  position:relative;
  padding:14px !important;
  border:1px solid #dbe7f5;
  border-radius:12px;
  background:#f5f9ff;
}

dialog:has(.sale-entry-header)
.sales-product-picker::before{
  content:'Product name / SKU / part number';
  display:block;
  margin:0 0 8px;
  color:#4e6078;
  font-size:11px;
  font-weight:750;
}

dialog:has(.sale-entry-header)
.sales-product-picker-box .smart-choice-search{
  height:48px;
  min-height:48px;
  border-color:#cddced !important;
  border-radius:10px !important;
  background:#fff !important;
  font-size:13px;
}

dialog:has(.sale-entry-header)
.sales-product-browser-toggle{
  top:4px;
  right:5px;
  height:40px;
  border:1px solid #c6d9f2;
  border-radius:9px;
  background:#edf5ff;
  color:#3f6fae;
  box-shadow:none;
}

/* ---------- Item fields ---------- */

dialog:has(.sale-entry-header)
.sales-smart-product-row label{
  color:#57687e;
  font-size:10px;
  font-weight:700;
}

dialog:has(.sale-entry-header)
.sales-smart-product-row input,
dialog:has(.sale-entry-header)
.sales-smart-product-row select{
  min-height:42px;
  margin-top:6px;
  padding:9px 11px;
  border:1px solid #dce5ef !important;
  border-radius:9px !important;
  background:#fff;
  color:#22324a;
}

dialog:has(.sale-entry-header)
.sales-smart-product-row input:focus,
dialog:has(.sale-entry-header)
.sales-smart-product-row select:focus{
  border-color:#75a3e8 !important;
  outline:0;
  box-shadow:0 0 0 3px rgba(76,130,218,.10);
}

/* Part No. */
dialog:has(.sale-entry-header)
.sales-smart-product-row label:has([data-field="part_number"]){
  grid-column:1 / span 2 !important;
}

/* Description */
dialog:has(.sale-entry-header)
.sales-smart-product-row .line-description{
  grid-column:3 / span 4 !important;
}

/* Qty */
dialog:has(.sale-entry-header)
.sales-smart-product-row label:has([data-field="quantity"]){
  grid-column:7 / span 1 !important;
}

/* Unit price */
dialog:has(.sale-entry-header)
.sales-smart-product-row label:has([data-field="unit_price"]){
  grid-column:8 / span 2 !important;
}

/* Discount */
dialog:has(.sale-entry-header)
.sales-smart-product-row label:has([data-field="discount"]){
  grid-column:10 / span 1 !important;
}

/* Tax */
dialog:has(.sale-entry-header)
.sales-smart-product-row label:has([data-field="tax"]){
  grid-column:11 / span 1 !important;
}

/* Remove button */
dialog:has(.sale-entry-header)
.sales-smart-product-row [data-action="remove-line"]{
  grid-column:12 / span 1 !important;
  align-self:end;
  min-width:42px;
  height:42px;
  padding:0;
  border:1px solid #f0d6da;
  border-radius:9px;
  background:#fff7f8;
  color:#bc5360;
}

/* Total price */

dialog:has(.sale-entry-header)
.sales-smart-product-row label:has(> output){
  grid-column:9 / span 3 !important;
  margin-top:2px;
  padding:10px 12px;
  border:1px solid #d9e6f5;
  border-radius:10px;
  background:#f3f8ff;
  color:#53667e;
}

dialog:has(.sale-entry-header)
.sales-smart-product-row output{
  display:block;
  margin-top:3px;
  color:#315f9b;
  font-size:17px;
  font-weight:800;
}

/* ---------- Add item button ---------- */

dialog:has(.sale-entry-header) [data-action="add-line"]{
  margin-top:12px;
  min-height:42px;
  border:1px dashed #bad0eb;
  border-radius:10px;
  background:#f7fbff;
  color:#4976ae;
  font-weight:700;
}

/* ---------- Footer ---------- */

dialog:has(.sale-entry-header) .form-footer{
  position:sticky;
  bottom:0;
  z-index:20;
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin:22px -26px 0;
  padding:16px 26px;
  border-top:1px solid #e2e9f2;
  background:rgba(255,255,255,.96);
  backdrop-filter:blur(12px);
}

dialog:has(.sale-entry-header) .form-footer button{
  min-height:42px;
  padding:0 19px;
  border-radius:10px;
  font-weight:700;
}

dialog:has(.sale-entry-header) .form-footer .primary{
  padding-left:24px;
  padding-right:24px;
  background:linear-gradient(135deg,#3979d8,#2e67bd);
  box-shadow:0 6px 16px rgba(45,102,187,.20);
}

/* ---------- Responsive ---------- */

@media(max-width:1000px){
  dialog:has(.sale-entry-header) .sale-entry-header{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }

  dialog:has(.sale-entry-header) .sale-entry-header > *{
    grid-column:auto / span 1 !important;
  }

  dialog:has(.sale-entry-header) .sale-extra-details,
  dialog:has(.sale-entry-header) .customer-picker{
    grid-column:1 / -1 !important;
  }
}

@media(max-width:720px){
  dialog:has(.sale-entry-header){
    width:98vw !important;
    border-radius:14px;
  }

  dialog:has(.sale-entry-header) #modal-form{
    padding:14px 14px 0;
  }

  dialog:has(.sale-entry-header) .sale-entry-header{
    grid-template-columns:1fr !important;
    padding:62px 14px 15px !important;
  }

  dialog:has(.sale-entry-header) .sale-entry-header > *{
    grid-column:1 / -1 !important;
  }

  dialog:has(.sale-entry-header) .sales-smart-product-row{
    display:grid !important;
    grid-template-columns:1fr !important;
  }

  dialog:has(.sale-entry-header)
  .sales-smart-product-row > *{
    grid-column:1 / -1 !important;
  }

  dialog:has(.sale-entry-header) .form-footer{
    margin-left:-14px;
    margin-right:-14px;
    padding:13px 14px;
  }
}


/* =========================================================
   Sales Invoice — Premium layout correction v2
   ========================================================= */

/* Header: icon | title | close */
dialog:has(.sale-entry-header) .modal-head{
  display:grid !important;
  grid-template-columns:48px minmax(0,1fr) 44px !important;
  align-items:center !important;
  justify-content:initial !important;
  gap:14px !important;
}

dialog:has(.sale-entry-header) .modal-head::before{
  content:'▤' !important;
  grid-column:1 !important;
  display:flex !important;
  align-items:center;
  justify-content:center;
  width:44px !important;
  height:44px !important;
  margin:0 !important;
  border-radius:13px;
  background:#eaf3ff !important;
  color:#3979d8;
  font-size:24px;
  font-weight:700;
}

dialog:has(.sale-entry-header) .modal-head h2{
  grid-column:2 !important;
  justify-self:start !important;
  width:auto !important;
  margin:0 !important;
  text-align:left !important;
}

dialog:has(.sale-entry-header) .modal-head [data-action="close"]{
  position:static !important;
  grid-column:3 !important;
  justify-self:end !important;
}


/* Compact Invoice Details grid */
dialog:has(.sale-entry-header) .sale-entry-header{
  grid-template-columns:repeat(12,minmax(0,1fr)) !important;
  grid-template-rows:auto auto auto !important;
  grid-auto-rows:auto !important;
  align-items:start !important;
  align-content:start !important;
  min-height:0 !important;
  height:auto !important;
  row-gap:15px !important;
  column-gap:16px !important;
}


/* ROW 1 */

/* Serial */
dialog:has(.sale-entry-header)
.sale-entry-header label:has([name="serial"]){
  grid-column:1 / span 3 !important;
  grid-row:1 !important;
  order:0 !important;
}

/* Date */
dialog:has(.sale-entry-header)
.sale-entry-header label:has([name="date"]){
  grid-column:4 / span 3 !important;
  grid-row:1 !important;
  order:0 !important;
}

/* Sale Invoice Type */
dialog:has(.sale-entry-header)
.sale-entry-header label:has([name="payment_choice"]){
  grid-column:7 / span 3 !important;
  grid-row:1 !important;
  order:0 !important;
}

/* Invoice Type */
dialog:has(.sale-entry-header)
.sale-entry-header label:has([name="invoice_type"]){
  grid-column:10 / span 3 !important;
  grid-row:1 !important;
  order:0 !important;
}


/* ROW 2 */

/* Customer */
dialog:has(.sale-entry-header)
.sale-entry-header .customer-picker{
  grid-column:1 / span 5 !important;
  grid-row:2 !important;
  order:0 !important;
}

/* Due date */
dialog:has(.sale-entry-header)
.sale-entry-header label:has([name="due_date"]){
  grid-column:6 / span 3 !important;
  grid-row:2 !important;
  order:0 !important;
}

/* Notes */
dialog:has(.sale-entry-header)
.sale-entry-header label:has([name="notes"]){
  grid-column:9 / span 4 !important;
  grid-row:2 !important;
  order:0 !important;
}


/* ROW 3 — reference details */
dialog:has(.sale-entry-header)
.sale-entry-header .sale-extra-details{
  grid-column:1 / -1 !important;
  grid-row:3 !important;
  order:0 !important;
}


/* Keep all normal invoice fields compact */
dialog:has(.sale-entry-header)
.sale-entry-header > label,
dialog:has(.sale-entry-header)
.sale-entry-header .customer-picker{
  align-self:start !important;
  min-height:0 !important;
  margin:0 !important;
}


/* Prevent hidden return controls from disturbing the grid */
dialog:has(.sale-entry-header)
.sale-entry-header [hidden]{
  display:none !important;
}


/* Notes matches approved compact appearance */
dialog:has(.sale-entry-header)
.sale-entry-header label:has([name="notes"]) input{
  height:44px !important;
}


/* Desktop card should not stretch vertically */
@media(min-width:1001px){
  dialog:has(.sale-entry-header) .sale-entry-header{
    padding-bottom:18px !important;
  }
}


/* Tablet */
@media(max-width:1000px) and (min-width:721px){
  dialog:has(.sale-entry-header) .sale-entry-header{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    grid-template-rows:auto !important;
  }

  dialog:has(.sale-entry-header)
  .sale-entry-header > label,
  dialog:has(.sale-entry-header)
  .sale-entry-header .customer-picker{
    grid-column:auto !important;
    grid-row:auto !important;
  }

  dialog:has(.sale-entry-header)
  .sale-entry-header .sale-extra-details{
    grid-column:1 / -1 !important;
    grid-row:auto !important;
  }
}


/* Mobile */
@media(max-width:720px){
  dialog:has(.sale-entry-header) .modal-head{
    grid-template-columns:42px 1fr 38px !important;
    gap:10px !important;
  }

  dialog:has(.sale-entry-header) .sale-entry-header{
    grid-template-columns:1fr !important;
    grid-template-rows:auto !important;
  }

  dialog:has(.sale-entry-header)
  .sale-entry-header > *,
  dialog:has(.sale-entry-header)
  .sale-entry-header .customer-picker{
    grid-column:1 !important;
    grid-row:auto !important;
  }
}


/* =========================================================
   Sales Invoice — Premium Items section v3
   Only affects Sales Invoice
   ========================================================= */

/* Items heading: title and helper stay together */
dialog:has(.sale-entry-header) .invoice-items-heading{
  justify-content:flex-start !important;
  align-items:center !important;
  gap:14px !important;
  padding:17px 20px 12px !important;
}

dialog:has(.sale-entry-header) .invoice-items-heading > *{
  margin-top:0 !important;
  margin-bottom:0 !important;
}

dialog:has(.sale-entry-header) .invoice-items-heading h3{
  flex:0 0 auto;
  font-size:18px !important;
}

dialog:has(.sale-entry-header) .invoice-items-heading p,
dialog:has(.sale-entry-header) .invoice-items-heading small,
dialog:has(.sale-entry-header) .invoice-items-heading span{
  color:#718096;
  font-size:12px;
  font-weight:500;
}


/* Warehouse becomes one compact professional row */
dialog:has(.sale-entry-header)
label:has([name="warehouse_id"]){
  display:grid !important;
  grid-template-columns:135px minmax(0,1fr) !important;
  align-items:center !important;
  gap:15px !important;
  padding:10px 20px 17px !important;
  border-left:1px solid #e1e9f3;
  border-right:1px solid #e1e9f3;
  background:#fff;
  color:#53667e !important;
  font-size:11px !important;
  font-weight:750 !important;
}

dialog:has(.sale-entry-header)
label:has([name="warehouse_id"]) select{
  width:100% !important;
  min-height:44px !important;
  margin:0 !important;
  padding:9px 13px !important;
  border:1px solid #d8e3ef !important;
  border-radius:10px !important;
  background:#fbfdff !important;
}


/* Main line-items container */
dialog:has(.sale-entry-header) #lines{
  padding:0 20px 22px !important;
}


/* One compact item card */
dialog:has(.sale-entry-header) .sales-smart-product-row{
  display:grid !important;

  grid-template-columns:
    minmax(125px,1.45fr)
    minmax(260px,3.5fr)
    minmax(72px,.75fr)
    minmax(120px,1.45fr)
    minmax(95px,1.15fr)
    minmax(95px,1.15fr)
    minmax(105px,1.25fr)
    44px !important;

  gap:11px 12px !important;
  align-items:end !important;

  padding:18px 16px 16px !important;
  border:1px solid #dce6f2 !important;
  border-radius:13px !important;
  background:#fff !important;
  box-shadow:0 5px 18px rgba(22,50,84,.045) !important;
}


/* Number badge */
dialog:has(.sale-entry-header) .sale-line-number{
  top:-11px !important;
  left:-11px !important;
  width:30px !important;
  height:30px !important;
  background:#eaf3ff !important;
  border:1px solid #bdd3ef !important;
  color:#356cab !important;
  font-size:12px !important;
}


/* Search occupies full first row */
dialog:has(.sale-entry-header)
.sales-smart-product-row .sales-product-picker{
  grid-column:1 / -1 !important;
  grid-row:1 !important;

  padding:11px 12px 12px !important;
  border:1px solid #dbe6f4 !important;
  border-radius:11px !important;
  background:#f6f9fd !important;

  /* hides the old visible "Short name" label text */
  font-size:0 !important;
}


/* Keep only our useful product heading */
dialog:has(.sale-entry-header)
.sales-product-picker::before{
  content:'Product name / SKU / part number' !important;
  display:block !important;
  margin:0 0 7px !important;
  color:#455a75 !important;
  font-size:11px !important;
  font-weight:750 !important;
}


/* Restore font sizes for elements inside picker */
dialog:has(.sale-entry-header)
.sales-product-picker input,
dialog:has(.sale-entry-header)
.sales-product-picker button,
dialog:has(.sale-entry-header)
.sales-product-picker small,
dialog:has(.sale-entry-header)
.sales-product-picker .smart-choice-status,
dialog:has(.sale-entry-header)
.sales-product-picker .smart-choice-option{
  font-size:12px !important;
}


/* Search bar */
dialog:has(.sale-entry-header)
.sales-product-picker-box .smart-choice-search{
  height:46px !important;
  min-height:46px !important;
  padding-top:9px !important;
  padding-bottom:9px !important;
  padding-right:175px !important;
  border-radius:9px !important;
  background:#fff !important;
}


/* Browse Products */
dialog:has(.sale-entry-header)
.sales-product-browser-toggle{
  top:3px !important;
  right:4px !important;
  height:40px !important;
  min-width:160px !important;
  border-radius:8px !important;
  background:#eef5ff !important;
  border-color:#bed4ef !important;
  color:#3569a6 !important;
  font-size:11px !important;
}


/* Stock status stays subtle and compact */
dialog:has(.sale-entry-header)
.sales-product-picker .stock-availability{
  display:block;
  margin:7px 2px 0 !important;
  color:#17755a;
  font-size:10px !important;
  font-weight:650;
}


/* FIELD ROW — exact approved order */

/* Part No. */
dialog:has(.sale-entry-header)
.sales-smart-product-row label:has([data-field="part_number"]){
  grid-column:1 !important;
  grid-row:2 !important;
}

/* Description */
dialog:has(.sale-entry-header)
.sales-smart-product-row .line-description{
  grid-column:2 !important;
  grid-row:2 !important;
}

/* Qty */
dialog:has(.sale-entry-header)
.sales-smart-product-row label:has([data-field="quantity"]){
  grid-column:3 !important;
  grid-row:2 !important;
}

/* Unit price */
dialog:has(.sale-entry-header)
.sales-smart-product-row label:has([data-field="unit_price"]){
  grid-column:4 !important;
  grid-row:2 !important;
}

/* Discount */
dialog:has(.sale-entry-header)
.sales-smart-product-row label:has([data-field="discount"]){
  grid-column:5 !important;
  grid-row:2 !important;
}

/* Tax */
dialog:has(.sale-entry-header)
.sales-smart-product-row label:has([data-field="tax"]){
  grid-column:6 !important;
  grid-row:2 !important;
}

/* Total price — same row */
dialog:has(.sale-entry-header)
.sales-smart-product-row label:has(> output){
  grid-column:7 !important;
  grid-row:2 !important;

  align-self:end !important;
  min-height:42px !important;
  margin:0 !important;
  padding:7px 10px !important;

  border:1px solid #d6e3f2 !important;
  border-radius:9px !important;
  background:#eef5ff !important;

  color:#52677f !important;
  font-size:9px !important;
  font-weight:700 !important;
}

/* Total value */
dialog:has(.sale-entry-header)
.sales-smart-product-row label:has(> output) output{
  display:block !important;
  margin-top:2px !important;
  color:#285c9f !important;
  font-size:15px !important;
  font-weight:800 !important;
  line-height:1.15 !important;
}


/* Delete */
dialog:has(.sale-entry-header)
.sales-smart-product-row [data-action="remove-line"]{
  grid-column:8 !important;
  grid-row:2 !important;

  align-self:end !important;
  width:44px !important;
  min-width:44px !important;
  height:42px !important;
  margin:0 !important;
  padding:0 !important;

  border:1px solid #efd5d9 !important;
  border-radius:9px !important;
  background:#fff7f8 !important;
  color:#c45160 !important;
}


/* Consistent compact item inputs */
dialog:has(.sale-entry-header)
.sales-smart-product-row > label:not(.sales-product-picker) input,
dialog:has(.sale-entry-header)
.sales-smart-product-row > label:not(.sales-product-picker) select{
  width:100% !important;
  min-width:0 !important;
  height:42px !important;
  min-height:42px !important;
  margin-top:5px !important;
  padding:8px 10px !important;
}


/* Add another item control */
dialog:has(.sale-entry-header) [data-action="add-line"]{
  display:block !important;
  width:100% !important;
  min-height:40px !important;
  margin:12px 0 0 !important;

  border:1px dashed #b9cfe9 !important;
  border-radius:9px !important;
  background:#f8fbff !important;
  color:#3f70aa !important;
  box-shadow:none !important;
}


/* Enough space so footer never hides the last row */
dialog:has(.sale-entry-header) #lines{
  margin-bottom:18px;
}


/* Tablet */
@media(max-width:1150px) and (min-width:721px){
  dialog:has(.sale-entry-header) .sales-smart-product-row{
    grid-template-columns:
      minmax(110px,1.4fr)
      minmax(210px,3fr)
      80px
      minmax(110px,1.3fr)
      minmax(90px,1fr)
      minmax(90px,1fr)
      minmax(95px,1.1fr)
      42px !important;
  }
}


/* Mobile stacks naturally */
@media(max-width:720px){

  dialog:has(.sale-entry-header)
  label:has([name="warehouse_id"]){
    display:block !important;
  }

  dialog:has(.sale-entry-header)
  label:has([name="warehouse_id"]) select{
    margin-top:7px !important;
  }

  dialog:has(.sale-entry-header) .sales-smart-product-row{
    grid-template-columns:1fr !important;
  }

  dialog:has(.sale-entry-header)
  .sales-smart-product-row > *{
    grid-column:1 !important;
    grid-row:auto !important;
  }

  dialog:has(.sale-entry-header)
  .sales-product-picker-box .smart-choice-search{
    padding-right:14px !important;
  }

  dialog:has(.sale-entry-header)
  .sales-product-browser-toggle{
    position:relative !important;
    top:auto !important;
    right:auto !important;
    width:100% !important;
    margin-top:8px !important;
  }
}


/* =========================================================
   Cashbook — Premium red/green design 2026
   Scoped only to Cashbook
   ========================================================= */

/* Main quick-entry panel */
section.panel:has(.cashbook-entry){
  border:1px solid #dbe6f2 !important;
  border-radius:16px !important;
  background:#fff !important;
  box-shadow:0 8px 28px rgba(29,65,108,.055) !important;
  overflow:visible;
}

section.panel:has(.cashbook-entry) .panel-body{
  padding:20px 22px !important;
}

/* Quick Entry title */
section.panel:has(.cashbook-entry) .panel-body::before{
  content:'Quick Entry';
  display:block;
  margin:0 0 14px;
  color:#153d70;
  font-size:18px;
  font-weight:800;
  letter-spacing:-.15px;
}


/* ---------------------------
   Date controls
   --------------------------- */

.cashbook-date-controls{
  display:flex !important;
  align-items:flex-end !important;
  gap:9px !important;
  margin-bottom:18px !important;
}

.cashbook-date-controls label{
  color:#354860;
  font-size:12px;
  font-weight:700;
}

.cashbook-date-controls input{
  min-height:44px !important;
  border:1px solid #d5e1ee !important;
  border-radius:9px !important;
  background:#fff !important;
}

.cashbook-date-controls button{
  min-width:46px !important;
  min-height:44px !important;
  border:1px solid #cfdeed !important;
  border-radius:9px !important;
  background:#f7faff !important;
  color:#245d9b !important;
  font-size:14px !important;
  font-weight:700 !important;
  box-shadow:none !important;
}

.cashbook-date-controls button:hover{
  background:#edf5ff !important;
  border-color:#a9c5e7 !important;
}


/* ---------------------------
   Quick-entry row
   --------------------------- */

.cashbook-entry{
  display:grid !important;
  grid-template-columns:
    minmax(150px,1.35fr)
    minmax(220px,1.8fr)
    minmax(125px,.95fr)
    minmax(230px,1.75fr)
    minmax(120px,.9fr)
    minmax(120px,.9fr)
    auto !important;

  gap:12px !important;
  align-items:end !important;
  margin:4px 0 0 !important;
}

.cashbook-entry label{
  color:#2e4057 !important;
  font-size:11px !important;
  font-weight:750 !important;
}

.cashbook-entry input,
.cashbook-entry select{
  width:100% !important;
  min-width:0 !important;
  height:46px !important;
  min-height:46px !important;
  margin-top:6px !important;
  padding:9px 12px !important;
  border:1px solid #d6e1ed !important;
  border-radius:9px !important;
  background:#fff !important;
  color:#1f3047 !important;
  box-shadow:0 1px 2px rgba(15,23,42,.02);
}

.cashbook-entry input:focus,
.cashbook-entry select:focus{
  border-color:#72a2e5 !important;
  outline:0 !important;
  box-shadow:0 0 0 3px rgba(58,119,205,.10) !important;
}


/* Payments input — RED */
.cashbook-entry > :nth-child(5) input{
  border-color:#f0c8cc !important;
  background:#fff8f8 !important;
  color:#dc2626 !important;
  font-weight:800 !important;
}

.cashbook-entry > :nth-child(5) input:focus{
  border-color:#e88c94 !important;
  box-shadow:0 0 0 3px rgba(220,38,38,.08) !important;
}


/* Receipts input — GREEN */
.cashbook-entry > :nth-child(6) input{
  border-color:#bfe4d1 !important;
  background:#f5fcf8 !important;
  color:#078545 !important;
  font-weight:800 !important;
}

.cashbook-entry > :nth-child(6) input:focus{
  border-color:#78c69d !important;
  box-shadow:0 0 0 3px rgba(5,150,82,.08) !important;
}


/* Add / Post */
.cashbook-entry > button,
.cashbook-entry [type="submit"]{
  height:46px !important;
  min-height:46px !important;
  padding:0 22px !important;
  border:1px solid #2263af !important;
  border-radius:10px !important;
  background:linear-gradient(135deg,#2e7bd3,#2865b4) !important;
  color:#fff !important;
  font-weight:800 !important;
  white-space:nowrap;
  box-shadow:0 6px 15px rgba(38,101,180,.18) !important;
}


/* Helper message */
section.panel:has(.cashbook-entry) .fine{
  color:#65778d !important;
  line-height:1.6 !important;
}


/* ---------------------------
   Opening balance
   --------------------------- */

.cashbook-opening{
  margin-left:auto !important;
  display:flex !important;
  flex-direction:row !important;
  align-items:center !important;
  gap:9px !important;
  padding:8px 14px !important;
  border:1px solid rgba(255,255,255,.22) !important;
  border-radius:10px !important;
  background:rgba(255,255,255,.08) !important;
  color:#fff !important;
}

.cashbook-opening small{
  color:rgba(255,255,255,.82) !important;
}

.cashbook-opening strong{
  color:#fff !important;
  font-size:18px !important;
}


/* ---------------------------
   Main Cashbook header
   --------------------------- */

.cashbook-blue:not(.cashbook-bottom){
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:18px !important;

  padding:18px 22px !important;

  border:1px solid #174d84 !important;
  border-radius:15px 15px 0 0 !important;

  background:
    linear-gradient(110deg,#154c87 0%,#176ab4 62%,#287fc7 100%) !important;

  color:#fff !important;

  box-shadow:
    0 9px 22px rgba(20,74,128,.12);
}

.cashbook-blue:not(.cashbook-bottom) h2,
.cashbook-blue:not(.cashbook-bottom) h3,
.cashbook-blue:not(.cashbook-bottom) strong{
  color:#fff !important;
}

.cashbook-blue:not(.cashbook-bottom) h2,
.cashbook-blue:not(.cashbook-bottom) h3{
  margin:0 !important;
  font-size:18px !important;
  font-weight:800 !important;
}


/* ---------------------------
   Cashbook table
   --------------------------- */

.cashbook-sheet{
  width:100% !important;
  table-layout:fixed !important;
  border-collapse:separate !important;
  border-spacing:0 !important;

  border:1px solid #d4e1ef !important;
  border-top:0 !important;

  background:#fff !important;
  color:#27384e !important;
}


/* Column proportions */
.cashbook-sheet th:nth-child(1),
.cashbook-sheet td:nth-child(1){
  width:6%;
}

.cashbook-sheet th:nth-child(2),
.cashbook-sheet td:nth-child(2){
  width:27%;
}

.cashbook-sheet th:nth-child(3),
.cashbook-sheet td:nth-child(3){
  width:17%;
}

.cashbook-sheet th:nth-child(4),
.cashbook-sheet td:nth-child(4){
  width:25%;
}

.cashbook-sheet th:nth-child(5),
.cashbook-sheet td:nth-child(5){
  width:10%;
}

.cashbook-sheet th:nth-child(6),
.cashbook-sheet td:nth-child(6){
  width:10%;
}

.cashbook-sheet th:nth-child(7),
.cashbook-sheet td:nth-child(7){
  width:10%;
}


/* Column header */
.cashbook-sheet thead th,
.cashbook-sheet th{
  padding:13px 12px !important;

  border-right:1px solid #dbe7f3 !important;
  border-bottom:1px solid #d8e5f2 !important;

  background:#edf5fd !important;
  color:#1f4f84 !important;

  font-size:11px !important;
  font-weight:800 !important;
  text-align:left !important;
}

.cashbook-sheet th:last-child{
  border-right:0 !important;
}


/* Rows */
.cashbook-sheet tbody tr{
  background:#fff !important;
  transition:background .12s ease;
}

.cashbook-sheet tbody tr:nth-child(even){
  background:#f5f9fd !important;
}

.cashbook-sheet tbody tr:hover{
  background:#edf6ff !important;
}

.cashbook-sheet td{
  padding:12px !important;

  border-right:1px solid #edf2f7 !important;
  border-bottom:1px solid #e8eff6 !important;

  color:#314258;
  font-size:12px !important;
  line-height:1.45 !important;

  white-space:normal !important;
  overflow-wrap:anywhere;
  vertical-align:middle !important;
}

.cashbook-sheet td:last-child{
  border-right:0 !important;
}


/* Payment amounts — RED */
.cashbook-sheet td:nth-child(5){
  color:#dc2626 !important;
  font-weight:800 !important;
  text-align:right !important;
}


/* Receipt amounts — GREEN */
.cashbook-sheet td:nth-child(6){
  color:#078545 !important;
  font-weight:800 !important;
  text-align:right !important;
}


/* Options */
.cashbook-sheet td:nth-child(7){
  text-align:center !important;
  white-space:nowrap !important;
}

.cashbook-sheet td:nth-child(7) button{
  width:34px !important;
  min-width:34px !important;
  height:32px !important;
  min-height:32px !important;
  padding:0 !important;
  margin:2px !important;

  border-radius:8px !important;
  box-shadow:none !important;
}

.cashbook-sheet td:nth-child(7) button:not(.danger){
  border:1px solid #c5dcf5 !important;
  background:#edf6ff !important;
  color:#1e6dbb !important;
}

.cashbook-sheet td:nth-child(7) button.danger{
  border:1px solid #f1ced2 !important;
  background:#fff1f2 !important;
  color:#dc3545 !important;
}


/* Empty state */
.cashbook-sheet tbody td[colspan]{
  height:230px !important;
  text-align:center !important;
  color:#7a899b !important;
  background:#fff !important;
}


/* ---------------------------
   Totals footer
   --------------------------- */

.cashbook-blue.cashbook-bottom,
.cashbook-bottom{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:0 !important;

  padding:13px 18px !important;

  border:1px solid #d4e3f2 !important;
  border-top:0 !important;
  border-radius:0 0 14px 14px !important;

  background:
    linear-gradient(90deg,#edf6ff,#e4f1ff) !important;

  color:#31465e !important;
}


/* Individual summary blocks */
.cashbook-bottom > *{
  display:flex;
  align-items:center;
  gap:7px;

  min-height:42px;
  padding:0 20px;

  border-left:1px solid #cbdced;
}


/* Payments total */
.cashbook-bottom > :nth-last-child(3){
  color:#566a80 !important;
}

.cashbook-bottom > :nth-last-child(3) strong,
.cashbook-bottom > :nth-last-child(3) b{
  color:#dc2626 !important;
  font-size:18px !important;
}


/* Receipts total */
.cashbook-bottom > :nth-last-child(2){
  color:#566a80 !important;
}

.cashbook-bottom > :nth-last-child(2) strong,
.cashbook-bottom > :nth-last-child(2) b{
  color:#078545 !important;
  font-size:18px !important;
}


/* Cash in hand */
.cashbook-bottom > :last-child{
  margin-left:8px;

  border:1px solid #bfe1d0 !important;
  border-radius:9px;

  background:#e2f7ea !important;

  color:#155e3c !important;
  font-weight:750 !important;
}

.cashbook-bottom > :last-child strong,
.cashbook-bottom > :last-child b{
  color:#08763e !important;
  font-size:20px !important;
}


/* ---------------------------
   Horizontal overflow cleanup
   --------------------------- */

.cashbook-sheet-wrap,
section:has(> .cashbook-sheet){
  max-width:100%;
  overflow-x:auto;
}


/* ---------------------------
   Responsive
   --------------------------- */

@media(max-width:1150px){
  .cashbook-entry{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }

  .cashbook-entry > button,
  .cashbook-entry [type="submit"]{
    width:100% !important;
  }

  .cashbook-sheet{
    min-width:900px;
  }
}

@media(max-width:700px){
  section.panel:has(.cashbook-entry) .panel-body{
    padding:15px !important;
  }

  .cashbook-date-controls{
    flex-wrap:wrap !important;
  }

  .cashbook-entry{
    grid-template-columns:1fr !important;
  }

  .cashbook-blue:not(.cashbook-bottom){
    align-items:flex-start !important;
    flex-direction:column !important;
  }

  .cashbook-opening{
    margin-left:0 !important;
  }

  .cashbook-blue.cashbook-bottom,
  .cashbook-bottom{
    align-items:stretch !important;
    flex-direction:column !important;
  }

  .cashbook-bottom > *{
    border-left:0 !important;
    border-top:1px solid #cbdced;
  }
}


/* Printing remains clean */
@media print{
  section.panel:has(.cashbook-entry){
    box-shadow:none !important;
  }

  .cashbook-blue:not(.cashbook-bottom){
    background:#fff !important;
    color:#000 !important;
    border:1px solid #444 !important;
  }

  .cashbook-blue:not(.cashbook-bottom) *{
    color:#000 !important;
  }

  .cashbook-sheet td:nth-child(5),
  .cashbook-sheet td:nth-child(6){
    color:#000 !important;
  }
}


/* =========================================================
   Purchase Bill — Fast 100+ Product Grid
   ========================================================= */

dialog:has(.purchase-fast-row){
  width:min(1580px,98vw) !important;
  max-width:1580px !important;
}

/* Compact bill-header area */
dialog:has(.purchase-fast-row) #modal-form{
  background:#f7faff;
}

dialog:has(.purchase-fast-row) #modal-form > .form-grid:first-child{
  padding:18px;
  border:1px solid #dfe8f2;
  border-radius:14px;
  background:#fff;
  box-shadow:0 5px 18px rgba(25,56,92,.04);
}

/* Fast-entry toolbar */
.purchase-grid-tools{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;

  margin:10px 0 8px;
  padding:10px 12px;

  border:1px solid #d8e5f2;
  border-radius:10px;

  background:#f3f8fe;
}

.purchase-grid-tools > div:first-child{
  display:flex;
  flex-direction:column;
  gap:2px;
}

.purchase-grid-tools strong{
  color:#284b72;
  font-size:12px;
}

.purchase-grid-tools small{
  color:#728398;
  font-size:10px;
}

.purchase-grid-tools-actions{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}

.purchase-grid-tools-actions button{
  min-height:34px;
  padding:0 11px;

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

  background:#fff;
  color:#35689f;

  font-size:10px;
  font-weight:750;

  box-shadow:none;
}

.purchase-grid-tools-actions button:hover{
  background:#eaf4ff;
  border-color:#a8c6e7;
}

/* Spreadsheet column header */
.purchase-grid-head,
.purchase-fast-row{
  display:grid !important;

  grid-template-columns:
    minmax(230px,2.4fr)
    72px
    minmax(115px,1.15fr)
    minmax(110px,1.1fr)
    minmax(200px,2fr)
    minmax(105px,1.05fr)
    86px
    86px
    98px
    42px !important;

  gap:8px !important;
}

.purchase-grid-head{
  position:sticky;
  top:0;
  z-index:8;

  align-items:center;

  margin:0 0 4px;
  padding:9px 10px;

  border:1px solid #d9e5f1;
  border-radius:9px;

  background:#eaf3fc;

  color:#3c5775;

  font-size:10px;
  font-weight:800;
}

.purchase-grid-head span{
  white-space:nowrap;
}

/* Every purchased product = one row */
.purchase-fast-row{
  position:relative;

  align-items:center !important;

  margin:0 0 5px !important;
  padding:7px 10px !important;

  border:1px solid #e0e8f1 !important;
  border-radius:9px !important;

  background:#fff !important;

  box-shadow:none !important;
}

.purchase-fast-row:hover{
  border-color:#c8d9eb !important;
  background:#fcfdff !important;
}

/* Hide repeated field-label text;
   spreadsheet header already describes every column */
.purchase-fast-row > label{
  min-width:0 !important;
  margin:0 !important;

  font-size:0 !important;
}

/* Restore input/search fonts */
.purchase-fast-row input,
.purchase-fast-row select,
.purchase-fast-row button,
.purchase-fast-row output,
.purchase-fast-row .smart-choice-search,
.purchase-fast-row .smart-choice-option{
  font-size:11px !important;
}

/* Product selector */
.purchase-fast-row .purchase-product-picker{
  grid-column:1 !important;
  grid-row:1 !important;

  min-width:0 !important;
}

.purchase-fast-row .smart-choice-box{
  width:100% !important;
}

.purchase-fast-row .smart-choice-search{
  width:100% !important;

  height:38px !important;
  min-height:38px !important;

  padding:7px 10px 7px 34px !important;

  border:1px solid #d3dfeb !important;
  border-radius:7px !important;

  background:#fff !important;
}

/* Hide redundant native product dropdown */
.purchase-fast-row .smart-choice-native{
  display:none !important;
}

/* Do not waste row height on match-status text */
.purchase-fast-row .smart-choice-status{
  display:none !important;
}

/* Smart autocomplete remains large/easy */
.purchase-fast-row .smart-choice-menu{
  z-index:10050 !important;

  min-width:430px;
  max-height:330px;

  border-radius:10px;

  box-shadow:0 18px 45px rgba(18,44,75,.20);
}

.purchase-fast-row .smart-choice-option{
  padding:10px 11px !important;
}

/* Qty */
.purchase-fast-row label:has([data-field="quantity"]){
  grid-column:2 !important;
  grid-row:1 !important;
}

/* Part No */
.purchase-fast-row label:has([data-field="part_number"]){
  grid-column:3 !important;
  grid-row:1 !important;
}

/* Brand */
.purchase-fast-row label:has([data-field="brand"]){
  grid-column:4 !important;
  grid-row:1 !important;
}

/* Description */
.purchase-fast-row .line-description{
  grid-column:5 !important;
  grid-row:1 !important;
}

/* Unit Cost */
.purchase-fast-row label:has([data-field="unit_price"]){
  grid-column:6 !important;
  grid-row:1 !important;
}

/* Discount */
.purchase-fast-row label:has([data-field="discount"]){
  grid-column:7 !important;
  grid-row:1 !important;
}

/* Tax */
.purchase-fast-row label:has([data-field="tax"]){
  grid-column:8 !important;
  grid-row:1 !important;
}

/* Line total */
.purchase-fast-row .purchase-line-total{
  grid-column:9 !important;
  grid-row:1 !important;

  display:flex;
  align-items:center;
  justify-content:flex-end;

  height:38px;
  min-width:0;

  padding:0 10px;

  border:1px solid #cfe0f1;
  border-radius:7px;

  background:#edf5fd;

  color:#255b93;

  font-size:12px !important;
  font-weight:800;
}

/* Delete */
.purchase-fast-row [data-action="remove-line"]{
  grid-column:10 !important;
  grid-row:1 !important;

  width:38px !important;
  min-width:38px !important;
  height:38px !important;
  min-height:38px !important;

  margin:0 !important;
  padding:0 !important;

  border:1px solid #efd4d8 !important;
  border-radius:7px !important;

  background:#fff5f6 !important;
  color:#c54a59 !important;

  box-shadow:none !important;
}

/* All row inputs */
.purchase-fast-row > label input,
.purchase-fast-row > label select{
  width:100% !important;
  min-width:0 !important;

  height:38px !important;
  min-height:38px !important;

  margin:0 !important;
  padding:7px 9px !important;

  border:1px solid #d5e0eb !important;
  border-radius:7px !important;

  background:#fff;
}

/* Auto-filled fields */
.purchase-fast-row [data-field="part_number"][readonly],
.purchase-fast-row [data-field="brand"][readonly]{
  background:#f5f8fb !important;
  color:#53677c !important;
}

/* Fast focus */
.purchase-fast-row input:focus,
.purchase-fast-row select:focus,
.purchase-fast-row .smart-choice-search:focus{
  border-color:#6c9edd !important;
  outline:0 !important;
  box-shadow:0 0 0 3px rgba(54,116,196,.09) !important;
}

/* Existing Add Item button becomes compact */
dialog:has(.purchase-fast-row) [data-action="add-line"]{
  width:auto !important;
  min-height:36px !important;

  margin:8px 0 0 auto !important;
  padding:0 14px !important;

  border:1px solid #bed4eb !important;
  border-radius:8px !important;

  background:#edf6ff !important;
  color:#346ca7 !important;

  font-size:11px !important;
  font-weight:750 !important;

  box-shadow:none !important;
}

/* Keep document total clearly visible */
dialog:has(.purchase-fast-row) #document-total{
  color:#174e84 !important;
  font-size:20px !important;
  font-weight:850 !important;
}

/* Sticky save/post footer for large 100-row bills */
dialog:has(.purchase-fast-row) .form-footer{
  position:sticky !important;
  bottom:0;
  z-index:30;

  margin-top:14px !important;
  padding:12px 18px !important;

  border-top:1px solid #dce5ef;

  background:rgba(255,255,255,.96) !important;
  backdrop-filter:blur(12px);
}

/* Tablet / small screens */
@media(max-width:1180px){
  .purchase-grid-head,
  .purchase-fast-row{
    grid-template-columns:
      minmax(220px,2.4fr)
      70px
      115px
      105px
      minmax(200px,2fr)
      105px
      85px
      85px
      95px
      40px !important;

    min-width:1180px;
  }

  dialog:has(.purchase-fast-row) #lines{
    overflow-x:auto;
    padding-bottom:8px;
  }
}

@media(max-width:720px){
  .purchase-grid-tools{
    align-items:flex-start;
    flex-direction:column;
  }
}


/* =========================================================
   Purchase Bill — inline supplier search / create
   ========================================================= */

.purchase-supplier-field{
  position:relative;
}

.purchase-supplier-field > select{
  margin-bottom:7px;
}

.purchase-supplier-tools{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  align-items:start;
}

.purchase-supplier-search-wrap{
  position:relative;
  min-width:0;
}

.purchase-supplier-search{
  width:100%;
  min-height:42px;
  padding:9px 12px;

  border:1px solid #d5e1ed;
  border-radius:9px;

  background:#fff;
}

.purchase-supplier-search:focus{
  border-color:#6e9fdf;
  outline:0;
  box-shadow:0 0 0 3px rgba(55,114,191,.09);
}

.purchase-new-supplier-button{
  min-height:42px;
  padding:0 14px;

  border:1px solid #bed4eb;
  border-radius:9px;

  background:#edf6ff;
  color:#316aa5;

  font-weight:750;
  white-space:nowrap;

  box-shadow:none;
}

.purchase-new-supplier-button:hover{
  background:#e2f0ff;
  border-color:#9fc1e5;
}

.purchase-supplier-results{
  position:absolute;
  z-index:10060;

  top:calc(100% + 5px);
  left:0;
  right:0;

  max-height:300px;
  overflow:auto;

  padding:6px;

  border:1px solid #d3e0ed;
  border-radius:10px;

  background:#fff;

  box-shadow:0 18px 45px rgba(18,45,78,.18);
}

.purchase-supplier-results[hidden]{
  display:none;
}

.purchase-supplier-results button{
  display:flex;
  flex-direction:column;
  gap:3px;

  width:100%;
  padding:9px 10px;

  border:0;
  border-radius:7px;

  background:transparent;
  color:#253a53;

  text-align:left;
  cursor:pointer;
}

.purchase-supplier-results button:hover{
  background:#edf6ff;
}

.purchase-supplier-results strong{
  font-size:12px;
}

.purchase-supplier-results small{
  color:#74869a;
  font-size:10px;
}

.purchase-new-supplier-editor{
  width:min(620px,94vw);
  border:0;
  border-radius:16px;
  padding:0;
  box-shadow:0 24px 70px rgba(15,23,42,.25);
}

@media(max-width:720px){
  .purchase-supplier-tools{
    grid-template-columns:1fr;
  }

  .purchase-new-supplier-button{
    width:100%;
  }
}


/* =========================================================
   Purchase Bill — Approved Login-Matched UI
   ========================================================= */

dialog:has(.purchase-fast-row){
  width:min(1540px,97vw) !important;
  max-width:1540px !important;
  max-height:95vh !important;

  padding:0 !important;
  overflow:hidden;

  border:0 !important;
  border-radius:20px !important;

  background:#f6f9fd !important;

  box-shadow:
    0 28px 80px rgba(18,46,82,.24),
    0 2px 8px rgba(15,23,42,.08) !important;
}


/* ---------------------------------------------------------
   Header — match login / Sales Invoice language
   --------------------------------------------------------- */

dialog:has(.purchase-fast-row) .modal-head{
  position:relative;

  display:grid !important;
  grid-template-columns:48px minmax(0,1fr) 44px !important;
  align-items:center !important;
  gap:14px !important;

  min-height:92px;
  padding:19px 24px !important;

  border-bottom:1px solid #e3ebf4 !important;

  background:
    radial-gradient(circle at 91% 0%,
      rgba(87,145,255,.15),
      transparent 31%),
    linear-gradient(
      135deg,
      #ffffff 0%,
      #f8fbff 58%,
      #edf5ff 100%
    ) !important;
}


dialog:has(.purchase-fast-row) .modal-head::before{
  content:'▤';

  grid-column:1;

  display:flex;
  align-items:center;
  justify-content:center;

  width:44px;
  height:44px;

  border:1px solid #cbdcf3;
  border-radius:13px;

  background:#eaf3ff;

  color:#1769ce;
  font-size:23px;
  font-weight:800;

  box-shadow:0 4px 12px rgba(44,92,157,.08);
}


dialog:has(.purchase-fast-row) .modal-head h2{
  grid-column:2;

  margin:0 !important;

  color:#14243b !important;

  font-size:25px !important;
  font-weight:800 !important;
  letter-spacing:-.35px;
}


dialog:has(.purchase-fast-row) .modal-head h2::after{
  content:'Create a new purchase bill and add the items below.';

  display:block;

  margin-top:4px;

  color:#75859b;

  font-size:11px;
  font-weight:500;
  letter-spacing:0;
}


dialog:has(.purchase-fast-row)
.modal-head [data-action="close"]{
  position:static !important;

  grid-column:3;
  justify-self:end;

  width:40px !important;
  min-width:40px !important;
  height:40px !important;

  padding:0 !important;

  border:1px solid #dae5f0 !important;
  border-radius:50% !important;

  background:#fff !important;
  color:#53677d !important;

  box-shadow:0 3px 10px rgba(15,23,42,.045) !important;
}


/* ---------------------------------------------------------
   Main form scroll area
   --------------------------------------------------------- */

dialog:has(.purchase-fast-row) #modal-form{
  max-height:calc(95vh - 92px) !important;
  overflow:auto !important;

  padding:18px 20px 0 !important;

  background:#f6f9fd !important;
}


/* ---------------------------------------------------------
   Bill information card
   --------------------------------------------------------- */

dialog:has(.purchase-fast-row)
#modal-form > .form-grid:first-child{
  position:relative;

  display:grid !important;
  grid-template-columns:repeat(12,minmax(0,1fr)) !important;

  gap:13px 15px !important;

  margin:0 0 16px !important;
  padding:62px 18px 18px !important;

  border:1px solid #dfe8f2 !important;
  border-radius:15px !important;

  background:#fff !important;

  box-shadow:0 6px 20px rgba(26,55,89,.045) !important;
}


dialog:has(.purchase-fast-row)
#modal-form > .form-grid:first-child::before{
  content:'Bill information';

  position:absolute;
  top:17px;
  left:18px;

  color:#17283f;

  font-size:16px;
  font-weight:800;
}


dialog:has(.purchase-fast-row)
#modal-form > .form-grid:first-child::after{
  content:'Supplier, dates, payment terms and reference information.';

  position:absolute;
  top:39px;
  left:18px;

  color:#7a899d;

  font-size:10px;
  font-weight:500;
}


/* Bill fields */

dialog:has(.purchase-fast-row)
#modal-form > .form-grid:first-child > label{
  color:#506178 !important;

  font-size:10px !important;
  font-weight:750 !important;
}


dialog:has(.purchase-fast-row)
#modal-form > .form-grid:first-child input,

dialog:has(.purchase-fast-row)
#modal-form > .form-grid:first-child select{
  width:100% !important;

  min-height:42px !important;

  margin-top:5px !important;
  padding:9px 11px !important;

  border:1px solid #d8e3ef !important;
  border-radius:9px !important;

  background:#fff !important;
  color:#24364d !important;
}


dialog:has(.purchase-fast-row)
#modal-form > .form-grid:first-child input:focus,

dialog:has(.purchase-fast-row)
#modal-form > .form-grid:first-child select:focus{
  border-color:#73a2e2 !important;
  outline:0 !important;

  box-shadow:0 0 0 3px rgba(64,123,205,.09) !important;
}


/* Supplier area */

dialog:has(.purchase-fast-row)
.purchase-supplier-field{
  grid-column:1 / span 5 !important;
}


dialog:has(.purchase-fast-row)
.purchase-supplier-tools{
  margin-top:6px;
}


/* Date */

dialog:has(.purchase-fast-row)
label:has([name="date"]){
  grid-column:6 / span 3 !important;
}


/* Due date */

dialog:has(.purchase-fast-row)
label:has([name="due_date"]){
  grid-column:9 / span 4 !important;
}


/* Payment method */

dialog:has(.purchase-fast-row)
label:has([name="payment_choice"]){
  grid-column:1 / span 5 !important;
}


/* Notes */

dialog:has(.purchase-fast-row)
label:has([name="notes"]){
  grid-column:6 / span 7 !important;
}


/* ---------------------------------------------------------
   Inline supplier search / button
   --------------------------------------------------------- */

dialog:has(.purchase-fast-row)
.purchase-supplier-tools{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto !important;

  gap:7px !important;
}


dialog:has(.purchase-fast-row)
.purchase-supplier-search{
  height:40px !important;
  min-height:40px !important;

  border-radius:8px !important;

  background:#fbfdff !important;
}


dialog:has(.purchase-fast-row)
.purchase-new-supplier-button{
  min-height:40px !important;

  padding:0 14px !important;

  border:1px solid #bcd2ec !important;
  border-radius:8px !important;

  background:#edf5ff !important;
  color:#326ba9 !important;

  font-size:10px !important;
  font-weight:800 !important;

  box-shadow:none !important;
}


/* ---------------------------------------------------------
   Items section card
   --------------------------------------------------------- */

dialog:has(.purchase-fast-row) #lines{
  position:relative;

  padding:0 12px 12px !important;

  border:1px solid #dfe8f2 !important;
  border-top:0 !important;

  border-radius:0 0 15px 15px !important;

  background:#fff !important;
}


/* Fast entry heading */

.purchase-grid-tools{
  margin:0 !important;

  padding:14px 16px !important;

  border:1px solid #dfe8f2 !important;
  border-bottom:0 !important;

  border-radius:15px 15px 0 0 !important;

  background:#fff !important;
}


.purchase-grid-tools > div:first-child strong{
  color:#17283f !important;

  font-size:16px !important;
  font-weight:800 !important;
}


.purchase-grid-tools > div:first-child small{
  color:#74859a !important;

  font-size:10px !important;
}


.purchase-grid-tools-actions{
  gap:7px !important;
}


.purchase-grid-tools-actions button{
  min-height:36px !important;

  padding:0 13px !important;

  border:1px solid #bed4eb !important;
  border-radius:8px !important;

  background:#fff !important;
  color:#3069a5 !important;

  font-size:10px !important;
  font-weight:800 !important;

  box-shadow:none !important;
}


.purchase-grid-tools-actions button:hover{
  background:#edf6ff !important;
}


/* ---------------------------------------------------------
   Spreadsheet header
   --------------------------------------------------------- */

.purchase-grid-head{
  grid-template-columns:
    32px
    minmax(220px,2.45fr)
    72px
    minmax(105px,1fr)
    minmax(110px,1fr)
    minmax(200px,2.15fr)
    minmax(100px,1fr)
    85px
    85px
    92px
    40px !important;

  gap:7px !important;

  margin:0 !important;
  padding:9px 8px !important;

  border:1px solid #dae6f2 !important;
  border-radius:8px !important;

  background:#edf5fd !important;

  color:#405a77 !important;

  font-size:9px !important;
  font-weight:800 !important;
}


.purchase-grid-head::before{
  content:'#';

  display:block;

  grid-column:1;
}


/* Shift existing header cells one column */

.purchase-grid-head > :nth-child(1){grid-column:2;}
.purchase-grid-head > :nth-child(2){grid-column:3;}
.purchase-grid-head > :nth-child(3){grid-column:4;}
.purchase-grid-head > :nth-child(4){grid-column:5;}
.purchase-grid-head > :nth-child(5){grid-column:6;}
.purchase-grid-head > :nth-child(6){grid-column:7;}
.purchase-grid-head > :nth-child(7){grid-column:8;}
.purchase-grid-head > :nth-child(8){grid-column:9;}
.purchase-grid-head > :nth-child(9){grid-column:10;}
.purchase-grid-head > :nth-child(10){grid-column:11;}


/* ---------------------------------------------------------
   Purchase rows
   --------------------------------------------------------- */

dialog:has(.purchase-fast-row) #lines{
  counter-reset:purchase-line;
}


.purchase-fast-row{
  counter-increment:purchase-line;

  grid-template-columns:
    32px
    minmax(220px,2.45fr)
    72px
    minmax(105px,1fr)
    minmax(110px,1fr)
    minmax(200px,2.15fr)
    minmax(100px,1fr)
    85px
    85px
    92px
    40px !important;

  gap:7px !important;

  min-height:52px !important;

  margin:4px 0 0 !important;
  padding:6px 8px !important;

  border:1px solid #e1e9f2 !important;
  border-radius:8px !important;

  background:#fff !important;
}


.purchase-fast-row::before{
  content:counter(purchase-line);

  grid-column:1;
  grid-row:1;

  display:flex;
  align-items:center;
  justify-content:center;

  color:#58708c;

  font-size:10px;
  font-weight:800;
}


/* Product */

.purchase-fast-row .purchase-product-picker{
  grid-column:2 !important;
}


/* Qty */

.purchase-fast-row label:has([data-field="quantity"]){
  grid-column:3 !important;
}


/* Part no */

.purchase-fast-row label:has([data-field="part_number"]){
  grid-column:4 !important;
}


/* Brand */

.purchase-fast-row label:has([data-field="brand"]){
  grid-column:5 !important;
}


/* Description */

.purchase-fast-row .line-description{
  grid-column:6 !important;
}


/* Unit cost */

.purchase-fast-row label:has([data-field="unit_price"]){
  grid-column:7 !important;
}


/* Discount */

.purchase-fast-row label:has([data-field="discount"]){
  grid-column:8 !important;
}


/* Tax */

.purchase-fast-row label:has([data-field="tax"]){
  grid-column:9 !important;
}


/* Total */

.purchase-fast-row .purchase-line-total{
  grid-column:10 !important;

  height:36px !important;

  padding:0 9px !important;

  border:1px solid #cfe0f1 !important;
  border-radius:7px !important;

  background:#edf6ff !important;

  color:#165a9d !important;

  font-size:11px !important;
  font-weight:850 !important;
}


/* Delete */

.purchase-fast-row [data-action="remove-line"]{
  grid-column:11 !important;

  width:36px !important;
  min-width:36px !important;
  height:36px !important;

  border-radius:7px !important;
}


/* Row inputs */

.purchase-fast-row > label input,
.purchase-fast-row > label select,
.purchase-fast-row .smart-choice-search{
  height:36px !important;
  min-height:36px !important;

  padding-top:6px !important;
  padding-bottom:6px !important;

  border-radius:7px !important;

  font-size:10px !important;
}


/* ---------------------------------------------------------
   Add another item
   --------------------------------------------------------- */

dialog:has(.purchase-fast-row)
[data-action="add-line"]{
  display:inline-flex !important;
  align-items:center;
  justify-content:center;

  width:auto !important;

  margin:9px 0 1px !important;
  padding:0 14px !important;

  min-height:36px !important;

  border:1px dashed #9fc1e6 !important;
  border-radius:8px !important;

  background:#f7fbff !important;
  color:#2267ab !important;

  font-size:10px !important;
  font-weight:800 !important;
}


/* ---------------------------------------------------------
   Total / footer area
   --------------------------------------------------------- */

dialog:has(.purchase-fast-row) #document-total{
  display:flex !important;
  align-items:center;
  justify-content:flex-end;

  min-height:58px;

  margin-top:10px;
  padding:12px 17px;

  border:1px solid #d7e5f3;
  border-radius:11px;

  background:
    linear-gradient(90deg,#f6faff,#e9f4ff);

  color:#135995 !important;

  font-size:22px !important;
  font-weight:900 !important;
}


/* Sticky action footer */

dialog:has(.purchase-fast-row) .form-footer{
  position:sticky !important;
  bottom:0;
  z-index:30;

  display:flex !important;
  justify-content:flex-end !important;
  gap:9px !important;

  margin:14px -20px 0 !important;
  padding:13px 20px !important;

  border-top:1px solid #e0e8f1 !important;

  background:rgba(255,255,255,.96) !important;

  backdrop-filter:blur(12px);
}


dialog:has(.purchase-fast-row)
.form-footer button{
  min-height:40px !important;

  padding:0 18px !important;

  border-radius:9px !important;

  font-weight:800 !important;
}


dialog:has(.purchase-fast-row)
.form-footer .primary{
  background:
    linear-gradient(135deg,#2d7ddd,#1767c6) !important;

  border-color:#1767c6 !important;

  box-shadow:
    0 6px 16px rgba(32,104,193,.17) !important;
}


/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media(max-width:1180px){
  .purchase-grid-head,
  .purchase-fast-row{
    min-width:1260px;
  }

  dialog:has(.purchase-fast-row) #lines{
    overflow-x:auto;
  }
}


@media(max-width:760px){

  dialog:has(.purchase-fast-row){
    width:98vw !important;
    border-radius:13px !important;
  }

  dialog:has(.purchase-fast-row) #modal-form{
    padding:12px 12px 0 !important;
  }

  dialog:has(.purchase-fast-row)
  #modal-form > .form-grid:first-child{
    grid-template-columns:1fr !important;

    padding:60px 13px 14px !important;
  }

  dialog:has(.purchase-fast-row)
  #modal-form > .form-grid:first-child > *{
    grid-column:1 !important;
  }

  dialog:has(.purchase-fast-row)
  .purchase-supplier-tools{
    grid-template-columns:1fr !important;
  }

  dialog:has(.purchase-fast-row)
  .form-footer{
    margin-left:-12px !important;
    margin-right:-12px !important;
  }
}


/* =========================================================
   Purchase Bills list — header action fix
   ========================================================= */

.purchase-bills-page-head{
  display:flex !important;
  align-items:flex-start !important;
  justify-content:space-between !important;
  gap:20px !important;

  width:100% !important;
  max-width:100% !important;

  overflow:visible !important;
}

.purchase-bills-page-head > div:first-child{
  flex:1 1 auto !important;
  min-width:0 !important;
}

.purchase-bills-page-head > .actions{
  display:flex !important;
  flex:0 0 auto !important;
  align-items:center !important;
  justify-content:flex-end !important;

  gap:10px !important;

  margin-left:auto !important;

  width:auto !important;
  max-width:none !important;

  overflow:visible !important;
  white-space:nowrap !important;
}

.purchase-bills-page-head > .actions button{
  flex:0 0 auto !important;
  width:auto !important;
  min-width:max-content !important;

  white-space:nowrap !important;
}

@media(max-width:850px){
  .purchase-bills-page-head{
    flex-wrap:wrap !important;
  }

  .purchase-bills-page-head > .actions{
    width:100% !important;
    margin-left:0 !important;
    justify-content:flex-start !important;
    flex-wrap:wrap !important;
  }
}


/* =========================================================
   Purchase Bills List — Approved Premium Design
   ONLY affects the Purchase Bills LIST page
   ========================================================= */

.purchase-list-page{
  width:100%;
}


/* =========================================================
   Premium page header
   ========================================================= */

.purchase-list-page .purchase-bills-page-head{
  position:relative;

  display:grid !important;
  grid-template-columns:58px minmax(0,1fr) auto !important;
  align-items:center !important;

  gap:17px !important;

  margin:0 0 18px !important;
  padding:21px 24px !important;

  border:1px solid #dce7f2 !important;
  border-radius:17px !important;

  overflow:hidden !important;

  background:
    radial-gradient(
      circle at 91% 0%,
      rgba(61,131,222,.17),
      transparent 37%
    ),
    linear-gradient(
      135deg,
      #ffffff 0%,
      #f8fbff 55%,
      #edf5ff 100%
    ) !important;

  box-shadow:
    0 8px 28px rgba(26,58,96,.055) !important;
}


/* Blue decorative ribbon */
.purchase-list-page .purchase-bills-page-head::after{
  content:'';

  position:absolute;

  right:175px;
  top:-70px;

  width:390px;
  height:190px;

  pointer-events:none;

  opacity:.5;

  transform:rotate(-19deg);

  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(76,145,235,.15),
      rgba(76,145,235,.28),
      transparent
    );
}


/* Icon */
.purchase-list-page .purchase-bills-page-head::before{
  content:'▤';

  position:relative;
  z-index:2;

  grid-column:1;

  display:flex;
  align-items:center;
  justify-content:center;

  width:52px;
  height:52px;

  border:1px solid #c9dcf3;
  border-radius:14px;

  background:
    linear-gradient(
      145deg,
      #eaf3ff,
      #dcecff
    );

  color:#176bd0;

  font-size:27px;
  font-weight:850;

  box-shadow:
    0 5px 14px rgba(39,91,158,.08);
}


/* Title */
.purchase-list-page
.purchase-bills-page-head > div:first-child{
  position:relative;
  z-index:2;

  grid-column:2;

  min-width:0 !important;
}

.purchase-list-page
.purchase-bills-page-head h1{
  margin:0 !important;

  color:#15263e !important;

  font-size:27px !important;
  font-weight:850 !important;

  letter-spacing:-.45px;
}

.purchase-list-page
.purchase-bills-page-head p{
  margin:5px 0 0 !important;

  color:#71839a !important;

  font-size:12px !important;
  font-weight:500 !important;
}


/* Header buttons */
.purchase-list-page
.purchase-bills-page-head > .actions{
  position:relative;
  z-index:3;

  grid-column:3;

  display:flex !important;
  align-items:center !important;

  gap:10px !important;

  width:auto !important;

  margin:0 !important;

  white-space:nowrap !important;
}

.purchase-list-page
.purchase-bills-page-head > .actions button{
  min-height:43px !important;

  padding:0 17px !important;

  border-radius:10px !important;

  font-size:11px !important;
  font-weight:800 !important;

  white-space:nowrap !important;

  box-shadow:none !important;
}


/* Export */
.purchase-list-page
.purchase-bills-page-head > .actions
button:not(.primary){
  border:1px solid #d3e0ed !important;

  background:#fff !important;
  color:#415d78 !important;
}

.purchase-list-page
.purchase-bills-page-head > .actions
button:not(.primary):hover{
  background:#f6faff !important;
}


/* Purchase Bill button */
.purchase-list-page
.purchase-bills-page-head > .actions .primary{
  border:1px solid #246ac0 !important;

  background:
    linear-gradient(
      135deg,
      #3480dc,
      #2468bd
    ) !important;

  color:#fff !important;

  box-shadow:
    0 7px 17px rgba(38,105,190,.18) !important;
}


/* =========================================================
   Statistics cards
   ========================================================= */

.purchase-list-stats{
  display:grid;

  grid-template-columns:repeat(4,minmax(0,1fr));

  gap:12px;

  margin-bottom:18px;
}


.purchase-stat-card{
  display:grid;

  grid-template-columns:52px minmax(0,1fr);

  align-items:center;

  gap:13px;

  min-height:104px;

  padding:15px;

  border:1px solid #dce7f2;
  border-radius:14px;

  background:
    linear-gradient(
      145deg,
      #ffffff,
      #f8fbff
    );

  box-shadow:
    0 6px 20px rgba(24,55,91,.04);
}


.purchase-stat-icon{
  display:flex;
  align-items:center;
  justify-content:center;

  width:48px;
  height:48px;

  border-radius:12px;

  background:#e8f2ff;

  color:#176bd0;

  font-size:23px;
  font-weight:850;
}


.purchase-stat-card > div{
  display:flex;
  flex-direction:column;
  gap:2px;

  min-width:0;
}


.purchase-stat-card small{
  color:#65788f;

  font-size:10px;
  font-weight:700;
}


.purchase-stat-card strong{
  color:#176bd0;

  font-size:20px;
  font-weight:850;

  line-height:1.25;

  font-variant-numeric:tabular-nums;
}


.purchase-stat-card span:not(.purchase-stat-icon){
  color:#8390a1;

  font-size:9px;
  font-weight:500;
}


/* Amount card */
.purchase-stat-green{
  border-color:#d2eadf;

  background:
    linear-gradient(
      145deg,
      #ffffff,
      #f3fbf7
    );
}

.purchase-stat-green .purchase-stat-icon{
  background:#e5f6ed;
  color:#09905a;
}

.purchase-stat-green strong{
  color:#07874f;
}


/* Outstanding card */
.purchase-stat-orange{
  border-color:#f0e1c9;

  background:
    linear-gradient(
      145deg,
      #ffffff,
      #fffaf2
    );
}

.purchase-stat-orange .purchase-stat-icon{
  background:#fff1da;
  color:#de8a06;
}

.purchase-stat-orange strong{
  color:#d27b00;
}


/* =========================================================
   Search & filter card
   ========================================================= */

.purchase-list-filter-card{
  display:grid;

  grid-template-columns:minmax(280px,2.2fr) minmax(150px,1fr) minmax(160px,1fr) auto;

  align-items:end;

  gap:12px;

  margin-bottom:18px;
  padding:16px;

  border:1px solid #dce7f2;
  border-radius:14px;

  background:#fff;

  box-shadow:
    0 6px 20px rgba(24,55,91,.035);
}


.purchase-list-filter-card label{
  display:flex;
  flex-direction:column;

  gap:5px;

  min-width:0;

  color:#54687f;

  font-size:9px;
  font-weight:800;
}


.purchase-list-filter-card select,
.purchase-list-filter-card input{
  width:100%;

  min-width:0;
  min-height:44px;

  padding:9px 12px;

  border:1px solid #d4e0ec;
  border-radius:9px;

  background:#fff;

  color:#293e56;

  font-size:11px;
}


.purchase-list-filter-card select:focus,
.purchase-list-filter-card input:focus{
  border-color:#72a2e2;

  outline:0;

  box-shadow:
    0 0 0 3px rgba(62,122,202,.09);
}


/* Search */
.purchase-list-search{
  position:relative;
}

.purchase-list-search > span{
  position:absolute;

  left:14px;
  bottom:11px;

  color:#607b98;

  font-size:21px;

  line-height:1;

  z-index:2;
}

.purchase-list-search input{
  padding-left:42px !important;
}


/* Clear */
.purchase-list-clear{
  min-height:44px;

  padding:0 17px;

  border:1px solid #d0deec;
  border-radius:9px;

  background:#fff;

  color:#3571af;

  font-size:10px;
  font-weight:800;

  white-space:nowrap;

  box-shadow:none;
}

.purchase-list-clear:hover{
  background:#f3f8fd;
}


/* =========================================================
   Main table card
   ========================================================= */

.purchase-list-panel{
  overflow:hidden !important;

  margin:0 !important;

  border:1px solid #dce7f2 !important;
  border-radius:15px !important;

  background:#fff !important;

  box-shadow:
    0 8px 26px rgba(27,58,93,.045) !important;
}


.purchase-list-panel .table-wrap{
  overflow-x:auto !important;
}


/* Table */
.purchase-list-table{
  width:100% !important;

  border-collapse:separate !important;
  border-spacing:0 !important;

  background:#fff !important;
}


.purchase-list-table thead th{
  padding:13px 13px !important;

  border-bottom:1px solid #dce6f0 !important;

  background:
    linear-gradient(
      180deg,
      #f8fbff,
      #f1f6fc
    ) !important;

  color:#587087 !important;

  font-size:9px !important;
  font-weight:850 !important;

  text-align:left !important;

  white-space:nowrap !important;
}


.purchase-list-table tbody tr{
  background:#fff;

  transition:
    background .12s ease;
}


.purchase-list-table tbody tr:nth-child(even){
  background:#fcfdff;
}


.purchase-list-table tbody tr:hover{
  background:#f4f9ff;
}


.purchase-list-table tbody td{
  padding:15px 13px !important;

  border-bottom:1px solid #e9eff5 !important;

  color:#33485f !important;

  font-size:10px !important;

  vertical-align:middle !important;
}


/* Number column */
.purchase-list-table th:first-child,
.purchase-list-table td:first-child{
  width:45px;

  text-align:center !important;
}


/* Bill number */
.purchase-bill-number{
  color:#146ac5 !important;

  font-weight:850 !important;
}


/* Money */
.purchase-total,
.purchase-paid,
.purchase-balance{
  font-weight:800 !important;

  font-variant-numeric:tabular-nums;
}


.purchase-total{
  color:#126dcc !important;
}

.purchase-paid{
  color:#08894e !important;
}

.purchase-balance{
  color:#d47b02 !important;
}


/* =========================================================
   Status badge
   ========================================================= */

.purchase-list-table .badge{
  display:inline-flex !important;

  align-items:center;
  justify-content:center;

  min-width:70px;

  padding:6px 10px !important;

  border-radius:999px !important;

  font-size:9px !important;
  font-weight:800 !important;

  text-transform:capitalize;
}


.purchase-list-table .badge.posted{
  border:1px solid #c6e9d7 !important;

  background:#e8f7ef !important;

  color:#087749 !important;
}


.purchase-list-table .badge.draft{
  border:1px solid #eadfbb !important;

  background:#fff8e5 !important;

  color:#9a6b07 !important;
}


/* =========================================================
   Actions
   ========================================================= */

.purchase-list-actions{
  min-width:100px;

  white-space:nowrap;

  text-align:right !important;
}


.purchase-list-actions button{
  min-height:34px !important;

  margin:2px !important;
  padding:0 11px !important;

  border:1px solid #d0dfed !important;
  border-radius:8px !important;

  background:#fff !important;

  color:#316ca7 !important;

  font-size:9px !important;
  font-weight:800 !important;

  box-shadow:none !important;
}


.purchase-list-actions button:hover{
  border-color:#a8c5e3 !important;

  background:#edf6ff !important;
}


/* =========================================================
   Footer / pagination
   ========================================================= */

.purchase-list-footer{
  display:flex;

  align-items:center;
  justify-content:space-between;

  gap:16px;

  min-height:58px;

  padding:12px 16px;

  border-top:1px solid #e3ebf3;

  background:#fbfdff;

  color:#75869a;

  font-size:10px;
}


.purchase-list-footer strong{
  color:#344d68;
}


.purchase-list-pagination{
  display:flex;

  align-items:center;

  gap:7px;
}


.purchase-list-pagination button,
.purchase-list-pagination strong{
  display:flex;

  align-items:center;
  justify-content:center;

  width:34px;
  height:34px;

  margin:0;
  padding:0;

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

  background:#fff;

  color:#58708a;

  box-shadow:none;
}


.purchase-list-pagination strong{
  border-color:#2571c8;

  background:#2674cd;

  color:#fff;
}


.purchase-list-pagination button:disabled{
  opacity:.5;

  cursor:default;
}


/* =========================================================
   Empty state
   ========================================================= */

.purchase-list-empty{
  height:220px;

  text-align:center !important;

  color:#7b8c9f !important;
}


.purchase-list-empty strong{
  display:block;

  margin-bottom:5px;

  color:#344b63;

  font-size:14px;
}


.purchase-list-empty span{
  font-size:10px;
}


/* =========================================================
   Responsive
   ========================================================= */

@media(max-width:1100px){

  .purchase-list-stats{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .purchase-list-filter-card{
    grid-template-columns:1fr 1fr;
  }

  .purchase-list-search{
    grid-column:1 / -1;
  }
}


@media(max-width:760px){

  .purchase-list-page .purchase-bills-page-head{
    grid-template-columns:46px 1fr !important;

    padding:17px !important;
  }

  .purchase-list-page .purchase-bills-page-head::before{
    width:42px;
    height:42px;

    font-size:21px;
  }

  .purchase-list-page
  .purchase-bills-page-head > .actions{
    grid-column:1 / -1;

    width:100% !important;

    margin-top:5px !important;

    flex-wrap:wrap;
  }

  .purchase-list-stats{
    grid-template-columns:1fr;
  }

  .purchase-list-filter-card{
    grid-template-columns:1fr;
  }

  .purchase-list-search{
    grid-column:auto;
  }

  .purchase-list-clear{
    width:100%;
  }

  .purchase-list-table{
    min-width:950px;
  }

  .purchase-list-footer{
    align-items:flex-start;
    flex-direction:column;
  }
}


/* =========================================================
   Purchase Bills List — final compact polish
   ========================================================= */

.purchase-list-page .purchase-list-filter-card{
  gap:10px !important;
  padding:12px 14px !important;
}

.purchase-list-page .purchase-list-filter-card input,
.purchase-list-page .purchase-list-filter-card select{
  min-height:40px !important;
  height:40px !important;
}

.purchase-list-page .purchase-list-clear{
  min-height:40px !important;
  height:40px !important;
}

.purchase-list-page .purchase-list-search > span{
  bottom:9px !important;
}


/* =========================================================
   Chart of Accounts — Premium Hierarchy UI
   Scoped ONLY to the Chart of Accounts page
   ========================================================= */

.coa-page{
  --coa-text:#102a4c;
  --coa-muted:#718399;
  --coa-border:#d8e5f1;
  --coa-bg:#f5f9fd;

  width:100%;
}


/* =========================================================
   Theme colors
   ========================================================= */

.coa-theme-assets{
  --coa-accent:#1677db;
  --coa-soft:#eaf4ff;
  --coa-border-theme:#cfe5fb;
}

.coa-theme-liabilities{
  --coa-accent:#e94762;
  --coa-soft:#fff0f3;
  --coa-border-theme:#f6d3da;
}

.coa-theme-capital{
  --coa-accent:#7547d8;
  --coa-soft:#f3efff;
  --coa-border-theme:#ddd3fa;
}

.coa-theme-revenue{
  --coa-accent:#13a86b;
  --coa-soft:#eaf9f2;
  --coa-border-theme:#cdeede;
}

.coa-theme-expenditures{
  --coa-accent:#f2a900;
  --coa-soft:#fff7df;
  --coa-border-theme:#f5e1a5;
}

.coa-theme-neutral{
  --coa-accent:#60778f;
  --coa-soft:#eef3f7;
  --coa-border-theme:#d9e2e9;
}


/* =========================================================
   Page hero
   ========================================================= */

.coa-page .coa-page-head{
  position:relative;

  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;

  gap:20px !important;

  margin-bottom:16px !important;
  padding:22px 24px !important;

  border:1px solid #d7e4f0 !important;
  border-radius:17px !important;

  overflow:hidden;

  background:
    radial-gradient(
      circle at 88% -25%,
      rgba(35,120,218,.18),
      transparent 42%
    ),
    linear-gradient(
      135deg,
      #ffffff 0%,
      #f8fbff 56%,
      #edf5ff 100%
    ) !important;

  box-shadow:
    0 8px 28px rgba(22,56,92,.055) !important;
}


.coa-page .coa-page-head::before{
  content:'';

  position:absolute;

  right:140px;
  top:-80px;

  width:360px;
  height:200px;

  transform:rotate(-18deg);

  pointer-events:none;

  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(45,139,228,.09),
      rgba(45,139,228,.17),
      transparent
    );
}


.coa-page .coa-page-head > div:first-child,
.coa-page .coa-page-head > .actions{
  position:relative;
  z-index:2;
}


.coa-page .coa-page-head h1{
  margin:0 !important;

  color:#102a4c !important;

  font-size:27px !important;
  font-weight:850 !important;

  letter-spacing:-.45px;
}


.coa-page .coa-page-head p{
  margin:5px 0 0 !important;

  color:#718399 !important;

  font-size:11px !important;
}


.coa-page .coa-page-head > .actions{
  display:flex !important;

  gap:9px !important;

  white-space:nowrap;
}


.coa-page .coa-header-add{
  min-height:42px !important;

  padding:0 16px !important;

  border:1px solid #bcd2e9 !important;
  border-radius:10px !important;

  background:#fff !important;

  color:#176dcc !important;

  font-size:10px !important;
  font-weight:800 !important;
}


.coa-page .coa-header-record{
  min-height:42px !important;

  padding:0 17px !important;

  border:1px solid #1767bb !important;
  border-radius:10px !important;

  background:
    linear-gradient(
      135deg,
      #2d82df,
      #1767bb
    ) !important;

  color:#fff !important;

  font-size:10px !important;
  font-weight:800 !important;

  box-shadow:
    0 7px 18px rgba(27,105,191,.18) !important;
}


/* =========================================================
   Five accounting category cards
   ========================================================= */

.coa-summary{
  display:grid;

  grid-template-columns:repeat(5,minmax(0,1fr));

  gap:11px;

  margin-bottom:16px;
}


.coa-summary-card{
  position:relative;

  display:grid;

  grid-template-columns:45px minmax(0,1fr);

  align-items:center;

  gap:11px;

  min-height:88px;

  padding:13px;

  border:1px solid var(--coa-border-theme);
  border-radius:13px;

  overflow:hidden;

  background:
    linear-gradient(
      145deg,
      #fff,
      var(--coa-soft)
    );

  box-shadow:
    0 5px 17px rgba(24,55,91,.035);
}


.coa-summary-card::after{
  content:'';

  position:absolute;

  right:-20px;
  bottom:-28px;

  width:70px;
  height:70px;

  border-radius:50%;

  background:var(--coa-accent);

  opacity:.055;
}


.coa-summary-icon{
  display:flex;

  align-items:center;
  justify-content:center;

  width:43px;
  height:43px;

  border-radius:11px;

  background:var(--coa-soft);

  color:var(--coa-accent);

  font-size:17px;
  font-weight:900;

  border:1px solid var(--coa-border-theme);
}


.coa-summary-card > div{
  display:flex;

  flex-direction:column;

  min-width:0;
}


.coa-summary-card small{
  margin-bottom:1px;

  color:#667d94;

  font-size:9px;
  font-weight:800;

  text-transform:uppercase;
  letter-spacing:.35px;
}


.coa-summary-card strong{
  color:var(--coa-accent);

  font-size:22px;
  font-weight:900;

  line-height:1.15;

  font-variant-numeric:tabular-nums;
}


.coa-summary-card div span{
  color:#8493a3;

  font-size:9px;
}


/* =========================================================
   Hierarchy — Head Level 1/2/3
   ========================================================= */

.coa-hierarchy-grid{
  display:grid;

  grid-template-columns:repeat(3,minmax(0,1fr));

  align-items:start;

  gap:13px;

  margin-bottom:17px;
}


.coa-head-panel{
  overflow:hidden;

  margin:0 !important;

  border:1px solid #d9e5f0;
  border-radius:15px;

  background:#fff;

  box-shadow:
    0 7px 22px rgba(22,55,90,.045);
}


.coa-head-title{
  display:flex;

  align-items:center;

  gap:11px;

  min-height:68px;

  padding:13px 15px;

  color:#fff;
}


.coa-level-1 .coa-head-title{
  background:
    linear-gradient(
      135deg,
      #0f569c,
      #1974cf
    );
}


.coa-level-2 .coa-head-title{
  background:
    linear-gradient(
      135deg,
      #1975d3,
      #2d8be4
    );
}


.coa-level-3 .coa-head-title{
  background:
    linear-gradient(
      135deg,
      #123f70,
      #0d3159
    );
}


.coa-level-number{
  display:flex;

  align-items:center;
  justify-content:center;

  width:39px;
  height:39px;

  flex:0 0 auto;

  border:1px solid rgba(255,255,255,.24);
  border-radius:10px;

  background:rgba(255,255,255,.12);

  font-size:11px;
  font-weight:900;

  letter-spacing:.5px;
}


.coa-head-title h3{
  margin:0 !important;

  color:#fff !important;

  font-size:14px !important;
  font-weight:850 !important;
}


.coa-head-title small{
  display:block;

  margin-top:2px;

  color:rgba(255,255,255,.72);

  font-size:8px;
  font-weight:600;
}


.coa-head-table{
  padding:0;
}


.coa-head-panel .table-wrap{
  overflow:auto;
}


.coa-head-panel table{
  width:100% !important;

  border-collapse:separate !important;
  border-spacing:0 !important;
}


.coa-head-panel thead th{
  padding:10px 10px !important;

  border-bottom:1px solid #dce7f1 !important;

  background:#f4f8fc !important;

  color:#637a91 !important;

  font-size:8px !important;
  font-weight:850 !important;

  text-transform:uppercase;
  letter-spacing:.25px;

  white-space:nowrap;
}


.coa-head-panel tbody tr{
  background:#fff;
}


.coa-head-panel tbody tr:nth-child(even){
  background:#f9fbfe;
}


.coa-head-panel tbody tr:hover{
  background:#f1f7fd;
}


.coa-head-panel tbody td{
  padding:10px 10px !important;

  border-bottom:1px solid #e8eef5 !important;

  color:#334b64 !important;

  font-size:9px !important;

  vertical-align:middle !important;
}


.coa-category-code{
  display:inline-flex;

  align-items:center;
  justify-content:center;

  min-width:44px;

  padding:4px 7px;

  border:1px solid var(--coa-border-theme);
  border-radius:7px;

  background:var(--coa-soft);

  color:var(--coa-accent);

  font-weight:850;

  font-variant-numeric:tabular-nums;

  cursor:context-menu;
}


.coa-page .coa-category-btn{
  width:100%;

  min-height:31px !important;

  padding:5px 8px !important;

  border:1px solid var(--coa-border-theme) !important;
  border-radius:8px !important;

  background:var(--coa-soft) !important;

  color:var(--coa-accent) !important;

  font-size:9px !important;
  font-weight:750 !important;

  text-align:left !important;

  box-shadow:none !important;
}


.coa-page .coa-category-btn:hover{
  transform:none !important;

  filter:brightness(.985);
}


.coa-page .coa-category-btn.primary{
  border-color:var(--coa-accent) !important;

  background:var(--coa-accent) !important;

  color:#fff !important;

  box-shadow:
    0 4px 10px rgba(25,75,125,.12) !important;
}


.coa-head-actions{
  display:flex;

  flex-wrap:wrap;

  gap:7px;

  padding:11px;

  border-top:1px solid #e1eaf3;

  background:#fbfdff;
}


.coa-page .coa-outline-action,
.coa-page .coa-add-account-action{
  min-height:34px !important;

  padding:0 10px !important;

  border:1px solid #cbdcea !important;
  border-radius:8px !important;

  background:#fff !important;

  color:#316da9 !important;

  font-size:8px !important;
  font-weight:800 !important;

  box-shadow:none !important;
}


.coa-page .coa-add-account-action{
  border-color:#9ec8ec !important;

  background:#eef7ff !important;

  color:#176cca !important;
}


/* =========================================================
   Account list
   ========================================================= */

.coa-account-panel{
  overflow:hidden !important;

  margin:0 !important;

  padding:0 !important;

  border:1px solid #d9e5f0 !important;
  border-radius:15px !important;

  background:#fff !important;

  box-shadow:
    0 8px 25px rgba(23,55,91,.045) !important;
}


.coa-account-list-heading{
  display:flex;

  align-items:center;
  justify-content:space-between;

  gap:18px;

  padding:17px 18px;

  border-bottom:1px solid #dfe8f1;

  background:
    linear-gradient(
      135deg,
      #ffffff,
      #f7fbff
    );
}


.coa-section-kicker{
  display:block;

  margin-bottom:5px;

  color:#1a71cb;

  font-size:8px;
  font-weight:900;

  letter-spacing:1px;
}


.coa-account-title-line{
  display:flex;

  align-items:center;

  flex-wrap:wrap;

  gap:8px;
}


.coa-account-title-line h3{
  margin:0 !important;

  color:#18314e !important;

  font-size:16px !important;
  font-weight:850 !important;
}


.coa-account-list-heading p{
  margin:6px 0 0;

  color:#74879a;

  font-size:9px;
}


.coa-selected-badge{
  display:inline-flex;

  align-items:center;

  padding:5px 9px;

  border:1px solid var(--coa-border-theme);
  border-radius:999px;

  background:var(--coa-soft);

  color:var(--coa-accent);

  font-size:8px;
  font-weight:850;
}


.coa-page .coa-toggle-all{
  min-height:36px !important;

  padding:0 12px !important;

  border:1px solid #c9dbe9 !important;
  border-radius:8px !important;

  background:#fff !important;

  color:#356eaa !important;

  font-size:8px !important;
  font-weight:800 !important;

  white-space:nowrap;

  box-shadow:none !important;
}


/* Account table */

.coa-account-table .table-wrap{
  overflow:auto !important;
}


.coa-account-table table{
  width:100% !important;

  border-collapse:separate !important;
  border-spacing:0 !important;
}


.coa-account-table thead th{
  padding:11px 12px !important;

  border-bottom:1px solid #dce6f0 !important;

  background:
    linear-gradient(
      180deg,
      #f8fbff,
      #f1f6fb
    ) !important;

  color:#587087 !important;

  font-size:8px !important;
  font-weight:850 !important;

  text-transform:uppercase;
  letter-spacing:.25px;

  white-space:nowrap !important;
}


.coa-account-table tbody tr{
  background:#fff;

  transition:background .12s ease;
}


.coa-account-table tbody tr:nth-child(even){
  background:#fafcff;
}


.coa-account-table tbody tr:hover{
  background:#f3f8fd;
}


.coa-account-table tbody td{
  padding:12px !important;

  border-bottom:1px solid #e9eff5 !important;

  color:#344a61 !important;

  font-size:9px !important;

  vertical-align:middle !important;
}


.coa-account-code{
  display:inline-flex;

  align-items:center;
  justify-content:center;

  min-width:55px;

  padding:5px 8px;

  border:1px solid var(--coa-border-theme);
  border-radius:7px;

  background:var(--coa-soft);

  color:var(--coa-accent);

  font-weight:850;

  font-variant-numeric:tabular-nums;

  cursor:context-menu;
}


.coa-account-name{
  display:flex;

  flex-direction:column;

  gap:2px;
}


.coa-account-name strong{
  color:#263e58;

  font-size:9px;
  font-weight:750;
}


.coa-account-name small{
  width:max-content;

  padding:2px 5px;

  border-radius:5px;

  background:#f2f3f5;

  color:#9299a1;

  font-size:7px;
  font-weight:750;
}


.coa-money{
  font-weight:800;

  font-variant-numeric:tabular-nums;
}


.coa-debit{
  color:#1671cb;
}


.coa-credit{
  color:#d85561;
}


.coa-row-actions{
  display:flex;

  align-items:center;

  gap:5px;

  white-space:nowrap;
}


.coa-page .coa-view-account,
.coa-page .coa-personal-expense{
  min-height:31px !important;

  padding:0 9px !important;

  border:1px solid #cbddea !important;
  border-radius:7px !important;

  background:#fff !important;

  color:#3371ac !important;

  font-size:8px !important;
  font-weight:800 !important;

  box-shadow:none !important;
}


.coa-page .coa-view-account:hover{
  background:#edf6ff !important;
}


.coa-page .coa-personal-expense{
  border-color:#f0d7b2 !important;

  background:#fff9ef !important;

  color:#b26d06 !important;
}


/* =========================================================
   Responsive
   ========================================================= */

@media(max-width:1180px){

  .coa-summary{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .coa-hierarchy-grid{
    grid-template-columns:1fr;
  }

}


@media(max-width:780px){

  .coa-page .coa-page-head{
    align-items:flex-start !important;
    flex-direction:column !important;
  }

  .coa-page .coa-page-head > .actions{
    width:100% !important;

    flex-wrap:wrap;
  }

  .coa-summary{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .coa-account-list-heading{
    align-items:flex-start;

    flex-direction:column;
  }

  .coa-account-table table{
    min-width:850px;
  }

}


@media(max-width:520px){

  .coa-summary{
    grid-template-columns:1fr;
  }

}


/* =========================================================
   Chart of Accounts — Final Visual Polish
   ========================================================= */

/* More compact hierarchy cards */
.coa-page .coa-head-title{
  min-height:56px !important;
  padding:10px 13px !important;
  gap:9px !important;
}

.coa-page .coa-level-number{
  width:36px !important;
  height:36px !important;
  border-radius:9px !important;
}

.coa-page .coa-head-title h3{
  padding:0 !important;
  margin:0 !important;
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
}

.coa-page .coa-head-title h3::before,
.coa-page .coa-head-title h3::after{
  display:none !important;
}

/* Remove any inherited dark rectangle behind title text */
.coa-page .coa-head-title > div{
  padding:0 !important;
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
}

.coa-page .coa-head-title small{
  margin-top:1px !important;
}

/* Tighter table rows */
.coa-page .coa-head-panel thead th{
  padding:8px 10px !important;
}

.coa-page .coa-head-panel tbody td{
  padding:8px 10px !important;
}

/* Softer selected category */
.coa-page .coa-category-btn.primary{
  border-color:var(--coa-border-theme) !important;
  background:var(--coa-soft) !important;
  color:var(--coa-accent) !important;
  box-shadow:
    inset 3px 0 0 var(--coa-accent) !important;
}

/* Slightly calmer category pills */
.coa-page .coa-category-btn{
  min-height:29px !important;
}

/* Compact hierarchy spacing */
.coa-page .coa-hierarchy-grid{
  gap:12px !important;
  margin-bottom:15px !important;
}

/* Balance cards */
.coa-page .coa-summary-card{
  min-height:94px !important;
}

.coa-page .coa-summary-card strong{
  font-size:18px !important;
  line-height:1.2 !important;
  white-space:nowrap;
}

.coa-page .coa-summary-card div span{
  margin-top:3px;
  line-height:1.25;
}

/* Slightly reduce top-card spacing */
.coa-page .coa-summary{
  gap:10px !important;
  margin-bottom:14px !important;
}


/* =========================================================
   Journal Entries — Premium Register UI
   Scoped ONLY to Journal Entries
   ========================================================= */

.journal-list-page{
  width:100%;

  --journal-blue:#176fc8;
  --journal-navy:#173354;
  --journal-green:#129765;
  --journal-border:#d9e5f0;
  --journal-muted:#708398;
}


/* =========================================================
   Hero
   ========================================================= */

.journal-list-page .journal-page-head{
  position:relative;

  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;

  gap:22px !important;

  margin-bottom:16px !important;
  padding:22px 23px !important;

  border:1px solid #d7e4f0 !important;
  border-radius:17px !important;

  overflow:hidden;

  background:
    radial-gradient(
      circle at 90% -15%,
      rgba(49,133,224,.18),
      transparent 40%
    ),
    linear-gradient(
      135deg,
      #ffffff 0%,
      #f8fbff 55%,
      #edf5ff 100%
    ) !important;

  box-shadow:
    0 8px 28px rgba(20,55,91,.055) !important;
}


.journal-list-page .journal-page-head::after{
  content:'';

  position:absolute;

  right:170px;
  top:-100px;

  width:420px;
  height:230px;

  transform:rotate(-18deg);

  pointer-events:none;

  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(42,128,220,.08),
      rgba(42,128,220,.18),
      transparent
    );
}


.journal-list-page .journal-page-head > div:first-child{
  position:relative;
  z-index:2;

  padding-left:64px;
}


.journal-list-page .journal-page-head > div:first-child::before{
  content:'≡';

  position:absolute;

  left:0;
  top:50%;

  display:flex;

  align-items:center;
  justify-content:center;

  width:48px;
  height:48px;

  transform:translateY(-50%);

  border:1px solid #c9ddf2;
  border-radius:13px;

  background:
    linear-gradient(
      145deg,
      #eaf4ff,
      #dcecff
    );

  color:#176dcc;

  font-size:25px;
  font-weight:900;

  box-shadow:
    0 5px 14px rgba(31,87,149,.08);
}


.journal-list-page .journal-page-head h1{
  margin:0 !important;

  color:#152e4d !important;

  font-size:27px !important;
  font-weight:850 !important;

  letter-spacing:-.45px;
}


.journal-list-page .journal-page-head p{
  margin:5px 0 0 !important;

  color:#718499 !important;

  font-size:11px !important;
}


.journal-list-page .journal-page-head > .actions{
  position:relative;
  z-index:3;

  display:flex !important;
  align-items:center !important;

  flex-wrap:wrap;

  justify-content:flex-end;

  gap:8px !important;

  width:auto !important;
}


.journal-list-page .journal-page-head button{
  min-height:40px !important;

  padding:0 13px !important;

  border-radius:9px !important;

  font-size:9px !important;
  font-weight:800 !important;

  white-space:nowrap;

  box-shadow:none !important;
}


.journal-list-page .journal-secondary-action{
  border:1px solid #cadbea !important;

  background:#fff !important;

  color:#3a6f9f !important;
}


.journal-list-page .journal-secondary-action:hover{
  border-color:#a9c8e5 !important;

  background:#f3f8fd !important;
}


.journal-list-page .journal-primary-action{
  border:1px solid #1768bc !important;

  background:
    linear-gradient(
      135deg,
      #2f82dc,
      #1768bc
    ) !important;

  color:#fff !important;

  box-shadow:
    0 7px 17px rgba(27,105,191,.18) !important;
}


/* =========================================================
   Summary cards
   ========================================================= */

.journal-summary-grid{
  display:grid;

  grid-template-columns:repeat(4,minmax(0,1fr));

  gap:11px;

  margin-bottom:16px;
}


.journal-stat-card{
  display:grid;

  grid-template-columns:48px minmax(0,1fr);

  align-items:center;

  gap:12px;

  min-height:94px;

  padding:14px;

  border:1px solid #d9e5f0;
  border-radius:14px;

  background:
    linear-gradient(
      145deg,
      #fff,
      #f8fbff
    );

  box-shadow:
    0 6px 20px rgba(23,55,91,.04);
}


.journal-stat-icon{
  display:flex;

  align-items:center;
  justify-content:center;

  width:46px;
  height:46px;

  border-radius:11px;

  font-size:19px;
  font-weight:900;
}


.journal-stat-card > div{
  display:flex;

  flex-direction:column;

  min-width:0;
}


.journal-stat-card small{
  margin-bottom:2px;

  color:#687d92;

  font-size:9px;
  font-weight:800;

  text-transform:uppercase;

  letter-spacing:.3px;
}


.journal-stat-card strong{
  font-size:18px;
  font-weight:900;

  line-height:1.2;

  white-space:nowrap;

  font-variant-numeric:tabular-nums;
}


.journal-stat-card div span{
  margin-top:3px;

  color:#8997a7;

  font-size:8px;
}


/* Entries */

.journal-stat-entries{
  border-color:#d5e4f3;

  background:
    linear-gradient(
      145deg,
      #fff,
      #f1f7fd
    );
}

.journal-stat-entries .journal-stat-icon{
  border:1px solid #cee1f5;

  background:#e9f3fe;

  color:#176fc8;
}

.journal-stat-entries strong{
  color:#176fc8;
}


/* Debit */

.journal-stat-debit{
  border-color:#d5e5f7;
}

.journal-stat-debit .journal-stat-icon{
  border:1px solid #cfe2f7;

  background:#eaf4ff;

  color:#1673d1;
}

.journal-stat-debit strong{
  color:#1673d1;
}


/* Credit */

.journal-stat-credit{
  border-color:#d2eadf;

  background:
    linear-gradient(
      145deg,
      #fff,
      #f3fbf7
    );
}

.journal-stat-credit .journal-stat-icon{
  border:1px solid #cbe8d9;

  background:#e7f7ef;

  color:#0d9360;
}

.journal-stat-credit strong{
  color:#0d9360;
}


/* Today */

.journal-stat-today{
  border-color:#ddd9f4;

  background:
    linear-gradient(
      145deg,
      #fff,
      #f7f5ff
    );
}

.journal-stat-today .journal-stat-icon{
  border:1px solid #ded7fa;

  background:#f0edff;

  color:#6d54ca;
}

.journal-stat-today strong{
  color:#6650c2;
}


/* =========================================================
   Filters
   ========================================================= */

.journal-filter-card{
  display:grid;

  grid-template-columns:
    minmax(320px,2.3fr)
    minmax(150px,1fr)
    minmax(170px,1fr)
    auto;

  align-items:end;

  gap:11px;

  margin-bottom:16px;
  padding:14px;

  border:1px solid #d9e5f0;
  border-radius:14px;

  background:#fff;

  box-shadow:
    0 6px 20px rgba(22,54,90,.035);
}


.journal-filter-card label{
  display:flex;

  flex-direction:column;

  gap:5px;

  min-width:0;

  color:#5f748a;

  font-size:8px;
  font-weight:850;

  text-transform:uppercase;

  letter-spacing:.25px;
}


.journal-filter-card input,
.journal-filter-card select{
  width:100%;

  min-width:0;
  height:40px;

  padding:8px 11px;

  border:1px solid #d3e0eb;
  border-radius:9px;

  background:#fff;

  color:#2e455e;

  font-size:10px;

  outline:0;
}


.journal-filter-card input:focus,
.journal-filter-card select:focus{
  border-color:#78a9df;

  box-shadow:
    0 0 0 3px rgba(66,127,196,.09);
}


.journal-search-input{
  position:relative;
}


.journal-search-icon{
  position:absolute;

  left:13px;
  top:50%;

  transform:translateY(-50%);

  z-index:2;

  color:#61809e;

  font-size:18px;
}


.journal-search-input input{
  padding-left:38px !important;
}


.journal-filter-clear{
  height:40px;

  padding:0 16px;

  border:1px solid #cfdeeb;
  border-radius:9px;

  background:#fff;

  color:#3772ac;

  font-size:9px;
  font-weight:850;

  box-shadow:none;
}


.journal-filter-clear:hover{
  background:#f2f8fd;
}


/* =========================================================
   Journal register
   ========================================================= */

.journal-list-panel{
  overflow:hidden !important;

  margin:0 !important;
  padding:0 !important;

  border:1px solid #d9e5f0 !important;
  border-radius:15px !important;

  background:#fff !important;

  box-shadow:
    0 8px 25px rgba(24,56,92,.045) !important;
}


.journal-table-heading{
  display:flex;

  align-items:center;
  justify-content:space-between;

  gap:18px;

  padding:16px 18px;

  border-bottom:1px solid #dfe8f1;

  background:
    linear-gradient(
      135deg,
      #fff,
      #f7fbff
    );
}


.journal-section-kicker{
  display:block;

  margin-bottom:4px;

  color:#1972cb;

  font-size:7px;
  font-weight:900;

  letter-spacing:1px;
}


.journal-table-heading h3{
  margin:0 !important;

  color:#193451 !important;

  font-size:15px !important;
  font-weight:850 !important;
}


.journal-table-heading p{
  margin:4px 0 0;

  color:#7a8b9c;

  font-size:8px;
}


.journal-record-count{
  display:inline-flex;

  align-items:center;

  gap:4px;

  padding:7px 10px;

  border:1px solid #d2e1ee;
  border-radius:999px;

  background:#f7fbff;

  color:#607991;

  font-size:8px;
  font-weight:750;
}


.journal-record-count strong{
  color:#176fc8;
}


/* Table */

.journal-list-panel .table-wrap{
  overflow:auto !important;
}


.journal-list-table{
  width:100% !important;

  border-collapse:separate !important;
  border-spacing:0 !important;
}


.journal-list-table thead th{
  padding:11px 12px !important;

  border-bottom:1px solid #dce6ef !important;

  background:
    linear-gradient(
      180deg,
      #f8fbff,
      #f1f6fb
    ) !important;

  color:#5a7188 !important;

  font-size:8px !important;
  font-weight:850 !important;

  text-align:left !important;

  text-transform:uppercase;

  letter-spacing:.25px;

  white-space:nowrap;
}


.journal-list-table tbody tr{
  background:#fff;

  transition:background .12s ease;
}


.journal-list-table tbody tr:nth-child(even){
  background:#fbfdff;
}


.journal-list-table tbody tr:hover{
  background:#f2f8fd;
}


.journal-list-table tbody td{
  padding:12px !important;

  border-bottom:1px solid #e8eef5 !important;

  color:#344b62 !important;

  font-size:9px !important;

  vertical-align:middle !important;
}


.journal-row-number{
  width:45px;

  color:#8a99a8 !important;

  text-align:center;
}


.journal-entry-number{
  display:inline-flex;

  align-items:center;

  padding:5px 8px;

  border:1px solid #d1e3f5;
  border-radius:7px;

  background:#edf6ff;

  color:#176fc8;

  font-weight:850;

  font-variant-numeric:tabular-nums;
}


.journal-entry-date{
  white-space:nowrap;
}


.journal-entry-description{
  min-width:240px;

  color:#344b62 !important;
}


.journal-total-debit,
.journal-total-credit{
  font-weight:850;

  white-space:nowrap;

  font-variant-numeric:tabular-nums;
}


.journal-total-debit{
  color:#176fc8;
}


.journal-total-credit{
  color:#0c9360;
}


.journal-list-table .journal-posted-badge{
  display:inline-flex !important;

  align-items:center;
  justify-content:center;

  min-width:65px;

  padding:5px 9px !important;

  border:1px solid #c7ead8 !important;
  border-radius:999px !important;

  background:#e9f8f0 !important;

  color:#08794c !important;

  font-size:8px !important;
  font-weight:850 !important;
}


/* =========================================================
   Empty state / footer
   ========================================================= */

.journal-empty-state{
  height:190px;

  text-align:center !important;

  color:#7b8d9e !important;
}


.journal-empty-state strong,
.journal-empty-state span{
  display:block;
}


.journal-empty-state strong{
  margin-bottom:5px;

  color:#344c64;

  font-size:13px;
}


.journal-empty-state span{
  font-size:9px;
}


.journal-list-footer{
  display:flex;

  align-items:center;
  justify-content:space-between;

  gap:14px;

  min-height:52px;

  padding:11px 16px;

  border-top:1px solid #e1eaf2;

  background:#fbfdff;

  color:#748699;

  font-size:8px;
}


.journal-list-footer strong{
  color:#344e69;
}


/* =========================================================
   Responsive
   ========================================================= */

@media(max-width:1100px){

  .journal-summary-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .journal-filter-card{
    grid-template-columns:1fr 1fr;
  }

  .journal-search-field{
    grid-column:1 / -1;
  }

}


@media(max-width:760px){

  .journal-list-page .journal-page-head{
    align-items:flex-start !important;
    flex-direction:column !important;
  }

  .journal-list-page .journal-page-head > .actions{
    justify-content:flex-start;

    width:100% !important;
  }

  .journal-summary-grid{
    grid-template-columns:1fr;
  }

  .journal-filter-card{
    grid-template-columns:1fr;
  }

  .journal-search-field{
    grid-column:auto;
  }

  .journal-filter-clear{
    width:100%;
  }

  .journal-list-table{
    min-width:900px;
  }

  .journal-list-footer{
    align-items:flex-start;

    flex-direction:column;
  }

}


/* =========================================================
   Settings — Branch Management
   ========================================================= */

.branch-settings-panel{
  overflow:hidden !important;

  padding:0 !important;

  border:1px solid #d8e5f1 !important;
  border-radius:16px !important;

  background:#fff !important;

  box-shadow:
    0 8px 26px rgba(23,56,91,.045) !important;
}


.branch-settings-head{
  display:flex;

  align-items:center;
  justify-content:space-between;

  gap:20px;

  padding:18px 20px;

  border-bottom:1px solid #e0e9f2;

  background:
    linear-gradient(
      135deg,
      #ffffff,
      #f4f9ff
    );
}


.branch-settings-kicker{
  display:block;

  margin-bottom:4px;

  color:#176fc8;

  font-size:8px;
  font-weight:900;

  letter-spacing:1px;
}


.branch-settings-head h3{
  margin:0 !important;

  color:#17324f !important;

  font-size:17px !important;
  font-weight:850 !important;
}


.branch-settings-head p{
  margin:4px 0 0;

  color:#76889b;

  font-size:9px;
}


.branch-add-button{
  min-height:40px !important;

  padding:0 15px !important;

  border-radius:9px !important;
}


.branch-settings-grid{
  display:grid;

  grid-template-columns:
    repeat(3,minmax(0,1fr));

  gap:12px;

  padding:16px;
}


.branch-settings-card{
  padding:14px;

  border:1px solid #d9e5f0;
  border-radius:13px;

  background:
    linear-gradient(
      145deg,
      #ffffff,
      #f8fbff
    );

  box-shadow:
    0 5px 17px rgba(24,55,91,.035);
}


.branch-settings-card.is-archived{
  opacity:.78;

  background:
    linear-gradient(
      145deg,
      #fff,
      #f7f8fa
    );
}


.branch-card-top{
  display:grid;

  grid-template-columns:
    44px minmax(0,1fr) auto;

  align-items:center;

  gap:10px;
}


.branch-card-icon{
  display:flex;

  align-items:center;
  justify-content:center;

  width:42px;
  height:42px;

  border:1px solid #cfe1f3;
  border-radius:11px;

  background:#eaf4ff;

  color:#176fc8;

  font-size:11px;
  font-weight:900;

  letter-spacing:.5px;
}


.branch-card-identity{
  display:flex;

  flex-direction:column;

  min-width:0;
}


.branch-card-identity strong{
  color:#223c57;

  font-size:11px;
  font-weight:850;
}


.branch-card-identity span{
  margin-top:2px;

  color:#8291a0;

  font-size:8px;
}


.branch-status-badge{
  display:inline-flex;

  align-items:center;
  justify-content:center;

  padding:5px 8px;

  border-radius:999px;

  font-size:7px;
  font-weight:850;
}


.branch-status-badge.active{
  border:1px solid #c8ead9;

  background:#e9f8f0;

  color:#08794b;
}


.branch-status-badge.archived{
  border:1px solid #dde2e7;

  background:#f3f5f7;

  color:#747f8a;
}


.branch-card-meta{
  display:flex;

  align-items:center;
  justify-content:space-between;

  gap:8px;

  margin-top:13px;
  padding-top:10px;

  border-top:1px solid #e7edf4;

  color:#8795a4;

  font-size:8px;
}


.branch-current-badge{
  padding:4px 7px;

  border:1px solid #cedff0;
  border-radius:999px;

  background:#edf6ff;

  color:#176fc8;

  font-weight:800;
}


.branch-card-actions{
  display:flex;

  flex-wrap:wrap;

  gap:6px;

  margin-top:11px;
}


.branch-card-actions button{
  min-height:32px !important;

  padding:0 9px !important;

  border-radius:7px !important;

  font-size:8px !important;
  font-weight:800 !important;

  box-shadow:none !important;
}


.branch-edit-button{
  border:1px solid #ccddea !important;

  background:#fff !important;

  color:#346fa8 !important;
}


.branch-archive-button{
  border:1px solid #ecd9b9 !important;

  background:#fff8ed !important;

  color:#a76807 !important;
}


.branch-reactivate-button{
  border:1px solid #c7ead8 !important;

  background:#ecf9f2 !important;

  color:#08794c !important;
}


.branch-delete-button{
  border:1px solid #f0cdd3 !important;

  background:#fff4f5 !important;

  color:#c94b5d !important;
}


.branch-settings-note{
  margin:0 16px 16px;
  padding:11px 13px;

  border:1px solid #d8e6f2;
  border-radius:10px;

  background:#f6faff;

  color:#64798e;

  font-size:8px;

  line-height:1.55;
}


.branch-settings-note strong{
  color:#2c5f91;
}


.branch-form-note,
.branch-warning-card,
.branch-danger-card{
  grid-column:1 / -1;

  padding:12px;

  border:1px solid #d8e5f0;
  border-radius:10px;

  background:#f6faff;

  color:#64798e;

  font-size:9px;

  line-height:1.55;
}


.branch-form-note strong,
.branch-form-note span,
.branch-warning-card strong{
  display:block;
}


.branch-form-note strong{
  margin-bottom:3px;

  color:#275d91;
}


.branch-warning-card{
  background:#fff9ef;

  border-color:#ecdcbf;
}


.branch-warning-card strong{
  color:#9d650e;

  font-size:11px;
}


.branch-danger-card{
  background:#fff5f6;

  border-color:#efced4;
}


.branch-danger-card > strong{
  display:block;

  margin-bottom:5px;

  color:#bc3e51;

  font-size:12px;
}


.branch-settings-empty{
  grid-column:1 / -1;

  padding:40px 20px;

  color:#8191a1;

  text-align:center;

  font-size:10px;
}


@media(max-width:1100px){

  .branch-settings-grid{
    grid-template-columns:
      repeat(2,minmax(0,1fr));
  }

}


@media(max-width:700px){

  .branch-settings-head{
    align-items:flex-start;

    flex-direction:column;
  }

  .branch-settings-grid{
    grid-template-columns:1fr;
  }

}


/* Team Access — Individual Permissions */

.staff-permission-editor{
  margin-top:18px;
  padding:18px;
  border:1px solid rgba(127,127,127,.22);
  border-radius:16px;
}

.staff-permission-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:16px;
}

.staff-permission-head h3,
.staff-permission-group h4{
  margin:0 0 6px;
}

.staff-permission-group{
  padding:14px 0;
  border-top:1px solid rgba(127,127,127,.16);
}

.staff-permission-grid,
.staff-branch-grid{
  display:grid;
  grid-template-columns:repeat(
    auto-fit,
    minmax(240px,1fr)
  );
  gap:10px;
}

.staff-permission-option{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:12px;
  border:1px solid rgba(127,127,127,.18);
  border-radius:12px;
  cursor:pointer;
}

.staff-permission-option input{
  margin-top:3px;
}

.staff-permission-option span{
  display:flex;
  flex-direction:column;
  gap:3px;
}

.staff-permission-option small{
  opacity:.65;
  font-size:11px;
}

.staff-edit-section{
  margin:18px 0;
}

.staff-active-toggle{
  display:flex;
  align-items:center;
  gap:8px;
  margin:12px 0;
}

.staff-owner-only-note{
  margin-top:16px;
  padding:12px;
  border-radius:12px;
  background:rgba(127,127,127,.08);
}

@media(max-width:720px){
  .staff-permission-head{
    flex-direction:column;
  }

  .staff-permission-grid,
  .staff-branch-grid{
    grid-template-columns:1fr;
  }
}


/* Team Access — current staff accounts */

.team-access-section{
  margin-top:18px;
}

.team-access-heading{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:18px;
}

.team-access-heading h2{
  margin:0 0 5px;
}

.team-user-grid{
  display:grid;
  grid-template-columns:repeat(
    auto-fit,
    minmax(320px,1fr)
  );
  gap:16px;
}

.team-user-card{
  background:var(--panel, #fff);
  border:1px solid rgba(127,127,127,.18);
  border-radius:16px;
  padding:18px;
  min-width:0;
  box-shadow:0 3px 12px rgba(0,0,0,.04);
}

.team-user-card-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}

.team-user-card-top h3{
  margin:0 0 4px;
}

.team-user-status{
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
}

.team-user-status.active{
  background:rgba(22,163,74,.12);
  color:#15803d;
}

.team-user-status.inactive{
  background:rgba(220,38,38,.10);
  color:#b91c1c;
}

.team-user-details{
  display:grid;
  gap:12px;
  margin:18px 0;
}

.team-user-details > div{
  display:flex;
  flex-direction:column;
  gap:3px;
}

.team-user-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  padding-top:14px;
  border-top:1px solid rgba(127,127,127,.14);
}

.team-owner-note{
  margin-top:14px;
  padding:11px 12px;
  border-radius:10px;
  background:rgba(37,99,235,.08);
  font-weight:700;
}

.team-notification-panel{
  margin-top:22px;
  overflow:hidden;
}

.team-notification-summary{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:18px 20px;
  cursor:pointer;
  font-weight:700;
}

.team-notification-list{
  border-top:1px solid rgba(127,127,127,.14);
}

.team-notification-row{
  display:grid;
  grid-template-columns:minmax(180px,.8fr) minmax(260px,1.6fr) auto;
  gap:18px;
  align-items:center;
  padding:14px 20px;
  border-bottom:1px solid rgba(127,127,127,.12);
}

.team-notification-row:last-child{
  border-bottom:0;
}

@media(max-width:800px){
  .team-user-grid{
    grid-template-columns:1fr;
  }

  .team-access-heading{
    flex-direction:column;
  }

  .team-notification-row{
    grid-template-columns:1fr;
  }
}



/* Verified email badge */
.verified-email-badge{
 display:inline-flex;
 align-items:center;
 justify-content:center;
 width:18px;
 height:18px;
 margin-left:6px;
 border-radius:50%;
 background:#1d9bf0;
 color:#fff;
 font-size:12px;
 font-weight:800;
 line-height:1;
 vertical-align:middle;
 flex:0 0 auto;
 box-shadow:0 1px 2px rgba(0,0,0,.16);
}

/* Security Center staff selector */
.security-staff-picker{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  width:100%;
  max-width:100%;
  overflow:visible;
  box-sizing:border-box;
  justify-content:flex-start;
}

.security-staff-picker button{
  flex:0 1 auto;
  min-width:110px;
  max-width:220px;
  white-space:normal;
  overflow-wrap:anywhere;
}

@media (max-width:900px){
  .security-staff-picker button{
    flex:1 1 140px;
    max-width:100%;
  }
}


/* ==========================================================
   AZIM SAHAK LTD - PREMIUM SECURITY CENTER
   ========================================================== */

#workspace.security-center-workspace{
  position:relative;
  min-height:100vh;
  padding-bottom:48px;
  background:
    radial-gradient(
      circle at 90% 2%,
      rgba(45,125,255,.16),
      transparent 30%
    ),
    radial-gradient(
      circle at 10% 35%,
      rgba(0,194,255,.08),
      transparent 25%
    ),
    linear-gradient(
      145deg,
      #f4f8ff 0%,
      #edf4fc 48%,
      #f8fbff 100%
    );
}


/* Main page title */

.security-center-workspace h1{
  color:#0a2346;
  font-weight:800;
  letter-spacing:-.035em;
}

.security-center-workspace > p,
.security-center-workspace .fine{
  color:#667892;
}


/* Premium cards */

.security-center-workspace .panel{
  position:relative;
  overflow:hidden;

  border:1px solid rgba(40,108,196,.16);
  border-radius:22px;

  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,.96),
      rgba(247,251,255,.92)
    );

  box-shadow:
    0 14px 34px rgba(25,72,125,.08),
    0 2px 8px rgba(25,72,125,.04);

  transition:
    transform .18s ease,
    box-shadow .18s ease,
    border-color .18s ease;
}

.security-center-workspace .panel::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  width:4px;
  height:100%;

  background:
    linear-gradient(
      180deg,
      #1787ff,
      #0bc5ea
    );

  opacity:.78;
}

.security-center-workspace .panel:hover{
  transform:translateY(-1px);

  border-color:
    rgba(35,119,228,.28);

  box-shadow:
    0 18px 40px rgba(25,72,125,.11),
    0 3px 10px rgba(25,72,125,.05);
}


/* Card headings */

.security-center-workspace .panel-head{
  padding:
    24px 28px 20px;

  border-bottom:
    1px solid rgba(42,94,160,.11);

  background:
    linear-gradient(
      90deg,
      rgba(238,246,255,.82),
      rgba(255,255,255,.55)
    );
}

.security-center-workspace .panel h2,
.security-center-workspace .panel h3{
  margin:0;
  color:#0b2850;
  font-weight:800;
  letter-spacing:-.02em;
}

.security-center-workspace .panel-head .fine{
  display:block;
  margin-top:7px;
  color:#71839b;
  font-size:.94rem;
}


/* Paragraph content */

.security-center-workspace .panel > p{
  margin-left:28px;
  margin-right:28px;
  line-height:1.7;
  color:#2d415c;
}

.security-center-workspace .panel > p strong{
  color:#0b2e5b;
}


/* ON/OFF security badges */

.security-status{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  min-width:82px;

  padding:
    7px 12px;

  border-radius:999px;

  font-size:.77rem;
  font-weight:800;
  letter-spacing:.06em;
}

.security-status-on{
  color:#087451;
  background:#e7fbf4;
  border:1px solid #aeead5;
}

.security-status-off{
  color:#5e7088;
  background:#eef3f8;
  border:1px solid #d8e2ed;
}


/* Tables */

.security-center-workspace table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
}

.security-center-workspace th{
  padding:15px 18px;

  color:#526b89;
  font-size:.82rem;
  font-weight:800;

  background:#f7faff;

  border-bottom:
    1px solid rgba(49,96,153,.13);
}

.security-center-workspace td{
  padding:16px 18px;

  color:#203754;

  border-bottom:
    1px solid rgba(49,96,153,.09);
}

.security-center-workspace tr:last-child td{
  border-bottom:0;
}

.security-center-workspace tbody tr{
  transition:background .15s ease;
}

.security-center-workspace tbody tr:hover{
  background:#f5f9ff;
}


/* Empty states */

.security-center-workspace .empty{
  margin:28px;
  padding:38px 22px;

  text-align:center;

  color:#7890aa;

  border:
    1px dashed rgba(68,119,181,.26);

  border-radius:17px;

  background:
    linear-gradient(
      145deg,
      #f8fbff,
      #f2f7fd
    );
}


/* Staff selector */

.security-center-workspace
.security-staff-picker{
  display:flex;
  flex-wrap:wrap;

  gap:10px;

  width:auto;
  max-width:100%;

  margin:20px 26px;

  overflow:visible;

  box-sizing:border-box;
}

.security-center-workspace
.security-staff-picker button{
  flex:0 1 auto;

  min-width:112px;
  max-width:210px;

  padding:
    13px 16px;

  border:
    1px solid rgba(46,105,177,.18);

  border-radius:14px;

  color:#173c6a;

  background:
    linear-gradient(
      145deg,
      #ffffff,
      #f1f7ff
    );

  box-shadow:
    0 4px 12px rgba(27,80,142,.05);

  white-space:normal;
  overflow-wrap:anywhere;

  transition:
    transform .16s ease,
    border-color .16s ease,
    box-shadow .16s ease;
}

.security-center-workspace
.security-staff-picker button:hover{
  transform:translateY(-1px);

  border-color:#60a6f7;

  box-shadow:
    0 8px 18px rgba(33,103,186,.11);
}


/* Primary Security Center action */

.security-center-workspace
button.primary{
  border:0;

  border-radius:14px;

  background:
    linear-gradient(
      135deg,
      #216be8,
      #0b9fe1
    );

  box-shadow:
    0 10px 24px rgba(31,111,219,.22);

  transition:
    transform .16s ease,
    box-shadow .16s ease;
}

.security-center-workspace
button.primary:hover{
  transform:translateY(-1px);

  box-shadow:
    0 14px 28px rgba(31,111,219,.28);
}


/* Special security setting card */

.security-center-workspace
.panel:last-child{
  border-color:
    rgba(49,115,207,.22);

  background:
    linear-gradient(
      145deg,
      #fafdff,
      #f1f7ff
    );
}


/* Desktop overflow protection */

.security-center-workspace{
  overflow-x:hidden;
}

.security-center-workspace .panel{
  max-width:100%;
  box-sizing:border-box;
}

.security-center-workspace table{
  min-width:0;
}


/* Mobile and tablet */

@media(max-width:900px){

  #workspace.security-center-workspace{
    padding-left:12px;
    padding-right:12px;
  }

  .security-center-workspace
  .panel-head{
    padding:
      20px 18px;
  }

  .security-center-workspace
  .panel > p{
    margin-left:18px;
    margin-right:18px;
  }

  .security-center-workspace
  .security-staff-picker{
    margin:
      16px 18px;
  }

  .security-center-workspace
  .security-staff-picker button{
    flex:
      1 1 140px;

    max-width:100%;
  }
}


/* ==========================================================
   END PREMIUM SECURITY CENTER
   ========================================================== */


/* KBL per-user location policy */

.security-kbl-policy .security-policy-box{
  margin:24px 28px 28px;
  padding:22px;

  display:grid;
  grid-template-columns:
    repeat(3,minmax(180px,1fr));

  gap:18px;

  border:1px solid rgba(42,105,190,.15);
  border-radius:18px;

  background:
    linear-gradient(
      145deg,
      rgba(245,250,255,.98),
      rgba(255,255,255,.96)
    );
}

.security-policy-label{
  display:block;
  margin-bottom:8px;

  color:#71839b;
  font-size:.78rem;
  font-weight:800;

  text-transform:uppercase;
  letter-spacing:.05em;
}

.security-distance-input{
  display:flex;
  align-items:center;
  gap:10px;
}

.security-distance-input input{
  width:130px;
  padding:11px 13px;

  border:1px solid #cbd9e9;
  border-radius:11px;

  background:white;
}

.security-policy-save{
  display:flex;
  align-items:flex-end;
}

.security-policy-box > .fine{
  grid-column:1/-1;
  margin:0;
}

@media(max-width:900px){

 .security-kbl-policy
 .security-policy-box{
   grid-template-columns:1fr;
   margin:18px;
 }

 .security-policy-box > .fine{
   grid-column:auto;
 }

}

/* Device Security */

.account-device-security-card{
  margin-top:24px;
  padding:20px;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;

  border:1px solid rgba(44,111,201,.17);
  border-radius:16px;

  background:
    linear-gradient(
      145deg,
      #f7fbff,
      #eef6ff
    );
}

.account-device-security-card strong{
  color:#143e71;
  font-size:1rem;
}

.account-device-security-card p{
  margin:
    6px 0 0;
}

.device-security-modal{
  display:grid;
  gap:16px;
}

@media(max-width:700px){

 .account-device-security-card{
   align-items:stretch;
   flex-direction:column;
 }

}

/* Device registration input visibility fix */

.device-security-modal input[name="device_label"],
.device-security-modal .email-verify-email-input{
  display:block !important;
  width:100% !important;
  min-height:56px !important;
  box-sizing:border-box !important;

  color:#0b2342 !important;
  background:#ffffff !important;

  border:1px solid #b9cbe0 !important;
  border-radius:12px !important;

  padding:14px 16px !important;

  font-size:16px !important;
  font-weight:600 !important;

  caret-color:#126edb !important;
  opacity:1 !important;
}

.device-security-modal input[name="device_label"]::placeholder,
.device-security-modal .email-verify-email-input::placeholder{
  color:#7a8ca3 !important;
  opacity:1 !important;
}

.device-security-modal label{
  display:block !important;
  color:#173b69 !important;
  font-weight:700 !important;
  margin-top:8px !important;
  margin-bottom:8px !important;
}

/* Windows Hello / Passkey */

.device-passkey-panel{
  display:grid;
  gap:12px;

  margin-top:20px;
  padding:18px;

  border:1px solid rgba(44,111,201,.17);
  border-radius:16px;

  background:
    linear-gradient(
      145deg,
      #f7fbff,
      #eef6ff
    );
}

.device-passkey-heading{
  display:grid;
  gap:4px;
}

.device-passkey-heading strong{
  color:#143e71;
}

.device-passkey-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;

  padding:14px;

  border:1px solid #d7e4f2;
  border-radius:12px;

  background:#fff;
}

@media(max-width:700px){
 .device-passkey-row{
   align-items:stretch;
   flex-direction:column;
 }
}

/* Multi-passkey controls */

.passkey-list{
  display:grid;
  gap:10px;
}

.device-passkey-actions{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
  margin-top:4px;
}

@media(max-width:700px){
  .device-passkey-actions{
    display:grid;
    grid-template-columns:1fr;
  }

  .device-passkey-actions button{
    width:100%;
  }
}


/* V42 - Owner current-location request modal.
   Inline styles are blocked by CSP, so layout is defined here. */

#v38-staff-location-request-popup{
  position:fixed !important;
  inset:0 !important;
  z-index:99999 !important;

  display:flex !important;
  align-items:center !important;
  justify-content:center !important;

  width:100vw !important;
  height:100vh !important;

  padding:20px !important;
  box-sizing:border-box !important;

  overflow:auto !important;

  background:rgba(15,23,42,.55) !important;
  backdrop-filter:blur(5px);
  -webkit-backdrop-filter:blur(5px);
}

#v38-staff-location-request-popup > div{
  width:min(520px,100%) !important;
  max-height:calc(100vh - 40px) !important;

  overflow:auto !important;

  background:#fff !important;
  color:#172b43 !important;

  border-radius:18px !important;
  box-shadow:0 25px 70px rgba(0,0,0,.25) !important;

  padding:24px !important;
  box-sizing:border-box !important;
}

#v38-staff-location-request-popup > div > div:first-child{
  font-size:20px !important;
  font-weight:800 !important;
  line-height:1.3 !important;
  margin-bottom:8px !important;
}

#v38-staff-location-request-popup > div > div:nth-child(2){
  line-height:1.6 !important;
}

#v38-staff-location-request-popup .fine{
  margin-top:10px !important;
}

#v38-staff-location-request-popup > div > div:last-child{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:10px !important;
  margin-top:20px !important;
}

@media(max-width:600px){
  #v38-staff-location-request-popup{
    padding:12px !important;
  }

  #v38-staff-location-request-popup > div{
    width:100% !important;
    max-height:calc(100vh - 24px) !important;
    padding:18px !important;
    border-radius:16px !important;
  }

  #v38-staff-location-request-popup > div > div:last-child{
    display:grid !important;
    grid-template-columns:1fr !important;
  }

  #v38-staff-location-request-popup button{
    width:100% !important;
  }
}


/* =========================================================
   V43 - Selected Staff Details / Owner View
   ========================================================= */

.v43-staff-details{
  margin:18px 0 22px;
  border:1px solid #d7e2ee;
  border-radius:18px;
  background:#f5f8fc;
  box-shadow:0 10px 30px rgba(21,60,105,.08);
  overflow:hidden;
}

.v43-details-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:22px 24px;
  background:#fff;
  border-bottom:1px solid #dfe7f0;
}

.v43-details-head h2,
.v43-side-head h3,
.v43-profile-title h3{
  margin:0;
  color:#153c69;
}

.v43-details-head h2{
  margin-top:3px;
  font-size:23px;
}

.v43-details-head p{
  margin:5px 0 0;
  color:#687b91;
  font-size:13px;
}

.v43-eyebrow{
  display:block;
  color:#4273b9;
  font-size:10px;
  font-weight:800;
  letter-spacing:.13em;
}

.v43-head-status{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:8px;
}

.v43-details-grid{
  display:grid;
  grid-template-columns:minmax(360px,.9fr) minmax(480px,1.35fr);
  gap:18px;
  padding:18px;
}

.v43-profile-card,
.v43-side-card{
  background:#fff;
  border:1px solid #dbe5ef;
  border-radius:16px;
  box-shadow:0 4px 16px rgba(23,61,101,.05);
}

.v43-profile-card{
  padding:20px;
}

.v43-profile-top{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:13px;
  padding-bottom:18px;
  border-bottom:1px solid #e3eaf2;
}

.v43-avatar{
  width:52px;
  height:52px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:#153c69;
  color:#fff;
  font-size:16px;
  font-weight:800;
  letter-spacing:.04em;
}

.v43-profile-title{
  min-width:0;
}

.v43-profile-title h3{
  font-size:18px;
}

.v43-profile-title span{
  display:block;
  margin-top:4px;
  color:#75869a;
  font-size:12px;
  overflow-wrap:anywhere;
}

.v43-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:27px;
  padding:4px 10px;
  border-radius:999px;
  font-size:10px;
  font-weight:800;
  line-height:1.2;
  text-transform:uppercase;
  letter-spacing:.04em;
  white-space:normal;
  text-align:center;
}

.v43-pill.good{
  background:#e5f8ee;
  color:#14754d;
  border:1px solid #b7e8d0;
}

.v43-pill.bad{
  background:#fff0f0;
  color:#b32727;
  border:1px solid #efc1c1;
}

.v43-pill.neutral{
  background:#eef3f8;
  color:#56697e;
  border:1px solid #d4dfe9;
}

.v43-location-block{
  margin:18px 0;
  padding:16px;
  border-radius:13px;
  background:#edf5ff;
  border:1px solid #cfe0f4;
}

.v43-section-label{
  margin-bottom:5px;
  color:#5e7692;
  font-size:10px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.v43-location-name{
  display:block;
  color:#153c69;
  font-size:16px;
}

.v43-coordinate{
  display:block;
  margin-top:5px;
  color:#6a7c90;
  font-size:11px;
  font-variant-numeric:tabular-nums;
}

.v43-map-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-top:11px;
  min-height:34px;
  padding:7px 13px;
  border-radius:8px;
  background:#4273b9;
  color:#fff !important;
  font-size:11px;
  font-weight:750;
  text-decoration:none;
}

.v43-map-button:hover{
  filter:brightness(.96);
}

.v43-info-list{
  border:1px solid #e1e8f0;
  border-radius:12px;
  overflow:hidden;
}

.v43-info-row{
  display:grid;
  grid-template-columns:minmax(130px,.85fr) minmax(0,1.2fr);
  align-items:center;
  gap:12px;
  min-height:46px;
  padding:10px 13px;
  border-bottom:1px solid #e8edf3;
}

.v43-info-row:last-child{
  border-bottom:0;
}

.v43-info-row>span:first-child{
  color:#6c7d90;
  font-size:11px;
}

.v43-info-row>strong{
  color:#263d58;
  font-size:12px;
  text-align:right;
  overflow-wrap:anywhere;
}

.v43-info-row>.v43-pill{
  justify-self:end;
}

.v43-security-summary{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:16px;
}

.v43-mini-card{
  min-width:0;
  padding:13px;
  border-radius:11px;
  background:#f7f9fc;
  border:1px solid #dde6ef;
}

.v43-mini-card>span{
  display:block;
  color:#718297;
  font-size:10px;
  font-weight:700;
}

.v43-mini-card>strong{
  display:block;
  margin-top:5px;
  color:#173d69;
  font-size:12px;
  overflow-wrap:anywhere;
}

.v43-mini-card>small{
  display:block;
  margin-top:4px;
  color:#8290a1;
  font-size:9px;
}

.v43-good-text{
  color:#14754d !important;
}

.v43-bad-text{
  color:#b32727 !important;
}

.v43-right-column{
  display:grid;
  grid-template-rows:auto auto;
  gap:18px;
  align-content:start;
}

.v43-side-card{
  overflow:hidden;
}

.v43-side-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:16px 18px;
  border-bottom:1px solid #e3eaf2;
  background:#fff;
}

.v43-side-head h3{
  margin-top:3px;
  font-size:16px;
}

.v43-count{
  display:grid;
  place-items:center;
  min-width:31px;
  height:31px;
  padding:0 8px;
  border-radius:9px;
  background:#edf4fc;
  color:#153c69;
  font-size:11px;
  font-weight:800;
}

.v43-history-list,
.v43-alert-list{
  padding:8px 18px 14px;
}

.v43-history-item{
  position:relative;
  display:grid;
  grid-template-columns:14px minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  padding:13px 0;
  border-bottom:1px solid #e8edf3;
}

.v43-history-item:last-child{
  border-bottom:0;
}

.v43-history-dot{
  width:9px;
  height:9px;
  border-radius:50%;
  background:#4273b9;
  box-shadow:0 0 0 4px #e9f1fb;
}

.v43-history-main strong,
.v43-history-main span,
.v43-history-meta strong,
.v43-history-meta span{
  display:block;
}

.v43-history-main strong{
  color:#233d5c;
  font-size:11px;
  text-transform:capitalize;
}

.v43-history-main span{
  margin-top:3px;
  color:#718398;
  font-size:10px;
  font-variant-numeric:tabular-nums;
}

.v43-history-meta{
  text-align:right;
}

.v43-history-meta strong{
  color:#415973;
  font-size:10px;
  font-weight:700;
}

.v43-history-meta span{
  margin-top:3px;
  color:#8392a3;
  font-size:9px;
}

.v43-alert-item{
  display:grid;
  grid-template-columns:30px minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  padding:12px 0;
  border-bottom:1px solid #e8edf3;
}

.v43-alert-item:last-child{
  border-bottom:0;
}

.v43-alert-icon{
  width:28px;
  height:28px;
  border-radius:8px;
  display:grid;
  place-items:center;
  background:#fff2dc;
  color:#a96200;
  font-size:12px;
  font-weight:900;
}

.v43-alert-item.error .v43-alert-icon,
.v43-alert-item.critical .v43-alert-icon{
  background:#ffe8e8;
  color:#b32727;
}

.v43-alert-item.clear .v43-alert-icon{
  background:#e5f8ee;
  color:#14754d;
}

.v43-alert-copy strong,
.v43-alert-copy span{
  display:block;
}

.v43-alert-copy strong{
  color:#263d58;
  font-size:11px;
  text-transform:capitalize;
}

.v43-alert-copy span{
  margin-top:3px;
  color:#718398;
  font-size:10px;
}

.v43-alert-time{
  color:#8392a3;
  font-size:9px;
  white-space:nowrap;
}

.v43-empty{
  padding:22px 4px 12px;
  color:#7a8999;
  font-size:11px;
  text-align:center;
}

@media(max-width:820px){
  .v43-details-grid{
    grid-template-columns:1fr;
  }
}

@media(max-width:640px){
  .v43-details-head{
    align-items:flex-start;
    flex-direction:column;
  }

  .v43-head-status{
    justify-content:flex-start;
  }

  .v43-details-grid{
    padding:10px;
    gap:10px;
  }

  .v43-profile-card{
    padding:14px;
  }

  .v43-profile-top{
    grid-template-columns:auto 1fr;
  }

  .v43-profile-top>.v43-pill{
    grid-column:1/-1;
    justify-self:start;
  }

  .v43-security-summary{
    grid-template-columns:1fr;
  }

  .v43-info-row{
    grid-template-columns:1fr;
  }

  .v43-info-row>strong{
    text-align:left;
  }

  .v43-info-row>.v43-pill{
    justify-self:start;
  }

  .v43-history-item,
  .v43-alert-item{
    grid-template-columns:14px 1fr;
  }

  .v43-history-meta,
  .v43-alert-time{
    grid-column:2;
    text-align:left;
  }
}


/* V47 PREMIUM ACTIVE SESSION BLOCK CARD */

.error.login-session-blocked{
  display:block;
  padding:0 !important;
  margin:0 0 20px !important;
  overflow:hidden;
  border:1px solid rgba(37,99,235,.24) !important;
  border-radius:18px !important;
  background:#ffffff !important;
  color:#172033 !important;
  box-shadow:
    0 18px 45px rgba(15,23,42,.10),
    0 3px 10px rgba(37,99,235,.07) !important;
  text-align:left;
}

.login-session-blocked .session-block-header{
  display:flex;
  align-items:center;
  gap:13px;
  padding:16px 18px 14px;
  background:
    radial-gradient(circle at 95% 0%,rgba(59,130,246,.18),transparent 42%),
    linear-gradient(135deg,#f5f9ff 0%,#eef5ff 100%);
  border-bottom:1px solid rgba(37,99,235,.12);
}

.login-session-blocked .session-block-icon{
  width:44px;
  height:44px;
  flex:0 0 44px;
  display:grid;
  place-items:center;
  border-radius:14px;
  color:#fff;
  background:linear-gradient(145deg,#0f4fc4,#2878f0);
  box-shadow:0 8px 20px rgba(37,99,235,.24);
}

.login-session-blocked .session-block-icon svg{
  width:25px;
  height:25px;
  fill:currentColor;
}

.login-session-blocked .session-block-kicker{
  margin:0 0 3px;
  color:#2463cf;
  font-size:10px;
  line-height:1.2;
  font-weight:800;
  letter-spacing:.13em;
}

.login-session-blocked h3{
  margin:0;
  color:#13213c;
  font-size:18px;
  line-height:1.25;
  font-weight:800;
}

.login-session-blocked .session-block-body{
  padding:16px 18px 18px;
}

.login-session-blocked .session-block-body>p{
  margin:0 0 14px;
  color:#475569;
  font-size:13.5px;
  line-height:1.65;
}

.login-session-blocked .session-block-rule{
  display:flex;
  flex-direction:column;
  gap:4px;
  padding:12px 13px;
  margin-bottom:13px;
  border-radius:12px;
  border:1px solid #dbe7fb;
  background:#f8fbff;
}

.login-session-blocked .session-block-rule strong{
  color:#18345f;
  font-size:13px;
}

.login-session-blocked .session-block-rule span{
  color:#64748b;
  font-size:12px;
  line-height:1.5;
}

.login-session-blocked .session-block-notice{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:11px 12px;
  border-radius:12px;
  background:#fff9ed;
  border:1px solid #f5dca7;
}

.login-session-blocked .session-block-notice-icon{
  width:22px;
  height:22px;
  flex:0 0 22px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:#d99016;
  color:#fff;
  font-size:12px;
  font-weight:900;
}

.login-session-blocked .session-block-notice div{
  display:flex;
  flex-direction:column;
  gap:2px;
}

.login-session-blocked .session-block-notice strong{
  color:#86560a;
  font-size:12px;
}

.login-session-blocked .session-block-notice span:not(.session-block-notice-icon){
  color:#765d30;
  font-size:11.5px;
  line-height:1.5;
}

@media (max-width:600px){
 .login-session-blocked .session-block-header{
   padding:14px;
 }
 .login-session-blocked .session-block-body{
   padding:14px;
 }
 .login-session-blocked h3{
   font-size:17px;
 }
}


/* V47 PREMIUM AFTER HOURS ACCESS CARD */

.login-after-hours-required .session-block-header{
  background:
    radial-gradient(circle at 95% 0%,rgba(245,158,11,.18),transparent 42%),
    linear-gradient(135deg,#fffaf1 0%,#fff7e6 100%);
  border-bottom-color:rgba(217,119,6,.16);
}

.login-after-hours-required .session-block-icon{
  background:linear-gradient(145deg,#c87508,#f2a31a);
  box-shadow:0 8px 20px rgba(217,119,6,.24);
}

.login-after-hours-required .session-block-kicker{
  color:#a65c08;
}

.login-after-hours-required .session-block-rule{
  background:#fffaf2;
  border-color:#f2dfb9;
}

.login-after-hours-required .session-block-rule strong{
  color:#75430b;
}

.login-after-hours-required .session-block-rule span{
  color:#786247;
}

.login-after-hours-required .session-block-notice{
  background:#f5f9ff;
  border-color:#d5e4fb;
}

.login-after-hours-required .session-block-notice-icon{
  background:#2768cc;
}

.login-after-hours-required .session-block-notice strong{
  color:#1d4e98;
}

.login-after-hours-required .session-block-notice div span{
  color:#536b8e;
}

.login-after-hours-required .after-hours-wait-note{
  margin:13px 1px 0 !important;
  color:#64748b !important;
  font-size:11.5px !important;
  line-height:1.55 !important;
}


/* V47 REBUILT SECURITY CENTER */

.v47-security-center{
 display:grid;
 gap:18px;
 margin-top:18px;
}

.v47-security-card-title{
 display:flex;
 align-items:flex-start;
 gap:14px;
}

.v47-security-icon{
 width:44px;
 height:44px;
 flex:0 0 44px;
 display:grid;
 place-items:center;
 border-radius:14px;
 color:#fff;
 font-weight:900;
 font-size:18px;
 background:linear-gradient(145deg,#125ec4,#318df2);
 box-shadow:0 9px 22px rgba(37,99,235,.22);
}

.v47-security-card-title h3{
 margin-bottom:5px!important;
}

.v47-security-card-title p{
 margin:0;
}

.v47-security-overview-grid{
 display:grid;
 grid-template-columns:repeat(4,minmax(0,1fr));
 gap:12px;
 margin-top:15px;
}

.v47-security-stat{
 min-height:108px;
 display:flex;
 flex-direction:column;
 justify-content:center;
 gap:5px;
 padding:15px;
 border:1px solid #dce7f4;
 border-radius:15px;
 background:
  linear-gradient(145deg,#fbfdff,#f5f9ff);
}

.v47-security-stat span{
 color:#64748b;
 font-size:11px;
 font-weight:800;
 text-transform:uppercase;
 letter-spacing:.05em;
}

.v47-security-stat strong{
 color:#153963;
 font-size:17px;
 line-height:1.25;
}

.v47-security-stat small{
 color:#7a8ca3;
 line-height:1.4;
}

.v47-security-staff-grid{
 display:grid;
 grid-template-columns:minmax(220px,1fr) minmax(280px,1.5fr);
 gap:14px;
 margin-top:14px;
}

.v47-security-staff-grid label{
 display:flex;
 flex-direction:column;
 gap:7px;
 color:#52647b;
 font-size:12px;
 font-weight:700;
}

.v47-security-staff-grid select{
 width:100%;
 min-height:44px;
 padding:0 12px;
 border:1px solid #d4dfec;
 border-radius:12px;
 background:#fff;
 color:#142a46;
}

.v47-security-staff-info{
 display:flex;
 flex-direction:column;
 gap:4px;
 padding:13px 15px;
 border:1px solid #dce7f4;
 border-radius:13px;
 background:#f8fbff;
}

.v47-security-staff-info strong{
 color:#153963;
 font-size:15px;
}

.v47-security-staff-info span{
 color:#64748b;
 font-size:12px;
}

.v47-security-section-head{
 display:flex;
 justify-content:space-between;
 gap:16px;
 align-items:flex-start;
}

.v47-monitoring-badge{
 flex:0 0 auto;
 padding:7px 10px;
 border-radius:999px;
 background:#eaf4ff;
 color:#1764c0;
 font-size:10px;
 font-weight:900;
 letter-spacing:.06em;
 border:1px solid #cfe3fb;
}

.v47-security-table-wrap{
 overflow:auto;
 margin-top:14px;
}

.v47-security-table-wrap table{
 width:100%;
}

.v47-security-empty{
 margin-top:14px;
 padding:14px;
 border:1px dashed #d8e2ed;
 border-radius:12px;
 background:#fbfdff;
}

.v47-owner-controls{
 display:grid;
 grid-template-columns:repeat(2,minmax(0,1fr));
 gap:12px;
 margin-top:14px;
}

.v47-owner-controls>div{
 display:flex;
 flex-direction:column;
 gap:4px;
 padding:14px;
 border:1px solid #dce7f4;
 border-radius:13px;
 background:#f8fbff;
}

.v47-owner-controls strong{
 color:#153963;
}

.v47-owner-controls span{
 color:#64748b;
 font-size:12px;
 line-height:1.45;
}

@media(max-width:900px){

 .v47-security-overview-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
 }

 .v47-security-staff-grid,
 .v47-owner-controls{
  grid-template-columns:1fr;
 }

}

@media(max-width:560px){

 .v47-security-overview-grid{
  grid-template-columns:1fr;
 }

 .v47-security-section-head{
  flex-direction:column;
 }

}


/* V47 SECURITY CENTER FINAL ORDER */

.security-center-workspace #v46-security-operations{
 display:grid;
 gap:20px;
 width:100%;
 margin:0;
}

.security-center-workspace .v47-security-overview-grid{
 display:grid!important;
 grid-template-columns:repeat(4,minmax(0,1fr))!important;
 gap:14px!important;
 width:100%!important;
}

.security-center-workspace .v47-security-stat{
 min-width:0!important;
 width:auto!important;
 min-height:115px!important;
 margin:0!important;
}

.security-center-workspace .v46-security-card{
 width:100%!important;
 max-width:none!important;
 box-sizing:border-box!important;
}

.security-center-workspace #v46-security-operations table,
.security-center-workspace .v47-security-table-wrap table{
 width:100%!important;
}

.security-center-workspace #v46-security-operations th,
.security-center-workspace #v46-security-operations td,
.security-center-workspace .v47-security-table-wrap th,
.security-center-workspace .v47-security-table-wrap td{
 white-space:normal!important;
 overflow-wrap:anywhere;
 vertical-align:top;
}

@media(max-width:1100px){
 .security-center-workspace .v47-security-overview-grid{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
 }
}

@media(max-width:700px){
 .security-center-workspace .v47-security-overview-grid{
  grid-template-columns:1fr!important;
 }

 .security-center-workspace #v46-security-operations{
  overflow:hidden;
 }

 .security-center-workspace #v46-security-operations table,
 .security-center-workspace .v47-security-table-wrap table{
  min-width:720px;
 }
}


/* V47 CLEAN SECURITY ALERTS */

.security-center-workspace
.v46-security-alerts
.v47-security-table-wrap{
 overflow-x:auto;
}

.security-center-workspace
.v46-security-alerts table{
 width:100%!important;
 min-width:960px;
 table-layout:auto!important;
}

.security-center-workspace
.v46-security-alerts th,
.security-center-workspace
.v46-security-alerts td{
 white-space:normal!important;
 word-break:normal!important;
 overflow-wrap:normal!important;
 vertical-align:top!important;
}

.security-center-workspace
.v46-security-alerts th:nth-child(1){
 width:16%;
}

.security-center-workspace
.v46-security-alerts th:nth-child(2){
 width:23%;
}

.security-center-workspace
.v46-security-alerts th:nth-child(3){
 width:49%;
}

.security-center-workspace
.v46-security-alerts th:nth-child(4){
 width:12%;
}

.v47-alert-time{
 color:#607086;
 font-size:12px;
 line-height:1.55;
}

.v47-alert-event strong{
 display:block;
 color:#173b65;
 font-size:13px;
 line-height:1.45;
}

.v47-legacy-badge{
 display:inline-flex;
 margin-top:7px;
 padding:4px 8px;
 border-radius:999px;
 border:1px solid #d8e1eb;
 background:#f3f6f9;
 color:#65758a;
 font-size:9px;
 font-weight:900;
 letter-spacing:.08em;
}

.v47-alert-detail-grid{
 display:grid;
 grid-template-columns:
  repeat(2,minmax(0,1fr));
 gap:8px 14px;
}

.v47-alert-detail-grid>div{
 min-width:0;
 display:flex;
 flex-direction:column;
 gap:2px;
 padding:7px 9px;
 border-radius:9px;
 background:#f8fbff;
 border:1px solid #e4edf7;
}

.v47-alert-detail-grid span{
 color:#73839a;
 font-size:10px;
 font-weight:700;
 text-transform:uppercase;
 letter-spacing:.04em;
}

.v47-alert-detail-grid strong{
 color:#263c57;
 font-size:11.5px;
 line-height:1.4;
}

.v47-alert-message{
 color:#52647a;
 font-size:12px;
 line-height:1.6;
}

.v47-alert-legacy{
 display:flex;
 flex-direction:column;
 gap:4px;
 padding:10px 11px;
 border-radius:10px;
 background:#f7f8fa;
 border:1px solid #e1e5ea;
}

.v47-alert-legacy strong{
 color:#59687a;
 font-size:11px;
}

.v47-alert-legacy span{
 color:#6e7c8d;
 font-size:11.5px;
 line-height:1.55;
}

.v47-severity{
 display:inline-flex;
 align-items:center;
 justify-content:center;
 min-width:72px;
 padding:6px 9px;
 border-radius:999px;
 font-size:9px;
 font-weight:900;
 letter-spacing:.06em;
}

.v47-severity-warning{
 color:#9a5c00;
 background:#fff4db;
 border:1px solid #f1d28c;
}

.v47-severity-critical{
 color:#a92929;
 background:#fff0f0;
 border:1px solid #efb8b8;
}

.v47-severity-info{
 color:#1d61a9;
 background:#eef6ff;
 border:1px solid #c9e1fa;
}

@media(max-width:700px){

 .v47-alert-detail-grid{
  grid-template-columns:1fr;
 }

}


/* V47 ACTIVE AFTER HOURS ACCESS */

.v47-active-access-card{
 border-color:#bddfc9!important;
 background:
  linear-gradient(
   145deg,
   #ffffff,
   #fbfffc
  )!important;
}

.v47-active-access-card::before{
 background:
  linear-gradient(
   90deg,
   #15803d,
   #22a856,
   #55c979
  )!important;
}

.v47-active-access-head{
 display:flex;
 justify-content:space-between;
 align-items:flex-start;
 gap:18px;
}

.v47-active-access-kicker{
 margin-bottom:4px;
 color:#15803d;
 font-size:10px;
 font-weight:900;
 letter-spacing:.10em;
}

.v47-active-badge{
 flex:0 0 auto;
 display:inline-flex;
 align-items:center;
 padding:7px 11px;
 border-radius:999px;
 background:#e9f9ef;
 border:1px solid #b9e4c8;
 color:#16713a;
 font-size:10px;
 font-weight:900;
 letter-spacing:.06em;
}

.v47-active-access-item{
 margin-top:15px;
 padding:16px;
 border:1px solid #d9e8df;
 border-radius:14px;
 background:#fff;
 box-shadow:
  0 7px 18px rgba(26,82,48,.05);
}

.v47-active-access-person{
 display:flex;
 flex-direction:column;
 gap:3px;
 margin-bottom:13px;
}

.v47-active-access-person strong{
 color:#173f2a;
 font-size:16px;
}

.v47-active-access-person span{
 color:#688070;
 font-size:12px;
}

.v47-active-access-grid{
 display:grid;
 grid-template-columns:
  repeat(4,minmax(0,1fr));
 gap:10px;
}

.v47-active-access-grid>div{
 display:flex;
 flex-direction:column;
 gap:4px;
 padding:10px 11px;
 border-radius:11px;
 background:#f7fcf8;
 border:1px solid #e1eee5;
}

.v47-active-access-grid span{
 color:#75877b;
 font-size:9px;
 font-weight:800;
 text-transform:uppercase;
 letter-spacing:.05em;
}

.v47-active-access-grid strong{
 color:#294c36;
 font-size:11.5px;
 line-height:1.45;
}

.v47-remaining-time{
 color:#16713a!important;
}

.v47-active-access-actions{
 display:flex;
 justify-content:space-between;
 align-items:center;
 gap:12px;
 margin-top:14px;
 padding-top:13px;
 border-top:1px solid #e4ece7;
}

.v47-applied-status{
 display:inline-flex;
 padding:6px 9px;
 border-radius:999px;
 background:#e9f9ef;
 color:#16713a;
 font-size:9px;
 font-weight:900;
 letter-spacing:.06em;
}

@media(max-width:900px){

 .v47-active-access-grid{
  grid-template-columns:
   repeat(2,minmax(0,1fr));
 }
}

@media(max-width:600px){

 .v47-active-access-head,
 .v47-active-access-actions{
  flex-direction:column;
  align-items:flex-start;
 }

 .v47-active-access-grid{
  grid-template-columns:1fr;
 }
}

