/* Super-boss dashboard, to-do lists, certificates, inventory, tracking and print styles. */

/* ---------- Hero and KPI cards ---------- */
.sb-hero { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; padding: 1.2rem 1.4rem; margin-bottom: 1rem; border-radius: 18px; color: #fff; background: linear-gradient(120deg, #6c5ce7 0%, #0984e3 55%, #00cec9 100%); box-shadow: 0 8px 24px rgba(108, 92, 231, .25); }
.sb-hero h1 { margin: 0; color: #fff; font-size: clamp(1.4rem, 3vw, 2rem); }
.sb-hero p { margin: .2rem 0 0; opacity: .92; }
.sb-kicker { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 800; opacity: .9; }
.sb-hero-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.sb-chip { display: inline-block; padding: .4rem .8rem; border-radius: 999px; font-weight: 700; font-size: .85rem; color: #fff; text-decoration: none; background: rgba(255, 255, 255, .22); border: 1px solid rgba(255, 255, 255, .45); }
.sb-chip-red { background: #d63031; border-color: #d63031; }
.sb-chip-blue { background: rgba(9, 132, 227, .85); border-color: transparent; }
.sb-chip-green { background: rgba(0, 184, 148, .9); border-color: transparent; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin: 1rem 0; }
.kpi { position: relative; display: flex; flex-direction: column; gap: .15rem; padding: 1rem 1.1rem; border-radius: 16px; color: #fff; overflow: hidden; box-shadow: 0 6px 16px rgba(0, 0, 0, .12); }
.kpi-label { font-size: .8rem; font-weight: 700; opacity: .92; }
.kpi-value { font-size: 1.9rem; font-weight: 800; line-height: 1.1; font-family: "Baloo 2", system-ui, sans-serif; }
.kpi-value small { font-size: 1rem; font-weight: 700; opacity: .85; }
.kpi-sub { font-size: .8rem; opacity: .92; }
.kpi .donut { position: absolute; right: 8px; top: 8px; opacity: .95; }
.kpi .donut text { fill: #fff; }
.kpi-violet { background: linear-gradient(135deg, #6c5ce7, #a29bfe); }
.kpi-green { background: linear-gradient(135deg, #00b894, #55efc4); color: #053b30; }
.kpi-orange { background: linear-gradient(135deg, #e17055, #fdcb6e); color: #4a1d0c; }
.kpi-blue { background: linear-gradient(135deg, #0984e3, #74b9ff); }
.kpi-pink { background: linear-gradient(135deg, #e84393, #fd79a8); }
.kpi-teal { background: linear-gradient(135deg, #00a8a8, #81ecec); color: #043a3a; }
.kpi-red { background: linear-gradient(135deg, #d63031, #ff7675); }

/* ---------- Charts ---------- */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.chart-card h2 { margin-top: 0; font-size: 1rem; }
.chart-card svg.bars, .chart-card svg.line { width: 100%; height: auto; display: block; }
.chart-card svg.line { height: 130px; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.hbars li { display: grid; grid-template-columns: minmax(70px, 28%) 1fr auto; gap: .5rem; align-items: center; font-size: .88rem; }
.hb-track { background: #eef0f8; border-radius: 999px; height: 12px; overflow: hidden; }
.hb-fill { display: block; height: 100%; border-radius: 999px; }
.hb-num { font-weight: 800; }
.donut { display: block; }

/* ---------- Alerts ---------- */
.alert-red { background: #ffe3e3; border-color: #d63031; }
.alert-amber { background: #fff3d6; border-color: #e0a100; }
.alert-blue { background: #e0f0ff; border-color: #0984e3; }
.alert-green { background: #dff7ec; border-color: #00b894; }

/* ---------- To-do lists: red until done, green when done ---------- */
.todo-list { list-style: none; margin: .5rem 0; padding: 0; display: grid; gap: .45rem; }
.todo-item form { margin: 0; }
.todo-btn { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .65rem .8rem; text-align: left; font: inherit; border-radius: 12px; border: 2px solid; cursor: pointer; }
span.todo-btn { cursor: default; }
.todo-item.is-open .todo-btn { background: #ffe9e9; border-color: #e03b3b; color: #7a1010; }
.todo-item.is-done .todo-btn { background: #e1f8ea; border-color: #1fa463; color: #0b4a2b; }
.todo-box { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; background: #fff; border: 2px solid currentColor; }
.todo-item.is-done .todo-box { background: #1fa463; border-color: #1fa463; color: #fff; }
.todo-text { flex: 1; font-weight: 700; }
.todo-item.is-done .todo-text { text-decoration: line-through; text-decoration-thickness: 2px; }
.todo-state { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.team-tasks li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .4rem .6rem; border-radius: 10px; margin-bottom: .3rem; border-left: 6px solid; }
.team-tasks li.is-open { background: #ffe9e9; border-color: #e03b3b; }
.team-tasks li.is-done { background: #e1f8ea; border-color: #1fa463; }
.team-count { font-weight: 800; }

/* ---------- Misc helpers ---------- */
.quick-links { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0; }
.chip.is-live { background: #dff7ec; color: #0b4a2b; border-color: #1fa463; }
.lvl { display: inline-block; min-width: 2.4rem; text-align: center; padding: .1rem .4rem; border-radius: 8px; font-weight: 800; }
.lvl-low { background: #ffe3e3; color: #8a1111; } .lvl-mid { background: #fff3d6; color: #7a5200; } .lvl-high { background: #dff7ec; color: #0b4a2b; } .lvl-na { background: #eef0f8; color: #667; }
.absent-row { display: flex; gap: .6rem; align-items: flex-start; }
.code-block { background: #1b1f3b; color: #e8ecff; padding: .6rem .8rem; border-radius: 10px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; font-size: .8rem; }
.break { word-break: break-all; }
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: .8rem 0; }
.tabs a { padding: .4rem .9rem; border-radius: 999px; background: #eef0f8; text-decoration: none; font-weight: 700; color: #26337e; }
.tabs a[aria-current="page"] { background: #26337e; color: #fff; }
.arc-year > summary, .arc-month > summary { cursor: pointer; font-size: 1.05rem; padding: .3rem 0; }
.arc-month { margin-left: 1rem; }
.gal-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: .4rem; }
.gal-pick label { position: relative; display: block; }
.gal-pick img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.gal-pick input { position: absolute; top: 6px; left: 6px; width: 20px; height: 20px; }

/* ---------- Inventory ---------- */
.inv-head { display: flex; gap: 1rem; align-items: center; margin-bottom: .8rem; }
.inv-cat-photo { width: 84px; height: 84px; border-radius: 16px; object-fit: cover; flex: none; }
.inv-empty { display: grid; place-items: center; background: linear-gradient(135deg, #dfe6ff, #f0e6ff); color: #6c5ce7; font-weight: 800; font-size: 1.6rem; text-align: center; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .8rem; }
.inv-card { border: 2px solid #e4e7f5; border-radius: 14px; padding: .6rem; background: #fff; }
.inv-card.is-low { border-color: #e0a100; background: #fffaf0; }
.inv-card.is-nophoto { border-style: dashed; border-color: #e03b3b; }
.inv-card h3 { margin: .4rem 0 .1rem; font-size: 1rem; }
.inv-photo { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; font-size: .85rem; }
.inv-qty { margin: 0; font-size: 1.1rem; }
.cat-photo-form { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }

/* ---------- Cameras and buses ---------- */
.cam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.cam-missing { border: 2px solid #d63031; background: #fff5f5; }
.cam-live { border: 2px solid #1fa463; }
.cam-view img { width: 100%; border-radius: 10px; background: #111; aspect-ratio: 16/9; object-fit: cover; }
.bus-map { height: 420px; border-radius: 16px; margin: 1rem 0; border: 2px solid #dfe3f5; z-index: 0; }
.page-driver { background: linear-gradient(160deg, #6c5ce7, #00cec9); min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.driver-card { background: #fff; border-radius: 20px; padding: 1.4rem; width: min(440px, 100%); text-align: center; }
.driver-btn { font-size: 1.3rem; padding: 1rem; }
.driver-status { font-weight: 800; padding: .7rem; border-radius: 12px; background: #eef0f8; }
.driver-status.ok { background: #dff7ec; color: #0b4a2b; }

/* ---------- Certificates (screen preview and print) ---------- */
.cert-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .6rem 1rem; }
.cert-fields .wide { grid-column: 1 / -1; }
.cert-sheet-wrap { overflow-x: auto; padding: .5rem 0 2rem; }
.cert-sheet { background: #fff; color: #111; width: 210mm; min-height: 297mm; margin: 0 auto; padding: 14mm 16mm; box-sizing: border-box; border: 1px solid #333; font-family: Georgia, "Times New Roman", serif; font-size: 12pt; line-height: 1.55; box-shadow: 0 4px 18px rgba(0, 0, 0, .15); }
.cert-letterhead { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #333; padding-bottom: 6mm; }
.cert-letterhead h2 { margin: 0; font-family: Arial, sans-serif; font-size: 15pt; }
.cert-letterhead p { margin: 0; font-size: 10pt; }
.cert-title { text-align: center; font-family: Arial, sans-serif; font-size: 20pt; margin: 10mm 0 6mm; }
.cert-title.blue { color: #3d6bb3; font-size: 14pt; }
.cert-row { display: flex; justify-content: space-between; gap: 8mm; }
.cert-row > * { flex: 1; }
.cert-row.three > * { flex: 1; }
.cert-line { margin: 0 0 3mm; display: flex; gap: 2mm; align-items: baseline; border-bottom: 1px solid #333; padding-bottom: 1mm; min-height: 7mm; }
.cert-line span { white-space: nowrap; font-size: 10.5pt; }
.cert-line b { font-weight: 600; }
.cert-line.strong span { font-weight: 700; }
.cert-line.block { min-height: 22mm; align-items: flex-start; flex-wrap: wrap; }
.cert-tc h3 { font-family: Arial, sans-serif; font-size: 11pt; margin: 4mm 0 2mm; }
.cert-sign { margin-top: 30mm; text-align: right; font-weight: 700; }
.cert-sign span { display: inline-block; border-top: 1px solid #111; padding-top: 1mm; min-width: 55mm; text-align: center; }
.cert-sign.left { text-align: left; font-weight: 400; margin-top: 40mm; }
.cert-sign.split { display: flex; justify-content: space-between; align-items: flex-end; text-align: left; font-weight: 400; margin-top: 40mm; }
.sigline { border-top: 1px dashed #111; padding-top: 1mm; min-width: 70mm; margin-bottom: 1mm; }
.cert-seal { width: 30mm; height: 30mm; border-radius: 50%; border: 1px solid #111; display: grid; place-items: center; text-align: center; font-size: 10pt; font-family: Arial, sans-serif; }
.cert-bonafide { font-family: "Cambria", Georgia, serif; }
.cert-date { text-align: right; }
.cert-sub { font-family: Arial, sans-serif; font-size: 11pt; color: #3d6bb3; margin: 6mm 0 2mm; }
.cert-legal { margin-top: 8mm; }
.cert-exp { font-family: Arial, sans-serif; font-size: 12.5pt; }
.cert-logo { text-align: center; margin-bottom: 4mm; }
.cert-exp .cert-title { font-size: 20pt; margin: 14mm 0 12mm; }
.cert-exp p { margin: 0 0 7mm; }

/* ---------- Print: only the page itself ---------- */
.print-btn { cursor: pointer; }
@media print {
  .topbar, .mainbar, .footer, .portal-side, .contact-bar, .no-print, .print-btn, .float-wa, .skip-link, .messages, .filter-bar, nav { display: none !important; }
  body { background: #fff !important; }
  .portal { display: block !important; }
  .portal-main { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .panel, .stat, .tile { box-shadow: none !important; break-inside: avoid; }
  .kpi { color: #000 !important; background: #fff !important; border: 1px solid #999; box-shadow: none; }
  .cert-sheet-wrap { overflow: visible; padding: 0; }
  .cert-sheet { box-shadow: none; border: 1px solid #000; margin: 0; width: auto; min-height: 270mm; page-break-after: always; }
  @page { size: A4; margin: 10mm; }
  a { color: inherit; text-decoration: none; }
  .todo-item.is-open .todo-btn, .todo-item.is-done .todo-btn { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Server usage */
.usage-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:.8rem}
.usage-item{border:2px solid #cfe8d5;background:#f1fbf3;border-radius:12px;padding:.7rem .9rem}
.usage-item.usage-amber{border-color:#f0b429;background:#fff8e6}
.usage-item.usage-red{border-color:#d62828;background:#ffe9e9}
.usage-top{display:flex;justify-content:space-between}
.usage-bar{height:12px;background:#e5e7eb;border-radius:8px;overflow:hidden;margin:.4rem 0}
.usage-bar span{display:block;height:100%;background:#2a9d4a}
.usage-amber .usage-bar span{background:#f0b429}
.usage-red .usage-bar span{background:#d62828}
.usage-red{animation:none}
.usage-days{display:flex;align-items:flex-end;gap:2px;height:60px;overflow:hidden}
.usage-days span{flex:1;min-height:2px;max-height:60px;background:#3b82f6;border-radius:2px 2px 0 0}
.panel.usage-red{border:3px solid #d62828;background:#fff5f5}.panel.usage-amber{border:3px solid #f0b429}
.btn-danger{background:#d62828;color:#fff;border:0;border-radius:8px;padding:.45rem .8rem;cursor:pointer}
.btn-danger:hover{background:#a81d1d}

/* Signed in: let the header wrap so the menu and the user's name never overlap */
.mainbar.has-user{flex-wrap:wrap;row-gap:.2rem}
.mainbar.has-user .topbar-actions{order:2;margin-left:auto;flex:0 1 auto;max-width:100%;gap:.6rem}
.mainbar.has-user .site-nav{order:3;flex:1 0 100%;min-width:0}
.mainbar.has-user .nav-list{flex-wrap:wrap}
.mainbar.has-user .who{min-width:0;white-space:normal}
.message-warning{background:#fff4d6;border:1px solid #f0b429;border-radius:10px;padding:.6rem .9rem}

.seo-copy{padding:2rem 1rem}.seo-copy p{max-width:62ch;margin:.4rem auto 1rem;text-align:center}
.seo-tags{display:flex;flex-wrap:wrap;gap:.5rem;justify-content:center;list-style:none;padding:0;margin:0}
.seo-tags li{background:#fff4c2;border-radius:999px;padding:.3rem .8rem;font-weight:600;font-size:.92rem}
.table-wrap{overflow-x:auto}
.grid-2{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:1rem;margin-bottom:1rem}
.wide-table th,.wide-table td{white-space:nowrap;font-size:.86rem;padding:.35rem .6rem}
.wide-table thead th{position:sticky;top:0;background:#fff}
