@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700&family=Public+Sans:wght@400;500;600&display=swap');

:root {
  --ink: #0F2F36;
  --ink-2: #1B4A54;
  --sun: #F2B134;
  --bg: #F2F5F6;
  --surface: #FFFFFF;
  --line: #DCE3E6;
  --text: #17262B;
  --muted: #5E7279;
  --ok: #23744F;
  --ok-bg: #DDF1E6;
  --warn: #7A4F00;
  --warn-bg: #FCEFC9;
  --bad: #B4302F;
  --bad-bg: #FBE0DE;
  --neutral: #3E525A;
  --neutral-bg: #E6ECEE;
  --head: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --body: 'Public Sans', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); font-size: 15px; line-height: 1.5; background: var(--bg); color: var(--text); }
a { color: var(--ink-2); }
h1, h2, h3 { font-family: var(--head); color: var(--ink); line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 18px; font-weight: 700; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #D5E4E7; padding: 24px 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { padding: 0 24px 24px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand strong { display: block; font-family: var(--head); font-size: 22px; line-height: 1.15; color: #fff; }
.brand span { font-size: 13px; color: var(--sun); }
.side nav { padding: 16px 0; flex: 1; }
.side nav a { display: block; padding: 10px 24px; color: #BFD3D7; text-decoration: none; border-left: 4px solid transparent; font-weight: 500; }
.side nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side nav a.active { background: rgba(255,255,255,.1); color: #fff; border-left-color: var(--sun); }
.who { padding: 16px 24px 0; border-top: 1px solid rgba(255,255,255,.12); font-size: 13px; }
.who b { display: block; color: #fff; font-weight: 600; }
.who a { color: var(--sun); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; justify-content: flex-end; padding: 14px 32px; color: var(--muted); font-size: 13px; }
.content { padding: 8px 32px 32px; max-width: 1180px; width: 100%; flex: 1; }
.footer { padding: 20px 32px; color: var(--muted); font-size: 13px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; margin-bottom: 20px; }
.card h3 { margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.stat .lbl { color: var(--muted); font-size: 13px; }
.stat .n { font-family: var(--head); font-size: 26px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-variant-numeric: tabular-nums; margin-bottom: 8px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
th { background: #F8FAFB; color: var(--muted); font-weight: 600; font-size: 13px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, tr:hover > td { background: #FAFCFC; }
td form { margin: 0; }

form.inline { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; color: var(--muted); }
input, select { font: inherit; padding: 9px 10px; border: 1px solid #C3CFD3; border-radius: 6px; background: #fff; color: var(--text); min-height: 40px; }
input:focus, select:focus { border-color: var(--ink-2); }
button, .btn { font: inherit; font-weight: 600; background: var(--ink); color: #fff; border: 0; padding: 0 16px; min-height: 40px; display: inline-flex; align-items: center; border-radius: 6px; cursor: pointer; text-decoration: none; }
button:hover, .btn:hover { background: var(--ink-2); }
button:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: var(--neutral-bg); color: var(--ink); }
.btn.secondary:hover { background: #D5DFE2; }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 13px; }

.alert { background: var(--ok-bg); border: 1px solid #A9D9BE; color: #14452E; padding: 11px 14px; border-radius: 6px; margin-bottom: 18px; }
.alert.error { background: var(--bad-bg); border-color: #EFB4B1; color: #7C1D1C; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.green { background: var(--ok-bg); color: var(--ok); }
.badge.yellow { background: var(--warn-bg); color: var(--warn); }
.badge.red { background: var(--bad-bg); color: var(--bad); }
.badge.gray { background: var(--neutral-bg); color: var(--neutral); }

.page-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head p { margin: 0; color: var(--muted); }

.tape { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; margin-bottom: 20px; }
.tape-total { font-family: var(--head); font-size: 34px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.tape-sub { color: var(--muted); margin-bottom: 14px; }
.tape-bar { display: flex; height: 22px; border-radius: 4px; overflow: hidden; background: var(--neutral-bg); }
.tape-bar i { display: block; height: 100%; }
.tape-bar i + i { border-left: 2px solid #fff; }
.seg-ok { background: var(--ok); }
.seg-open { background: var(--sun); }
.seg-bad { background: var(--bad); }
.tape-key { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 14px; }
.tape-key div { font-size: 14px; }
.tape-key b { font-family: var(--head); font-size: 18px; display: block; font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }

.auth { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-brand { background: var(--ink); color: #D5E4E7; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-brand strong { font-family: var(--head); font-size: 26px; color: #fff; }
.auth-brand h2 { font-size: 40px; color: #fff; max-width: 14em; margin-bottom: 10px; }
.auth-brand p { max-width: 28em; margin: 0; }
.auth-brand .tag { color: var(--sun); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px; }
.auth-form form { width: 100%; max-width: 340px; }
.auth-form input { width: 100%; margin-bottom: 14px; }
.auth-form button { width: 100%; justify-content: center; background: var(--ink); }

.login { max-width: 380px; margin: 80px auto; }
.login input { width: 100%; margin-bottom: 14px; }

.receipt { max-width: 380px; margin: 16px auto; background: #fff; border: 1px solid var(--line); border-top: 6px solid var(--sun); padding: 24px; text-align: center; }
.receipt h3 { margin-bottom: 2px; }
.receipt p { color: var(--muted); margin: 0 0 12px; }
.receipt table { border: 0; border-radius: 0; }
.receipt td { border: 0; text-align: left; padding: 5px 0; background: none !important; }
.receipt td:last-child { text-align: right; }
.receipt img { margin: 14px 0 6px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: 16px 0 0; }
  .brand { padding: 0 20px 14px; }
  .side nav { display: flex; overflow-x: auto; padding: 0; }
  .side nav a { white-space: nowrap; border-left: 0; border-bottom: 4px solid transparent; padding: 12px 16px; }
  .side nav a.active { border-bottom-color: var(--sun); }
  .who { display: none; }
  .topbar, .content, .footer { padding-left: 16px; padding-right: 16px; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 28px; }
  .auth-brand h2 { font-size: 28px; }
}

@media print {
  .side, .topbar, .footer, .noprint { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
}

/* Icons */
.ic { width: 1.2em; height: 1.2em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button, .btn { gap: 8px; }
.side nav a { display: flex; align-items: center; gap: 12px; }
.side nav a .ic { width: 20px; height: 20px; opacity: .85; }
.side nav a.active .ic { color: var(--sun); opacity: 1; }
.who a { display: inline-flex; align-items: center; gap: 4px; }
.who .ic { width: 14px; height: 14px; }
h3 .ic { margin-right: 8px; color: var(--ink-2); vertical-align: -0.2em; }

.field { position: relative; margin-bottom: 14px; }
.field input { width: 100%; margin: 0; padding-left: 38px; }
.field .ic-l { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.field input[type=password], .field input.has-toggle { padding-right: 44px; }
form.inline .field { min-width: 220px; margin-bottom: 0; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); min-height: 32px; width: 36px; padding: 0; justify-content: center; background: transparent; color: var(--muted); border-radius: 6px; }
.pw-toggle:hover { background: var(--neutral-bg); color: var(--ink); }
.pw-toggle .ic-off { display: none; }
.pw-toggle.shown .ic-on { display: none; }
.pw-toggle.shown .ic-off { display: inline; }
.pw-toggle.shown { color: var(--ink); }
input[type=password]::-ms-reveal { display: none; }

.stat.has-ico { display: flex; align-items: center; gap: 14px; }
.ico { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.ico .ic { width: 22px; height: 22px; }
.ico.ok { background: var(--ok-bg); color: var(--ok); }
.ico.warn { background: var(--warn-bg); color: var(--warn); }
.ico.bad { background: var(--bad-bg); color: var(--bad); }
.ico.neutral { background: var(--neutral-bg); color: var(--neutral); }

.hero .lbl { display: flex; align-items: center; gap: 8px; }
.hero .lbl .ic { color: var(--sun); }
.auth-form h1 { display: flex; align-items: center; gap: 10px; }
.choice .ic { color: var(--ink-2); width: 20px; height: 20px; }

/* Keep the eye button small even inside forms whose buttons are full width */
.field .pw-toggle { width: 36px; min-height: 32px; padding: 0; background: transparent; color: var(--muted); justify-content: center; }
.field .pw-toggle:hover { background: var(--neutral-bg); color: var(--ink); }
.field .pw-toggle.shown { color: var(--ink); }

/* Icon-only buttons (delete inactive customer) */
.icon-btn { width: 36px; min-height: 36px; padding: 0; justify-content: center; background: var(--neutral-bg); color: var(--neutral); }
.icon-btn:hover { background: #D5DFE2; }
.icon-btn.danger { background: var(--bad-bg); color: var(--bad); }
.icon-btn.danger:hover { background: var(--bad); color: #fff; }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.icon-btn:disabled:hover { background: var(--neutral-bg); color: var(--neutral); }

/* Avatars, progress bars, who-cell */
.avatar { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--ink-2); color: #fff; font-family: var(--head); font-weight: 700; font-size: 15px; flex: none; }
.avatar.xs { width: 26px; height: 26px; font-size: 11px; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.lg { width: 84px; height: 84px; font-size: 30px; border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--line); }
.who-cell { display: inline-flex; align-items: center; gap: 10px; }
.muted { color: var(--muted); }

.progress { height: 12px; background: var(--neutral-bg); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ok); border-radius: 999px; min-width: 0; }
.progress-cell { min-width: 170px; }
.progress-cell .progress { height: 8px; margin-bottom: 4px; }
.progress-cell span { font-size: 12px; }

/* Keep long peso amounts inside the stat tiles */
.stat.has-ico { gap: 12px; padding: 14px 16px; min-width: 0; }
.stat.has-ico .ico { width: 40px; height: 40px; }
.stat.has-ico .n { font-size: 21px; white-space: nowrap; }
.stat.has-ico > div { min-width: 0; }

/* Email setup checklist */
.checklist { list-style: none; padding: 0; margin: 0 0 14px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .ic { margin-top: 2px; }
.checklist li.ok .ic { color: var(--ok); }
.checklist li.todo .ic { color: var(--bad); }
code { background: var(--neutral-bg); padding: 1px 6px; border-radius: 4px; font-size: 13px; }
