/* =========================================================
   Website Sekolah — Dashboard Admin
   ========================================================= */
:root {
    --green: #0f5132;
    --green-700: #0b3d26;
    --green-100: #e3efe8;
    --gold: #f4b740;
    --bg: #f4f6f5;
    --card: #fff;
    --ink: #1b2a22;
    --muted: #6b7a72;
    --line: #e4e9e6;
    --radius: 14px;
    --serif: 'Fraunces', Georgia, serif;
    --sans: 'Plus Jakarta Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.muted { color: var(--muted); }
.block { display: block; }
.right { text-align: right; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 250px; background: var(--green-700); color: #cfe0d6; position: fixed; inset: 0 auto 0 0;
    display: flex; flex-direction: column; z-index: 40; transition: transform .25s;
}
.side-brand { display: flex; align-items: center; gap: .7rem; padding: 1.3rem 1.2rem; color: #fff; font-family: var(--serif); font-size: 1.05rem; line-height: 1.2; }
.side-brand img { width: 36px; height: 36px; object-fit: contain; }
.side-nav { display: flex; flex-direction: column; padding: .5rem .8rem; gap: 2px; overflow-y: auto; }
.side-nav small { text-transform: uppercase; letter-spacing: .1em; font-size: .7rem; opacity: .55; padding: 1rem .7rem .4rem; }
.side-nav a { display: flex; align-items: center; gap: .75rem; padding: .65rem .8rem; border-radius: 10px; font-weight: 500; transition: .15s; }
.side-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav a.active { background: var(--gold); color: var(--green-700); font-weight: 700; }
.side-nav i { font-size: 1.1rem; }
.pill { margin-left: auto; background: #e63946; color: #fff; font-size: .72rem; padding: .05rem .5rem; border-radius: 999px; }

.main { flex: 1; margin-left: 250px; min-width: 0; }
.topbar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1rem; height: 68px;
    padding: 0 1.8rem; background: rgba(244,246,245,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.topbar h1 { font-family: var(--serif); font-size: 1.4rem; color: var(--green-700); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .8rem; }
.user-chip { display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: .9rem; }
.user-chip small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.avatar.sm { width: 34px; height: 34px; font-size: .85rem; }
.menu-btn { display: none; }
.content { padding: 1.8rem; max-width: 1280px; }
.overlay { display: none; }

/* ---------- Komponen ---------- */
.btn {
    display: inline-flex; align-items: center; gap: .45rem; background: var(--green); color: #fff; border: 1px solid var(--green);
    padding: .6rem 1.1rem; border-radius: 10px; font: 600 .9rem var(--sans); cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { background: var(--green-700); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg); }
.btn-wa { background: #25d366; border-color: #25d366; }
.btn-block { width: 100%; justify-content: center; padding: .8rem; }
.icon-btn {
    position: relative; width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 9px;
    border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; font-size: 1rem;
}
.icon-btn:hover { border-color: var(--green); color: var(--green); }
.icon-btn.danger:hover { border-color: #dc3545; color: #dc3545; }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: #e63946; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; margin-bottom: 1.4rem; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; }
.card-head h2, .card-title { font-size: 1.05rem; margin-bottom: 1rem; }
.card-head h2 { margin: 0; }
.link { color: var(--green); font-weight: 600; font-size: .88rem; }
.greet { margin-bottom: 1.4rem; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; margin-bottom: 1.4rem; }
.stat-card { display: flex; align-items: center; gap: 1rem; margin: 0; }
.stat-card strong { display: block; font-family: var(--serif); font-size: 1.8rem; line-height: 1; }
.stat-card span { font-size: .88rem; color: var(--muted); }
.stat-card small { display: block; font-size: .75rem; color: var(--muted); }
.stat-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; flex-shrink: 0; }
.c1 { background: #e3efe8; color: #0f5132; }
.c2 { background: #fff1d6; color: #b7791f; }
.c3 { background: #e2ecfb; color: #2563eb; }
.c4 { background: #fde4e6; color: #c81e3a; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.4rem; }
.grid-2 + .grid-2 { grid-template-columns: 1fr 1fr; }

.bar-chart { display: flex; align-items: flex-end; gap: 1rem; height: 200px; padding-top: 1rem; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: .3rem; }
.bar { width: 100%; max-width: 46px; background: linear-gradient(var(--green), #2d8a57); border-radius: 8px 8px 3px 3px; transition: height .6s; }
.bar-col:last-child .bar { background: linear-gradient(var(--gold), #e09b1a); }
.bar-val { font-size: .8rem; font-weight: 700; }
.bar-label { font-size: .78rem; color: var(--muted); }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.quick a {
    display: flex; flex-direction: column; gap: .5rem; padding: 1rem; border: 1px dashed var(--line); border-radius: 12px;
    font-weight: 600; font-size: .9rem; transition: .15s;
}
.quick a i { font-size: 1.3rem; color: var(--green); }
.quick a:hover { border-color: var(--green); background: var(--green-100); }

.list { list-style: none; }
.list li { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list img { width: 52px; height: 40px; object-fit: cover; border-radius: 8px; }
.list li > div { flex: 1; min-width: 0; }
.list a { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list a:hover { color: var(--green); }
.list small { color: var(--muted); font-size: .8rem; }
.list li.unread a::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #e63946; margin-left: .4rem; vertical-align: middle; }

.badge { font-size: .74rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; }
.badge.ok { background: #d1f2df; color: #0b5132; }
.badge.warn { background: #fff1d6; color: #8a5a00; }

/* ---------- Tabel ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.search { position: relative; flex: 1; max-width: 340px; }
.search i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 2.3rem !important; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .7rem .8rem; border-bottom: 1px solid var(--line); }
.table td { padding: .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: #fafcfb; }
.table tr.unread td { background: #f6fbf8; font-weight: 600; }
.table .right { text-align: right; }
.table .empty { text-align: center; color: var(--muted); padding: 2.5rem; }
.cell-media { display: flex; align-items: center; gap: .8rem; }
.cell-media img { width: 56px; height: 42px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.cell-media img.round { width: 40px; height: 40px; border-radius: 50%; }
.cell-media small { display: block; color: var(--muted); font-size: .78rem; }
.actions { white-space: nowrap; }
.actions form { display: inline; }

/* ---------- Form ---------- */
label { display: grid; gap: .35rem; font-weight: 600; font-size: .86rem; margin-bottom: 1rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], select, textarea {
    font: 400 .92rem var(--sans); padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfb; width: 100%; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); border-color: transparent; background: #fff; }
textarea { resize: vertical; }
input[type=file] { font-size: .85rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
.row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 1rem; }
.form-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1.4rem; align-items: start; }
.form-layout .side { position: sticky; top: 88px; }
.form-actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; margin-top: .5rem; }
.img-preview { aspect-ratio: 16/10; border-radius: 10px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); }
.img-preview img { width: 100%; height: 100%; object-fit: cover; }
.img-preview.square { aspect-ratio: 1; }
.img-preview.logo { aspect-ratio: auto; height: 120px; padding: .8rem; }
.img-preview.logo img { object-fit: contain; }

.tabs { display: flex; gap: .3rem; margin-bottom: 1rem; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tab { background: none; border: 0; padding: .7rem 1rem; font: 600 .9rem var(--sans); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.active { color: var(--green); border-bottom-color: var(--green); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.save-bar { display: flex; justify-content: flex-end; }

.upload-row { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.upload-row input[type=text] { flex: 1; min-width: 220px; }
.gallery-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.2rem; }
.gallery-admin figure { padding: 0; overflow: hidden; margin: 0; }
.gallery-admin img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.gallery-admin figcaption { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .7rem .8rem; font-size: .85rem; }
.card.empty { text-align: center; color: var(--muted); padding: 3rem; }

.message { max-width: 820px; }
.message-head { display: flex; align-items: center; gap: .8rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); margin-bottom: 1.2rem; }
.message-head > div { flex: 1; }
.message-head small { display: block; }
.message h2 { font-family: var(--serif); color: var(--green-700); margin-bottom: .8rem; }
.message .prose { margin-bottom: 1.5rem; white-space: normal; }

.alert { padding: .8rem 1rem; border-radius: 10px; font-size: .9rem; display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; font-weight: 500; }
.alert-success { background: #d1f2df; color: #0b5132; }
.alert-danger { background: #fde2e1; color: #9b1c1c; }
.alert-warning { background: #fff3cd; color: #7a5b00; }
.alert-close { background: none; border: 0; font-size: 1.2rem; cursor: pointer; color: inherit; }

/* ---------- Link Aplikasi ---------- */
.app-ico { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; overflow: hidden; }
.app-ico.lg { width: 60px; height: 60px; border-radius: 16px; font-size: 1.7rem; }
.app-ico img, .cell-media img.app-logo { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 5px; }
.cell-media img.app-logo { width: 42px; height: 42px; border-radius: 11px; border: 1px solid var(--line); }
.w-hijau { background: #e3efe8; color: #0f5132; }
.w-biru  { background: #e2ecfb; color: #1d4ed8; }
.w-emas  { background: #fff1d6; color: #b7791f; }
.w-merah { background: #fde4e6; color: #c81e3a; }
.w-ungu  { background: #ede5fb; color: #6d28d9; }
.w-tosca { background: #dcf4f2; color: #0f766e; }
.url-link { color: var(--muted); }
.url-link:hover { color: var(--green); }
.table tr.dimmed td { opacity: .55; }

.switch {
    display: inline-flex; align-items: center; gap: .5rem; background: none; border: 0; cursor: pointer;
    font: 600 .82rem var(--sans); color: var(--muted);
}
.switch span { width: 36px; height: 20px; border-radius: 999px; background: #cfd8d3; position: relative; transition: .2s; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
.switch.on { color: var(--green); }
.switch.on span { background: var(--green); }
.switch.on span::after { left: 18px; }

.icon-picker { display: grid; grid-template-columns: repeat(8, 1fr); gap: .5rem; margin-bottom: 1.2rem; }
.pick, .pick-color { margin: 0; cursor: pointer; }
.pick input, .pick-color input { position: absolute; opacity: 0; pointer-events: none; }
.pick span {
    display: grid; place-items: center; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 10px;
    font-size: 1.2rem; color: var(--muted); transition: .15s;
}
.pick:hover span { border-color: var(--green); color: var(--green); }
.pick input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.pick input:focus-visible + span { outline: 2px solid var(--gold); }
.color-picker { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }
.pick-color { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .8rem .4rem .45rem; border: 1px solid var(--line); border-radius: 999px; font-weight: 500; }
.pick-color span { width: 22px; height: 22px; border-radius: 50%; border: 2px solid currentColor; }
.pick-color:has(input:checked) { border-color: var(--green); background: var(--green-100); font-weight: 700; }

.app-preview { background: var(--bg); border-radius: 12px; padding: 1.2rem; margin-bottom: 1.2rem; }
.app-card-demo { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .3rem; }
.app-card-demo .app-ico { margin-bottom: .4rem; }
.app-card-demo strong { color: var(--green-700); }
.app-card-demo small { color: var(--muted); font-size: .82rem; }
label.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
label.check input { width: 17px; height: 17px; accent-color: var(--green); }

@media (max-width: 560px) { .icon-picker { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Login ---------- */
.login-page { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; background: #fff; }
.login-art {
    background: radial-gradient(circle at 20% 20%, #1c7a4c, var(--green-700) 60%); color: #d7e8de;
    display: grid; place-items: center; padding: 3rem; position: relative; overflow: hidden;
}
.login-art::after { content: ''; position: absolute; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(244,183,64,.12); right: -140px; bottom: -140px; }
.login-art > div { max-width: 420px; position: relative; z-index: 1; }
.login-logo { width: 72px; margin-bottom: 1.5rem; }
.login-art h1 { font-family: var(--serif); color: #fff; font-size: 2.3rem; line-height: 1.15; margin-bottom: 1rem; }
.login-box { display: grid; place-items: center; padding: 2rem; }
.login-form { width: min(380px, 100%); }
.login-form h2 { font-family: var(--serif); color: var(--green-700); font-size: 1.8rem; }
.login-form > .muted { margin-bottom: 1.6rem; }
.input-icon { position: relative; }
.input-icon i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon input { padding: .8rem .8rem .8rem 2.4rem; }
.back-link { display: block; text-align: center; margin-top: 1.2rem; color: var(--muted); font-size: .88rem; }
.back-link:hover { color: var(--green); }

/* ---------- Responsif ---------- */
@media (max-width: 1100px) {
    .cards { grid-template-columns: 1fr 1fr; }
    .grid-2, .grid-2 + .grid-2 { grid-template-columns: 1fr; }
    .form-layout { grid-template-columns: 1fr; }
    .form-layout .side { position: static; }
    .row4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
    .sidebar { transform: translateX(-100%); }
    .side-open .sidebar { transform: none; }
    .side-open .overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }
    .main { margin-left: 0; }
    .menu-btn { display: inline-grid; }
    .topbar { padding: 0 1rem; }
    .content { padding: 1rem; }
    .user-chip > span:last-child { display: none; }
    .login-page { grid-template-columns: 1fr; }
    .login-art { padding: 2.5rem 1.5rem; }
    .login-art h1 { font-size: 1.7rem; }
}
@media (max-width: 560px) {
    .cards, .row2, .row3, .row4, .quick { grid-template-columns: 1fr; }
}
.toolbar-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
/* ---------- Cek Sistem ---------- */
.checks { list-style: none; }
.checks li { display: flex; gap: .9rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.checks li:last-child { border-bottom: 0; }
.checks li > i { font-size: 1.25rem; margin-top: .1rem; }
.checks li.ok > i { color: #198754; }
.checks li.bad > i { color: #d97706; }
.checks strong { display: block; }
.checks span { color: var(--muted); }
.checks small { display: block; margin-top: .35rem; background: #fff7e6; color: #7a5b00; padding: .45rem .7rem; border-radius: 8px; }
code { font-size: .85rem; word-break: break-all; }
.checks li { padding-left: .9rem; border-left: 4px solid transparent; }
.checks li.ok { border-left-color: #22a06b; }
.checks li.bad { border-left-color: #d97706; background: #fffbf2; }
