/* ============================================================
   First Goshen-Gate School — Vivid Purple Theme
   ============================================================ */

:root {
  /* Brand palette — vivid purple blended with the navy/red logo */
  --primary: #7c3aed;          /* vivid purple */
  --primary-dark: #4c1d95;     /* deep purple (headers, footer, hero) */
  --primary-deep: #3b0d76;
  --primary-foreground: #ffffff;
  --accent: #e11d48;           /* logo-inspired red accent */
  --accent-foreground: #ffffff;

  --secondary: #ede9fe;        /* light purple */
  --secondary-foreground: #4c1d95;

  --background: #ffffff;
  --foreground: #1f1635;
  --muted: #f5f3ff;
  --muted-2: #faf9ff;
  --muted-foreground: #6b6485;
  --card: #ffffff;
  --border: #e7e1f5;

  --tone-a: #16a34a;
  --tone-b: #2563eb;
  --tone-c: #d97706;
  --tone-d: #e11d48;
  --tone-f: #b91c1c;

  --radius: 0.85rem;
  --shadow-sm: 0 1px 2px rgba(31, 22, 53, 0.06);
  --shadow: 0 10px 30px -12px rgba(76, 29, 149, 0.25);
  --shadow-lg: 0 20px 45px -15px rgba(76, 29, 149, 0.35);

  --font-heading: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  --container: 1180px;
}

* { box-sizing: border-box; }

html { background: var(--background); scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--foreground);
  background: var(--background);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { font-family: var(--font-heading); line-height: 1.2; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.icon { width: 20px; height: 20px; flex-shrink: 0; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1rem; }
.text-balance { text-wrap: balance; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ----------------------------- Buttons ----------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 600; font-size: 0.95rem;
  padding: 0.65rem 1.25rem; border-radius: calc(var(--radius) * 0.8);
  border: 1px solid transparent; cursor: pointer;
  transition: background .2s, color .2s, transform .05s, box-shadow .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: var(--accent-foreground); }
.btn-accent:hover { filter: brightness(0.94); }
.btn-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.btn-secondary:hover { background: #ddd3fb; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--foreground); }
.btn-outline:hover { background: var(--muted); }
.btn-outline-light { background: transparent; border-color: rgba(255,255,255,.4); color: #fff; }
.btn-outline-light:hover { background: rgba(255,255,255,.12); }
.btn-lg { padding: 0.85rem 1.6rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; border-color: transparent; padding: 0.5rem; }
.btn-ghost:hover { background: var(--muted); }
.btn-icon { padding: 0.5rem; border-radius: 0.6rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.text-danger { color: var(--accent); }

/* ----------------------------- Badges ----------------------------- */
.badge {
  display: inline-flex; align-items: center;
  font-size: 0.75rem; font-weight: 600; padding: 0.2rem 0.6rem;
  border-radius: 999px; background: var(--secondary); color: var(--secondary-foreground);
}
.badge-primary { background: var(--primary); color: #fff; }
.badge-accent { background: var(--accent); color: #fff; }
.badge-green { background: var(--tone-a); color: #fff; }
.tone-a { background: var(--tone-a); color: #fff; }
.tone-b { background: var(--tone-b); color: #fff; }
.tone-c { background: var(--tone-c); color: #fff; }
.tone-d { background: var(--tone-d); color: #fff; }
.tone-f { background: var(--tone-f); color: #fff; }

/* ----------------------------- Cards ----------------------------- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-hover { transition: box-shadow .2s, transform .2s; }
.card-hover:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card-body { padding: 1.5rem; }

/* ----------------------------- Header ----------------------------- */
.topbar { background: var(--primary-dark); color: #fff; font-size: 0.85rem; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; padding-top: .5rem; padding-bottom: .5rem; gap: 1rem; }
.topbar .contact { display: flex; align-items: center; gap: .5rem; }
.topbar .dot { opacity: .6; }
.topbar .motto { font-style: italic; font-weight: 500; }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .75rem; padding-bottom: .75rem; }
.brand { display: flex; align-items: center; gap: .75rem; }
.brand img { width: 48px; height: 48px; object-fit: contain; }
.brand .b-name { font-family: var(--font-heading); font-weight: 700; color: var(--primary-dark); font-size: 1.05rem; line-height: 1.1; }
.brand .b-sub { font-size: .72rem; color: var(--muted-foreground); }

.main-nav { display: none; align-items: center; gap: .25rem; }
.main-nav a { padding: .5rem .75rem; border-radius: .5rem; font-weight: 500; font-size: .95rem; color: rgba(31,22,53,.8); transition: background .15s, color .15s; }
.main-nav a:hover { background: var(--secondary); color: var(--secondary-foreground); }
.main-nav a.active { color: var(--primary); font-weight: 600; }

.header-actions { display: none; align-items: center; gap: .5rem; }
.menu-toggle { display: inline-flex; background: none; border: none; padding: .5rem; cursor: pointer; color: var(--foreground); }

.mobile-nav { display: none; border-top: 1px solid var(--border); background: #fff; }
.mobile-nav.open { display: block; }
.mobile-nav .container { display: flex; flex-direction: column; gap: .25rem; padding-top: .75rem; padding-bottom: .75rem; }
.mobile-nav a { padding: .6rem .75rem; border-radius: .5rem; font-weight: 500; }
.mobile-nav a.active { background: var(--secondary); color: var(--primary); }
.mobile-actions { margin-top: .5rem; display: flex; flex-direction: column; gap: .5rem; }

@media (min-width: 1024px) {
  .main-nav, .header-actions { display: flex; }
  .menu-toggle { display: none; }
}
@media (max-width: 767px) { .topbar { display: none; } }

/* ----------------------------- Hero slider ----------------------------- */
.hero { position: relative; height: 78vh; min-height: 520px; overflow: hidden; background: var(--primary-dark); }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .7s ease; }
.hero-slide.active { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }
.hero-slide .overlay { position: absolute; inset: 0; background: linear-gradient(to right, rgba(60,13,118,.9), rgba(76,29,149,.6) 55%, rgba(124,58,237,.25)); }
.hero-content { position: relative; z-index: 10; height: 100%; display: flex; align-items: center; }
.hero-content .inner { max-width: 640px; color: #fff; }
.hero-eyebrow { display: inline-block; background: var(--accent); color: #fff; font-weight: 600; font-size: .85rem; padding: .25rem 1rem; border-radius: 999px; }
.hero h1 { margin-top: 1rem; font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; line-height: 1.05; }
.hero .lead { margin-top: 1rem; font-size: 1.15rem; color: rgba(255,255,255,.9); max-width: 36rem; }
.hero-cta { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .75rem; }
.hero-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 20; background: rgba(255,255,255,.25); border: none; color: #fff; padding: .5rem; border-radius: 999px; cursor: pointer; backdrop-filter: blur(4px); transition: background .2s; }
.hero-arrow:hover { background: rgba(255,255,255,.45); }
.hero-arrow.prev { left: 1rem; } .hero-arrow.next { right: 1rem; }
.hero-dots { position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; gap: .5rem; }
.hero-dots button { height: 10px; width: 10px; border-radius: 999px; border: none; background: rgba(255,255,255,.5); cursor: pointer; transition: all .3s; padding: 0; }
.hero-dots button.active { width: 32px; background: var(--accent); }

/* ----------------------------- Page hero ----------------------------- */
.page-hero { background: var(--primary-dark); color: #fff; padding: 3.5rem 0; text-align: center; }
.page-hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 800; }
.page-hero p { margin: 1rem auto 0; max-width: 42rem; color: rgba(255,255,255,.85); }

/* ----------------------------- Sections ----------------------------- */
.section { padding: 4rem 0; }
@media (min-width: 1024px) { .section { padding: 6rem 0; } }
.section-muted { background: var(--muted); }
.section-secondary { background: #f3eefe; }
.section-purple { background: var(--primary-dark); color: #fff; }

.eyebrow { font-family: var(--font-heading); font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }
.section-title { margin-top: .5rem; font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 700; color: var(--primary-dark); }
.section-purple .section-title { color: #fff; }
.section-head { max-width: 42rem; margin: 0 auto; text-align: center; }
.section-head p { margin-top: 1rem; color: var(--muted-foreground); }
.section-purple .section-head p { color: rgba(255,255,255,.8); }

/* Grid utilities */
.grid { display: grid; gap: 1.5rem; }
.two-col { grid-template-columns: 1fr; align-items: center; gap: 3rem; }
.cards-2 { grid-template-columns: 1fr; }
.cards-3 { grid-template-columns: 1fr; }
.cards-4 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .cards-2 { grid-template-columns: repeat(2,1fr); } .cards-4 { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 768px) { .cards-3 { grid-template-columns: repeat(3,1fr); } }
@media (min-width: 1024px) { .two-col { grid-template-columns: 1fr 1fr; } .cards-4 { grid-template-columns: repeat(4,1fr); } }

/* About */
.about-img-wrap { position: relative; }
.about-img { position: relative; height: 420px; border-radius: 1.25rem; overflow: hidden; }
.about-img img { width: 100%; height: 100%; object-fit: cover; }
.about-badge { position: absolute; bottom: -1.5rem; right: -1rem; background: var(--accent); color: #fff; padding: 1.25rem 1.5rem; border-radius: 1.25rem; box-shadow: var(--shadow); }
.about-badge .num { font-family: var(--font-heading); font-size: 1.9rem; font-weight: 800; }
.about-badge .lbl { font-size: .85rem; }
@media (max-width: 639px) { .about-badge { display: none; } }
.checklist { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .75rem; }
.checklist li { display: flex; gap: .5rem; align-items: flex-start; font-size: .95rem; }
.checklist .icon { color: var(--accent); margin-top: 2px; }
@media (min-width: 640px) { .checklist { grid-template-columns: repeat(2,1fr); } }
.lead-text { margin-top: 1rem; color: var(--muted-foreground); }

/* Program cards */
.program-card { overflow: hidden; padding: 0; }
.program-card .pc-img { height: 11rem; }
.program-card .pc-img img { width: 100%; height: 100%; object-fit: cover; }
.program-card .pc-body { padding: 1.25rem; }
.pc-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.pc-head h3 { font-size: 1.15rem; color: var(--primary-dark); }
.pc-body p { margin-top: .5rem; color: var(--muted-foreground); font-size: .9rem; }

/* Value tiles (purple section) */
.value-tile { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 1.25rem; padding: 1.5rem; }
.value-icon { display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3rem; border-radius: .85rem; background: var(--accent); color: #fff; }
.value-tile h3 { margin-top: 1rem; font-size: 1.15rem; }
.value-tile p { margin-top: .5rem; font-size: .9rem; color: rgba(255,255,255,.8); }
.value-card-light .value-icon { background: var(--secondary); color: var(--secondary-foreground); }
.value-card-light h3 { color: var(--primary-dark); }
.value-card-light p { color: var(--muted-foreground); }

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1rem; }
@media (min-width: 768px) { .gallery-grid { grid-template-columns: repeat(3,1fr); } }
.gallery-item { position: relative; overflow: hidden; border-radius: .85rem; aspect-ratio: 1; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.gallery-item:hover img { transform: scale(1.06); }

/* Testimonials */
.quote-icon { color: var(--accent); }
.t-card { height: 100%; display: flex; flex-direction: column; }
.t-card .q { margin-top: 1rem; flex: 1; color: rgba(31,22,53,.9); }
.t-card .who { margin-top: 1.5rem; }
.t-card .who .n { font-family: var(--font-heading); font-weight: 600; color: var(--primary-dark); }
.t-card .who .r { font-size: .85rem; color: var(--muted-foreground); }

/* Mission / vision */
.mv-icon { display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3rem; border-radius: .85rem; }
.mv-icon.purple { background: var(--primary); color: #fff; }
.mv-icon.red { background: var(--accent); color: #fff; }

/* Program detail rows */
.prog-row { display: grid; gap: 2rem; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .prog-row { grid-template-columns: 1fr 1fr; } .prog-row.reverse .prog-img { order: 2; } }
.prog-img { position: relative; height: 18rem; border-radius: 1.25rem; overflow: hidden; }
@media (min-width: 1024px) { .prog-img { height: 24rem; } }
.prog-img img { width: 100%; height: 100%; object-fit: cover; }

/* CTA */
.cta-box { background: var(--accent); color: #fff; border-radius: 1.5rem; padding: 3rem 1.5rem; text-align: center; }
@media (min-width: 640px) { .cta-box { padding: 4rem 3rem; } }
.cta-box h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 700; max-width: 36rem; margin: 0 auto; }
.cta-box p { max-width: 34rem; margin: 1rem auto 0; color: rgba(255,255,255,.9); }
.cta-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }

/* Contact */
.contact-grid { display: grid; gap: 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.info-card { display: flex; align-items: flex-start; gap: 1rem; padding: 1.25rem; }
.info-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: .85rem; background: var(--secondary); color: var(--secondary-foreground); flex-shrink: 0; }
.info-card .lbl { font-family: var(--font-heading); font-weight: 600; }
.info-card .val { font-size: .9rem; color: var(--muted-foreground); }

/* Forms */
.field { display: grid; gap: .4rem; margin-bottom: 1rem; }
.field label { font-size: .9rem; font-weight: 600; }
.input, .textarea, .select {
  width: 100%; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: .6rem;
  font: inherit; color: var(--foreground); background: #fff; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,58,237,.15); }
.textarea { resize: vertical; min-height: 7rem; }
.field-row { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }
.input-icon-wrap { position: relative; }
.input-icon-wrap .icon { position: absolute; left: .65rem; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); }
.input-icon-wrap .input { padding-left: 2.25rem; }

/* Email portal page */
.webmail-card { overflow: hidden; }
.webmail-head { background: var(--primary-dark); color: #fff; text-align: center; padding: 2.5rem 1.5rem; }
.webmail-badge { display: inline-flex; align-items: center; justify-content: center; width: 4rem; height: 4rem; border-radius: 1.25rem; background: rgba(255,255,255,.1); margin: 0 auto; }
.tip-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: .65rem; background: var(--secondary); color: var(--secondary-foreground); }

/* Flash / alerts */
.flash-stack { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: .5rem; width: min(92%, 420px); }
.flash { padding: .8rem 1rem; border-radius: .6rem; box-shadow: var(--shadow); font-size: .9rem; font-weight: 500; }
.flash-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-info { background: var(--secondary); color: var(--secondary-foreground); }

/* Footer */
.site-footer { background: var(--primary-dark); color: #fff; }
.footer-grid { display: grid; gap: 2.5rem; padding: 3rem 0; grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: repeat(4,1fr); } }
.footer-brand { display: flex; align-items: center; gap: .75rem; }
.footer-brand img { width: 48px; height: 48px; border-radius: 999px; background: rgba(255,255,255,.9); object-fit: contain; padding: 4px; }
.footer-brand span { font-family: var(--font-heading); font-weight: 700; font-size: 1.1rem; }
.site-footer p, .site-footer li { color: rgba(255,255,255,.8); }
.footer-col h3 { font-family: var(--font-heading); font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.footer-col ul { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .5rem; font-size: .9rem; }
.footer-col a:hover { color: #fff; }
.footer-contact li { display: flex; gap: .5rem; align-items: flex-start; font-size: .9rem; margin-top: .75rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); }
.footer-bottom .container { display: flex; flex-direction: column; gap: .5rem; align-items: center; justify-content: space-between; padding: 1.25rem 1rem; font-size: .8rem; color: rgba(255,255,255,.7); }
@media (min-width: 640px) { .footer-bottom .container { flex-direction: row; } }

.mt-2 { margin-top: .5rem; } .mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; } .mt-8 { margin-top: 2rem; }
.flex-page { display: flex; flex-direction: column; min-height: 100vh; }
.flex-1 { flex: 1; }

/* ============================================================
   School Portal
   ============================================================ */

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--muted); padding: 3rem 1rem; }
.login-card-wrap { width: 100%; max-width: 28rem; }
.login-head { text-align: center; margin-bottom: 1.5rem; display: flex; flex-direction: column; align-items: center; }
.login-head img { width: 64px; height: 64px; object-fit: contain; }
.login-head h1 { margin-top: 1rem; font-size: 1.5rem; color: var(--primary-dark); }
.login-head p { margin-top: .25rem; font-size: .9rem; color: var(--muted-foreground); }
.login-card { border: 1px solid var(--border); background: var(--card); border-radius: 1.25rem; box-shadow: var(--shadow); padding: 2rem; }
.demo-box { margin-top: 1.5rem; background: var(--muted); border-radius: .6rem; padding: 1rem; }
.demo-box .hd { display: flex; align-items: center; gap: .5rem; font-size: .8rem; font-weight: 600; }
.demo-box .hd .icon { color: var(--primary); }
.demo-grid { margin-top: .75rem; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.demo-box .note { margin-top: .75rem; font-size: .78rem; color: var(--muted-foreground); line-height: 1.5; }
.back-link { margin-top: 1.5rem; text-align: center; font-size: .9rem; }
.back-link a { color: var(--primary); font-weight: 600; }

/* Portal layout */
.portal { display: flex; min-height: 100vh; background: var(--muted); }
.sidebar { width: 16rem; flex-shrink: 0; background: var(--primary-deep); color: #fff; display: none; }
.sidebar-inner { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.sidebar-head { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.12); }
.sidebar-head img { width: 40px; height: 40px; object-fit: contain; background: rgba(255,255,255,.1); border-radius: .4rem; padding: 4px; }
.sidebar-head .t { font-family: var(--font-heading); font-weight: 700; font-size: .9rem; }
.sidebar-head .s { font-size: .72rem; color: rgba(255,255,255,.6); }
.sidebar-nav { flex: 1; padding: 1rem .75rem; display: grid; gap: .25rem; align-content: start; }
.sidebar-nav a, .sidebar-foot a, .sidebar-foot button {
  display: flex; align-items: center; gap: .75rem; padding: .65rem .75rem; border-radius: .6rem;
  font-size: .9rem; font-weight: 500; color: rgba(255,255,255,.8); transition: background .15s, color .15s;
  border: none; background: none; cursor: pointer; width: 100%; text-align: left; font-family: var(--font-sans);
}
.sidebar-nav a:hover, .sidebar-foot a:hover, .sidebar-foot button:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-nav a.active { background: var(--accent); color: #fff; }
.sidebar-foot { padding: 1rem .75rem; border-top: 1px solid rgba(255,255,255,.12); display: grid; gap: .25rem; }
.sidebar-foot a .ml-auto { margin-left: auto; }

.portal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.portal-topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: #fff; border-bottom: 1px solid var(--border); padding: .75rem 1rem; }
.portal-topbar .left { display: flex; align-items: center; gap: .75rem; }
.portal-topbar .view-site { font-size: .9rem; color: var(--muted-foreground); }
.portal-topbar .view-site:hover { color: var(--foreground); }
.portal-user { display: flex; align-items: center; gap: .75rem; }
.portal-user .meta { text-align: right; line-height: 1.2; }
.portal-user .meta .n { font-size: .9rem; font-weight: 600; }
.portal-user .meta .r { font-size: .75rem; color: var(--muted-foreground); text-transform: capitalize; }
.avatar { width: 2.25rem; height: 2.25rem; border-radius: 999px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }
.sidebar-mobile-btn { display: inline-flex; background: none; border: none; padding: .5rem; cursor: pointer; color: var(--foreground); }
.portal-content { flex: 1; padding: 1.5rem 1rem; }

@media (min-width: 1024px) {
  .sidebar { display: block; }
  .sidebar-mobile-btn { display: none; }
  .portal-content { padding: 2rem; }
  .portal-topbar { padding: .75rem 2rem; }
}

/* Mobile sidebar overlay */
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(31,22,53,.5); z-index: 40; }
.sidebar-backdrop.open { display: block; }
@media (max-width: 1023px) {
  .sidebar.open { display: block; position: fixed; left: 0; top: 0; height: 100%; z-index: 50; }
  .sidebar.open .sidebar-inner { height: 100%; }
}

/* Portal headings & stats */
.portal-h1 { font-size: 1.5rem; font-weight: 700; }
.portal-sub { margin-top: .25rem; color: var(--muted-foreground); }
.page-head { display: flex; flex-direction: column; gap: 1rem; }
@media (min-width: 640px) { .page-head { flex-direction: row; align-items: center; justify-content: space-between; } }

.stat-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 1280px) { .stat-grid { grid-template-columns: repeat(4,1fr); } }
.stat-card { display: flex; align-items: center; gap: 1rem; padding: 1.25rem; }
.stat-icon { width: 3rem; height: 3rem; border-radius: .85rem; background: var(--secondary); color: var(--secondary-foreground); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-card .v { font-size: 1.5rem; font-weight: 700; }
.stat-card .l { font-size: .85rem; color: var(--muted-foreground); }

.panel-grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .panel-grid { grid-template-columns: 1fr 1fr; } }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem 0; }
.panel-head h3 { font-size: 1rem; }
.panel-head a { font-size: .85rem; font-weight: 600; color: var(--primary); display: inline-flex; align-items: center; gap: .25rem; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.list-rows { display: grid; gap: .75rem; padding: 1rem 1.5rem 1.5rem; }
.list-row .nm { font-size: .9rem; font-weight: 500; }
.list-row .sm { font-size: .75rem; color: var(--muted-foreground); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--border); }
table.data th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted-foreground); font-weight: 600; background: var(--muted-2); }
table.data tr:last-child td { border-bottom: none; }
table.data td.actions { text-align: right; white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
.cell-sub { display: block; font-size: .75rem; color: var(--muted-foreground); }
.empty-row td { text-align: center; padding: 2.5rem; color: var(--muted-foreground); }
.action-btns { display: inline-flex; gap: .25rem; justify-content: flex-end; }

.toolbar { display: flex; align-items: center; gap: .5rem; }
.search-box { position: relative; max-width: 24rem; width: 100%; }
.search-box .icon { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); }
.search-box .input { padding-left: 2.25rem; }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; z-index: 60; background: rgba(31,22,53,.55); padding: 1rem; overflow-y: auto; }
.modal-overlay.open { display: flex; align-items: flex-start; justify-content: center; }
.modal { background: #fff; border-radius: 1rem; box-shadow: var(--shadow-lg); width: 100%; max-width: 34rem; margin: 2rem auto; max-height: 90vh; overflow-y: auto; }
.modal-head { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 1.15rem; }
.modal-body { padding: 1.5rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: .5rem; padding-top: .5rem; }

/* Restricted notice */
.restricted { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 4rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.restricted .icon { color: var(--muted-foreground); width: 40px; height: 40px; }
.restricted h2 { margin-top: 1rem; font-size: 1.15rem; }
.restricted p { margin-top: .25rem; max-width: 24rem; font-size: .9rem; color: var(--muted-foreground); }

/* Slides manager */
.slide-row { display: flex; flex-direction: column; gap: 1rem; padding: 1rem; }
@media (min-width: 640px) { .slide-row { flex-direction: row; align-items: center; } }
.slide-thumb { position: relative; height: 7rem; width: 100%; flex-shrink: 0; border-radius: .6rem; overflow: hidden; background: var(--muted); }
@media (min-width: 640px) { .slide-thumb { width: 12rem; } }
.slide-thumb img { width: 100%; height: 100%; object-fit: cover; }
.slide-thumb .num { position: absolute; left: .5rem; top: .5rem; background: rgba(31,22,53,.7); color: #fff; font-size: .72rem; font-weight: 500; padding: .1rem .5rem; border-radius: .4rem; }
.slide-info { flex: 1; min-width: 0; }
.slide-info h3 { font-size: 1rem; }
.slide-info p { font-size: .9rem; color: var(--muted-foreground); margin-top: .25rem; }
.slide-info .path { margin-top: .5rem; font-size: .75rem; }
.slide-actions { display: flex; gap: .25rem; }
.preview-box { position: relative; margin-top: .5rem; height: 8rem; width: 100%; border-radius: .6rem; overflow: hidden; background: var(--muted); }
.preview-box img { width: 100%; height: 100%; object-fit: cover; }

/* Portal forms & misc */
.form-grid-2 { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .form-grid-2 { grid-template-columns: 1fr 1fr; } }
.btn-danger { color: var(--accent); }
.btn-danger:hover { background: #fee2e2; color: var(--accent); }
.badge-soft { background: var(--secondary); color: var(--secondary-foreground); }
.quick-action { padding: .85rem 1rem; border: 1px solid var(--border); border-radius: .65rem; transition: background .15s, border-color .15s; }
.quick-action:hover { background: var(--muted); border-color: var(--primary); }
.alert { padding: .8rem 1rem; border-radius: .6rem; font-size: .9rem; font-weight: 500; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.text-muted { color: var(--muted-foreground); }
