/* SMP Yos Sudarso Bandung — Design tokens & komponen dasar */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:wght@700;800&family=Poppins:wght@600;700&display=swap');

:root {
  --navy-950: #060b1d;
  --navy-900: #0b1226;
  --navy-700: #0b2a5b;
  --navy-500: #1d4a96;
  --gold-500: #ffb400;
  --gold-300: #f0cf6b;

  --bg: #ffffff;
  --bg-soft: #f5f7fb;
  --surface: #ffffff;
  --text: #14213d;
  --text-muted: #55627d;
  --border: #e1e6f0;
  --primary: var(--navy-700);
  --primary-contrast: #ffffff;
  --accent: var(--gold-500);
  --success: #1e9e6a;
  --warning: #e39b0b;
  --danger: #d64545;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(11, 42, 91, 0.08);
  --shadow-hover: 0 12px 32px rgba(11, 42, 91, 0.14);
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Poppins', var(--font-body);
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --container: 1180px;
  --t: 0.25s ease;
}

:root[data-theme='dark'] {
  --bg: #0a1226;
  --bg-soft: #111a33;
  --surface: #15203d;
  --text: #e6ebf5;
  --text-muted: #a3afc9;
  --border: #25335a;
  --primary: #7fa6e8;
  --primary-contrast: #071b3d;
  --accent: #e8b93c;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.5);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  transition: background var(--t), color var(--t);
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.container { width: min(100% - 32px, var(--container)); margin-inline: auto; }
.section { padding: 72px 0; }
.section--soft { background: var(--bg-soft); }
.section__head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section__head p { color: var(--text-muted); }
.eyebrow { color: var(--accent); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; }

/* Tombol */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 12px 22px; border-radius: 999px; border: 2px solid transparent;
  font: 600 .95rem var(--font-body); cursor: pointer;
  transition: transform var(--t), box-shadow var(--t), background var(--t);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); text-decoration: none; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn--primary { background: var(--primary); color: var(--primary-contrast); }
.btn--gold { background: var(--accent); color: #1b1400; }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--sm { padding: 8px 14px; font-size: .85rem; }

/* Card */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px;
  transition: transform var(--t), box-shadow var(--t);
}
.card--hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Form */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: .9rem; }
.input, select.input, textarea.input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; transition: border-color var(--t), box-shadow var(--t);
}
.input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(29, 74, 150, .2); }
.field--error .input { border-color: var(--danger); }
.field__error { color: var(--danger); font-size: .85rem; min-height: 1em; }

/* Badge */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--bg-soft); color: var(--text-muted); }
.badge--success { background: rgba(30,158,106,.15); color: var(--success); }
.badge--warning { background: rgba(227,155,11,.18); color: var(--warning); }
.badge--danger { background: rgba(214,69,69,.15); color: var(--danger); }
.badge--info { background: rgba(29,74,150,.15); color: var(--primary); }

/* Toast */
.toast-wrap { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 10px; z-index: 9999; max-width: calc(100vw - 32px); }
.toast {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-left: 5px solid var(--primary); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover); padding: 12px 16px; min-width: 240px;
  animation: toast-in .3s ease;
}
.toast--success { border-left-color: var(--success); }
.toast--error { border-left-color: var(--danger); }
.toast--warning { border-left-color: var(--warning); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(7,27,61,.55); display: grid; place-items: center; z-index: 9000; padding: 16px; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 24px; width: min(100%, 460px); box-shadow: var(--shadow-hover); }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* Skeleton & empty state */
.skeleton { background: linear-gradient(90deg, var(--bg-soft) 25%, var(--border) 37%, var(--bg-soft) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-sm); min-height: 18px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.empty { text-align: center; padding: 48px 16px; color: var(--text-muted); }
.empty h3 { color: var(--text); }

/* Loader layar penuh */
.page-loader { position: fixed; inset: 0; background: var(--bg); display: grid; place-items: center; z-index: 10000; transition: opacity .4s ease, visibility .4s; }
.page-loader.is-hidden { opacity: 0; visibility: hidden; }
.spinner { width: 44px; height: 44px; border: 4px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ===== Komponen bersama tambahan (dipakai publik & dashboard) ===== */
.muted { color: var(--text-muted); }
.pad { padding: 16px; }
.hidden, [hidden] { display: none !important; }
.spinner--sm { width: 16px; height: 16px; border-width: 2px; display: inline-block; vertical-align: -3px; }
.progress { height: 10px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.progress__bar { height: 100%; background: linear-gradient(90deg, var(--accent), #ffd466); border-radius: 999px; transition: width .6s ease; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 24px; flex-wrap: wrap; font-size: .9rem; color: var(--text-muted); }
.icon-btn { background: transparent; border: 1px solid transparent; color: inherit; width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; cursor: pointer; position: relative; transition: background var(--t); }
.icon-btn:hover { background: rgba(127,127,127,.15); }
.icon-btn svg, .btn svg { width: 18px; height: 18px; }
.modal--wide { width: min(100%, 760px); max-height: 90vh; overflow: auto; }
.modal { max-height: 90vh; overflow: auto; }
.modal__title { margin-bottom: 14px; }
.empty__icon { width: 44px; height: 44px; opacity: .55; margin: 0 auto 8px; display: block; }
.skeleton-list { padding: 4px 0; }
.badge--muted { background: var(--bg-soft); color: var(--text-muted); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: .92rem; }
.kv dt { color: var(--text-muted); } .kv dd { margin: 0; }
.rich img { border-radius: 10px; margin: 8px 0; }
.rich table { border-collapse: collapse; width: 100%; } .rich td, .rich th { border: 1px solid var(--border); padding: 6px 10px; }
.rich blockquote { border-left: 4px solid var(--accent); margin: 12px 0; padding: 4px 16px; color: var(--text-muted); }
