@import url('/vendor/fonts/400.css');
@import url('/vendor/fonts/500.css');
@import url('/vendor/fonts/600.css');
@import url('/vendor/fonts/700.css');

:root {
  --font: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  /* the school portal's palette (FrontEndProtal tailwind.config.ts): navy + green */
  --brand: #0e2a4d;
  --brand-600: #091e37;
  --brand-50: #eef2f7;
  --accent: #8cc63f;
  --accent-600: #72a230;
  --accent-dark: #52741f;
  --accent-50: #f2f9e8;
  --gold: #f2b300;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f0f3f8;
  --line: #e2e7ef;
  --text: #16202e;
  --muted: #5d6b7e;
  --danger: #d93025;
  --danger-50: #fdecea;
  --success: #188038;
  --success-50: #e6f4ea;
  --warn: #b06000;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-2: 0 10px 30px rgba(16, 24, 40, .14);
  --focus: 0 0 0 3px rgba(140, 198, 63, .5);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body:not(.meet) {
    --bg: #0f141b; --surface: #171d26; --surface-2: #1e2531; --line: #2a3342;
    --text: #e7ecf3; --muted: #9aa6b8; --brand: #4a7bc4; --brand-600: #3b68a8; --brand-50: #14233b; --danger-50: #3a1714; --success-50: #12301c;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { flex: none; display: block; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  background: var(--surface-2); color: var(--text); font-weight: 600; cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .05s; white-space: nowrap; text-decoration: none !important;
}
.btn:hover { filter: brightness(.97); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-600); filter: none; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.text { background: transparent; color: var(--brand); padding: 0 12px; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13.5px; }
.btn.lg { height: 48px; padding: 0 24px; font-size: 16px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: transparent; color: inherit; cursor: pointer; flex: none;
}
.icon-btn:hover { background: rgba(127, 127, 127, .14); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--focus); }

/* ---------- form fields ---------- */
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  height: 44px; width: 100%; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; padding: 10px 14px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: var(--focus); }

.switch { position: relative; display: inline-flex; width: 40px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #9aa6b8; transition: background .15s; }
.switch i::after {
  content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(16px); }
[dir="rtl"] .switch input:checked + i::after { transform: translateX(-16px); }
.switch input:focus-visible + i { box-shadow: var(--focus); }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted);
}
.badge.live { background: var(--success-50); color: var(--success); }
.badge.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.warn { background: #fff4e0; color: var(--warn); }
.muted { color: var(--muted); }
.spinner {
  width: 22px; height: 22px; border-radius: 50%; border: 3px solid currentColor; border-top-color: transparent;
  animation: spin .8s linear infinite; opacity: .8;
}
@keyframes spin { to { transform: rotate(360deg); } }

.avatar {
  display: grid; place-items: center; border-radius: 50%; overflow: hidden; flex: none;
  color: #fff; font-weight: 600; background: var(--brand); user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- menus, dialogs, toasts ---------- */
.menu {
  position: fixed; z-index: 1000; min-width: 220px; padding: 6px; border-radius: 12px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-2);
  animation: pop .12s ease-out;
}
.menu button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px;
  background: none; cursor: pointer; text-align: start; font-size: 14px;
}
.menu button:hover, .menu button:focus-visible { background: var(--surface-2); outline: none; }
.menu button.danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
@keyframes pop { from { opacity: 0; transform: scale(.97); } }

dialog.modal {
  border: 0; padding: 0; border-radius: 18px; width: min(520px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-2);
}
dialog.modal::backdrop { background: rgba(10, 14, 20, .55); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 6px; }
.modal-head h2 { font-size: 19px; }
.modal-body { padding: 10px 20px 20px; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 20px 20px; }

.toasts { position: fixed; z-index: 1100; bottom: 96px; inset-inline-start: 16px; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
  background: #262b33; color: #f1f3f4; box-shadow: var(--shadow-2); animation: toastIn .2s ease-out; font-size: 14px;
}
.toast .actions { display: flex; gap: 6px; margin-inline-start: auto; }
.toast .btn { height: 30px; padding: 0 12px; font-size: 13px; }
.toast.out { opacity: 0; transform: translateY(8px); transition: .2s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
