/* ============================================================
   DentaCare Pro — Admin Panel CSS
   ============================================================ */

:root {
  --sidebar-w: 248px;
  --topbar-h:  58px;
  --primary:   #2563eb;
  --sidebar-bg:#0f172a;
  --content-bg:#f1f5f9;
  --radius:    12px;
}

/* ── Reset / Base ─── */
*, *::before, *::after { box-sizing: border-box; }
body.admin-body {
  background: var(--content-bg);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px; color: #1e293b; margin: 0;
}

/* ── Sidebar ─── */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  transition: width .25s cubic-bezier(.4,0,.2,1);
  z-index: 1040;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px; color: white; font-weight: 700;
  font-size: 1rem; border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.sidebar-brand i { font-size: 20px; }
.sidebar-nav { padding: 10px 0; flex: 1; }
.nav-section {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; color: #475569;
  padding: 14px 20px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px; color: #94a3b8; font-size: .875rem;
  text-decoration: none; border-left: 3px solid transparent;
  transition: all .15s; cursor: pointer; white-space: nowrap;
}
.nav-item i { width: 18px; text-align: center; font-size: 15px; flex-shrink: 0; }
.nav-item:hover  { color: #e2e8f0; background: rgba(255,255,255,.05); }
.nav-item.active { color: white; background: rgba(37,99,235,.2); border-left-color: var(--primary); }
.nav-logout { color: #f87171; }
.nav-logout:hover { color: #fca5a5; }

/* ── Main wrapper ─── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin-left .25s cubic-bezier(.4,0,.2,1);
}

/* ── Topbar ─── */
.topbar {
  height: var(--topbar-h); background: white;
  border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px; position: sticky; top: 0; z-index: 100;
  flex-shrink: 0;
}
.sidebar-toggle {
  width: 36px; height: 36px; border: none; background: #f8fafc;
  border-radius: 8px; cursor: pointer; color: #64748b;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; transition: background .15s;
}
.sidebar-toggle:hover { background: #e2e8f0; }
.topbar-title { font-weight: 600; font-size: 1rem; color: #1e293b; }
.topbar-right  { display: flex; align-items: center; }
.topbar-user   { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
}
.user-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.user-role { font-size: 11px; color: #94a3b8; }

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

/* ── Stat cards ─── */
.stat-card {
  background: white; border-radius: var(--radius); padding: 20px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
  border-left: 4px solid transparent;
  transition: transform .2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 20px;
}
.stat-num  { font-size: 1.75rem; font-weight: 800; color: #0f172a; line-height: 1.1; }
.stat-lbl  { font-size: .75rem; color: #64748b; margin-top: 3px; }

/* ── Cards ─── */
.card { border-radius: var(--radius) !important; }
.card-header {
  background: white; font-size: .875rem; padding: 13px 18px;
  border-bottom: 1px solid #f1f5f9; border-radius: var(--radius) var(--radius) 0 0 !important;
}

/* ── Tables ─── */
.table { font-size: .875rem; }
.table th {
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: #64748b; border-bottom: 1px solid #e2e8f0 !important;
  padding: 10px 14px;
}
.table td { padding: 11px 14px; vertical-align: middle; border-color: #f1f5f9; }
.table-hover tbody tr:hover { background: #f8fafc; }

/* ── Buttons ─── */
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 5px; }

/* ── Patient avatar ─── */
.patient-avatar {
  width: 34px; height: 34px; border-radius: 9px;
  background: #dbeafe; color: #1d4ed8;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.patient-avatar-lg {
  width: 56px; height: 56px; border-radius: 14px;
  background: #dbeafe; color: #1d4ed8;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px; flex-shrink: 0;
}

/* ── Login page ─── */
.login-body {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center; padding: 20px;
}
.login-wrapper { width: 100%; max-width: 420px; }
.login-card {
  background: white; border-radius: 20px; padding: 36px 32px;
  box-shadow: 0 24px 64px rgba(0,0,0,.3);
}
.login-logo {
  width: 60px; height: 60px; border-radius: 16px;
  background: #eff6ff; display: flex; align-items: center;
  justify-content: center; margin: 0 auto;
}

/* ── Collapsed sidebar ─── */
.sidebar-collapsed .sidebar { width: 0; }
.sidebar-collapsed .main-wrapper { margin-left: 0; }

/* ── Responsive ─── */
@media (max-width: 991px) {
  .sidebar { width: 0; }
  .sidebar.open { width: var(--sidebar-w); box-shadow: 4px 0 24px rgba(0,0,0,.3); }
  .main-wrapper { margin-left: 0; }
}

/* ── Alerts ─── */
.alert { border-radius: 10px; font-size: .875rem; }

/* ── Form controls ─── */
.form-control, .form-select { border-radius: 8px; font-size: .875rem; border-color: #e2e8f0; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.input-group-text { border-color: #e2e8f0; background: #f8fafc; }

/* ── Nav tabs ─── */
.nav-tabs .nav-link { font-size: .875rem; color: #64748b; border-radius: 8px 8px 0 0; }
.nav-tabs .nav-link.active { color: var(--primary); font-weight: 600; }
