/* ============================
   LIVE.CØDE — CMS Admin CSS
   Dark mode, premium admin UI
   ============================ */

:root {
  --bg:         #111110;
  --bg2:        #18171a;
  --bg3:        #1f1e22;
  --bg4:        #27262b;
  --border:     #2e2c33;
  --border2:    #38353f;
  --text:       #f0ebe0;
  --text2:      #a89f8e;
  --text3:      #6b6057;
  --cr:         #e03c3c;
  --cr-dim:     rgba(224,60,60,0.15);
  --cr-border:  rgba(224,60,60,0.3);
  --sg:         #3fa35a;
  --sg-dim:     rgba(63,163,90,0.12);
  --am:         #d4843a;
  --am-dim:     rgba(212,132,58,0.12);
  --pu:         #8a6fd4;
  --pu-dim:     rgba(138,111,212,0.12);
  --accent:     #e03c3c;
  --sidebar-w:  240px;
  --topbar-h:   56px;
  --radius:     6px;
  --radius-sm:  4px;
  --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
  --shadow:     0 4px 20px rgba(0,0,0,0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body { background: var(--bg); color: var(--text); font-family: 'DM Mono', monospace; font-size: 13px; -webkit-font-smoothing: antialiased; }

/* ============================
   LOGIN
   ============================ */
#login-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-box {
  width: 380px; padding: 48px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.login-logo {
  display: flex; align-items: center; gap: 12px; margin-bottom: 32px;
}
.logo-oslash {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px; color: var(--cr); line-height: 1;
}
.logo-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text);
}
.login-label {
  font-size: 10px; letter-spacing: 0.15em; color: var(--text3);
  text-transform: uppercase; margin-bottom: 28px;
}
.login-error {
  font-size: 11px; color: var(--cr); text-align: center; min-height: 16px;
  margin-top: 12px; transition: opacity 200ms ease;
}

/* ============================
   FORMS — SHARED
   ============================ */
.field-wrap { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text3);
}
.field-input {
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); padding: 10px 14px; font-family: 'DM Mono', monospace; font-size: 13px;
  outline: none; width: 100%; transition: border-color 150ms ease;
}
.field-input:focus { border-color: var(--cr); }
.field-input::placeholder { color: var(--text3); }
select.field-input { cursor: pointer; }
textarea.field-input { resize: vertical; min-height: 80px; }

.field-row { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.field-row .field-wrap.flex-1 { flex: 1 1 120px; }
.field-row .field-wrap.flex-2 { flex: 2 1 180px; }
.field-row .field-wrap.w-auto { flex-shrink: 0; }

.form-grid { display: flex; flex-direction: column; gap: 16px; }

/* ============================
   BUTTONS
   ============================ */
.btn-primary {
  font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; background: var(--cr); color: #fff;
  border: none; border-radius: var(--radius-sm); padding: 11px 24px;
  cursor: pointer; transition: background 150ms ease, transform 150ms ease;
  white-space: nowrap;
}
.btn-primary:hover { background: #c42e2e; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary.sm { padding: 8px 16px; font-size: 10px; }
.btn-primary.full { width: 100%; text-align: center; }
.btn-secondary {
  font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; background: var(--bg3); color: var(--text2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 18px; cursor: pointer; transition: all 150ms ease;
}
.btn-secondary:hover { border-color: var(--border2); color: var(--text); }
.btn-ghost {
  font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; background: transparent; color: var(--text3);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 16px; cursor: pointer; transition: all 150ms ease;
}
.btn-ghost.sm { padding: 6px 12px; font-size: 9px; }
.btn-ghost:hover { border-color: var(--border2); color: var(--text2); }
.btn-danger {
  font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; background: transparent; color: var(--cr);
  border: 1px solid var(--cr-border); border-radius: var(--radius-sm);
  padding: 9px 18px; cursor: pointer; transition: all 150ms ease;
}
.btn-danger.full { width: 100%; text-align: center; }
.btn-danger:hover { background: var(--cr-dim); }
.btn-tiny {
  font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text3); background: transparent;
  border: 1px solid var(--border); border-radius: 3px; padding: 4px 10px;
  cursor: pointer; transition: all 150ms ease;
}
.btn-tiny:hover { border-color: var(--accent); color: var(--accent); }
.btn-logout {
  font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text3); background: transparent;
  border: none; cursor: pointer; width: 100%; text-align: left;
  padding: 6px 0; transition: color 150ms ease;
}
.btn-logout:hover { color: var(--cr); }

/* ============================
   TOGGLE
   ============================ */
.toggle { position: relative; display: inline-block; width: 36px; height: 20px; cursor: pointer; }
.toggle input { display: none; }
.toggle-track {
  position: absolute; inset: 0; background: var(--bg4);
  border-radius: 10px; border: 1px solid var(--border);
  transition: background 200ms ease;
}
.toggle input:checked + .toggle-track { background: var(--sg); border-color: var(--sg); }
.toggle-track::after {
  content: ''; position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--text3); transition: transform 200ms ease, background 200ms ease;
}
.toggle input:checked + .toggle-track::after { transform: translateX(16px); background: #fff; }
.toggle-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text2);
}
.toggle-row:last-of-type { border-bottom: none; }

/* ============================
   ADMIN SHELL
   ============================ */
#admin-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
}

/* ============================
   SIDEBAR
   ============================ */
.sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  height: 100vh; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-header { padding: 20px 20px 16px; border-bottom: 1px solid var(--border); }
.sidebar-logo { display: flex; align-items: center; gap: 12px; }
.sidebar-oslash {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px; color: var(--cr); line-height: 1; flex-shrink: 0;
}
.sidebar-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text); display: block;
}
.sidebar-system { font-size: 9px; color: var(--text3); letter-spacing: 0.1em; text-transform: uppercase; }

.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-group { margin-bottom: 4px; }
.nav-group-label {
  font-size: 8px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--text3); padding: 12px 16px 4px; display: block;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; color: var(--text3);
  text-decoration: none; font-size: 12px; letter-spacing: 0.04em;
  border-left: 2px solid transparent;
  transition: all 150ms ease; cursor: pointer;
  border-radius: 0;
}
.nav-link:hover { color: var(--text2); background: var(--bg3); }
.nav-link.active { color: var(--text); border-left-color: var(--cr); background: var(--bg3); }
.nav-icon { font-size: 14px; width: 16px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--cr-dim); border: 1px solid var(--cr-border);
  color: var(--cr); display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; flex-shrink: 0;
}
.user-name { font-size: 12px; color: var(--text); display: block; }
.user-role { font-size: 9px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.08em; }
.sidebar-view-site {
  font-size: 10px; letter-spacing: 0.1em; color: var(--text3);
  text-decoration: none; text-transform: uppercase; transition: color 150ms ease;
}
.sidebar-view-site:hover { color: var(--cr); }

/* ============================
   TOP BAR
   ============================ */
.admin-main { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.topbar {
  height: var(--topbar-h); display: flex; align-items: center;
  justify-content: space-between; padding: 0 28px;
  border-bottom: 1px solid var(--border); background: var(--bg2);
  flex-shrink: 0;
}
.topbar-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px; font-weight: 300; color: var(--text); letter-spacing: 0.02em;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--sg); box-shadow: 0 0 6px var(--sg);
  animation: pulse 2s ease infinite;
}
.status-dot.error { background: var(--cr); box-shadow: 0 0 6px var(--cr); animation: none; }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.4;} }

/* ============================
   TOAST
   ============================ */
.toast {
  position: fixed; top: 64px; right: 24px; z-index: 9998;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 20px;
  font-size: 12px; color: var(--text2); letter-spacing: 0.04em;
  opacity: 0; transform: translateY(-8px);
  transition: opacity 250ms ease, transform 250ms var(--ease-out);
  pointer-events: none; min-width: 200px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-color: var(--sg); color: var(--sg); }
.toast.error   { border-color: var(--cr); color: var(--cr); }

/* ============================
   VIEWS
   ============================ */
.view-container { flex: 1; overflow-y: auto; padding: 24px 28px; }
.view { display: none; animation: fade-in 250ms var(--ease-out); }
.view.active { display: block; }
@keyframes fade-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
.view-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.view-description { font-size: 12px; color: var(--text3); margin-bottom: 20px; }

/* ── REGISTRY HUD & SIDEBAR PULSE ─────────────────── */
.registry-hud {
  margin: 16px;
  padding: 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.hud-label {
  font-family: 'DM Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--text3);
  margin-bottom: 10px;
  text-transform: uppercase;
}
.sync-indicator {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--text3);
}
.sync-indicator.connected { color: var(--cr); }
.pulse-dot {
  width: 6px; height: 6px;
  background: #333;
  border-radius: 50%;
}
.connected .pulse-dot {
  background: var(--cr);
  box-shadow: 0 0 8px var(--cr);
  animation: registry-pulse 1.5s infinite;
}
@keyframes registry-pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}
.hud-btn {
  width: 100%;
  background: none;
  border: 1px solid var(--border);
  color: var(--text2);
  font-family: 'DM Mono', monospace;
  font-size: 8px;
  padding: 6px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 200ms ease;
}
.hud-btn:hover { border-color: var(--cr); color: var(--cr); }

/* ── CONSTRUCTOR GRIDS ────────────────────────────── */
.constructor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 1600px) {
  .constructor-grid { grid-template-columns: 1fr 1fr; }
  .constructor-output { grid-column: 1 / -1; }
}

.drop-zone {
  border: 1px dashed var(--border);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 200ms ease;
  background: var(--bg3);
  border-radius: var(--radius);
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--cr); background: var(--bg); }
.drop-icon { font-size: 20px; color: var(--text3); margin-bottom: 8px; display: block; }
.drop-zone p { font-family: 'DM Mono', monospace; font-size: 9px; color: var(--text3); text-transform: uppercase; }

.input-divider {
  text-align: center;
  margin: 20px 0;
  position: relative;
}
.input-divider::before {
  content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); z-index: 1;
}
.input-divider span {
  position: relative; z-index: 2; background: var(--bg); padding: 0 12px;
  font-family: 'DM Mono', monospace; font-size: 8px; color: var(--text3);
}

.raw-textarea {
  width: 100%; height: 160px;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); padding: 12px;
  font-family: 'DM Mono', monospace; font-size: 11px;
  resize: vertical; outline: none;
}
.raw-textarea:focus { border-color: var(--cr); }

.json-monitor-v2 {
  background: #080808; border: 1px solid var(--border);
  padding: 20px; border-radius: var(--radius);
  position: relative; min-height: 400px;
}
.json-monitor-v2 pre {
  color: #4ade80; font-family: 'DM Mono', monospace; font-size: 11px;
  white-space: pre-wrap; line-height: 1.6;
}

.audit-list-v2 {
  display: flex; flex-direction: column; gap: 1px;
  background: var(--border); border: 1px solid var(--border);
}
.audit-item-v2 {
  background: var(--bg3); padding: 14px;
  display: flex; justify-content: space-between; align-items: center;
}
.audit-item-v2:hover { background: var(--bg2); }
.a-meta { display: flex; flex-direction: column; gap: 2px; }
.a-id { font-family: 'DM Mono', monospace; font-size: 8px; color: var(--cr); text-transform: uppercase; }
.a-name { font-family: 'Cormorant Garamond', serif; font-size: 14px; }
.a-btn {
  background: none; border: 1px solid var(--border);
  color: var(--text3); font-family: 'DM Mono', monospace;
  font-size: 7px; padding: 3px 6px; cursor: pointer; text-transform: uppercase;
}
.a-btn:hover { border-color: var(--cr); color: var(--cr); }

/* ============================
   DASHBOARD
   ============================ */
.stat-grid {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 12px; margin-bottom: 20px;
}
.stat-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: linear-gradient(90deg, var(--cr), transparent);
}
.stat-label { font-size: 9px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text3); margin-bottom: 8px; }
.stat-value { font-family: 'Cormorant Garamond', serif; font-size: 44px; font-weight: 300; color: var(--text); line-height: 1; margin-bottom: 6px; }
.stat-sub { font-size: 10px; color: var(--text3); }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dash-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.dash-card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.dash-card-title { font-size: 9px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text3); }

.coreloop-code { font-size: 10px; color: var(--cr); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 4px; }
.coreloop-name { font-family: 'Cormorant Garamond', serif; font-size: 22px; color: var(--text); margin-bottom: 16px; }
.coreloop-progress-wrap { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.coreloop-progress-bar { flex: 1; height: 3px; background: var(--bg4); border-radius: 2px; overflow: hidden; }
.coreloop-progress-fill { height: 100%; background: var(--cr); border-radius: 2px; transition: width 600ms var(--ease-out); }
.coreloop-progress-label { font-size: 10px; color: var(--text3); white-space: nowrap; }
.coreloop-phase { font-size: 10px; color: var(--text3); letter-spacing: 0.08em; text-transform: uppercase; }

.dash-list { display: flex; flex-direction: column; gap: 2px; }
.dash-list-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer;
  transition: background 150ms ease;
}
.dash-list-item:hover { background: var(--bg3); }
.dash-item-title { font-size: 12px; color: var(--text2); }
.dash-item-tag {
  font-size: 9px; color: var(--text3); letter-spacing: 0.06em;
  background: var(--bg4); padding: 2px 6px; border-radius: 2px;
}

.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.qa-btn {
  font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); cursor: pointer; text-decoration: none;
  transition: all 150ms ease; display: flex; align-items: center; gap: 6px;
}
.qa-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--cr-dim); }

/* ============================
   POSTS / DATA TABLE
   ============================ */
.filter-tabs { display: flex; gap: 4px; }
.filter-tab {
  font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 6px 14px; border-radius: 3px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text3); cursor: pointer; transition: all 150ms ease;
}
.filter-tab:hover { border-color: var(--border2); color: var(--text2); }
.filter-tab.active { background: var(--cr); border-color: var(--cr); color: #fff; }

.data-table-wrap { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  font-size: 9px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--text3); padding: 12px 16px; text-align: left;
  border-bottom: 1px solid var(--border); background: var(--bg3);
}
.data-table td {
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text2); vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 120ms ease; cursor: default; }
.data-table tbody tr:hover { background: var(--bg3); }
.loading-row { text-align: center; color: var(--text3); padding: 32px !important; }

.status-pill {
  display: inline-block; font-size: 8px; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 2px;
}
.pill-live    { background: var(--sg-dim);  color: var(--sg); }
.pill-draft   { background: var(--bg4);  color: var(--text3); }
.pill-gated   { background: var(--pu-dim);  color: var(--pu); }
.pill-soon    { background: var(--am-dim);  color: var(--am); }
.pill-pinned  { background: var(--cr-dim);  color: var(--cr); }
.pill-beta    { background: var(--am-dim);  color: var(--am); }

.action-btn {
  font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 0.08em;
  background: transparent; border: 1px solid var(--border); border-radius: 3px;
  color: var(--text3); padding: 3px 9px; cursor: pointer;
  transition: all 150ms ease; white-space: nowrap;
}
.action-btn:hover { border-color: var(--accent); color: var(--accent); }
.action-btn.danger:hover { color: var(--cr); border-color: var(--cr-border); }

/* ============================
   POST EDITOR
   ============================ */
.editor-panel {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 20px;
  overflow: hidden;
}
.editor-panel.sm-panel.visible { display: block !important; }
.editor-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.editor-title { font-family: 'Cormorant Garamond', serif; font-size: 20px; color: var(--text); font-weight: 300; }
.editor-body { display: grid; grid-template-columns: 1fr 260px; gap: 0; }
.editor-main { padding: 20px; display: flex; flex-direction: column; gap: 16px; border-right: 1px solid var(--border); }
.editor-sidebar { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.editor-sidebar-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px;
}
.esc-title { font-size: 9px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text3); margin-bottom: 12px; }
.editor-sidebar-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }

.editor-toolbar-mini {
  display: flex; gap: 4px; margin-bottom: 6px;
}
.etb-btn {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 3px;
  color: var(--text2); padding: 4px 10px; cursor: pointer;
  font-size: 12px; transition: all 120ms ease;
}
.etb-btn:hover { border-color: var(--border2); color: var(--text); }

.editor-textarea { min-height: 240px; font-family: 'DM Mono', monospace; font-size: 12px; line-height: 1.7; }

.preview-mini { padding: 12px; background: var(--bg); border-radius: var(--radius-sm); }
.preview-type { font-size: 9px; color: var(--cr); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px; }
.preview-title { font-family: 'Cormorant Garamond', serif; font-size: 16px; color: var(--text); line-height: 1.2; margin-bottom: 6px; }
.preview-excerpt { font-size: 11px; color: var(--text3); line-height: 1.55; }

/* ============================
   TOOLS GRID
   ============================ */
.tools-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.tool-admin-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  position: relative;
}
.tool-admin-card:hover { border-color: var(--border2); }
.tool-admin-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.tool-admin-name { font-size: 11px; font-weight: 500; color: var(--text); letter-spacing: 0.08em; }
.tool-admin-desc { font-size: 11px; color: var(--text3); line-height: 1.55; margin-bottom: 14px; }
.tool-admin-footer { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tool-status-select {
  font-family: 'DM Mono', monospace; font-size: 9px;
  background: var(--bg3); border: 1px solid var(--border); border-radius: 3px;
  color: var(--text2); padding: 4px 8px; cursor: pointer;
  transition: border-color 150ms ease;
}
.tool-status-select:focus { border-color: var(--cr); outline: none; }

/* ============================
   CORELOOP VIEW
   ============================ */
.section-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.section-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.section-card.wide { grid-column: 1 / -1; }
.section-card-label { font-size: 9px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text3); margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.action-btn.danger:hover {
  background: var(--cr);
  color: #fff;
  border-color: var(--cr);
  box-shadow: 0 0 15px rgba(176,32,32,0.3);
}

.tool-admin-card {
  background: var(--iv2-dark);
  border: 1px solid var(--iv3-dark);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  transition: border-color 200ms ease;
}

.cl-display {
  background: var(--bg3); border-radius: var(--radius-sm); padding: 14px 16px;
  margin-bottom: 20px; display: flex; flex-direction: column; gap: 4px;
}
.cl-display .code { font-size: 10px; color: var(--cr); letter-spacing: 0.1em; }
.cl-display .name { font-family: 'Cormorant Garamond', serif; font-size: 20px; color: var(--text); }
.cl-display .progress { font-size: 10px; color: var(--text3); }

.cl-history { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.cl-history-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; background: var(--bg3); border-radius: var(--radius-sm);
  font-size: 11px;
}
.cl-history-item.active-loop { border-left: 2px solid var(--cr); }
.cl-h-code { color: var(--cr); font-size: 9px; letter-spacing: 0.1em; }
.cl-h-name { color: var(--text2); flex: 1; padding: 0 12px; }

/* ============================
   SIGNALS CHART
   ============================ */
.signals-chart { display: flex; flex-direction: column; gap: 16px; }
.signal-bar-row { display: flex; align-items: center; gap: 12px; }
.signal-bar-label { font-size: 10px; color: var(--text3); width: 120px; flex-shrink: 0; }
.signal-bar-track { flex: 1; height: 8px; background: var(--bg4); border-radius: 4px; overflow: hidden; }
.signal-bar-fill { height: 100%; background: var(--cr); border-radius: 4px; transition: width 600ms var(--ease-out); }
.signal-count { font-size: 11px; color: var(--text2); width: 40px; text-align: right; }

#signals-summary { display: flex; flex-direction: column; gap: 10px; }
.sig-summary-item { display: flex; justify-content: space-between; pad: 8px 0; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.sig-sum-label { font-size: 11px; color: var(--text3); }
.sig-sum-val { font-size: 16px; font-family: 'Cormorant Garamond', serif; color: var(--text); }

/* ============================
   SETTINGS
   ============================ */
.setting-info { font-size: 11px; color: var(--text3); margin-bottom: 6px; }
.meta-note { font-size: 12px; color: var(--text3); padding: 24px; font-style: italic; }

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(2,1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: repeat(2,1fr); }
  .section-grid { grid-template-columns: 1fr; }
  .section-card.wide { grid-column: auto; }
  .editor-body { grid-template-columns: 1fr; }
  .editor-main { border-right: none; border-bottom: 1px solid var(--border); }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 200px; }
  .tools-grid { grid-template-columns: 1fr; }
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* ============================
   SIGNAL INTELLIGENCE
   ============================ */
.signal-intelligence {
  padding: 16px 0;
}
.signal-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}
.s-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.s-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.1em;
}
.s-value {
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--text);
}
.signal-chart-tactical {
  height: 120px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  height: 100%;
}
.chart-bar {
  width: 100%;
  background: var(--bg4);
  border: 1px solid var(--border2);
  transition: height 600ms var(--ease-out), background 300ms ease;
  position: relative;
}
.chart-bar:hover {
  background: var(--cr-dim);
  border-color: var(--cr-border);
}
.chart-bar.active {
  background: var(--cr);
  border-color: var(--cr);
}
.bar-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text3);
}

/* ============================
   MEDIA VAULT
   ============================ */
.asset-grid-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.asset-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 200ms ease;
}
.asset-card:hover {
  border-color: var(--text3);
  transform: translateY(-2px);
}
.asset-preview {
  height: 120px;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.asset-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
}
.asset-info {
  padding: 12px;
}
.asset-name {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.asset-meta {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text3);
  display: flex;
  justify-content: space-between;
}
.asset-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.asset-btn {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 6px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 150ms ease;
}
.asset-btn:hover {
  background: var(--bg4);
  color: var(--text);
}

/* ============================
   SYSTEM BRIDGE
   ============================ */
.bridge-status-card {
  display: flex;
  gap: 24px;
  align-items: center;
  background: var(--bg2);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.bridge-meta {
  flex: 1;
}
.deploy-log-v2 {
  background: #000;
  padding: 12px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--sg);
  margin-top: 12px;
  height: 80px;
  overflow-y: auto;
  border: 1px solid var(--border);
}
.health-checks {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.health-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text2);
}
.status-pill {
  padding: 2px 8px;
  font-size: 9px;
  border-radius: 10px;
}
.pill-live {
  background: var(--sg-dim);
  color: var(--sg);
  border: 1px solid var(--sg-dim);
}

/* ============================
   SYSTEM FORGE (FILE MANAGER)
   ============================ */
.forge-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - 120px);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 20px;
}

.forge-explorer {
  background: var(--bg2);
  display: flex;
  flex-direction: column;
}

.explorer-header {
  padding: 12px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text3);
}

#forge-path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.explorer-tree {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.explorer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text2);
  transition: all 150ms ease;
  user-select: none;
}

.explorer-item:hover {
  background: var(--bg3);
  color: var(--text);
}

.explorer-item.active {
  background: var(--bg4);
  color: var(--accent);
  border-left: 2px solid var(--accent);
}

.explorer-item.is-system {
  color: var(--cr);
}

.explorer-item.is-system:hover {
  color: #ff6b6b;
}

.icon-folder { color: #d4a017; font-size: 12px; }
.icon-file { color: var(--text3); font-size: 12px; }

.forge-editor {
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.editor-header-mini {
  padding: 8px 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 48px;
}

#forge-file-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
}

.editor-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.forge-textarea-wrap {
  flex: 1;
  position: relative;
}

.forge-textarea {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  padding: 20px;
  resize: none;
  outline: none;
}

.binary-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--cr);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  gap: 16px;
}

@media (max-width: 1024px) {
  .forge-container { grid-template-columns: 1fr; height: auto; min-height: 800px; }
  .forge-explorer { height: 300px; border-right: none; border-bottom: 1px solid var(--border); }
}

/* ============================
   MODAL
   ============================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000;
  padding: 24px;
}
.modal-content {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 600px;
}
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text2);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
}
.btn-secondary:hover {
  border-color: var(--text3);
  color: var(--text);
}
