/* Northwoods UCP — unified interface layer */
:root {
  --bg: #080d17 !important;
  --panel: #111927 !important;
  --sidebar: #0b1220 !important;
  --sidebar2: #0b1220 !important;
  --accent: #4ee6c1 !important;
  --accent2: #ff826c !important;
  --text: #edf5f3 !important;
  --muted: #8e9daf !important;
  --border: rgba(151, 173, 192, .14) !important;
  --shadow: rgba(0, 0, 0, .3) !important;
  --ucp-cyan: #4ee6c1;
  --ucp-coral: #ff826c;
  --ucp-ink: #080d17;
  --ucp-surface: #111927;
  --ucp-surface-2: #172233;
  --ucp-line: rgba(151, 173, 192, .14);
  --ucp-muted: #8e9daf;
}

* { box-sizing: border-box; }
html { background: var(--ucp-ink); scroll-behavior: smooth; }
body {
  min-height: 100vh;
  color: var(--text) !important;
  font-family: Inter, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif !important;
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    radial-gradient(circle at 86% 8%, rgba(78,230,193,.12), transparent 28rem),
    radial-gradient(circle at 18% 92%, rgba(255,130,108,.08), transparent 30rem),
    var(--ucp-ink) !important;
  background-size: 48px 48px, 48px 48px, auto, auto, auto !important;
}

::selection { color: #07110f; background: var(--ucp-cyan); }
a, button, input, select, textarea { transition: border-color .2s, background .2s, color .2s, transform .2s, box-shadow .2s !important; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--ucp-cyan) !important;
  outline-offset: 3px;
}

.layout { min-height: 100vh; align-items: stretch; }
.sidebar {
  position: sticky !important;
  top: 0;
  z-index: 20;
  width: 272px !important;
  height: 100vh;
  flex: 0 0 272px;
  overflow-y: auto;
  padding: 24px 18px !important;
  background: rgba(8, 14, 25, .94) !important;
  border: 0 !important;
  border-right: 1px solid var(--ucp-line) !important;
  box-shadow: 20px 0 60px rgba(0,0,0,.14);
  scrollbar-width: thin;
  scrollbar-color: rgba(78,230,193,.3) transparent;
}

.brand {
  align-items: flex-start !important;
  flex-direction: row !important;
  text-align: left !important;
  gap: 13px !important;
  margin: 0 0 26px !important;
  padding: 0 4px 22px !important;
  border-bottom: 1px solid var(--ucp-line) !important;
}
.brand-badge {
  width: 50px !important;
  height: 50px !important;
  flex: 0 0 50px;
  border-radius: 14px !important;
  border: 1px solid rgba(78,230,193,.35) !important;
  box-shadow: 0 0 0 4px rgba(78,230,193,.06), 0 12px 30px rgba(0,0,0,.35) !important;
}
.brand h1 { margin: 3px 0 3px !important; color: #fff; font-size: 13px !important; line-height: 1.25; letter-spacing: .02em !important; }
.brand p { margin: 0 !important; color: var(--ucp-cyan) !important; font: 700 10px/1.2 inherit !important; letter-spacing: .13em; text-transform: uppercase; }

.nav { gap: 5px !important; padding: 0 !important; }
.nav::before {
  content: "Workspace";
  display: block;
  padding: 0 12px 8px;
  color: #637286;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.nav a, .nav button {
  min-height: 44px;
  padding: 10px 12px !important;
  color: #aab8c7 !important;
  font-size: 13px !important;
  font-weight: 650 !important;
  text-align: left;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 11px !important;
}
.nav a:hover, .nav button:hover { color: #fff !important; background: rgba(255,255,255,.045) !important; transform: translateX(2px); }
.nav a.active {
  color: #06120f !important;
  background: var(--ucp-cyan) !important;
  border-color: var(--ucp-cyan) !important;
  box-shadow: 0 10px 28px rgba(78,230,193,.16);
}
.nav .left { gap: 11px !important; }
.nav .dot {
  width: 6px !important;
  height: 6px !important;
  background: currentColor !important;
  box-shadow: 0 0 0 4px rgba(142,157,175,.08) !important;
}
.nav a.active .dot { background: #06120f !important; box-shadow: 0 0 0 4px rgba(6,18,15,.1) !important; }
.chev { color: currentColor; font-size: 15px; opacity: .55 !important; }
.subnav {
  margin: 2px 0 6px 20px !important;
  padding: 3px 0 3px 9px !important;
  border-left: 1px solid rgba(78,230,193,.22) !important;
}
.subnav a { min-height: 36px; padding: 8px 11px !important; font-size: 12px !important; background: transparent !important; }
.logout {
  display: flex !important;
  align-items: center;
  justify-content: center;
  margin-top: 18px !important;
  padding: 10px 12px !important;
  color: #ff9c8b !important;
  font-size: 12px;
  background: rgba(255,130,108,.07) !important;
  border: 1px solid rgba(255,130,108,.18) !important;
  border-radius: 10px !important;
}
.logout:hover { color: #fff !important; background: rgba(255,130,108,.14) !important; }
.sidebar-footer { margin-top: 14px !important; padding: 14px 5px 0 !important; color: #657488 !important; border-color: var(--ucp-line) !important; font-size: 11px !important; line-height: 1.6; }
.sidebar-footer strong { color: #c8d5df; }

.main {
  width: calc(100% - 272px);
  max-width: 1500px;
  padding: 38px clamp(22px, 4vw, 64px) 60px !important;
  gap: 20px !important;
}
.main::before {
  content: "NORTHWOODS / CONTROL PANEL";
  display: block;
  color: var(--ucp-cyan);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .2em;
  margin-bottom: -10px;
}
.topbar {
  position: relative;
  min-height: 126px;
  padding: 26px 28px !important;
  overflow: hidden;
  background: linear-gradient(120deg, rgba(23,34,51,.98), rgba(15,24,37,.95)) !important;
  border: 1px solid var(--ucp-line) !important;
  border-radius: 20px !important;
  box-shadow: 0 24px 60px rgba(0,0,0,.2) !important;
  backdrop-filter: blur(18px) !important;
}
.topbar::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -45px;
  top: -80px;
  border: 36px solid rgba(78,230,193,.07);
  border-radius: 50%;
  pointer-events: none;
}
.welcome { color: #fff !important; font-size: clamp(22px, 3vw, 34px) !important; font-weight: 720 !important; letter-spacing: -.035em !important; }
.welcome small { max-width: 650px; margin-top: 8px !important; color: var(--ucp-muted) !important; font-size: 13px !important; line-height: 1.5; font-weight: 500 !important; letter-spacing: 0; }
.pill {
  position: relative;
  z-index: 1;
  padding: 8px 11px !important;
  color: #9ff3df !important;
  background: rgba(78,230,193,.07) !important;
  border: 1px solid rgba(78,230,193,.18) !important;
  border-radius: 9px !important;
  font-size: 10px !important;
  letter-spacing: .08em;
}
.pill .dot { width: 6px !important; height: 6px !important; background: var(--ucp-cyan) !important; box-shadow: 0 0 10px var(--ucp-cyan) !important; }

.grid { gap: 16px !important; }
.card, .panel, .stat, .request-card, .ticket, .box {
  color: var(--text) !important;
  background: linear-gradient(145deg, rgba(18,28,43,.96), rgba(13,21,33,.96)) !important;
  border: 1px solid var(--ucp-line) !important;
  border-radius: 16px !important;
  box-shadow: 0 18px 45px rgba(0,0,0,.16) !important;
  backdrop-filter: blur(12px) !important;
}
.card, .panel { padding: 22px !important; }
.card:hover { border-color: rgba(78,230,193,.28) !important; transform: translateY(-2px); }
.card h2, .card h3, .panel h2, .panel h3, .panel-head h3 { color: #f5faf9 !important; font-size: 13px !important; letter-spacing: .04em !important; }
.card p, .panel p, .muted, .meta, .hint { color: var(--ucp-muted) !important; }
.card .badge, .badge, .tag {
  color: #a7f4e1 !important;
  background: rgba(78,230,193,.07) !important;
  border: 1px solid rgba(78,230,193,.15) !important;
  border-radius: 8px !important;
}

.btn, button.btn, input[type="submit"] {
  min-height: 40px;
  padding: 10px 15px !important;
  color: #06120f !important;
  background: var(--ucp-cyan) !important;
  border: 1px solid var(--ucp-cyan) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  font-weight: 750 !important;
  font-size: 12px !important;
}
.btn:hover, button.btn:hover, input[type="submit"]:hover { background: #75efd1 !important; border-color: #75efd1 !important; transform: translateY(-1px); }
.btn-secondary, .btn.ghost, .ghost {
  color: #c5d0da !important;
  background: rgba(255,255,255,.035) !important;
  border-color: var(--ucp-line) !important;
}
.btn-secondary:hover, .btn.ghost:hover { color: #fff !important; background: rgba(255,255,255,.07) !important; }
.btn.warn, .warn { color: #ffc1b6 !important; background: rgba(255,130,108,.08) !important; border-color: rgba(255,130,108,.22) !important; }

.field { gap: 8px !important; }
.field label, label { color: #c7d2dc !important; letter-spacing: .02em; }
.field input, .field select, .field textarea, .input, input, select, textarea {
  color: #edf5f3 !important;
  caret-color: var(--ucp-cyan);
  background: #0b1320 !important;
  border: 1px solid rgba(151,173,192,.18) !important;
  border-radius: 10px !important;
}
.field input, .field select, .field textarea { padding: 12px 13px !important; }
input::placeholder, textarea::placeholder { color: #536276 !important; }
input:focus, select:focus, textarea:focus { border-color: rgba(78,230,193,.65) !important; box-shadow: 0 0 0 4px rgba(78,230,193,.07) !important; outline: none; }
select option { color: #edf5f3; background: #101928; }

.table-wrap, .tablewrap {
  position: relative;
  width: 100%;
  overflow-x: auto !important;
  color: #dfe8ea;
  background: #0c1421 !important;
  border: 1px solid var(--ucp-line) !important;
  border-radius: 14px !important;
  box-shadow: inset 0 1px rgba(255,255,255,.02), 0 14px 35px rgba(0,0,0,.12);
  scrollbar-width: thin;
  scrollbar-color: rgba(78,230,193,.25) #0c1421;
}
.table-wrap table, .tablewrap table, table {
  width: 100%;
  color: #dfe8ea !important;
  background: transparent !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}
.table-wrap thead, .tablewrap thead { background: #111c2b !important; }
.table-wrap th, .tablewrap th, th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 13px 15px !important;
  color: #7f91a6 !important;
  background: #111c2b !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(151,173,192,.18) !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  line-height: 1.3;
  letter-spacing: .11em !important;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.table-wrap td, .tablewrap td, td {
  padding: 15px !important;
  color: #cbd6df !important;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(151,173,192,.09) !important;
  font-size: 12px !important;
  line-height: 1.45;
  vertical-align: middle !important;
}
.table-wrap tbody tr:last-child td, .tablewrap tbody tr:last-child td { border-bottom: 0 !important; }
.table-wrap tbody tr:nth-child(even), .tablewrap tbody tr:nth-child(even) { background: rgba(255,255,255,.012); }
.table-wrap tbody tr:hover, .tablewrap tbody tr:hover { background: rgba(78,230,193,.045) !important; }
.table-wrap td:first-child, .tablewrap td:first-child { color: #fff !important; font-weight: 750; }
.table-wrap .muted, .tablewrap .muted { padding: 28px 15px !important; color: #65758a !important; text-align: center; }
.table-wrap .actions, .tablewrap .actions { gap: 6px !important; flex-wrap: nowrap !important; }
.table-wrap .btn, .tablewrap .btn { min-height: 34px; padding: 7px 10px !important; }
.table-wrap .status, .tablewrap .status {
  display: inline-flex !important;
  align-items: center;
  gap: 7px !important;
  padding: 6px 9px !important;
  color: #a7f4e1 !important;
  background: rgba(78,230,193,.07) !important;
  border: 1px solid rgba(78,230,193,.16) !important;
  border-radius: 8px !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: .06em !important;
  text-transform: uppercase;
  white-space: nowrap;
}
.table-wrap .status .s-dot, .tablewrap .status .s-dot {
  width: 6px !important;
  height: 6px !important;
  background: var(--ucp-cyan) !important;
  box-shadow: 0 0 8px rgba(78,230,193,.7) !important;
}
.alert { color: #dce7ea !important; background: rgba(255,255,255,.035) !important; border-color: var(--ucp-line) !important; border-radius: 12px !important; }
.alert-error { color: #ffc1b6 !important; background: rgba(255,130,108,.07) !important; border-color: rgba(255,130,108,.2) !important; }
.alert-ok { color: #a7f4e1 !important; background: rgba(78,230,193,.07) !important; border-color: rgba(78,230,193,.18) !important; }
.modal-backdrop { background: rgba(2,6,12,.78) !important; backdrop-filter: blur(8px); }
.modal { color: var(--text) !important; background: #111927 !important; border-color: var(--ucp-line) !important; border-radius: 18px !important; }
.modal p { color: var(--ucp-muted) !important; }

.ucp-menu { display: none; }
@media (max-width: 900px) {
  .layout { display: block !important; }
  .sidebar {
    display: block !important;
    position: fixed !important;
    left: 0;
    transform: translateX(-102%);
    transition: transform .25s ease !important;
    width: min(300px, 88vw) !important;
    height: 100dvh;
    box-shadow: 24px 0 70px rgba(0,0,0,.5);
  }
  body.ucp-nav-open .sidebar { transform: translateX(0); }
  body.ucp-nav-open::after { content: ""; position: fixed; inset: 0; z-index: 15; background: rgba(0,0,0,.6); backdrop-filter: blur(3px); }
  .main { width: 100%; padding: 24px 18px 45px !important; }
  .main::before { padding-left: 48px; min-height: 34px; display: flex; align-items: center; }
  .ucp-menu {
    display: grid;
    place-items: center;
    position: fixed;
    z-index: 30;
    top: 22px;
    left: 18px;
    width: 36px;
    height: 36px;
    color: var(--ucp-cyan);
    background: #111927;
    border: 1px solid var(--ucp-line);
    border-radius: 9px;
    cursor: pointer;
  }
  .topbar { align-items: flex-start !important; min-height: 150px; }
  .grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 600px) {
  .topbar { flex-direction: column; padding: 22px !important; }
  .welcome { font-size: 25px !important; }
  .card, .panel { padding: 17px !important; }
  .form { grid-template-columns: 1fr !important; }
  .span-2 { grid-column: auto !important; }
  .actions { width: 100%; }
  .actions .btn { flex: 1 1 auto; }
  .table-wrap, .tablewrap { overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Authentication and small standalone states */
body:has(.login-card), body:has(> .card:only-child) {
  display: grid !important;
  place-items: center;
  padding: 24px !important;
  background:
    linear-gradient(90deg, rgba(8,13,23,.94) 0%, rgba(8,13,23,.76) 56%, rgba(8,13,23,.45)),
    url("../img/login-bg.png") center/cover fixed !important;
}
body:has(.login-card)::before, body:has(> .card:only-child)::before {
  content: "NORTHWOODS COUNTY\A ACCESS TERMINAL";
  white-space: pre;
  position: fixed;
  top: 34px;
  left: 38px;
  z-index: 3;
  color: rgba(255,255,255,.75);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.7;
  letter-spacing: .2em;
}
.login-card, body > .card:only-child {
  width: min(100%, 430px) !important;
  margin-left: min(34vw, 470px);
  padding: 34px !important;
  text-align: left !important;
  color: var(--text) !important;
  background: rgba(12,20,32,.94) !important;
  border: 1px solid rgba(151,173,192,.18) !important;
  border-radius: 20px !important;
  box-shadow: 0 35px 100px rgba(0,0,0,.45) !important;
  backdrop-filter: blur(20px) !important;
}
.login-card .logo { width: 72px !important; height: 72px !important; margin: 0 0 25px !important; border-radius: 18px !important; border-color: rgba(78,230,193,.3) !important; box-shadow: 0 0 0 6px rgba(78,230,193,.05), 0 20px 45px rgba(0,0,0,.4) !important; }
.login-card h1, body > .card:only-child h1 { margin: 0 0 8px !important; color: #fff !important; font-size: 27px !important; letter-spacing: -.035em !important; }
.login-card .subtitle, body > .card:only-child p { color: var(--ucp-muted) !important; font-weight: 500 !important; }
.discord-btn { margin-top: 10px; min-height: 48px; color: #07110f !important; background: var(--ucp-cyan) !important; border: 1px solid var(--ucp-cyan); border-radius: 11px !important; box-shadow: 0 15px 35px rgba(78,230,193,.15) !important; }
.discord-btn:hover { color: #07110f !important; background: #75efd1 !important; box-shadow: 0 18px 40px rgba(78,230,193,.22) !important; }
.discord-btn svg { fill: currentColor !important; }
.login-card .footer, body > .card:only-child .footer { padding-top: 18px; color: #6e7e91 !important; border-top: 1px solid var(--ucp-line); line-height: 1.7; }
.login-card .footer strong { color: #aab8c7 !important; }
@media (max-width: 820px) {
  .login-card, body > .card:only-child { margin-left: 0; }
  body:has(.login-card)::before, body:has(> .card:only-child)::before { position: absolute; top: 22px; left: 24px; }
}
