:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-alt: #eef4ff;
  --line: #dfe8f5;
  --primary: #1d4ed8;
  --primary-dark: #1e3a8a;
  --text: #111827;
  --muted: #64748b;
  --success: #0f766e;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: linear-gradient(180deg, #eef4ff 0%, #f8fafc 100%);
  color: var(--text);
}
button, input { font: inherit; }

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

.sidebar {
  background: #0f172a;
  color: #f8fafc;
  padding: 24px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  padding: 8px 10px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  font-weight: 800;
}

.brand strong { display: block; }
.brand small { color: #cbd5e1; }

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav a {
  display: block;
  text-decoration: none;
  color: #e2e8f0;
  padding: 12px 14px; border-radius: 10px;
  font-weight: 600;
}

.nav a.active,
.nav a:hover {
  background: rgba(148, 163, 184, 0.14);
}

.main-panel {
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

.topbar-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  height: 52px;
  box-shadow: var(--shadow);
}
.topbar-search input {
  border: 0; outline: none; background: transparent; width: 100%; color: var(--muted);
}

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

.quick-btn, .secondary, .primary, .action-list button {
  border: 1px solid var(--line);
  background: white; color: var(--text);
  border-radius: 10px;
  padding: 11px 16px;
  cursor: pointer;
  font-weight: 600;
}

.quick-btn.primary, .primary {
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: white; border-color: transparent;
}

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

.eyebrow {
  margin: 0; color: var(--primary); text-transform: uppercase; font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
}

h1 { margin: 6px 0 0; font-size: clamp(2rem, 3vw, 2.6rem); }
.header-actions { display: flex; gap: 10px; }

.stats-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px;
}

.stat-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px 18px 16px; box-shadow: var(--shadow);
}
.stat-card.warning { background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%); }
.stat-card .stat-label { display: block; color: var(--muted); font-size: 0.8rem; margin-bottom: 12px; }
.stat-card strong { font-size: clamp(1.5rem, 2vw, 2rem); }

.content-grid {
  display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(280px, 0.9fr); gap: 18px; margin-bottom: 22px;
}

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

.panel.large { padding: 18px 18px 8px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.panel-header h2 { margin: 0; font-size: 1.1rem; }
.panel-header a { color: var(--primary); text-decoration: none; font-weight: 600; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }

.status-tag {
  display: inline-block; background: #e0f2fe; color: #075985; padding: 5px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700;
}

.action-list {
  display: grid; grid-template-columns: 1fr; gap: 10px;
}
.action-list button {
  text-align: left; background: #f8fafc;
}

.bottom-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px;
}

.mini-list, .notice-list {
  list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px;
}
.mini-list li, .notice-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line);
}
.mini-list strong, .notice-list strong { display: block; }
.mini-list small, .notice-list p { color: var(--muted); margin: 2px 0 0; }

.status-dot {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block;
}
.status-dot.active { background: var(--success); }

.chip-list {
  display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0;
}
.chip-list li {
  background: #eff6ff; color: var(--primary-dark); border: 1px solid #bfdbfe; padding: 8px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700;
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { padding: 18px 16px; }
  .nav { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .content-grid, .bottom-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .main-panel { padding: 16px; }
  .topbar, .page-header { flex-direction: column; align-items: stretch; }
  .topbar-actions, .header-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
}
