/* Koadi Hosting portal — layers on top of koadi-ds.css.
   Only shell and portal-specific pieces live here; colours, type, buttons,
   cards, badges and tables all come from the design system. */

body { background: var(--bg); }

.shell { display: flex; min-height: 100vh; }

/* ── Sidebar ──────────────────────────────────────────────────────────── */
.side {
  width: 244px; flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  padding: 22px 16px; position: sticky; top: 0; height: 100vh;
}
.side-logo { display: flex; align-items: center; gap: 10px; padding: 0 6px 26px; }
.side-logo span { font-family: var(--font-display); font-size: 19px; font-weight: 700; color: var(--text); }
.side-head {
  font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-3); padding: 0 8px 9px;
}
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.nav {
  display: flex; align-items: center; gap: 11px; padding: 10px 13px; border-radius: 10px;
  font-size: 14.5px; font-weight: 500; color: var(--text-2); text-decoration: none;
}
.nav:hover { background: var(--surface-sunken); color: var(--text); }
.nav.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav.on:hover { background: var(--brand-soft); color: var(--brand); }
.side-plan {
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px;
  background: var(--surface-sunken);
}
.side-plan .lbl { font-size: 12px; color: var(--text-2); margin-bottom: 3px; }
.side-plan .name { font-family: var(--font-display); font-size: 15.5px; font-weight: 700; margin-bottom: 8px; }
.side-plan .sla { font-size: 12.5px; color: var(--text-2); line-height: 1.45; }

/* ── Main column ──────────────────────────────────────────────────────── */
.main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; border-bottom: 1px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: space-between; padding: 0 30px;
  position: sticky; top: 0; z-index: 20;
}
.topbar .who { font-size: 14.5px; font-weight: 600; }
.topbar .right { display: flex; align-items: center; gap: 14px; font-size: 13.5px; color: var(--text-2); }
.avatar {
  width: 32px; height: 32px; border-radius: 999px; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600;
}
.content { padding: 30px; display: flex; flex-direction: column; gap: 20px; }
.page-title { font-family: var(--font-display); font-size: 30px; font-weight: 700; margin: 0 0 6px; letter-spacing: -.02em; }
.page-sub { font-size: 14.5px; color: var(--text-2); margin: 0; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }

/* ── Blocks ───────────────────────────────────────────────────────────── */
.hero { padding: 26px 28px; display: flex; align-items: center; gap: 22px; }
.hero .icon {
  width: 52px; height: 52px; border-radius: 999px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.hero .title { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-bottom: 4px; letter-spacing: -.02em; }
.hero .meta { font-size: 14px; color: var(--text-2); }

.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.stat { padding: 20px 22px; }
.stat .k {
  font-size: 12.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 10px;
}
.stat .v { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.stat .n { font-size: 13px; color: var(--text-2); margin-top: 5px; }

.split { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.split-even { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.28fr); gap: 20px; align-items: start; }
.block-title { font-family: var(--font-display); font-size: 17px; font-weight: 600; margin-bottom: 16px; letter-spacing: -.01em; }

.feed { display: flex; flex-direction: column; }
.feed-row { display: flex; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--divider); }
.feed-row:last-child { border-bottom: none; padding-bottom: 3px; }
.feed-ico {
  width: 30px; height: 30px; border-radius: 999px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.feed-t { font-size: 14px; font-weight: 500; }
.feed-m { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }

.note {
  display: flex; gap: 12px; align-items: flex-start; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 15px 18px;
  font-size: 13.5px; color: var(--text-2); line-height: 1.55;
}
.log {
  background: #10253A; border-radius: var(--radius-md); padding: 16px 18px; color: #C7D3DE;
  font: 400 12.5px/1.75 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  overflow-x: auto; white-space: pre; margin: 0;
}
.log .t { color: #8492A0; }
.log .e { color: #FDA29B; }
details > summary { font-size: 13.5px; font-weight: 600; color: var(--brand); cursor: pointer; margin-bottom: 12px; }

.urgency { display: flex; gap: 9px; }
.urgency label { flex-grow: 1; cursor: pointer; }
.urgency input { position: absolute; opacity: 0; }
.urgency .opt {
  text-align: center; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 8px; font-size: 13.5px; font-weight: 500; color: var(--text-2);
}
.urgency input:checked + .opt {
  border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600;
}

.empty { text-align: center; padding: 44px 24px; color: var(--text-2); }
.empty .h { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 6px; }

/* ── Auth pages ───────────────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px;
  background:
    radial-gradient(900px 420px at 80% -10%, var(--brand-soft), transparent 60%),
    radial-gradient(600px 340px at 0% 40%, var(--action-soft), transparent 55%);
}
.auth-card { width: 100%; max-width: 420px; padding: 34px 32px; }
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 22px; }
.auth-logo span { font-family: var(--font-display); font-size: 21px; font-weight: 700; }

@media (max-width: 900px) {
  .stat-grid, .split, .split-even { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .content { padding: 20px; }
}

/* ── Slide-over drawer (no JavaScript) ────────────────────────────────────
   The CSP sets script-src 'none', so this is driven by a hidden checkbox: the
   trigger and every close control are <label for> the same input. Opening
   costs no page load and adds no history entry. The server renders the input
   `checked` after a rejected submission so the form is not lost behind it. */
.drawer-toggle { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }

.drawer {
  position: fixed; inset: 0; z-index: 200;
  visibility: hidden;
  transition: visibility 0s linear .3s;
}
.drawer-toggle:checked ~ .drawer { visibility: visible; transition-delay: 0s; }

.drawer-scrim {
  position: absolute; inset: 0; display: block; cursor: default;
  background: rgba(16, 37, 58, .42);
  opacity: 0; transition: opacity .28s ease;
}
.drawer-toggle:checked ~ .drawer .drawer-scrim { opacity: 1; }

.drawer-panel {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: min(440px, 92vw);
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: 8px 0 28px -12px rgba(16, 37, 58, .35);
  display: flex; flex-direction: column;
  transform: translateX(-101%);
  transition: transform .3s cubic-bezier(.32, .72, 0, 1);
}
.drawer-toggle:checked ~ .drawer .drawer-panel { transform: translateX(0); }

.drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.drawer-head .t {
  font-family: var(--font-display); font-size: 18px; font-weight: 700;
  letter-spacing: -.01em; margin: 0;
}
.drawer-body { padding: 24px; overflow-y: auto; flex-grow: 1; }
.drawer-foot {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end; flex-shrink: 0;
  background: var(--surface-sunken);
}
label.btn { cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .drawer-panel, .drawer-scrim { transition: none; }
}
