@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --brand: #E74C3C;
  --brand-dark: #c0392b;
  --canvas: #f4f7fb;
  --ink: #202a35;
  --muted: #728091;
  --line: #e8edf2;
  --white: #ffffff;
  --radius: 14px;
  --shadow: 0 12px 34px rgba(32, 42, 53, .08);
  --shadow-soft: 0 5px 18px rgba(32, 42, 53, .06);
}

html { scroll-behavior: smooth; }
body { background: var(--canvas); color: var(--ink); font-family: 'DM Sans', sans-serif; }
h1, h2, h3, h4, h5, h6, .navbar-brand { font-family: 'Space Grotesk', sans-serif; letter-spacing: 0; }
a { transition: color .2s ease, background-color .2s ease, transform .2s ease, box-shadow .2s ease; }

/* Shared dashboard shell */
.dashboard-shell { min-height: 100vh; }
.dashboard-sidebar { position: fixed; z-index: 1040; inset: 0 auto 0 0; width: 248px; padding: 24px 16px; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: var(--white); transition: transform .25s ease, width .25s ease; }
.admin-sidebar { overflow-x: hidden; overflow-y: auto; }
.brand-lockup { display: flex; align-items: center; gap: 11px; padding: 0 10px 25px; color: var(--white); text-decoration: none; }
.brand-lockup img { width: 42px; height: 42px; object-fit: contain; background: rgba(255,255,255,.16); border-radius: 12px; padding: 5px; }
.site-logo { height: 42px; object-fit: contain; }
.school-profile-logo { height: 210px; object-fit: contain; padding: 24px; background: #fff; }
.brand-lockup strong { display: block; font-size: .94rem; line-height: 1.15; }
.brand-lockup small { opacity: .72; font-size: .72rem; }
.nav-section-label { padding: 8px 12px 7px; color: rgba(255,255,255,.58); font-size: .67rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.dashboard-nav { gap: 4px !important; }
.dashboard-nav .nav-link { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: rgba(255,255,255,.82); font-size: .88rem; font-weight: 500; }
.dashboard-nav .nav-link i { width: 19px; text-align: center; font-size: 1rem; }
.dashboard-nav .nav-link:hover, .dashboard-nav .nav-link.active { color: var(--white); background: rgba(255,255,255,.16); transform: translateX(2px); }
.dashboard-nav .nav-link.active { box-shadow: inset 3px 0 0 var(--white); }
.dashboard-nav .logout-link { margin-top: 12px; color: rgba(255,255,255,.72); }
.dashboard-main { min-height: 100vh; margin-left: 248px; }
.dashboard-topbar { position: sticky; z-index: 1030; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 14px 34px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.topbar-heading small { display: block; margin-bottom: 2px; color: var(--muted); font-size: .75rem; }
.topbar-heading h4 { margin: 0; font-size: 1.3rem; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); }
.user-avatar { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: var(--brand); color: var(--white); font-weight: 700; font-size: .8rem; }
.user-chip strong { display: block; font-size: .8rem; line-height: 1.1; }
.user-chip small { color: var(--muted); font-size: .7rem; }
.dashboard-content { padding: 30px 34px 44px; }
.mobile-menu { display: none; border: 0; background: transparent; color: var(--brand-dark); font-size: 1.35rem; }
.sidebar-backdrop { display: none; }

.card { border: 1px solid rgba(232,237,242,.9); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.card.p-4 { padding: 24px !important; }
.card:hover { box-shadow: var(--shadow); }
.stat-card { position: relative; overflow: hidden; min-height: 142px; }
.stat-card::after { position: absolute; right: -22px; bottom: -38px; width: 112px; height: 112px; border: 18px solid rgba(231,76,60,.08); border-radius: 50%; content: ''; }
.stat-card .stat-icon { display: grid; width: 40px; height: 40px; place-items: center; margin-bottom: 18px; border-radius: 11px; background: rgba(231,76,60,.1); color: var(--brand-dark); font-size: 1.1rem; }
.stat-card h3 { margin: 4px 0 0; font-size: 1.8rem; }
.stat-card h6 { color: var(--muted); font-size: .78rem; font-weight: 600; }
.table-responsive { border: 1px solid var(--line); border-radius: 10px; }
.table { margin: 0; vertical-align: middle; }
.table thead th { padding: 13px 15px; border-bottom: 1px solid var(--line); background: #fafbfc; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.table tbody td { padding: 14px 15px; border-color: var(--line); font-size: .86rem; }
.table tbody tr { transition: background .2s ease; }
.table tbody tr:hover { background: rgba(231,76,60,.035); }
.form-control, .form-select { min-height: 42px; border-color: #dfe5eb; border-radius: 9px; color: var(--ink); font-size: .88rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(231,76,60,.12); }
.form-label { margin-bottom: 6px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.btn { border-radius: 9px; font-weight: 600; transition: transform .2s ease, box-shadow .2s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(32,42,53,.1); }
.btn-danger, .btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-danger:hover, .btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-outline-danger, .btn-outline-primary { color: var(--brand-dark); border-color: rgba(192,57,43,.5); }
.btn-outline-danger:hover, .btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); color: var(--white); }
.badge { border-radius: 999px; padding: 6px 9px; font-weight: 600; }
.alert { border: 0; border-radius: 10px; font-size: .86rem; }
.profile-hero-card { text-align: center; background: linear-gradient(160deg, #fff, #fff7f6); }
.profile-avatar-wrap { display: flex; min-height: 176px; align-items: center; justify-content: center; margin-bottom: 20px; }
.profile-avatar-image, .profile-avatar-placeholder { width: 156px; height: 156px; border: 6px solid #fff; border-radius: 50%; box-shadow: 0 10px 24px rgba(32,42,53,.13); }
.profile-avatar-image { object-fit: cover; }
.profile-avatar-placeholder { display: grid; place-items: center; background: rgba(231,76,60,.1); color: var(--brand-dark); font-size: 4rem; }
.profile-meta { display: grid; gap: 12px; margin-top: 22px; text-align: left; }
.profile-meta > div { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.profile-meta i { width: 22px; color: var(--brand); font-size: 1.1rem; text-align: center; }
.profile-meta small, .profile-details small { display: block; margin-bottom: 2px; color: var(--muted); font-size: .72rem; }
.profile-meta strong { display: block; font-size: .82rem; overflow-wrap: anywhere; }
.profile-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.profile-details > div { min-height: 86px; padding: 17px; background: #fff; }
.profile-details strong { display: block; font-size: .9rem; overflow-wrap: anywhere; }
.profile-detail-wide { grid-column: 1 / -1; }

/* Public landing and login */
.public-nav { border-bottom: 1px solid var(--line); }
.public-nav .nav-link { color: var(--muted); font-weight: 600; font-size: .86rem; }
.public-nav .nav-link.active { color: var(--brand-dark); font-weight: 700; }
.public-nav .nav-link:hover { color: var(--brand-dark); }
.public-hero { min-height: clamp(680px, 60vw, 900px); background-image: url('../images/logo/banner web.jpeg'); background-position: center; background-size: cover; background-repeat: no-repeat; }
.public-section { padding: 76px 0; }
.public-section > .container > .card, .public-section > .container .card { box-shadow: var(--shadow-soft); }
.login-page { min-height: 100vh; background: linear-gradient(135deg, var(--brand), #fceaea); }
.login-page > .container > .row { width: 100%; max-width: 100%; flex: 0 0 100%; }
.login-panel { width: min(100%, 460px); margin-inline: auto; border: 0; border-radius: 18px; box-shadow: 0 24px 60px rgba(123,34,26,.18); }
.register-panel { width: min(100%, 620px); }
.subject-checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.subject-option { cursor: pointer; }
.subject-option input { position: absolute; opacity: 0; pointer-events: none; }
.subject-option span { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font-size: .82rem; transition: .2s ease; }
.subject-option i { color: transparent; font-size: 1rem; }
.subject-option:hover span { border-color: var(--brand); background: rgba(231,76,60,.04); }
.subject-option input:checked + span { border-color: var(--brand); background: rgba(231,76,60,.1); color: var(--brand-dark); font-weight: 700; box-shadow: 0 0 0 2px rgba(231,76,60,.1); }
.subject-option input:checked + span i { color: var(--brand); }
.login-mark { display: grid; width: 64px; height: 64px; place-items: center; margin: 0 auto 16px; border-radius: 18px; background: rgba(231,76,60,.1); }
.login-mark img { width: 48px; height: 48px; }

@media (max-width: 991.98px) {
  .dashboard-sidebar { transform: translateX(-100%); box-shadow: 12px 0 30px rgba(32,42,53,.15); }
  .dashboard-sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop.is-open { position: fixed; z-index: 1035; inset: 0; display: block; background: rgba(32,42,53,.35); }
  .dashboard-main { margin-left: 0; }
  .mobile-menu { display: inline-grid; place-items: center; }
  .dashboard-topbar { padding: 14px 20px; }
  .dashboard-content { padding: 24px 20px 36px; }
}
@media (max-width: 575.98px) {
  .dashboard-topbar { min-height: 68px; }
  .topbar-heading h4 { font-size: 1.05rem; }
  .topbar-heading small { display: none; }
  .user-chip { padding-right: 6px; }
  .user-chip > div:not(.user-avatar) { display: none; }
  .dashboard-content { padding: 18px 14px 28px; }
  .card.p-4 { padding: 18px !important; }
  .public-section { padding: 45px 0; }
  .profile-details { grid-template-columns: 1fr; }
  .profile-detail-wide { grid-column: auto; }
  .subject-checkbox-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
