:root {
    --bg: #f3f6f4;
    --panel: #ffffff;
    --ink: #1c2b24;
    --muted: #5d6f66;
    --line: #d7e2db;
    --brand: #0f6b4c;
    --brand-2: #14835d;
    --accent: #c9a227;
    --danger: #b42318;
    --warn: #b54708;
    --ok: #067647;
    --shadow: 0 10px 30px rgba(15, 40, 30, 0.06);
    --sidebar: #0b3d2e;
    --sidebar-ink: #d7efe4;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.app {
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.shell { display: grid; grid-template-columns: 262px 1fr; min-height: 100vh; }
.side {
    background: linear-gradient(180deg, var(--sidebar), #08291f);
    color: var(--sidebar-ink);
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
    overflow-anchor: none;
}
.brand { display: flex; gap: 10px; align-items: center; margin-bottom: 28px; color: #fff; text-decoration: none; }
.brand-mark {
    width: 38px; height: 38px; border-radius: 10px;
    background: #1aa36f; color: #fff; display: grid; place-items: center;
    font-weight: 800;
}
.brand strong { display: block; font-size: 15px; }
.brand small { opacity: .7; font-size: 11px; }
.nav-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .55; margin: 16px 10px 6px; }
.nav a {
    display: flex; align-items: center; gap: 10px;
    color: var(--sidebar-ink); text-decoration: none;
    padding: 8px 10px; border-radius: 8px; font-size: 14px; line-height: 1.25;
}
.nav-ico {
    width: 18px; height: 18px; flex-shrink: 0;
    display: grid; place-items: center; opacity: .82;
}
.nav-ico svg { width: 18px; height: 18px; display: block; }
.nav a:hover, .nav a.active { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav a:hover .nav-ico, .nav a.active .nav-ico { opacity: 1; color: #8ee7bb; }
.main { padding: 22px 28px 48px; }
.top {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 22px;
}
.top h1 { margin: 0; font-size: 24px; }
.user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.user form { display: inline; }
.user-chip {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--ink); text-decoration: none; min-width: 0;
}
.user-chip:hover { text-decoration: none; }
.user-chip strong { display: block; font-size: 13px; line-height: 1.2; color: var(--ink); }
.user-chip small { display: block; font-size: 11px; color: var(--muted); }
.avatar {
    width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
    display: inline-block; vertical-align: middle; background: #d7e2db;
}
.avatar-fallback {
    display: grid; place-items: center; background: #0f6b4c; color: #fff;
    font-weight: 700; letter-spacing: .02em;
}
.profil-foto { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.profil-foto .avatar, .profil-foto .avatar-fallback { width: 88px; height: 88px; flex-shrink: 0; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.card {
    background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
    padding: 16px; box-shadow: var(--shadow);
}
.card .k { font-size: 12px; color: var(--muted); }
.card .v { font-size: 26px; font-weight: 700; margin-top: 6px; }
.panel {
    background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
    padding: 18px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filter-card {
    background: #f7fbf8;
    border: 1px solid var(--line);
    border-radius: 14px;
    margin-bottom: 16px;
    overflow: hidden;
}
.panel > .filter-card:first-child {
    margin: -18px -18px 18px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 14px 14px 0 0;
}
.filter-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(180deg, #0b3d2e, #0f4a38);
    color: #fff;
}
.filter-head-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.filter-head-title svg { width: 18px; height: 18px; flex-shrink: 0; }
.filter-head strong { display: block; font-size: 14px; }
.filter-head .hint { color: #b7d4c6; margin: 2px 0 0; }
.filter-head .btn { background: #1aa36f; }
.filter-head .btn:hover { background: #22b87a; }
.filter-body { padding: 16px; }
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    align-items: end;
}
.filter-grid > .field { margin-bottom: 0; }
.filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}
.grow { flex: 1; }
input, select, textarea {
    border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
    font: inherit; background: #fff; color: var(--ink); width: 100%;
}
textarea { min-height: 72px; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--brand); color: #fff; border: 0; border-radius: 8px;
    padding: 8px 12px; font: inherit; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--brand-2); text-decoration: none; color: #fff; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.warn { background: var(--warn); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 5px 8px; font-size: 12px; }
.flash { background: #e8f8ef; color: var(--ok); padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; }
.errors { background: #fdecec; color: var(--danger); padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; }
.badge { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 99px; background: #e7f3ec; color: var(--brand); }
.badge.n { background: #fdecec; color: var(--danger); }
.badge.p { background: #fff4e5; color: var(--warn); }
.badge.k { background: #fff7d6; color: #854d0e; }
.hint { color: var(--muted); font-size: 12px; }
.pager { margin-top: 14px; }
.pager-nav { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.check { display: flex; gap: 8px; align-items: center; }
.check input { width: auto; }
.akses-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 12px 0 18px; }
.akses-grup { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #f7fbf8; }
.akses-grup h3 { margin: 0 0 10px; font-size: 13px; }
.akses-item { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-size: 14px; color: var(--ink); }
.akses-item input { width: auto; margin-top: 3px; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: #0b3d2e; }
.login-card { width: 380px; background: #fff; border-radius: 16px; padding: 28px; }
.search-box { position: relative; }
.search-results {
    position: absolute; left: 0; right: 0; top: 100%; background: #fff;
    border: 1px solid var(--line); border-radius: 8px; z-index: 20;
    max-height: 280px; overflow: auto;
}
.search-results button {
    display: block; width: 100%; text-align: left; background: none; border: 0;
    padding: 8px 10px; cursor: pointer; font: inherit;
}
.search-results button:hover { background: #f3f6f4; }
.kasir { display: grid; grid-template-columns: 1.4fr .9fr; gap: 16px; }
@media (max-width: 980px) {
    .shell { grid-template-columns: 1fr; }
    .side { height: auto; position: relative; }
    .cards, .kasir, .grid-2, .grid-3, .grid-4, .filter-grid { grid-template-columns: 1fr; }
}
@media print {
    .side, .toolbar, .filter-card, .btn, .no-print { display: none !important; }
    .shell { display: block; }
    .main { padding: 0; }
    .panel { box-shadow: none; border: 0; }
}
