/* RT/RW Dashboard - public site styles */
:root {
  --bg: #f4f7f6; --surface: #ffffff; --surface-2: #eef3f1; --text: #0f1f1a; --muted: #5b6b64;
  --primary: #0f766e; --primary-d: #0b5a54; --on-primary: #ffffff; --accent: #f59e0b;
  --ok: #15803d; --ok-bg: #dcfce7; --danger: #b91c1c; --danger-bg: #fee2e2; --warn-bg: #fef3c7; --warn: #92400e; --info-bg: #dbeafe; --info: #1e40af;
  --border: #dfe7e4; --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 31, 26, .06), 0 10px 30px rgba(15, 31, 26, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
[data-theme="dark"] {
  --bg: #0a1311; --surface: #111e1b; --text: #e7f0ed; --muted: #9db2aa;
  --primary: #2dd4bf; --primary-d: #5eead4; --on-primary: #05211d;
  --ok: #4ade80; --ok-bg: #123524; --danger: #fca5a5; --danger-bg: #3b1515; --warn-bg: #3a2c0b; --warn: #fcd34d; --info-bg: #14264a; --info: #93c5fd;
  --border: #20352f; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
}
[data-theme="dark"] { --surface-2: #162826; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.65; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.01em; }
p { margin-bottom: 1rem; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.section { padding: 36px 0; }
.muted { color: var(--muted); }
.sr-only, .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* navbar */
.navbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, var(--primary), #14b8a6); color: var(--on-primary); font-size: .85rem; font-weight: 800; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a { padding: 8px 12px; border-radius: 10px; font-size: .92rem; font-weight: 500; color: var(--muted); transition: background .15s, color .15s; }
.nav-links a:hover { background: var(--surface-2); color: var(--text); }
.nav-links a.active { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); font-weight: 700; }
.theme-toggle { margin-left: 6px; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 1.05rem; cursor: pointer; }
.theme-toggle:hover { background: var(--surface-2); }
.burger { display: none; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.burger span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; }
@media (max-width: 960px) {
  .burger { display: inline-flex; }
  .nav-links { position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 20px 18px; display: none; box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; }
  .theme-toggle { margin: 6px 0 0; width: 100%; }
}

/* hero + page head */
.hero { background: radial-gradient(1200px 400px at 85% -20%, rgba(245, 158, 11, .25), transparent 60%), linear-gradient(135deg, #0b5a54 0%, #0f766e 55%, #14b8a6 100%); color: #fff; padding: 56px 0 84px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40px; background: linear-gradient(to bottom, transparent, var(--bg)); }
.hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; margin-bottom: 12px; }
.hero p { font-size: 1.1rem; opacity: .92; max-width: 52ch; }
.hero-badge { display: inline-block; padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, .16); font-size: .82rem; font-weight: 600; margin-bottom: 16px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.tonight { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); border-radius: var(--radius); padding: 20px; backdrop-filter: blur(6px); }
.tonight h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; opacity: .85; margin-bottom: 8px; }
.tonight .big { font-size: 1.4rem; font-weight: 800; margin-bottom: 6px; }
.tonight .chips { margin-top: 8px; }
.tonight .chip { background: rgba(255, 255, 255, .18); color: #fff; }
@media (max-width: 820px) { .hero-grid { grid-template-columns: 1fr; } .hero { padding: 40px 0 70px; } }
.page-head { background: linear-gradient(135deg, #0b5a54, #0f766e); color: #fff; padding: 36px 0 44px; }
.page-head h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 4px; }
.page-head p { opacity: .9; margin: 0; }
.pull-up { margin-top: -28px; position: relative; z-index: 2; }

/* buttons, forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; background: var(--primary); color: var(--on-primary); transition: transform .12s, background .15s, box-shadow .15s; }
.btn:hover { background: var(--primary-d); transform: translateY(-1px); }
.btn-light { background: #fff; color: #0b5a54; }
.btn-light:hover { background: #f1f5f4; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .55); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .15); }
.btn-sm { padding: 6px 12px; font-size: .85rem; border-radius: 9px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: .88rem; font-weight: 600; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; width: 100%; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 1px; border-color: var(--primary); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar > * { width: auto; }
.toolbar input[type="search"] { min-width: 200px; flex: 1; }
.spacer { flex: 1; }

/* cards & grids */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; animation: rise .45s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .card { animation: none; } html { scroll-behavior: auto; } }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-title h2 { font-size: 1.35rem; }
.section-title a { color: var(--primary); font-weight: 600; font-size: .92rem; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .label { font-size: .82rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat .value { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.stat .sub { font-size: .85rem; color: var(--muted); }
.stat.in .value { color: var(--ok); }
.stat.out .value { color: var(--danger); }

/* badges, chips */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--danger-bg); color: var(--danger); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.info { background: var(--info-bg); color: var(--info); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 3px 11px; border-radius: 999px; background: var(--surface-2); font-size: .85rem; }
button.chip { border: 1px solid var(--border); background: var(--surface); cursor: pointer; font: inherit; font-size: .88rem; }
button.chip.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.in-text { color: var(--ok); font-weight: 600; }
.out-text { color: var(--danger); font-weight: 600; }
tfoot td { font-weight: 800; background: var(--surface-2); }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* chart */
.chart { width: 100%; height: auto; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .bar-in { fill: #16a34a; }
.chart .bar-out { fill: #ef4444; }
.legend { display: flex; gap: 16px; font-size: .85rem; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.legend .in { background: #16a34a; } .legend .out { background: #ef4444; }

/* ronda */
.day-card { display: flex; flex-direction: column; gap: 8px; border-top: 4px solid var(--border); }
.day-card.today { border-top-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent), var(--shadow); }
.day-card h3 { font-size: 1.1rem; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.day-meta { font-size: .85rem; color: var(--muted); }

/* announcements, articles, agenda */
.item-title { font-size: 1.12rem; margin-bottom: 6px; }
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
.item-body p { margin-bottom: .8rem; }
.item-body h3 { margin: 1.2rem 0 .5rem; font-size: 1.1rem; }
.pin { color: var(--accent); font-weight: 700; }
.article-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.article-card:hover { transform: translateY(-3px); }
.article-cover { height: 150px; background: linear-gradient(135deg, #0f766e, #14b8a6); display: grid; place-items: center; color: rgba(255, 255, 255, .9); font-size: 2.2rem; font-weight: 800; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-text { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.article-text h3 { font-size: 1.1rem; }
.article-text p { color: var(--muted); font-size: .93rem; margin: 0; }
.article-full { max-width: 760px; margin: 0 auto; }
.article-full h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin-bottom: 10px; }
.article-full .cover { margin: 18px 0; border-radius: var(--radius); max-height: 380px; width: 100%; object-fit: cover; }
.article-full .item-body { font-size: 1.05rem; }
.date-box { min-width: 62px; text-align: center; border-radius: 12px; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); padding: 8px 6px; line-height: 1.1; align-self: flex-start; }
.date-box b { display: block; font-size: 1.5rem; }
.date-box span { font-size: .75rem; text-transform: uppercase; font-weight: 700; letter-spacing: .05em; }
.row { display: flex; gap: 14px; align-items: flex-start; }
.row > div:last-child { flex: 1; min-width: 0; }
.list { display: flex; flex-direction: column; gap: 14px; }

/* contact */
.contact { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.contact:last-child { border-bottom: 0; }
.contact b { display: block; }
.contact small { color: var(--muted); }
.contact-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* letter */
.letter { background: #fff; color: #000; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 36px 40px; font-family: "Times New Roman", Times, serif; font-size: 1.02rem; line-height: 1.6; }
.letter h3 { text-align: center; text-decoration: underline; color: #000; margin-bottom: 4px; font-family: inherit; }
.letter .center { text-align: center; }
.letter table { width: auto; font-size: inherit; margin: 10px 0 14px 16px; }
.letter td { border: 0; padding: 1px 12px 1px 0; }
.letter .sign { margin: 28px 0 0 auto; width: 240px; text-align: center; }
.letter .sign .space { height: 70px; }

/* alerts */
.notice { padding: 12px 16px; border-radius: 12px; font-size: .93rem; margin-bottom: 14px; }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.bad { background: var(--danger-bg); color: var(--danger); }
.notice.info { background: var(--info-bg); color: var(--info); }
.loading { padding: 30px; text-align: center; color: var(--muted); }

/* footer */
.site-footer { background: #0a1f1b; color: #cfe3dd; margin-top: 40px; padding-top: 44px; }
.site-footer .brand { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 28px; padding-bottom: 28px; }
.footer-col h4 { color: #fff; margin-bottom: 12px; font-size: .95rem; }
.footer-col li { margin-bottom: 6px; }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-area { margin: 10px 0 6px; font-weight: 600; color: #fff; }
.footer-muted { color: #8fb0a6; font-size: .9rem; margin: 0 0 8px; }
.license-link { word-break: break-all; color: #5eead4; font-size: .9rem; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding-top: 18px; padding-bottom: 22px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .88rem; color: #8fb0a6; }
.license-badge { padding: 5px 14px; border-radius: 999px; border: 1px solid rgba(94, 234, 212, .5); color: #5eead4; font-weight: 700; }
.license-badge:hover { background: rgba(94, 234, 212, .12); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* print: only the area marked as .print-area */
@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; left: 0; top: 0; width: 100%; border: 0; box-shadow: none; }
  .no-print { display: none !important; }
}

/* small helpers (no inline styles because of the Content Security Policy) */
.mt { margin-top: 20px; } .mt-sm { margin-top: 12px; } .mt-lg { margin-top: 32px; }
.narrow { max-width: 640px; }
.notfound { text-align: center; padding: 90px 20px; }
.notfound h2 { margin-bottom: 10px; }
.nf-code { font-size: clamp(4rem, 14vw, 8rem); color: var(--primary); }

/* tombol Admin di navbar */
.nav-links a.nav-admin { margin-left: 6px; border: 1px solid var(--primary); color: var(--primary); font-weight: 700; }
.nav-links a.nav-admin:hover { background: var(--primary); color: var(--on-primary); }
@media (max-width: 960px) { .nav-links a.nav-admin { margin: 6px 0 0; text-align: center; } }
