/* =========================================================
   CODE ZERO :: LIBERTY COUNTY — core stylesheet
   Design language: emergency-dispatch terminal.
   Palette is deliberately restricted to black/red/off-white —
   department differentiation comes from iconography and
   typography, not extra colors.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Teko:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root{
  --bg:        #0b0b0c;
  --bg-elev:   #141416;
  --bg-inset:  #1a1a1d;
  --line:      #2a2a2e;
  --line-soft: #1f1f22;

  --red:        #d21f30;
  --red-bright: #ff3346;
  --red-dim:    #5c1017;

  --text:       #ece9e6;
  --text-muted: #9a9a9e;
  --text-faint: #616166;

  --ok:    #2fae60;
  --warn:  #e0a339;

  --font-display: 'Teko', 'Arial Narrow', sans-serif;
  --font-body:    'IBM Plex Sans', -apple-system, Segoe UI, sans-serif;
  --font-mono:    'IBM Plex Mono', 'Courier New', monospace;

  --max: 1180px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img{ max-width:100%; display:block; }
a{ color: inherit; text-decoration: none; }

::selection{ background: var(--red); color:#fff; }

:focus-visible{
  outline: 2px solid var(--red-bright);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.wrap{
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

h1,h2,h3,h4{
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.02;
  margin: 0;
}
h1{ font-size: clamp(48px, 8vw, 92px); }
h2{ font-size: clamp(32px, 5vw, 48px); }
h3{ font-size: clamp(22px, 3vw, 28px); }
p{ margin: 0 0 1em; color: var(--text-muted); max-width: 62ch; }

code, .mono{ font-family: var(--font-mono); }

/* ---------------- status strip (top of every page) ---------------- */
.statusbar{
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
}
.statusbar .wrap{
  display:flex;
  align-items:center;
  justify-content: space-between;
  height: 34px;
  gap: 16px;
  overflow-x: auto;
  white-space: nowrap;
}
.statusbar .dot{
  display:inline-block;
  width:7px; height:7px;
  border-radius:50%;
  background: var(--text-faint);
  margin-right:7px;
  position: relative;
  top: -1px;
}
.statusbar .dot.on{ background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.statusbar .dot.off{ background: var(--red-bright); box-shadow: 0 0 6px var(--red-bright); }
.statusbar .seg{ color: var(--text-muted); }
.statusbar .seg b{ color: var(--text); font-weight: 500; }

/* ---------------- nav ---------------- */
header.site{
  border-bottom: 1px solid var(--line);
  position: sticky; top:0; z-index: 50;
  background: rgba(11,11,12,0.92);
  backdrop-filter: blur(6px);
}
.navrow{
  display:flex;
  align-items:center;
  justify-content: space-between;
  height: 76px;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.5px;
}
.brand .mark{
  width: 30px; height: 30px;
  border: 2px solid var(--red);
  display:flex; align-items:center; justify-content:center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--red);
  transform: rotate(45deg);
  flex: none;
}
.brand .mark span{ transform: rotate(-45deg); }
.brand small{
  display:block;
  font-family: var(--font-body);
  font-size: 10.5px;
  letter-spacing: 1.5px;
  color: var(--text-faint);
  font-weight: 600;
  margin-top: -2px;
}

nav.primary{ display:flex; align-items:center; gap: 2px; }
nav.primary a{
  padding: 8px 14px;
  font-size: 14.5px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
nav.primary a:hover, nav.primary a.active{
  color: var(--text);
  border-bottom-color: var(--red);
}
.navrow .actions{ display:flex; align-items:center; gap:10px; }

.hamburger{
  display:none;
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  align-items:center; justify-content:center;
  cursor:pointer;
}
.hamburger span, .hamburger::before, .hamburger::after{ content:none; }
.hamburger .bars{ width:18px; display:flex; flex-direction:column; gap:4px; }
.hamburger .bars i{ display:block; height:2px; background: var(--text); }

/* ---------------- buttons ---------------- */
.btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 11px 20px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.btn:hover{ border-color: var(--text-muted); }
.btn-primary{
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.btn-primary:hover{ background: var(--red-bright); border-color: var(--red-bright); }
.btn-discord{
  background: #5865F2;
  border-color: #5865F2;
  color:#fff;
}
.btn-discord:hover{ filter: brightness(1.08); }
.btn-ghost{ border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover{ color: var(--text); }
.btn-sm{ padding: 7px 14px; font-size: 12.5px; }
.btn-danger{ border-color: var(--red-dim); color: var(--red-bright); }
.btn-danger:hover{ background: var(--red-dim); }
.btn-ok{ border-color: #1c4a30; color: var(--ok); }
.btn-ok:hover{ background: #123321; }
.btn:disabled{ opacity: .45; cursor: not-allowed; }

/* ---------------- hero ---------------- */
.hero{
  border-bottom: 1px solid var(--line);
  padding: 84px 0 64px;
  position: relative;
  overflow:hidden;
}
.hero .wrap{
  display:grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items:end;
}
.hero .eyebrow{
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--red-bright);
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}
.hero h1{ margin-bottom: 18px; }
.hero .sub{ font-size: 17px; max-width: 46ch; }
.hero .cta-row{ display:flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

.readout{
  border: 1px solid var(--line);
  background: var(--bg-elev);
  font-family: var(--font-mono);
  font-size: 13px;
}
.readout .head{
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text-faint);
  display:flex; justify-content:space-between;
}
.readout .row{
  display:flex; justify-content:space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-muted);
}
.readout .row:last-child{ border-bottom:none; }
.readout .row b{ color: var(--text); font-weight: 500; }
.readout .row .up{ color: var(--ok); }
.readout .row .down{ color: var(--red-bright); }

/* ---------------- sections ---------------- */
section{ padding: 72px 0; border-bottom: 1px solid var(--line); }
section:last-of-type{ border-bottom:none; }
.section-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap: 24px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.section-head .tag{
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
}

/* ---------------- department grid ---------------- */
.deptgrid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.deptcard{
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 28px 24px;
  min-height: 220px;
  display:flex;
  flex-direction: column;
  justify-content: space-between;
  transition: background .15s ease;
}
.deptcard:hover{ background: var(--bg-elev); }
.deptcard .num{
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--red-bright);
}
.deptcard h3{ margin: 18px 0 8px; }
.deptcard p{ font-size: 14px; margin-bottom: 0; }
.deptcard .go{
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
}

/* department detail page */
.dept-hero{
  border-bottom: 1px solid var(--line);
  padding: 60px 0;
}
.dept-hero .code{
  font-family: var(--font-mono);
  color: var(--red-bright);
  font-size: 13px;
  margin-bottom: 10px;
}
.dept-hero .stripe{
  width: 60px; height: 3px; background: var(--red);
  margin: 22px 0 0;
}
.rolelist{ border-top: 1px solid var(--line); }
.roleitem{
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
  display:grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
}
.roleitem h4{ font-family: var(--font-body); font-size: 16px; font-weight:600; }
.roleitem p{ margin:0; font-size: 14.5px; }

/* ---------------- staff ---------------- */
.staffgrid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.staffcard{
  background: var(--bg);
  padding: 26px 22px;
}
.staffcard .role{
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--red-bright);
  margin-bottom: 10px;
}
.staffcard h4{ font-family: var(--font-body); font-size: 17px; font-weight:600; margin-bottom:4px; }
.staffcard .handle{ font-family: var(--font-mono); font-size: 12.5px; color: var(--text-faint); }

/* ---------------- forms ---------------- */
.field{ margin-bottom: 20px; }
.field label{
  display:block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-muted);
}
.field .hint{ font-size: 12.5px; color: var(--text-faint); margin-top: 6px; }
input, select, textarea{
  width: 100%;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 11px 13px;
  font-family: var(--font-body);
  font-size: 14.5px;
}
input:focus, select:focus, textarea:focus{
  outline: none;
  border-color: var(--red);
}
textarea{ min-height: 110px; resize: vertical; }
.row2{ display:grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.tabs{ display:flex; gap:0; border-bottom: 1px solid var(--line); margin-bottom: 32px; flex-wrap: wrap; }
.tabs button{
  background:none; border:none; color: var(--text-faint);
  font-family: var(--font-mono); font-size: 13px;
  padding: 12px 18px; cursor:pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs button.active{ color: var(--text); border-bottom-color: var(--red); }

.formcard{
  border: 1px solid var(--line);
  background: var(--bg-elev);
  padding: 32px;
  max-width: 720px;
}

.notice{
  border: 1px solid var(--line);
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.notice.ok{ border-color: #1c4a30; color: var(--ok); }
.notice.err{ border-color: var(--red-dim); color: var(--red-bright); }

/* ---------------- admin ---------------- */
.adminbar{
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev);
}
.adminbar .wrap{ height:60px; display:flex; align-items:center; justify-content:space-between; }
.adminbar .title{ font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); }

.appfilters{ display:flex; gap:8px; margin-bottom: 24px; flex-wrap:wrap; }
.appfilters button{
  background:transparent; border: 1px solid var(--line); color: var(--text-muted);
  font-family: var(--font-mono); font-size: 12.5px; padding: 8px 14px; cursor:pointer;
}
.appfilters button.active{ color: var(--text); border-color: var(--red); }

.apptable{ border: 1px solid var(--line); }
.approw{
  display:grid;
  grid-template-columns: 90px 1fr 150px 130px 150px;
  gap: 12px;
  align-items:center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.approw.head{
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
  background: var(--bg-elev);
}
.approw:last-child{ border-bottom:none; }
.badge{
  display:inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid var(--line);
}
.badge.pending{ color: var(--warn); border-color: #5a441c; }
.badge.approved{ color: var(--ok); border-color: #1c4a30; }
.badge.denied{ color: var(--red-bright); border-color: var(--red-dim); }

.detailpanel{
  border: 1px solid var(--line);
  background: var(--bg-elev);
  padding: 28px;
  margin-top: 24px;
}
.detailpanel dl{ display:grid; grid-template-columns: 160px 1fr; gap: 10px 16px; margin: 0 0 20px; }
.detailpanel dt{ color: var(--text-faint); font-family: var(--font-mono); font-size: 12.5px; }
.detailpanel dd{ margin:0; }

.loginwrap{
  min-height: calc(100vh - 76px);
  display:flex; align-items:center; justify-content:center;
}
.loginbox{
  border: 1px solid var(--line);
  background: var(--bg-elev);
  padding: 40px;
  width: 100%;
  max-width: 380px;
}

/* ---------------- footer ---------------- */
footer.site{
  padding: 40px 0;
}
footer.site .wrap{
  display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap: 16px;
}
footer.site .fbrand{ font-family: var(--font-display); font-size: 20px; }
footer.site .legal{ font-size: 12.5px; color: var(--text-faint); }
footer.site .flinks{ display:flex; gap: 18px; font-size: 13px; color: var(--text-muted); }

/* ---------------- discord cta block ---------------- */
.discordcta{
  border: 1px solid var(--line);
  background: var(--bg-elev);
  padding: 40px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.discordcta h3{ margin-bottom: 6px; }
.discordcta p{ margin:0; }

/* ---------------- utility ---------------- */
.skeleton{ color: var(--text-faint); font-family: var(--font-mono); font-size: 13px; }

/* ---------------- responsive ---------------- */
@media (max-width: 900px){
  .hero .wrap{ grid-template-columns: 1fr; }
  .deptgrid{ grid-template-columns: repeat(2,1fr); }
  .staffgrid{ grid-template-columns: repeat(2,1fr); }
  .roleitem{ grid-template-columns: 1fr; gap: 6px; }
  .approw{ grid-template-columns: 70px 1fr 110px; }
  .approw span.col-date, .approw span.col-dept{ display:none; }
}

@media (max-width: 680px){
  nav.primary{
    position: fixed;
    top: 76px; left:0; right:0; bottom:0;
    background: var(--bg);
    flex-direction: column;
    align-items: stretch;
    padding: 10px 24px;
    display:none;
    overflow-y:auto;
  }
  nav.primary.open{ display:flex; }
  nav.primary a{ padding: 16px 0; border-bottom: 1px solid var(--line-soft); font-size: 17px; }
  .hamburger{ display:flex; }
  .navrow .actions .btn-discord-label{ display:none; }
  .deptgrid{ grid-template-columns: 1fr; }
  .staffgrid{ grid-template-columns: 1fr; }
  .row2{ grid-template-columns: 1fr; }
  .discordcta{ flex-direction: column; align-items:flex-start; }
  .apptable{ overflow-x:auto; }
}
