/* 
  SmartEdu Premium Design System
  Style: Modern, Clean, High-Contrast with Glassmorphism
*/

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

:root {
  /* ── Core Colors (HSL for consistency) ── */
  --p-h: 225; --p-s: 60%; --p-l: 45%; /* Primary Navy-ish */
  --primary-dark:  hsl(var(--p-h), var(--p-s), 25%);
  --primary:       hsl(var(--p-h), var(--p-s), var(--p-l));
  --primary-light: hsl(var(--p-h), var(--p-s), 96%);
  --accent:        hsl(355, 78%, 56%); /* Modern Red/Coral */
  --yellow:        hsl(45, 100%, 55%);
  
  /* ── Gradients ── */
  --grad-primary: linear-gradient(135deg, var(--primary), var(--primary-dark));
  --grad-surface: linear-gradient(180deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.4) 100%);

  /* ── Neutral Palette ── */
  --bg-page:       #f8fafc;
  --bg-panel:      #ffffff;
  --bg-white:      #ffffff;
  --bg-hover:      #f1f5f9;
  --border:        #e2e8f0;
  --border-strong: #cbd5e1;

  /* ── Text ── */
  --text:          #0f172a;
  --text-muted:    #64748b;
  --text-light:    #94a3b8;

  /* ── Semantic ── */
  --success:       #10b981; --success-bg: #ecfdf5; --success-text: #065f46;
  --danger:        #ef4444;  --danger-bg:  #fef2f2; --danger-text:  #991b1b;
  --warning:       #f59e0b;  --warning-bg: #fffbeb; --warning-text: #92400e;

  /* ── Layout & Shape ── */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --glass: blur(12px) saturate(180%);
  
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Global Resets ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { 
  height: 100%; 
  color: var(--text); 
  background: var(--bg-page); 
  font-family: 'Outfit', 'Inter', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 0.5em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
p { margin-bottom: 1em; }

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

/* ── App Shell ── */
.app-shell { display: flex; min-height: 100vh; position: relative; }

.sidebar {
  width: 260px;
  background: var(--grad-primary);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: var(--transition);
  z-index: 50;
  box-shadow: 4px 0 24px rgba(0,0,0,0.05);
}

.sidebar-brand {
  padding: 32px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand-text {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.sidebar-section-label {
  padding: 24px 24px 8px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.4);
  font-weight: 600;
}

.sidebar-nav { list-style: none; padding: 0 12px; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: rgba(255,255,255,0.7);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 400;
  transition: var(--transition);
}

.sidebar-nav a:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.sidebar-nav a.active {
  background: #fff;
  color: var(--primary-dark);
  font-weight: 500;
  box-shadow: var(--shadow-md);
}

.sidebar-footer {
  margin-top: auto;
  padding: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user { display: flex; align-items: center; gap: 12px; }
.sidebar-user-name { font-size: 0.9rem; font-weight: 500; }
.sidebar-user-role { font-size: 0.75rem; color: rgba(255,255,255,0.5); }

/* ── Main Content Area ── */
.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 72px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: var(--glass);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-left { display: flex; align-items: center; }

.content-area {
  padding: 32px;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Components ── */
.content-section {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
  transition: var(--transition);
}

.content-section:hover { box-shadow: var(--shadow-md); }

.page-header { margin-bottom: 32px; display: flex; justify-content: space-between; align-items: center; }
.page-title { margin-bottom: 0; font-size: 1.75rem; color: var(--primary-dark); }
.page-subtitle { color: var(--text-muted); font-size: 1rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--grad-primary);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(var(--p-h), var(--p-s), 45%, 0.3);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--p-h), var(--p-s), 45%, 0.4);
}

.btn--secondary {
  background: #fff;
  border-color: var(--primary);
  color: var(--primary);
}

.btn--secondary:hover { background: var(--primary-light); }

.btn--danger { background: var(--danger); color: #fff; }
.btn--ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn--ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn--sm { padding: 6px 12px; font-size: 0.8rem; }
.btn--lg { padding: 14px 28px; font-size: 1rem; }
.btn--block { width: 100%; }

/* Stats */
.stat-card {
  padding: 24px;
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.stat-card__value { font-size: 2rem; font-weight: 600; color: var(--primary-dark); }
.stat-card__label { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }

/* Tables */
.table-wrapper { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th {
  padding: 16px;
  background: var(--primary-light);
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
}
.data-table td { padding: 16px; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-hover); }

/* Badges */
.badge {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}
.badge--success { background: var(--success-bg); color: var(--success-text); }
.badge--danger { background: var(--danger-bg); color: var(--danger-text); }
.badge--warning { background: var(--warning-bg); color: var(--warning-text); }
.badge--primary { background: var(--primary-light); color: var(--primary); }

/* Forms */
.field-group { margin-bottom: 24px; }
.field-label { display: block; margin-bottom: 8px; font-size: 0.9rem; font-weight: 500; color: var(--primary-dark); }
.field-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
  background: #fff;
}
.field-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

/* Authentication Layout */
.page-auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 10% 20%, rgba(26, 32, 44, 1) 0%, rgba(45, 55, 72, 1) 90%);
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 900px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: var(--glass);
  border-radius: var(--radius-xl);
  display: flex;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.auth-panel-left {
  flex: 1;
  background: var(--grad-primary);
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.auth-panel-left::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.auth-panel-right {
  flex: 1.2;
  padding: 60px;
  background: #fff;
}

.auth-headline { font-size: 2.5rem; margin-bottom: 16px; font-weight: 700; line-height: 1.1; }
.auth-sub { color: rgba(255,255,255,0.6); font-size: 1.1rem; }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 0.875rem; }
.breadcrumb-sep { opacity: 0.4; }
.breadcrumb-current { color: var(--primary-dark); font-weight: 500; }

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: modalEnter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.modal__header { padding: 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal__title { margin: 0; font-size: 1.25rem; }
.modal__body { padding: 24px; }
.modal__footer { padding: 16px 24px; background: var(--bg-hover); display: flex; justify-content: flex-end; gap: 12px; }

/* Avatars */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

/* Utilities */
.text-muted { color: var(--text-muted) !important; }
.text-danger { color: var(--danger) !important; }
.text-sm { font-size: 0.875rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }

/* Messages */
.msg {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 0.9rem;
  border-left: 4px solid transparent;
}
.msg--success { background: var(--success-bg); color: var(--success-text); border-color: var(--success); }
.msg--error { background: var(--danger-bg); color: var(--danger-text); border-color: var(--danger); }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { width: 0; transform: translateX(-100%); position: absolute; }
  .auth-card { flex-direction: column; }
  .auth-panel-left { padding: 40px; }
  .auth-panel-right { padding: 40px; }
  .content-area { padding: 20px; }
  .topbar { padding: 0 20px; }
}