/* ============================================================
   Sonbos Communicatieportaal — Stylesheet
   System fonts, no external dependencies
   ============================================================ */

:root {
  --color-bg: #eef2f7;
  --color-surface: #ffffff;
  --color-surface-2: #f8fafc;
  --color-border: #d1dbe8;
  --color-border-light: #e8eef5;

  --color-navy: #0f2044;
  --color-navy-mid: #1a3461;
  --color-text: #1e2d40;
  --color-text-muted: #5c6e82;
  --color-text-subtle: #8fa3b8;

  /* Department accent colours */
  --color-it: #1d4ed8;
  --color-it-bg: #dbeafe;
  --color-it-border: #93c5fd;

  --color-frontdesk: #15803d;
  --color-frontdesk-bg: #dcfce7;
  --color-frontdesk-border: #86efac;

  --color-hrm: #7e22ce;
  --color-hrm-bg: #f3e8ff;
  --color-hrm-border: #d8b4fe;

  --color-bar: #b45309;
  --color-bar-bg: #fef3c7;
  --color-bar-border: #fcd34d;

  --color-facilitair: #0e7490;
  --color-facilitair-bg: #cffafe;
  --color-facilitair-border: #67e8f9;

  --color-management: #9f1239;
  --color-management-bg: #ffe4e6;
  --color-management-border: #fda4af;

  /* Priority */
  --urgent-bg: #fef2f2; --urgent-color: #b91c1c; --urgent-border: #fca5a5;
  --hoog-bg: #fff7ed;   --hoog-color: #c2410c;   --hoog-border: #fed7aa;
  --normaal-bg: #eff6ff; --normaal-color: #1d4ed8; --normaal-border: #bfdbfe;
  --laag-bg: #f8fafc;   --laag-color: #475569;   --laag-border: #cbd5e1;

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(15,32,68,.07), 0 1px 2px rgba(15,32,68,.05);
  --shadow: 0 4px 12px rgba(15,32,68,.09), 0 1px 3px rgba(15,32,68,.06);
  --shadow-lg: 0 10px 32px rgba(15,32,68,.13), 0 2px 8px rgba(15,32,68,.07);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --transition: .18s cubic-bezier(.4,0,.2,1);
}

/* ── Reset ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}
img, svg { display: block; }
a { color: var(--color-it); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: var(--font); cursor: pointer; }
ul { list-style: none; }

/* ── Focus states (accessibility) ────────────────── */
:focus-visible {
  outline: 3px solid var(--color-it);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── Layout helpers ───────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
}
.section-header h2 {
  font-size: 1.1rem; font-weight: 700; color: var(--color-navy);
  letter-spacing: -.01em;
}
.section-divider {
  flex: 1; height: 1px; background: var(--color-border);
}

/* ── Header / Nav ─────────────────────────────────── */
#site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-navy);
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.nav-inner {
  display: flex; align-items: center; gap: 0;
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  height: 58px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  color: #ffffff; font-weight: 700; font-size: .97rem;
  flex-shrink: 0; margin-right: 28px;
  text-decoration: none;
}
.nav-logo:hover { text-decoration: none; color: #c7d8f5; }
.nav-logo-icon {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--color-it);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-logo-icon svg { width: 18px; height: 18px; }
.nav-links {
  display: flex; align-items: center; gap: 2px; flex: 1;
}
.nav-links a {
  color: #a8c0de; font-size: .88rem; font-weight: 500;
  padding: 7px 13px; border-radius: var(--radius-sm);
  text-decoration: none; transition: var(--transition);
  white-space: nowrap;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-links a.active { color: #fff; background: rgba(255,255,255,.12); }
.nav-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.btn-primary {
  background: var(--color-it); color: #fff;
  border: none; border-radius: var(--radius-sm);
  padding: 8px 15px; font-size: .85rem; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.btn-primary:hover { background: #1e40af; }
.btn-primary:active { transform: scale(.97); }
.btn-secondary {
  background: transparent; color: #a8c0de;
  border: 1px solid rgba(168,192,222,.35); border-radius: var(--radius-sm);
  padding: 7px 13px; font-size: .85rem; font-weight: 500;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
}
.btn-secondary:hover { color: #fff; border-color: rgba(168,192,222,.7); }
.hamburger {
  display: none; background: none; border: none; color: #fff;
  padding: 6px; cursor: pointer;
}

/* System status badge in header */
.sys-status {
  display: flex; align-items: center; gap: 6px;
  font-size: .78rem; color: #a8c0de;
  border-left: 1px solid rgba(255,255,255,.1);
  padding-left: 14px; margin-left: 6px;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34,197,94,.25);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 2px rgba(34,197,94,.25); }
  50% { box-shadow: 0 0 0 5px rgba(34,197,94,.1); }
}
.status-dot.warning { background: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,.25); }
.status-dot.error { background: #ef4444; box-shadow: 0 0 0 2px rgba(239,68,68,.25); }

/* ── Hero ─────────────────────────────────────────── */
#section-dashboard {
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-mid) 60%, #1a3d6e 100%);
  padding: 44px 20px 40px;
  position: relative; overflow: hidden;
}
#section-dashboard::after {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-inner {
  max-width: 1200px; margin: 0 auto;
  position: relative; z-index: 1;
}
.hero-title {
  font-size: 1.9rem; font-weight: 800; color: #fff;
  letter-spacing: -.03em; line-height: 1.15;
  margin-bottom: 8px;
}
.hero-sub {
  font-size: 1rem; color: #93b8dd; font-weight: 400;
  margin-bottom: 22px;
}
.hero-meta {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.hero-date { font-size: .82rem; color: #7aa3c8; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(34,197,94,.15); border: 1px solid rgba(34,197,94,.3);
  color: #4ade80; border-radius: 20px;
  padding: 4px 12px; font-size: .78rem; font-weight: 600;
}

/* ── Status Cards Grid ────────────────────────────── */
.status-bar {
  background: var(--color-navy-mid);
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding: 0 20px;
}
.status-bar-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
}
.status-card {
  padding: 14px 18px;
  border-right: 1px solid rgba(255,255,255,.07);
  cursor: pointer; transition: var(--transition);
  text-decoration: none; display: block;
}
.status-card:last-child { border-right: none; }
.status-card:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.sc-label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: #7aa3c8; font-weight: 600; margin-bottom: 4px;
}
.sc-value {
  font-size: .9rem; font-weight: 600; color: #e2ecf8;
  display: flex; align-items: center; gap: 6px;
}
.sc-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.sc-dot.ok { background: #22c55e; }
.sc-dot.warn { background: #f59e0b; }
.sc-dot.crit { background: #ef4444; }
.sc-sub { font-size: .73rem; color: #5c7fa0; margin-top: 2px; }

/* ── Main content layout ──────────────────────────── */
.page-body {
  max-width: 1200px; margin: 0 auto;
  padding: 28px 20px 40px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}
.main-col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.side-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* ── Card base ────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--color-border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title {
  font-size: .9rem; font-weight: 700; color: var(--color-navy);
  display: flex; align-items: center; gap: 8px;
}
.card-icon {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.card-body { padding: 16px 20px; }
.card-action { font-size: .8rem; color: var(--color-it); font-weight: 600; cursor: pointer; }
.card-action:hover { text-decoration: underline; }

/* ── Hub Map ──────────────────────────────────────── */
#section-hub .card-body { padding: 0; }
.hub-svg-wrap {
  width: 100%; overflow: hidden; border-radius: 0 0 var(--radius) var(--radius);
}
.hub-svg { width: 100%; height: auto; display: block; }
.hub-line {
  stroke: #cbd5e1; stroke-width: 2;
  stroke-dasharray: 6 4;
  animation: dash-flow 2.5s linear infinite;
}
.hub-line.it { stroke: var(--color-it); }
.hub-line.frontdesk { stroke: var(--color-frontdesk); }
.hub-line.hrm { stroke: var(--color-hrm); }
.hub-line.bar { stroke: var(--color-bar); }
.hub-line.facilitair { stroke: var(--color-facilitair); }
.hub-line.management { stroke: var(--color-management); }
@keyframes dash-flow {
  to { stroke-dashoffset: -20; }
}
.hub-center-circle { fill: var(--color-it); filter: drop-shadow(0 4px 12px rgba(29,78,216,.4)); }
.hub-center-text { fill: #fff; font-family: var(--font); font-weight: 800; font-size: 20px; text-anchor: middle; dominant-baseline: middle; }
.hub-center-sub { fill: rgba(255,255,255,.7); font-family: var(--font); font-size: 11px; text-anchor: middle; }
.hub-dept-circle { cursor: pointer; transition: filter .2s; }
.hub-dept-circle:hover { filter: brightness(1.1); }
.hub-dept-text { font-family: var(--font); font-weight: 700; font-size: 12px; text-anchor: middle; dominant-baseline: middle; fill: #fff; pointer-events: none; }
.hub-dept-sub { font-family: var(--font); font-size: 10px; text-anchor: middle; fill: rgba(255,255,255,.75); pointer-events: none; }
.hub-pulse {
  animation: hub-pulse 3s ease-in-out infinite;
}
@keyframes hub-pulse {
  0%, 100% { opacity: .25; r: 62; }
  50% { opacity: 0; r: 75; }
}

/* ── Announcements / Meldingen list ──────────────── */
.melding-list { display: flex; flex-direction: column; gap: 0; }
.melding-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--color-border-light);
  transition: background var(--transition);
  cursor: pointer;
}
.melding-item:last-child { border-bottom: none; }
.melding-item:hover { background: var(--color-surface-2); }
.melding-item.new-item {
  animation: highlight-new .6s ease;
}
@keyframes highlight-new {
  0% { background: #dbeafe; }
  100% { background: transparent; }
}
.melding-prio { flex-shrink: 0; margin-top: 2px; }
.prio-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 12px;
  font-size: .7rem; font-weight: 700; white-space: nowrap;
  border-width: 1px; border-style: solid;
}
.prio-badge.urgent { background: var(--urgent-bg); color: var(--urgent-color); border-color: var(--urgent-border); }
.prio-badge.hoog   { background: var(--hoog-bg);   color: var(--hoog-color);   border-color: var(--hoog-border); }
.prio-badge.normaal{ background: var(--normaal-bg); color: var(--normaal-color);border-color: var(--normaal-border); }
.prio-badge.laag   { background: var(--laag-bg);   color: var(--laag-color);   border-color: var(--laag-border); }

.melding-content { flex: 1; min-width: 0; }
.melding-subject { font-size: .88rem; font-weight: 600; color: var(--color-text); line-height: 1.35; }
.melding-meta {
  font-size: .75rem; color: var(--color-text-muted);
  margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.melding-dept-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 7px; border-radius: 10px;
  font-size: .7rem; font-weight: 600; border: 1px solid;
}
.melding-dept-chip.it         { background: var(--color-it-bg);         color: var(--color-it);         border-color: var(--color-it-border); }
.melding-dept-chip.frontdesk  { background: var(--color-frontdesk-bg);  color: var(--color-frontdesk);  border-color: var(--color-frontdesk-border); }
.melding-dept-chip.hrm        { background: var(--color-hrm-bg);        color: var(--color-hrm);        border-color: var(--color-hrm-border); }
.melding-dept-chip.bar        { background: var(--color-bar-bg);        color: var(--color-bar);        border-color: var(--color-bar-border); }
.melding-dept-chip.facilitair { background: var(--color-facilitair-bg); color: var(--color-facilitair); border-color: var(--color-facilitair-border); }
.melding-dept-chip.management { background: var(--color-management-bg); color: var(--color-management); border-color: var(--color-management-border); }
.melding-status-chip {
  padding: 1px 7px; border-radius: 10px;
  font-size: .7rem; font-weight: 600; border: 1px solid;
  background: var(--laag-bg); color: var(--laag-color); border-color: var(--laag-border);
}
.melding-status-chip.open     { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.melding-status-chip.behandeling { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.melding-status-chip.gesloten { background: #dcfce7; color: #166534; border-color: #86efac; }
.melding-time { color: var(--color-text-subtle); font-size: .73rem; }
.melding-action { flex-shrink: 0; margin-top: 3px; }

/* ── Department Tabs ──────────────────────────────── */
.dept-tabs {
  display: flex; gap: 0; overflow-x: auto;
  border-bottom: 2px solid var(--color-border-light);
  padding: 0 20px;
  scrollbar-width: none;
}
.dept-tabs::-webkit-scrollbar { display: none; }
.dept-tab {
  padding: 11px 14px; font-size: .83rem; font-weight: 600;
  color: var(--color-text-muted); background: none; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  cursor: pointer; white-space: nowrap; transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
}
.dept-tab:hover { color: var(--color-text); }
.dept-tab.active { color: var(--color-it); border-bottom-color: var(--color-it); }
.dept-tab .tab-dot {
  width: 7px; height: 7px; border-radius: 50%;
}
.dept-panel { display: none; padding: 20px; }
.dept-panel.active { display: block; }
.dept-panel-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.dept-panel-info h3 { font-size: 1rem; font-weight: 700; color: var(--color-navy); }
.dept-panel-info p { font-size: .82rem; color: var(--color-text-muted); margin-top: 3px; }
.dept-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-dept {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: var(--radius-sm);
  font-size: .8rem; font-weight: 600; cursor: pointer;
  transition: var(--transition); border: none;
}
.btn-dept.primary { background: var(--color-it); color: #fff; }
.btn-dept.primary:hover { background: #1e40af; }
.btn-dept.outline {
  background: none; color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-dept.outline:hover { background: var(--color-surface-2); }

.dept-ticket-list { display: flex; flex-direction: column; gap: 8px; }
.dept-ticket {
  background: var(--color-surface-2); border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  display: flex; align-items: flex-start; gap: 10px;
  transition: box-shadow var(--transition);
}
.dept-ticket:hover { box-shadow: var(--shadow-sm); }
.dept-ticket-body { flex: 1; min-width: 0; }
.dept-ticket-subject { font-size: .85rem; font-weight: 600; color: var(--color-text); }
.dept-ticket-desc { font-size: .78rem; color: var(--color-text-muted); margin-top: 3px; }
.dept-ticket-footer {
  display: flex; align-items: center; gap: 8px;
  margin-top: 7px; flex-wrap: wrap;
}

/* ── FAQ / Kennisbank ─────────────────────────────── */
#section-faq { padding: 0 0 40px; }
.faq-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.faq-search-wrap {
  position: relative; margin-bottom: 20px;
}
.faq-search {
  width: 100%; padding: 10px 14px 10px 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius); font-size: .9rem;
  background: var(--color-surface); color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.faq-search:focus { outline: none; border-color: var(--color-it); box-shadow: 0 0 0 3px rgba(29,78,216,.12); }
.faq-search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--color-text-subtle); pointer-events: none;
}
.faq-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.faq-category {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.faq-cat-header {
  padding: 13px 16px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--color-border-light);
}
.faq-cat-icon {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.faq-cat-title { font-size: .87rem; font-weight: 700; color: var(--color-navy); }
.faq-item-list { padding: 6px 0; }
.faq-item {
  border-bottom: 1px solid var(--color-border-light);
}
.faq-item:last-child { border-bottom: none; }
.faq-question {
  width: 100%; text-align: left; background: none; border: none;
  padding: 10px 16px; cursor: pointer; font-size: .83rem; font-weight: 600;
  color: var(--color-text); display: flex; justify-content: space-between; align-items: center;
  gap: 8px; transition: background var(--transition);
}
.faq-question:hover { background: var(--color-surface-2); color: var(--color-it); }
.faq-question.open { color: var(--color-it); }
.faq-chevron {
  transition: transform var(--transition); flex-shrink: 0;
  color: var(--color-text-subtle); width: 14px; height: 14px;
}
.faq-question.open .faq-chevron { transform: rotate(180deg); }
.faq-answer {
  display: none; padding: 0 16px 12px;
  font-size: .8rem; color: var(--color-text-muted); line-height: 1.65;
}
.faq-answer.open { display: block; }
.faq-answer ol, .faq-answer ul { padding-left: 16px; margin-top: 6px; }
.faq-answer li { margin-bottom: 3px; list-style: decimal; }
.faq-answer ul li { list-style: disc; }
.faq-answer .code {
  background: #f1f5f9; border: 1px solid #e2e8f0;
  padding: 2px 5px; border-radius: 4px; font-family: monospace; font-size: .78rem;
}
.faq-hidden { display: none !important; }

/* ── Sidebar widgets ──────────────────────────────── */
.widget-title {
  font-size: .83rem; font-weight: 700; color: var(--color-navy);
  display: flex; align-items: center; gap: 8px;
}
.widget-title-icon {
  width: 22px; height: 22px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
}
.contact-list { display: flex; flex-direction: column; gap: 0; }
.contact-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--color-border-light);
}
.contact-item:last-child { border-bottom: none; }
.contact-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--color-it-bg); color: var(--color-it);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; flex-shrink: 0;
}
.contact-name { font-size: .82rem; font-weight: 600; color: var(--color-text); }
.contact-role { font-size: .73rem; color: var(--color-text-muted); }
.contact-ext { font-size: .73rem; color: var(--color-it); font-weight: 600; margin-top: 1px; }

.quick-links { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; }
.quick-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--color-text); font-size: .82rem; font-weight: 500;
  transition: background var(--transition); text-decoration: none;
  border: 1px solid var(--color-border-light);
}
.quick-link:hover {
  background: var(--color-surface-2);
  color: var(--color-it); text-decoration: none;
  border-color: var(--color-it-border);
}
.quick-link svg { flex-shrink: 0; color: var(--color-text-subtle); }
.quick-link:hover svg { color: var(--color-it); }

/* Stats widget */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 16px; }
.stat-box {
  background: var(--color-surface-2); border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm); padding: 12px; text-align: center;
}
.stat-value { font-size: 1.5rem; font-weight: 800; color: var(--color-navy); line-height: 1; }
.stat-label { font-size: .7rem; color: var(--color-text-muted); margin-top: 4px; }
.stat-box.it .stat-value { color: var(--color-it); }
.stat-box.warn .stat-value { color: var(--color-bar); }
.stat-box.ok .stat-value { color: var(--color-frontdesk); }

/* ── Modal ────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(10,20,40,.55); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; animation: fade-in .18s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: var(--color-surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 540px;
  max-height: 92vh; overflow-y: auto;
  animation: slide-up .22s cubic-bezier(.4,0,.2,1);
}
@keyframes slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--color-border-light);
}
.modal-title { font-size: 1.05rem; font-weight: 700; color: var(--color-navy); }
.modal-close {
  background: none; border: none; color: var(--color-text-muted);
  cursor: pointer; padding: 4px; border-radius: var(--radius-sm);
  transition: var(--transition);
}
.modal-close:hover { color: var(--color-text); background: var(--color-surface-2); }
.modal-body { padding: 22px 24px; }
.modal-footer {
  padding: 16px 24px 22px;
  border-top: 1px solid var(--color-border-light);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* Form */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-label {
  display: block; font-size: .8rem; font-weight: 600;
  color: var(--color-text); margin-bottom: 5px;
}
.form-label .required { color: #ef4444; }
.form-control {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); font-size: .88rem;
  color: var(--color-text); background: var(--color-surface);
  font-family: var(--font); transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none; border-color: var(--color-it);
  box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-hint { font-size: .73rem; color: var(--color-text-subtle); margin-top: 4px; }
.btn-cancel {
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: .88rem; font-weight: 600; cursor: pointer;
  background: none; border: 1px solid var(--color-border);
  color: var(--color-text); transition: var(--transition);
}
.btn-cancel:hover { background: var(--color-surface-2); }
.btn-submit {
  padding: 9px 22px; border-radius: var(--radius-sm);
  font-size: .88rem; font-weight: 600; cursor: pointer;
  background: var(--color-it); color: #fff;
  border: none; transition: var(--transition);
  display: flex; align-items: center; gap: 7px;
}
.btn-submit:hover { background: #1e40af; }
.btn-submit:active { transform: scale(.97); }

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 600;
  background: var(--color-navy); color: #fff;
  padding: 12px 20px; border-radius: var(--radius);
  font-size: .87rem; font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  transform: translateY(20px); opacity: 0;
  transition: transform .28s cubic-bezier(.4,0,.2,1), opacity .28s ease;
  pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-icon { color: #4ade80; flex-shrink: 0; }

/* ── Ticket detail drawer (simple slide) ─────────── */
.ticket-drawer {
  position: fixed; right: 0; top: 0; bottom: 0; z-index: 400;
  width: 400px; max-width: 95vw;
  background: var(--color-surface);
  box-shadow: -8px 0 32px rgba(15,32,68,.15);
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  border-left: 1px solid var(--color-border);
}
.ticket-drawer.open { transform: translateX(0); }
.drawer-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--color-border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.drawer-title { font-size: .95rem; font-weight: 700; color: var(--color-navy); }
.drawer-close {
  background: none; border: none; cursor: pointer; color: var(--color-text-muted);
  padding: 4px; border-radius: var(--radius-sm); transition: var(--transition);
}
.drawer-close:hover { background: var(--color-surface-2); color: var(--color-text); }
.drawer-body { padding: 20px; flex: 1; overflow-y: auto; }
.drawer-field { margin-bottom: 16px; }
.drawer-field-label { font-size: .73rem; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-subtle); font-weight: 600; margin-bottom: 4px; }
.drawer-field-value { font-size: .87rem; color: var(--color-text); }
.drawer-description {
  background: var(--color-surface-2); border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm); padding: 12px; font-size: .83rem;
  color: var(--color-text-muted); line-height: 1.6; margin-top: 4px;
}

/* ── Footer ───────────────────────────────────────── */
footer {
  background: var(--color-navy); color: #7aa3c8;
  padding: 22px 20px;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.footer-brand { font-size: .83rem; }
.footer-brand strong { color: #c7d8f5; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: #7aa3c8; font-size: .78rem; text-decoration: none; }
.footer-links a:hover { color: #c7d8f5; }
.footer-offline {
  font-size: .73rem; color: #5c7fa0;
  display: flex; align-items: center; gap: 5px;
}

/* ── Chip / count badge ───────────────────────────── */
.count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: #ef4444; color: #fff;
  border-radius: 9px; font-size: .68rem; font-weight: 700;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 900px) {
  .page-body { grid-template-columns: 1fr; }
  .side-col { order: -1; display: grid; grid-template-columns: 1fr 1fr; }
  .status-bar-inner { grid-template-columns: repeat(3, 1fr); }
  .status-bar-inner .status-card:nth-child(n+4) { border-top: 1px solid rgba(255,255,255,.07); }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .sys-status .sys-status-text { display: none; }
  .status-bar-inner { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero-title { font-size: 1.45rem; }
  .side-col { grid-template-columns: 1fr; }
  .faq-grid { grid-template-columns: 1fr; }
  .page-body { padding: 16px 14px 30px; gap: 16px; }
  .modal-box { max-width: 100%; }
  .ticket-drawer { width: 100%; }
}
@media (max-width: 420px) {
  .status-bar-inner { grid-template-columns: 1fr; }
  .hero-title { font-size: 1.25rem; }
}

/* ── Mobile Nav ───────────────────────────────────── */
.mobile-nav {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: var(--color-navy); flex-direction: column;
  padding: 20px;
}
.mobile-nav.open { display: flex; }
.mobile-nav-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.mobile-nav-links { display: flex; flex-direction: column; gap: 4px; }
.mobile-nav-links a {
  color: #a8c0de; padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 1rem; font-weight: 600; text-decoration: none; display: block;
}
.mobile-nav-links a:hover { background: rgba(255,255,255,.08); color: #fff; }
.mobile-nav-links a.active { background: rgba(255,255,255,.12); color: #fff; }

/* ── Scrollbar ────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-subtle); }

/* ── Empty state ──────────────────────────────────── */
.empty-state {
  text-align: center; padding: 32px 20px; color: var(--color-text-muted);
}
.empty-state svg { margin: 0 auto 10px; opacity: .35; }
.empty-state p { font-size: .85rem; }

/* ── Skeleton loader (optional micro-detail) ─────── */
.skeleton {
  background: linear-gradient(90deg, #e8eef5 25%, #f5f8fb 50%, #e8eef5 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Utility ──────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.items-center { align-items: center; }
