:root {
  --bg: #0f172a;
  --panel: #111827;
  --surface: #ffffff;
  --muted: #6b7280;
  --text: #111827;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-weak: #eff6ff;
  --danger: #dc2626;
  --success: #16a34a;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  background: #f3f6fb;
  color: var(--text);
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at top left, #dbeafe, #f8fafc 48%);
}

.login-card {
  width: 100%;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.eyebrow {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-weak);
  color: var(--primary);
  font-size: 12px;
  margin-bottom: 12px;
}

h1, h2, h3 {
  margin: 0;
}

.field {
  display: block;
  margin-top: 18px;
}

.field span {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

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

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

.btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
}

.btn-ghost {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-danger {
  background: #fee2e2;
  color: var(--danger);
}

.btn-block {
  width: 100%;
}

.error {
  color: var(--danger);
  min-height: 20px;
  margin-top: 12px;
}

.dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: var(--panel);
  color: #fff;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 24px;
  font-weight: 700;
}

.brand-subtitle {
  margin-top: 6px;
  color: #94a3b8;
  font-size: 13px;
}

.nav {
  margin-top: 32px;
  display: grid;
  gap: 8px;
}

.nav-link {
  text-align: left;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #cbd5e1;
  padding: 12px 14px;
  cursor: pointer;
}

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

.sidebar-footer {
  margin-top: auto;
}

.main {
  padding: 24px 28px 40px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
}

.flash {
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  color: #155e75;
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 20px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.metric-value {
  margin-top: 12px;
  font-size: 28px;
  font-weight: 700;
}

.layout-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.stack {
  display: grid;
  gap: 18px;
}

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

.form-grid .full {
  grid-column: 1 / -1;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

th, td {
  padding: 12px 10px;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
  font-size: 14px;
  vertical-align: top;
}

th {
  color: #475569;
  font-weight: 600;
}

.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-weak);
  color: var(--primary);
  font-size: 12px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

.note {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 14px;
  padding: 12px 14px;
}

.empty {
  color: var(--muted);
  padding: 24px 0;
}

@media (max-width: 1080px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }

  .layout-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
}
