/* ── Variables ─────────────────────────────────────────────── */
:root {
  --primary:     #6C63FF;
  --primary-lt:  #EEF2FF;
  --income:      #10B981;
  --income-lt:   #F0FDF4;
  --expense:     #EF4444;
  --expense-lt:  #FEF2F2;
  --bg:          #F0F4FF;
  --card:        #FFFFFF;
  --text:        #1E293B;
  --text-muted:  #94A3B8;
  --border:      #E2E8F0;
  --nav-h:       68px;
  --fab-size:    58px;
  --radius-card: 18px;
  --radius-btn:  14px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

/* ── Layout ─────────────────────────────────────────────────── */
#app {
  padding-bottom: calc(var(--nav-h) + 12px);
  min-height: 100vh;
}
.view { padding: 0 16px 16px; }
.view.hidden { display: none !important; }

/* ── Page Header ─────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 12px;
}
.page-header h1 { font-size: 1.5rem; font-weight: 800; }
.today { font-size: 0.82rem; color: var(--text-muted); }

/* ── Balance Card ────────────────────────────────────────────── */
.balance-card {
  background: linear-gradient(135deg, var(--primary) 0%, #9B8FFF 100%);
  border-radius: 22px;
  padding: 24px;
  color: #fff;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(108,99,255,.28);
}
.balance-label   { font-size: 0.82rem; opacity: .8; margin-bottom: 4px; }
.balance-amount  { font-size: 2.4rem; font-weight: 800; letter-spacing: -1px; }
.balance-summary { margin-top: 10px; font-size: 0.82rem; opacity: .9; }

/* ── Unclassified Banner ─────────────────────────────────────── */
.unclassified-banner {
  width: 100%;
  background: #FFFBEB;
  border: 2px solid #FCD34D;
  border-radius: 14px;
  padding: 12px 16px;
  text-align: left;
  font-size: 0.88rem;
  margin-bottom: 14px;
  color: #92400E;
  transition: background 0.15s;
}
.unclassified-banner:hover { background: #FEF3C7; }

/* ── Section Card ────────────────────────────────────────────── */
.section {
  background: var(--card);
  border-radius: var(--radius-card);
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px 10px;
  font-weight: 700;
  font-size: 0.95rem;
}
.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
}

/* ── Transaction Item ────────────────────────────────────────── */
.tx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.tx-item:last-child { border-bottom: none; }
.tx-item:active     { background: var(--bg); }
.tx-item.unclassified { background: #FFFBF0; }

.tx-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.tx-body  { flex: 1; min-width: 0; }
.tx-cat   { font-size: 0.88rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tx-memo  { font-size: 0.78rem; color: var(--text-muted); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.tx-date  { color: var(--text-muted); }
.tx-amount { font-weight: 700; font-size: 0.95rem; white-space: nowrap; }

.income-text  { color: var(--income); }
.expense-text { color: var(--expense); }
.muted        { color: var(--text-muted); }

.badge-warn {
  background: #FEF3C7;
  color: #D97706;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
}

/* ── Empty State ──────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 44px 16px;
  color: var(--text-muted);
  line-height: 1.6;
}
.empty-icon { font-size: 2.8rem; margin-bottom: 12px; }
.empty-sub  { font-size: 0.82rem; margin-top: 6px; }

/* ── Bottom Navigation ──────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 2px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.62rem;
  transition: color 0.15s;
}
.nav-btn .nav-icon { font-size: 1.45rem; line-height: 1; }
.nav-btn.active { color: var(--primary); font-weight: 700; }
.nav-fab-slot { flex: 1; pointer-events: none; }

/* ── FAB ─────────────────────────────────────────────────────── */
#fab {
  position: fixed;
  bottom: calc(var(--nav-h) - 26px);
  left: 50%;
  transform: translateX(-50%);
  width: var(--fab-size);
  height: var(--fab-size);
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: 4px solid var(--card);
  font-size: 1.9rem;
  line-height: 1;
  z-index: 101;
  box-shadow: 0 4px 18px rgba(108,99,255,.42);
  transition: transform 0.15s, box-shadow 0.15s;
}
#fab:active {
  transform: translateX(-50%) scale(0.92);
  box-shadow: 0 2px 8px rgba(108,99,255,.3);
}

/* ── Modals ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.48);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  animation: fade-in 0.18s ease;
}
.modal-overlay.hidden { display: none !important; }
body.modal-open { overflow: hidden; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal-sheet,
.modal-card {
  background: var(--card);
  border-radius: 24px 24px 0 0;
  padding: 20px 20px 28px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  animation: slide-up 0.22s ease;
}
@keyframes slide-up {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-handle {
  width: 38px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 14px;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.modal-header h2 { font-size: 1.1rem; font-weight: 800; }
.close-btn {
  background: var(--bg);
  border: none;
  border-radius: 50%;
  width: 32px; height: 32px;
  font-size: 0.95rem;
  display: flex; align-items: center; justify-content: center;
}

/* ── Type Toggle ─────────────────────────────────────────────── */
.type-toggle { display: flex; gap: 8px; margin-bottom: 14px; }
.type-btn {
  flex: 1;
  padding: 11px;
  border: 2px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--bg);
  font-size: 0.95rem;
  font-weight: 700;
  transition: all 0.15s;
}
.type-btn.expense.active {
  background: var(--expense-lt);
  border-color: var(--expense);
  color: var(--expense);
}
.type-btn.income.active {
  background: var(--income-lt);
  border-color: var(--income);
  color: var(--income);
}

/* ── Amount Display ──────────────────────────────────────────── */
.amount-display {
  text-align: center;
  padding: 14px 0;
  font-weight: 800;
  font-size: 2.8rem;
  letter-spacing: -1px;
}
.amount-unit { font-size: 1.3rem; color: var(--text-muted); margin-left: 4px; font-weight: 600; }

/* ── Numpad ──────────────────────────────────────────────────── */
.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 0 14px;
}
.num-btn {
  padding: 18px 0;
  border: none;
  border-radius: 14px;
  background: var(--bg);
  font-size: 1.4rem;
  font-weight: 700;
  transition: background 0.1s;
}
.num-btn:active { background: var(--border); }
.del-btn { color: var(--expense); }

/* ── Quick Memo ──────────────────────────────────────────────── */
#quick-memo {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-btn);
  font-size: 0.95rem;
  background: var(--bg);
  margin-bottom: 12px;
}
#quick-memo:focus { outline: none; border-color: var(--primary); }

#quick-category {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-btn);
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
  margin-bottom: 12px;
}
#quick-category:focus { outline: none; border-color: var(--primary); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 13px 20px;
  transition: opacity 0.15s;
}
.btn-primary:active { opacity: 0.85; }
.btn-primary.btn-lg { width: 100%; padding: 15px; font-size: 1.05rem; }

.btn-danger {
  background: var(--expense-lt);
  color: var(--expense);
  border: 2px solid #FECACA;
  border-radius: var(--radius-btn);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 13px 18px;
}
.btn-add {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.88rem;
}
.icon-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  padding: 4px 10px;
}

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-btn);
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
}
.form-group input:focus,
.form-group select:focus { outline: none; border-color: var(--primary); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
.form-actions .btn-primary { flex: 1; }

/* ── Filter Bar ──────────────────────────────────────────────── */
.filter-bar { display: flex; gap: 8px; margin-bottom: 10px; }
.filter-bar select {
  flex: 1;
  padding: 8px 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  font-size: 0.82rem;
  color: var(--text);
}

/* ── Date Group ──────────────────────────────────────────────── */
.date-group { margin-bottom: 10px; }
.date-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 8px 4px 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── Stats ───────────────────────────────────────────────────── */
.month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 4px 0 16px;
}
.month-label { font-size: 1.1rem; font-weight: 800; }

.stats-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.stat-card.income  { border-top: 4px solid var(--income); }
.stat-card.expense { border-top: 4px solid var(--expense); }
.stat-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.stat-value { font-size: 1.05rem; font-weight: 800; }

.chart-card {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.chart-title { font-weight: 700; margin-bottom: 14px; font-size: 0.92rem; }
.chart-wrap     { position: relative; height: 230px; }
.chart-wrap-bar { position: relative; height: 190px; }

/* ── Category Stats ──────────────────────────────────────────── */
.cat-stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.cat-stat-item:last-child { border-bottom: none; }
.cat-stat-body { flex: 1; }
.cat-stat-name { font-size: 0.88rem; font-weight: 600; margin-bottom: 6px; }
.cat-stat-bar  { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.cat-stat-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.cat-stat-amount { text-align: right; min-width: 72px; }
.pct-text { font-size: 0.72rem; color: var(--text-muted); }

/* ── Settings – Category Items ───────────────────────────────── */
.cat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.cat-item:last-child { border-bottom: none; }
.cat-item:active { background: var(--bg); }
.cat-body { flex: 1; }
.cat-name { font-size: 0.88rem; font-weight: 600; }
.cat-type { font-size: 0.74rem; color: var(--text-muted); }
.edit-arrow { color: var(--text-muted); font-size: 1.5rem; }

/* ── Icon Picker ─────────────────────────────────────────────── */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.icon-option {
  padding: 7px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  font-size: 1.2rem;
  transition: border-color 0.12s;
}
.icon-option.selected {
  border-color: var(--primary);
  background: var(--primary-lt);
}

/* ── Color Picker ────────────────────────────────────────────── */
.color-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.color-option {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid transparent;
  transition: transform 0.12s;
}
.color-option:active { transform: scale(0.9); }
.color-option.selected {
  border-color: var(--text);
  box-shadow: 0 0 0 2px #fff inset;
}

/* ── Loading ─────────────────────────────────────────────────── */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 1.5rem;
  animation: pulse 1s infinite alternate;
}
@keyframes pulse { from { opacity: .5; } to { opacity: 1; } }

/* ── Utility ─────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Message Dialog (showAlert / showConfirm) ────────────────── */
.msg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.52);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  animation: fade-in 0.15s ease;
}
.msg-overlay.msg-closing {
  animation: fade-out 0.15s ease forwards;
}
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }

.msg-box {
  background: var(--card);
  border-radius: 20px;
  padding: 28px 24px 20px;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 12px 40px rgba(0,0,0,.22);
  animation: msg-scale-in 0.18s cubic-bezier(.34,1.28,.64,1);
}
@keyframes msg-scale-in {
  from { transform: scale(0.86); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.msg-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.msg-body {
  font-size: 0.93rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 22px;
  white-space: pre-wrap;
}
.msg-actions {
  display: flex;
  gap: 8px;
}
.msg-btn {
  flex: 1;
  padding: 11px 0;
  border-radius: var(--radius-btn);
  font-size: 0.93rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}
.msg-btn:active { opacity: 0.75; }
.msg-btn--ghost {
  background: var(--bg);
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.msg-btn--primary {
  background: var(--primary);
  color: #fff;
}

/* ── Auth screen ─────────────────────────────────────────────── */
#auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6C63FF 0%, #a78bfa 100%);
  padding: 24px 16px;
}
.auth-wrapper {
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.auth-logo {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 8px;
}
.auth-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 24px;
  letter-spacing: -0.5px;
}
.auth-card {
  background: var(--card-bg, #fff);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg, #f8f7ff);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-muted, #9ca3af);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.auth-tab.active {
  background: var(--primary, #6C63FF);
  color: #fff;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-form input {
  padding: 12px 14px;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 12px;
  font-size: 1rem;
  outline: none;
  background: var(--bg, #f8f7ff);
  color: var(--text, #1a1a2e);
  transition: border-color .15s;
}
.auth-form input:focus {
  border-color: var(--primary, #6C63FF);
}
.auth-error {
  min-height: 20px;
  font-size: .85rem;
  color: #ef4444;
  text-align: left;
}
/* ── Logout button & user nick in header ── */
.logout-btn {
  padding: 4px 12px;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 20px;
  background: transparent;
  font-size: .8rem;
  color: var(--text-muted, #9ca3af);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.logout-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}
.user-nick {
  font-weight: 700;
  color: var(--primary, #6C63FF);
}

/* ── Parent Screen ───────────────────────────────────────────── */
#parent-detail-screen {
  min-height: 100vh;
  background: var(--bg, #F0F4FF);
  padding: 0 16px 32px;
}

.parent-ild Card ──────────────────────────────────────────────── */
.parent-child-list {
  margin-bottom: 8px;
}
.child-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.child-card:active { background: var(--bg); }
.child-card.selected {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(108,99,255,.2);
}
.child-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #a78bfa 100%);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.child-info { flex: 1; }
.child-nick { font-size: 0.95rem; font-weight: 700; }
.child-user { font-size: 0.76rem; color: var(--text-muted); margin-top: 2px; }

/* ── Parent Summary Card ─────────────────────────────────────── */
.parent-summary-card {
  background: linear-gradient(135deg, var(--primary) 0%, #9B8FFF 100%);
  border-radius: 20px;
  padding: 20px;
  color: #fff;
  margin: 12px 0 14px;
  box-shadow: 0 6px 20px rgba(108,99,255,.28);
}
.parent-summary-name {
  font-size: 0.82rem;
  opacity: .85;
  margin-bottom: 4px;
}
.parent-summary-balance {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 8px;
}
.parent-summary-row {
  font-size: 0.82rem;
  opacity: .9;
}

.parent-detail-btn {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  margin-top: 4px;
}

/* ── Parent Detail Header ────────────────────────────────────── */
.parent-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0 16px;
}
.parent-detail-header h1 {
  font-size: 1.1rem;
  font-weight: 800;
  flex: 1;
}
.back-btn {
  background: none;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  padding: 4px 0;
  white-space: nowrap;
}

/* ── Admin / Parent / Monitoring (v2) ────────────────────────── */
.admin-section { border-top: 2px solid var(--primary); }

.admin-user-row,
.monitoring-req-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #E2E8F0);
}
.admin-user-row:last-child,
.monitoring-req-item:last-child { border-bottom: none; }

.user-info { flex: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-nick  { font-size: 0.92rem; font-weight: 700; }
.user-id    { font-size: 0.76rem; }
.admin-user-actions { display: flex; gap: 6px; flex-shrink: 0; }

.log-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border, #E2E8F0);
  font-size: 0.82rem;
  flex-wrap: wrap;
}
.log-item:last-child { border-bottom: none; }
.log-action  { font-weight: 700; white-space: nowrap; }
.log-detail  { background: var(--bg, #F8FAFC); border-radius: 4px; padding: 1px 6px; }
.log-user    { margin-left: auto; }
.log-time    { white-space: nowrap; }

.child-card2 {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 12px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

/* Status badges */
.status-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}
.status-badge.pending  { background: #FEF9C3; color: #92400E; }
.status-badge.accepted { background: #DCFCE7; color: #15803D; }
.status-badge.rejected { background: #FEE2E2; color: #991B1B; }
.status-badge.admin    { background: #EDE9FE; color: #6C63FF; }

/* Small action buttons */
.btn-small {
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-accept { background: #DCFCE7; color: #15803D; }
.btn-reject { background: #FEE2E2; color: #991B1B; }
.btn-accept:active { background: #BBF7D0; }
.btn-reject:active { background: #FECACA; }

/* Add child form inside settings */
.add-child-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  padding: 0 16px 12px;
}
.add-child-form input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--border, #E2E8F0);
  border-radius: 10px;
  font-size: 0.9rem;
  background: var(--card);
  color: var(--text);
  outline: none;
}
.add-child-form input:focus { border-color: var(--primary); }

/* ── Parent Date Filter Bar ──────────────────────────────────── */
.parent-date-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0 6px;
  flex-wrap: wrap;
}
.parent-date-filter input[type="date"],
.parent-date-filter select {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1.5px solid var(--border, #E2E8F0);
  border-radius: 10px;
  font-size: 0.82rem;
  background: var(--card);
  color: var(--text);
  outline: none;
}
.parent-date-filter input[type="date"]:focus,
.parent-date-filter select:focus { border-color: var(--primary); }
.filter-sep { font-size: 0.85rem; color: var(--muted, #94A3B8); flex-shrink: 0; }

/* ── Parent Period Summary Bar ───────────────────────────────── */
.parent-period-summary {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 12px 16px;
  font-size: 0.85rem;
  margin-bottom: 8px;
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* ── Child Mini Overview (inline in child card) ──────────────── */
.child-mini-overview {
  font-size: 0.76rem;
  margin-top: 2px;
  color: var(--muted, #94A3B8);
}
.child-card2.clickable { cursor: pointer; }
.child-card2.clickable:active { opacity: .8; }

/* ── Log Filter Bar ──────────────────────────────────────────── */
.log-filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  padding: 0 16px;
  flex-wrap: wrap;
}
.log-filter-bar select {
  flex: 1;
  min-width: 120px;
  padding: 8px 12px;
  border: 1.5px solid var(--border, #E2E8F0);
  border-radius: 10px;
  font-size: 0.82rem;
  background: var(--card);
  color: var(--text);
  outline: none;
}
.log-filter-bar select:focus { border-color: var(--primary); }

