/* MBB — gaya macOS bersih: terang, aksen biru Apple #0071e3 */
* { box-sizing: border-box; }
:root {
  --bg: #f5f5f7; --card: #ffffff; --sidebar: #f5f5f7;
  --text: #1d1d1f; --muted: #86868b; --line: #e8e8ed;
  --accent: #0071e3; --accent-soft: rgba(0, 113, 227, .12);
  --green: #1d7a4f; --red: #b3261e; --amber: #8a6d1b;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
}
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
.app { display: flex; min-height: 100vh; }

/* ---- layar login ---- */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--bg); }
.login-card { background: #fff; border: 1px solid rgba(0, 0, 0, .04); border-radius: 20px; box-shadow: var(--shadow); padding: 28px; width: 100%; max-width: 380px; }
.login-card h1 { font-size: 22px; margin: 16px 0 4px; letter-spacing: -.01em; }
.login-card .hint { margin-bottom: 0; }
.login-card form { background: transparent; padding: 0; margin: 16px 0 0; grid-template-columns: 1fr; }
.login-card .notice { margin: 12px 0 0; }
.btn-logout { background: transparent; border: 0; color: var(--muted); font-size: 13px; cursor: pointer; padding: 6px 0 0; font-family: inherit; }
.btn-logout:hover { color: var(--red); }
.user-line { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ---- sidebar ---- */
.sidebar {
  width: 248px; flex-shrink: 0; background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 20px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px; }
.brand .mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--accent);
  color: #fff; font-weight: 800; font-size: 14px; letter-spacing: .02em;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand .name { font-size: 16px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.brand .sub { font-size: 12px; color: var(--muted); line-height: 1.3; }
.tabs { display: flex; flex-direction: column; gap: 2px; }
.tabs button {
  display: block; width: 100%; text-align: left;
  border: 0; background: transparent; padding: 9px 12px; border-radius: 8px;
  cursor: pointer; font-size: 14px; color: var(--text); font-family: inherit;
}
.tabs button:hover { background: rgba(0, 0, 0, .04); }
.tabs button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-foot { margin-top: auto; padding: 0 6px; }
.badge {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 5px 10px; border-radius: 999px;
  background: rgba(0, 0, 0, .05); color: var(--muted);
}
.badge.live { background: rgba(29, 122, 79, .12); color: var(--green); }

/* ---- content ---- */
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 28px 0;
}
.topbar h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
main { max-width: 980px; width: 100%; margin: 0 auto; padding: 18px 28px 48px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card {
  background: var(--card); border: 1px solid rgba(0, 0, 0, .04);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
}
.card .label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.card .value { font-size: 24px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.card .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

.panel {
  background: var(--card); border: 1px solid rgba(0, 0, 0, .04);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 12px; }
.panel h2 { margin: 0 0 4px; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.panel .hint { color: var(--muted); font-size: 13px; margin: 0 0 14px; line-height: 1.5; }
.tablewrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafafa; }
th { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tfoot td { font-weight: 700; background: #fafafa; }
.pctbar { height: 6px; background: #ececf1; border-radius: 99px; overflow: hidden; min-width: 70px; margin-bottom: 4px; }
.pctbar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; padding: 16px; background: #fafafa; border-radius: 12px; }
form .full { grid-column: 1 / -1; }
label { font-size: 12px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 5px; }
input, select {
  width: 100%; padding: 9px 12px; border: 1px solid #d2d2d7; border-radius: 10px;
  font-size: 14px; background: #fff; font-family: inherit; color: var(--text);
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 113, 227, .18); }
button.primary {
  background: var(--accent); color: #fff; border: 0; padding: 10px 18px;
  border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
}
button.primary:hover { background: #0077ed; }
button.primary:disabled { opacity: .6; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters input, .filters select { max-width: 220px; }
.notice { background: #fff8e1; border: 1px solid #f0dfa8; color: var(--amber); border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.5; margin-bottom: 14px; }
.error { background: #fdecea; border: 1px solid #f2b8b5; color: var(--red); border-radius: 12px; padding: 12px 14px; font-size: 13px; margin-bottom: 14px; }
.okmsg { background: #e6f4ea; border: 1px solid #a8d5b5; color: var(--green); border-radius: 12px; padding: 12px 14px; font-size: 13px; margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.pos { color: var(--green); } .neg { color: var(--red); }
.updated { font-size: 12px; color: var(--muted); margin: -6px 0 14px; }
.btn-hapus {
  background: transparent; color: var(--red); border: 1px solid #f2b8b5;
  border-radius: 8px; padding: 5px 10px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.btn-hapus:hover { background: #fdecea; }
.btn-hapus.armed { background: var(--red); color: #fff; border-color: var(--red); }
footer { color: var(--muted); font-size: 12px; text-align: center; padding: 20px; }

/* ---- mobile: sidebar jadi bar atas ---- */
@media (max-width: 760px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static;
    flex-direction: column; gap: 12px; padding: 14px 14px 10px;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .tabs { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 2px; }
  .tabs button { width: auto; white-space: nowrap; }
  .side-foot { display: none; }
  .topbar { padding: 16px 16px 0; }
  .topbar h1 { font-size: 22px; }
  main { padding: 14px 14px 40px; }
  .panel { padding: 16px; }
  /* Ringkasan di HP: hanya Nama, Total Saldo, Sisa Utang */
  .col-opt { display: none; }
}
