/* GST Invoice Generator - Roboto (normal) everywhere */
*, *::before, *::after { box-sizing: border-box; font-family: 'Roboto', Arial, sans-serif !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #f3f5f9; color: #1f2937; font-size: 15px; line-height: 1.5; font-weight: 400; }
a { color: #1d4ed8; text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; font-weight: 700; color: #111827; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 17px; }
img { max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: #6b7280; } .small { font-size: 13px; } .right { text-align: right; } .center { text-align: center; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border: 1px solid transparent; border-radius: 5px; font-size: 15px; font-weight: 700; cursor: pointer; line-height: 1.2; text-decoration: none; background: #e5e7eb; color: #111827; }
.btn-primary { background: #1d4ed8; color: #fff; } .btn-primary:hover { background: #1e40af; }
.btn-light { background: #fff; border-color: #d1d5db; color: #111827; }
.btn-success { background: #15803d; color: #fff; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn[disabled] { opacity: .6; cursor: wait; }

/* Public pages */
.pubbar { background: #fff; border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 20; }
.pubbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.pubnav { display: flex; gap: 8px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: #111827; }
.brand-mark { display: inline-flex; width: 30px; height: 30px; border-radius: 5px; background: #1d4ed8; color: #fff; align-items: center; justify-content: center; font-size: 18px; }
.hero { padding: 56px 0 40px; text-align: center; background: linear-gradient(180deg, #eaf0ff, #f3f5f9); }
.hero p { max-width: 640px; margin: 10px auto 22px; font-size: 17px; color: #4b5563; }
.hero h1 { font-size: 34px; }
.hero .btn { margin: 4px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); } .g6 { grid-template-columns: repeat(6, 1fr); }
.section { padding: 36px 0; }
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 5px; padding: 20px; margin-bottom: 18px; }
.card h2, .card h3 { margin-bottom: 14px; }
.feature { background: #fff; border: 1px solid #e5e7eb; border-radius: 5px; padding: 18px; }
.tpl-chip { background: #fff; border: 1px solid #e5e7eb; border-radius: 5px; padding: 10px; text-align: center; font-size: 13px; }
.tpl-chip i { display: block; height: 46px; border-radius: 5px; margin-bottom: 8px; }
.footer { text-align: center; padding: 24px 12px; color: #6b7280; font-size: 13px; }
.auth-box { max-width: 460px; margin: 28px auto; }

/* App shell */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 58px; padding: 0 14px; background: #fff; border-bottom: 1px solid #e5e7eb; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; border: 1px solid #d1d5db; background: #fff; border-radius: 5px; font-size: 20px; width: 40px; height: 38px; cursor: pointer; }
.shell { display: flex; min-height: calc(100vh - 58px); }
.sidebar { width: 236px; flex: 0 0 236px; background: linear-gradient(180deg, #0f43f0 0%, #0b34cf 55%, #0a2ba8 100%); padding: 14px 10px; }
.sidebar a { display: flex; align-items: center; gap: 11px; color: #f1f5ff; padding: 8px 10px; border-radius: 5px; margin-bottom: 4px; font-weight: 500; }
.sidebar a:hover { background: rgba(255,255,255,.12); color: #fff; }
.sidebar a.active { background: #2b7bff; color: #fff; font-weight: 700; }
.sidebar .mi { width: 26px; height: 26px; flex: none; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; background: var(--mc, #3b82f6); color: #fff; }
.content { flex: 1; min-width: 0; padding: 22px; max-width: 1200px; }
.avatar { border-radius: 5px; object-fit: cover; display: inline-block; vertical-align: middle; }
.avatar-ini { background: #1d4ed8; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }

/* Alerts, badges */
.alert { padding: 11px 14px; border-radius: 5px; margin-bottom: 14px; font-size: 14px; }
.alert-success { background: #dcfce7; color: #166534; } .alert-error { background: #fee2e2; color: #991b1b; } .alert-info { background: #dbeafe; color: #1e40af; } .alert-warn { background: #fef3c7; color: #92400e; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 5px; font-size: 12px; font-weight: 700; }
.b-paid, .b-active { background: #dcfce7; color: #166534; } .b-unpaid { background: #fef3c7; color: #92400e; } .b-cancelled, .b-blocked { background: #fee2e2; color: #991b1b; } .b-admin { background: #ede9fe; color: #5b21b6; }

/* Stats */
.stat { background: #fff; border: 1px solid #e5e7eb; border-radius: 5px; padding: 16px; }
.stat:nth-child(6n+1) { background: #e3edfd; border-color: #c9daf6; } .stat:nth-child(6n+2) { background: #dcf3e8; border-color: #bfe3d1; } .stat:nth-child(6n+3) { background: #ece7fb; border-color: #d6cff1; }
.stat:nth-child(6n+4) { background: #fde4e1; border-color: #f3c8c3; } .stat:nth-child(6n+5) { background: #fdf0d5; border-color: #f1e0b4; } .stat:nth-child(6n+6) { background: #d9f1f4; border-color: #bde2e8; }
.stat.s-green { background: #dcf3e8; } .stat.s-orange { background: #fdf0d5; } .stat.s-red { background: #fde4e1; } .stat.s-purple { background: #ece7fb; } .stat.s-teal { background: #d9f1f4; }
.stat b { display: block; font-size: 24px; color: #111827; }
.stat span { color: #6b7280; font-size: 13px; }

/* Forms */
label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 4px; color: #374151; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=tel], input[type=file], select, textarea { width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 5px; font-size: 15px; background: #fff; color: #111827; }
input:focus, select:focus, textarea:focus { outline: 2px solid #93c5fd; border-color: #3b82f6; }
textarea { min-height: 80px; resize: vertical; }
.row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 14px; }
.row.r3 { grid-template-columns: repeat(3, 1fr); } .row.r1 { grid-template-columns: 1fr; }
.field { margin-bottom: 14px; }
.hint { font-size: 12px; color: #6b7280; margin-top: 3px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.profile-top { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: #6b7280; } .kv dd { margin: 0; word-break: break-word; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
.tbl th { background: #f3f4f6; text-align: left; padding: 10px; font-weight: 700; white-space: nowrap; }
.tbl td { padding: 10px; border-top: 1px solid #e5e7eb; vertical-align: middle; }
.tbl .num { text-align: right; white-space: nowrap; }
.inline-form { display: inline; }
.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.pager a, .pager span { padding: 6px 12px; border: 1px solid #d1d5db; border-radius: 5px; background: #fff; font-size: 13px; }
.pager span { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }

/* Invoice form rows */
.item-row { display: grid; grid-template-columns: 2.3fr .8fr .7fr .9fr .9fr .6fr .7fr .9fr auto; gap: 8px; align-items: end; padding: 12px; border: 1px solid #e5e7eb; border-radius: 5px; margin-bottom: 10px; background: #fafbfd; }
.item-row .f-pack { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: #4b5563; border-top: 1px dashed #d1d5db; padding-top: 8px; }
.item-row .f-pack input { width: 110px; }
.item-row .f-pack select { width: 140px; }
.item-row .f-pack .pack-eg { color: #9ca3af; }
.logo-prev { width: 90px; height: 90px; object-fit: contain; border: 1px solid #e5e7eb; border-radius: 5px; background: #fff; padding: 4px; }
.logo-empty { display: flex; align-items: center; justify-content: center; color: #9ca3af; font-size: 12px; }
.unit-chip { display: inline-flex; align-items: center; gap: 6px; background: #eef2ff; color: #3730a3; border-radius: 5px; padding: 4px 6px 4px 12px; margin: 0 6px 6px 0; font-size: 13px; }
.chip-x { border: 0; background: #c7d2fe; color: #3730a3; border-radius: 5px; width: 20px; height: 20px; line-height: 18px; cursor: pointer; padding: 0; }
.tpl-pick a i.grad { background: linear-gradient(135deg, var(--g1), var(--g2)); }
.item-row .pick { margin-bottom: 6px; font-size: 13px; padding: 6px 8px; }
.item-row .line-total { padding: 10px 0; font-weight: 700; text-align: right; }
.totals { max-width: 380px; margin-left: auto; }
.totals div { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed #e5e7eb; }
.totals .grand { font-weight: 700; font-size: 18px; border-bottom: 0; color: #1d4ed8; }
.supply-tag { display: inline-block; background: #e0e7ff; color: #3730a3; padding: 3px 10px; border-radius: 5px; font-size: 12px; font-weight: 700; }

/* Invoice view toolbar & template picker */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tpl-pick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tpl-pick a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 2px solid #e5e7eb; border-radius: 5px; background: #fff; color: #111827; font-size: 12px; }
.tpl-pick a i { width: 16px; height: 16px; border-radius: 5px; display: inline-block; }
.tpl-pick a.sel { border-color: #111827; font-weight: 700; }
.paper-scroll { width: 100%; overflow: hidden; position: relative; }

/* ======= Invoice paper (A4 width 794px) ======= */
.paper { width: 794px; background: #fff; color: #222; font-size: 12px; line-height: 1.45; padding: 30px 34px; transform-origin: top left; box-shadow: 0 2px 14px rgba(0,0,0,.12); }
.paper .head { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 14px; padding: 14px 16px; background: var(--c2); border-radius: 5px; border-bottom: 3px solid var(--c3); }
.paper .head-l { display: flex; gap: 14px; align-items: center; flex: 1; min-width: 0; }
.paper .logo { flex: none; width: 62px; height: 62px; background: #fff; border: 1px solid rgba(0,0,0,.10); border-radius: 5px; padding: 4px; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.paper .logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
.paper .biz h2 { font-size: 19px; margin: 0 0 3px; color: var(--c1); letter-spacing: .2px; line-height: 1.2; }
.paper .biz div { font-size: 11.5px; color: #4b5563; line-height: 1.45; }
.paper .head-r { text-align: right; font-size: 11.5px; min-width: 170px; max-width: 250px; display: flex; flex-direction: column; gap: 3px; align-items: flex-end; border-left: 1px solid rgba(0,0,0,.12); padding-left: 16px; }
.paper .head-r .ct { display: flex; gap: 6px; justify-content: flex-end; word-break: break-all; }
.paper .head-r .ct span { opacity: .65; }
.paper .head-r .ct b { font-weight: 700; }
.paper .title { font-size: 18px; font-weight: 700; letter-spacing: 1px; text-align: center; padding: 7px 0; margin-bottom: 10px; }
.paper table { width: 100%; border-collapse: collapse; }
.paper .meta td { padding: 5px 8px; border: 1px solid #d9dee7; font-size: 12px; }
.paper .meta td.k { background: var(--c2); font-weight: 700; width: 17%; color: #333; }
.paper .parties { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid #d9dee7; margin: 10px 0; }
.paper .parties > div { padding: 8px 10px; min-height: 90px; }
.paper .parties > div + div { border-left: 1px solid #d9dee7; }
.paper .parties h4 { margin: 0 0 4px; font-size: 11px; letter-spacing: .5px; color: var(--c1); text-transform: uppercase; }
.paper .parties b { font-size: 13px; }
.paper .items { table-layout: fixed; margin-top: 4px; }
.paper .items th { padding: 7px 4px; font-size: 10.5px; text-align: center; border: 1px solid #d9dee7; }
.paper .items td { padding: 6px 4px; font-size: 11px; border: 1px solid #e3e7ee; vertical-align: top; word-wrap: break-word; }
.paper .items td.n { text-align: right; } .paper .items td.c { text-align: center; }
.paper .items tr.blank td { height: 24px; }
.paper .packnote { font-size: 9.5px; color: #6b7280; margin-top: 2px; }
.paper .perunit { font-size: 9.5px; color: #6b7280; }
.paper .sum { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; margin-top: 12px; align-items: start; }
.paper .sum table td { padding: 5px 8px; border: 1px solid #e3e7ee; font-size: 12px; }
.paper .sum table td:last-child { text-align: right; white-space: nowrap; }
.paper .sum tr.grand td { font-weight: 700; font-size: 14px; }
.paper .words { font-size: 12px; margin-bottom: 8px; padding: 8px; background: var(--c2); border-radius: 5px; }
.paper .small-h { font-weight: 700; color: var(--c1); margin: 8px 0 2px; font-size: 11px; text-transform: uppercase; }
.paper .small-t { font-size: 11px; color: #444; white-space: pre-line; }
.paper .sign { text-align: right; margin-top: 18px; font-size: 12px; }
.paper .sigbox { min-height: 56px; display: flex; align-items: flex-end; justify-content: flex-end; margin-top: 4px; }
.paper .sigbox img { max-width: 170px; max-height: 56px; width: auto; height: auto; object-fit: contain; display: block; }
.paper .sigtext { font-family: 'Great Vibes', 'Segoe Script', 'Brush Script MT', cursive; font-size: 32px; line-height: 1.05; color: #1f2937; padding-right: 8px; }
.paper .sign .line { display: inline-block; border-top: 1px solid #999; padding-top: 4px; min-width: 170px; text-align: center; margin-top: 2px; }
.paper .foot { text-align: center; color: #777; font-size: 10.5px; margin-top: 14px; }
/* Variants */
.paper.v-a .title { background: var(--c1); color: #fff; }
.paper.v-a .items th, .paper.v-c .items th { background: var(--c1); color: #fff; border-color: var(--c1); }
.paper.v-a .sum tr.grand td, .paper.v-c .sum tr.grand td { background: var(--c1); color: #fff; }
.paper.v-b { border: 2px solid var(--c1); }
.paper.v-b .title { text-align: left; font-size: 26px; color: var(--c1); padding: 0 0 4px; border-bottom: 3px solid var(--c1); background: transparent; }
.paper.v-b .items th, .paper.v-d .items th { background: var(--c2); color: var(--c1); border-bottom: 2px solid var(--c1); }
.paper.v-b .sum tr.grand td, .paper.v-d .sum tr.grand td { background: var(--c2); color: var(--c1); }
.paper.v-c .head { background: var(--c1); color: #fff; padding: 16px; border-radius: 5px; }
.paper.v-c .head .biz h2, .paper.v-c .head .biz div, .paper.v-c .head-r { color: #fff; }
.paper.v-c .title { background: var(--c2); color: var(--c1); }
.paper.v-d .title { color: var(--c1); border-bottom: 2px solid var(--c1); background: transparent; font-size: 20px; }

/* Responsive */
/* ---- Extra templates 13-16 ---- */
.paper.v-e .head { background: linear-gradient(135deg, var(--c1), var(--c3)); color: #fff; }
.paper.v-e .head .biz h2, .paper.v-e .head .biz div, .paper.v-e .head-r { color: #fff; }
.paper.v-e .title { color: var(--c1); border-bottom: 3px solid var(--c3); background: transparent; font-size: 20px; }
.paper.v-e .items th { background: linear-gradient(135deg, var(--c1), var(--c3)); color: #fff; border-color: var(--c1); }
.paper.v-e .sum tr.grand td { background: linear-gradient(135deg, var(--c1), var(--c3)); color: #fff; }
.paper.v-e .parties h4, .paper.v-e .small-h { color: var(--c1); }
.paper.v-f .head { background: var(--c2); border: 1px solid var(--c1); }
.paper.v-f .title { display: table; margin: 0 auto 10px; background: linear-gradient(90deg, var(--c1), var(--c3)); color: #fff; border-radius: 5px; padding: 6px 30px; }
.paper.v-f .items th { background: var(--c1); color: #fff; border-color: var(--c1); }
.paper.v-f .items tbody tr:nth-child(even) td { background: var(--c2); }
.paper.v-f .sum tr.grand td { background: var(--c1); color: #fff; }
.paper.v-g .head { background: var(--c1); color: #fff; border-bottom: 4px solid var(--c3); }
.paper.v-g .head .biz h2 { color: var(--c3); }
.paper.v-g .head .biz div, .paper.v-g .head-r { color: #f3f4f6; }
.paper.v-g .title { text-align: left; color: var(--c1); border-bottom: 3px solid var(--c3); padding: 4px 0; background: transparent; font-size: 20px; }
.paper.v-g .items th { background: var(--c1); color: var(--c3); border-color: var(--c1); }
.paper.v-g .sum tr.grand td { background: var(--c1); color: var(--c3); }
.paper.v-g .parties h4, .paper.v-g .small-h { color: var(--c1); }
.paper.v-g .meta td.k { background: #fbf3d6; }
.paper.v-h { border-top: 12px solid var(--c1); border-bottom: 6px solid var(--c3); }
.paper.v-h .head { background: var(--c2); border: 1px solid var(--c3); }
.paper.v-h .title { background: var(--c1); color: #fff; border-radius: 5px; }
.paper.v-h .items th { background: var(--c3); color: #fff; border-color: var(--c3); }
.paper.v-h .sum tr.grand td { background: var(--c3); color: #fff; }
.paper.v-h .parties h4, .paper.v-h .small-h { color: var(--c1); }

@media (max-width: 991px) {
  .g4 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(2, 1fr); } .g6 { grid-template-columns: repeat(3, 1fr); }
  .menu-btn { display: inline-block; }
  .sidebar { position: fixed; top: 58px; left: 0; bottom: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; width: 250px; overflow-y: auto; }
  .sidebar.open { transform: none; }
  .content { padding: 16px; }
  .item-row { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .item-row .f-desc { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  body { font-size: 14px; }
  h1 { font-size: 22px; } .hero h1 { font-size: 26px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; } .g6 { grid-template-columns: repeat(2, 1fr); }
  .row, .row.r3 { grid-template-columns: 1fr; }
  .item-row { grid-template-columns: 1fr 1fr; }
  .uname { display: none; }
  .kv { grid-template-columns: 1fr; }
  .totals { max-width: none; }
  .card { padding: 14px; }
}

/* ======= PRINT: plain black & white, only the invoice ======= */
@media print {
  @page { size: A4; margin: 10mm; }
  html, body { background: #fff !important; }
  .no-print, .topbar, .sidebar, .toolbar, .tpl-pick, .alert, .pubbar { display: none !important; }
  .shell, .content { display: block !important; padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .paper-scroll { overflow: visible !important; height: auto !important; }
  .paper { transform: none !important; width: 100% !important; margin: 0 !important; padding: 0 !important; box-shadow: none !important; }
  .paper, .paper * { color: #000 !important; background: #fff !important; border-color: #000 !important; box-shadow: none !important; text-shadow: none !important; }
  .paper img { filter: grayscale(1); }
  .paper .title { border-top: 2px solid #000 !important; border-bottom: 2px solid #000 !important; }
  .paper .head { border: 0 !important; border-bottom: 1px solid #000 !important; border-radius: 0 !important; padding: 0 0 8px !important; }
  .paper.v-h { border-top: 0 !important; border-bottom: 0 !important; }
  .paper .title { border-radius: 0 !important; display: block !important; }
  .paper .packnote, .paper .perunit { color: #000 !important; }
  .paper .head-r { border-left: 0 !important; }
  .paper.v-b { border: 0 !important; }
    .paper .logo { box-shadow: none !important; border: 1px solid #000 !important; }
  .paper .items th, .paper .items td, .paper .meta td, .paper .sum td { border: 1px solid #000 !important; }
  .paper .items th { font-weight: 700; }
  .paper .parties, .paper .parties > div { border-color: #000 !important; }
  .paper .words { border: 1px solid #000; }
  .paper tr { page-break-inside: avoid; }
}

.paper.v-c .head-r, .paper.v-e .head-r, .paper.v-g .head-r { border-left-color: rgba(255,255,255,.35); }
.paper.v-c .logo, .paper.v-e .logo, .paper.v-g .logo { border-color: rgba(255,255,255,.6); }
.paper.v-c .head .biz div, .paper.v-e .head .biz div { color: rgba(255,255,255,.92); }
.sig-prev { max-width: 220px; max-height: 70px; object-fit: contain; border: 1px dashed #d1d5db; border-radius: 5px; padding: 4px; background: #fff; }
.sig-text-prev { font-family: 'Great Vibes', 'Segoe Script', 'Brush Script MT', cursive; font-size: 34px; line-height: 1.1; padding: 6px 12px; border: 1px dashed #d1d5db; border-radius: 5px; background: #fff; min-height: 52px; }

/* ---- reports / payments ---- */
.rtabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.rtabs a { padding: 8px 14px; border-radius: 5px; background: #fff; border: 1px solid #e5e7eb; color: #111827; font-size: 14px; font-weight: 700; }
.rtabs a.on { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.filt { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; align-items: end; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tbl tfoot td { font-weight: 700; background: #f3f4f6; }
.tbl .neg { color: #b91c1c; } .tbl .pos { color: #15803d; }
.stat.warn b { color: #b91c1c; } .stat.good b { color: #15803d; }
.kvl { width: 100%; border-collapse: collapse; } .kvl td { padding: 7px 0; border-bottom: 1px solid #f0f1f4; } .kvl td:last-child { text-align: right; font-weight: 700; white-space: nowrap; }
.b-partial { background: #fef3c7; color: #92400e; }
@media (max-width: 991px) { .filt { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .filt { grid-template-columns: 1fr; } }
@media print { .rtabs, .filt, .presets { display: none !important; } }

/* ---- Excel-style report sheet ---- */
.sheet-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; background: #fff; border: 1px solid #d1d5db; border-radius: 5px; }
.sheet { background: #fff; min-width: 100%; display: inline-block; width: 100%; }
.sheet-head { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 3px solid #1e3a5f; flex-wrap: wrap; }
.sheet-logo { width: 60px; height: 60px; object-fit: contain; }
.sheet-biz { flex: 1; min-width: 200px; } .sh-name { font-size: 20px; font-weight: 700; color: #1e3a5f; } .sh-line { font-size: 12px; color: #4b5563; }
.sheet-title { text-align: right; min-width: 220px; } .st-main { font-size: 18px; font-weight: 700; color: #111827; } .st-sub { font-size: 12px; color: #4b5563; }
table.xl { border-collapse: collapse; width: 100%; font-size: 13px; }
table.xl th, table.xl td { border: 1px solid #c8ccd4; padding: 6px 9px; white-space: nowrap; }
table.xl thead th { background: #1e3a5f; color: #fff; position: sticky; top: 0; text-align: left; font-weight: 700; }
table.xl thead th.num, table.xl td.num { text-align: right; }
table.xl tbody tr:nth-child(even) td { background: #f5f7fb; }
table.xl tbody tr:hover td { background: #e8f0fe; }
table.xl td.sn, table.xl th.sn { width: 42px; text-align: center; background: #eef0f4 !important; color: #374151; }
table.xl thead th.sn { background: #1e3a5f !important; color: #fff; }
table.xl tr.bd td { font-weight: 700; background: #dbe4f3 !important; }
table.xl tfoot td { background: #e5e7eb; font-weight: 700; border-top: 2px solid #1e3a5f; }
.sheet-note { padding: 8px 12px; font-size: 12px; color: #6b7280; }
@media print { .sheet-scroll { border: 0; overflow: visible; } table.xl { font-size: 10px; } table.xl th, table.xl td { white-space: normal; padding: 3px 5px; } table.xl thead th { background: #e5e7eb !important; color: #000 !important; } @page { size: A4 landscape; margin: 8mm; } }

/* report tabs: one colour each, 5px radius */
.rtabs a.rt { border-radius: 5px; border: 2px solid transparent; color: #fff; }
.rtabs a.rt-summary { background: #1d4ed8; }
.rtabs a.rt-datewise { background: #0f766e; }
.rtabs a.rt-products { background: #7c3aed; }
.rtabs a.rt-lines { background: #c2410c; }
.rtabs a.rt-dues { background: #be123c; }
.rtabs a.rt-received { background: #15803d; }
.rtabs a.rt-govt { background: #0369a1; }
.rtabs a.rt { opacity: .82; } .rtabs a.rt:hover { opacity: 1; } .rtabs a.rt.on { opacity: 1; border-color: #111827; box-shadow: 0 0 0 2px #fff inset; }

table.xl td.wrap { white-space: normal; min-width: 150px; max-width: 320px; }
table.xl a.invlink { color: #1d4ed8; font-weight: 700; text-decoration: underline; }
table.xl a.invlink:hover { color: #be123c; }

table.xl a.invlink, table.xl a.invlink:hover { color: inherit; font-weight: 400; text-decoration: none; cursor: pointer; }

table.xl td.wrap { min-width: 105px; max-width: 150px; width: 120px; }
table.xl th.invcol { width: 120px; }

/* round photos / tiny dots stay circular, everything else is 5px */
.avatar, .t-av { border-radius: 50% !important; }
