/* ── Variables ────────────────────────────────────────────────── */
:root {
  --sb-bg:      #1e293b;
  --sb-text:    #94a3b8;
  --sb-active:  #3b82f6;
  --sb-w:       230px;
  --body-bg:    #f1f5f9;
  --card-bg:    #fff;
  --accent:     #3b82f6;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', system-ui, sans-serif; background: var(--body-bg); color: #1e293b; }

/* ── Layout ───────────────────────────────────────────────────── */
.sa-wrapper  { display: flex; min-height: 100vh; }
.sa-content  { margin-left: var(--sb-w); padding: 28px; flex: 1; max-width: calc(100vw - var(--sb-w)); }

/* ── Sidebar ──────────────────────────────────────────────────── */
.sa-sidebar {
  width: var(--sb-w);
  background: var(--sb-bg);
  color: var(--sb-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
}

.sa-brand {
  padding: 22px 20px;
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  letter-spacing: -.3px;
}
.sa-brand i { color: var(--accent); font-size: 22px; }

.sa-nav { list-style: none; padding: 14px 0; margin: 0; flex: 1; }
.sa-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: var(--sb-text);
  text-decoration: none;
  font-size: 13.5px;
  transition: all .18s;
  border-left: 3px solid transparent;
}
.sa-nav li a:hover  { background: rgba(255,255,255,.06); color: #fff; }
.sa-nav li a.active { background: rgba(59,130,246,.14); color: #fff; border-left-color: var(--accent); }
.sa-nav li a i      { width: 18px; text-align: center; }

.sa-sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sa-sidebar-footer a { margin-left: auto; color: var(--sb-text); text-decoration: none; }
.sa-sidebar-footer a:hover { color: #ef4444; }

/* ── Page header ─────────────────────────────────────────────── */
.sa-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.sa-page-header h1 { font-size: 20px; font-weight: 700; color: #1e293b; margin: 0; }

/* ── Stat cards ──────────────────────────────────────────────── */
.sa-stat-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  display: flex;
  align-items: center;
  gap: 16px;
}
.sa-stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff; flex-shrink: 0;
}
.sa-stat-icon.blue   { background: #3b82f6; }
.sa-stat-icon.green  { background: #10b981; }
.sa-stat-icon.red    { background: #ef4444; }
.sa-stat-icon.orange { background: #f59e0b; }

.sa-stat-info h2 { font-size: 26px; font-weight: 700; margin: 0; color: #1e293b; }
.sa-stat-info p  { margin: 2px 0 0; font-size: 13px; color: #64748b; }

/* ── General card ────────────────────────────────────────────── */
.sa-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}

/* ── Badges ──────────────────────────────────────────────────── */
.sa-badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .2px;
}
.badge-active   { background: #dcfce7; color: #16a34a; }
.badge-inactive { background: #fee2e2; color: #dc2626; }

/* ── Action buttons ──────────────────────────────────────────── */
.sa-actions { display: flex; gap: 5px; }

.btn-icon {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  font-size: 12px;
  text-decoration: none;
  transition: all .17s;
  cursor: pointer;
  border: 1px solid transparent;
  background: none;
  padding: 0;
}
.btn-icon-primary { background: #eff6ff; color: #3b82f6; border-color: #bfdbfe; }
.btn-icon-primary:hover { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.btn-icon-success { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.btn-icon-success:hover { background: #16a34a; color: #fff; border-color: #16a34a; }
.btn-icon-warning { background: #fffbeb; color: #d97706; border-color: #fde68a; }
.btn-icon-warning:hover { background: #d97706; color: #fff; border-color: #d97706; }
.btn-icon-danger  { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.btn-icon-danger:hover  { background: #dc2626; color: #fff; border-color: #dc2626; }

/* ── Tables ──────────────────────────────────────────────────── */
.table th { font-size: 12px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .4px; }
.table td { font-size: 13.5px; }

/* ── Nav tabs (form) ─────────────────────────────────────────── */
.nav-tabs { border-bottom: none; }
.nav-tabs .nav-link { color: #64748b; border: 1px solid transparent; font-size: 13.5px; }
.nav-tabs .nav-link.active { color: #1e293b; font-weight: 600; border-color: #e2e8f0 #e2e8f0 #fff; background: #fff; }
.sa-card.tab-attached { border-radius: 0 12px 12px 12px; }

/* ── Login page ──────────────────────────────────────────────── */
.sa-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
}
.sa-login-box {
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%; max-width: 370px;
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
}
.sa-login-logo { text-align: center; margin-bottom: 28px; }
.sa-login-logo i   { font-size: 46px; color: var(--accent); }
.sa-login-logo h2  { font-size: 20px; font-weight: 700; margin: 10px 0 2px; color: #1e293b; }
.sa-login-logo p   { font-size: 13px; color: #64748b; margin: 0; }
