:root {
  --navy: #0b1d3a; --navy2: #102a54; --aqua: #06b6d4; --blue: #2563eb; --ink: #0f172a; --muted: #64748b;
  --glass: rgba(255,255,255,.82); --line: rgba(15,23,42,.08); --side-w: 252px;
  --bs-primary: #0e7490; --bs-primary-rgb: 14,116,144; --bs-body-font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
html, body { min-height: 100%; }
body {
  color: var(--ink); font-size: .92rem;
  background:
    radial-gradient(1200px 600px at -10% -10%, rgba(6,182,212,.16), transparent 60%),
    radial-gradient(900px 600px at 110% 0%, rgba(99,102,241,.14), transparent 60%),
    radial-gradient(900px 700px at 100% 110%, rgba(16,185,129,.12), transparent 60%),
    linear-gradient(180deg, #f3f7fc 0%, #eef3f9 100%);
  background-attachment: fixed;
}
.btn-primary { --bs-btn-bg: #0e7490; --bs-btn-border-color: #0e7490; --bs-btn-hover-bg: #155e75; --bs-btn-hover-border-color: #155e75; --bs-btn-active-bg: #164e63; }
.btn-outline-primary { --bs-btn-color: #0e7490; --bs-btn-border-color: #0e7490; --bs-btn-hover-bg: #0e7490; --bs-btn-hover-border-color: #0e7490; }
.text-primary { color: #0e7490 !important; }
a { color: #0e7490; }

/* floating bubbles background */
.bubbles { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bubbles span { position: absolute; bottom: -120px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.9), rgba(6,182,212,.12) 60%, rgba(6,182,212,.04)); border: 1px solid rgba(6,182,212,.15); animation: rise 26s linear infinite; }
.bubbles span:nth-child(1){left:8%;width:60px;height:60px;animation-delay:0s}
.bubbles span:nth-child(2){left:24%;width:28px;height:28px;animation-delay:6s;animation-duration:20s}
.bubbles span:nth-child(3){left:46%;width:90px;height:90px;animation-delay:3s;animation-duration:32s}
.bubbles span:nth-child(4){left:66%;width:40px;height:40px;animation-delay:10s}
.bubbles span:nth-child(5){left:82%;width:70px;height:70px;animation-delay:14s;animation-duration:30s}
.bubbles span:nth-child(6){left:93%;width:22px;height:22px;animation-delay:2s;animation-duration:18s}
.bubbles span:nth-child(7){left:36%;width:46px;height:46px;animation-delay:8s;animation-duration:24s}
.bubbles span:nth-child(8){left:56%;width:18px;height:18px;animation-delay:12s;animation-duration:16s}
@keyframes rise { 0% { transform: translateY(0) translateX(0); opacity: 0; } 10% { opacity: 1; } 50% { transform: translateY(-55vh) translateX(20px); } 100% { transform: translateY(-115vh) translateX(-10px); opacity: 0; } }

/* sidebar */
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--side-w); z-index: 1040; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy2) 60%, #0c4a6e 100%); color: #cbd5e1; box-shadow: 4px 0 30px rgba(2,6,23,.18); }
.sidebar::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(400px 200px at 0% 100%, rgba(6,182,212,.25), transparent 70%); }
.brand { display: flex; gap: 12px; align-items: center; padding: 20px 18px; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand b { display: block; font-size: 1rem; line-height: 1.2; }
.brand small { color: #7dd3fc; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.brand-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; color: #fff; background: linear-gradient(135deg, #22d3ee, #2563eb); box-shadow: 0 6px 18px rgba(34,211,238,.4); flex: none; }
.brand-icon.big { width: 72px; height: 72px; font-size: 2.3rem; border-radius: 20px; margin-bottom: 18px; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 8px 10px 16px; position: relative; z-index: 1; }
.sidebar nav::-webkit-scrollbar { width: 5px } .sidebar nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px }
.nav-group { font-size: .66rem; text-transform: uppercase; letter-spacing: .14em; color: #64748b; margin: 16px 10px 6px; font-weight: 700; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: #cbd5e1; text-decoration: none; margin-bottom: 2px; transition: .15s; }
.nav-item i { font-size: 1.05rem; width: 20px; text-align: center; color: #7dd3fc; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(34,211,238,.25), rgba(37,99,235,.15)); color: #fff; box-shadow: inset 3px 0 0 #22d3ee; }
.nav-item.active i { color: #22d3ee; }
.side-foot { padding: 12px 18px; font-size: .75rem; color: #94a3b8; border-top: 1px solid rgba(255,255,255,.07); position: relative; z-index: 1; }

/* main */
.main { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; position: relative; z-index: 1; }
.topbar { position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: 12px; padding: 12px 26px; background: rgba(255,255,255,.72); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.page-title { font-size: 1.2rem; font-weight: 700; margin: 0; }
.co-switch { min-width: 190px; border-radius: 10px; font-weight: 600; }
.date-chip { font-size: .8rem; color: var(--muted); background: #fff; border: 1px solid var(--line); padding: 5px 12px; border-radius: 20px; }
.user-chip { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 30px; padding: 4px 14px 4px 4px; text-align: left; line-height: 1.1; }
.user-chip small { display: block; color: var(--muted); font-size: .7rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, #06b6d4, #6366f1); }
.avatar-sm { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, #10b981, #0e7490); flex-shrink: 0; }
.handover .card-header { border-bottom: 1px solid var(--line); }
.ho-box { background: rgba(15,23,42,.045); border-radius: 10px; padding: 8px 6px; } .ho-box small { display: block; color: var(--muted); font-size: .75rem; } .ho-box b { font-size: 1.05rem; }
.btn-icon { border: 0; font-size: 1.4rem; }
.content { padding: 24px 26px; flex: 1; }
.foot { text-align: center; color: var(--muted); font-size: .75rem; padding: 14px; }

/* cards */
.card.glass, .glass { background: var(--glass); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.7); border-radius: 16px; box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 28px rgba(15,23,42,.06); }
.card.glass > .card-header { background: transparent; border-bottom: 1px solid var(--line); padding: 14px 18px; }
.card.glass > .card-body { padding: 18px; }
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; border-bottom-width: 1px; white-space: nowrap; background: rgba(241,245,249,.7); }
.table td { vertical-align: middle; }
.table-hover tbody tr:hover > * { background: rgba(6,182,212,.06); }
.table tfoot td, .table tfoot th { font-weight: 700; background: rgba(241,245,249,.8); }

/* KPI cards */
.kpi { display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: 16px; background: var(--glass); border: 1px solid rgba(255,255,255,.7); box-shadow: 0 8px 28px rgba(15,23,42,.06); height: 100%; position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; opacity: .1; background: var(--k); }
.kpi-icon { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-size: 1.35rem; background: var(--k); box-shadow: 0 8px 18px -6px var(--ks); flex: none; }
.kpi-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 1.4rem; font-weight: 800; line-height: 1.2; }
.kpi-sub { font-size: .76rem; color: var(--muted); }
.kpi-blue { --k: linear-gradient(135deg,#3b82f6,#1d4ed8); --ks: #3b82f6; }
.kpi-aqua { --k: linear-gradient(135deg,#22d3ee,#0891b2); --ks: #06b6d4; }
.kpi-green { --k: linear-gradient(135deg,#34d399,#059669); --ks: #10b981; }
.kpi-amber { --k: linear-gradient(135deg,#fbbf24,#d97706); --ks: #f59e0b; }
.kpi-rose { --k: linear-gradient(135deg,#fb7185,#e11d48); --ks: #f43f5e; }
.kpi-violet { --k: linear-gradient(135deg,#a78bfa,#7c3aed); --ks: #8b5cf6; }
.kpi-slate { --k: linear-gradient(135deg,#64748b,#334155); --ks: #64748b; }

/* hero banner */
.hero { border-radius: 20px; padding: 22px 26px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(120deg, #0b1d3a 0%, #0e7490 55%, #06b6d4 100%); box-shadow: 0 18px 40px -18px rgba(14,116,144,.6); }
.hero::before { content: ""; position: absolute; right: -60px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero::after { content: ""; position: absolute; right: 120px; bottom: -120px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255,255,255,.06); }
.hero h2 { font-weight: 800; font-size: 1.45rem; margin: 0; }
.hero .muted { color: #bae6fd; }
.hero .stat { position: relative; z-index: 1; }
.hero .stat b { font-size: clamp(1rem, 1.5vw, 1.35rem); display: block; white-space: nowrap; }
.hero .stat small { color: #bae6fd; text-transform: uppercase; font-size: .68rem; letter-spacing: .08em; }

/* slab cards */
.slab { border-radius: 16px; padding: 16px 18px; background: var(--glass); border: 1px solid rgba(255,255,255,.7); box-shadow: 0 8px 28px rgba(15,23,42,.06); position: relative; height: 100%; }
.slab.running { border: 2px solid #06b6d4; box-shadow: 0 10px 30px -8px rgba(6,182,212,.45); }
.slab.closed { opacity: .95; }
.slab .slab-no { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.slab .days { font-size: 1.1rem; font-weight: 800; }
.slab .badge-status { position: absolute; right: 14px; top: 14px; }
.ring { --p: 0; --c: #06b6d4; width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), #e2e8f0 0); flex: none; }
.ring > span { width: 62px; height: 62px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 800; font-size: .9rem; }
.tier-dots { display: flex; gap: 4px; } .tier-dots i { width: 18px; height: 6px; border-radius: 3px; background: #e2e8f0; display: block; }
.tier-dots i.on { background: linear-gradient(90deg,#f59e0b,#ef4444); }

.badge-soft { background: rgba(6,182,212,.12); color: #0e7490; font-weight: 600; }
.badge-soft-success { background: rgba(16,185,129,.12); color: #047857; } .badge-soft-danger { background: rgba(244,63,94,.12); color: #be123c; }
.badge-soft-warning { background: rgba(245,158,11,.15); color: #b45309; } .badge-soft-secondary { background: rgba(100,116,139,.12); color: #475569; }
.co-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.filter-bar { background: var(--glass); border-radius: 14px; padding: 10px 14px; border: 1px solid rgba(255,255,255,.7); margin-left: 0; margin-right: 0; }
.form-control, .form-select { border-radius: 10px; }
.items-table input, .items-table select { min-width: 80px; }
.items-table .rate-low { background: #fff7ed; border-color: #f59e0b; }
.items-table .rate-bad { background: #fff1f2; border-color: #e11d48; }
.sum-box { background: linear-gradient(135deg, #f0f9ff, #ecfeff); border-radius: 14px; padding: 14px 18px; border: 1px solid #bae6fd; }
.sum-box .big { font-size: 1.6rem; font-weight: 800; color: #0e7490; }
.nav-pills .nav-link { border-radius: 10px; color: #334155; font-weight: 600; }
.nav-pills .nav-link.active { background: linear-gradient(90deg,#0e7490,#06b6d4); }
.chart-box { position: relative; height: 290px; }
.mini-table td, .mini-table th { padding: .45rem .6rem; }
.money-pos { color: #047857; font-weight: 600; } .money-neg { color: #be123c; font-weight: 600; }

/* login */
.login-page { background: linear-gradient(130deg, #0b1d3a 0%, #0e3a66 45%, #0e7490 100%); min-height: 100vh; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 70px; padding: 30px; position: relative; z-index: 1; }
.login-hero { color: #e0f2fe; max-width: 470px; }
.login-hero h1 { font-weight: 800; color: #fff; font-size: 2.4rem; }
.hero-list { list-style: none; padding: 0; margin-top: 22px; } .hero-list li { margin-bottom: 10px; } .hero-list i { color: #22d3ee; margin-right: 8px; }
.login-card { width: 100%; max-width: 410px; background: rgba(255,255,255,.95); border-radius: 22px; padding: 36px 32px; box-shadow: 0 30px 70px -20px rgba(0,0,0,.5); }
.btn-glow { box-shadow: 0 10px 24px -8px rgba(14,116,144,.8); border-radius: 12px; font-weight: 600; }
.bubbles.light span { background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.35), rgba(34,211,238,.1) 60%, transparent); border-color: rgba(255,255,255,.18); }

/* print */
.invoice { background: #fff; max-width: 820px; margin: 0 auto; padding: 30px; border-radius: 14px; }
.print-head, .print-info, .print-sign { display: none; }
.inv-parties { --bs-gutter-x: 0; gap: 12px; }
.inv-parties > .col { border: 1px solid #dbe4ec; border-radius: 10px; padding: 10px 14px; background: #f8fbfd; }
.inv-parties > .col > small:first-child { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: #0e7490 !important; }
body.ur .inv-parties > .col > small:first-child { text-transform: none; letter-spacing: 0; }
.inv-words { margin-top: 10px; padding: 7px 12px; border-radius: 8px; background: #f1f7fa; border: 1px dashed #b6ccd8; font-size: .85rem; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); transition: .25s; }
  body.side-open .sidebar { transform: none; }
  .main { margin-left: 0; }
  .content { padding: 16px; } .topbar { padding: 10px 16px; }
}

/* ================= Urdu / RTL ================= */
@font-face { font-family: 'Nastaliq'; src: url(vendor/fonts/nastaliq-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Nastaliq'; src: url(vendor/fonts/nastaliq-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }
.ur-font { font-family: 'Nastaliq', serif; }
.lang-sw .btn { min-width: 46px; font-weight: 600; }
.login-lang { position: fixed; top: 18px; inset-inline-end: 22px; z-index: 5; }
body.ur { font-family: 'Nastaliq', 'Segoe UI', Tahoma, sans-serif; font-size: .95rem; line-height: 2; }
body.ur h1, body.ur h2, body.ur h3, body.ur h4, body.ur h5, body.ur h6, body.ur .page-title, body.ur .brand b { line-height: 1.9; }
body.ur .btn, body.ur .form-control, body.ur .form-select, body.ur .badge, body.ur .nav-link, body.ur .dropdown-item, body.ur label { line-height: 1.9; }
body.ur .table td, body.ur .table th { line-height: 1.9; padding-top: .3rem; padding-bottom: .3rem; }
body.ur .table thead th, body.ur .kpi-label, body.ur .nav-group, body.ur .slab .slab-no, body.ur .hero .stat small, body.ur .brand small { text-transform: none; letter-spacing: 0; }
/* numbers stay crisp in a Latin font */
body.ur input[type=number], body.ur input[type=date], body.ur input[type=month], body.ur .kpi-value, body.ur .hero .stat b, body.ur td.text-end, body.ur th.text-end,
body.ur .ring > span, body.ur .sum-box b, body.ur .sum-box .big, body.ur .money-pos, body.ur .money-neg, body.ur tfoot td { font-family: 'Segoe UI', Tahoma, 'Nastaliq', sans-serif; }
body.ur input[type=number], body.ur input[type=date], body.ur input[type=month] { direction: ltr; text-align: right; }
body.ur .kpi-value { font-size: 1.3rem; }
body.ur .hero h2 { font-size: 1.35rem; }
body.ur .form-floating > label { right: 0; left: auto; }
[dir=rtl] .sidebar { left: auto; right: 0; box-shadow: -4px 0 30px rgba(2,6,23,.18); }
[dir=rtl] .main { margin-left: 0; margin-right: var(--side-w); }
[dir=rtl] .nav-item.active { background: linear-gradient(270deg, rgba(34,211,238,.25), rgba(37,99,235,.15)); box-shadow: inset -3px 0 0 #22d3ee; }
[dir=rtl] .kpi::after { right: auto; left: -30px; }
[dir=rtl] .hero::before { right: auto; left: -60px; } [dir=rtl] .hero::after { right: auto; left: 120px; }
[dir=rtl] .user-chip { padding: 4px 4px 4px 14px; text-align: right; }
[dir=rtl] .slab .badge-status { right: auto; left: 14px; }
[dir=rtl] .sidebar::after { background: radial-gradient(400px 200px at 100% 100%, rgba(6,182,212,.25), transparent 70%); }
[dir=rtl] .bi-arrow-right::before, [dir=rtl] .bi-arrow-left::before { transform: scaleX(-1); display: inline-block; }
[dir=rtl] .pl-table .sub td { padding-left: .6rem; padding-right: 1.6rem; }
[dir=rtl] .hero-list i { margin-right: 0; margin-left: 8px; }
@media (max-width: 991.98px) {
  [dir=rtl] .sidebar { transform: translateX(100%); } [dir=rtl] body.side-open .sidebar, body.side-open[dir=rtl] .sidebar { transform: none; }
  [dir=rtl] .main { margin-right: 0; }
}

/* ================= A4 PRINT TEMPLATE ================= */
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  html, body { background: #fff !important; }
  body { font-size: 9pt; color: #0f172a; }
  body.ur { font-size: 9.5pt; line-height: 1.8; }
  .sidebar, .topbar, .foot, .bubbles, .no-print, .filter-bar, .nav-pills, .alert, .btn, .btn-group, .dropdown, .form-text,
  form[method=get], .card-header input, .card-header select, .kpi-icon, .kpi::after, .hero::before, .hero::after, .d-print-none { display: none !important; }
  .main, [dir=rtl] .main { margin: 0 !important; min-height: 0; display: block; }
  .content { padding: 0 !important; }
  a { color: inherit !important; text-decoration: none !important; }
  .table-responsive { overflow: visible !important; max-height: none !important; }
  .sticky-top { position: static !important; }
  .text-muted { color: #475569 !important; }

  /* letterhead */
  .print-head { display: flex !important; justify-content: space-between; align-items: flex-end; gap: 16px; padding-bottom: 8px; border-bottom: 2.5px solid #0e7490; }
  .ph-brand { display: flex; align-items: center; gap: 10px; }
  .ph-logo { width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-size: 21px; background: linear-gradient(135deg, #0e7490, #1d4ed8); flex: none; }
  .ph-name { font-size: 15pt; font-weight: 800; color: #0b1d3a; line-height: 1.15; }
  .ph-addr { font-size: 8pt; color: #475569; }
  .ph-doc { text-align: end; }
  .ph-title { font-size: 13pt; font-weight: 800; color: #0e7490; text-transform: uppercase; letter-spacing: .04em; line-height: 1.2; }
  body.ur .ph-title { text-transform: none; letter-spacing: 0; }
  .ph-meta { font-size: 8.5pt; color: #334155; }
  .print-info { display: flex !important; justify-content: space-between; flex-wrap: wrap; gap: 4px 18px; font-size: 7.5pt; color: #475569; background: #f1f5f9; border-bottom: 1px solid #cbd5e1; padding: 4px 8px; margin-bottom: 10px; }
  .print-info b { color: #0f172a; }

  /* signatures */
  .print-sign { display: flex !important; gap: 30px; margin-top: 34px; break-inside: avoid; }
  .print-sign > div { flex: 1; border-top: 1px solid #334155; padding-top: 4px; text-align: center; font-size: 8pt; color: #334155; }

  /* cards become report sections */
  .card, .card.glass, .glass { background: #fff !important; box-shadow: none !important; backdrop-filter: none !important; border: 1px solid #cbd5e1 !important; border-radius: 4px !important; margin-bottom: 10px !important; break-inside: auto; }
  .card.glass > .card-header, .card > .card-header { background: #e9f1f5 !important; border-bottom: 1px solid #cbd5e1 !important; border-inline-start: 4px solid #0e7490; padding: 4px 8px !important; font-size: 10pt; break-after: avoid; }
  .card-header .bi { display: none; }
  .card.glass > .card-body, .card > .card-body { padding: 6px 8px !important; }
  .row { --bs-gutter-y: 8px; --bs-gutter-x: 10px; }
  .mb-4 { margin-bottom: 10px !important; }

  /* tables */
  .table { font-size: 8.5pt; width: 100% !important; border-collapse: collapse !important; }
  .table > :not(caption) > * > * { box-shadow: none !important; padding: 3px 6px !important; border: 1px solid #d5dde6 !important; }
  .table thead { display: table-header-group; }
  .table tfoot { display: table-row-group; }
  .table thead th { background: #0b3b52 !important; color: #fff !important; border-color: #0b3b52 !important; font-size: 7.5pt; letter-spacing: .03em; white-space: normal; }
  .table tbody tr:nth-child(even) > * { background: #f5f8fb !important; }
  .table tfoot td, .table tfoot th { background: #e2ebf1 !important; font-weight: 800; border-top: 2px solid #0b3b52 !important; }
  .table tfoot tr + tr > * { border-top: 1px solid #d5dde6 !important; }
  .table tr { break-inside: avoid; }
  .badge { border: 1px solid currentColor; }

  /* KPI tiles */
  .kpi { padding: 6px 9px !important; border-radius: 4px !important; box-shadow: none !important; background: #fff !important; border: 1px solid #cbd5e1 !important; border-inline-start: 4px solid var(--ks) !important; gap: 0; }
  .kpi-label { font-size: 7pt; color: #475569; }
  .kpi-value { font-size: 12pt !important; }
  .kpi-sub { font-size: 7pt; }
  .row > .col-6:has(> .kpi) { flex: 0 0 auto; width: 25%; }
  .hero, .slab, .sum-box { box-shadow: none !important; border-radius: 6px !important; }
  .slab { border: 1px solid #cbd5e1 !important; background: #fff !important; }
  .chart-box { height: 210px !important; break-inside: avoid; }
  canvas { max-width: 100% !important; }

  /* desktop column layout on paper; entry forms are not printed */
  .col-md, .col-lg { flex: 1 0 0%; }
  .col-md-2, .col-lg-2 { flex: 0 0 auto; width: 16.6667%; } .col-md-3, .col-lg-3 { flex: 0 0 auto; width: 25%; }
  .col-md-4, .col-lg-4 { flex: 0 0 auto; width: 33.3333%; } .col-md-5, .col-lg-5 { flex: 0 0 auto; width: 41.6667%; }
  .col-md-6, .col-lg-6 { flex: 0 0 auto; width: 50%; } .col-md-7, .col-lg-7 { flex: 0 0 auto; width: 58.3333%; }
  .col-md-8, .col-lg-8 { flex: 0 0 auto; width: 66.6667%; } .col-md-9, .col-lg-9 { flex: 0 0 auto; width: 75%; }
  form[method=post]:has(.form-control, .form-select) { display: none !important; }
  .row:has(> [class*=col-] form[method=post] :is(.form-control, .form-select)) > [class*=col-] { width: 100% !important; flex: 0 0 auto; }
  .row > [class*=col-]:has(form[method=post] :is(.form-control, .form-select)):not(:has(.table)) { display: none !important; }

  /* print a single card (ledger, load sheet, stock list) */
  body.print-one .card:not(.print-target), body.print-one .kpi, body.print-one .hero, body.print-one .row > [class*=col-]:not(:has(.print-target)) { display: none !important; }
  body.print-one .row > [class*=col-]:has(.print-target) { width: 100% !important; }

  /* invoices / vouchers */
  .invoice { max-width: none; padding: 0 !important; border-radius: 0; }
  .invoice .brand-icon { box-shadow: none; }
  body.is-doc .print-head, body.is-doc .print-info { display: none !important; }
  .invoice, .invoice.glass { border: 0 !important; font-size: 10.5pt; }
  .invoice .table { font-size: 10pt; }
  .invoice h4 { font-size: 18pt; } .invoice h5 { font-size: 15pt; letter-spacing: .04em; }
  .invoice > .d-flex:first-child { border-bottom: 3px solid #0e7490 !important; }
  .invoice .row.justify-content-end .table td { padding: 4px 8px !important; }
  .inv-parties > .col { border-radius: 4px; background: #f8fbfd !important; }
  .inv-words { border-radius: 4px; font-size: 9.5pt; }
  /* fill the A4 sheet: signatures + footer sit at the bottom of the page */
  body.is-doc .invoice { display: flex; flex-direction: column; min-height: 264mm; }
  body.is-doc.pg-land .invoice { min-height: 176mm; }
  .invoice .print-sign { margin-top: auto !important; padding-top: 50px; }
}

/* ---------- drill-down: clickable cards, stats and table rows ---------- */
a.kpi-link { display: block; height: 100%; color: inherit; text-decoration: none; }
a.kpi-link .kpi { transition: transform .15s ease, box-shadow .15s ease; }
a.kpi-link:hover .kpi { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(15,23,42,.13); }
a.kpi-link .kpi-label::after { content: "\F138"; font-family: "bootstrap-icons"; margin-inline-start: 6px; opacity: 0; transition: opacity .15s; }
a.kpi-link:hover .kpi-label::after { opacity: .8; }
a.stat-link { color: inherit; text-decoration: none; border-radius: 12px; transition: background .15s; }
a.stat-link:hover { background: rgba(255,255,255,.14); }
a.slab-link { display: block; color: inherit; text-decoration: none; height: 100%; }
a.slab-link .slab { transition: transform .15s ease, box-shadow .15s ease; }
a.slab-link:hover .slab { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(15,23,42,.13); }
tr[data-href] { cursor: pointer; }
tr[data-href]:hover > td { background: rgba(59,130,246,.07); }
a.cell-link { color: inherit; text-decoration: none; border-bottom: 1px dashed rgba(100,116,139,.55); }
a.cell-link:hover { color: var(--bs-primary); border-bottom-color: currentColor; }
.drill-crumb { font-size: .85rem; }
@media print { a.cell-link { border: 0; } }

/* ---------- accounts ---------- */
.min-w-0 { min-width: 0; }
.acc-icon { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; color: #fff; box-shadow: 0 6px 16px -6px rgba(15,23,42,.35); }
.acc-icon.acc-sm { width: 36px; height: 36px; flex-basis: 36px; border-radius: 11px; font-size: 1rem; }
.acc-cash { background: linear-gradient(135deg,#34d399,#059669); }
.acc-bank { background: linear-gradient(135deg,#3b82f6,#1d4ed8); }
.acc-wallet { background: linear-gradient(135deg,#fbbf24,#d97706); }
.acc-card { transition: transform .15s, box-shadow .15s; }
.acc-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -18px rgba(15,23,42,.35); }
.acc-bal { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; }
.dir-toggle .btn { font-weight: 600; padding: .6rem; }
.quick-actions .btn { border-radius: 12px; font-weight: 600; }
.fin-pos > div { padding: 2px 0; }
.voucher .voucher-tbl th { color: var(--muted); font-weight: 500; padding: .45rem 0; }
.voucher .voucher-tbl td { font-weight: 600; padding: .45rem 0; }
.voucher-amt { border: 2px dashed rgba(14,116,144,.35); border-radius: 14px; padding: .9rem 1.2rem; font-size: 1.05rem; }
.voucher-amt b { font-size: 1.6rem; color: var(--ink); }
.voucher-stamp { border: 3px solid; border-radius: 10px; padding: .3rem .9rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; transform: rotate(-6deg); }
.vs-in { color: #059669; } .vs-out { color: #dc2626; } .vs-tr { color: #2563eb; }
.voucher .print-sign { display: flex; gap: 30px; margin-top: 60px; }
.voucher .print-sign > div { flex: 1; border-top: 1px solid #334155; padding-top: 4px; text-align: center; font-size: .8rem; color: #334155; }
.voucher ~ .print-sign { display: none !important; }
@media print { .voucher { box-shadow: none !important; border: 1px solid #cbd5e1 !important; max-width: none !important; } .acc-card:hover { transform: none; } }
/* accounts reports */
.rep-table .rep-group td { background: rgba(14,116,144,.08); font-weight: 700; color: #0e7490; text-transform: uppercase; font-size: .75rem; letter-spacing: .04em; }
.rep-table .rep-sub td { font-weight: 600; color: var(--muted); font-size: .8rem; padding-left: 1rem; }
.rep-table .row-total td { font-weight: 700; border-top: 1.5px solid #94a3b8; background: rgba(148,163,184,.08); }
.export-btns .btn { white-space: nowrap; }
@media print { .rep-table .rep-group td { background: #e2e8f0 !important; color: #0f172a !important; } .export-btns { display: none !important; } }
