/* AMINC CRM - its own look: navy side bar, AMINC red + blue accents. Light + dark (Auto follows the device; theme.js applies the user's choice). */
:root {
  color-scheme: light;
  --navy: #101a2b;        /* side bar */
  --navy-2: #1b2940;
  --blue: #0257ce;        /* primary buttons, links */
  --blue-2: #0257ce;
  --blue-soft: #e5eefc;
  --red: #c8102e;         /* overdue, errors */
  --red-soft: #fde8eb;
  --brand-red: #fb2240;
  --green: #137a3f; --green-soft: #e3f4ea;
  --amber: #a15c00; --amber-soft: #fff3df;
  --teal: #0b7285; --teal-soft: #e0f3f6;
  --purple: #6a3db8; --purple-soft: #efe8fb;
  --bg: #f3f5f8;
  --card: #ffffff;
  --surface-2: #f0f2f5;
  --surface-3: #e9f0fb;
  --ink: #111418;
  --muted: #5a6170;
  --line: #d8dce2;
  --input-border: #c3cad4;
  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: Bahnschrift, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: Consolas, ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --navy: #070b13; --navy-2: #131c2c;
    --blue: #2f6fd6; --blue-2: #7aa7f2; --blue-soft: #15263f;
    --red: #ff5a6e; --red-soft: #3b151b;
    --green: #5fd18f; --green-soft: #133022; --amber: #f2b552; --amber-soft: #3a2b0f;
    --teal: #5cc8d8; --teal-soft: #0f2d33; --purple: #b79af0; --purple-soft: #261a3d;
    --bg: #0c0e11; --card: #16191e; --surface-2: #1d2128; --surface-3: #1b2a40;
    --ink: #e9ebee; --muted: #9ba3af; --line: #2c313a; --input-border: #3d444f;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --navy: #070b13; --navy-2: #131c2c;
  --blue: #2f6fd6; --blue-2: #7aa7f2; --blue-soft: #15263f;
  --red: #ff5a6e; --red-soft: #3b151b;
  --green: #5fd18f; --green-soft: #133022; --amber: #f2b552; --amber-soft: #3a2b0f;
  --teal: #5cc8d8; --teal-soft: #0f2d33; --purple: #b79af0; --purple-soft: #261a3d;
  --bg: #0c0e11; --card: #16191e; --surface-2: #1d2128; --surface-3: #1b2a40;
  --ink: #e9ebee; --muted: #9ba3af; --line: #2c313a; --input-border: #3d444f;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); -webkit-text-size-adjust: 100%; }
a { color: var(--blue-2); }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; margin: 0 0 .5rem; letter-spacing: .01em; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.08rem; } h3 { font-size: .95rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.pad { padding: 1rem; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- shell: side bar + content ---------- */
#shell { display: flex; min-height: 100vh; }
#side { width: 220px; flex: none; background: var(--navy); color: #d9dde3; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  border-right: 3px solid var(--brand-red); }
.brand { display: flex; align-items: center; gap: .6rem; padding: 1rem .9rem .8rem; color: #fff; text-decoration: none; }
.brand .logo { width: 36px; height: 36px; flex: none; border-radius: 8px; background: #fff url(/logo.png) center/84% no-repeat; }
.brand .bt { display: flex; flex-direction: column; line-height: 1.15; }
.brand b { font: 700 1.05rem var(--font-head); letter-spacing: .06em; }
.brand small { font-size: .74rem; color: #9fb0c8; letter-spacing: .04em; }
.menu-btn { display: none; }
#nav { display: flex; flex-direction: column; gap: 2px; padding: .4rem .5rem; flex: 1; overflow-y: auto; }
#nav a { display: flex; align-items: center; gap: .6rem; color: #c9d1dd; text-decoration: none; padding: .55rem .7rem; border-radius: 8px; font-weight: 600; font-size: .92rem; }
#nav a .ic { width: 1.2rem; text-align: center; opacity: .85; }
#nav a .ct { margin-left: auto; font-size: .72rem; background: var(--brand-red); color: #fff; border-radius: 99px; padding: 0 .45rem; }
#nav a:hover { background: var(--navy-2); color: #fff; }
#nav a.on { background: var(--blue); color: #fff; }
#nav .sep { height: 1px; background: rgba(255,255,255,.1); margin: .45rem .3rem; }
#who { padding: .7rem .9rem 1rem; border-top: 1px solid rgba(255,255,255,.1); font-size: .85rem; display: flex; flex-direction: column; gap: .45rem; }
#who .uname { color: #fff; font-weight: 600; }
#who .role-chip { font-size: .72rem; color: #9fb0c8; text-transform: uppercase; letter-spacing: .05em; }
#who .row { gap: .35rem; }
#who button, #who .btn { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.3); min-height: 32px; padding: .25rem .6rem; font-size: .8rem; }
#who button:hover, #who .btn:hover { background: var(--navy-2); }
main { flex: 1; min-width: 0; padding: 1.2rem 1.4rem 3rem; max-width: 1300px; }

/* ---------- controls ---------- */
button, .btn { font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: .45rem .85rem; border-radius: 8px;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .35rem; min-height: 38px; font-size: .88rem; font-weight: 600; }
button:hover, .btn:hover { border-color: var(--muted); }
button.primary, .btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
button.primary:hover, .btn.primary:hover { filter: brightness(1.12); }
button.danger { color: var(--red); border-color: var(--red); }
button.link { border: 0; background: none; color: var(--blue-2); padding: .1rem .2rem; min-height: 0; text-decoration: underline; font-weight: 400; }
button.sm, .btn.sm { min-height: 30px; padding: .15rem .55rem; font-size: .8rem; }
button:disabled { opacity: .55; cursor: default; }
input, select, textarea { font: inherit; color: var(--ink); border: 1px solid var(--input-border); border-radius: 8px; padding: .45rem .6rem; background: var(--card); width: 100%; min-height: 38px; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 1px; }
label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: .2rem; }
label.check { display: flex; align-items: center; gap: .45rem; color: var(--ink); font-size: .9rem; }
.field { margin-bottom: .75rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 1rem; }
.span-all { grid-column: 1 / -1; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.card > h2:first-child, .card-head { margin-bottom: .7rem; }
.card-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-head .spacer { flex: 1; }
.page-head { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.page-head .spacer { flex: 1; }
.crumbs { font-size: .82rem; color: var(--muted); margin-bottom: .3rem; }
.crumbs a { color: var(--muted); }

/* ---------- badges ---------- */
.badge { display: inline-block; font-size: .74rem; font-weight: 600; padding: .08rem .5rem; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.blue { background: var(--blue-soft); color: var(--blue-2); }
.badge.teal { background: var(--teal-soft); color: var(--teal); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }
.badge.dim { background: transparent; border: 1px solid var(--line); color: var(--muted); }

/* ---------- KPI tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem .9rem; text-decoration: none; color: inherit; display: block; }
a.tile:hover { border-color: var(--blue-2); }
.tile b { display: block; font: 700 1.55rem var(--font-head); line-height: 1.15; }
.tile span { font-size: .8rem; color: var(--muted); }
.tile.bad b { color: var(--red); }
.tile.warn b { color: var(--amber); }
.dash { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 980px) { .dash { grid-template-columns: 1fr; } }

/* ---------- lists ---------- */
.item { display: flex; gap: .7rem; align-items: flex-start; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .t { font-weight: 600; }
.item .m { font-size: .84rem; color: var(--muted); }
.item.overdue .due { color: var(--red); font-weight: 700; }
.item.today .due { color: var(--amber); font-weight: 700; }
.due { font-size: .82rem; white-space: nowrap; color: var(--muted); }
.grp-title { font: 600 .78rem var(--font-head); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: .8rem 0 .2rem; }
.grp-title.red { color: var(--red); }
.empty { color: var(--muted); font-size: .9rem; padding: .4rem 0; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .45rem .55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .76rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; background: var(--surface-2); }
th.sort { cursor: pointer; user-select: none; }
th.sort:hover { color: var(--ink); }
th.sort.on::after { content: " ▲"; font-size: .65rem; }
th.sort.on.desc::after { content: " ▼"; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-3); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td .sub { font-size: .8rem; color: var(--muted); }
td.red { color: var(--red); font-weight: 600; }

/* ---------- filters ---------- */
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; }
.filters .field { margin: 0; flex: 1 1 150px; min-width: 140px; }
.filters .field.wide { flex: 2 1 240px; }
.chips { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .6rem; }
.chips button { min-height: 30px; padding: .15rem .65rem; border-radius: 99px; font-size: .8rem; font-weight: 600; }
.chips button.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.chips button .n { opacity: .75; font-weight: 400; margin-left: .2rem; }
.seg { display: inline-flex; border: 1px solid var(--input-border); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; min-height: 34px; }
.seg button + button { border-left: 1px solid var(--input-border); }
.seg button.on { background: var(--blue); color: #fff; }

/* ---------- account page ---------- */
.acct-head { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.acct-head .grow { flex: 1; min-width: 260px; }
.acct-head h1 { margin: 0 0 .25rem; }
.facts { display: flex; gap: .4rem 1.2rem; flex-wrap: wrap; font-size: .9rem; color: var(--muted); margin-top: .35rem; }
.facts b { color: var(--ink); font-weight: 600; }
.actions { display: flex; gap: .45rem; flex-wrap: wrap; margin: .8rem 0 1rem; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 980px) { .cols { grid-template-columns: 1fr; } }
.contacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .6rem; }
.contact { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .7rem; background: var(--surface-2); }
.contact.left { opacity: .6; }
.contact .nm { font-weight: 700; }
.contact .ttl { font-size: .84rem; color: var(--muted); }
.contact .ln { font-size: .88rem; margin-top: .15rem; word-break: break-word; }
.star { color: var(--amber); }
.timeline .act { border-left: 3px solid var(--blue-2); padding: .3rem 0 .5rem .7rem; margin-left: .2rem; }
.timeline .act + .act { margin-top: .2rem; }
.timeline .act .hd { display: flex; gap: .5rem; flex-wrap: wrap; align-items: baseline; }
.timeline .act .hd b { font-weight: 700; }
.timeline .act .bd { white-space: pre-wrap; font-size: .92rem; }
.notes { white-space: pre-wrap; }
.deal { border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: 8px; padding: .55rem .7rem; margin-bottom: .5rem; cursor: pointer; }
.deal.won { border-left-color: var(--green); } .deal.lost { border-left-color: var(--muted); opacity: .75; }
.deal:hover { background: var(--surface-3); }
.deal .v { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- pipeline board ---------- */
.board { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: .7rem; overflow-x: auto; padding-bottom: .4rem; }
.col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: .55rem; min-height: 120px; }
.col h3 { margin: 0 0 .1rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.col .tot { font-size: .78rem; color: var(--muted); margin-bottom: .5rem; }
.col .deal { background: var(--card); }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--blue-2); border-radius: 99px; }
.stagebars .r { display: grid; grid-template-columns: 130px minmax(0, 1fr) 110px; gap: .6rem; align-items: center; font-size: .85rem; padding: .2rem 0; }
.stagebars .r .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(5,8,14,.5); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 4vh 1rem; overflow-y: auto; }
.modal { background: var(--card); border-radius: 12px; width: min(640px, 100%); box-shadow: 0 10px 40px rgba(0,0,0,.3); border-top: 4px solid var(--blue); }
.modal .mh { display: flex; align-items: center; gap: .5rem; padding: .85rem 1rem .4rem; }
.modal .mh h2 { margin: 0; flex: 1; }
.modal .mb { padding: .4rem 1rem .2rem; }
.modal .mf { display: flex; gap: .5rem; justify-content: flex-end; padding: .6rem 1rem 1rem; flex-wrap: wrap; }
.modal .mf .left { margin-right: auto; }
.subbox { border: 1px dashed var(--input-border); border-radius: 8px; padding: .6rem .7rem .1rem; margin: .2rem 0 .8rem; background: var(--surface-2); }
.dupe { background: var(--amber-soft); color: var(--amber); border-radius: 8px; padding: .5rem .7rem; margin-bottom: .75rem; font-size: .88rem; }
.dupe a { color: inherit; font-weight: 700; }

/* ---------- misc ---------- */
.login { max-width: 380px; margin: 9vh auto 0; }
.login .card { padding: 1.5rem; border-top: 4px solid var(--brand-red); }
.login .logo-lg { width: 84px; height: 84px; margin: 0 auto .8rem; border-radius: 14px; background: #fff url(/logo.png) center/86% no-repeat; border: 1px solid var(--line); }
.login h1 { text-align: center; }
.login .sub { text-align: center; margin-top: -.3rem; }
.err { background: var(--red-soft); color: var(--red); padding: .55rem .75rem; border-radius: 8px; margin-bottom: .8rem; font-size: .9rem; }
.ok-box { background: var(--blue-soft); color: var(--blue-2); padding: .7rem .8rem; border-radius: 8px; margin: .8rem 0; word-break: break-all; }
.log-old { color: var(--red); text-decoration: line-through; word-break: break-word; }
.log-new { color: var(--green); word-break: break-word; }
.theme-pick { display: inline-flex; border: 1px solid var(--input-border); border-radius: 9px; overflow: hidden; }
.theme-pick button { border: 0; border-radius: 0; }
.theme-pick button + button { border-left: 1px solid var(--input-border); }
.theme-pick button.on { background: var(--blue); color: #fff; }
details.hist summary { cursor: pointer; font-weight: 600; }
#toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); background: var(--navy); color: #fff; padding: .6rem 1rem; border-radius: 8px;
  font-size: .92rem; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60; max-width: 90vw; }
#toast.show { opacity: 1; }
#toast.bad { background: var(--red); }

/* ---------- phones: side bar becomes a top bar with a menu ---------- */
@media (max-width: 760px) {
  #shell { flex-direction: column; }
  #side { width: auto; height: auto; position: sticky; top: 0; z-index: 30; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 3px solid var(--brand-red); }
  .brand { padding: .5rem .75rem; flex: 1; }
  .brand .logo { width: 30px; height: 30px; }
  .menu-btn { display: inline-flex; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.3); margin-right: .75rem; font-size: 1.1rem; }
  #nav, #who { display: none; width: 100%; }
  #side.open #nav, #side.open #who { display: flex; }
  #nav { padding: .2rem .5rem .5rem; }
  main { padding: .8rem .75rem 3rem; }
  .card { padding: .85rem; }
  .hide-sm { display: none; }
  .board { grid-template-columns: repeat(5, 78vw); }
  .stagebars .r { grid-template-columns: 100px minmax(0, 1fr) 90px; }
}
/* ===== PRINT REPORTS (admin + manager): a white "paper" with a toolbar above it; Letter, portrait or landscape ===== */
main.rpt-mode { max-width: 11.3in; }
.rpt-toolbar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .9rem; }
.rpt-toolbar .spacer { flex: 1; }
.rpt-toolbar label.check { margin: 0; }
.rpt-paper { --r-ink: #111418; --r-muted: #5a6170; --r-line: #d3d8df; --r-blue: #0257ce; --r-red: #c8102e;
  background: #fff; color: var(--r-ink); color-scheme: light; padding: .5in .55in; border-radius: 4px; box-shadow: 0 2px 14px rgba(0,0,0,.18);
  font: 9.5pt/1.4 var(--font); overflow-x: auto; }
.rpt-paper.p { max-width: 8.5in; }
.rpt-paper a { color: var(--r-ink); text-decoration: none; }
.rpt-head { display: flex; align-items: center; gap: 10px; border-bottom: 3px solid #fb2240; padding-bottom: 6px; margin-bottom: 10px; }
.rpt-head img { width: 34px; height: 34px; }
.rpt-head .grow { flex: 1; }
.rpt-app { font: 700 7.5pt var(--font-head); letter-spacing: .08em; color: var(--r-blue); text-transform: uppercase; }
.rpt-title { font: 700 14pt var(--font-head); letter-spacing: .02em; }
.rpt-meta { font-size: 7.5pt; color: var(--r-muted); text-align: right; }
.rpt-sub { font-size: 8.5pt; color: var(--r-muted); margin: -4px 0 8px; }
.rpt-sec { font: 700 9.5pt var(--font-head); letter-spacing: .05em; text-transform: uppercase; color: var(--r-blue); margin: 14px 0 5px;
  border-bottom: 1px solid var(--r-line); padding-bottom: 2px; break-after: avoid; }
.rpt-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 14px; border: 1px solid var(--r-line); border-left: 4px solid var(--r-blue); border-radius: 4px; padding: 7px 10px; }
.rpt-facts span { display: block; font: 600 6.5pt var(--font-head); letter-spacing: .06em; text-transform: uppercase; color: var(--r-muted); }
.rpt-glance { display: flex; gap: 8px; margin: 2px 0 10px; break-inside: avoid; }
.rpt-glance > div { flex: 1; border: 1px solid var(--r-line); border-radius: 4px; padding: 5px 8px; }
.rpt-glance b { display: block; font: 700 12pt var(--font-head); }
.rpt-glance span { font-size: 7pt; color: var(--r-muted); }
.rpt-paper table { border-collapse: collapse; width: 100%; font-size: 8.5pt; }
.rpt-paper th, .rpt-paper td { border: 1px solid var(--r-line); padding: 3px 6px; text-align: left; vertical-align: top; background: none; white-space: normal; }
.rpt-paper th { background: #eef2f6; color: var(--r-ink); font: 600 7pt var(--font-head); text-transform: uppercase; letter-spacing: .04em; }
.rpt-paper tbody tr:nth-child(even) td { background: #f7f9fb; }
.rpt-paper tr { break-inside: avoid; }
.rpt-paper td.n, .rpt-paper th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rpt-paper td.nw { white-space: nowrap; }
.rpt-paper td.blank { width: 2.3in; }
.rpt-paper .sub { color: var(--r-muted); font-size: 7.5pt; }
.rpt-paper .red { color: var(--r-red); font-weight: 700; }
.rpt-paper .muted { color: var(--r-muted); }
.rpt-paper .pre { white-space: pre-wrap; }
.rpt-paper tfoot th { background: #eef2f6; }
.rpt-grp { font: 700 8pt var(--font-head); text-transform: uppercase; letter-spacing: .05em; margin: 10px 0 3px; break-after: avoid; }
.rpt-grp.red { color: var(--r-red); }
.rpt-act { border-left: 3px solid var(--r-blue); padding: 2px 0 4px 8px; margin: 0 0 6px; break-inside: avoid; }
.rpt-act b { font-weight: 700; }
.rpt-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rpt-end { margin-top: 12px; font-size: 7pt; color: var(--r-muted); text-align: center; }
.print-blocked { display: none; }
@media (max-width: 900px) { .rpt-paper { padding: .8rem; } .rpt-facts { grid-template-columns: repeat(2, 1fr); } .rpt-two { grid-template-columns: 1fr; } }

@media print {
  :root, :root[data-theme], :root:not([data-theme="light"]) { color-scheme: light; }
  #side, button, .no-print, .rpt-toolbar, .overlay, #toast, #modal-root { display: none !important; }
  body.rpt-printing #shell { display: block; }   /* no flex box around the report (it would add a blank last page) */
  body { background: #fff; }
  main, main.rpt-mode { padding: 0; margin: 0; max-width: none; }
  main.rpt-mode > *:not(.rpt-paper) { display: none !important; }
  .rpt-paper { box-shadow: none; border-radius: 0; padding: 0; overflow: visible; max-width: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rpt-paper.l { page: rptl; } .rpt-paper.p { page: rptp; }
  .rpt-facts { grid-template-columns: repeat(4, 1fr) !important; } .rpt-two { grid-template-columns: 1fr 1fr !important; }
  /* printing is for admins and managers only: anyone else's print comes out as this notice */
  body.no-print-role #shell { display: none !important; }
  body.no-print-role .print-blocked { display: block; padding: 2in 1in; text-align: center; font: 14pt var(--font); color: #000; }
}
@page rptl {
  size: Letter landscape; margin: 0.45in 0.5in 0.55in;
  @bottom-left { content: "AMINC CRM · Confidential"; font: 7pt "Segoe UI", Arial, sans-serif; color: #777; }
  @bottom-right { content: "Page " counter(page) " of " counter(pages); font: 7pt "Segoe UI", Arial, sans-serif; color: #777; }
}
@page rptp {
  size: Letter portrait; margin: 0.5in 0.5in 0.6in;
  @bottom-left { content: "AMINC CRM · Confidential"; font: 7pt "Segoe UI", Arial, sans-serif; color: #777; }
  @bottom-right { content: "Page " counter(page) " of " counter(pages); font: 7pt "Segoe UI", Arial, sans-serif; color: #777; }
}
