/* CalcNunta — stil de aplicație */
:root {
  --bg: #F3EEE6;
  --surface: #FFFDF9;
  --surface-2: #F8F3EC;
  --ink: #241F1B;
  --muted: #7B7067;
  --line: #E8DFD3;
  --track: #ECE4D9;
  --accent: #3E5A4A;
  --accent-2: #2F4A3B;
  --accent-ink: #FFFCF7;
  --accent-soft: #E1EAE3;
  --gold: #B8904F;
  --gold-soft: #F1E6D2;
  --danger: #B24A3D;
  --ok: #3F8158;
  --info: #4F82A6;
  --shadow: 0 1px 2px rgba(60, 40, 20, .05), 0 8px 24px -14px rgba(60, 40, 20, .25);
  --shadow-lg: 0 18px 40px -18px rgba(40, 28, 16, .45);
  --r: 22px; --r-sm: 14px;
  --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --nav-h: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12100E; --surface: #1D1A17; --surface-2: #24201C; --ink: #F2ECE4; --muted: #A79C91;
    --line: #332D28; --track: #2E2924; --accent: #8DB59A; --accent-2: #2A3D31; --accent-ink: #10190F; --accent-soft: #223028;
    --gold: #D6B37A; --gold-soft: #3A3022; --danger: #E58B7E; --ok: #86C59A; --info: #84B2D3;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 26px -16px rgba(0,0,0,.7);
    --shadow-lg: 0 18px 40px -16px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.45 var(--body); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

#splash { position: fixed; inset: 0; display: grid; place-items: center; background: var(--accent-2); z-index: 100; }
#splash svg { width: 64px; height: 64px; fill: none; stroke: #E9D3A8; stroke-width: 1.6; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.9); opacity: .6; } }

#app { max-width: 640px; margin: 0 auto; padding: 0 16px calc(var(--nav-h) + 40px + env(safe-area-inset-bottom)); }

/* ---------- app bar ---------- */
.appbar { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) 0 6px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mark { width: 32px; height: 32px; fill: none; stroke: var(--gold); stroke-width: 1.8; flex: none; }
.mark path { fill: var(--gold); stroke: none; }
.brand-name { display: block; font: 560 20px/1 var(--display); letter-spacing: -.01em; }
.brand-tag { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar-btn { height: 42px; border-radius: 21px; border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; gap: 8px; padding: 3px 14px 3px 3px; box-shadow: var(--shadow); font-weight: 800; font-size: 14px; color: var(--accent); flex: none; cursor: pointer; }
.avatar-btn .av { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; font-size: 13px; }
.avatar-btn .av .ic { width: 18px; height: 18px; }
.avatar-btn .av-lbl { font-size: 13px; color: var(--ink, inherit); white-space: nowrap; }
@media (max-width: 350px) { .avatar-btn { padding-right: 3px; } .avatar-btn .av-lbl { display: none; } }
.sync-dot { position: absolute; right: 0; top: calc(12px + env(safe-area-inset-top)); width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--bg); background: var(--muted); }
.sync-dot[data-s="local"] { display: none; }
.sync-dot[data-s="saved"] { background: var(--ok); }
.sync-dot[data-s="saving"] { background: var(--gold); }
.sync-dot[data-s="error"], .sync-dot[data-s="offline"] { background: var(--danger); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 2px 6px; }
.page-title { font: 400 34px/1.05 var(--display); letter-spacing: -.02em; margin: 0; }
.head-total { text-align: right; }
.head-total span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.head-total b { display: block; font: 560 22px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.head-total small { color: var(--muted); font-size: 12.5px; }

/* ---------- bottom nav ---------- */
.tabs {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 640px;
  display: grid; grid-template-columns: repeat(6, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
@media (min-width: 660px) { .tabs { bottom: 12px; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); width: calc(100% - 32px); } }
.tabs button { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 0 5px; font-size: 11px; font-weight: 700; color: var(--muted); border-radius: 14px; position: relative; }
.tabs button .ic { width: 23px; height: 23px; }
.tabs button.on { color: var(--accent); }
.tabs button.on::before { content: ''; position: absolute; top: 2px; width: 44px; height: 30px; border-radius: 15px; background: var(--accent-soft); z-index: -1; }
.tabs button.on .ic { stroke-width: 2; }

.fab { position: fixed; z-index: 29; right: max(16px, calc(50% - 304px)); bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 8px; height: 54px; padding: 0 20px 0 16px; border: 0; border-radius: 18px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 15px; box-shadow: var(--shadow-lg); }
.fab .ic { width: 22px; height: 22px; stroke-width: 2.2; }
.fab:active { transform: scale(.97); }
@media (min-width: 660px) { .fab { bottom: calc(var(--nav-h) + 30px); } }

/* ---------- hero ---------- */
.hero, .auth-top {
  position: relative; overflow: hidden; color: #FBF5EA;
  background: radial-gradient(120% 90% at 100% 0%, #5B7A63 0%, transparent 55%), linear-gradient(160deg, #3E5A4A 0%, #253A2E 100%);
}
.hero { border-radius: 28px; padding: 22px 22px 24px; margin: 10px 0 14px; box-shadow: var(--shadow-lg); }
.hero-rings { position: absolute; right: -60px; top: -50px; width: 240px; height: 240px; border-radius: 50%; border: 1.5px solid rgba(233, 211, 168, .35); pointer-events: none; }
.hero-rings::after { content: ''; position: absolute; inset: -1.5px; transform: translateX(-80px); border-radius: 50%; border: 1.5px solid rgba(233, 211, 168, .22); }
.hero-top { display: flex; justify-content: space-between; align-items: center; position: relative; }
.eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .16em; font-weight: 800; color: #E9D3A8; }
.hero-edit { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.08); color: #FBF5EA; display: grid; place-items: center; }
.hero-edit .ic { width: 17px; height: 17px; }
.hero-names { position: relative; font: 400 clamp(30px, 8.5vw, 40px)/1.05 var(--display); letter-spacing: -.02em; margin: 10px 0 4px; overflow-wrap: anywhere; }
.hero-date { position: relative; margin: 0; opacity: .8; font-size: 14px; text-transform: capitalize; }
.count { position: relative; display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.count b { font: 400 64px/0.9 var(--display); letter-spacing: -.03em; color: #F3E2BE; font-variant-numeric: tabular-nums; }
.count span { font-size: 14px; line-height: 1.25; opacity: .9; }
.count.today { font: 400 24px/1.2 var(--display); color: #F3E2BE; }
.hero-cta { position: relative; margin-top: 18px; display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 11px 18px; background: #F3E2BE; color: #253A2E; font-weight: 800; }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 4px; }
.tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 14px 6px 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.tile b { font-size: 13px; font-weight: 800; margin-top: 4px; }
.tile span { font-size: 11.5px; color: var(--muted); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.tile:active, .row:active { transform: scale(.99); }
@media (max-width: 380px) { .tiles { grid-template-columns: repeat(2, 1fr); } }

.chip { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; color: var(--tint); background: color-mix(in srgb, var(--tint) 15%, var(--surface)); }
.chip .ic { width: 21px; height: 21px; stroke-width: 1.8; }

/* ---------- cards & rows ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin: 12px 0; box-shadow: var(--shadow); }
.card.list { padding: 14px 0 4px; overflow: hidden; }
#glist { padding: 0; }
#glist > .row:first-child { border-top: 0; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 0 18px 8px; }
.card:not(.list) > .card-h { padding: 0 0 8px; }
.card-h .h2 { margin: 0; flex: 1; }
.card-h .sum { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent); white-space: nowrap; }
.card-h .chip { width: 34px; height: 34px; border-radius: 11px; }
.card-h .chip .ic { width: 18px; height: 18px; }
.h2 { font: 560 18px/1.2 var(--display); margin: 0 0 12px; letter-spacing: -.005em; }
.sum.neg, .neg { color: var(--danger) !important; }
.ok { color: var(--ok) !important; }

.row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 18px; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; min-height: 62px; }
button.row:hover, .row .as-btn:hover { background: var(--surface-2); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-variant-numeric: tabular-nums; }
.row-right b { font-weight: 800; white-space: nowrap; }
.row-right small { font-size: 12px; color: var(--muted); white-space: nowrap; font-weight: 600; }
.row-go { color: var(--muted); width: 18px; height: 18px; }
.as-btn { border: 0; background: transparent; text-align: left; padding: 4px 0; border-radius: 8px; }
.row.task { padding: 8px 18px; }
.row.task.done .row-title { text-decoration: line-through; color: var(--muted); font-weight: 600; }
.tick { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; color: transparent; flex: none; transition: .15s; }
.tick .ic { width: 16px; height: 16px; stroke-width: 2.6; }
.tick.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 800; font-size: 14px; color: var(--tint); background: color-mix(in srgb, var(--tint) 16%, var(--surface)); }
.avatar.lg { width: 52px; height: 52px; font-size: 17px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; color: var(--pc); background: color-mix(in srgb, var(--pc) 14%, var(--surface)); white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-n { font-size: 12px; font-weight: 800; color: var(--muted); }
.add { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--accent); font-weight: 800; padding: 14px 18px 12px; text-align: left; font-size: 15px; }
.add .ic { width: 18px; height: 18px; stroke-width: 2.2; }
.link { border: 0; background: transparent; color: var(--accent); font-weight: 800; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; padding: 4px 0; }
.link .ic { width: 16px; height: 16px; }
.link.center { align-self: center; margin: 0 auto; display: flex; }
.empty-line { color: var(--muted); padding: 14px 18px; margin: 0; border-top: 1px solid var(--line); font-size: 14px; }
.note { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.note.center { text-align: center; margin: 12px 0 0; }

/* ---------- donut + legend ---------- */
.split { display: flex; align-items: center; gap: 20px; }
.donut { position: relative; width: var(--s); height: var(--s); flex: none; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 18px; }
.donut-c b { font: 560 26px/1 var(--display); font-variant-numeric: tabular-nums; }
.donut-c b.sm { font-size: 17px; }
.donut-c small { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 3px; }
.legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; display: grid; gap: 9px; }
.legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 0 8px; font-size: 13.5px; min-width: 0; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend span { min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend b { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 460px) {
  .split { gap: 14px; }
  .legend li { grid-template-columns: 10px minmax(0, 1fr); }
  .legend li b { grid-column: 2; font-size: 14px; }
}
.legend .lg-note { color: var(--muted); font-size: 12.5px; padding-top: 6px; border-top: 1px dashed var(--line); display: block; }
.legend em { font-style: normal; font-weight: 700; }
@media (max-width: 360px) { .split { flex-direction: column; align-items: stretch; } .split .donut { margin: 0 auto; } }

/* ---------- stats ---------- */
.glance { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.glance div { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 6px; text-align: center; box-shadow: var(--shadow); }
.glance b { display: block; font: 560 22px/1.1 var(--display); font-variant-numeric: tabular-nums; color: var(--accent); }
.glance span { font-size: 11.5px; color: var(--muted); display: block; margin-top: 2px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat-grid div { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); }
.stat-grid span { display: block; font-size: 12.5px; color: var(--muted); }
.stat-grid b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; margin-top: 2px; font-weight: 800; }
.vendor-strip { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 12px 2px 0; font-size: 13px; font-weight: 700; color: var(--muted); }

/* ---------- stepper ---------- */
.stepper-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.stepper-row + .stepper-row { border-top: 1px solid var(--line); }
.sr-label { font-weight: 700; }
.sr-hint { font-size: 12.5px; color: var(--muted); }
.stepper { display: flex; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; flex: none; }
.stepper button { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: var(--shadow); font-size: 22px; line-height: 1; color: var(--accent); }
.stepper button:active { transform: scale(.92); }
.stepper input { width: 60px; text-align: center; border: 0; background: transparent; font: 560 21px/1 var(--display); font-variant-numeric: tabular-nums; padding: 0; }
.stepper input:focus { outline: none; }

/* ---------- fields ---------- */
.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.field input, .select select, .search input {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface-2); font-size: 16px; font-variant-numeric: tabular-nums;
  appearance: none; -webkit-appearance: none;
}
.field input:focus, .select select:focus, .search input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; border-color: transparent; background: var(--surface); }
.money-in { display: flex; }
.money-in input { border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 0; }
.cur { min-width: 56px; border: 1px solid var(--line); border-left: 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; padding: 0 10px; }
.cur.static { background: var(--surface-2); color: var(--muted); }
button.cur::after { content: '⇄'; font-size: 11px; margin-left: 4px; opacity: .7; }
.select { position: relative; }
.select .ic { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); width: 18px; height: 18px; }
.select select { padding-right: 38px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; align-items: end; }
@media (max-width: 340px) { .grid2 { grid-template-columns: 1fr; } }
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 5px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--muted); min-height: 38px; line-height: 1.15; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.card > .seg { margin-bottom: 14px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 4px 0 14px; cursor: pointer; }
.switch-row span { display: flex; flex-direction: column; }
.switch-row small { color: var(--muted); font-size: 12.5px; }
.switch { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 999px; background: var(--track); position: relative; flex: none; cursor: pointer; transition: .2s; border: 0; margin: 0; }
.switch::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: .2s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }

.toolbar { display: flex; gap: 10px; align-items: center; margin: 12px 0 0; flex-wrap: wrap; }
.toolbar .seg { flex: 0 0 auto; }
.search { flex: 1 1 180px; position: relative; }
.search .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.search input { padding-left: 40px; background: var(--surface); border-radius: 999px; min-height: 44px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); font-weight: 800; font-size: 15px; text-decoration: none; color: var(--ink); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; }
.btn .ic { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; }
.actions-row { display: flex; gap: 10px; margin: 16px 0; }
.actions-row .btn { flex: 1; }

/* ---------- budget ---------- */
.meter { height: 10px; border-radius: 999px; background: var(--track); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .3s; }
.meter.over i { background: var(--danger); }
.meter-msg { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.meter-msg.neg { font-weight: 700; }
.gift-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.gift-total b { color: var(--ink); font-size: 18px; font-variant-numeric: tabular-nums; }
.balance { padding: 14px 16px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.balance.neg { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }
.shop { margin: 0; padding: 0 18px 8px; list-style: none; }
.shop li { padding: 10px 0; border-top: 1px dashed var(--line); font-variant-numeric: tabular-nums; font-size: 14.5px; }

/* ---------- empty state ---------- */
.empty { text-align: center; padding: 40px 20px; }
.empty-art { width: 92px; height: 92px; margin: 0 auto 16px; border-radius: 30px; display: grid; place-items: center; background: color-mix(in srgb, #C9607E 14%, var(--surface)); color: #C9607E; }
.empty-art .ic { width: 44px; height: 44px; stroke-width: 1.4; }
.empty h2 { font: 400 24px/1.2 var(--display); margin: 0 0 8px; }
.empty p { color: var(--muted); margin: 0 auto 20px; max-width: 34ch; }

/* ---------- bottom sheet ---------- */
.sheet-dlg { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 640px; max-height: 92vh; background: transparent; color: var(--ink); }
.sheet-dlg[open] { animation: up .28s cubic-bezier(.2, .9, .3, 1); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-dlg::backdrop { background: rgba(20, 14, 10, .45); backdrop-filter: blur(2px); }
.sheet { background: var(--surface); border-radius: 26px 26px 0 0; padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; }
@media (min-width: 660px) { .sheet-dlg { margin: auto; max-width: 520px; } .sheet { border-radius: 26px; } }
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet-h { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sheet-h h2 { font: 560 21px/1.2 var(--display); margin: 0; overflow-wrap: anywhere; }
.sheet-h p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.sheet-big { display: flex; flex-direction: column; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); margin-bottom: 16px; }
.sheet-big span { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.sheet-big b { font: 560 28px/1.15 var(--display); font-variant-numeric: tabular-nums; }
.sheet-big small { color: var(--muted); font-weight: 700; }
.sheet .stepper-row { padding: 6px 0 12px; }
.sheet .stepper-row + .stepper-row { padding-top: 12px; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.sheet-actions .btn { flex: 1 1 auto; }
.sheet-actions .btn.primary { flex: 2 1 140px; }
.sub-h { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 20px 0 10px; }
.acct { padding: 14px 16px; border-radius: 16px; background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; }
.acct span, .acct small { color: var(--muted); font-size: 13px; }
.acct p { margin: 0 0 10px; color: var(--muted); font-size: 14px; }

/* ---------- auth ---------- */
#auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; max-width: 520px; margin: 0 auto; }
.auth-top { padding: calc(54px + env(safe-area-inset-top)) 28px 70px; text-align: center; }
@media (min-width: 560px) { .auth-top { border-radius: 0 0 36px 36px; } }
.auth-mark { width: 64px; height: 64px; fill: none; stroke: #E9D3A8; stroke-width: 1.5; position: relative; }
.auth-mark path { fill: #E9D3A8; stroke: none; }
.auth-top h1 { font: 400 40px/1 var(--display); margin: 10px 0 6px; letter-spacing: -.02em; position: relative; }
.auth-tag { margin: 0; color: #F3E2BE; font-weight: 700; position: relative; }
.auth-pitch { margin: 10px auto 0; max-width: 32ch; opacity: .8; font-size: 14.5px; position: relative; }
.lang-btn { position: absolute; right: 16px; top: calc(14px + env(safe-area-inset-top)); height: 36px; min-width: 44px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #FBF5EA; font-size: 13px; font-weight: 800; z-index: 1; }
.auth-card { position: relative; margin: -42px 16px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: 18px 18px 20px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.auth-card .seg { margin-bottom: 16px; }
.auth-card .btn.wide + .btn.wide { margin-top: 10px; }
.auth-msg { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 600; }
.auth-msg.err { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }
.auth-card .link.center { margin-top: 10px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 14px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- plăți cu dată ---------- */
.pays { border: 1px solid var(--line); border-radius: 18px; padding: 14px 14px 4px; margin: 2px 0 16px; background: var(--surface-2); }
.pays-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.pays-h span { font-weight: 800; }
.pays-h small { color: var(--muted); font-weight: 700; font-size: 13px; }
.pays-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.pays-list li { display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.pays-list .pd { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 600; }
.pays-list .pd .ic { width: 17px; height: 17px; }
.pays-list b { color: var(--ok); font-variant-numeric: tabular-nums; }
.pdel { width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: grid; place-items: center; }
.pdel:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.pdel .ic { width: 17px; height: 17px; }
.mail-row { margin-top: 12px; padding: 12px 0 2px; border-top: 1px dashed var(--line); }
.pays-none { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.pay-add { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; align-items: end; }
.pay-add .btn { grid-column: 1 / -1; margin-bottom: 12px; }
.pay-add .field input { background: var(--surface); }

/* ---------- premium ---------- */
.lk { width: 14px; height: 14px; vertical-align: -2px; opacity: .65; margin-left: 2px; }
.icon-btn { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--accent); box-shadow: var(--shadow); }
.pay-hero { text-align: center; padding: 6px 4px 14px; }
.pay-star { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 22px; display: grid; place-items: center; color: #7A5A22; background: linear-gradient(145deg, #F6E7C6, #E2C28A); box-shadow: var(--shadow); }
.pay-star .ic { width: 32px; height: 32px; fill: currentColor; stroke-width: 1.2; }
.pay-hero h2 { font: 400 28px/1.1 var(--display); margin: 0 0 6px; }
.pay-hero p { margin: 0 auto; color: var(--muted); max-width: 34ch; }
.pay-list { list-style: none; margin: 0 0 16px; padding: 14px 16px; border-radius: 18px; background: var(--surface-2); display: grid; gap: 10px; }
.pay-list li { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 15px; }
.pay-list .ic { width: 20px; height: 20px; color: var(--ok); stroke-width: 2.4; margin-top: 1px; }
.pay-price { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin-bottom: 14px; }
.pay-price b { font: 560 32px/1 var(--display); }
.pay-price span { color: var(--muted); font-size: 13.5px; }
.btn.gold { background: linear-gradient(145deg, #C9A25E, #A7813F); color: #fff; }
.btn.gold .ic { fill: currentColor; }
.sheet .btn.ghost.wide { margin-top: 8px; color: var(--muted); border-color: transparent; }
.plan { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 10px; padding: 14px 16px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line)); background: color-mix(in srgb, var(--gold) 10%, var(--surface)); text-align: left; }
.plan > .ic:first-child { color: var(--gold); fill: currentColor; width: 22px; height: 22px; }
.plan span { flex: 1; display: flex; flex-direction: column; }
.plan small { color: var(--muted); font-size: 13px; }
.plan.on b { color: var(--gold); }

#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; transition: .25s; z-index: 200; max-width: calc(100% - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#print { display: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- print / PDF ---------- */
@media print {
  @page { margin: 16mm 14mm; }
  body { background: #fff; color: #1d1915; font-size: 11pt; }
  #app, #auth, dialog, #toast, #splash { display: none !important; }
  #print { display: block; }
  #print header { border-bottom: 1.5pt solid #3E5A4A; padding-bottom: 10pt; margin-bottom: 12pt; }
  #print .p-brand { font: 700 10pt var(--body); letter-spacing: .14em; text-transform: uppercase; color: #A9844F; }
  #print h1 { font: 400 26pt/1.1 var(--display); margin: 4pt 0; }
  #print header p { margin: 0; color: #6d625a; }
  #print h2 { font: 560 13pt var(--display); margin: 16pt 0 6pt; color: #3E5A4A; }
  .p-totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8pt; }
  .p-totals div { border: 1pt solid #e2d8cb; border-radius: 6pt; padding: 7pt 9pt; }
  .p-totals span { display: block; font-size: 8.5pt; color: #6d625a; }
  .p-totals b { font-size: 13pt; }
  #print table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
  #print th { text-align: left; font-size: 8.5pt; color: #6d625a; border-bottom: 1pt solid #cfc3b4; padding: 4pt; }
  #print td { border-bottom: .5pt solid #e7ded2; padding: 4pt; }
  #print .n { text-align: right; white-space: nowrap; }
  #print tr { break-inside: avoid; }
  .p-foot p { margin: 3pt 0; }
  .p-rate { color: #6d625a; font-size: 9pt; }
}

/* tab „Cont” + etichete mai înguste pe telefon */
@media (max-width: 400px) { .tabs button { font-size: 10px; } .tabs button .ic { width: 22px; height: 22px; } }

/* câmp de dată zi.lună.an */
.date-in { position: relative; }
.date-in .dmy { padding-right: 46px; }
.date-in .dmy.bad { border-color: var(--danger); outline-color: var(--danger); }
.date-in .dnat { position: absolute; left: 12px; bottom: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.date-btn { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.date-btn:hover { color: var(--accent); background: var(--accent-soft); }

/* explicații la sarcini */
.row-title .ic.ti { width: 15px; height: 15px; margin-left: 6px; vertical-align: -2px; color: var(--muted); }
.info-box { background: var(--accent-soft); border-radius: 14px; padding: 12px 14px; margin: 0 0 14px; font-size: 13.5px; line-height: 1.5; }
.info-box b { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--accent); margin-bottom: 4px; }
.info-box b .ic { width: 16px; height: 16px; }
.info-box p { margin: 4px 0 0; }

/* acord GDPR */
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: var(--muted); margin: 0 0 14px; cursor: pointer; }
.consent input { width: 20px; height: 20px; flex: none; margin: 1px 0 0; accent-color: var(--accent); }
.consent a, .auth-card .note a { color: var(--accent); font-weight: 700; }

/* ștergerea contului */
.link.danger-link { color: var(--danger); font-size: 13.5px; margin-top: 18px; }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: transparent; }
.info-box.warn { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }

/* activare cu cod Gumroad */
.lic { margin: 14px 0 4px; }
.lic .note { margin-bottom: 8px; }
.lic-row { display: flex; gap: 8px; }
.lic-row input { flex: 1; min-width: 0; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2, var(--surface)); padding: 0 12px; font: 600 14px/1 var(--body); color: var(--ink); letter-spacing: .02em; }
