/* =====================================================================
   Tema aplikasi: sidebar putih, area konten abu lembut, kartu putih,
   aksen hijau. Menimpa gaya dasar Bootstrap.
   ===================================================================== */
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/PlusJakartaSans-Regular.woff) format("woff"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url(fonts/PlusJakartaSans-Medium.woff) format("woff"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/PlusJakartaSans-SemiBold.woff) format("woff"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url(fonts/PlusJakartaSans-Bold.woff) format("woff"); }

:root {
  --bg: #ececec;           /* latar di luar bingkai */
  --frame: #ffffff;        /* bingkai aplikasi + sidebar */
  --content: #f5f5f5;      /* area konten */
  --card: #ffffff;
  --soft: #f4f4f3;         /* isian lembut */
  --line: #ececeb;
  --ink: #1b1d1c;
  --muted: #7a7f7c;
  --dark: #1b1d1c;
  --brand: #16925a;        /* hijau utama */
  --brand-2: #22b36f;
  --brand-dark: #0e7646;
  --brand-soft: #e6f5ec;
  --accent: var(--brand);  /* alias untuk komponen lama */
  --accent-2: var(--brand-2);
  --accent-soft: var(--brand-soft);
  --ok: #16925a;   --ok-soft: #e4f5eb;
  --warn: #c07c00; --warn-soft: #fff3d9;
  --bad: #dc3f3a;  --bad-soft: #fdeceb;
  --info: #2f6fd6; --info-soft: #e8effc;
  --r-frame: 26px; --r-card: 18px; --r-in: 12px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-font-family: var(--font);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg);
  --bs-border-color: var(--line);
  --bs-link-color: var(--ink); --bs-link-color-rgb: 27,29,28;
  --bs-link-hover-color: var(--brand); --bs-link-hover-color-rgb: 22,146,90;
  --bs-secondary-color: var(--muted);
  --bs-tertiary-bg: var(--soft);
  --bs-success: var(--ok); --bs-danger: var(--bad); --bs-warning: var(--warn);
  --bs-success-rgb: 22,146,90; --bs-danger-rgb: 220,63,58; --bs-warning-rgb: 192,124,0;
}
html { font-size: 14px; }
html, body { background: var(--bg); }
body { font-family: var(--font); color: var(--ink); font-size: 13.5px; line-height: 1.5; word-spacing: .1em; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
a:hover { color: var(--brand); }
.text-body-secondary { color: var(--muted) !important; }
.text-success { color: var(--ok) !important; }
h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 { font-weight: 600; letter-spacing: -.01em; }
.h4, h1.h4 { font-size: 1.3rem; } .h5, h2.h5 { font-size: 1.1rem; } .h6 { font-size: .95rem; }
.small, small { font-size: .84em; }
.num-col, .tnum { font-variant-numeric: tabular-nums; }
.num-col { text-align: right; white-space: nowrap; }
.money-lg { white-space: nowrap; }

/* ---------- Bingkai: sidebar + konten ---------- */
.app { max-width: 1440px; margin: 16px auto; background: var(--frame); border-radius: var(--r-frame); display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - 32px); padding: 12px; gap: 6px; }
.side { position: sticky; top: 12px; align-self: start; height: calc(100vh - 56px); display: flex; flex-direction: column; padding: 4px 6px 4px 4px; }
.side-brand { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 14px; }
.side-brand a { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 1.12rem; letter-spacing: -.02em; }
.side-brand .logo { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(145deg, var(--brand-2), var(--brand)); color: #fff; display: grid; place-items: center; font-size: 1.05rem; }
.side-brand small { display: block; font-size: .68rem; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: -2px; }
.side-toggle { width: 28px; height: 28px; border-radius: 8px; border: 0; background: var(--soft); color: var(--muted); display: grid; place-items: center; }
.side-nav { flex: 1; overflow-y: auto; scrollbar-width: thin; padding-right: 2px; padding-left: 6px; }
.side-sec { font-size: .7rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: #8d928f; margin: 16px 8px 6px; }
.side-sec:first-child { margin-top: 2px; }
.side-link { position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; color: #3f4441; font-weight: 500; margin-bottom: 2px; }
.side-link i { font-size: 1.05rem; color: #626864; width: 20px; text-align: center; }
.side-link:hover { background: var(--soft); color: var(--ink); }
.side-link.active { background: var(--brand-soft); color: var(--brand-dark); }
.side-link.active i { color: var(--brand); }
.side-link.active::before { content: ""; position: absolute; left: -9px; top: 50%; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); transform: translateY(-50%); }
.side-link .cnt { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--soft); color: #555b57; font-size: .72rem; font-weight: 600; display: grid; place-items: center; }
.side-link .cnt.hot { background: var(--brand); color: #fff; }
.side-card { margin-top: 12px; border-radius: 16px; padding: 16px; color: #fff; text-align: center; background: radial-gradient(120% 90% at 100% 100%, rgba(255,255,255,.14), transparent 60%), linear-gradient(160deg, var(--brand-2), var(--brand-dark)); }
.side-card b { display: block; font-size: 1rem; }
.side-card p { font-size: .8rem; opacity: .9; margin: 4px 0 12px; }
.side-card a { display: block; background: #fff; color: var(--brand-dark); border-radius: 10px; padding: 7px 10px; font-weight: 600; font-size: .86rem; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 2px 4px 12px 4px; }
.topbar .search { position: relative; width: min(340px, 100%); }
.topbar .search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.topbar .search input { width: 100%; border: 0; background: var(--soft); border-radius: 12px; padding: 8px 12px 8px 36px; font: inherit; color: var(--ink); }
.topbar .search input:focus { outline: 2px solid var(--brand-soft); background: #fff; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink); display: grid; place-items: center; font-size: 1.02rem; position: relative; }
.icon-btn:hover { background: var(--soft); color: var(--ink); }
.icon-btn .dot { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--brand); color: #fff; font-size: .6rem; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.user-btn { display: flex; align-items: center; gap: 8px; padding: 3px 6px 3px 3px; border-radius: 99px; color: var(--ink); }
.user-btn:hover { background: var(--soft); color: var(--ink); }
.user-btn .avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); display: grid; place-items: center; font-weight: 700; font-size: .82rem; }
.user-btn .who { line-height: 1.15; }
.user-btn .who b { font-size: .86rem; font-weight: 600; display: block; }
.user-btn .who span { font-size: .7rem; color: var(--muted); }
.content { flex: 1; background: var(--content); border-radius: 20px; padding: 20px 20px 28px; min-width: 0; }
.menu-btn { display: none; }

.page-head { margin-bottom: 16px; }
.page-head h1 { font-size: 1.75rem; font-weight: 600; letter-spacing: -.025em; margin: 0; text-wrap: balance; }
.page-head p { color: var(--muted); margin: 3px 0 0; font-size: .95rem; }
.date-chip { display: inline-flex; align-items: center; gap: 8px; background: #fff; border-radius: 99px; padding: 8px 14px; font-weight: 500; white-space: nowrap; }

/* ---------- Kartu ---------- */
.card { border: 0; border-radius: var(--r-card); background: var(--card); box-shadow: none; }
.card-body { padding: 18px 20px; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-title-row h2, .card-title-row h3 { font-size: 1.08rem; margin: 0; font-weight: 600; }
.title-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--soft); display: inline-grid; place-items: center; color: #3f4441; font-size: 1.05rem; flex: none; }
.title-with-ico { display: flex; align-items: center; gap: 10px; }
.sub { color: var(--muted); font-size: .82rem; }
.panel-soft { background: var(--soft); border-radius: var(--r-in); padding: 12px; }
.big-num { font-size: 2.1rem; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }

.kpi { border-radius: 16px; background: var(--soft); padding: 14px 16px; height: 100%; display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
a.kpi:hover { color: var(--ink); background: #efefee; }
.kpi .kpi-top { display: flex; justify-content: space-between; align-items: center; color: #3f4441; font-weight: 500; font-size: .92rem; }
.kpi .kpi-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(0,0,0,.05); font-size: .9rem; }
.kpi .kpi-val { font-size: 1.75rem; font-weight: 600; margin-top: 8px; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .kpi-val .fs-6 { font-size: .85rem !important; }
.kpi .kpi-foot { font-size: .76rem; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.kpi.hot { background: linear-gradient(160deg, var(--brand-2), var(--brand-dark)); color: #fff; }
.kpi.hot .kpi-top { color: #fff; } .kpi.hot .kpi-ico { background: rgba(255,255,255,.2); } .kpi.hot .kpi-foot { color: rgba(255,255,255,.85); }
a.kpi.hot:hover { color: #fff; filter: brightness(1.04); }
.stat-card { background: #fff; border-radius: var(--r-card); padding: 16px 18px; height: 100%; display: flex; flex-direction: column; gap: 6px; color: var(--ink); }
a.stat-card:hover { color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.stat-card .head { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1rem; }
.stat-card .val { font-size: 1.85rem; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; margin-top: 6px; }
.stat-card .foot { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.trend { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 99px; font-size: .72rem; font-weight: 600; }
.trend.up { background: var(--ok-soft); color: var(--ok); } .trend.down { background: var(--bad-soft); color: var(--bad); } .trend.neutral { background: rgba(0,0,0,.06); color: var(--muted); }
.kpi.hot .trend { background: rgba(255,255,255,.22); color: #fff; }
.tile { background: var(--soft); border-radius: 14px; padding: 12px; height: 100%; display: block; color: var(--ink); }
a.tile:hover { background: #efefee; color: var(--ink); }

/* ---------- Tombol ---------- */
.btn { border-radius: 12px; font-weight: 500; font-size: .93rem; padding: .5rem 1rem; }
.btn-sm { font-size: .82rem; padding: .3rem .75rem; border-radius: 10px; }
.btn-success, .btn-dark, .btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-success:hover, .btn-success:focus, .btn-dark:hover, .btn-dark:focus, .btn-primary:hover, .btn-primary:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-black { background: var(--dark); border-color: var(--dark); color: #fff; }
.btn-black:hover, .btn-black:focus { background: #000; border-color: #000; color: #fff; }
.btn-warning { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-outline-secondary, .btn-light, .btn-outline-primary, .btn-outline-success { background: var(--soft); border-color: var(--soft); color: var(--ink); }
.btn-outline-secondary:hover, .btn-light:hover, .btn-outline-primary:hover, .btn-outline-success:hover { background: #e9e9e8; border-color: #e9e9e8; color: var(--ink); }
.page-head .btn-light { background: #fff; border-color: #fff; }
.page-head .btn-light:hover { background: #fafafa; }
.btn-outline-danger { border-color: var(--bad-soft); background: var(--bad-soft); color: var(--bad); }
.btn-outline-danger:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-outline-warning { background: var(--warn-soft); border-color: var(--warn-soft); color: #7a5000; }
.btn-outline-warning:hover { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn-link { color: var(--muted); }
.btn:focus-visible { box-shadow: 0 0 0 3px rgba(22,146,90,.3); }

/* ---------- Form ---------- */
.form-control, .form-select { border-radius: 11px; background-color: var(--soft); border-color: var(--soft); padding: .5rem .8rem; font-size: .93rem; }
.form-control-sm, .form-select-sm { border-radius: 9px; padding: .3rem .6rem; font-size: .85rem; }
.form-select, .form-select-sm { padding-right: 2.1rem; }
.form-control:focus, .form-select:focus { background-color: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22,146,90,.14); }
.form-label { font-weight: 500; font-size: .82rem; color: #4a4f4c; margin-bottom: .3rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.input-group-text { background: var(--soft); border-color: var(--soft); color: var(--muted); }
.filter-bar .form-control, .filter-bar .form-select { background-color: #fff; border-color: #fff; }
.search-pill { position: relative; }
.search-pill .bi { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-pill input { padding-left: 34px; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
input.num-in { text-align: right; -moz-appearance: textfield; appearance: textfield; }
input.num-in::-webkit-outer-spin-button, input.num-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.items-table input, .items-table select { min-width: 70px; }

/* ---------- Tabel ---------- */
.table { --bs-table-bg: transparent; --bs-table-hover-bg: #fafafa; margin-bottom: 0; font-size: .92rem; }
.table > :not(caption) > * > * { padding: .62rem .7rem; border-bottom-color: var(--line); }
.table thead th, .table thead.table-light th { background: var(--soft) !important; color: var(--muted); font-weight: 500; font-size: .8rem; border-bottom: 0; white-space: nowrap; }
.table thead th:first-child { border-top-left-radius: 10px; border-bottom-left-radius: 10px; }
.table thead th:last-child { border-top-right-radius: 10px; border-bottom-right-radius: 10px; }
.table-sm > :not(caption) > * > * { padding: .45rem .55rem; }
.table tfoot th, .table tfoot td { border-bottom: 0; }
.table-wrap { border: 1px solid var(--line); border-radius: 14px; padding: 6px; overflow-x: auto; }
.card > .table-responsive { padding: 8px; }

/* ---------- Badge & status ---------- */
.badge { border-radius: 999px; font-weight: 600; padding: .35em .75em; font-size: .74em; }
.badge.text-bg-success { background: var(--ok-soft) !important; color: var(--ok) !important; }
.badge.text-bg-danger { background: var(--bad-soft) !important; color: var(--bad) !important; }
.badge.text-bg-warning { background: var(--warn-soft) !important; color: #7a5000 !important; }
.badge.text-bg-primary { background: var(--info-soft) !important; color: var(--info) !important; }
.badge.text-bg-info { background: #e3f4f7 !important; color: #117384 !important; }
.badge.text-bg-secondary { background: rgba(0,0,0,.06) !important; color: #555b57 !important; }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap; padding: 2px 10px 2px 8px; border-radius: 99px; font-size: .84em; background: rgba(0,0,0,.05); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.ok { color: var(--ok); background: var(--ok-soft); } .status.warn { color: #9a6300; background: var(--warn-soft); }
.status.bad { color: var(--bad); background: var(--bad-soft); } .status.muted { color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; background: var(--soft); font-size: .76rem; font-weight: 500; color: #4a4f4c; white-space: nowrap; }
.chip-unit-laundry { background: #e5f0fa; color: #1f5f96; }
.chip-unit-dapur { background: var(--brand-soft, #e3f4ec); color: var(--brand-dark, #0f6b41); }

.meter { height: 10px; border-radius: 99px; background: repeating-linear-gradient(135deg, #ececeb 0 5px, #f6f6f5 5px 10px); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.meter.ok > span { background: var(--brand); } .meter.warn > span { background: #f0a020; } .meter.bad > span { background: var(--bad); }
.meter.sm { height: 7px; }
.progress { border-radius: 99px; background: var(--soft); }
.progress-bar.bg-success { background: var(--brand) !important; }
.alert { border-radius: 14px; border: 0; }
.alert-success { background: var(--ok-soft); color: #0c5a36; } .alert-danger { background: var(--bad-soft); color: #8f2a26; }
.alert-warning { background: var(--warn-soft); color: #6b4700; } .alert-info, .alert-light { background: var(--info-soft); color: #1e4b91; }
.dropdown-menu { border: 0; border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.12); padding: 6px; font-size: .93rem; }
.dropdown-item { border-radius: 9px; padding: .45rem .75rem; }
.dropdown-item.active, .dropdown-item:active { background: var(--brand); }
.modal-content { border: 0; border-radius: 20px; }
.seg { display: inline-flex; background: var(--soft); border-radius: 12px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.content > .seg, .filter-bar .seg, .page-head .seg { background: #fff; }
.seg a { padding: 5px 12px; border-radius: 9px; color: #4a4f4c; font-weight: 500; font-size: .86rem; white-space: nowrap; }
.seg a.active { background: var(--brand-soft); color: var(--brand-dark); }
.card .seg a.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.chart-legend { display: flex; gap: 12px; font-size: .8rem; color: var(--muted); flex-wrap: wrap; align-items: center; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }

/* ---------- Responsif ---------- */
@media (max-width: 991.98px) {
  .app { margin: 0; border-radius: 0; grid-template-columns: minmax(0, 1fr); padding: 10px; min-height: 100vh; }
  .side { position: fixed; z-index: 1040; left: 0; top: 0; height: 100%; width: 270px; background: #fff; padding: 14px; box-shadow: 0 0 40px rgba(0,0,0,.2); transform: translateX(-105%); transition: transform .2s; }
  .side.open { transform: none; }
  .side-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 1030; }
  .menu-btn { display: grid; }
  .topbar .search { display: none; }
  .user-btn .who { display: none; }
  .content { padding: 14px; border-radius: 16px; }
  .page-head h1 { font-size: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }
@media print {
  body, html { background: #fff; }
  .app { margin: 0; padding: 0; display: block; }
  .side, .topbar, .no-print { display: none !important; }
  .content { background: #fff; padding: 0; }
  .card { border: 1px solid #ddd; }
}
