/* ========================================
   CARENEXT — DASHBOARD STYLES
   ======================================== */

/* --- BASE RESET (same as landing) --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue-50: #EFF6FF; --blue-100: #DBEAFE; --blue-200: #BFDBFE;
  --blue-500: #3B82F6; --blue-600: #2563EB; --blue-700: #1D4ED8;
  --cyan-400: #22D3EE; --cyan-500: #06B6D4;
  --green-50: #F0FDF4; --green-400: #4ADE80; --green-500: #22C55E; --green-600: #16A34A;
  --purple-50: #F5F3FF; --purple-500: #8B5CF6;
  --orange-50: #FFF7ED; --orange-500: #F97316;
  --red-50: #FEF2F2; --red-400: #F87171; --red-500: #EF4444;
  --yellow-50: #FEFCE8; --yellow-500: #EAB308;
  --gray-50: #F9FAFB; --gray-100: #F3F4F6; --gray-200: #E5E7EB;
  --gray-300: #D1D5DB; --gray-400: #9CA3AF; --gray-500: #6B7280;
  --gray-600: #4B5563; --gray-700: #374151; --gray-800: #1F2937; --gray-900: #111827;
  --white: #FFFFFF;
  --sidebar-w: 256px;
  --topbar-h: 68px;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-xl: 24px; --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
  --trans: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== LOGIN SCREEN ===== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0F172A 0%, #1e3a5f 50%, #064E3B 100%);
  position: relative;
  overflow: hidden;
}

.login-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
}
.orb-1 { width:500px; height:500px; background:rgba(59,130,246,0.2); top:-100px; right:-100px; }
.orb-2 { width:400px; height:400px; background:rgba(6,182,212,0.15); bottom:-100px; left:-100px; }

.login-card {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 32px 64px rgba(0,0,0,0.4);
  position: relative;
  z-index: 1;
}

.login-header { text-align: center; margin-bottom: 36px; }
.login-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.login-logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--blue-500), var(--cyan-500));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.login-logo-text {
  font-size: 26px;
  font-weight: 900;
  color: var(--white);
  letter-spacing: -0.04em;
}
.login-title { font-size: 24px; font-weight: 800; color: var(--white); margin-bottom: 8px; letter-spacing: -0.03em; }
.login-subtitle { font-size: 14px; color: rgba(255,255,255,0.5); }

.login-form { display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.7); }

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  font-size: 15px;
  color: var(--white);
  font-family: inherit;
  transition: var(--trans);
  outline: none;
}
.form-input::placeholder { color: rgba(255,255,255,0.3); }
.form-input:focus {
  border-color: rgba(59,130,246,0.6);
  background: rgba(59,130,246,0.08);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.role-select {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.role-option {
  padding: 10px 8px;
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: var(--trans);
  background: rgba(255,255,255,0.04);
}
.role-option .role-icon { font-size: 20px; margin-bottom: 4px; }
.role-option .role-name { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.6); }
.role-option.selected {
  border-color: var(--blue-500);
  background: rgba(59,130,246,0.15);
}
.role-option.selected .role-name { color: var(--white); }

.login-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--blue-500), var(--cyan-500));
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--trans);
  box-shadow: 0 4px 14px rgba(59,130,246,0.35);
}
.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59,130,246,0.45);
}

.login-footer { text-align: center; margin-top: 20px; font-size: 13px; color: rgba(255,255,255,0.35); }
.login-footer a { color: var(--cyan-400); }

/* ===== APP LAYOUT ===== */
#app { display: none; }
#app.active { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: var(--trans);
  box-shadow: var(--shadow-sm);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--gray-100);
}
.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--blue-500), var(--cyan-500));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.sidebar-logo-text {
  font-size: 18px;
  font-weight: 900;
  color: var(--gray-900);
  letter-spacing: -0.04em;
}

.daycare-name {
  padding: 12px 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-nav { flex: 1; padding: 8px 12px; overflow-y: auto; }

.nav-group { margin-bottom: 24px; }
.nav-group-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0 8px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--trans);
  position: relative;
  user-select: none;
}
.nav-item:hover { background: var(--gray-50); color: var(--gray-900); }
.nav-item.active {
  background: var(--blue-50);
  color: var(--blue-700);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--blue-500);
  border-radius: 0 3px 3px 0;
}

.nav-icon { font-size: 17px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-label { flex: 1; }
.nav-badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--blue-500);
  color: var(--white);
  padding: 1px 7px;
  border-radius: var(--radius-full);
}
.nav-badge.red { background: var(--red-500); }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--gray-100);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--trans);
}
.sidebar-user:hover { background: var(--gray-50); }
.user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--blue-500), var(--cyan-500));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 700; color: var(--gray-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--gray-400); }
.user-menu-icon { font-size: 14px; color: var(--gray-400); }

/* ===== MAIN CONTENT ===== */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== TOPBAR ===== */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  flex: 1;
}
.topbar-title h1 {
  font-size: 20px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.03em;
}
.topbar-title p {
  font-size: 13px;
  color: var(--gray-400);
}

.topbar-search {
  position: relative;
}
.topbar-search input {
  padding: 9px 14px 9px 38px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-family: inherit;
  color: var(--gray-700);
  outline: none;
  width: 240px;
  transition: var(--trans);
}
.topbar-search input:focus {
  border-color: var(--blue-300);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  color: var(--gray-400);
}

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

.icon-btn {
  width: 38px;
  height: 38px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  cursor: pointer;
  transition: var(--trans);
  position: relative;
}
.icon-btn:hover { background: var(--gray-100); border-color: var(--gray-300); }

.notif-indicator {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: var(--red-500);
  border-radius: 50%;
  border: 1.5px solid var(--white);
}

.topbar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: linear-gradient(135deg, var(--blue-500), var(--cyan-500));
  color: var(--white);
  border: none;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--trans);
  box-shadow: 0 3px 10px rgba(59,130,246,0.3);
}
.topbar-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(59,130,246,0.4); }

/* ===== PAGE CONTENT ===== */
.page-content {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
}

/* VIEWS */
.view { display: none; }
.view.active { display: block; }

/* ===== DASHBOARD VIEW ===== */
.alerts-banner {
  background: linear-gradient(135deg, #FFF7ED, #FFEDD5);
  border: 1px solid #FED7AA;
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.alert-icon { font-size: 20px; }
.alert-text { flex: 1; font-size: 14px; color: #92400E; font-weight: 500; }
.alert-text strong { color: #78350F; }
.alert-close { font-size: 18px; color: #92400E; cursor: pointer; opacity: 0.5; }
.alert-close:hover { opacity: 1; }

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--gray-100);
  transition: var(--trans);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}
.stat-card.blue::before { background: linear-gradient(90deg, var(--blue-500), var(--cyan-400)); }
.stat-card.green::before { background: linear-gradient(90deg, var(--green-500), #14B8A6); }
.stat-card.purple::before { background: linear-gradient(90deg, var(--purple-500), #8B5CF6); }
.stat-card.orange::before { background: linear-gradient(90deg, var(--orange-500), #EAB308); }

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.stat-label { font-size: 13px; font-weight: 600; color: var(--gray-500); }
.stat-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.stat-icon-wrap.blue { background: var(--blue-50); }
.stat-icon-wrap.green { background: var(--green-50); }
.stat-icon-wrap.purple { background: var(--purple-50); }
.stat-icon-wrap.orange { background: var(--orange-50); }

.stat-value {
  font-size: 32px;
  font-weight: 900;
  color: var(--gray-900);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}
.stat-change.up { background: #DCFCE7; color: var(--green-600); }
.stat-change.down { background: #FEE2E2; color: var(--red-500); }

/* ===== DASHBOARD GRID ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 360px;
  gap: 20px;
}

/* CHART WIDGET */
.widget {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 24px;
  overflow: hidden;
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.widget-title { font-size: 15px; font-weight: 700; color: var(--gray-900); letter-spacing: -0.01em; }
.widget-subtitle { font-size: 12px; color: var(--gray-400); margin-top: 2px; }

.widget-actions { display: flex; gap: 8px; }
.widget-tab {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  transition: var(--trans);
  border: 1px solid transparent;
}
.widget-tab.active {
  background: var(--blue-50);
  color: var(--blue-600);
  border-color: var(--blue-200);
}

/* CHART */
.chart-area {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 100%;
  padding-bottom: 24px;
}

.bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.bar {
  width: 100%;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--blue-500), var(--blue-400));
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}
.bar:hover { filter: brightness(1.1); transform: scaleY(1.03); transform-origin: bottom; }
.bar.alt { background: linear-gradient(180deg, var(--cyan-500), var(--cyan-400)); }

.bar-label {
  font-size: 10px;
  color: var(--gray-400);
  font-weight: 500;
}

/* DONUT CHART */
.donut-chart-wrap {
  display: flex;
  align-items: center;
  gap: 28px;
}

.donut-svg { transform: rotate(-90deg); }
.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.donut-center .dc-val { font-size: 24px; font-weight: 900; color: var(--gray-900); line-height: 1; }
.donut-center .dc-lbl { font-size: 11px; color: var(--gray-400); }

.donut-wrap { position: relative; flex-shrink: 0; }

.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.legend-item { display: flex; align-items: center; gap: 8px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-text { font-size: 13px; color: var(--gray-600); flex: 1; }
.legend-pct { font-size: 13px; font-weight: 700; color: var(--gray-900); }

/* CHECKINS TABLE */
.checkins-table { width: 100%; border-collapse: collapse; }
.checkins-table th {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 0;
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
}
.checkins-table td {
  padding: 12px 0;
  font-size: 13px;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-50);
  vertical-align: middle;
}
.checkins-table tr:last-child td { border-bottom: none; }

.child-row-info { display: flex; align-items: center; gap: 10px; }
.child-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}
.child-name { font-weight: 600; color: var(--gray-900); font-size: 13px; }
.child-age { font-size: 11px; color: var(--gray-400); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
}
.status-pill.in { background: #DCFCE7; color: #16A34A; }
.status-pill.out { background: #FEE2E2; color: #DC2626; }
.status-pill.absent { background: var(--gray-100); color: var(--gray-500); }

/* ACTIVITY FEED */
.activity-feed { display: flex; flex-direction: column; }
.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-50);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.activity-icon.blue { background: var(--blue-50); }
.activity-icon.green { background: var(--green-50); }
.activity-icon.orange { background: var(--orange-50); }
.activity-icon.red { background: var(--red-50); }

.activity-text { flex: 1; }
.activity-title { font-size: 13px; font-weight: 600; color: var(--gray-800); margin-bottom: 2px; }
.activity-desc { font-size: 12px; color: var(--gray-400); }
.activity-time { font-size: 11px; color: var(--gray-400); white-space: nowrap; padding-top: 2px; }

/* ===== CHILDREN VIEW ===== */
.view-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  padding: 9px 16px;
  flex: 1;
  max-width: 340px;
}
.search-box input {
  border: none;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  color: var(--gray-700);
  background: transparent;
  width: 100%;
}
.search-box input::placeholder { color: var(--gray-400); }

.filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  font-family: inherit;
  transition: var(--trans);
}
.filter-btn:hover { background: var(--gray-50); border-color: var(--gray-300); }
.filter-btn.active { background: var(--blue-50); border-color: var(--blue-200); color: var(--blue-600); }

.view-btn {
  width: 38px;
  height: 38px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: var(--trans);
}
.view-btn:hover { background: var(--gray-50); }
.view-btn.active { background: var(--blue-50); border-color: var(--blue-200); }

.add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: linear-gradient(135deg, var(--blue-500), var(--cyan-500));
  color: var(--white);
  border: none;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--trans);
  margin-left: auto;
  box-shadow: 0 3px 10px rgba(59,130,246,0.3);
}
.add-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(59,130,246,0.4); }

.children-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.child-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--trans);
  cursor: pointer;
}
.child-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--blue-100); }

.child-card-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.child-card-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--white);
  flex-shrink: 0;
}
.child-card-info { flex: 1; }
.child-card-name { font-size: 15px; font-weight: 700; color: var(--gray-900); margin-bottom: 3px; }
.child-card-details { font-size: 12px; color: var(--gray-400); }

.child-card-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--gray-50);
  border-bottom: 1px solid var(--gray-50);
  margin-bottom: 12px;
}
.child-card-status-label { font-size: 12px; color: var(--gray-500); }

.child-card-meta { display: flex; gap: 16px; }
.child-meta-item { font-size: 12px; color: var(--gray-500); }
.child-meta-item strong { display: block; font-size: 11px; color: var(--gray-400); font-weight: 600; margin-bottom: 1px; }

/* ===== BILLING VIEW ===== */
.billing-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.invoice-table-wrapper {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
}
.table-title { font-size: 15px; font-weight: 700; color: var(--gray-900); }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 24px;
  text-align: left;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
}
.data-table td {
  padding: 14px 24px;
  font-size: 14px;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-50);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--blue-50); }

.invoice-id { font-weight: 700; color: var(--blue-600); font-family: monospace; }
.amount-cell { font-weight: 700; color: var(--gray-900); }

.badge {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
}
.badge.paid { background: #DCFCE7; color: #16A34A; }
.badge.pending { background: #FEF9C3; color: #CA8A04; }
.badge.overdue { background: #FEE2E2; color: #DC2626; }
.badge.draft { background: var(--gray-100); color: var(--gray-500); }

.action-cell { display: flex; gap: 8px; }
.action-btn {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  font-family: inherit;
  transition: var(--trans);
}
.action-btn:hover { background: var(--gray-50); border-color: var(--gray-300); }
.action-btn.primary { background: var(--blue-50); border-color: var(--blue-200); color: var(--blue-600); }

/* ===== MESSAGES VIEW ===== */
.messages-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  height: calc(100vh - 160px);
}

.conversations-panel {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.conv-search {
  padding: 16px;
  border-bottom: 1px solid var(--gray-100);
}
.conv-search input {
  width: 100%;
  padding: 8px 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-family: inherit;
  color: var(--gray-700);
  outline: none;
}

.conversations-list { flex: 1; overflow-y: auto; }

.conv-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-50);
  transition: var(--trans);
}
.conv-item:hover { background: var(--gray-50); }
.conv-item.active { background: var(--blue-50); border-left: 3px solid var(--blue-500); }
.conv-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
  position: relative;
}
.conv-online {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 9px;
  height: 9px;
  background: var(--green-500);
  border-radius: 50%;
  border: 1.5px solid var(--white);
}
.conv-info { flex: 1; min-width: 0; }
.conv-name { font-size: 13px; font-weight: 700; color: var(--gray-900); margin-bottom: 2px; }
.conv-preview { font-size: 12px; color: var(--gray-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.conv-time { font-size: 11px; color: var(--gray-400); }
.conv-unread {
  width: 18px;
  height: 18px;
  background: var(--blue-500);
  color: var(--white);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* CHAT WINDOW */
.chat-window {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
}
.chat-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-500), var(--cyan-500));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
}
.chat-header-info { flex: 1; }
.chat-header-name { font-size: 15px; font-weight: 700; color: var(--gray-900); }
.chat-header-status { font-size: 12px; color: var(--green-500); font-weight: 500; }
.chat-header-actions { display: flex; gap: 8px; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--gray-50);
}

.chat-date-divider {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.message-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.message-row.sent { flex-direction: row-reverse; }

.msg-bubble-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-500), var(--teal-500, #14B8A6));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}

.message-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
}

.message-bubble.received {
  background: var(--white);
  color: var(--gray-800);
  border: 1px solid var(--gray-100);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.message-bubble.sent {
  background: linear-gradient(135deg, var(--blue-500), var(--cyan-500));
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.bubble-time { font-size: 11px; opacity: 0.65; display: block; margin-top: 4px; }
.sent .bubble-time { text-align: right; }

.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-family: inherit;
  color: var(--gray-800);
  outline: none;
  transition: var(--trans);
}
.chat-input:focus { border-color: var(--blue-300); background: var(--white); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.chat-input::placeholder { color: var(--gray-400); }

.send-btn {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--blue-500), var(--cyan-500));
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: var(--trans);
  flex-shrink: 0;
}
.send-btn:hover { transform: scale(1.1); box-shadow: 0 4px 12px rgba(59,130,246,0.4); }

/* ===== ATTENDANCE VIEW ===== */
.attendance-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}

.attendance-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.date-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  padding: 6px 16px;
}
.date-nav-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--gray-600);
  padding: 2px;
  line-height: 1;
  transition: var(--trans);
}
.date-nav-btn:hover { color: var(--gray-900); }
.date-text { font-size: 14px; font-weight: 700; color: var(--gray-900); min-width: 160px; text-align: center; }

.checkin-qr-card {
  background: linear-gradient(135deg, var(--blue-500), var(--cyan-500));
  border-radius: var(--radius-lg);
  padding: 28px;
  color: var(--white);
  text-align: center;
  margin-bottom: 20px;
}
.qr-title { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.qr-subtitle { font-size: 13px; opacity: 0.8; margin-bottom: 20px; }
.qr-code {
  width: 140px;
  height: 140px;
  background: var(--white);
  border-radius: var(--radius-md);
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
}
.qr-cta {
  padding: 10px 24px;
  background: rgba(255,255,255,0.2);
  border: 1.5px solid rgba(255,255,255,0.4);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  cursor: pointer;
  font-family: inherit;
  transition: var(--trans);
}
.qr-cta:hover { background: rgba(255,255,255,0.3); }

/* ===== REPORTS VIEW ===== */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.report-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: var(--trans);
}
.report-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--blue-100); }
.report-card-icon { font-size: 32px; margin-bottom: 14px; }
.report-card-title { font-size: 15px; font-weight: 700; color: var(--gray-900); margin-bottom: 6px; }
.report-card-desc { font-size: 13px; color: var(--gray-400); line-height: 1.5; }
.report-card-cta {
  margin-top: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-600);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===== STAFF VIEW ===== */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.staff-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: var(--trans);
}
.staff-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--blue-100); }
.staff-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--white);
}
.staff-name { font-size: 16px; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; }
.staff-role { font-size: 13px; color: var(--gray-400); margin-bottom: 14px; }
.staff-meta { display: flex; justify-content: space-around; padding-top: 14px; border-top: 1px solid var(--gray-100); }
.staff-meta-item { text-align: center; }
.staff-meta-val { font-size: 14px; font-weight: 700; color: var(--gray-900); }
.staff-meta-lbl { font-size: 11px; color: var(--gray-400); }

/* ===== SETTINGS VIEW ===== */
.settings-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--trans);
}
.settings-nav-item:hover { background: var(--gray-50); color: var(--gray-900); }
.settings-nav-item.active { background: var(--blue-50); color: var(--blue-700); font-weight: 600; }

.settings-panel {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.settings-section-title { font-size: 18px; font-weight: 800; color: var(--gray-900); margin-bottom: 6px; letter-spacing: -0.02em; }
.settings-section-desc { font-size: 14px; color: var(--gray-400); margin-bottom: 32px; }

.settings-form { display: flex; flex-direction: column; gap: 24px; }
.settings-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.settings-field { display: flex; flex-direction: column; gap: 6px; }
.settings-label { font-size: 13px; font-weight: 600; color: var(--gray-700); }
.settings-input {
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  color: var(--gray-800);
  outline: none;
  transition: var(--trans);
}
.settings-input:focus { border-color: var(--blue-400); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }

.password-wrapper { position: relative; width: 100%; display: flex; align-items: center; }
.password-wrapper input { width: 100%; padding-right: 40px; }
.password-toggle {
  position: absolute;
  right: 12px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  user-select: none;
  font-size: 15px;
}
.password-toggle:hover { opacity: 1; }

.settings-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--gray-50);
}
.settings-toggle-row:last-child { border-bottom: none; }
.toggle-info strong { display: block; font-size: 14px; font-weight: 600; color: var(--gray-900); margin-bottom: 3px; }
.toggle-info span { font-size: 13px; color: var(--gray-400); }

.toggle {
  position: relative;
  width: 40px;
  height: 22px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--gray-300);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--trans);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--white);
  border-radius: 50%;
  transition: var(--trans);
  box-shadow: var(--shadow-sm);
}
.toggle input:checked + .toggle-slider { background: var(--blue-500); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

.settings-save-btn {
  padding: 11px 24px;
  background: linear-gradient(135deg, var(--blue-500), var(--cyan-500));
  color: var(--white);
  border: none;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--trans);
  align-self: flex-start;
  box-shadow: 0 3px 10px rgba(59,130,246,0.3);
}
.settings-save-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(59,130,246,0.4); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: var(--trans);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 36px;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95) translateY(10px);
  transition: var(--trans);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.modal-title { font-size: 20px; font-weight: 800; color: var(--gray-900); letter-spacing: -0.03em; }
.modal-close { background: none; border: none; font-size: 22px; color: var(--gray-400); cursor: pointer; transition: var(--trans); }
.modal-close:hover { color: var(--gray-900); }

.modal-form { display: flex; flex-direction: column; gap: 16px; }
.modal-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

.btn-cancel {
  padding: 10px 20px;
  background: var(--gray-100);
  border: none;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  font-family: inherit;
  transition: var(--trans);
}
.btn-cancel:hover { background: var(--gray-200); }

.btn-save {
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--blue-500), var(--cyan-500));
  border: none;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  cursor: pointer;
  font-family: inherit;
  transition: var(--trans);
  box-shadow: 0 3px 10px rgba(59,130,246,0.3);
}
.btn-save:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(59,130,246,0.4); }

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--gray-900);
  color: var(--white);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateX(120%);
  transition: var(--trans);
  max-width: 360px;
}
.toast.visible { transform: translateX(0); }
.toast.success { background: #14532D; border-left: 4px solid var(--green-500); }
.toast.error { background: #7F1D1D; border-left: 4px solid var(--red-500); }
.toast.info { background: #1E3A5F; border-left: 4px solid var(--blue-500); }

.toast-icon { font-size: 18px; flex-shrink: 0; }

/* ===== NOTIFICATION PANEL ===== */
.notif-panel {
  position: fixed;
  top: var(--topbar-h);
  right: 0;
  width: 360px;
  height: calc(100vh - var(--topbar-h));
  background: var(--white);
  border-left: 1px solid var(--gray-100);
  z-index: 80;
  transform: translateX(100%);
  transition: var(--trans);
  overflow-y: auto;
  box-shadow: -8px 0 32px rgba(0,0,0,0.08);
}
.notif-panel.open { transform: translateX(0); }

.notif-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  position: sticky;
  top: 0;
  background: var(--white);
}
.notif-panel-title { font-size: 16px; font-weight: 800; color: var(--gray-900); }
.notif-mark-all { font-size: 13px; color: var(--blue-600); cursor: pointer; font-weight: 600; }

.notif-list { padding: 8px; }
.notif-list-item {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--trans);
}
.notif-list-item:hover { background: var(--gray-50); }
.notif-list-item.unread { background: var(--blue-50); }

.notif-item-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.notif-item-body { flex: 1; }
.notif-item-title { font-size: 13px; font-weight: 700; color: var(--gray-900); margin-bottom: 3px; }
.notif-item-desc { font-size: 12px; color: var(--gray-400); line-height: 1.4; }
.notif-item-time { font-size: 11px; color: var(--gray-400); margin-top: 4px; }

/* ===== USER DROPDOWN ===== */
.sidebar-user {
  position: relative;
  cursor: pointer;
}
.user-dropdown {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 0;
  width: 100%;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.06);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.user-dropdown.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.dropdown-item {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--trans);
}
.dropdown-item span {
  font-size: 15px;
}
.dropdown-item:hover {
  background: var(--gray-50);
  color: var(--gray-900);
}
.dropdown-item.text-red {
  color: var(--red-600);
}
.dropdown-item.text-red:hover {
  background: #FEF2F2;
  color: var(--red-700);
}
.dropdown-hr {
  height: 1px;
  background: var(--gray-100);
  margin: 4px 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .widget:last-child { grid-column: span 2; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-256px); width: 256px; }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
}

@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .widget:last-child { grid-column: span 1; }
  .messages-layout { grid-template-columns: 1fr; height: auto; }
  .conversations-panel { height: 300px; }
  .attendance-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .billing-stats { grid-template-columns: 1fr; }
  .reports-grid { grid-template-columns: 1fr 1fr; }
  .settings-row { grid-template-columns: 1fr; }
  .modal-row { grid-template-columns: 1fr; }
}
