@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #4361EE;
  --primary-dark: #3651D4;
  --primary-darker: #2D44C8;
  --primary-light: #6B83F0;
  --primary-bg: #EEF0FD;
  --secondary: #0ea5e9;
  --success: #10b981;
  --success-bg: #d1fae5;
  --success-text: #065f46;
  --warning: #FFA800;
  --warning-bg: #FFF4DE;
  --warning-text: #946200;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --danger-text: #991b1b;
  --info: #3b82f6;
  --info-bg: #dbeafe;
  --info-text: #1e40af;
  --purple: #8b5cf6;
  --purple-bg: #ede9fe;
  --purple-text: #5b21b6;
  --gray-bg: #f3f4f6;
  --gray-text: #4b5563;
  --sidebar-bg: #FFFFFF;
  --sidebar-width: 220px;
  --sidebar-collapsed-width: 56px;
  --topbar-height: 64px;
  --body-bg: #F5F6FA;
  --card-bg: #ffffff;
  --card-shadow: 0 2px 8px rgba(0,0,0,.05);
  --card-shadow-hover: 0 6px 20px rgba(0,0,0,.09);
  --border-color: #EFEFEF;
  --text-primary: #1A1D1F;
  --text-secondary: #6F767E;
  --text-muted: #9A9FA5;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: all .2s cubic-bezier(.4,0,.2,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--body-bg);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

::selection { background: var(--primary-bg); color: var(--primary-dark); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D9D9D9; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #BDBDBD; }

/* ─── Layout ─── */
.layout { display: flex; min-height: 100vh; }

/* ─── Sidebar ─── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  border-right: 1px solid var(--border-color);
  transition: width .25s ease;
  overflow: visible;
}
.sidebar-inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar-logo {
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
  white-space: nowrap;
}
.sidebar-logo .logo-icon {
  width: 36px; height: 36px; min-width: 36px;
  background: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(67,97,238,.35);
}
.sidebar-logo-text { overflow: hidden; white-space: nowrap; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

.nav-section-title { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: calc(100% - 16px);
  height: 44px;
  margin: 0 8px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: var(--transition);
  position: relative;
  gap: 12px;
  overflow: hidden;
  white-space: nowrap;
  text-decoration: none;
}
.nav-item:hover {
  background: var(--primary-bg);
  color: var(--primary);
}
.nav-item.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 10px rgba(67,97,238,.35);
}
.nav-item.active::before { display: none; }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-label { font-size: 13px; font-weight: 500; }
.nav-badge { display: none; }

.sidebar-user {
  padding: 14px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
  overflow: hidden;
}
.sidebar-user .avatar {
  width: 36px; height: 36px; min-width: 36px;
  background: linear-gradient(135deg, #6B83F0, #4361EE);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.sidebar-user-info {
  overflow: hidden;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text-primary);
}
.sidebar-collapse-btn {
  position: absolute;
  top: 8px; right: -14px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 50%;
  font-size: 14px;
  transition: var(--transition);
  z-index: 10;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.sidebar-collapse-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.collapse-icon-collapse { display: none; }
.sidebar.collapsed .collapse-icon-collapse { display: block; }
.sidebar.collapsed .collapse-icon-expand { display: none; }
.sidebar.collapsed .sidebar-collapse-btn { right: -14px; }
.sidebar.collapsed .sidebar-logo-text { display: none; }
.sidebar.collapsed .sidebar-user-info { display: none; }

/* ─── Main Content ─── */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .25s ease;
}
.sidebar.collapsed ~ .main { margin-left: var(--sidebar-collapsed-width); }

/* ─── Topbar ─── */
.topbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 0 28px;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-left h2 {
  font-size: 20px; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.02em;
}
.topbar-right { display: flex; align-items: center; gap: 4px; }

.topbar-icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
  position: relative;
  border: none;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}
.topbar-icon-btn:hover {
  background: var(--body-bg);
  color: var(--text-primary);
}
.topbar-icon-btn .dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid #fff;
}
.topbar-user {
  display: flex; align-items: center;
  padding: 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  margin-left: 4px;
}
.topbar-user:hover { background: var(--body-bg); }
.topbar-user .avatar-sm {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #6B83F0, #4361EE);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 700;
}
.topbar-user .status-dot {
  position: absolute;
  bottom: 5px; right: 5px;
  width: 9px; height: 9px;
  background: #10b981;
  border-radius: 50%;
  border: 2px solid #fff;
}

/* ─── Page Content ─── */
.page-content {
  padding: 24px 28px;
  flex: 1;
}

/* ─── Breadcrumb ─── */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted);
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--text-muted); font-size: 11px; }
.breadcrumb .current { color: var(--text-primary); font-weight: 500; }

/* ─── Stat Cards ─── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  padding: 20px 22px;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  overflow: hidden;
}
.stat-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}
.stat-info { flex: 1; min-width: 0; }
.stat-label {
  font-size: 12px; font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-value {
  font-size: 26px; font-weight: 800;
  color: var(--primary);
  letter-spacing: -.03em;
  line-height: 1.1;
}
.stat-period {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.stat-delta {
  font-size: 12px; margin-top: 6px;
  display: flex; align-items: center; gap: 4px;
}
.stat-delta.up { color: var(--success); }
.stat-delta.down { color: var(--danger); }

/* Donut Chart */
.stat-donut {
  position: relative;
  flex-shrink: 0;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
}
.donut {
  width: 56px; height: 56px;
  position: absolute; top: 0; left: 0;
}
.donut-track {
  fill: none;
  stroke: #F0F1FE;
  stroke-width: 3;
}
.donut-fill {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray .5s ease;
}
.donut-fill.primary { stroke: var(--primary); }
.donut-fill.orange   { stroke: #FFA800; }
.donut-fill.success  { stroke: var(--success); }
.donut-fill.info     { stroke: var(--info); }
.donut-pct {
  position: relative;
  font-size: 10px; font-weight: 700;
  color: var(--text-primary);
  z-index: 1;
}

/* ─── Cards ─── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  margin-bottom: 24px;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
}
.card:hover { box-shadow: var(--card-shadow-hover); }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 {
  font-size: 14px; font-weight: 600;
  color: var(--text-primary);
}
.card-body { padding: 20px; }
.card-body.no-padding { padding: 0; }

/* ─── Tables ─── */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 11px 18px;
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  background: #FAFAFA;
}
td {
  padding: 13px 18px;
  font-size: 13px;
  border-bottom: 1px solid #F7F7F7;
  vertical-align: middle;
  color: var(--text-secondary);
}
td strong { color: var(--text-primary); font-weight: 600; }
tbody tr { transition: var(--transition); }
tbody tr:hover td { background: rgba(67,97,238,.025); }
tbody tr:last-child td { border-bottom: none; }

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
}
.badge-green  { background: var(--success-bg); color: var(--success-text); }
.badge-yellow { background: var(--warning-bg); color: var(--warning-text); }
.badge-red    { background: var(--danger-bg);  color: var(--danger-text); }
.badge-blue   { background: var(--info-bg);    color: var(--info-text); }
.badge-gray   { background: var(--gray-bg);    color: var(--gray-text); }
.badge-purple { background: var(--purple-bg);  color: var(--purple-text); }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(67,97,238,.3);
}
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(67,97,238,.4);
  transform: translateY(-1px);
  color: #fff;
}
.btn-secondary {
  background: #fff;
  color: var(--text-secondary);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background: var(--body-bg);
  color: var(--text-primary);
  border-color: #D9D9D9;
}
.btn-danger {
  background: #fff;
  color: var(--danger);
  border-color: #fecaca;
}
.btn-danger:hover { background: var(--danger-bg); }
.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16,185,129,.3);
}
.btn-success:hover {
  box-shadow: 0 4px 12px rgba(16,185,129,.4);
  transform: translateY(-1px);
  color: #fff;
}
.btn-sm  { padding: 6px 12px; font-size: 12px; }
.btn-xs  { padding: 3px 8px; font-size: 11px; border-radius: 6px; }

/* ─── Forms ─── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-primary);
  background: #fff;
  transition: var(--transition);
  font-family: inherit;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67,97,238,.12);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { min-height: 80px; resize: vertical; line-height: 1.6; }
select.form-control { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239A9FA5' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }

/* ─── Alerts ─── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-error   { background: var(--danger-bg);  color: var(--danger-text);  border: 1px solid #fecaca; }
.alert-success { background: var(--success-bg); color: var(--success-text); border: 1px solid #a7f3d0; }
.alert-info    { background: var(--info-bg);    color: var(--info-text);    border: 1px solid #93c5fd; }

/* ─── Tabs ─── */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 24px;
}
.tab {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  text-decoration: none;
  background: none;
  font-family: inherit;
  transition: var(--transition);
}
.tab:hover { color: var(--primary); }
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ─── Tab Content ─── */
.tab-content {
  margin-bottom: 20px;
}

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: .3; }
.empty-state p { font-size: 14px; }

/* ─── Pagination ─── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 24px;
}
.pagination a, .pagination span {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}
.pagination span {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(67,97,238,.3);
}
.pagination a:hover {
  background: var(--primary-bg);
  color: var(--primary);
  border-color: var(--primary);
}

/* ─── Filter Bar ─── */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-bar .form-control { width: auto; min-width: 180px; }
.filter-bar .form-control.search { min-width: 280px; }

/* ─── Detail Grid ─── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-item { padding: 10px 0; }
.detail-item .label {
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.detail-item .value {
  font-size: 14px;
  margin-top: 4px;
  color: var(--text-primary);
}

/* ─── Perm Matrix ─── */
.perm-matrix { overflow-x: auto; }
.perm-matrix table { font-size: 12px; }
.perm-matrix th { text-align: center; font-size: 11px; padding: 10px 8px; }
.perm-matrix td { text-align: center; padding: 10px 8px; }
.perm-matrix td:first-child { text-align: left; font-weight: 500; }
.perm-matrix input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ─── Section Headers ─── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.section-header h2 {
  font-size: 22px; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.02em;
}
.section-header .subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ─── Grid Layouts ─── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .grid-2    { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .page-content { padding: 18px 16px; }
}

/* ─── Animations ─── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-content > * { animation: fadeIn .3s ease-out; }
.stat-card { animation: fadeIn .4s ease-out; }
.stat-card:nth-child(2) { animation-delay: .05s; }
.stat-card:nth-child(3) { animation-delay: .10s; }
.stat-card:nth-child(4) { animation-delay: .15s; }

/* ─── Auth Page ─── */
.auth-wrapper { display: flex; width: 100%; min-height: 100vh; }

.auth-left {
  flex: 1;
  background: linear-gradient(145deg, #1B2A6B 0%, #2D44C8 50%, #4361EE 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}
.auth-left::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(107,131,240,.18) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(67,97,238,.12) 0%, transparent 50%);
  animation: bgFloat 15s ease-in-out infinite;
}
@keyframes bgFloat {
  0%, 100% { transform: translate(0,0) rotate(0deg); }
  50%       { transform: translate(-2%,2%) rotate(1deg); }
}

.auth-left .brand { text-align: center; position: relative; z-index: 1; }
.auth-left .brand .logo-big {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, rgba(255,255,255,.2), rgba(255,255,255,.05));
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  font-size: 32px; font-weight: 800; color: #fff;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.15);
}
.auth-left .brand h2 { font-size: 28px; font-weight: 700; color: #fff; margin-bottom: 12px; letter-spacing: -.02em; }
.auth-left .brand p  { font-size: 15px; color: rgba(255,255,255,.6); line-height: 1.6; max-width: 360px; }

.auth-left .features { margin-top: 48px; position: relative; z-index: 1; display: flex; flex-direction: column; gap: 16px; }
.auth-left .features .feat { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.75); font-size: 14px; }
.auth-left .features .feat .feat-icon {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.1);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.auth-left .features .feat .feat-icon svg { width: 18px; height: 18px; color: #6B83F0; }

.auth-right {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  background: #fff;
}
.auth-container { width: 100%; max-width: 420px; }

.auth-card { background: transparent; }
.auth-card .auth-logo { margin-bottom: 36px; }
.auth-card .auth-logo h1 { font-size: 26px; font-weight: 800; color: var(--text-primary); letter-spacing: -.02em; }
.auth-card .auth-logo p  { font-size: 14px; color: var(--text-secondary); margin-top: 8px; line-height: 1.5; }
.auth-card .auth-logo .welcome { color: var(--primary); font-weight: 600; }
.auth-card .form-group { margin-bottom: 20px; }
.auth-card .form-group label { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.auth-card .form-control {
  padding: 12px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  font-size: 14px;
}
.auth-card .form-control:focus { box-shadow: 0 0 0 4px rgba(67,97,238,.1); }
.auth-card .btn { width: 100%; padding: 12px 20px; border-radius: 10px; font-size: 14px; font-weight: 600; border: none; }
.auth-card .btn-primary:hover { border: none; }
.auth-card .alert { margin-bottom: 24px; border-radius: 10px; }
.auth-footer {
  text-align: center; margin-top: 32px;
  padding-top: 24px; border-top: 1px solid var(--border-color);
  font-size: 12px; color: var(--text-muted); line-height: 1.6;
}

@media (max-width: 768px) {
  .auth-wrapper { flex-direction: column; }
  .auth-left { display: none; }
  .auth-right { padding: 24px; }
}

/* ─── Nav Tree ─── */
.nav-group {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.nav-group-toggle {
  display: flex;
  align-items: center;
  width: calc(100% - 16px);
  height: 44px;
  margin: 0 8px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: var(--transition);
  gap: 12px;
  overflow: hidden;
  white-space: nowrap;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.nav-group-toggle:hover {
  background: var(--primary-bg);
  color: var(--primary);
}
.nav-group-toggle.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 10px rgba(67,97,238,.35);
}
.nav-group-toggle svg {
  width: 20px; height: 20px;
  flex-shrink: 0;
}
.nav-group-toggle .nav-label {
  flex: 1;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
}
.nav-group-toggle .nav-arrow {
  width: 16px; height: 16px;
  transition: transform .2s ease;
  flex-shrink: 0;
}
.nav-group.expanded .nav-group-toggle .nav-arrow {
  transform: rotate(90deg);
}
.nav-group-items {
  overflow: hidden;
  max-height: 0;
  transition: max-height .25s ease;
}
.nav-group.expanded .nav-group-items {
  max-height: 200px;
}
.nav-sub-item {
  display: flex;
  align-items: center;
  width: calc(100% - 16px);
  height: 38px;
  margin: 0 8px;
  padding: 0 12px 0 48px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: var(--transition);
  gap: 10px;
  overflow: hidden;
  white-space: nowrap;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.nav-sub-item:hover {
  background: var(--primary-bg);
  color: var(--primary);
}
.nav-sub-item.active {
  background: rgba(67,97,238,.12);
  color: var(--primary);
  font-weight: 600;
}
.nav-sub-item svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
}

.sidebar.collapsed .nav-group-items { max-height: 0 !important; }
.sidebar.collapsed .nav-arrow { display: none; }
.sidebar.collapsed .nav-sub-item { padding-left: 12px; height: 0; margin: 0; padding-top: 0; padding-bottom: 0; }

/* ─── Focus ring ─── */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
