/* Ourel Admin — Portal-specific styles */
/* Shared design tokens live in ../../shared/style.css */

/* ── Admin auth-logo margin override ── */
.auth-logo { margin-bottom: 32px; }

/* ── Textarea (admin forms only) ── */
input[type="file"] { padding: 8px; background: rgba(248,250,252,0.80); }
textarea { resize: vertical; min-height: 90px; }

/* ══ BUTTONS (admin-specific) ════════════════════════════════════════ */
.btn-sm   { padding: 6px 12px; font-size: 13px; }

.btn-danger             { background: transparent; border: 1.5px solid var(--red); color: var(--red); }
.btn-danger:hover:not(:disabled)  { background: rgba(254,242,242,0.80); }

/* ══ APP LAYOUT ══════════════════════════════════════════════════════ */
.app-layout { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ── */
.sidebar {
  width: 248px;
  background: linear-gradient(180deg, #07101f 0%, #0d1b35 50%, #080f1e 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: -100px;
  left: -60px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(201,168,76,0.09) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.sidebar::after {
  content: '';
  position: absolute;
  bottom: 40px;
  right: -40px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(99,102,241,0.07) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.sidebar > * { position: relative; z-index: 1; }

.sidebar-logo { padding: 24px 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.07); }

.sidebar-school {
  padding: 12px 20px 14px;
  color: rgba(255,255,255,0.38);
  font-size: 11.5px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-school strong {
  display: block;
  color: rgba(255,255,255,0.86);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.sidebar-nav { padding: 10px 10px; flex: 1; }

.nav-section-label {
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,0.20);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 16px 10px 5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  color: rgba(255,255,255,0.46);
  font-size: 13px;
  cursor: pointer;
  transition: all .18s cubic-bezier(0.16,1,0.3,1);
  border: none;
  border-left: 2px solid transparent;
  background: none;
  width: 100%;
  text-align: left;
  margin-bottom: 1px;
  letter-spacing: 0.005em;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.88);
  border-left-color: rgba(255,255,255,0.12);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(201,168,76,0.14) 0%, rgba(201,168,76,0.04) 100%);
  color: var(--gold);
  border-left-color: var(--gold);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(201,168,76,0.10);
}

.nav-item .icon { width: 18px; font-size: 15px; flex-shrink: 0; opacity: 0.85; }
.nav-item.active .icon { opacity: 1; }

.sidebar-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,0.06); }

.sidebar-divider { height: 1px; background: rgba(255,255,255,0.05); margin: 4px 12px; }

/* ── Main Content ── */
.main-content { flex: 1; overflow-y: auto; overflow-x: hidden; background: transparent; }

.topbar {
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.76);
  box-shadow: 0 1px 0 rgba(15,23,42,0.04), 0 4px 20px rgba(15,23,42,0.05);
  padding: 0 30px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h1 {
  font-size: 20px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #0F172A 0%, #2d4080 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-content { padding: 28px; }

/* ══ CARDS (admin extensions) ════════════════════════════════════════ */
.card { transition: box-shadow .25s cubic-bezier(0.16,1,0.3,1), transform .25s cubic-bezier(0.16,1,0.3,1); }
.card:hover { box-shadow: 0 12px 36px rgba(15,23,42,0.11), 0 2px 8px rgba(15,23,42,0.05); transform: translateY(-2px); }
.card-body { padding: 24px; }

/* ── Stat Cards ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 28px; }

.stat-card {
  background: rgba(255,255,255,0.76);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.88);
  border-radius: var(--radius);
  padding: 26px 24px 22px;
  box-shadow: 0 2px 16px rgba(15,23,42,0.07), 0 1px 3px rgba(15,23,42,0.04), inset 0 1px 0 rgba(255,255,255,0.85);
  position: relative;
  overflow: hidden;
  transition: box-shadow .25s cubic-bezier(0.16,1,0.3,1), transform .25s cubic-bezier(0.16,1,0.3,1);
  border-top: 3px solid rgba(201,168,76,0.35);
}
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.50) 0%, transparent 60%);
  pointer-events: none;
}
.stat-card:hover { box-shadow: 0 12px 36px rgba(15,23,42,0.12), 0 2px 8px rgba(15,23,42,0.05); transform: translateY(-3px); }

.stat-card.green { border-top-color: rgba(22,163,74,0.60); }
.stat-card.red   { border-top-color: rgba(220,38,38,0.55); }
.stat-card.gold  { border-top-color: var(--gold); }

.stat-card-icon {
  position: absolute;
  top: 20px; right: 20px;
  width: 42px; height: 42px;
  background: rgba(201,168,76,0.09);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 1px solid rgba(201,168,76,0.14);
}
.stat-card.green .stat-card-icon { background: rgba(22,163,74,0.08); border-color: rgba(22,163,74,0.14); }
.stat-card.red   .stat-card-icon { background: rgba(220,38,38,0.07); border-color: rgba(220,38,38,0.12); }

.stat-card .stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .10em;
  margin-bottom: 14px;
}
.stat-card .stat-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
  letter-spacing: -0.04em;
}
.stat-card .stat-sub { font-size: 12px; color: var(--gray-400); margin-top: 9px; font-weight: 500; }

.stat-card.green .stat-value { color: #15803d; }
.stat-card.red   .stat-value { color: #b91c1c; }
.stat-card.gold  .stat-value { color: var(--gold); }

/* ══ TABLES (admin extensions) ═══════════════════════════════════════ */
thead { position: sticky; top: 0; z-index: 1; }

/* ── Badges (admin-only) ── */
.badge-active   { background: rgba(240,253,244,0.90); color: var(--success); border: 1px solid rgba(187,247,208,0.60); }
.badge-inactive { background: rgba(241,245,249,0.80); color: var(--gray-600); border: 1px solid rgba(226,232,240,0.60); }

/* ══ MODAL ═══════════════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8,15,30,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
}

.modal {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(48px) saturate(180%);
  -webkit-backdrop-filter: blur(48px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.90);
  border-radius: 18px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 72px rgba(15,23,42,0.16), 0 4px 20px rgba(15,23,42,0.08), inset 0 1px 0 rgba(255,255,255,0.90);
  border-top: 3px solid var(--gold);
  overflow: hidden;
}

.modal-header {
  padding: 22px 28px 18px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 15px; font-weight: 700; color: var(--navy); letter-spacing: -0.01em; }

.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--gray-400);
  padding: 6px;
  border-radius: 6px;
  line-height: 1;
  transition: all .15s ease;
}
.modal-close:hover { color: var(--navy); background: rgba(0,0,0,0.05); }

.modal-body { padding: 28px; overflow-y: auto; flex: 1; }

.modal-footer {
  padding: 18px 28px;
  border-top: 1px solid rgba(0,0,0,0.04);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

/* ── Upload Zone ── */
.upload-zone {
  border: 2px dashed rgba(226,232,240,0.80);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all .2s ease;
  background: rgba(248,250,252,0.50);
}
.upload-zone:hover { border-color: var(--navy); background: rgba(248,250,252,0.80); }
.upload-zone .icon { font-size: 32px; margin-bottom: 8px; }
.upload-zone p { color: var(--gray-600); font-size: 14px; }
.upload-zone small { color: var(--gray-400); font-size: 12px; }

/* ── School Code Badge ── */
.school-code-badge {
  background: rgba(255,255,255,0.10);
  color: var(--gold);
  font-family: monospace;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 5px;
  letter-spacing: .08em;
  border: 1px solid rgba(201,168,76,0.25);
}

/* ── Filters ── */
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; align-items: flex-end; }
.filters .form-group { margin-bottom: 0; min-width: 140px; }

/* ── Inline Edit ── */
.inline-edit { display: flex; gap: 8px; align-items: center; }
.inline-edit input { width: 120px; }

/* ── Mobile Menu Toggle ── */
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.menu-toggle span { display: block; width: 22px; height: 2px; background: var(--navy); margin: 5px 0; border-radius: 2px; }

/* ── Sidebar Close Button (mobile only) ── */
.sidebar-close {
  display: none;
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.60);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  z-index: 1;
  transition: color .15s, background .15s;
}
.sidebar-close:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* ── Sidebar Backdrop (mobile only) ── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.40);
  z-index: 49;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.sidebar-backdrop.visible { opacity: 1; pointer-events: auto; }

/* ══ RESPONSIVE ══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; height: 100vh; transform: translateX(-100%); transition: transform .3s cubic-bezier(0.16,1,0.3,1); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: block; }
  .sidebar-close { display: block; }
  .sidebar-backdrop { display: block; }
  .main-content { width: 100%; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
  .modal { max-width: 100%; }
  .topbar { padding: 0 16px; }
  .auth-split { flex-direction: column; }
  .auth-left { width: 100%; padding: 40px 24px; min-height: 220px; }
  .auth-right { padding: 32px 24px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
  .auth-form-title { font-size: 22px; }
}
