/* Sniper Signals — professional light control panel */
:root {
  --bg: #f3f5f8;
  --bg-accent: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.12);
  --accent: #0f766e;
  --accent-2: #115e59;
  --accent-soft: rgba(15, 118, 110, 0.1);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.08);
  --ok: #059669;
  --ok-soft: rgba(5, 150, 105, 0.1);
  --warn: #d97706;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06), 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.1), 0 8px 20px rgba(15, 23, 42, 0.05);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar-w: 268px;
  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(900px 520px at -10% -20%, rgba(15, 118, 110, 0.08), transparent 55%),
    radial-gradient(700px 420px at 110% 0%, rgba(14, 165, 233, 0.07), transparent 50%),
    radial-gradient(600px 400px at 80% 100%, rgba(15, 23, 42, 0.04), transparent 45%),
    linear-gradient(180deg, #f7f9fc 0%, var(--bg) 40%, #eef2f6 100%);
  background-attachment: fixed;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(248,250,252,0.88));
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--border);
  box-shadow: 8px 0 40px rgba(15, 23, 42, 0.03);
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 20;
  animation: slideInLeft 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 16px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  color: #fff;
  background: linear-gradient(145deg, #0f766e 0%, #0e7490 55%, #155e75 100%);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.28), inset 0 1px 0 rgba(255,255,255,0.25);
  transform: perspective(400px) rotateY(-8deg);
  transition: transform 0.35s ease;
}
.brand:hover .brand-mark { transform: perspective(400px) rotateY(0deg) translateY(-2px); }
.brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.brand p {
  margin: 2px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.nav-list { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.nav-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 550;
  font-size: 0.94rem;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.nav-list a:hover {
  background: var(--surface);
  color: var(--text);
  transform: translateX(3px);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.nav-list a.active {
  background: linear-gradient(135deg, var(--accent-soft), rgba(14, 165, 233, 0.08));
  color: var(--accent-2);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.15);
}
.nav-ico {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  font-size: 0.85rem;
  box-shadow: inset 0 0 0 1px var(--border);
}

.sidebar-footer {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.sidebar-footer .meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 10px; word-break: break-all; }
.sidebar-footer form { margin: 0; }

.main {
  padding: 28px 32px 48px;
  animation: fadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.main-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}
.main-header .sub { margin: 6px 0 0; color: var(--muted); font-size: 0.95rem; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat, .panel {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-md);
  transform: translateZ(0);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}
.stat:hover, .panel:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.stat .label { color: var(--muted); font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.stat .value {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, #0f172a, #0f766e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.panel { margin-bottom: 16px; }
.panel h2, .panel h3 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.row:last-child { border-bottom: 0; }
.muted { color: var(--muted); }
.ok { color: var(--ok); font-weight: 600; }

.flash {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.92rem;
  animation: fadeUp 0.4s ease;
}
.flash.ok { background: var(--ok-soft); border: 1px solid rgba(5,150,105,0.2); color: #047857; }
.flash.err { background: var(--danger-soft); border: 1px solid rgba(220,38,38,0.18); color: #b91c1c; }

label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 6px;
  font-weight: 600;
}
input, textarea, select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  margin-bottom: 14px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  background: #fff;
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}
textarea { min-height: 90px; resize: vertical; }

.btn, button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 650;
  font-size: 0.9rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none;
}
.btn:hover, button.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.btn.primary, button.btn.primary {
  background: linear-gradient(145deg, #0f766e, #0e7490);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.25);
}
.btn.primary:hover, button.btn.primary:hover {
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.32);
}
.btn.danger { border-color: rgba(220,38,38,0.25); color: #b91c1c; background: #fff5f5; }
form.inline { display: inline; margin: 0; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.pill {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-2);
}
.pill.warn { background: rgba(217,119,6,0.12); color: #b45309; }
.pill.ok { background: var(--ok-soft); color: #047857; }

.runbook ol { padding-left: 18px; color: var(--text); }
.runbook li { margin: 8px 0; line-height: 1.45; }
.runbook code {
  background: var(--bg-accent);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.85em;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .main { padding: 20px 16px 40px; }
}
