/* ==========================================================================
   Portal Web Sekolah & LMS Terpadu - Lightweight Responsive Design System
   Auto-resize layout (320px mobile -> 1440px+ desktop) tanpa library berat
   ========================================================================== */

:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-soft: #f0f4fa;
  --text: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --brand: #1d4ed8;
  --brand-dark: #1e40af;
  --brand-soft: #dbeafe;
  --accent: #0d9488;
  --accent-soft: #ccfbf1;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 6px 24px -8px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 40px -16px rgba(29, 78, 216, 0.18);
  --container: min(1240px, 100% - 2rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: clamp(0.92rem, 0.9rem + 0.15vw, 1rem);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: var(--surface-soft);
  padding: 2px 6px;
  border-radius: 6px;
}

.container { width: var(--container); margin-inline: auto; }
.section { padding-block: clamp(28px, 4vw, 52px); }
.section-tight { padding-block: clamp(18px, 2.5vw, 32px); }
.stack-sm { display: grid; gap: 10px; }
.stack-md { display: grid; gap: 16px; }
.stack-lg { display: grid; gap: 24px; }
.flex-wrap { display: flex; flex-wrap: wrap; align-items: center; }
.justify-between { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.78rem; }

/* ---------- Topbar & Navigation ---------- */
.topbar-info {
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.78rem;
  padding: 7px 0;
}
.topbar-info .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  font-weight: 600;
}
.sync-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.05rem;
  box-shadow: 0 8px 18px -6px rgba(29, 78, 216, 0.45);
}
.brand-title { font-weight: 700; font-size: 0.98rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.brand-sub { font-size: 0.74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 9px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover, .nav-links a.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
  text-decoration: none;
}
.nav-cta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-toggle {
  display: none;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 11px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}

@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; align-items: center; gap: 6px; }
  .nav-links {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 12px 16px 18px;
    flex-direction: column;
    align-items: stretch;
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 12px; }
  .brand-sub { display: none; }
}

/* ---------- Buttons & Badges ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.16s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-sm { padding: 6px 11px; font-size: 0.8rem; border-radius: 7px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px -6px rgba(29, 78, 216, 0.5); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #0f766e; }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-danger { background: var(--danger); color: #fff; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface-soft);
  color: var(--muted);
}
.badge-brand { background: var(--brand-soft); color: var(--brand-dark); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-accent { background: var(--accent-soft); color: #115e59; }

/* ---------- Hero ---------- */
.hero {
  background: radial-gradient(circle at top right, #dbeafe 0%, #eff6ff 40%, #ffffff 100%);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(32px, 5vw, 60px);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.95fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: center;
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 {
  font-size: clamp(1.65rem, 2.8vw, 2.55rem);
  line-height: 1.18;
  margin: 12px 0 12px;
  letter-spacing: -0.02em;
}

/* ---------- Cards & Auto-Resize Grids ---------- */
.grid-auto-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 18px; }
.grid-auto-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 18px; }
.grid-auto-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-hover { transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #bfdbfe; }
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.card-header h2, .card-header h3 { margin: 0; font-size: 1.03rem; }
.card-body { padding: 18px; }

.stat-card {
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.stat-card .stat-label { font-size: 0.79rem; color: var(--muted); font-weight: 600; }
.stat-card .stat-val { font-size: clamp(1.35rem, 2.2vw, 1.85rem); font-weight: 800; margin: 4px 0 2px; color: var(--text); }

.mini-stat {
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}
.mini-stat span { font-size: 0.78rem; color: var(--muted); }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 12px; }

/* ---------- Tabs ---------- */
.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 18px;
}
.tab-btn {
  padding: 8px 14px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}
.tab-btn.active, .tab-btn:hover { background: var(--brand); color: #fff; }
a.tab-btn { display: inline-flex; align-items: center; text-decoration: none; }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
th, td { padding: 10px 13px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-soft); font-weight: 700; font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fbff; }

/* ---------- Forms & Alerts ---------- */
.form-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.form-group { display: grid; gap: 6px; }
.form-group label { font-size: 0.83rem; font-weight: 600; color: var(--text); }
.input, select.input, textarea.input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}
.input:focus { outline: 2px solid #93c5fd; border-color: var(--brand); }
textarea.input { min-height: 92px; resize: vertical; }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.88rem;
  margin-bottom: 16px;
}
.alert-ok { background: var(--ok-soft); border-color: #86efac; color: #14532d; }
.alert-warn { background: var(--warn-soft); border-color: #fde68a; color: #78350f; }
.alert-danger { background: var(--danger-soft); border-color: #fca5a5; color: #7f1d1d; }
.alert-info { background: var(--brand-soft); border-color: #93c5fd; color: #1e3a8a; }

/* ---------- Progress Bar ---------- */
.progress { width: 100%; height: 10px; border-radius: 999px; background: var(--surface-soft); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--accent)); }

/* ---------- Page Header ---------- */
.page-banner {
  background: linear-gradient(120deg, #eff6ff 0%, #f0fdfa 100%);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(22px, 3.2vw, 38px);
}
.page-banner h1 { margin: 8px 0 6px; font-size: clamp(1.4rem, 2.3vw, 2rem); }

/* ---------- Footer ---------- */
.site-footer {
  background: #0f172a;
  color: #cbd5e1;
  padding-block: 42px 24px;
  margin-top: 40px;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 24px; }
.site-footer h3, .site-footer h4 { color: #fff; margin-top: 0; font-size: 0.98rem; }
.site-footer a { color: #94a3b8; font-size: 0.86rem; display: block; padding: 3px 0; }
.site-footer a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #1e293b;
  margin-top: 28px;
  padding-top: 16px;
  font-size: 0.8rem;
  color: #94a3b8;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

@media print {
  .topbar-info, .site-header, .site-footer, .no-print { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; }
}


/* ---------- Ekstensi Portal Identitas, Media Sosial, Galeri, Alumni Chat & LMS Card Grid ---------- */
.identity-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #0f766e 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: clamp(22px, 3vw, 34px);
  box-shadow: var(--shadow-lg);
}
.identity-banner .text-muted { color: #cbd5e1; }

.social-frame {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.social-embed-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #eff6ff, #f0fdfa);
  border-bottom: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.social-embed-box iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.gallery-card-img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  background: var(--surface-soft);
}

.cover-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.subject-group-card {
  border-top: 4px solid var(--brand);
}

.chat-feed {
  display: grid;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding: 4px;
}
.chat-bubble {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
}
.submenu-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.submenu-pill {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
}
.submenu-pill.active, .submenu-pill:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  text-decoration: none;
}


/* ---------- Form Controls, Multi-Column Grids & Dashboard Shell ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.grid-main-aside { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.95fr); gap: 22px; align-items: start; }
@media (max-width: 960px) {
  .grid-2, .grid-3, .grid-main-aside { grid-template-columns: 1fr; }
}

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.83rem; font-weight: 600; color: var(--text); }
.field-hint { font-size: 0.76rem; color: var(--muted); }

.select, .textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14);
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.55; }

.btn-ok { background: var(--ok); color: #fff; box-shadow: 0 6px 14px -6px rgba(21, 128, 61, 0.45); }
.btn-ok:hover { background: #166534; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 12px; }
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.kpi-label { font-size: 0.77rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.kpi-value { font-size: 1.5rem; font-weight: 800; color: var(--text); margin-top: 2px; }

/* ---------- Beranda Modern Indonesia (Ticker, Split Welcome, Keunggulan, Quick Portal) ---------- */
.ticker-bar {
  background: linear-gradient(90deg, #1e3a8a, #0f766e);
  color: #fff;
  font-size: 0.82rem;
  padding: 8px 0;
}
.ticker-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ticker-tag {
  background: rgba(255, 255, 255, 0.18);
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.74rem;
  white-space: nowrap;
}
.ticker-bar a { color: #fef08a; font-weight: 600; }

.pillar-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.pillar-card.accent { border-top-color: var(--accent); }

.welcome-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.quick-portal-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.quick-portal-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

.img-preview-box {
  width: 100%;
  max-height: 180px;
  border-radius: var(--radius-sm);
  border: 1px dashed #cbd5e1;
  background: var(--surface-soft);
  object-fit: cover;
  padding: 4px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  background: var(--surface-soft);
  border-radius: 10px;
  margin-bottom: 18px;
}
.auth-tab {
  text-align: center;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
}
.auth-tab.active {
  background: var(--surface);
  color: var(--brand-dark);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  text-decoration: none;
}
