/* =========================================================
   MIS GASTOS DZD · EUR — Estilos
   Colores principales: cambia aquí y se aplica en toda la app.
   ========================================================= */
:root {
  --petrol: #0D3B46;
  --petrol-2: #14505E;
  --petrol-3: #1D6474;
  --gold: #E4AD55;
  --gold-soft: #FBF1DF;
  --ivory: #F8F5EF;
  --white: #FFFFFF;
  --ink: #15242B;
  --muted: #5E6C73;
  --faint: #8A969C;
  --line: #E9E3D8;
  --line-2: #F1ECE3;
  --green: #2E8A5F;
  --green-soft: #E5F3EB;
  --coral: #CC5B4A;
  --coral-soft: #FBEAE6;
  --blue: #3C6E8F;
  --blue-soft: #E6EFF5;
  --violet: #6D5BA8;
  --violet-soft: #EEEAF7;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(13,59,70,.05), 0 4px 16px rgba(13,59,70,.06);
  --shadow-lg: 0 10px 40px rgba(13,59,70,.18);
  --nav-h: 64px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --vvh: 100dvh;
  --vvt: 0px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ivory); min-height: 100%; }
body { overflow-x: hidden; -webkit-tap-highlight-color: transparent; font-size: 15px; line-height: 1.4; }
body.sheet-open { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.ico { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 16px; height: 16px; }
.ico.lg { width: 24px; height: 24px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.pos { color: var(--green); }
.neg { color: var(--coral); }
a { color: var(--petrol-3); }

/* ---------- Layout ---------- */
.app { min-height: 100dvh; }
.sidebar { display: none; }
.main { padding: calc(var(--sat) + 14px) calc(var(--sar) + 16px) calc(var(--nav-h) + var(--sab) + 24px) calc(var(--sal) + 16px); max-width: 1180px; margin: 0 auto; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 4px 0 16px; flex-wrap: wrap; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 0 0 2px; }
.page-title { font-size: 26px; font-weight: 750; letter-spacing: -.02em; margin: 0; color: var(--petrol); }

/* ---------- Bottom nav (móvil) ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: rgba(255,255,255,.96); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
  padding: 6px calc(var(--sar) + 4px) calc(var(--sab) + 6px) calc(var(--sal) + 4px);
  display: grid; grid-template-columns: 1fr 1fr 58px 1fr 1fr 1fr; align-items: end; column-gap: 2px;
}
.bn-item { background: none; border: 0; padding: 4px 0 2px; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--faint); font-size: 10px; font-weight: 600; min-width: 0; }
.bn-item span { white-space: nowrap; overflow: hidden; text-overflow: clip; max-width: 100%; letter-spacing: -.02em; }
@media (max-width: 380px) { .bn-item { font-size: 9.3px; } .bottom-nav { grid-template-columns: 1fr 1fr 54px 1fr 1fr 1fr; padding-left: calc(var(--sal) + 2px); padding-right: calc(var(--sar) + 2px); } }
.bn-item .ico { width: 22px; height: 22px; }
.bn-item.active { color: var(--petrol); }
.bn-item.active .ico { stroke-width: 2.2; }
.bn-item.active::after { content: ""; width: 4px; height: 4px; border-radius: 2px; background: var(--gold); margin-top: -1px; }
.bn-fab { justify-self: center; width: 52px; height: 52px; border-radius: 18px; border: 0; background: var(--petrol); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(13,59,70,.35); margin-bottom: 4px; transform: translateY(-6px); }
.bn-fab .ico { width: 26px; height: 26px; stroke-width: 2.2; }
.bn-fab:active { transform: translateY(-6px) scale(.96); }

/* ---------- Escritorio ---------- */
@media (min-width: 960px) {
  .bottom-nav { display: none; }
  .sidebar {
    display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: 236px;
    background: var(--petrol); color: #d5e3e6; padding: 22px 14px 18px;
  }
  .main { margin-left: 236px; padding: 26px 32px 40px; max-width: none; }
  .main > .wrap { max-width: 1160px; margin: 0 auto; }
  .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; }
  .brand-logo { width: 36px; height: 36px; border-radius: 11px; background: var(--gold); color: var(--petrol); display: grid; place-items: center; font-weight: 800; }
  .brand b { display: block; color: #fff; font-size: 15px; }
  .brand small { color: #9fbcc2; font-size: 11.5px; letter-spacing: .06em; }
  .side-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; color: #c3d6da; background: none; border: 0; font-weight: 600; font-size: 14px; width: 100%; text-align: left; position: relative; }
  .side-item:hover { background: rgba(255,255,255,.06); color: #fff; }
  .side-item.active { background: rgba(255,255,255,.1); color: #fff; }
  .side-item.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
  .side-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding-top: 14px; }
  .side-user { display: flex; align-items: center; gap: 10px; padding: 6px 8px 10px; }
  .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--petrol-3); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
  .side-user b { color: #fff; font-size: 13.5px; display: block; }
  .side-user small { color: #9fbcc2; font-size: 11.5px; }
  .page-title { font-size: 30px; }
}

/* ---------- Tarjetas ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.card-title { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.grid { display: grid; gap: 12px; }
.grid-2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .grid-2 { grid-template-columns: 1fr 1fr; gap: 16px; } }
.section { margin-top: 16px; }
@media (min-width: 960px) { .section { margin-top: 20px; } }

/* Acciones del dashboard */
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.actions.single { grid-template-columns: 1fr; }
.page-head .actions { width: 100%; }
.action {
  border: 1px solid var(--line); background: var(--white); border-radius: 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 12px 6px;
  font-weight: 650; font-size: 13.5px; color: var(--ink); min-width: 0;
}
.action .chip-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; }
.action.in .chip-ico { background: var(--green-soft); color: var(--green); }
.action.out .chip-ico { background: var(--coral-soft); color: var(--coral); }
.action:active { transform: scale(.98); }
.action .lbl-long { display: none; }
@media (min-width: 960px) {
  .actions { width: 100%; max-width: 640px; }
  .page-head .actions { width: auto; grid-template-columns: repeat(3, 196px); }
  .page-head .actions.single { grid-template-columns: 196px; }
  .action { flex-direction: row; justify-content: flex-start; padding: 10px 14px; gap: 10px; font-size: 14px; }
  .action .chip-ico { width: 34px; height: 34px; border-radius: 10px; }
  .action .lbl-short { display: none; }
  .action .lbl-long { display: inline; }
  .action:hover { border-color: #d9d0c1; }
}

/* Saldos */
.balance {
  background: linear-gradient(150deg, var(--petrol) 0%, #0F4552 60%, var(--petrol-2) 100%);
  color: #fff; border: 0; position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 18px;
}
.balance::after { content: ""; position: absolute; right: -40px; top: -40px; width: 150px; height: 150px; border-radius: 50%; border: 1px solid rgba(228,173,85,.25); }
.balance .b-label { font-size: 12.5px; font-weight: 650; letter-spacing: .05em; color: #b9d2d7; display: flex; align-items: center; gap: 8px; }
.balance .b-label .cur { margin-left: auto; font-size: 11px; font-weight: 800; letter-spacing: .1em; color: var(--petrol); background: var(--gold); border-radius: 6px; padding: 2px 7px; }
.balance .b-amount { font-size: 32px; font-weight: 760; letter-spacing: -.02em; margin: 6px 0 2px; overflow-wrap: anywhere; }
.balance .b-amount small { font-size: 16px; font-weight: 650; color: #b9d2d7; margin-left: 4px; }
.balance .b-sub { font-size: 13.5px; color: #cfe0e3; }
.balance .b-sub b { color: var(--gold); font-weight: 700; }
.balance .b-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.12); }
.balance .b-split div { min-width: 0; }
.balance .b-split span { display: block; font-size: 11.5px; color: #9fbcc2; letter-spacing: .04em; }
.balance .b-split b { font-size: 15.5px; font-weight: 680; overflow-wrap: anywhere; }
.balance .b-links { display: flex; gap: 8px; margin-top: auto; padding-top: 14px; flex-wrap: wrap; }
.btn-ghost-light { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); color: #fff; border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 600; display: inline-flex; gap: 7px; align-items: center; }
.btn-ghost-light:hover { background: rgba(255,255,255,.16); }
@media (min-width: 960px) { .balance .b-amount { font-size: 36px; } }

/* Resumen hoy / mes */
.sum-total { font-size: 26px; font-weight: 750; color: var(--petrol); letter-spacing: -.02em; }
.sum-label { font-size: 12.5px; color: var(--muted); }
.sum-rows { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; display: grid; gap: 6px; }
.sum-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.sum-row span:first-child { color: var(--muted); }
.sum-row b { font-weight: 650; text-align: right; }
.sum-row .eq { color: var(--muted); font-weight: 500; }

/* Movimientos */
.mv-list { display: flex; flex-direction: column; }
.mv-day { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; padding: 14px 4px 6px; }
.mv { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line-2); background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; min-width: 0; }
.mv:last-child { border-bottom: 0; }
.mv:hover { background: #fcfbf8; }
.mv-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.t-exp_dzd .mv-ico, .ti-exp_dzd { background: var(--coral-soft); color: var(--coral); }
.t-exp_eur .mv-ico, .ti-exp_eur { background: #FCEFE4; color: #C0702F; }
.t-exp_vir .mv-ico, .ti-exp_vir { background: var(--violet-soft); color: var(--violet); }
.t-dzd_buy .mv-ico, .ti-dzd_buy { background: var(--green-soft); color: var(--green); }
.t-eur_in .mv-ico, .ti-eur_in { background: #E3F1F1; color: #23797A; }
.t-transfer .mv-ico, .ti-transfer { background: var(--blue-soft); color: var(--blue); }
.mv-main { flex: 1; min-width: 0; }
.mv-title { font-weight: 650; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-fifo { font-size: 11.5px; color: var(--faint); }
.mv-amt { text-align: right; flex: none; max-width: 52%; }
@media (max-width: 420px) { .mv { gap: 10px; } .mv-ico { width: 36px; height: 36px; } .mv-amt b { font-size: 14px; } }
.mv-amt b { display: block; font-weight: 700; font-size: 14.5px; white-space: nowrap; }
.mv-amt small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; }
.mv-amt .internal { color: var(--blue); }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; letter-spacing: .02em; white-space: nowrap; }
.badge.gold { background: var(--gold-soft); color: #9A6A1E; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.coral { background: var(--coral-soft); color: var(--coral); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.grey { background: #EFEDEA; color: var(--muted); }

/* Filtros */
.filters { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.filters .search { grid-column: 1 / -1; }
.filters .custom-range { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 960px) {
  .filters { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .filters .search { grid-column: auto; }
  .filters.has-user { grid-template-columns: 2fr 1fr 1fr 1fr 1fr; }
}
.field-ico { position: relative; }
.field-ico .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.field-ico input { padding-left: 38px; }

/* Chips de periodo */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--white); border-radius: 20px; padding: 7px 13px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.chip.active { background: var(--petrol); border-color: var(--petrol); color: #fff; }

/* Formularios */
.form { display: grid; gap: 14px; }
.lbl { display: block; font-size: 12.5px; font-weight: 650; color: var(--muted); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; min-width: 0; border: 1px solid var(--line); background: var(--white); border-radius: var(--radius-sm);
  padding: 11px 12px; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235E6C73' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
input[type=date].input { min-height: 46px; }
.input:focus { border-color: var(--petrol-3); box-shadow: 0 0 0 3px rgba(29,100,116,.12); }
.input.big { font-size: 28px; font-weight: 700; padding: 10px 70px 10px 14px; letter-spacing: -.01em; }
.amount-wrap { position: relative; }
.amount-wrap .cur { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--muted); font-size: 15px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.hint.err { color: var(--coral); font-weight: 600; }
.hint.ok { color: var(--green); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.info { background: var(--gold-soft); color: #7D5718; border-radius: 12px; padding: 10px 12px; font-size: 13px; display: flex; gap: 8px; align-items: flex-start; }
.info.blue { background: var(--blue-soft); color: #2D5671; }
.info.coral { background: var(--coral-soft); color: #9C3F31; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg.two { grid-template-columns: 1fr 1fr; }
.seg button { border: 1px solid var(--line); background: var(--white); border-radius: 12px; padding: 9px 6px; text-align: center; min-width: 0; line-height: 1.2; }
.seg button b { display: block; font-size: 13.5px; font-weight: 700; }
.seg button small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.seg button.active { border-color: var(--petrol); background: var(--petrol); color: #fff; box-shadow: 0 3px 10px rgba(13,59,70,.2); }
.seg button.active small { color: #c4dade; }

.cat-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.cat-chip { border: 1px solid var(--line); background: var(--white); border-radius: 20px; padding: 8px 13px; font-size: 14px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-chip.active { background: var(--gold); border-color: var(--gold); color: var(--petrol); }
.cat-chip.inactive { border-style: dashed; color: var(--muted); }

.btn { border: 1px solid transparent; border-radius: 12px; padding: 11px 16px; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; }
.btn.primary { background: var(--petrol); color: #fff; }
.btn.primary:hover { background: var(--petrol-2); }
.btn.secondary { background: var(--white); border-color: var(--line); color: var(--ink); }
.btn.danger { background: var(--coral-soft); color: var(--coral); }
.btn.gold { background: var(--gold); color: var(--petrol); }
.btn.small { min-height: 36px; padding: 7px 12px; font-size: 13.5px; border-radius: 10px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.block { width: 100%; }
.icon-btn { border: 1px solid var(--line); background: var(--white); width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); flex: none; }
.icon-btn:hover { color: var(--ink); }
.link-btn { background: none; border: 0; color: var(--petrol-3); font-weight: 650; font-size: 13.5px; padding: 4px 0; display: inline-flex; align-items: center; gap: 4px; }

/* Interruptor */
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #D7D2C8; border-radius: 20px; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(18px); }

/* Listas de ajustes */
.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); min-width: 0; }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow b { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .grow small { color: var(--muted); font-size: 12.5px; }
.list-row.off .grow b { color: var(--faint); }

/* Lotes */
.lot { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 6px; }
.lot.next { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.lot-head { display: flex; align-items: center; gap: 10px; }
.lot-n { width: 28px; height: 28px; border-radius: 8px; background: var(--petrol); color: #fff; font-weight: 750; font-size: 13px; display: grid; place-items: center; flex: none; }
.lot-head b { flex: 1; min-width: 0; }
.lot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 13px; }
.lot-grid span { color: var(--muted); }
.bar { height: 6px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--gold); border-radius: 4px; }
.bar.petrol i { background: var(--petrol-3); }

/* Análisis */
.donut-wrap { display: grid; gap: 18px; align-items: center; }
@media (min-width: 760px) { .donut-wrap { grid-template-columns: 240px 1fr; } }
.donut { width: 100%; max-width: 210px; margin: 0 auto; display: block; }
.cat-row { display: grid; grid-template-columns: 12px 1fr auto; gap: 4px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; }
.cat-row:last-child { border-bottom: 0; }
.cat-row .dot { width: 10px; height: 10px; border-radius: 3px; }
.cat-row .name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-row .val { font-weight: 700; text-align: right; white-space: nowrap; }
.cat-row .bar { grid-column: 2 / 4; }
.cat-row .meta { grid-column: 2 / 4; font-size: 12px; color: var(--muted); }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.stat { background: var(--ivory); border-radius: 12px; padding: 10px; min-width: 0; }
.stat span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.stat b { display: block; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
@media (max-width: 420px) { .stats3 { grid-template-columns: 1fr; } .stat { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; } }

/* Recurrentes */
.rec { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.rec:last-child { border-bottom: 0; }
.rec .mv-main { min-width: 160px; }
.rec-actions { display: flex; gap: 6px; align-items: center; margin-left: auto; }
@media (max-width: 600px) { .rec-actions { width: 100%; margin-left: 52px; } .rec-actions .btn { flex: 1; } }
.alert-bar { display: flex; align-items: center; gap: 10px; background: var(--gold-soft); border: 1px solid #F1D9AE; color: #7D5718; border-radius: 14px; padding: 10px 14px; font-weight: 600; font-size: 14px; width: 100%; text-align: left; }

/* ---------- Hoja / modal ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(9,30,36,.45); z-index: 80; opacity: 0; transition: opacity .2s; }
.sheet-backdrop.show { opacity: 1; }
.sheet {
  position: fixed; z-index: 81; background: var(--white); display: flex; flex-direction: column;
  left: 0; right: 0; top: var(--vvt); height: var(--vvh); max-height: var(--vvh);
  transform: translateY(16px); opacity: 0; transition: transform .22s ease, opacity .22s ease;
}
.sheet.show { transform: none; opacity: 1; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: calc(var(--sat) + 12px) calc(var(--sar) + 16px) 12px calc(var(--sal) + 16px); border-bottom: 1px solid var(--line-2); flex: none; }
.sheet-head h2 { margin: 0; font-size: 18px; font-weight: 750; color: var(--petrol); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-head .t-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.sheet-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 16px calc(var(--sar) + 16px) 20px calc(var(--sal) + 16px); }
.sheet-foot { flex: none; display: flex; gap: 10px; padding: 10px calc(var(--sar) + 16px) calc(var(--sab) + 10px) calc(var(--sal) + 16px); border-top: 1px solid var(--line-2); background: var(--white); }
.sheet-foot .btn { flex: 1; }
.sheet-foot .btn.primary { flex: 2; }
body.kb .sheet-foot { padding-bottom: 10px; }
@media (min-width: 640px) {
  .sheet { left: 50%; right: auto; top: 50%; width: min(560px, 94vw); height: auto; max-height: min(88vh, calc(var(--vvh) - 24px)); border-radius: 20px; transform: translate(-50%, calc(-50% + 14px)); box-shadow: var(--shadow-lg); }
  .sheet.show { transform: translate(-50%, -50%); }
  .sheet.wide { width: min(720px, 94vw); }
  .sheet-head { padding: 16px 20px 12px; }
  .sheet-body { padding: 18px 20px 20px; }
  .sheet-foot { padding: 12px 20px 16px; border-radius: 0 0 20px 20px; }
  .sheet.confirm { width: min(420px, 94vw); }
}
.sheet.confirm .sheet-body { font-size: 14.5px; }
@media (max-width: 639px) {
  .sheet.confirm { top: auto; bottom: 0; height: auto; max-height: var(--vvh); border-radius: 20px 20px 0 0; }
  .sheet.confirm .sheet-head { padding-top: 16px; }
}

.detail-amount { font-size: 30px; font-weight: 760; letter-spacing: -.02em; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; margin-top: 12px; }
.kv span { color: var(--muted); }
.kv b { text-align: right; font-weight: 600; overflow-wrap: anywhere; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--sab) + 18px); transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; z-index: 100; opacity: 0; transition: .25s; max-width: calc(100vw - 32px); box-shadow: var(--shadow-lg); display: flex; gap: 8px; align-items: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--coral); }
@media (min-width: 960px) { .toast { bottom: 28px; left: calc(50% + 118px); } }

/* Login */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: calc(var(--sat) + 20px) 18px calc(var(--sab) + 20px); background: radial-gradient(1200px 600px at 20% -10%, #fff 0%, var(--ivory) 60%); }
.auth .card { width: min(400px, 100%); padding: 26px 22px; }
.auth-logo { width: 56px; height: 56px; border-radius: 16px; background: var(--petrol); color: var(--gold); display: grid; place-items: center; margin-bottom: 14px; }
.auth h1 { margin: 0 0 4px; color: var(--petrol); font-size: 24px; }

.empty { text-align: center; color: var(--muted); padding: 26px 10px; font-size: 14px; }
.more-btn { display: block; margin: 10px auto 0; }
.loading { min-height: 60vh; display: grid; place-items: center; color: var(--muted); }
