/* Tema bersama — navy #16365c, biru #1769d2 (P1) */

:root {
	--navy: #16365c;
	--navy-soft: #1f4a7a;
	--blue: #1769d2;
	--blue-soft: #e8f0fb;
	--ink: #1f2937;
	--muted: #6b7280;
	--line: #e5e7eb;
	--bg: #f7f9fc;
	--white: #ffffff;
	--green: #1a7f4b;
	--amber: #b45309;
	--red: #b42318;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: "Segoe UI", Tahoma, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0 0 .6rem; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }

.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: .86rem; }
.nowrap { white-space: nowrap; }

/* ---------- Topbar publik ---------- */

.topbar {
	background: var(--white);
	border-bottom: 1px solid var(--line);
	position: sticky;
	top: 0;
	z-index: 20;
}

.topbar-inner {
	max-width: 1140px;
	margin: 0 auto;
	padding: .7rem 1.2rem;
	display: flex;
	align-items: center;
	gap: 1.5rem;
}

.brand { display: flex; align-items: center; gap: .6rem; color: var(--navy); font-weight: 700; }
.brand:hover { text-decoration: none; }

.brand-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px; height: 32px;
	border-radius: 8px;
	background: var(--navy);
	color: #fff;
	font-size: .8rem;
	letter-spacing: .5px;
}

.brand-text { font-size: .95rem; }

.topnav { display: flex; gap: 1.1rem; flex: 1; }
.topnav a { color: var(--ink); font-size: .9rem; }
.topnav a:hover { color: var(--blue); }

.topbar-actions { display: flex; gap: .5rem; }

/* ---------- Halaman publik ---------- */

.page { max-width: 1140px; margin: 0 auto; padding: 1.5rem 1.2rem 3rem; }

.footer {
	border-top: 1px solid var(--line);
	padding: 1.2rem;
	text-align: center;
	color: var(--muted);
	font-size: .82rem;
}

/* ---------- Panel admin ---------- */

.layout-admin { display: flex; min-height: 100vh; }

.sidebar {
	width: 232px;
	flex: 0 0 232px;
	background: var(--navy);
	color: #dfe8f5;
	display: flex;
	flex-direction: column;
	position: sticky;
	top: 0;
	height: 100vh;
}

.sidebar-brand {
	display: flex;
	align-items: center;
	gap: .6rem;
	padding: 1rem 1.1rem;
	font-weight: 700;
	color: #fff;
	border-bottom: 1px solid rgba(255,255,255,.12);
}

.sidebar-brand .brand-mark { background: rgba(255,255,255,.16); }

.sidebar-nav { display: flex; flex-direction: column; padding: .8rem .6rem; gap: .15rem; flex: 1; }

.sidebar-link {
	color: #cfdcf0;
	padding: .55rem .75rem;
	border-radius: 6px;
	font-size: .9rem;
}
.sidebar-link:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.sidebar-link.is-active { background: var(--blue); color: #fff; font-weight: 600; }

.sidebar-foot { padding: .9rem 1.1rem; border-top: 1px solid rgba(255,255,255,.12); font-size: .82rem; }
.sidebar-foot a { color: #cfdcf0; }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.admin-topbar {
	background: var(--white);
	border-bottom: 1px solid var(--line);
	padding: .8rem 1.4rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.admin-topbar-title { font-weight: 700; color: var(--navy); }

.admin-topbar-user { display: flex; align-items: center; gap: .8rem; font-size: .85rem; }
.user-name { font-weight: 600; }
.user-role { color: var(--muted); text-transform: uppercase; font-size: .72rem; letter-spacing: .5px; }

.admin-content { padding: 1.4rem; }

/* ---------- Kartu & tabel ---------- */

.card {
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 1.1rem 1.2rem;
	margin-bottom: 1.2rem;
}

.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.card-head h2 { margin: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .9rem; margin-bottom: 1.2rem; }

.stat-card {
	background: var(--white);
	border: 1px solid var(--line);
	border-left: 4px solid var(--blue);
	border-radius: 10px;
	padding: .9rem 1rem;
	display: flex;
	flex-direction: column;
	gap: .25rem;
}

.stat-label { color: var(--muted); font-size: .8rem; }
.stat-value { font-size: 1.6rem; color: var(--navy); }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .76rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.table tbody tr:hover { background: #fafcff; }

.empty-state { text-align: center; padding: 2rem 1rem; color: var(--muted); }

/* ---------- Badge & pill ---------- */

.badge, .pill {
	display: inline-block;
	padding: .18rem .55rem;
	border-radius: 999px;
	font-size: .74rem;
	font-weight: 600;
	line-height: 1.4;
	white-space: nowrap;
}

.badge-warning, .pill-pemeliharaan { background: #fef3c7; color: var(--amber); }
.badge-success, .pill-aktif { background: #dcfce7; color: var(--green); }
.badge-danger, .pill-nonaktif { background: #fee4e2; color: var(--red); }
.badge-info, .pill-role { background: var(--blue-soft); color: var(--blue); }
.badge-secondary, .pill-aksi { background: #f1f5f9; color: #475569; }
.badge-dark { background: #e2e8f0; color: #1e293b; }

/* ---------- Tombol & form ---------- */

.btn {
	display: inline-block;
	padding: .45rem .9rem;
	border-radius: 6px;
	border: 1px solid transparent;
	font-size: .88rem;
	cursor: pointer;
	text-align: center;
	background: #eef2f7;
	color: var(--ink);
}
.btn:hover { text-decoration: none; filter: brightness(.97); }

.btn-primary { background: var(--blue); color: #fff; }
.btn-outline { background: transparent; border-color: var(--line); color: var(--navy); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-sm { padding: .3rem .65rem; font-size: .8rem; }
.btn-block { width: 100%; }

.form { display: flex; flex-direction: column; gap: .9rem; max-width: 520px; }

.field { display: flex; flex-direction: column; gap: .3rem; }
.field span { font-size: .84rem; color: var(--muted); }

input[type="text"], input[type="password"], input[type="number"], select {
	padding: .5rem .6rem;
	border: 1px solid var(--line);
	border-radius: 6px;
	font-size: .92rem;
	background: #fff;
	color: var(--ink);
	width: 100%;
}

input:focus, select:focus { outline: 2px solid var(--blue-soft); border-color: var(--blue); }

.check { display: flex; align-items: flex-start; gap: .5rem; font-size: .9rem; }
.check input { margin-top: .25rem; }

.filter-bar { display: flex; gap: .6rem; margin-bottom: .9rem; flex-wrap: wrap; }
.filter-bar input[type="text"] { max-width: 320px; }
.filter-bar select { max-width: 210px; }

/* ---------- Login ---------- */

.auth-wrap { display: flex; justify-content: center; padding: 3rem 1rem; }
.auth-card { width: 100%; max-width: 380px; padding: 1.6rem; }
.auth-head { text-align: center; margin-bottom: 1.2rem; }
.auth-head h1 { margin: .7rem 0 .2rem; }
.auth-head p { margin: 0; color: var(--muted); font-size: .85rem; }
.auth-note { text-align: center; margin-top: 1rem; font-size: .85rem; }

/* ---------- Alert ---------- */

.alert { padding: .7rem .9rem; border-radius: 8px; margin-bottom: 1rem; font-size: .9rem; }
.alert-success { background: #dcfce7; color: #14532d; }
.alert-danger { background: #fee4e2; color: #7f1d1d; }

/* ---------- Stub & utilitas ---------- */

.stub-head { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.meta-list { margin: .8rem 0; padding-left: 1.1rem; color: var(--ink); }
.room-grid { list-style: none; display: flex; gap: .7rem; flex-wrap: wrap; padding: 0; margin: .8rem 0 0; }
.room-chip { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; background: #fff; }
.room-chip span { display: block; color: var(--muted); font-size: .78rem; }

@media (max-width: 900px) {
	.stat-grid { grid-template-columns: repeat(2, 1fr); }
	.topnav { display: none; }
	.layout-admin { flex-direction: column; }
	.sidebar { width: 100%; flex: none; height: auto; position: static; }
	.sidebar-nav { flex-direction: row; overflow-x: auto; }
}

/* ---------- Fase 1: form & tabel lanjutan ---------- */

.form-wide { max-width: none; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9rem; }
.form-actions { display: flex; gap: .6rem; margin-top: .4rem; align-items: center; }
.inline-form { display: inline-block; margin: 0; }
.ta-right { text-align: right; }

textarea {
	padding: .5rem .6rem;
	border: 1px solid var(--line);
	border-radius: 6px;
	font: inherit;
	width: 100%;
	background: #fff;
	color: var(--ink);
}

input[type="date"], input[type="time"], input[type="file"] {
	padding: .45rem .55rem;
	border: 1px solid var(--line);
	border-radius: 6px;
	font: inherit;
	background: #fff;
}

.inline-form select { padding: .3rem .4rem; font-size: .8rem; border-radius: 6px; }
.photo-preview { display: flex; flex-direction: column; gap: .3rem; }
.photo-preview img { max-width: 220px; border-radius: 8px; border: 1px solid var(--line); }

/* ---------- Fase 2: filter & pagination ---------- */
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; align-items: end; }
.filter-actions { display: flex; gap: .5rem; align-items: end; }
.pager-wrap { margin-top: 1rem; }
.pager { display: flex; gap: .3rem; flex-wrap: wrap; align-items: center; }
.pager-link { display: inline-block; padding: .3rem .6rem; border: 1px solid var(--line); border-radius: 6px; font-size: .82rem; color: var(--navy); background: #fff; }
.pager-link:hover { text-decoration: none; background: var(--blue-soft); }
.pager-link.is-current { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- Dashboard admin ---------- */
.stat-foot { color: var(--muted); font-size: .74rem; }
.grid-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 1.1rem; }
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list li { padding: .55rem 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: .15rem; }
.activity-list li:last-child { border-bottom: 0; }
.activity-action { font-weight: 600; font-size: .82rem; color: var(--navy); }
.activity-detail { font-size: .86rem; }
.activity-meta { color: var(--muted); font-size: .74rem; }
@media (max-width: 980px) { .grid-2 { grid-template-columns: 1fr; } }
