/* paidbill 대시보드 — 모바일 우선 경량 CSS (라즈베리파이 ARM, 프레임워크 없음). */
:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1d2330;
  --muted: #6b7280;
  --line: #e3e6ea;
  --brand: #2563eb;
  --brand-ink: #ffffff;
  --warn: #d97706;
  --danger: #dc2626;
  --ok: #059669;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Apple SD Gothic Neo",
    "Noto Sans KR", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }

header.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
}
header.topbar .brand { font-weight: 700; font-size: 17px; }
header.topbar .spacer { flex: 1; }
header.topbar form { margin: 0; }

nav.tabs {
  display: flex; gap: 4px; overflow-x: auto;
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 0 8px;
}
nav.tabs a {
  padding: 12px 12px; white-space: nowrap; color: var(--muted);
  border-bottom: 2px solid transparent; font-size: 14px;
}
nav.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

main { padding: 14px; max-width: 760px; margin: 0 auto; }
h1 { font-size: 19px; margin: 4px 0 14px; }
h2 { font-size: 16px; margin: 18px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
}
.row { display: flex; align-items: center; gap: 10px; }
.row .spacer { flex: 1; }
.amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.pos { color: var(--ok); }
.neg { color: var(--danger); }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.badge.skeleton { background: #fef3c7; color: var(--warn); }
.badge.detailed { background: #d1fae5; color: var(--ok); }
.badge.other { background: #e5e7eb; color: var(--muted); }
.badge.fixed { background: #dbeafe; color: var(--brand); }
.badge.grocery { background: #dcfce7; color: var(--ok); }
.badge.etc { background: #f3f4f6; color: var(--muted); }
.badge.conf-high { background: #d1fae5; color: var(--ok); }
.badge.conf-medium { background: #fef3c7; color: var(--warn); }
.badge.conf-low { background: #f3f4f6; color: var(--muted); }

button, .btn {
  font: inherit; cursor: pointer; border: 1px solid var(--line);
  background: var(--card); color: var(--ink);
  border-radius: 8px; padding: 8px 12px; min-height: 40px;
}
button.primary, .btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
button.danger { color: var(--danger); border-color: #f3c2c2; }
button:disabled { opacity: .5; cursor: not-allowed; }

label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea {
  font: inherit; width: 100%; padding: 10px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--ink); min-height: 42px;
}
textarea { min-height: 70px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar select { width: auto; min-width: 120px; }

.upload-channels { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.channel-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 10px; text-align: center;
}
.channel-btn .ico { font-size: 26px; }

.bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand); }

.flash { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 14px; }
.flash.err { background: #fee2e2; color: var(--danger); }
.flash.ok { background: #d1fae5; color: var(--ok); }

.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

.login-wrap { max-width: 360px; margin: 8vh auto; }
.center { text-align: center; }

@media (min-width: 560px) {
  .upload-channels { grid-template-columns: repeat(4, 1fr); }
}
