:root {
  --brand: #18A892;
  --brand-dark: #157D72;
  --bg: #f7f8fa;
  --fg: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --danger: #dc2626;
  --warn: #f59e0b;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; color: var(--fg); background: var(--bg); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: white; padding: 36px 32px; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,.08); width: 360px; text-align: center; }
.login-card h1 { color: var(--brand-dark); margin: 0 0 4px; }
.btn-google { display: inline-flex; align-items: center; gap: 10px; margin-top: 24px; padding: 11px 20px; background: white; border: 1px solid var(--border); border-radius: 8px; color: var(--fg); text-decoration: none; font-weight: 500; transition: box-shadow .15s; }
.btn-google:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.err { color: var(--danger); margin-top: 16px; min-height: 20px; }

.topbar { display: flex; align-items: center; gap: 24px; padding: 12px 24px; background: white; border-bottom: 1px solid var(--border); }
.brand { font-weight: 600; color: var(--brand-dark); font-size: 18px; }
nav#tabs { display: flex; gap: 4px; flex: 1; }
nav#tabs a { padding: 8px 14px; color: var(--muted); text-decoration: none; border-radius: 6px; font-size: 14px; cursor: pointer; }
nav#tabs a.active { background: var(--brand); color: white; }
.user { display: flex; align-items: center; gap: 12px; font-size: 14px; }

main { padding: 24px; max-width: 1200px; margin: 0 auto; }
.view { background: white; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }

.month-picker { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.month-picker input[type=month] { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.badge { padding: 2px 8px; background: #fef3c7; color: #92400e; border-radius: 4px; font-size: 12px; }

table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
table.data th { background: #f9fafb; font-weight: 600; color: var(--muted); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:hover { background: #fafafa; }
.expand-btn { background: none; border: none; cursor: pointer; color: var(--brand-dark); font-size: 16px; padding: 0 4px; }
.deal-detail { background: #f9fafb; }
.deal-detail td { padding: 12px 24px; }
.deal-table { width: 100%; }
.deal-table th, .deal-table td { padding: 6px 8px; font-size: 13px; }

.actions { margin-bottom: 16px; }
.btn { padding: 8px 16px; background: var(--brand); color: white; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; }
.btn:hover { background: var(--brand-dark); }
.btn-sm { padding: 4px 10px; background: white; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; }
.btn-sm:hover { background: var(--bg); }
.btn-link { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; }
.btn-link:hover { color: var(--fg); text-decoration: underline; }
.btn-danger { color: var(--danger); }

.note { margin-top: 12px; font-size: 13px; color: var(--muted); }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-card { background: white; border-radius: 8px; padding: 24px; width: 480px; max-width: 90vw; }
.modal-card h3 { margin: 0 0 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.modal-card label { display: block; margin: 12px 0 4px; font-size: 13px; color: var(--muted); }
.modal-card input, .modal-card select { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }

.percent-list { margin-top: 8px; }
.percent-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.percent-add { display: flex; gap: 6px; margin-top: 8px; }
.percent-add input { flex: 1; padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; }
