:root{
  --nav:#173b62;--nav2:#0f2d4c;--accent:#f28b22;--accent2:#e2711a;
  --bg:#f3f6fa;--card:#fff;--line:#dce4ee;--line2:#eef2f7;--ink:#14202e;--ink2:#4a5a6c;--muted:#7b8a9b;
  --good:#0f8a4b;--goodbg:#e4f5ec;--warn:#9a6200;--warnbg:#fff3dc;--bad:#c0332b;--badbg:#fde8e6;--info:#1f5fa8;--infobg:#e6effa;
  --s1:#2a78d6;--s2:#eb6834;--s3:#1baf7a;
  --r:10px;--sh:0 1px 2px rgba(16,32,52,.06),0 4px 16px rgba(16,32,52,.05);
  font-family:"Segoe UI",system-ui,-apple-system,Roboto,Arial,sans-serif;font-size:14px;color:var(--ink);
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink)}
a{color:var(--info);text-decoration:none}
.hidden{display:none!important}
.muted{color:var(--muted)}
.err{color:var(--bad);min-height:18px;font-size:13px}
h1,h2,h3{margin:0 0 10px;font-weight:650;letter-spacing:-.01em}
h1{font-size:20px}h2{font-size:17px}h3{font-size:15px}

/* auth */
.auth{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,var(--nav2),var(--nav) 60%,#24527f);padding:16px}
.auth-card{background:#fff;border-radius:14px;padding:28px;width:min(380px,100%);box-shadow:0 20px 60px rgba(0,0,0,.25);display:flex;flex-direction:column;gap:10px}
.auth-logo{width:64px;height:64px;object-fit:contain;align-self:center}
.auth-card h1{text-align:center;margin:0}.auth-card p{text-align:center;margin:0 0 6px}
label{display:flex;flex-direction:column;gap:4px;font-size:12px;font-weight:600;color:var(--ink2)}
input,select,textarea{font:inherit;font-size:14px;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink);min-width:0;width:100%}
textarea{resize:vertical;min-height:60px}
input:focus,select:focus,textarea:focus{outline:2px solid rgba(242,139,34,.35);border-color:var(--accent)}
input[type=checkbox]{width:auto}

/* buttons */
.btn{font:inherit;font-weight:600;border:1px solid var(--line);background:#fff;color:var(--ink);padding:8px 14px;border-radius:8px;cursor:pointer;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;text-decoration:none}
.btn:hover{border-color:#b9c6d6;background:#f8fafc}
.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff}.btn.primary:hover{background:var(--accent2)}
.btn.navy{background:var(--nav);border-color:var(--nav);color:#fff}.btn.navy:hover{background:var(--nav2)}
.btn.danger{color:var(--bad);border-color:#f0c4c0}.btn.danger:hover{background:var(--badbg)}
.btn.ghost{background:transparent;border-color:transparent;color:inherit}
.btn.sm{padding:5px 10px;font-size:13px}.btn.block{width:100%;justify-content:center;padding:10px}
.btn:disabled{opacity:.5;cursor:not-allowed}
.icon-btn{background:none;border:0;font-size:18px;cursor:pointer;padding:6px 8px;border-radius:8px;color:inherit;text-decoration:none}
.icon-btn:hover{background:rgba(0,0,0,.06)}

/* layout */
#app{display:flex;min-height:100vh}
#side{width:236px;background:var(--nav);color:#dbe6f3;display:flex;flex-direction:column;position:fixed;inset:0 auto 0 0;z-index:30;transition:transform .2s}
.brand{display:flex;gap:10px;align-items:center;padding:16px 16px 12px;border-bottom:1px solid rgba(255,255,255,.08)}
.brand img{width:38px;height:38px;object-fit:contain;background:#fff;border-radius:50%;padding:2px}
.brand b{display:block;color:#fff;font-size:14px;line-height:1.1}.brand small{color:var(--accent);font-weight:600;font-size:11px;letter-spacing:.06em;text-transform:uppercase}
#nav{flex:1;overflow-y:auto;padding:8px 8px 16px}
#nav .grp{font-size:10.5px;text-transform:uppercase;letter-spacing:.09em;color:#8fa6c1;padding:14px 10px 4px;font-weight:700}
#nav a{display:flex;align-items:center;gap:10px;padding:7px 10px;border-radius:7px;color:#dbe6f3;font-size:13.5px}
#nav a:hover{background:rgba(255,255,255,.07)}
#nav a.on{background:rgba(242,139,34,.16);color:#fff;box-shadow:inset 3px 0 0 var(--accent)}
#nav a i{font-style:normal;width:18px;text-align:center;opacity:.9}
.side-foot{padding:10px 16px;font-size:12px;color:#9fb3ca;border-top:1px solid rgba(255,255,255,.08)}
#mainWrap{flex:1;margin-left:236px;min-width:0;display:flex;flex-direction:column}
#top{position:sticky;top:0;z-index:20;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:10px;padding:8px 16px}
#menuBtn{display:none}
#searchForm{flex:1;max-width:520px}
#searchBox{background:var(--bg);border-color:transparent}
.top-right{margin-left:auto;display:flex;gap:6px;align-items:center}
main{padding:18px 20px 40px;max-width:1500px;width:100%}
#scrim{display:none}

/* page header */
.ph{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:14px}
.ph h1{margin:0}.ph .sub{color:var(--muted);font-size:13px;margin-top:3px}
.actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}

/* cards/grid */
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--sh);padding:16px}
.card h3{display:flex;justify-content:space-between;align-items:center}
.grid{display:grid;gap:14px}
.g2{grid-template-columns:repeat(2,minmax(0,1fr))}.g3{grid-template-columns:repeat(3,minmax(0,1fr))}.g4{grid-template-columns:repeat(4,minmax(0,1fr))}
.kpis{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:12px;margin-bottom:14px}
.kpi{background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:14px 16px;box-shadow:var(--sh);position:relative;overflow:hidden}
.kpi .l{font-size:12px;color:var(--ink2);font-weight:600}
.kpi .v{font-size:22px;font-weight:700;margin-top:6px;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.kpi .s{font-size:12px;color:var(--muted);margin-top:4px}
.kpi.accent{border-top:3px solid var(--accent)}.kpi.navy{border-top:3px solid var(--nav)}
.chart-box{position:relative;height:280px}
.chart-box.sm{height:230px}

/* tables */
.tbl-wrap{overflow:auto;border:1px solid var(--line);border-radius:var(--r);background:#fff}
table.t{border-collapse:collapse;width:100%;font-size:13px}
table.t th{background:#f6f8fb;text-align:left;font-weight:650;color:var(--ink2);padding:9px 10px;border-bottom:1px solid var(--line);white-space:nowrap;position:sticky;top:0;z-index:1}
table.t td{padding:8px 10px;border-bottom:1px solid var(--line2);vertical-align:top}
table.t tr:last-child td{border-bottom:0}
table.t tbody tr:hover td{background:#fafcfe}
table.t tr.click{cursor:pointer}
table.t .n,table.t th.n{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
table.t tfoot td{font-weight:700;background:#f6f8fb;border-top:1px solid var(--line)}
.empty{padding:30px;text-align:center;color:var(--muted)}
.mini-list{list-style:none;margin:0;padding:0}
.mini-list li{display:flex;justify-content:space-between;gap:10px;padding:8px 0;border-bottom:1px solid var(--line2);font-size:13px}
.mini-list li:last-child{border-bottom:0}
.mini-list li>b{white-space:nowrap}

/* pills */
.pill{display:inline-block;padding:2px 9px;border-radius:99px;font-size:11.5px;font-weight:650;background:#eef2f7;color:var(--ink2);white-space:nowrap}
.pill.good{background:var(--goodbg);color:var(--good)}.pill.warn{background:var(--warnbg);color:var(--warn)}.pill.bad{background:var(--badbg);color:var(--bad)}.pill.info{background:var(--infobg);color:var(--info)}

/* filters */
.filters{display:flex;gap:8px;flex-wrap:wrap;align-items:flex-end;margin-bottom:12px}
.filters label{min-width:130px}
.filters .grow{flex:1;min-width:180px}
.seg{display:inline-flex;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:#fff}
.seg button{border:0;background:none;padding:7px 12px;font:inherit;font-size:13px;cursor:pointer;color:var(--ink2)}
.seg button.on{background:var(--nav);color:#fff}

/* forms */
.form-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.span2{grid-column:span 2}.span3{grid-column:span 3}.span4{grid-column:span 4}
.section-t{font-size:12px;text-transform:uppercase;letter-spacing:.07em;color:var(--nav);font-weight:750;margin:18px 0 8px;display:flex;align-items:center;gap:8px}
.section-t::before{content:"";width:4px;height:14px;background:var(--accent);border-radius:2px}
.lines td{padding:5px 4px!important}
.lines input,.lines select,.lines textarea{padding:6px 7px;font-size:13px}
.lines textarea{min-height:36px}
.totals-box{margin-left:auto;width:min(340px,100%)}
.totals-box div{display:flex;justify-content:space-between;padding:6px 0;border-bottom:1px solid var(--line2)}
.totals-box div.g{font-weight:750;font-size:16px;border-bottom:0;background:var(--nav);color:#fff;padding:9px 12px;border-radius:8px;margin-top:6px}
.sticky-bar{position:sticky;bottom:0;background:rgba(243,246,250,.95);backdrop-filter:blur(4px);padding:12px 0;display:flex;gap:8px;justify-content:flex-end;border-top:1px solid var(--line);margin-top:16px;z-index:5}

/* modal */
.modal{position:fixed;inset:0;background:rgba(10,22,38,.45);display:grid;place-items:center;z-index:100;padding:16px}
.modal-card{background:#fff;border-radius:14px;padding:22px;width:min(760px,100%);max-height:92vh;overflow:auto;box-shadow:0 20px 60px rgba(0,0,0,.3)}
.modal-foot{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}
#toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%) translateY(80px);background:var(--ink);color:#fff;padding:10px 18px;border-radius:10px;opacity:0;transition:.25s;z-index:200;font-weight:600;max-width:90vw}
#toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
#toast.bad{background:var(--bad)}

.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);margin-bottom:14px;flex-wrap:wrap}
.tabs a{padding:8px 14px;color:var(--ink2);font-weight:600;border-bottom:2px solid transparent;margin-bottom:-1px}
.tabs a.on{color:var(--nav);border-color:var(--accent)}
.report-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:12px}
.report-list a{display:block;background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:14px;color:var(--ink);box-shadow:var(--sh)}
.report-list a:hover{border-color:var(--accent)}
.report-list b{display:block;margin-bottom:4px}.report-list span{font-size:12.5px;color:var(--muted)}
.legend{display:flex;gap:14px;flex-wrap:wrap;font-size:12px;color:var(--ink2);margin-bottom:6px}
.legend i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:5px;vertical-align:-1px}
.notice{background:var(--infobg);color:var(--info);padding:10px 12px;border-radius:8px;font-size:13px}
.notice.warn{background:var(--warnbg);color:var(--warn)}
.img-slot{display:flex;gap:10px;align-items:center}
.img-slot img{width:70px;height:56px;object-fit:contain;border:1px solid var(--line);border-radius:6px;background:#fff}

/* ===== printable A4 document ===== */
.sheet-wrap{overflow:auto;padding:8px 0}
.sheet{width:210mm;min-height:297mm;margin:0 auto;background:#fff;box-shadow:0 4px 30px rgba(0,0,0,.12);padding:12mm 12mm 10mm;color:#1b2533;font-family:Arial,Helvetica,sans-serif;font-size:10.5px;display:flex;flex-direction:column}
.sheet .hd{display:flex;justify-content:space-between;align-items:center;padding-bottom:8px;border-bottom:1.5px solid #173b62;position:relative}
.sheet .hd::after{content:"";position:absolute;left:0;bottom:-1.5px;width:30%;height:3px;background:#f28b22}
.sheet .hd .lg{display:flex;align-items:center;gap:14px}
.sheet .hd .lg img{width:78px;height:78px;object-fit:contain}
.sheet .hd .cn{font-size:23px;font-weight:800;color:#173b62;line-height:1.08;letter-spacing:.01em}
.sheet .hd .cn small{display:block;font-size:12px;color:#445;font-weight:600;margin-top:4px}
.sheet .hd .cert{text-align:center;font-weight:700;font-size:9px}
.sheet .hd .cert img{width:90px;height:52px;object-fit:contain;display:block;margin:0 auto}
.sheet .hd .cert .svc{background:#173b62;color:#fff;padding:5px 12px;margin-top:4px;font-size:9px}
.sheet .ttl{text-align:center;margin:14px 0 12px}
.sheet .ttl span{font-size:22px;font-weight:800;color:#173b62;display:inline-block;padding:0 14px 4px;border-bottom:3px solid #f28b22;letter-spacing:.02em}
.sheet .panels{display:grid;grid-template-columns:1.45fr 1fr;gap:10px}
.sheet .pn{border:1px solid #c9d3de}
.sheet .pn .ph2{background:#eef2f7;border-left:4px solid #f28b22;font-weight:800;color:#173b62;padding:7px 10px;font-size:10px;letter-spacing:.03em}
.sheet .pn .pb{padding:9px 12px;line-height:1.45}
.sheet .pn .pname{font-size:13.5px;font-weight:800;color:#173b62;margin-bottom:3px}
.sheet .pn .kv{display:grid;grid-template-columns:92px 1fr;row-gap:3px}
.sheet .pn .kv b{color:#556;font-weight:600;font-size:9.5px}
.sheet table.it{width:100%;border-collapse:collapse;margin-top:14px;border-top:3px solid #f28b22}
.sheet table.it th{background:#10263f;color:#fff;font-size:9.5px;padding:8px 7px;text-align:left;font-weight:700}
.sheet table.it td{padding:7px;border-bottom:1px solid #d7dee7;border-right:1px solid #e3e8ee;vertical-align:top;white-space:pre-wrap}
.sheet table.it td:last-child{border-right:0}
.sheet table.it .n{text-align:right;white-space:nowrap}
.sheet .lower{display:grid;grid-template-columns:1.45fr 1fr;gap:14px;margin-top:12px;align-items:start}
.sheet .terms .ph2{background:#eef2f7;border-left:4px solid #f28b22;font-weight:800;color:#173b62;padding:7px 10px;font-size:10px}
.sheet .terms .kv{display:grid;grid-template-columns:100px 1fr;row-gap:3px;padding:8px 4px;line-height:1.4}
.sheet .terms .kv b{color:#556;font-weight:600}
.sheet .tot div{display:flex;justify-content:space-between;padding:7px 10px;border-bottom:1px solid #e3e8ee}
.sheet .tot div:first-child{background:#eef2f7;font-weight:700}
.sheet .tot .gt{background:#10263f;color:#fff;font-weight:800;font-size:12px;border:0}
.sheet .words{margin-top:8px;font-size:9.5px}.sheet .words b{display:block;color:#556;font-size:9px;letter-spacing:.04em}
.sheet .phead{order:0}
.sheet .pgw{order:1;flex:1;width:100%;border-collapse:collapse}
.sheet .pgw>thead>tr>td,.sheet .pgw>tfoot>tr>td,.sheet .pgw>tbody>tr>td{padding:0;vertical-align:top}
.sheet .pfoot{order:2}
.sheet .sp-h,.sheet .sp-f{display:none}
.sheet .sign{display:flex;justify-content:flex-end;margin-top:10px}
.sheet .sign .box{width:290px;text-align:center}
.sheet .sign .for{font-weight:800;color:#173b62;text-align:right;font-size:10px;margin-bottom:6px}
.sheet .sign .imgs{display:flex;align-items:flex-end;justify-content:center;gap:0;height:120px}
.sheet .sign .imgs .st{width:120px;height:120px;object-fit:contain;margin-right:-8px}
.sheet .sign .imgs .sg{width:110px;height:78px;object-fit:contain}
.sheet .sign .line{border-top:1px solid #8a96a5;margin-top:2px;padding-top:4px;font-size:9.5px;color:#556}
.sheet .ft{margin-top:12px;border-top:1.5px solid #173b62;position:relative;padding-top:8px;display:grid;grid-template-columns:repeat(3,max-content);justify-content:space-between;gap:10px;font-size:7.8px;color:#445;line-height:1.5}
.sheet .ft span{display:block;white-space:nowrap}
.sheet .ft::before{content:"";position:absolute;left:0;top:-1.5px;width:20%;height:3px;background:#f28b22}
.sheet .ft b{display:block;color:#173b62;font-size:9px;margin-bottom:2px}
.sheet .ft2{display:flex;justify-content:space-between;font-size:8.5px;margin-top:10px;color:#445}
.sheet .ft2 b{color:#173b62}
.sheet .bank{margin-top:8px;font-size:9.5px;white-space:pre-wrap;line-height:1.4}
.sheet .bank b{color:#556}
.sheet .note{white-space:pre-wrap}
.sheet .subj{margin-top:10px;padding:7px 10px;border:1px solid #c9d3de;border-left:4px solid #173b62;font-size:10.5px;line-height:1.4}
.sheet .subj b{color:#173b62;margin-right:4px}
.sheet table.it tr{break-inside:avoid;page-break-inside:avoid}
.sheet table.it thead{display:table-header-group}
.sheet .totblk,.sheet .tot,.sheet .sign,.sheet .ft,.sheet .ft2,.sheet .words,.sheet .terms .ph2{break-inside:avoid;page-break-inside:avoid}
.sheet .terms .kv span{white-space:pre-wrap}

@media (max-width:1100px){.g4{grid-template-columns:repeat(2,minmax(0,1fr))}.g3{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:860px){
  #side{transform:translateX(-100%)}
  body.nav-open #side{transform:none}
  body.nav-open #scrim{display:block;position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:25}
  #mainWrap{margin-left:0}
  #menuBtn{display:block}
  main{padding:14px 12px 40px}
  .g2,.g3,.g4{grid-template-columns:minmax(0,1fr)}
  .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .span3,.span4{grid-column:span 2}
  .kpi .v{font-size:19px}
  .kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .kpi{padding:10px 12px}
  #logoutBtn{display:none}
}
@media print{
  @page{size:A4;margin:0 0 10mm 0;@bottom-right{content:"Page " counter(page) "/" counter(pages);font:8px Arial,sans-serif;color:#445;margin-right:12mm}}
  @page report{size:A4 landscape;margin:10mm 10mm 12mm 10mm;@bottom-right{content:"Page " counter(page) "/" counter(pages);font:8px Arial,sans-serif;color:#445}}
  .print-report{page:report}
  body{background:#fff}
  #side,#top,.no-print,#toast,#modal{display:none!important}
  #mainWrap{margin:0}main{padding:0;max-width:none}
  .sheet{box-shadow:none;margin:0;width:210mm;min-height:0;padding:0;display:block}
  .sheet .phead{position:fixed;top:0;left:12mm;right:12mm;background:#fff;z-index:2;padding-top:8mm}
  .sheet.theme-modern .phead{padding:7mm 12mm 6mm}
  .sheet .pfoot{position:fixed;bottom:0;left:12mm;right:12mm;background:#fff;z-index:2}
  .sheet .pgw{width:calc(100% - 24mm);margin:0 12mm}
  .sheet .sp-h,.sheet .sp-f{display:block}
  .sheet .sp-h{height:38mm}
  .theme-modern .sp-h{height:40mm}
  .theme-elegant .sp-h{height:38mm}
  .theme-modern .sp-f{height:30mm}
  .sheet .sp-f{height:var(--sp-f,27mm)}
  .sheet-wrap{padding:0;overflow:visible}
  .print-report{padding:0}
  html,body{height:auto}
  #app{display:block;min-height:0}
  .print-report table.t tfoot{display:table-row-group}
  .print-report .ph{margin-bottom:6px}
  table.t th{white-space:normal}
  table.t td,table.t th{padding:4px 5px}
  .print-report .tbl-wrap{border:0;overflow:visible}
  table.t th{position:static}
  table.t{font-size:9px}
}

/* ===== Document themes (Company Settings → Document design) ===== */
.sheet{position:relative;--acc:#f28b22;--navy:#173b62;--navy2:#10263f}
.sheet.t-quotation{--typ:#2a78d6}.sheet.t-proforma{--typ:#7a5af0}.sheet.t-invoice{--typ:#f28b22}.sheet.t-packing_list{--typ:#149e8e}.sheet.t-purchase_order{--typ:#173b62}.sheet.t-credit_note{--typ:#d64545}.sheet.t-bill{--typ:#5b6b7d}
.sheet .wm,.sheet .hsub,.sheet .hcard,.sheet .sstamp{display:none}
.sheet .hero{position:relative}
.sheet.theme-classic .pgw,.sheet .pgw{position:relative;z-index:1}

/* ---------- MODERN: navy band header, summary card, zebra table, type colour ---------- */
.sheet.theme-modern{padding-top:0}
.theme-modern .phead{margin:0 -12mm;padding:7mm 12mm 6mm;background:linear-gradient(100deg,#0d2238 0%,#173b62 62%,#21507f 100%);border-bottom:4px solid var(--acc)}
@media screen{.theme-modern .phead{position:relative}}
.theme-modern .phead::after{content:"";position:absolute;right:0;bottom:-4px;width:34%;height:4px;background:var(--typ)}
.theme-modern .hd{border:0;padding:0}
.theme-modern .hd::after{display:none}
.theme-modern .hd .lg img{background:#fff;border-radius:14px;padding:5px;width:70px;height:70px}
.theme-modern .hd .cn{color:#fff;font-size:22px}
.theme-modern .hd .cn small{color:#cfe0f3}
.theme-modern .hd .cert{background:#fff;border-radius:8px;padding:5px 6px 0;overflow:hidden}
.theme-modern .hd .cert img{height:40px}
.theme-modern .hd .cert .svc{margin:4px -6px 0;background:var(--acc)}
.theme-modern .hero{display:flex;justify-content:space-between;align-items:center;gap:14px;margin:14px 0 12px}
.theme-modern .ttl{text-align:left;margin:0}
.theme-modern .ttl span{font-size:26px;letter-spacing:.06em;border:0;padding:0;color:var(--navy2);position:relative}
.theme-modern .ttl span::after{content:"";display:block;width:46px;height:4px;border-radius:2px;background:var(--typ);margin-top:5px}
.theme-modern .hsub{display:block;font-size:11px;color:#56657a;margin-top:6px;font-weight:600}
.theme-modern .hcard{display:flex;flex-direction:column;align-items:flex-end;background:#f5f8fc;border:1px solid #dfe7f1;border-left:4px solid var(--typ);border-radius:10px;padding:8px 14px;min-width:190px}
.theme-modern .hcard small{font-size:8.5px;font-weight:800;letter-spacing:.08em;color:#56657a}
.theme-modern .hcard b{font-size:17px;color:var(--navy2);margin-top:2px}
.theme-modern .hcard em{font-style:normal;font-size:9px;color:#56657a;margin-top:2px}
.theme-modern .sstamp{display:block;position:absolute;left:52%;top:50%;transform:translate(-50%,-50%) rotate(-12deg);border:3px solid;border-radius:8px;padding:3px 14px;font-weight:900;font-size:22px;letter-spacing:.12em;opacity:.8}
.sstamp.s-paid{color:#0f8a4b}.sstamp.s-draft{color:#9aa6b2}.sstamp.s-cancelled{color:#c0332b}
.theme-modern .pn{border:1px solid #e1e8f0;border-radius:10px;overflow:hidden;background:#fff}
.theme-modern .pn .ph2,.theme-modern .terms .ph2{background:none;border-left:0;color:var(--acc);font-size:9px;letter-spacing:.1em;padding:9px 12px 0}
.theme-modern .terms .ph2{padding-left:4px}
.theme-modern .subj{border-radius:8px;border:1px solid #e1e8f0;border-left:4px solid var(--typ);background:#fff}
.theme-modern table.it{border-top:0;border-radius:10px;overflow:hidden;margin-top:12px}
.theme-modern table.it th{background:var(--navy2);padding:9px 8px}
.theme-modern table.it td{border-right:0;border-bottom:1px solid #edf1f6;background:#fff}
.theme-modern table.it tbody tr:nth-child(even) td{background:#f7f9fc}
.theme-modern .tot{border:1px solid #e1e8f0;border-radius:10px;overflow:hidden;background:#fff}
.theme-modern .tot div:first-child{background:#f5f8fc}
.theme-modern .tot .gt{background:var(--acc)}
.theme-modern .ft{border-top:0;background:#f3f6fa;border-radius:10px;padding:9px 12px}
.theme-modern .ft::before{display:none}
.theme-modern .ft2{padding:0 12px}

/* ---------- ELEGANT: clean white, big title on the right, fine lines ---------- */
.theme-elegant .hd{border-bottom:1px solid #cfd8e3}
.theme-elegant .hd::after{width:100%;height:1px;background:linear-gradient(90deg,var(--typ),transparent 70%);bottom:-1px}
.theme-elegant .hd .lg img{width:64px;height:64px}
.theme-elegant .hd .cn{font-size:20px;font-weight:700;letter-spacing:.04em}
.theme-elegant .hero{display:flex;justify-content:space-between;align-items:flex-end;margin:16px 0 14px;gap:14px}
.theme-elegant .ttl{text-align:left;margin:0}
.theme-elegant .ttl span{border:0;padding:0;font-size:30px;font-weight:300;letter-spacing:.14em;color:var(--navy2)}
.theme-elegant .hsub{display:block;font-size:11px;color:var(--typ);font-weight:700;letter-spacing:.04em;margin-top:4px}
.theme-elegant .hcard{display:flex;flex-direction:column;align-items:flex-end;text-align:right}
.theme-elegant .hcard small{font-size:8.5px;letter-spacing:.14em;color:#7a8898;font-weight:700}
.theme-elegant .hcard b{font-size:20px;font-weight:700;color:var(--navy2)}
.theme-elegant .hcard em{font-style:normal;font-size:9px;color:#7a8898}
.theme-elegant .sstamp{display:block;position:absolute;left:50%;top:40%;transform:translate(-50%,-50%) rotate(-10deg);font-size:24px;font-weight:300;letter-spacing:.3em;border-top:1.5px solid;border-bottom:1.5px solid;padding:2px 10px;opacity:.75}
.theme-elegant .pn{border:0;border-top:2px solid var(--navy2)}
.theme-elegant .pn .ph2,.theme-elegant .terms .ph2{background:none;border-left:0;padding:7px 0 0;color:#7a8898;font-size:8.5px;letter-spacing:.14em}
.theme-elegant .pn .pb{padding:6px 0}
.theme-elegant .subj{border:0;border-left:3px solid var(--typ);background:#f7f9fb}
.theme-elegant table.it{border-top:2px solid var(--navy2)}
.theme-elegant table.it th{background:#fff;color:var(--navy2);border-bottom:1px solid #cfd8e3;letter-spacing:.06em;font-size:8.5px}
.theme-elegant table.it td{border-right:0;border-bottom:1px solid #eef1f5}
.theme-elegant .tot div{border-bottom:1px solid #eef1f5}
.theme-elegant .tot div:first-child{background:none}
.theme-elegant .tot .gt{background:none;color:var(--navy2);border-top:2px solid var(--navy2);border-bottom:3px double var(--navy2);font-size:13px}
.theme-elegant .ft{border-top:1px solid #cfd8e3}
.theme-elegant .ft::before{background:var(--typ)}

@media print{
  .theme-modern .phead{margin:0;left:0!important;right:0!important}
  .sheet .sstamp{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .sheet{-webkit-print-color-adjust:exact;print-color-adjust:exact}
}
