/* ============================================
   منصة إرتقاء - Professional RTL Design System
   ============================================ */

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

:root {
  /* Primary Palette */
  --primary: #0f4c81;
  --primary-dark: #0a3561;
  --primary-light: #1a6bb5;
  --primary-subtle: #e8f0fb;
  --primary-glass: rgba(15, 76, 129, 0.08);

  /* Accent */
  --accent: #00c896;
  --accent-dark: #00a07a;
  --accent-light: #e0faf4;

  /* Semantic */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --info: #3b82f6;
  --info-bg: #eff6ff;

  /* Scores */
  --score-5: #10b981;
  --score-4: #3b82f6;
  --score-3: #f59e0b;
  --score-2: #f97316;
  --score-1: #ef4444;

  /* Surface */
  --bg: #f0f4f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  /* Text */
  --text: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  /* Sidebar */
  --sidebar-bg: #0f172a;
  --sidebar-text: #cbd5e1;
  --sidebar-active: #0f4c81;
  --sidebar-hover: rgba(255,255,255,0.06);
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 64px;

  /* Header */
  --header-height: 64px;
  --header-bg: #ffffff;

  /* Typography */
  --font-main: 'Tajawal', 'Cairo', sans-serif;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.10), 0 10px 10px -5px rgba(0,0,0,0.04);
  --shadow-primary: 0 4px 14px rgba(15, 76, 129, 0.25);

  /* Radius */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

input, textarea, select, button { font-family: var(--font-main); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface-3); }
::-webkit-scrollbar-thumb { background: #c1ccd9; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== LAYOUT ===== */
.app-wrapper { display: flex; min-height: 100vh; }

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0; right: 0; left: 0;
  height: var(--header-height);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-brand {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.5px;
}

.header-brand .brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 1rem;
  box-shadow: var(--shadow-primary);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-nav .nav-icon-btn {
  width: 38px; height: 38px;
  border: none;
  background: var(--surface-3);
  border-radius: var(--radius);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.header-nav .nav-icon-btn:hover {
  background: var(--primary-subtle);
  color: var(--primary);
}

.badge-dot {
  position: absolute;
  top: 6px; left: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid white;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.75rem;
  background: var(--surface-3);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.user-menu:hover { background: var(--primary-subtle); }

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.user-name-sm { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.user-role-sm { font-size: 0.72rem; color: var(--text-muted); }

.hamburger {
  width: 36px; height: 36px;
  background: none; border: none;
  display: flex; flex-direction: column;
  justify-content: center; gap: 5px;
  cursor: pointer; padding: 4px; border-radius: var(--radius-sm);
  transition: var(--transition);
}
.hamburger:hover { background: var(--surface-3); }
.hamburger span {
  display: block; height: 2px;
  background: var(--text-secondary); border-radius: 2px;
  transition: var(--transition-slow);
}
.hamburger span:nth-child(1) { width: 22px; }
.hamburger span:nth-child(2) { width: 16px; }
.hamburger span:nth-child(3) { width: 22px; }

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: var(--header-height); right: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: var(--sidebar-bg);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 90;
  transition: transform var(--transition-slow), width var(--transition-slow);
  display: flex;
  flex-direction: column;
  padding-bottom: 2rem;
}

.sidebar.collapsed { width: var(--sidebar-collapsed-width); }
.sidebar.collapsed .sidebar-label,
.sidebar.collapsed .sidebar-link span,
.sidebar.collapsed .sidebar-section-title { display: none; }
.sidebar.collapsed .sidebar-link { justify-content: center; padding: 0.7rem; }

.sidebar-section { padding: 0.75rem 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.sidebar-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 0.5rem 1.1rem 0.3rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 1rem;
  margin: 1px 0.5rem;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}

.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: white;
}

.sidebar-link.active {
  background: var(--sidebar-active);
  color: white;
  box-shadow: 0 2px 8px rgba(15, 76, 129, 0.4);
}

.sidebar-link i {
  width: 18px;
  text-align: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.sidebar-link .badge-count {
  margin-right: auto;
  margin-left: 0;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-right: var(--sidebar-width);
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  padding: 1.5rem;
  transition: margin-right var(--transition-slow);
}

.main-content.expanded { margin-right: var(--sidebar-collapsed-width); }

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.page-breadcrumb a { color: var(--primary); }
.page-breadcrumb span { color: var(--text-muted); }

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title i { color: var(--primary); }

.card-body { padding: 1.25rem; }
.card-footer { padding: 0.9rem 1.25rem; background: var(--surface-2); border-top: 1px solid var(--border-light); }

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 4px; height: 100%;
  background: var(--stat-color, var(--primary));
}

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

.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-body { flex: 1; }
.stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1; color: var(--text); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem; }
.stat-change {
  font-size: 0.72rem;
  display: inline-flex; align-items: center; gap: 0.2rem;
  margin-top: 0.3rem;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}
.stat-change.up { background: var(--success-bg); color: var(--success); }
.stat-change.down { background: var(--danger-bg); color: var(--danger); }

/* ===== GRID LAYOUTS ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.25rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }

.col-span-2 { grid-column: span 2; }

/* ===== TABLES ===== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%; border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  background: var(--surface-2);
  padding: 0.75rem 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--primary-glass); }

/* ===== SCORE BADGES ===== */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 800;
  color: white;
}

.score-badge.score-excellent { background: var(--score-5); }
.score-badge.score-verygood { background: var(--score-4); }
.score-badge.score-good { background: var(--score-3); }
.score-badge.score-acceptable { background: var(--score-2); }
.score-badge.score-poor { background: var(--score-1); }

.score-pill {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem; font-weight: 700;
}
.score-pill.score-excellent { background: #ecfdf5; color: var(--score-5); }
.score-pill.score-verygood { background: #eff6ff; color: var(--score-4); }
.score-pill.score-good { background: #fffbeb; color: #d97706; }
.score-pill.score-acceptable { background: #fff7ed; color: var(--score-2); }
.score-pill.score-poor { background: #fef2f2; color: var(--score-1); }

/* ===== SCORE SLIDER COMPONENT ===== */
.score-criterion {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.85rem;
  transition: var(--transition);
}

.score-criterion:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }

.criterion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.criterion-number {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--primary-subtle);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 800;
  flex-shrink: 0;
}

.criterion-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  margin: 0 0.6rem;
}

.criterion-score-display {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  min-width: 28px;
  text-align: center;
}

.score-buttons {
  display: flex; gap: 0.4rem;
  justify-content: center;
  margin-bottom: 0.6rem;
}

.score-btn {
  width: 40px; height: 40px;
  border: 2px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  font-family: var(--font-main);
}

.score-btn:hover { border-color: var(--primary); background: var(--primary-subtle); color: var(--primary); }

.score-btn.active-1 { border-color: var(--score-1); background: #fef2f2; color: var(--score-1); }
.score-btn.active-2 { border-color: var(--score-2); background: #fff7ed; color: var(--score-2); }
.score-btn.active-3 { border-color: var(--score-3); background: #fffbeb; color: #d97706; }
.score-btn.active-4 { border-color: var(--score-4); background: #eff6ff; color: var(--score-4); }
.score-btn.active-5 { border-color: var(--score-5); background: #ecfdf5; color: var(--score-5); }

.score-label-sm { font-size: 0.55rem; margin-top: 1px; }

.criterion-comment textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  resize: none;
  direction: rtl;
  color: var(--text);
  transition: var(--transition);
  font-family: var(--font-main);
}
.criterion-comment textarea:focus { outline: none; border-color: var(--primary); background: white; }

/* ===== DOMAIN TABS ===== */
.domain-tabs {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  margin-bottom: 1.25rem;
  background: var(--surface-2);
  padding: 0.4rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.domain-tab {
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: var(--font-main);
  transition: var(--transition);
  display: flex; align-items: center; gap: 0.4rem;
}

.domain-tab:hover { background: var(--surface-3); color: var(--text); }
.domain-tab.active { background: var(--primary); color: white; box-shadow: var(--shadow-primary); }

.domain-panel { display: none; }
.domain-panel.active { display: block; animation: fadeIn 0.25s ease; }

/* ===== FORM ELEMENTS ===== */
.form-group { margin-bottom: 1.1rem; }

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text);
  transition: var(--transition);
  direction: rtl;
  font-family: var(--font-main);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.1);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control { cursor: pointer; }
textarea.form-control { min-height: 90px; resize: vertical; }

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

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: var(--font-main);
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover { background: var(--primary-dark); color: white; box-shadow: 0 4px 16px rgba(15,76,129,0.35); transform: translateY(-1px); }

.btn-accent {
  background: var(--accent);
  color: white;
}
.btn-accent:hover { background: var(--accent-dark); color: white; }

.btn-secondary {
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-2); color: var(--primary); border-color: var(--primary); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; color: white; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 0.95rem; }
.btn-icon { width: 34px; height: 34px; padding: 0; }
.btn-icon-lg { width: 42px; height: 42px; padding: 0; }

.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ===== ALERTS ===== */
.alert {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
}

.alert-success { background: var(--success-bg); color: #065f46; border-color: #a7f3d0; }
.alert-danger { background: var(--danger-bg); color: #991b1b; border-color: #fca5a5; }
.alert-warning { background: var(--warning-bg); color: #78350f; border-color: #fde68a; }
.alert-info { background: var(--info-bg); color: #1e40af; border-color: #bfdbfe; }

/* ===== PROGRESS BAR ===== */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--surface-3);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--primary);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RADAR CHART CONTAINER ===== */
.chart-container {
  position: relative;
  width: 100%;
  padding: 0.5rem;
}

/* ===== SCORE SUMMARY CARD ===== */
.score-summary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  color: white;
  position: relative;
  overflow: hidden;
}

.score-summary::before {
  content: '';
  position: absolute;
  top: -30px; left: -30px;
  width: 150px; height: 150px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}

.score-summary::after {
  content: '';
  position: absolute;
  bottom: -20px; right: -20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}

.score-summary-main {
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1;
  position: relative;
}

.score-summary-label {
  font-size: 1rem;
  font-weight: 600;
  opacity: 0.85;
  margin-top: 0.3rem;
}

.score-summary-sub {
  font-size: 0.82rem;
  opacity: 0.65;
  margin-top: 0.15rem;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  width: 64px; height: 64px;
  margin: 0 auto 1rem;
  background: var(--surface-3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  color: var(--text-muted);
}

.empty-state h3 { font-size: 1rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 0.4rem; }
.empty-state p { font-size: 0.85rem; }

/* ===== STATUS BADGES ===== */
.status-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 700;
}

.status-badge.completed { background: var(--success-bg); color: var(--success); }
.status-badge.draft { background: var(--surface-3); color: var(--text-muted); }
.status-badge.pending { background: var(--warning-bg); color: var(--warning); }
.status-badge.inprogress { background: var(--info-bg); color: var(--info); }
.status-badge.urgent { background: var(--danger-bg); color: var(--danger); }
.status-badge.high { background: #fff7ed; color: var(--score-2); }

/* ===== NOTIFICATION ===== */
.notification-item {
  display: flex; gap: 0.75rem; padding: 0.85rem;
  border-radius: var(--radius);
  transition: var(--transition);
  border: 1px solid transparent;
}

.notification-item:hover { background: var(--surface-2); border-color: var(--border); }
.notification-item.unread { background: var(--primary-glass); border-color: rgba(15,76,129,0.15); }

.notification-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; flex-shrink: 0;
}

.notification-icon.info { background: var(--info-bg); color: var(--info); }
.notification-icon.success { background: var(--success-bg); color: var(--success); }
.notification-icon.warning { background: var(--warning-bg); color: var(--warning); }
.notification-icon.danger { background: var(--danger-bg); color: var(--danger); }

/* ===== LOGIN PAGE ===== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #0f4c81 60%, #1a6bb5 100%);
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

.login-wrapper::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.login-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.35);
  position: relative;
}

.login-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-logo .logo-icon {
  width: 64px; height: 64px;
  margin: 0 auto 0.75rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  color: white;
  box-shadow: var(--shadow-primary);
}

.login-logo h1 { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.login-logo p { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.3rem; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
@keyframes countUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.animate-in { animation: fadeIn 0.35s ease both; }
.animate-slide { animation: slideIn 0.35s ease both; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(100%);
    width: var(--sidebar-width) !important;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-right: 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .main-content { padding: 1rem; }
  .login-card { padding: 1.75rem; }
}

/* ===== OVERLAY =====  */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 85;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.visible { display: block; }

/* ===== PRINT ===== */
@media print {
  .sidebar, .header, .btn, .no-print { display: none !important; }
  .main-content { margin: 0; padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}

/* ===== CUSTOM COMPONENTS ===== */
.visit-report-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  color: white;
  margin-bottom: 1.5rem;
}

.teacher-card {
  display: flex; align-items: center; gap: 1rem;
}

.teacher-avatar-lg {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  border: 3px solid rgba(255,255,255,0.3);
  flex-shrink: 0;
}

.criteria-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 2rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.step {
  display: flex; align-items: center;
}

.step-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
  color: var(--text-muted);
  transition: var(--transition);
  flex-shrink: 0;
}

.step.active .step-circle { background: var(--primary); border-color: var(--primary); color: white; box-shadow: var(--shadow-primary); }
.step.done .step-circle { background: var(--success); border-color: var(--success); color: white; }

.step-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); margin: 0.3rem 0.4rem 0; white-space: nowrap; }
.step.active .step-label { color: var(--primary); }
.step.done .step-label { color: var(--success); }

.step-line { flex: 1; height: 2px; background: var(--border); min-width: 24px; }
.step.done + .step .step-line, .step.active + .step .step-line { background: var(--primary); }

/* ===== DOMAIN SUMMARY BARS ===== */
.domain-bar-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-light);
}
.domain-bar-row:last-child { border-bottom: none; }

.domain-bar-name { font-size: 0.82rem; font-weight: 600; color: var(--text); min-width: 130px; }
.domain-bar-wrap { flex: 1; }
.domain-bar-score { font-size: 0.85rem; font-weight: 800; color: var(--primary); min-width: 30px; text-align: center; }

/* Range input styling */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%; height: 4px;
  background: var(--border);
  border-radius: 2px; outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,76,129,0.15);
  transition: var(--transition);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
