:root {
  --ink: #111827;
  --muted: #64748b;
  --line: #e5e7eb;
  --surface: #ffffff;
  --soft: #f8fafc;
  --brand: #155e75;
  --brand-2: #2563eb;
  --ok: #059669;
  --warn: #b45309;
  --shadow: 0 12px 35px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #eef2f6;
}

a { color: inherit; text-decoration: none; }

.portal {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #0f172a;
  color: #e2e8f0;
  padding: 20px 14px;
  overflow-y: auto;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 10px 16px;
  border-bottom: 1px solid rgba(226, 232, 240, .14);
  margin-bottom: 14px;
  text-align: center;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #38bdf8, #22c55e);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #082f49;
}

.brand-logo {
  width: 100%;
  max-width: 178px;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  display: block;
  margin: 0 auto 4px;
}
.brand-fallback { display: flex; align-items: center; gap: 10px; }
.brand-title { font-weight: 800; line-height: 1.1; }
.brand-sub { font-size: 12px; color: #94a3b8; margin-top: 2px; }

.nav-section {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 18px 10px 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 14px;
  margin: 2px 0;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, .09);
  color: #fff;
}

.nav-separator {
  height: 1px;
  background: rgba(255, 255, 255, .1);
  margin: 12px 10px;
}

.logout-link {
  color: #f87171 !important;
}

.logout-link:hover {
  background: rgba(248, 113, 113, .15) !important;
  color: #fef2f2 !important;
}

.main {
  min-width: 0;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-title {
  font-weight: 800;
  letter-spacing: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: #fff;
  color: #0f172a;
  border-radius: 7px;
  padding: 8px 11px;
  font-size: 13px;
  font-weight: 800;
}

.home-btn:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--warn);
}
.dot.ok { background: var(--ok); }

.content {
  padding: 28px;
  max-width: 1320px;
}

.page-head {
  margin-bottom: 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  color: var(--brand);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  margin-bottom: 7px;
}

h1 {
  margin: 0;
  font-size: 31px;
  line-height: 1.15;
  letter-spacing: 0;
}

.lede {
  margin: 9px 0 0;
  color: var(--muted);
  max-width: 760px;
  line-height: 1.55;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.module-card {
  grid-column: span 4;
  min-height: 174px;
  display: flex;
  flex-direction: column;
}

.module-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.module-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e0f2fe;
  color: #075985;
  font-weight: 800;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: #f1f5f9;
  color: #475569;
}
.badge.live { background: #dcfce7; color: #166534; }
.badge.api { background: #dbeafe; color: #1d4ed8; }
.badge.todo { background: #fef3c7; color: #92400e; }

.module-title {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 7px;
}

.module-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  flex: 1;
}

.button-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 15px;
}

.btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  padding: 8px 11px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.btn.primary {
  background: var(--brand-2);
  color: #fff;
  border-color: var(--brand-2);
}
.btn.danger {
  color: #b91c1c;
  border-color: #fecaca;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.field { grid-column: span 6; }
.field.full { grid-column: span 12; }
.field.third { grid-column: span 4; }

label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  margin-bottom: 6px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  font: inherit;
  font-size: 14px;
  background: #fff;
}

input[readonly],
textarea[readonly] {
  background: #f1f5f9;
  color: #475569;
  cursor: not-allowed;
}

textarea { min-height: 86px; resize: vertical; }

.notice {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 7px;
  background: #f1f5f9;
  color: #334155;
  font-size: 13px;
}
.notice.ok { background: #dcfce7; color: #166534; }
.notice.err { background: #fee2e2; color: #991b1b; }

.panel {
  grid-column: span 12;
}

.panel h2 {
  margin: 0 0 8px;
  font-size: 19px;
}

.checklist {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}

.checklist li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #334155;
  font-size: 14px;
}

.check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  background: #e2e8f0;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.split {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 16px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}
.table th,
.table td {
  text-align: left;
  padding: 10px 11px;
  border-bottom: 1px solid #eef2f7;
  font-size: 13px;
}
.table th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

@media (max-width: 920px) {
  .portal { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .content { padding: 18px; }
  .module-card { grid-column: span 12; }
  .split { grid-template-columns: 1fr; }
  .field,
  .field.third { grid-column: span 12; }
}
