/* Koperasi admin — tokens follow the "0. Fondasi" design sheet. Brand colors are overridden per koperasi in the layout. */
:root {
  --brand: #0E7C5A; --brand-dark: #075A41; --brand-soft: #E3F4EC; --accent: #F2B233;
  --text: #14201B; --text-2: #4D5B55; --bg: #F4F6F5; --surface: #FFFFFF; --border: #E2E6E4;
  --success: #12805C; --success-soft: #E3F4EC; --warning: #B45309; --warning-soft: #FEF3C7;
  --danger: #C2341C; --danger-soft: #FDE8E4; --info: #1D63C9; --info-soft: #E5EEFB; --neutral-soft: #EEF1EF;
  --radius: 14px; --radius-sm: 10px; --shadow: 0 1px 2px rgba(20, 32, 27, .05);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; line-height: 30px; margin: 0; font-weight: 700; }
h2 { font-size: 18px; line-height: 26px; margin: 0 0 12px; font-weight: 700; }
h3 { font-size: 15px; margin: 0 0 10px; font-weight: 600; }
small, .muted { color: var(--text-2); }
.caption { font-size: 12px; color: var(--text-2); font-weight: 500; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--success); } .neg { color: var(--danger); }

/* shell */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand .logo { width: 38px; height: 38px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.brand b { display: block; font-size: 14px; line-height: 18px; }
.nav-group { margin: 14px 8px 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); font-weight: 700; }
.nav a { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 9px; color: var(--text); font-weight: 500; }
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }
.nav .count { background: var(--accent); color: #3b2a00; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 0 7px; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 28px; border-bottom: 1px solid var(--border); background: var(--surface); }
.topbar .user { display: flex; gap: 10px; align-items: center; }
.content { padding: 24px 28px 48px; max-width: 1400px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }

/* surfaces */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 8px; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat .label { color: var(--text-2); font-size: 12px; font-weight: 600; }
.stat .value { font-size: 22px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.stat.hero { background: var(--brand); color: #fff; border-color: var(--brand); }
.stat.hero .label, .stat.hero .sub { color: rgba(255,255,255,.8); }
dl.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 12px; margin: 0; }
dl.kv dt { color: var(--text-2); } dl.kv dd { margin: 0; font-weight: 500; }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 -18px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 18px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; color: var(--text-2); font-weight: 600; background: #FAFBFA; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #FAFBFA; }
tfoot td { font-weight: 700; background: #FAFBFA; }
td .sub { font-size: 12px; color: var(--text-2); }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.neutral { background: var(--neutral-soft); color: var(--text-2); }

/* forms & buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; background: var(--brand); color: #fff; white-space: nowrap; }
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn.outline { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn.outline:hover { background: var(--brand-soft); }
.btn.soft { background: var(--brand-soft); color: var(--brand-dark); }
.btn.danger { background: var(--danger); } .btn.danger:hover { background: #a02a16; }
.btn.ghost { background: transparent; color: var(--text-2); border-color: var(--border); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=month], input[type=search], select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit; color: var(--text); background: #fff; }
textarea { height: auto; min-height: 84px; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.check { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters input, .filters select { width: auto; min-width: 160px; }
.error-text { color: var(--danger); font-size: 12px; margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
details.inline { display: inline-block; position: relative; }
details.inline > summary { list-style: none; cursor: pointer; }
details.inline > summary::-webkit-details-marker { display: none; }
details.inline[open] > .pop { position: absolute; right: 0; z-index: 20; width: 340px; margin-top: 6px; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.12); }

/* alerts */
.alert { padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 500; }
.alert.success { background: var(--success-soft); color: var(--success); }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.warning { background: var(--warning-soft); color: var(--warning); }
.alert.info { background: var(--info-soft); color: var(--info); }

/* tabs */
.tabs { display: flex; gap: 4px; background: var(--neutral-soft); padding: 4px; border-radius: 12px; margin-bottom: 16px; width: fit-content; flex-wrap: wrap; }
.tabs a { padding: 7px 14px; border-radius: 9px; color: var(--text-2); font-weight: 600; }
.tabs a.active { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.tabs a:hover { text-decoration: none; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 28px; }
.timeline li::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 99px; background: var(--brand); }
.timeline b { display: block; }

.pagination { display: flex; gap: 4px; margin-top: 14px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 11px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--text); }
.pagination .active { background: var(--brand); color: #fff; border-color: var(--brand); }
.pagination .disabled { color: var(--text-2); opacity: .6; }
.empty { text-align: center; padding: 28px; color: var(--text-2); }
.doc-thumb { width: 100%; max-height: 220px; object-fit: contain; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg); }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth .card { width: 100%; max-width: 400px; padding: 28px; }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; }
  .g2, .g3, .g4, .form-grid { grid-template-columns: 1fr; } .span2 { grid-column: auto; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; } dl.kv { grid-template-columns: 1fr; }
}
@media print { .sidebar, .topbar, .no-print { display: none !important; } .shell { display: block; } .card { box-shadow: none; } }
