/* ═══════════════════════════════════════════════════════════════
   Wosool v2 — Premium global styles
   Design language: warm green + glassmorphism + soft shadows
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Brand palette */
  --g1: #085041;  --g2: #1D9E75;  --g3: #5DCAA5;  --gl: #E1F5EE;
  --g0: #0B2E24;  --g-soft: #F0F9F5;

  /* Surface */
  --bg: #F5F9F7;
  --w:  #ffffff;
  --w-soft: #FAFCFB;

  /* Text */
  --text:  #0B2E24;
  --text2: #5C7A70;
  --text3: #8FA89E;

  /* Borders */
  --border:      #D0E8DF;
  --border-soft: #E6F1EC;

  /* Tool colors */
  --t-iep:#7C3AED;       --t-iep-bg:#F3E8FF;
  --t-adapt:#0EA5E9;     --t-adapt-bg:#E0F2FE;
  --t-story:#F59E0B;     --t-story-bg:#FEF3C7;
  --t-pecs:#EC4899;      --t-pecs-bg:#FCE7F3;
  --t-behavior:#EF4444;  --t-behavior-bg:#FEE2E2;
  --t-sensory:#10B981;   --t-sensory-bg:#D1FAE5;
  --t-bsp:#6366F1;       --t-bsp-bg:#E0E7FF;
  --t-report:#14B8A6;    --t-report-bg:#CCFBF1;
  --t-skills:#8B5CF6;    --t-skills-bg:#EDE9FE;
  --t-ws:#06B6D4;        --t-ws-bg:#CFFAFE;

  /* States */
  --danger:  #DC2626;   --danger-bg:  #FEF2F2;   --danger-soft: #FEE2E2;
  --warning: #D97706;   --warning-bg: #FFFBEB;   --warning-soft:#FEF3C7;
  --success: #059669;   --success-bg: #ECFDF5;   --success-soft:#D1FAE5;
  --info:    #2563EB;   --info-bg:    #EFF6FF;   --info-soft:   #DBEAFE;

  /* Shadows — layered for depth */
  --shadow-xs: 0 1px 2px rgba(8,80,65,.04);
  --shadow-sm: 0 1px 3px rgba(8,80,65,.06), 0 1px 2px rgba(8,80,65,.04);
  --shadow-md: 0 4px 14px rgba(8,80,65,.08), 0 2px 4px rgba(8,80,65,.04);
  --shadow-lg: 0 12px 36px rgba(8,80,65,.12), 0 4px 12px rgba(8,80,65,.06);
  --shadow-xl: 0 24px 60px rgba(8,80,65,.16), 0 8px 24px rgba(8,80,65,.08);
  --shadow-glow: 0 0 0 4px rgba(29,158,117,.12);

  /* Radius — generous for modern feel */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-2xl: 36px;
  --r-full: 9999px;

  /* Typography */
  --font: 'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Layout */
  --header-h: 64px;
  --container-w: 1240px;
}

[data-theme="dark"] {
  --bg: #0A1612;
  --w:  #112520;
  --w-soft: #0E1F1B;
  --text:  #E5F3EE;
  --text2: #87B3A4;
  --text3: #5F8278;
  --border: #1f3a32;
  --border-soft: #15302A;
  --gl: #15302A;
  --g-soft: #122922;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.3);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 4px 14px rgba(0,0,0,.45), 0 2px 4px rgba(0,0,0,.3);
  --shadow-lg: 0 12px 36px rgba(0,0,0,.6), 0 4px 12px rgba(0,0,0,.4);
  --shadow-xl: 0 24px 60px rgba(0,0,0,.7), 0 8px 24px rgba(0,0,0,.5);
}

/* ═══════════════════════════════════════════════════════════════
   Reset + base
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  direction: rtl;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: var(--g2); text-decoration: none; transition: color .15s; }
a:hover { color: var(--g1); }

h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.01em; color: var(--text); }
h1 { font-size: 28px; line-height: 1.3; }
h2 { font-size: 22px; line-height: 1.35; }
h3 { font-size: 18px; line-height: 1.4; }
h4 { font-size: 15px; line-height: 1.45; }

::selection { background: var(--g3); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--g3); }

/* ═══════════════════════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════════════════════ */

.btn {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  padding: 11px 22px;
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  background: linear-gradient(135deg, var(--g2) 0%, var(--g1) 100%);
  color: #fff;
  transition: transform .15s, box-shadow .15s, opacity .15s;
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.15), transparent);
  transition: left .5s;
}
.btn:hover::before { left: 100%; }
.btn:hover  { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
.btn:disabled::before { display: none; }

.btn-ghost {
  background: var(--w);
  color: var(--text2);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.btn-ghost:hover { background: var(--gl); color: var(--g1); border-color: var(--g3); transform: translateY(-1px); }

.btn-danger { background: linear-gradient(135deg, #EF4444, #B91C1C); }
.btn-warning { background: linear-gradient(135deg, #F59E0B, #B45309); }
.btn-info { background: linear-gradient(135deg, #3B82F6, #1E40AF); }

.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: var(--r-sm); }
.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: var(--r-md); }
.btn-block { width: 100%; }

.btn-icon {
  width: 38px; height: 38px;
  padding: 0;
  border-radius: var(--r-sm);
}

/* ═══════════════════════════════════════════════════════════════
   Inputs
   ═══════════════════════════════════════════════════════════════ */

.input,
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], input[type="tel"], select, textarea {
  font-family: var(--font);
  font-size: 14px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--w);
  color: var(--text);
  width: 100%;
  transition: border-color .15s, box-shadow .15s, background .15s;
  font-weight: 500;
}
.input:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--g2);
  box-shadow: var(--shadow-glow);
}
.input::placeholder, input::placeholder, textarea::placeholder { color: var(--text3); font-weight: 400; }

textarea { resize: vertical; min-height: 100px; line-height: 1.7; }

label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  display: block;
  margin-bottom: 7px;
  letter-spacing: .01em;
}

.req { color: var(--danger); margin-right: 3px; }

/* ═══════════════════════════════════════════════════════════════
   Card
   ═══════════════════════════════════════════════════════════════ */

.card {
  background: var(--w);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-soft);
  transition: transform .2s, box-shadow .2s;
}
.card-hover { cursor: pointer; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--g3); }
.card-title { font-size: 15px; font-weight: 800; color: var(--g1); margin-bottom: 4px; }
.card-subtitle { font-size: 12px; color: var(--text2); }

/* ═══════════════════════════════════════════════════════════════
   Top bar (shared across dashboards)
   ═══════════════════════════════════════════════════════════════ */

.topbar {
  background: linear-gradient(135deg, var(--g1) 0%, var(--g2) 60%, #2DB58A 100%);
  color: #fff;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 20px rgba(8,80,65,.18);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -.01em;
}
.brand svg { width: 34px; height: 34px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.2)); }
.brand-sub {
  font-size: 11px;
  font-weight: 500;
  opacity: .85;
  margin-top: 1px;
  letter-spacing: .02em;
}
.tb-spacer { flex: 1; }
.tb-btn {
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tb-btn:hover { background: rgba(255,255,255,.26); transform: translateY(-1px); }
.tb-icon {
  width: 38px; height: 38px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-full);
  font-size: 16px;
}
.tb-user {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.12);
}
.tb-avatar {
  width: 30px; height: 30px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, #fff, #E1F5EE);
  color: var(--g1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════════
   Layout helpers
   ═══════════════════════════════════════════════════════════════ */

.wrap { padding: 28px; max-width: var(--container-w); margin: 0 auto; }
.wrap-sm { max-width: 720px; }
.wrap-md { max-width: 960px; }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 20px; } .mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; } .mt-6 { margin-top: 24px; }

.text-center { text-align: center; }
.text-muted { color: var(--text2); }
.text-soft { color: var(--text3); }
.text-sm { font-size: 12px; }
.text-md { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }

.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

/* ═══════════════════════════════════════════════════════════════
   Badge / Chip
   ═══════════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  background: var(--gl);
  color: var(--g1);
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger);  }
.badge-info    { background: var(--info-soft);    color: var(--info);    }
.badge-soft    { background: var(--bg);           color: var(--text2);   }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px;
  border-radius: var(--r-full);
  background: var(--w);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.chip:hover { border-color: var(--g3); color: var(--g1); }
.chip.active { background: var(--gl); border-color: var(--g2); color: var(--g1); }

/* ═══════════════════════════════════════════════════════════════
   Hero header (used in dashboards)
   ═══════════════════════════════════════════════════════════════ */

.hero {
  background:
    radial-gradient(circle at 0% 100%, rgba(93,202,165,.22), transparent 60%),
    radial-gradient(circle at 100% 0%,  rgba(29,158,117,.18), transparent 60%),
    linear-gradient(135deg, var(--w), var(--g-soft));
  border-radius: var(--r-xl);
  padding: 28px 30px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-soft);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%; left: -10%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(29,158,117,.08), transparent 70%);
  pointer-events: none;
}
.hero h1 { color: var(--g1); margin-bottom: 4px; }
.hero p { color: var(--text2); font-size: 14px; }

/* ═══════════════════════════════════════════════════════════════
   Section title
   ═══════════════════════════════════════════════════════════════ */

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
  color: var(--g1);
  margin: 28px 0 14px;
  letter-spacing: -.01em;
}
.section-title .badge { font-size: 10px; }

/* ═══════════════════════════════════════════════════════════════
   Toast
   ═══════════════════════════════════════════════════════════════ */

.toast {
  position: fixed;
  bottom: 28px;
  right: 50%;
  transform: translateX(50%) translateY(120px);
  background: var(--g0);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xl);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  z-index: 1000;
  max-width: 90vw;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,.1);
}
.toast.on { transform: translateX(50%) translateY(0); opacity: 1; }
.toast.err { background: linear-gradient(135deg, #DC2626, #991B1B); }
.toast.ok  { background: linear-gradient(135deg, #059669, #047857); }
.toast.warn { background: linear-gradient(135deg, #D97706, #92400E); }

/* ═══════════════════════════════════════════════════════════════
   Skeleton loader
   ═══════════════════════════════════════════════════════════════ */

.skeleton {
  background: linear-gradient(90deg, var(--border-soft) 0%, var(--gl) 50%, var(--border-soft) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════════════════════
   Avatar / Icon circle
   ═══════════════════════════════════════════════════════════════ */

.avatar {
  width: 44px; height: 44px;
  border-radius: var(--r-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--g2), var(--g3));
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 4px 12px rgba(29,158,117,.3);
  flex-shrink: 0;
}
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }

/* ═══════════════════════════════════════════════════════════════
   Modal / Overlay (glassmorphism)
   ═══════════════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,46,36,.55);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  animation: fadeIn .2s;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--w);
  border-radius: var(--r-xl);
  padding: 28px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-soft);
  animation: slideUp .3s cubic-bezier(.34,1.56,.64,1);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in { animation: fadeInUp .4s cubic-bezier(.16,1,.3,1) both; }
.animate-in:nth-child(1) { animation-delay: .05s; }
.animate-in:nth-child(2) { animation-delay: .1s; }
.animate-in:nth-child(3) { animation-delay: .15s; }
.animate-in:nth-child(4) { animation-delay: .2s; }
.animate-in:nth-child(5) { animation-delay: .25s; }
.animate-in:nth-child(6) { animation-delay: .3s; }
.animate-in:nth-child(7) { animation-delay: .35s; }
.animate-in:nth-child(8) { animation-delay: .4s; }

/* ═══════════════════════════════════════════════════════════════
   Empty state
   ═══════════════════════════════════════════════════════════════ */

.empty {
  text-align: center;
  padding: 50px 24px;
  color: var(--text2);
}
.empty .ico {
  font-size: 56px;
  margin-bottom: 14px;
  opacity: .6;
}
.empty h3 { color: var(--text); margin-bottom: 6px; }
.empty p { font-size: 13px; margin-bottom: 16px; }

/* ═══════════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .wrap { padding: 16px; }
  .topbar { padding: 12px 16px; gap: 10px; }
  .brand { font-size: 15px; gap: 8px; }
  .brand svg { width: 28px; height: 28px; }
  .brand-sub { display: none; }
  h1 { font-size: 22px; } h2 { font-size: 19px; }
  .hero { padding: 22px 20px; border-radius: var(--r-lg); }
  .tb-btn { padding: 7px 11px; font-size: 12px; }
  .tb-user { display: none; }
}
