:root {
  --bg: #eef3fb;
  --panel: #ffffff;
  --soft: #f7f9fd;
  --ink: #133057;
  --muted: #5f6f86;
  --brand: #123b7a;
  --brand-2: #1e63c5;
  --line: #d8e2f0;
  --good: #18794e;
  --warn: #b96f00;
  --bad: #b42318;
  --shadow: 0 18px 40px rgba(18, 59, 122, 0.08);
  font-family: Inter, Segoe UI, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
.hidden { display: none !important; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 1rem; }
.panel.soft { background: var(--soft); }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem; }
.auth-card { width: min(1080px, 100%); }
.brand-lockup { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.auth-logo, .top-logo { width: 84px; height: 84px; object-fit: cover; border-radius: 22px; border: 1px solid var(--line); background: white; }
.top-logo { width: 60px; height: 60px; }
.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.auth-grid { margin-top: 1rem; }
label { display: grid; gap: .4rem; font-size: .95rem; margin-bottom: .8rem; }
input, select, textarea, button { font: inherit; }
input, select, textarea { width: 100%; padding: .78rem .9rem; border-radius: 14px; border: 1px solid var(--line); background: white; color: var(--ink); }
button { cursor: pointer; border: 0; border-radius: 14px; background: var(--brand); color: white; padding: .82rem 1rem; font-weight: 600; }
button.ghost, .icon-btn { background: white; color: var(--brand); border: 1px solid var(--line); }
button:hover { filter: brightness(.98); }
.status { min-height: 1.25rem; color: var(--brand); }
.notice { padding: .9rem 1rem; border-radius: 14px; background: #eff6ff; border: 1px solid #cfe0ff; color: var(--ink); }
.muted { color: var(--muted); }
.mt { margin-top: 1rem; }
.mb { margin-bottom: 1rem; }
.row { display: flex; gap: .75rem; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.align-start { align-items: flex-start; }
.compact-controls > * { flex: 1 1 180px; }
.compact-grid { align-items: start; }
.mini-cards, .mini-stats, .hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .75rem; }
.stat-box { border: 1px solid var(--line); border-radius: 16px; padding: .85rem; background: white; }
.stat-box span, .stat-box .label { display: block; color: var(--muted); font-size: .84rem; }
.stat-box strong { display: block; font-size: 1.05rem; margin-top: .25rem; }
.tag { display: inline-flex; padding: .28rem .62rem; border-radius: 999px; background: #edf3ff; color: var(--brand); font-size: .78rem; border: 1px solid #d6e4ff; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 1rem; background: var(--brand); color: white; box-shadow: 0 8px 28px rgba(0,0,0,.08); }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: .85rem; }
.topbar p, .topbar h1 { margin: 0; }
.topbar h1 { font-size: 1.35rem; }
.layout-shell { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 90px); }
.sidebar { background: #f3f7fe; border-right: 1px solid var(--line); padding: 1rem; }
.main-nav { display: grid; gap: .5rem; }
.main-nav button { text-align: left; justify-content: flex-start; }
.main-nav button.active { background: var(--brand-2); }
.container { padding: 1rem; }
.view { display: none; }
.view.active { display: block; }
.hero { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1rem; }
.card { background: white; border: 1px solid var(--line); border-radius: 20px; padding: 1rem; box-shadow: var(--shadow); }
.card h3, .panel h3, .panel h2 { margin-top: 0; }
.stack-list { display: grid; gap: .8rem; }
.stack-item { border: 1px solid var(--line); border-radius: 16px; padding: .85rem; background: white; }
.section-head { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin-bottom: 1rem; }
.network-pill, .user-chip { display: inline-flex; align-items: center; gap: .5rem; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.12); padding: .45rem .65rem; border-radius: 999px; }
#networkStatusDot { width: 10px; height: 10px; border-radius: 999px; background: #7ee787; display: inline-block; }
.focus-list { margin: 0; padding-left: 1.2rem; }
.modal { border: 0; padding: 0; background: transparent; width: min(1100px, calc(100vw - 2rem)); }
.modal::backdrop { background: rgba(7, 19, 39, .45); }
.modal-card { max-height: 88vh; overflow: auto; }
.modal-grid { align-items: start; }
.unit-btn { width: 100%; text-align: left; background: white; color: var(--ink); border: 1px solid var(--line); }
.unit-btn.active { background: #eff6ff; color: var(--brand); border-color: #cfe0ff; }
.resource-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
.file-meta { display: flex; flex-wrap: wrap; gap: .45rem; margin: .55rem 0; }
.resource-title { margin: 0 0 .35rem; }
.state-approved { color: var(--good); }
.state-pending { color: var(--warn); }
.state-rejected { color: var(--bad); }
.mobile-only { display: none; }
@media (max-width: 980px) {
  .grid.two, .grid.three, .layout-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 90px auto 0 0; width: min(300px, 86vw); transform: translateX(-110%); transition: transform .2s ease; z-index: 25; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .mobile-only { display: inline-flex; }
  .hero, .section-head, .topbar { flex-direction: column; align-items: stretch; }
  .topbar-right { justify-content: space-between; flex-wrap: wrap; }
}

.auth-footer { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; display: grid; gap: .35rem; }
.install-code { display: grid; gap: .2rem; padding: .85rem 1rem; border: 1px dashed var(--line); border-radius: 16px; background: white; }
.install-code strong { font-size: 1.05rem; letter-spacing: .04em; }
button:disabled { opacity: .55; cursor: not-allowed; }
textarea { resize: vertical; }
