/* =========================================================
   PTSP DIGITAL SEKOLAH — Design tokens
   Palette terinspirasi warna seremonial sekolah: navy + emas,
   dengan metafora "loket" (kartu tiket) untuk status pengajuan.
   ========================================================= */
:root {
    --navy-950: #10192e;
    --navy-900: #1b2a4a;
    --navy-700: #2b3f68;
    --navy-500: #4c5f8c;
    --gold-500: #c9973e;
    --gold-300: #e3bd76;
    --paper: #f7f5f0;
    --paper-card: #ffffff;
    --ink: #262b3a;
    --ink-soft: #5b6178;
    --line: #e4e0d6;
    --success: #2f7d5b;
    --success-bg: #e8f3ee;
    --danger: #b3413a;
    --danger-bg: #fbeae8;
    --warning: #a9761f;
    --warning-bg: #faf1de;
    --info: #2b5f8a;
    --info-bg: #e8f1f7;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(16, 25, 46, 0.08), 0 8px 24px -12px rgba(16, 25, 46, 0.18);
}

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,500;8..60,600;8..60,700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    line-height: 1.55;
}

h1, h2, h3, .display {
    font-family: 'Source Serif 4', Georgia, serif;
    color: var(--navy-950);
    font-weight: 600;
    margin: 0 0 .4em;
}

a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--gold-500); }
p { margin: 0 0 1em; }

:focus-visible {
    outline: 3px solid var(--gold-300);
    outline-offset: 2px;
}

/* ---------- Layout shell (app setelah login) ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--navy-950);
    color: #dfe4f2;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
}

.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    padding: 0 8px 20px;
    border-bottom: 1px solid rgba(255,255,255,.12);
    margin-bottom: 16px;
}
.sidebar .brand .mark {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; flex-shrink: 0;
}
.sidebar .brand .mark img { width: 100%; height: 100%; object-fit: contain; }
.sidebar .brand .name { font-family: 'Source Serif 4', serif; font-size: 15px; line-height: 1.25; }
.sidebar .brand .name small { display:block; font-family:'Plus Jakarta Sans',sans-serif; font-size: 11px; color: #9aa5c4; font-weight: 500;}

.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a {
    color: #c3cae3; padding: 10px 12px; border-radius: 8px; font-size: 14px; font-weight: 500;
    display: flex; align-items: center; gap: 10px;
}
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: var(--gold-500); color: var(--navy-950); font-weight: 700; }
.sidebar nav a.back-to-site {
    color: #9aa5c4; font-size: 12.5px; font-weight: 600; margin-bottom: 8px;
    padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.12);
    border-radius: 0;
}
.sidebar nav a.back-to-site:hover { color: #fff; background: transparent; }
.sidebar .user-box {
    border-top: 1px solid rgba(255,255,255,.12); padding-top: 14px; margin-top: 14px; font-size: 13px;
}
.sidebar .user-box .role { color: var(--gold-300); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.sidebar .user-box a { color: #9aa5c4; font-size: 12.5px; }

.main {
    flex: 1;
    padding: 32px 40px;
    max-width: 1100px;
}

.topbar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; gap: 16px; flex-wrap: wrap;}
.topbar .eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--gold-500); font-weight: 700; margin-bottom: 4px; }

/* ---------- Cards ---------- */
.card {
    background: var(--paper-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.card h3 { font-size: 18px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }

.stat {
    background: var(--paper-card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px 20px;
}
.stat .num { font-family: 'Source Serif 4', serif; font-size: 30px; color: var(--navy-950); font-weight: 700; }
.stat .label { font-size: 13px; color: var(--ink-soft); }

/* ---------- Ticket card (signature element) ---------- */
.ticket {
    display: flex;
    background: var(--paper-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid var(--line);
}
.ticket .stub {
    width: 90px; flex-shrink: 0;
    background: var(--navy-950);
    color: var(--gold-300);
    display: flex; align-items: center; justify-content: center;
    writing-mode: vertical-rl; text-orientation: mixed;
    font-family: 'Source Serif 4', serif; font-size: 13px; letter-spacing: .06em;
    position: relative;
}
.ticket .stub::after {
    content: ""; position: absolute; right: -6px; top: 0; bottom: 0; width: 12px;
    background-image: radial-gradient(circle at 6px 0, transparent 6px, var(--paper) 6.5px);
    background-size: 12px 16px; background-repeat: repeat-y;
}
.ticket .body { padding: 16px 20px; flex: 1; display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap;}
.ticket .kode { font-family: 'Source Serif 4', serif; font-weight: 700; color: var(--navy-950); font-size: 15px;}
.ticket .meta { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }

/* ---------- Badges ---------- */
.badge {
    display: inline-block; padding: 4px 11px; border-radius: 100px; font-size: 12.5px; font-weight: 600;
}
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }

/* ---------- Forms ---------- */
label { display: block; font-size: 13.5px; font-weight: 600; color: var(--navy-900); margin-bottom: 6px; }
.field { margin-bottom: 18px; }
.help { font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=tel],
select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
    font-family: inherit; font-size: 14.5px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { border-color: var(--navy-500); }
textarea { resize: vertical; min-height: 90px; }

.btn {
    display: inline-flex; align-items: center; gap: 8px; justify-content: center;
    padding: 10px 18px; border-radius: 8px; font-weight: 700; font-size: 14px;
    border: 1px solid transparent; cursor: pointer; font-family: inherit;
}
.btn-primary { background: var(--navy-950); color: #fff; }
.btn-primary:hover { background: var(--navy-700); color: #fff; }
.btn-gold { background: var(--gold-500); color: var(--navy-950); }
.btn-gold:hover { background: var(--gold-300); color: var(--navy-950); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--navy-900); }
.btn-outline:hover { border-color: var(--navy-500); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--ink-soft); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }

/* ---------- Auth pages ---------- */
.auth-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(1200px 600px at 15% -10%, #24365e 0%, var(--navy-950) 55%);
    padding: 24px;
}
.auth-card {
    width: 100%; max-width: 420px; background: var(--paper-card); border-radius: 14px;
    padding: 34px 32px; box-shadow: 0 20px 60px -20px rgba(0,0,0,.5);
}
.auth-card .mark {
    width: 52px; height: 52px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; margin-bottom: 14px;
}
.auth-card .mark img { width: 100%; height: 100%; object-fit: contain; }
.auth-card .eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--gold-500); font-weight: 700; }

.alert { padding: 12px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-info { background: var(--info-bg); color: var(--info); }

hr.line { border: none; border-top: 1px solid var(--line); margin: 20px 0; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 20px 26px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li:last-child { border-color: transparent; padding-bottom: 0; }
.timeline li::before {
    content: ""; position: absolute; left: -7px; top: 2px; width: 12px; height: 12px;
    border-radius: 50%; background: var(--gold-500); border: 2px solid var(--paper-card);
}
.timeline .t-status { font-weight: 700; color: var(--navy-950); font-size: 14px; }
.timeline .t-time { font-size: 12.5px; color: var(--ink-soft); }
.timeline .t-note { font-size: 13.5px; color: var(--ink-soft); margin-top: 2px; }

@media print {
    .no-print { display: none !important; }
    body { background: #fff; }
}

@media (max-width: 860px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; align-items: center; padding: 12px 16px; overflow-x: auto; }
    .sidebar .brand { border: none; margin: 0 16px 0 0; padding: 0; }
    .sidebar nav { flex-direction: row; }
    .sidebar .user-box { display: none; }
    .main { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
