:root {
  --primary: #0f2a44;
  --primary-2: #155e75;
  --accent: #16a34a;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: rgba(15, 23, 42, .10);
  --shadow: 0 24px 70px rgba(15, 42, 68, .14);
  --radius: 28px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% -10%, rgba(22, 163, 74, .16), transparent 28rem),
    radial-gradient(circle at 90% 0%, rgba(21, 94, 117, .18), transparent 26rem),
    var(--bg);
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.page-shell { width: min(1200px, calc(100% - 32px)); margin: 0 auto; }
.hub-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 16px 0; backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { display:grid; place-items:center; width: 46px; height: 46px; border-radius: 16px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color:#fff; font-weight: 900; letter-spacing: -.05em; box-shadow: var(--shadow); }
.brand strong { display:block; font-size: 1.05rem; }
.brand small { display:block; color: var(--muted); font-size: .78rem; margin-top: 2px; }
.top-nav { display:flex; align-items:center; gap: 8px; flex-wrap: wrap; }
.top-nav a, .btn { border: 0; border-radius: 999px; padding: 12px 18px; font-weight: 800; font-size: .88rem; transition: transform .2s, box-shadow .2s, background .2s; }
.top-nav a { color: var(--muted); }
.top-nav a:hover { color: var(--text); background: rgba(255,255,255,.75); }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: 0 18px 42px rgba(15, 42, 68, .22); }
.btn-secondary { background: rgba(22, 163, 74, .11); color: #0f6b36; border: 1px solid rgba(22, 163, 74, .22); }
.btn-ghost { background: rgba(255,255,255,.78); color: var(--text); border: 1px solid var(--line); }
.btn-danger { background: rgba(220, 38, 38, .10); color: #b91c1c; border: 1px solid rgba(220, 38, 38, .22); }
.btn-mini { padding: 8px 12px; font-size: .76rem; }
.hero { display:grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr); gap: 24px; align-items: stretch; padding: 40px 0 28px; }
.hero-copy, .hero-panel, .locked-card, .admin-panel, .system-card, .editor-card { background: rgba(255,255,255,.82); border: 1px solid rgba(255,255,255,.78); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.hero-copy { padding: clamp(28px, 5vw, 58px); min-height: 420px; display:flex; flex-direction:column; justify-content:center; }
.eyebrow { margin:0 0 12px; color: var(--accent); font-weight: 900; letter-spacing: .12em; text-transform: uppercase; font-size: .74rem; }
h1, h2, h3 { margin: 0; line-height: 1.05; letter-spacing: -.04em; }
h1 { font-size: clamp(2.35rem, 6vw, 5.25rem); max-width: 780px; }
h2 { font-size: clamp(1.7rem, 3vw, 2.6rem); }
h3 { font-size: 1.1rem; }
p { color: var(--muted); line-height: 1.65; }
.hero-copy > p:not(.eyebrow) { font-size: clamp(1rem, 2vw, 1.22rem); max-width: 720px; }
.hero-actions { display:flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.hero-panel { padding: 28px; display:flex; flex-direction:column; justify-content:space-between; gap: 24px; background: linear-gradient(145deg, rgba(15,42,68,.96), rgba(21,94,117,.92)); color: #fff; }
.hero-panel p, .hero-panel dd { color: rgba(255,255,255,.72); }
.status-pill { display:inline-flex; align-items:center; gap:8px; width:max-content; padding: 8px 12px; background: rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.2); border-radius:999px; font-weight: 800; font-size: .78rem; }
.status-pill i { display:block; width:9px; height:9px; background:#22c55e; border-radius:999px; box-shadow:0 0 0 6px rgba(34,197,94,.16); }
.mini-metrics { display:grid; grid-template-columns:1fr 1fr; gap: 12px; margin:0; }
.mini-metrics div { padding: 18px; border-radius: 22px; background: rgba(255,255,255,.10); border:1px solid rgba(255,255,255,.12); }
.mini-metrics dt { font-size: 2rem; font-weight: 950; }
.mini-metrics dd { margin: 4px 0 0; }
.section { padding: 44px 0; }
.section-head { display:flex; align-items:end; justify-content:space-between; gap: 24px; margin-bottom: 18px; }
.filters { display:flex; gap: 10px; flex-wrap:wrap; justify-content:flex-end; }
input, select, textarea { width:100%; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; background: rgba(255,255,255,.88); color: var(--text); outline:none; transition:border .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { border-color: rgba(21, 94, 117, .45); box-shadow: 0 0 0 4px rgba(21, 94, 117, .10); }
textarea { min-height: 110px; resize: vertical; }
.filters input { min-width: 260px; }
.filters select { min-width: 200px; }
.systems-grid { display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.system-card { position:relative; overflow:hidden; padding: 22px; display:flex; flex-direction:column; min-height: 265px; }
.system-card:before { content:""; position:absolute; inset:0; background: radial-gradient(circle at top right, rgba(21,94,117,.16), transparent 14rem); pointer-events:none; }
.system-card > * { position:relative; }
.card-icon { display:grid; place-items:center; width: 50px; height: 50px; border-radius: 18px; background: rgba(21,94,117,.10); color: var(--primary-2); font-weight:950; font-size: 1.45rem; line-height: 1; overflow:hidden; }
.card-icon img { width:100%; height:100%; object-fit:contain; display:block; border-radius:16px; }
.card-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }
.category-badge, .status-badge { border-radius:999px; padding:7px 10px; font-size:.72rem; font-weight:900; }
.category-badge { background: rgba(15,42,68,.07); color: var(--primary); }
.status-badge { background: rgba(22,163,74,.10); color: #15803d; }
.system-card p { flex:1; }
.card-actions { display:flex; gap: 8px; flex-wrap:wrap; align-items:center; margin-top: 16px; }
.locked-card { padding: 28px; display:flex; align-items:center; justify-content:space-between; gap: 20px; }
.hidden { display: none !important; }
.admin-panel { padding: 26px; }
.admin-top { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; margin-bottom: 18px; }
.admin-actions { display:flex; align-items:center; gap:10px; }
.save-state { color: var(--muted); font-size:.82rem; }
.tabs { display:flex; gap:8px; flex-wrap:wrap; border-bottom:1px solid var(--line); margin-bottom: 20px; }
.tab { border:0; background:transparent; padding: 14px 16px; border-radius: 14px 14px 0 0; color: var(--muted); font-weight:900; }
.tab.active { background: rgba(21,94,117,.10); color: var(--primary); }
.tab-panel { display:none; }
.tab-panel.active { display:block; }
.editor-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.editor-card { padding: 20px; box-shadow: 0 16px 42px rgba(15,42,68,.08); }
.editor-card.full { grid-column: 1 / -1; }
.form-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full, label.full { grid-column: 1 / -1; }
label { display:block; color: var(--text); font-weight: 800; font-size:.86rem; }
label span { display:block; margin-bottom: 7px; }
.form-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:14px; }
.list-editor { display:grid; gap: 10px; }
.list-row { display:grid; grid-template-columns: repeat(12, 1fr); gap: 8px; align-items:start; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: rgba(248,250,252,.8); }
.list-row .span-2 { grid-column: span 2; }
.list-row .span-3 { grid-column: span 3; }
.list-row .span-4 { grid-column: span 4; }
.list-row .span-5 { grid-column: span 5; }
.list-row .span-6 { grid-column: span 6; }
.list-row .span-8 { grid-column: span 8; }
.list-row .span-12 { grid-column: span 12; }
.stats-grid { display:grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-card { background: rgba(248,250,252,.9); border:1px solid var(--line); border-radius: 22px; padding: 18px; }
.stat-card strong { display:block; font-size: 2rem; letter-spacing:-.05em; }
.stat-table { width:100%; border-collapse: collapse; overflow:hidden; border-radius:18px; }
.stat-table th, .stat-table td { padding: 12px; border-bottom:1px solid var(--line); text-align:left; }
.stat-table th { color: var(--muted); font-size:.78rem; text-transform:uppercase; letter-spacing:.08em; }
.modal-backdrop { position:fixed; inset:0; z-index:60; display:grid; place-items:center; background: rgba(15,23,42,.55); padding: 18px; backdrop-filter: blur(8px); }
.login-card { position:relative; width:min(420px, 100%); background:#fff; border-radius: 28px; padding: 28px; box-shadow: var(--shadow); display:grid; gap:14px; }
.modal-close { position:absolute; right:14px; top:12px; border:0; background:transparent; font-size: 1.8rem; color: var(--muted); }
.form-message { min-height: 20px; margin: 0; font-weight:800; }
.form-message.error { color: #b91c1c; }
.form-message.success { color: #15803d; }
.toast { position:fixed; z-index:80; right:18px; bottom:18px; min-width: 260px; max-width: 420px; padding: 14px 16px; background: var(--text); color:#fff; border-radius:18px; box-shadow: var(--shadow); transform: translateY(20px); opacity:0; pointer-events:none; transition:.25s; }
.toast.show { transform: translateY(0); opacity:1; }
.small-note { color: var(--muted); font-size:.82rem; line-height:1.55; }
.codebox { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; min-height: 360px; white-space: pre; }
.upload-row { display:flex; gap: 10px; align-items:end; flex-wrap:wrap; }
.upload-row label { flex: 1 1 260px; }
.preview-img { width: 100%; max-height: 160px; object-fit: cover; border-radius: 18px; border: 1px solid var(--line); background: #f8fafc; }
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .systems-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-grid, .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .page-shell { width: min(100% - 22px, 1200px); }
  .hub-header, .section-head, .locked-card, .admin-top { align-items:flex-start; flex-direction:column; }
  .top-nav { width: 100%; }
  .top-nav a, .top-nav button, .hero-actions .btn, .filters, .filters input, .filters select { width: 100%; }
  .systems-grid, .stats-grid { grid-template-columns: 1fr; }
  .hero-copy, .hero-panel, .admin-panel { border-radius: 22px; }
  .list-row { grid-template-columns: 1fr; }
  .list-row > * { grid-column: 1 / -1 !important; }
}
