/* MCRBi ITD Portal — palette taken from mcrbi.com.ph */
@font-face { font-family: Figtree; font-weight: 400; font-display: swap; src: url(fonts/figtree-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Figtree; font-weight: 500; font-display: swap; src: url(fonts/figtree-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Figtree; font-weight: 600; font-display: swap; src: url(fonts/figtree-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Figtree; font-weight: 700; font-display: swap; src: url(fonts/figtree-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: Figtree; font-weight: 800; font-display: swap; src: url(fonts/figtree-latin-800-normal.woff2) format("woff2"); }

:root {
  --maroon: #7a1f1f;
  --maroon-d: #5e1818;
  --maroon-2: #6b2523;
  --ink: #2a1816;
  --ink-2: #4a3a36;
  --muted: #6a5a56;
  --cream: #faf7f4;
  --paper: #ffffff;
  --line: #e6dcd6;
  --line-2: #ecdcd8;
  --rose: #f3e6e2;
  --gold: #f3cf6e;
  --gold-m: #d9a22b;
  --gold-d: #b07c12;
  --gold-ink: #2a1e00;
  --green: #2f7a4b; --green-bg: #e5f2e9;
  --blue: #2a5a8c;  --blue-bg: #e4edf6;
  --purple: #6a3f8c; --purple-bg: #efe7f5;
  --red: #a8322b;   --red-bg: #f8e3e1;
  --amber: #8a5a00; --amber-bg: #fbefcf;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(42,24,22,.06), 0 4px 16px rgba(42,24,22,.06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Figtree, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--cream); }
a { color: var(--maroon); }
a:hover { color: var(--maroon-d); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.9rem; font-weight: 800; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; margin-top: 1.25em; }
p { margin: 0 0 .8em; }
code, .mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mt { margin-top: 1.25rem; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.ico { flex-shrink: 0; vertical-align: -.2em; }
[hidden] { display: none !important; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .62rem 1.1rem; border-radius: 9px; border: 1.5px solid transparent; font: inherit; font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s; line-height: 1.2; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn-primary { background: var(--maroon); color: #fff; }
.btn-primary:hover { background: var(--maroon-d); color: #fff; }
.btn-gold { background: var(--gold); color: var(--gold-ink); }
.btn-gold:hover { background: #ebc04f; color: var(--gold-ink); }
.btn-outline { background: var(--paper); border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--maroon); color: var(--maroon); }
.btn-ghost-light { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.35); }
.btn-ghost-light:hover { background: rgba(255,255,255,.18); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #256640; color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #8d2923; color: #fff; }
.btn-outline-danger { background: var(--paper); border-color: #e3bdb9; color: var(--red); }
.btn-outline-danger:hover { background: var(--red-bg); color: var(--red); }
.btn-sm { padding: .38rem .7rem; font-size: .85rem; border-radius: 7px; }
.btn-lg { padding: .8rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.row-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.row-actions.center { justify-content: center; }
.icon-btn { background: none; border: 0; padding: .4rem; border-radius: 8px; cursor: pointer; color: var(--ink-2); display: inline-flex; }
.icon-btn:hover { background: var(--rose); color: var(--maroon); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .9rem; min-width: 0; }
.field label, legend { font-weight: 600; font-size: .88rem; color: var(--ink-2); }
.req { color: var(--red); }
input[type=text], input:not([type]), input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=file], select, textarea {
  font: inherit; font-size: .95rem; color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: 8px; padding: .55rem .7rem; width: 100%; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--maroon); }
textarea { resize: vertical; }
input[type=file] { padding: .45rem; background: var(--cream); }
.hint { color: var(--muted); font-size: .8rem; }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
fieldset > legend { font-size: 1rem; font-weight: 700; color: var(--maroon); margin-bottom: .8rem; padding: 0; }
.form-card fieldset + fieldset { border-top: 1px solid var(--line); padding-top: 1.2rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.stack > * + * { margin-top: .2rem; }
.check { display: inline-flex; align-items: center; gap: .45rem; font-weight: 500; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--maroon); }
.inline-radios { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.inline-radios legend { width: 100%; margin-bottom: .4rem; font-size: .88rem; color: var(--ink-2); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- alerts ---------- */
.alert { padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1rem; border: 1px solid; font-size: .93rem; }
.alert ul { margin: .4rem 0 0 1.1rem; padding: 0; }
.alert-success { background: var(--green-bg); border-color: #bfdcc8; color: #1f5434; }
.alert-error { background: var(--red-bg); border-color: #ecc3bf; color: #7d221c; }
.alert-warning { background: var(--amber-bg); border-color: #f0d98f; color: #5c3d00; }
.alert-info { background: var(--blue-bg); border-color: #c4d6ea; color: #1d4069; }
.pw-reveal code.pw { background: #fff; padding: .15rem .5rem; border-radius: 6px; font-size: 1.05rem; user-select: all; }

/* ---------- cards ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.card-title { display: flex; align-items: center; gap: .5rem; color: var(--maroon); }
.link { font-weight: 600; font-size: .88rem; text-decoration: none; }
.empty { color: var(--muted); padding: 1rem 0; margin: 0; }

/* ---------- badges ---------- */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.badge-neutral { background: #eee8e5; color: var(--ink-2); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-gold { background: var(--amber-bg); color: var(--amber); border-color: #f0d98f; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-dark { background: var(--ink); color: #fff; }
.prio { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.prio::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #b9aca8; }
.prio-medium::before { background: var(--gold-m); }
.prio-high::before { background: #d0662a; }
.prio-critical { color: var(--red); }
.prio-critical::before { background: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }

/* =========================================================
   PUBLIC PORTAL
   ========================================================= */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }
.wrap.narrow { max-width: 820px; padding-top: 1.75rem; }
.pub-top { background: var(--maroon); color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.pub-top-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .65rem; padding-bottom: .65rem; }
.brand { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand .seal { width: 44px; height: 44px; background: #fff; border-radius: 50%; padding: 2px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.08rem; letter-spacing: .01em; }
.brand-text small { color: var(--gold); font-size: .78rem; font-weight: 500; }
.pub-nav { display: flex; align-items: center; gap: 1.2rem; }
.pub-nav > a:not(.btn) { color: #f6e9e6; text-decoration: none; font-weight: 500; font-size: .93rem; }
.pub-nav > a:not(.btn):hover { color: var(--gold); }

.hero { background: linear-gradient(135deg, var(--maroon) 0%, var(--maroon-2) 55%, #4d1513 100%); color: #fff; padding: 3rem 0 3.6rem; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: linear-gradient(90deg, var(--gold-d), var(--gold), var(--gold-d)); }
.hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.hero h1 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); color: #fff; max-width: 18ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .76rem; font-weight: 700; color: var(--gold); margin-bottom: .6rem; }
.eyebrow.dark { color: var(--gold-d); margin-bottom: .3rem; }
.lead { font-size: 1.07rem; color: #f3e3df; max-width: 52ch; }
.hero-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.4rem; }
.hero-seal { width: 170px; height: 170px; background: #fff; border-radius: 50%; padding: 6px; opacity: .96; box-shadow: 0 0 0 6px rgba(243,207,110,.35); }

.advisory { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem 1.2rem; border-radius: var(--radius); margin: -1.6rem 0 2rem; position: relative; z-index: 2; box-shadow: var(--shadow); background: var(--paper); border: 1px solid var(--line); border-left: 6px solid var(--gold-m); }
.advisory .ico { color: var(--gold-d); margin-top: .1rem; }
.advisory strong { display: block; color: var(--ink); }
.advisory p { margin: .15rem 0 0; color: var(--ink-2); }
.advisory-warning { background: #fffaf0; border-left-color: #d0662a; }
.advisory-warning .ico { color: #b3531c; }
.advisory-urgent { background: var(--red-bg); border-color: #ecc3bf; border-left-color: var(--red); }
.advisory-urgent .ico { color: var(--red); }

.section-title { font-size: 1.35rem; margin: 2rem 0 1rem; }
.type-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }
.type-card { display: flex; align-items: flex-start; gap: .9rem; padding: 1.2rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, border-color .15s, box-shadow .15s; }
.type-card:hover { transform: translateY(-2px); border-color: var(--gold-m); color: var(--ink); box-shadow: 0 8px 24px rgba(122,31,31,.12); }
.type-ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--rose); color: var(--maroon); flex-shrink: 0; }
.type-ico.big { width: 60px; height: 60px; border-radius: 14px; }
.type-card:hover .type-ico { background: var(--maroon); color: var(--gold); }
.type-body { display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.type-body strong { font-size: 1.02rem; }
.type-body small { color: var(--muted); font-size: .87rem; line-height: 1.4; }
.type-go { color: var(--gold-d); font-weight: 700; font-size: 1.2rem; align-self: center; transition: transform .15s; }
.type-card:hover .type-go { transform: translateX(3px); }

.two-col { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.25rem; margin-bottom: 2.5rem; }
.dir { width: 100%; border-collapse: collapse; font-size: .9rem; }
.dir th, .dir td { text-align: left; vertical-align: top; padding: .65rem .3rem; border-top: 1px solid var(--line); }
.dir th { width: 42%; font-weight: 700; }
.dir th small { display: block; font-weight: 500; color: var(--muted); }
.dir a { text-decoration: none; }

.back { display: inline-block; margin-bottom: 1rem; text-decoration: none; font-weight: 600; font-size: .9rem; }
.form-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.2rem; }
.form-head h1 { margin: 0; }
.form-head p { margin: 0; }
.privacy-note { display: flex; gap: .5rem; align-items: flex-start; font-size: .84rem; color: var(--muted); background: var(--cream); padding: .7rem .9rem; border-radius: 8px; }
.success-card { text-align: center; padding: 2.5rem 1.5rem; }
.success-ico { display: inline-grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; background: var(--green-bg); color: var(--green); margin-bottom: 1rem; }
.ref-no { font-size: 2rem; font-weight: 800; color: var(--maroon); letter-spacing: .04em; background: var(--rose); display: inline-block; padding: .3rem 1.2rem; border-radius: 10px; border: 2px dashed var(--gold-m); }
.track-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 1rem; align-items: end; }
.track-form .field { margin: 0; }
.track-head, .ticket-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.badges { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

.meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .9rem 1.2rem; margin: 1rem 0; }
.meta dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.meta dd { margin: .15rem 0 0; font-weight: 500; overflow-wrap: anywhere; }
.note-box { background: var(--cream); border-left: 4px solid var(--gold-m); padding: .8rem 1rem; border-radius: 0 8px 8px 0; margin-top: 1rem; }
.note-box p { margin: .3rem 0 0; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 1.1rem 1.8rem; font-size: .92rem; }
.timeline .dot { position: absolute; left: 0; top: .3rem; width: 14px; height: 14px; border-radius: 50%; background: var(--maroon); border: 3px solid var(--rose); }
.timeline li.internal .dot { background: var(--gold-m); }
.timeline p { margin: .3rem 0 0; color: var(--ink-2); background: var(--cream); padding: .5rem .7rem; border-radius: 8px; }
.tag-internal { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; background: var(--amber-bg); color: var(--amber); padding: .05rem .4rem; border-radius: 4px; margin-left: .3rem; }

.modal { position: fixed; inset: 0; background: rgba(42,24,22,.55); display: grid; place-items: center; z-index: 50; padding: 1rem; }
.modal-box { background: var(--paper); border-radius: 16px; max-width: 560px; width: 100%; padding: 1.8rem; box-shadow: 0 20px 60px rgba(0,0,0,.3); border-top: 6px solid var(--gold-m); }
.steps { padding-left: 1.2rem; }
.steps li { margin-bottom: .8rem; }
.modal-actions { text-align: right; }

.pub-foot { background: var(--ink); color: #d9cbc7; padding: 2rem 0; margin-top: 3rem; font-size: .85rem; text-align: center; }
.pub-foot .wordmark { height: 46px; background: #fff; padding: 6px 12px; border-radius: 8px; margin-bottom: 1rem; }
.pub-foot p { margin: .2rem 0; }
.pub-foot .muted { color: #a8958f; }

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(circle at 20% 10%, var(--maroon-2), var(--maroon) 40%, #3d100f 100%); }
.login-box { background: var(--paper); border-radius: 18px; padding: 2rem; width: 100%; max-width: 400px; box-shadow: 0 25px 70px rgba(0,0,0,.35); border-top: 6px solid var(--gold); }
.login-box.wide { max-width: 620px; }
.login-brand { text-align: center; margin-bottom: 1.3rem; }
.seal-lg { width: 84px; height: 84px; }
.login-brand h1 { font-size: 1.5rem; margin: .5rem 0 .2rem; color: var(--maroon); }
.login-brand p { color: var(--muted); margin: 0; }
.login-foot { text-align: center; font-size: .88rem; margin: 1.2rem 0 0; }

/* =========================================================
   ADMIN
   ========================================================= */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: var(--maroon); color: #f2e4e1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: .7rem; padding: 1.2rem 1.2rem 1rem; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.1); }
.side-brand:hover { color: #fff; }
.side-brand .seal { width: 42px; height: 42px; background: #fff; border-radius: 50%; padding: 2px; }
.side-brand strong { display: block; font-size: 1.05rem; }
.side-brand small { color: var(--gold); font-size: .78rem; }
.side-nav { padding: .8rem .7rem; display: flex; flex-direction: column; gap: .15rem; flex: 1; overflow-y: auto; }
.side-nav a { display: flex; align-items: center; gap: .7rem; padding: .62rem .8rem; border-radius: 9px; color: #f2e4e1; text-decoration: none; font-weight: 500; font-size: .93rem; }
.side-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-nav a.on { background: var(--gold); color: var(--gold-ink); font-weight: 700; }
.side-nav .count { margin-left: auto; background: var(--gold); color: var(--gold-ink); font-size: .75rem; font-weight: 800; padding: .05rem .5rem; border-radius: 999px; }
.side-nav a.on .count { background: var(--maroon); color: #fff; }
.side-foot { padding: 1rem 1.2rem; border-top: 1px solid rgba(255,255,255,.1); }
.side-foot a { color: #e8d3cf; font-size: .85rem; text-decoration: none; display: flex; gap: .4rem; align-items: center; }
.side-foot a:hover { color: var(--gold); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 1rem; padding: .8rem 1.75rem; background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.page-title { font-size: 1.3rem; margin: 0; flex: 1; }
.menu-btn { display: none; }
.me { display: flex; align-items: center; gap: .4rem; }
.me-link { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); padding: .25rem .5rem; border-radius: 10px; }
.me-link:hover { background: var(--cream); color: var(--ink); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--maroon); color: var(--gold); display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.me-text { display: flex; flex-direction: column; line-height: 1.2; }
.me-text small { color: var(--muted); font-size: .76rem; }
.content { padding: 1.6rem 1.75rem 3rem; max-width: 1320px; width: 100%; }
.greet { font-size: 1.05rem; margin-bottom: 1.2rem; }
.page-actions { margin-bottom: 1rem; display: flex; justify-content: flex-end; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.tile { display: flex; flex-direction: column; gap: .4rem; padding: 1.1rem 1.2rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); border-top: 4px solid #b9aca8; }
a.tile:hover { border-color: var(--gold-m); color: var(--ink); }
.tile-blue { border-top-color: var(--blue); }
.tile-gold { border-top-color: var(--gold-m); }
.tile-green { border-top-color: var(--green); }
.tile-red { border-top-color: var(--red); }
.tile-neutral { border-top-color: var(--maroon); }
.tile-label { font-size: .84rem; font-weight: 600; color: var(--muted); display: flex; gap: .35rem; align-items: center; }
.tile-num { font-size: 2.1rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.tile-num small { font-size: .95rem; font-weight: 600; color: var(--muted); }

.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; }
.queue { list-style: none; margin: 0; padding: 0; }
.queue li + li { border-top: 1px solid var(--line); }
.queue a { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem .3rem; text-decoration: none; color: var(--ink); border-radius: 6px; }
.queue a:hover { background: var(--cream); color: var(--ink); }
.q-main { display: flex; flex-direction: column; min-width: 0; }
.q-main strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-main small, .q-side small { color: var(--muted); font-size: .8rem; }
.q-side { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; flex-shrink: 0; }
.visit { font-weight: 700; color: var(--amber) !important; }

/* single-series bars, maroon on a light track */
.hbars { display: flex; flex-direction: column; gap: .35rem; }
.hbar { display: grid; grid-template-columns: 150px 1fr 36px; align-items: center; gap: .7rem; padding: .3rem .25rem; border-radius: 6px; text-decoration: none; color: var(--ink); font-size: .88rem; }
a.hbar:hover { background: var(--cream); color: var(--ink); }
.hbar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { height: 14px; background: #f3ece8; border-radius: 4px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: var(--maroon); border-radius: 0 4px 4px 0; }
.hbar:hover .hbar-fill { background: var(--maroon-d); }
.hbar-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.cols { display: grid; grid-template-columns: repeat(6, 1fr); gap: .8rem; height: 210px; align-items: end; padding-top: .5rem; border-bottom: 1px solid var(--line); }
.col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: .3rem; position: relative; }
.col-bar { width: 60%; max-width: 46px; background: var(--maroon); border-radius: 4px 4px 0 0; min-height: 0; }
.col:hover .col-bar { background: var(--maroon-d); }
.col-val { font-weight: 700; font-size: .85rem; font-variant-numeric: tabular-nums; }
.col-label { position: absolute; bottom: -1.6rem; font-size: .8rem; color: var(--muted); }
.cols + * { margin-top: 2rem; }

.tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.tabs a { padding: .55rem .85rem; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .88rem; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--maroon); }
.tabs a.on { color: var(--maroon); border-bottom-color: var(--maroon); }
.tab-n { background: #efe7e4; color: var(--ink-2); font-size: .74rem; padding: .05rem .45rem; border-radius: 999px; margin-left: .2rem; }
.tabs a.on .tab-n { background: var(--maroon); color: #fff; }

.filters { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; padding: 1rem 1.2rem; }
.filters .field { margin: 0; min-width: 150px; }
.filters .grow { flex: 1 1 260px; }
.check-field { justify-content: flex-end; padding-bottom: .55rem; }
.filter-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.table-card { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: #fbf8f6; padding: .7rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .75rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr:hover { background: #fdfaf8; }
.table .sub { display: block; color: var(--muted); font-size: .8rem; }
.table .subj { max-width: 320px; font-weight: 600; }
.table td.mono a { font-weight: 700; text-decoration: none; }
.table tr.inactive td { opacity: .6; }
.table.compact td, .table.compact th { padding: .5rem .8rem; }
.card .table.compact th { background: none; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem; border-top: 1px solid var(--line); gap: .5rem; flex-wrap: wrap; }
.pager span:last-child { display: flex; gap: .4rem; }
form.inline { display: inline-flex; gap: .3rem; flex-wrap: wrap; }

.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }
.ticket-side { position: sticky; top: 80px; }
.action-card { padding: 1.1rem; }
.action-card h3 { margin-top: 0; }
.danger-zone { border-color: #ecc3bf; }
.desc { white-space: normal; background: var(--cream); padding: .9rem 1rem; border-radius: 8px; overflow-wrap: anywhere; }
.attach { display: flex; align-items: center; gap: .4rem; margin-top: 1rem; font-weight: 600; }
.comment-form { margin-bottom: 1.3rem; }
.comment-form .row-actions { justify-content: space-between; margin-top: .5rem; }

.form-narrow { max-width: 860px; }
.roles { display: grid; gap: .5rem; }
.role-opt { display: flex; gap: .7rem; align-items: flex-start; padding: .75rem .9rem; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; }
.role-opt:has(input:checked) { border-color: var(--maroon); background: #fdf6f4; }
.role-opt input { margin-top: .25rem; accent-color: var(--maroon); }
.role-opt small { display: block; color: var(--muted); font-size: .84rem; }
.role-pill { font-size: .8rem; font-weight: 700; padding: .2rem .55rem; border-radius: 6px; white-space: nowrap; }
.role-admin { background: var(--maroon); color: #fff; }
.role-supervisor { background: var(--gold); color: var(--gold-ink); }
.role-technician { background: var(--blue-bg); color: var(--blue); }
.role-viewer { background: #eee8e5; color: var(--ink-2); }
.matrix td:first-child { font-weight: 500; }
.matrix .yes { color: var(--green); }
.matrix .no { color: #c4b8b4; }

.print-head { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid, .two-col { grid-template-columns: 1fr; }
  .ticket-layout { grid-template-columns: 1fr; }
  .ticket-side { position: static; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .menu-btn { display: inline-flex; }
  .me-text { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .type-grid, .grid-2, .track-form { grid-template-columns: 1fr; }
  .hero-seal { display: none; }
  .pub-nav > a:not(.btn) { display: none; }
  .brand-text small { display: none; }
  .content { padding: 1.1rem 1rem 2.5rem; }
  .topbar { padding: .6rem 1rem; }
  .hbar { grid-template-columns: 110px 1fr 30px; }
  .card { padding: 1.1rem; }
}

/* ---------- print (reports) ---------- */
@media print {
  .side, .topbar, .filters, .page-actions, .tabs { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  body { background: #fff; }
  .card, .tile { box-shadow: none; break-inside: avoid; }
  .print-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; border-bottom: 3px solid var(--maroon); padding-bottom: .8rem; }
  .print-head img { height: 44px; }
  .hbar-fill, .col-bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.actions { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: flex-end; max-width: 300px; margin-left: auto; }
.actions form.inline { display: contents; }
.side { align-self: start; }
