:root {
  --bg: #F4F6F8; --card: #FFFFFF; --line: #E5E7EB; --text: #111827; --muted: #4B5563;
  --navy: #0E1A2B; --navy-2: #1B2A40; --brand: #0F766E; --brand-dark: #115E59; --mint: #14B8A6;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 Inter, "Segoe UI", system-ui, sans-serif; }
a { color: var(--brand); } a:hover { color: var(--brand-dark); }
h1 { font-size: 28px; margin: 8px 0 4px; } h2 { font-size: 19px; margin: 0 0 14px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .strong { font-weight: 600; text-decoration: none; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 220px; max-width: 250px; background: var(--navy); color: #E5E7EB; padding: 24px 14px; display: flex; flex-direction: column; gap: 4px; }
.side a { color: #CBD5E1; text-decoration: none; padding: 11px 12px; border-radius: 8px; }
.side a.active { background: var(--navy-2); color: #fff; font-weight: 600; }
.side .logout { margin-top: auto; }
.link-button { background: none; border: 0; color: #CBD5E1; font: inherit; padding: 11px 12px; cursor: pointer; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--mint); color: var(--navy); display: grid; place-items: center; font-weight: 700; }
.brand-text { display: flex; flex-direction: column; color: #fff; } .brand-text small { color: #9CA3AF; }
.brand-text.dark { color: var(--text); } .brand-text.dark small { color: var(--muted); }
.content { flex: 999 1 560px; min-width: 0; padding: 28px 40px; display: flex; flex-direction: column; gap: 20px; }

.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.key { margin: 0; font-size: 15px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.search input { height: 44px; min-width: 260px; border: 1px solid #D1D5DB; border-radius: 8px; padding: 0 12px; font: inherit; }

.btn { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid #D1D5DB; background: #fff; color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-danger { color: #B91C1C; border-color: #FCA5A5; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; display: flex; flex-direction: column; }
.stat span { color: var(--muted); font-size: 13px; } .stat strong { font-size: 28px; }
.stat-warn { background: #FFFBEB; border-color: #FCD34D; } .stat-warn span, .stat-warn strong { color: #92400E; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pad { padding: 22px 24px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pill { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid #D1D5DB; color: #374151; text-decoration: none; font-size: 13px; }
.pill-on { border-color: var(--brand); background: #F0FDFA; color: var(--brand-dark); font-weight: 600; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 880px; }
th { text-align: left; background: #F9FAFB; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 12px 16px; }
td { padding: 13px 16px; border-top: 1px solid var(--line); vertical-align: top; }

.badge { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-ok { background: #DCFCE7; color: #166534; } .badge-info { background: #DBEAFE; color: #1E40AF; }
.badge-warn { background: #FEF3C7; color: #92400E; } .badge-bad { background: #FEE2E2; color: #991B1B; }
.badge-idle { background: #F3F4F6; color: #374151; }

.alert { margin: 0; padding: 12px 16px; border-radius: 10px; border: 1px solid; }
.alert-ok { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.alert-info { background: #EFF6FF; border-color: #BFDBFE; color: #1E3A8A; }
.alert-error { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }

label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 14px; }
label.inline, .features label { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; min-height: 32px; }
input, select, textarea { font: inherit; border: 1px solid #D1D5DB; border-radius: 8px; padding: 10px 12px; background: #fff; }
input[type=checkbox] { width: 18px; height: 18px; }
textarea { width: 100%; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.features { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 18px 0 8px; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 16px; }
.validation-message { color: #B91C1C; font-size: 13px; font-weight: 400; }

.two-col { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.grow { flex: 2 1 480px; min-width: 0; }
.side-col { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 16px; font-size: 14px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; font-weight: 500; }
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.history li { display: flex; flex-direction: column; padding-left: 12px; border-left: 2px solid #CBD5E1; font-size: 14px; }

.bare { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
