:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --blue: #123a63;
  --teal: #0f766e;
  --line: #dbe3ee;
  --shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4fa 100%);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
.app-shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, #0d2440 0%, #0f2f50 100%);
  color: #fff;
  padding: 28px 22px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; }
.brand-logo, .auth-logo { width: 56px; height: 56px; }
.brand-name { font-size: 1.35rem; font-weight: 800; }
.brand-slogan, .eyebrow, .muted { color: rgba(255,255,255,.72); }
.nav-list { display: grid; gap: 8px; }
.nav-list a {
  padding: 11px 14px;
  border-radius: 14px;
  color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.05);
}
.nav-list a:hover { background: rgba(255,255,255,.12); }
.main-panel { padding: 28px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.topbar h1 { margin: 4px 0 0; font-size: 1.8rem; }
.user-chip {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  text-align: right;
}
.hero-card, .panel-card, .stat-card, .auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.hero-card { padding: 24px; margin-bottom: 22px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 14px; padding: 11px 16px; font-weight: 700;
  border: 1px solid transparent;
}
.button-primary { background: linear-gradient(135deg, var(--blue), var(--teal)); color: #fff; }
.button-secondary { border-color: var(--line); background: #fff; }
.button-full { width: 100%; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin: 22px 0; }
.stat-card { padding: 20px; min-height: 116px; }
.stat-label { color: var(--muted); font-size: .92rem; margin-bottom: 10px; }
.stat-value { font-size: 1.9rem; font-weight: 800; color: var(--blue); }
.tone-teal .stat-value { color: var(--teal); }
.two-column { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.panel-card { padding: 20px; }
.panel-card h3 { margin-top: 0; }
.panel-card ul { margin: 0; padding-left: 18px; color: #334155; }
.messages { margin-bottom: 16px; }
.message { background: #ecfeff; border: 1px solid #a5f3fc; padding: 12px 14px; border-radius: 14px; }
.auth-body {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
}
.auth-card {
  width: min(460px, 100%);
  padding: 28px;
  text-align: center;
}
.auth-slogan { color: var(--muted); margin-top: -8px; }
.auth-form { display: grid; gap: 14px; text-align: left; margin-top: 20px; }
.auth-form label { display: grid; gap: 6px; font-weight: 600; }
.auth-form input {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
}
.auth-links { margin-top: 16px; }
.mobile-nav { display: none; }
@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
    position: sticky; bottom: 0; background: rgba(255,255,255,.96);
    border-top: 1px solid var(--line); padding: 10px; backdrop-filter: blur(14px);
  }
  .mobile-nav a { text-align: center; font-size: .82rem; padding: 8px 6px; border-radius: 12px; background: #f8fafc; }
  .main-panel { padding: 18px 16px 90px; }
  .topbar { flex-direction: column; align-items: flex-start; }
}

.hero-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.filter-bar { display: grid; grid-template-columns: 1.5fr 1fr 1fr auto; gap: 10px; margin-top: 16px; }
.filter-bar input, .filter-bar select, .stack-form input, .stack-form select, .stack-form textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--text);
}
.record-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 18px; }
.record-grid.compact-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.record-card, .mini-card, .note-card, .alert-box {
  background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
}
.record-card, .mini-card, .note-card { padding: 18px; }
.record-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; margin-bottom: 12px; }
.muted-text { color: var(--muted); }
.pill { display:inline-flex; align-items:center; border-radius:999px; padding:6px 10px; font-size:.78rem; font-weight:700; background:#edf2f7; color:#334155; }
.pill-active, .pill-lead, .pill-open { background:#dbeafe; color:#1d4ed8; }
.pill-pause, .pill-overdue, .pill-stopped, .pill-inactive { background:#fee2e2; color:#b91c1c; }
.pill-active { background:#dcfce7; color:#166534; }
.quick-actions, .mini-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top: 14px; }
.button-small { padding: 9px 12px; font-size: .9rem; }
.detail-list, .meta-list { display:grid; gap:10px; margin:0; }
.detail-list > div, .meta-list > div { display:flex; justify-content:space-between; gap:16px; border-bottom:1px solid var(--line); padding-bottom:10px; }
.detail-list dt, .meta-list dt { color: var(--muted); }
.detail-list dd, .meta-list dd { margin:0; text-align:right; }
.placeholder-stack, .note-stack { display:grid; gap:12px; }
.alert-box { padding:16px; margin-top: 16px; }
.section-head { display:flex; justify-content:space-between; gap:12px; align-items:center; margin-bottom: 10px; }
.small { font-size: 1.1rem; line-height:1.25; }
