:root {
  --ink: #11110f;
  --rail: #181816;
  --rail-2: #22221f;
  --paper: #f2f0e9;
  --surface: #faf9f5;
  --line: #d6d2c8;
  --muted: #77756e;
  --green: #b8ef3d;
  --green-dark: #34480c;
  --amber: #ffb44c;
  --red: #e65b4d;
  --white: #fffefa;
  --radius: 6px;
  font-family: "Bahnschrift", "DIN Alternate", "Aptos", sans-serif;
  color: var(--ink);
  background: var(--paper);
  letter-spacing: 0;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--paper); }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 610px) 1fr; background: var(--ink); color: var(--white); }
.login-panel { padding: clamp(32px, 6vw, 76px); display: flex; flex-direction: column; background: var(--rail); border-right: 1px solid #35352f; }
.brand-lockup, .sidebar-brand { display: flex; align-items: center; gap: 14px; }
.brand-lockup strong, .sidebar-brand strong { display: block; font-size: 18px; line-height: 1; }
.brand-lockup small, .sidebar-brand small { display: block; color: #99978e; font-size: 10px; margin-top: 5px; }
.brand-mark { width: 44px; height: 44px; display: grid; grid-template-columns: repeat(4, 1fr); align-items: end; gap: 3px; padding: 7px; border: 1px solid #4b4a43; }
.brand-mark i { display: block; background: var(--green); height: 30%; }
.brand-mark i:nth-child(2) { height: 75%; }.brand-mark i:nth-child(3) { height: 100%; }.brand-mark i:nth-child(4) { height: 55%; }
.brand-mark.compact { width: 36px; height: 36px; padding: 6px; }
.login-copy { margin: auto 0 28px; max-width: 420px; }
.eyebrow { display: block; font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; margin-bottom: 8px; }
.login-copy .eyebrow { color: var(--green); }
.login-copy h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.05; margin: 0 0 18px; font-weight: 620; }
.login-copy p { color: #aaa89f; margin: 0; font-size: 15px; }
.stack-form { display: grid; gap: 16px; max-width: 420px; }
label { color: #3c3b36; font-size: 12px; font-weight: 650; display: grid; gap: 7px; }
.login-panel label { color: #b8b6ad; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 4px; background: var(--white); color: var(--ink); padding: 11px 12px; outline: none; min-height: 42px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #78766e; box-shadow: 0 0 0 3px rgba(184,239,61,.18); }
.login-panel input { border-color: #44443e; background: #22221f; color: var(--white); }
.button { border: 1px solid #bebbb1; border-radius: 4px; padding: 10px 14px; background: var(--surface); color: var(--ink); font-weight: 700; min-height: 40px; }
.button:hover { border-color: #77756e; }
.button.primary { background: var(--green); border-color: var(--green); color: #13170a; }
.button.danger { color: #8d241a; border-color: #e0a9a4; background: #fff3f1; }
.button.small { padding: 6px 9px; min-height: 31px; font-size: 12px; }
.button.full { width: 100%; display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.form-error { min-height: 18px; color: #ff8b7e; margin: 0; font-size: 12px; }
.login-panel footer { margin-top: auto; padding-top: 32px; color: #6f6e68; font-size: 10px; }
.login-status { position: relative; overflow: hidden; padding: 70px; background: #10110e; }
.signal-grid { position: absolute; inset: 0; opacity: .28; background-image: linear-gradient(#363830 1px, transparent 1px), linear-gradient(90deg,#363830 1px,transparent 1px); background-size: 56px 56px; }
.live-chip { position: relative; display: inline-flex; gap: 9px; align-items: center; font-size: 11px; border: 1px solid #4a4c43; padding: 9px 12px; }
.live-chip span, .server-state > span { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(184,239,61,.7); }
.version-stamp { position: absolute; right: 8%; top: 18%; color: #2d2f28; font-size: clamp(120px, 23vw, 300px); font-weight: 800; line-height: .72; }
.version-stamp b { color: #1a1c17; }
.login-status > p { position: absolute; bottom: 8%; left: 8%; color: var(--green); font-size: clamp(28px, 4vw, 62px); font-weight: 700; line-height: .95; }

.app-shell { display: grid; grid-template-columns: 230px minmax(0,1fr); min-height: 100vh; }
.sidebar { background: var(--rail); color: var(--white); padding: 22px 14px 18px; display: flex; flex-direction: column; position: fixed; width: 230px; height: 100vh; z-index: 30; }
.sidebar-brand { padding: 0 8px 28px; border-bottom: 1px solid #34342f; }
#nav { display: grid; gap: 4px; margin-top: 20px; }
#nav button { appearance: none; border: 0; border-left: 3px solid transparent; background: transparent; color: #aaa89f; display: flex; align-items: center; gap: 12px; padding: 11px 12px; text-align: left; border-radius: 2px; }
#nav button:hover { background: #242420; color: var(--white); }
#nav button.active { background: #292a23; color: var(--white); border-left-color: var(--green); }
.nav-icon { width: 17px; color: var(--green); text-align: center; font-size: 16px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid #34342f; padding: 18px 8px 0; display: grid; gap: 15px; }
.server-state { display: flex; align-items: center; gap: 10px; }
.server-state b,.server-state small { display: block; }.server-state b { font-size: 12px; }.server-state small { color: #807f78; font-size: 10px; margin-top: 3px; }
.text-button { border: 0; background: none; color: #9e9c94; padding: 0; text-align: left; font-size: 12px; }
.sidebar-foot > small { color: #5f5e58; font-size: 9px; }
.workspace { grid-column: 2; min-width: 0; }
.topbar { height: 88px; background: var(--surface); border-bottom: 1px solid var(--line); padding: 0 30px; display: flex; align-items: center; gap: 18px; position: sticky; top: 0; z-index: 20; }
.topbar h2 { margin: 0; font-size: 20px; font-weight: 650; }
.topbar .eyebrow { margin-bottom: 4px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 15px; color: var(--muted); font-size: 11px; }
.admin-badge { border: 1px solid var(--line); background: var(--paper); color: var(--ink); padding: 7px 9px; font-weight: 700; }
.icon-button { display: none; border: 1px solid var(--line); background: var(--paper); width: 38px; height: 38px; border-radius: 4px; }
.content { padding: 28px 30px 50px; max-width: 1540px; margin: 0 auto; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.section-head h3 { margin: 0; font-size: 17px; }.section-head p { color: var(--muted); margin: 5px 0 0; font-size: 12px; }

.metric-grid { display: grid; grid-template-columns: repeat(5,minmax(120px,1fr)); border: 1px solid var(--line); background: var(--surface); margin-bottom: 26px; }
.metric { min-height: 122px; padding: 18px; border-right: 1px solid var(--line); position: relative; }
.metric:last-child { border-right: 0; }
.metric small { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.metric strong { display: block; margin-top: 20px; font-size: 30px; font-weight: 600; }
.metric em { position: absolute; width: 7px; height: 7px; background: var(--green); right: 15px; top: 15px; border-radius: 50%; }
.two-column { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(280px,.7fr); gap: 22px; }
.panel { border-top: 3px solid var(--ink); background: var(--surface); min-width: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 15px 16px; border-bottom: 1px solid var(--line); }
.panel-heading h3 { margin: 0; font-size: 13px; text-transform: uppercase; }.panel-heading small { color: var(--muted); }
.release-strips, .activity-list { margin: 0; padding: 0; list-style: none; }
.release-strip, .activity-list li { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.release-strip:last-child, .activity-list li:last-child { border-bottom: 0; }
.release-strip strong { font-size: 15px; }.release-strip time, .activity-list time { margin-left: auto; color: var(--muted); font-size: 10px; white-space: nowrap; }
.activity-list b { display: block; font-size: 12px; }.activity-list span { color: var(--muted); font-size: 11px; }
.channel { display: inline-flex; align-items: center; min-width: 48px; justify-content: center; padding: 4px 7px; border-radius: 2px; font-size: 9px; font-weight: 800; text-transform: uppercase; background: #e4e1d8; color: #4f4e48; }
.channel.beta { background: #ffe0b8; color: #6a3d00; }
.status { display: inline-flex; gap: 6px; align-items: center; font-size: 11px; font-weight: 700; }
.status::before { content:""; width: 7px; height: 7px; border-radius: 50%; background: var(--green-dark); }
.status.revoked::before,.status.disabled::before,.status.suspended::before { background: var(--red); }
.status.draft::before { background: var(--amber); }

.table-shell { background: var(--surface); border: 1px solid var(--line); overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { background: #e8e5dc; color: #66645d; font-size: 9px; text-transform: uppercase; text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--line); }
td { padding: 13px; border-bottom: 1px solid #e2ded5; font-size: 12px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; } tbody tr:hover { background: #f6f4ed; }
.mono { font-family: "Cascadia Mono","Consolas",monospace; font-size: 11px; }
.muted { color: var(--muted); }.strong { font-weight: 700; }
.actions { display: flex; gap: 7px; justify-content: flex-end; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(11,11,9,.7); display: grid; place-items: center; padding: 20px; }
.modal { width: min(620px,100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border-top: 5px solid var(--green); box-shadow: 0 24px 80px rgba(0,0,0,.35); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }.modal-close { border: 0; background: transparent; font-size: 24px; color: var(--muted); }
.modal-body { padding: 20px; display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }.form-grid .wide { grid-column: 1 / -1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 20px; border-top: 1px solid var(--line); }
.segmented { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 4px; padding: 3px; }
.segmented button { border: 0; background: transparent; padding: 8px; border-radius: 3px; color: var(--muted); }
.segmented button.active { background: var(--ink); color: var(--white); }
.check-row { display: flex; align-items: center; gap: 9px; font-size: 12px; }.check-row input { width: 17px; min-height: 17px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; background: var(--ink); color: var(--white); border-left: 4px solid var(--green); padding: 13px 16px; min-width: 240px; max-width: 380px; transform: translateY(140%); transition: transform .22s ease; font-size: 12px; }
.toast.show { transform: translateY(0); }.toast.error { border-left-color: var(--red); }
.key-cell { display:flex; gap:7px; align-items:center; }.copy-button { border:0;background:#e8e5dc;padding:5px 7px;border-radius:3px; }
.loading-line { height: 3px; background: var(--green); animation: load 1s infinite alternate; }
@keyframes load { from { width: 12%; } to { width: 100%; } }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(3,1fr); }.metric:nth-child(3) { border-right:0; }.metric:nth-child(n+4) { border-top:1px solid var(--line); }
  .two-column { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .login-shell { grid-template-columns: 1fr; }.login-status { display:none; }.login-panel { min-height:100vh; padding:30px 24px; }
  .app-shell { grid-template-columns:1fr; }.workspace { grid-column:1; }
  .sidebar { transform:translateX(-100%); transition:transform .2s ease; box-shadow:10px 0 40px rgba(0,0,0,.3); }.sidebar.open { transform:translateX(0); }
  .icon-button { display:block; }.topbar { height:76px; padding:0 16px; }.top-actions #clock { display:none; }.content { padding:20px 14px 40px; }
  .metric-grid { grid-template-columns:repeat(2,1fr); }.metric { border-right:1px solid var(--line) !important; border-top:1px solid var(--line); }.metric:nth-child(1),.metric:nth-child(2){border-top:0}.metric:nth-child(even){border-right:0!important}
  .form-grid { grid-template-columns:1fr; }.form-grid .wide { grid-column:auto; }.section-head { align-items:flex-start; flex-direction:column; }
}

