/* ================================================================
   Contas — premium iOS-style dark theme
   Target: iPhone 17 Pro (safe-area insets), mobile-first.
================================================================ */

:root {
    --bg: #050506;
    --bg-elev: #0f0f14;
    --surface: rgba(255, 255, 255, 0.06);
    --surface-strong: rgba(255, 255, 255, 0.09);
    --surface-hover: rgba(255, 255, 255, 0.12);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);

    --text: rgba(255, 255, 255, 0.96);
    --text-soft: rgba(255, 255, 255, 0.62);
    --text-muted: rgba(255, 255, 255, 0.42);

    --violet: #8B5CF6;
    --indigo: #6366F1;
    --blue: #3B82F6;
    --green: #30D158;
    --green-soft: rgba(48, 209, 88, 0.14);
    --amber: #F59E0B;
    --red: #FF453A;
    --red-soft: rgba(255, 69, 58, 0.16);

    --grad-primary: linear-gradient(135deg, #8B5CF6 0%, #3B82F6 100%);
    --grad-balance: linear-gradient(155deg, #1A1A28 0%, #0B0B12 100%);
    --grad-glass:   linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.55);
    --shadow-glow: 0 8px 30px rgba(139, 92, 246, 0.35);

    --ease: cubic-bezier(0.22, 1, 0.36, 1);

    --safe-top:    env(safe-area-inset-top);
    --safe-bottom: env(safe-area-inset-bottom);
    --safe-left:   env(safe-area-inset-left);
    --safe-right:  env(safe-area-inset-right);
}

/* ---------------- reset ---------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
                 "Segoe UI", Roboto, Inter, system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
}
body {
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(139, 92, 246, 0.22), transparent 60%),
        radial-gradient(1000px 500px at 110% 10%, rgba(59, 130, 246, 0.18), transparent 60%),
        var(--bg);
}
button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
input, textarea, select {
    font-family: inherit;
    font-size: 16px; /* iOS won't zoom in on focus */
    color: var(--text);
}

/* ---------------- layout primitives ---------------- */
.screen { display: none; min-height: 100vh; min-height: 100dvh; }
.screen.is-active { display: block; }
.screen:not(.is-active) { display: none !important; }

/* ================================================================
   LOGIN SCREEN
================================================================ */
.screen--login {
    position: relative;
    min-height: 100dvh;
    padding: calc(var(--safe-top) + 40px) 24px calc(var(--safe-bottom) + 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.login__bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.login__glow {
    position: absolute;
    width: 520px; height: 520px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.55;
}
.login__glow--1 { top: -160px; left: -120px; background: radial-gradient(closest-side, #8B5CF6, transparent); }
.login__glow--2 { bottom: -180px; right: -140px; background: radial-gradient(closest-side, #3B82F6, transparent); }

.login__card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    padding: 32px 24px;
    background: rgba(12, 12, 18, 0.72);
    backdrop-filter: blur(30px) saturate(140%);
    -webkit-backdrop-filter: blur(30px) saturate(140%);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}
.login__brand {
    text-align: center;
    margin-bottom: 28px;
}
.login__logo {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    display: grid; place-items: center;
    border-radius: 18px;
    background: var(--grad-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}
.login__title {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.login__subtitle {
    margin: 0;
    color: var(--text-soft);
    font-size: 14px;
}
.login__form { display: flex; flex-direction: column; gap: 14px; }
.login__error {
    margin: 4px 0 -4px;
    padding: 10px 14px;
    font-size: 13px;
    color: #FFBBB7;
    background: var(--red-soft);
    border: 1px solid rgba(255, 69, 58, 0.3);
    border-radius: var(--radius-md);
}

/* ================================================================
   FIELDS / INPUTS
================================================================ */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.field__label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-soft);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding-left: 4px;
}
.field input,
.field textarea,
.field select {
    width: 100%;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
    outline: none;
}
.field input::placeholder,
.field textarea::placeholder {
    color: var(--text-muted);
}
.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: var(--indigo);
    background: var(--surface-strong);
}
.field textarea {
    resize: none;
    min-height: 68px;
}
/* hide native calendar icon tint on iOS */
.field input[type="date"] {
    color: var(--text);
    color-scheme: dark;
}

/* ================================================================
   BUTTONS
================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.01em;
    transition: transform 0.12s var(--ease), filter 0.18s var(--ease), background 0.18s var(--ease);
    user-select: none;
    -webkit-user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn--lg { padding: 16px 20px; font-size: 16px; }
.btn--primary {
    background: var(--grad-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}
.btn--primary:active { filter: brightness(0.9); }
.btn--ghost-danger {
    margin-top: 8px;
    color: var(--red);
    background: var(--red-soft);
    border: 1px solid rgba(255, 69, 58, 0.22);
}
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.btn__spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* small round icon button */
.icon-btn {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text);
    transition: background 0.18s var(--ease), transform 0.12s var(--ease);
}
.icon-btn:active { transform: scale(0.92); background: var(--surface-hover); }

/* ================================================================
   APP HEADER
================================================================ */
.app-header {
    position: relative;
    padding: calc(var(--safe-top) + 16px) 20px 20px;
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.10), transparent 70%);
}
.app-header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.greet { display: flex; flex-direction: column; line-height: 1.15; }
.greet__hi { font-size: 13px; color: var(--text-soft); }
.greet__name { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }

.month-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 18px;
}
.month-nav__btn {
    width: 36px; height: 36px;
    display: grid; place-items: center;
    color: var(--text-soft);
    border-radius: 50%;
    transition: background 0.18s var(--ease);
}
.month-nav__btn:active { background: var(--surface); }
.month-nav__label {
    font-size: 16px;
    font-weight: 600;
    min-width: 150px;
    text-align: center;
    text-transform: capitalize;
    letter-spacing: -0.01em;
}

/* ---------- balance card ---------- */
.balance-card {
    padding: 22px 22px 18px;
    background: var(--grad-balance);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
}
.balance-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(600px 180px at 90% -20%, rgba(139, 92, 246, 0.28), transparent 60%);
    pointer-events: none;
}
.balance-card__label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-soft);
}
.balance-card__amount {
    margin-top: 4px;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.1;
    background: linear-gradient(180deg, #fff, rgba(255,255,255,0.72));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.balance-card__progress {
    margin-top: 18px;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}
.balance-card__progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green), #34D399);
    border-radius: inherit;
    transition: width 0.5s var(--ease);
}
.balance-card__meta {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.balance-card__meta-item { flex: 1; display: flex; flex-direction: column; }
.balance-card__meta-label { font-size: 11px; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.08em; }
.balance-card__meta-value { font-size: 15px; font-weight: 600; }
.balance-card__meta-divider { width: 1px; height: 28px; background: var(--border); }

.balance-card__saldo {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}
.balance-card__saldo-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.balance-card__saldo-label {
    font-size: 11px;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.balance-card__saldo-value {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.balance-card__saldo-item--net { text-align: right; align-items: flex-end; }
.balance-card__saldo-value.is-positive { color: #34D399; }
.balance-card__saldo-value.is-negative { color: #FB7185; }

/* The salary is now editable, so it is a real button — styled to stay flush
   with the static item beside it. */
.balance-card__saldo-item--action {
    appearance: none;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
}
.balance-card__saldo-item--action:active { opacity: 0.6; }
.balance-card__saldo-item--action .balance-card__saldo-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.balance-card__edit-icon { opacity: 0.55; flex: none; }

/* ================================================================
   MAIN LIST
================================================================ */
.app-main {
    padding: 12px 16px calc(var(--safe-bottom) + 120px);
}
.segmented {
    display: flex;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 14px;
}
.segmented__btn {
    flex: 1;
    padding: 8px 10px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
    transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.segmented__btn.is-active {
    background: var(--surface-hover);
    color: var(--text);
    box-shadow: 0 1px 0 rgba(255,255,255,0.07) inset;
}

.bills-list { display: flex; flex-direction: column; gap: 10px; }

/* ---------- period header (1st/2nd half of month) ---------- */
.period-header {
    display: grid;
    grid-template-columns: 4px 1fr auto;
    align-items: center;
    gap: 12px;
    margin: 14px 2px 2px;
    padding: 4px 0;
}
.period-header:first-child { margin-top: 4px; }
.period-header__bar {
    width: 4px;
    height: 28px;
    border-radius: 999px;
}
.period-header__text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.period-header__title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.period-header__range {
    font-size: 11px;
    color: var(--text-soft);
    margin-top: 2px;
}
.period-header__total {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}
.period-header__numbers {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    text-align: right;
    line-height: 1.2;
}
.period-header__salary {
    font-size: 10px;
    color: var(--text-soft);
    letter-spacing: 0.02em;
}
.period-header__saldo {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.period-header__saldo.is-positive { color: #34D399; }
.period-header__saldo.is-negative { color: #FB7185; }

.period-empty {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-soft);
    font-size: 13px;
}
.period-empty__icon { font-size: 18px; }
.period-empty__text { font-weight: 500; }
.period-empty--first  { border-left: 3px solid rgba(139, 92, 246, 0.5); }
.period-empty--second { border-left: 3px solid rgba(45, 212, 191, 0.5); }
.period-header--first .period-header__bar {
    background: linear-gradient(180deg, #8B5CF6 0%, #6366F1 100%);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.5);
}
.period-header--first .period-header__title { color: #C4B5FD; }
.period-header--second .period-header__bar {
    background: linear-gradient(180deg, #2DD4BF 0%, #10B981 100%);
    box-shadow: 0 0 12px rgba(45, 212, 191, 0.45);
}
.period-header--second .period-header__title { color: #6EE7B7; }

/* ---------- bill card ---------- */
.bill {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 14px 14px 14px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: background 0.2s var(--ease), border-color 0.2s var(--ease),
                transform 0.15s var(--ease), opacity 0.3s var(--ease);
    position: relative;
    overflow: hidden;
}
.bill::before {
    content: "";
    position: absolute;
    left: 0; top: 10%; bottom: 10%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: transparent;
    transition: background 0.2s var(--ease);
}
.bill--period-first::before {
    background: linear-gradient(180deg, #8B5CF6 0%, #6366F1 100%);
}
.bill--period-second::before {
    background: linear-gradient(180deg, #2DD4BF 0%, #10B981 100%);
}
.bill:active { transform: scale(0.985); background: var(--surface-strong); }
.bill.is-paid {
    background: rgba(48, 209, 88, 0.08);
    border-color: rgba(48, 209, 88, 0.26);
}
.bill.is-overdue:not(.is-paid) {
    border-color: rgba(255, 69, 58, 0.32);
}

.bill__avatar {
    width: 44px; height: 44px;
    display: grid; place-items: center;
    border-radius: 14px;
    background: var(--grad-glass);
    border: 1px solid var(--border);
    font-size: 20px;
}
.bill.is-paid .bill__avatar {
    background: var(--green-soft);
    border-color: rgba(48, 209, 88, 0.32);
}

.bill__body { min-width: 0; }
.bill__name {
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bill__meta {
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-soft);
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.bill__badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(59, 130, 246, 0.14);
    color: #93C5FD;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}
.bill.is-overdue:not(.is-paid) .bill__meta .due {
    color: #FCA5A5;
    font-weight: 600;
}

.bill__right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.bill__amount {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.01em;
    color: var(--text);
}
.bill.is-paid .bill__amount {
    color: var(--text-soft);
    text-decoration: line-through;
    text-decoration-color: rgba(255,255,255,0.3);
}

.bill__check {
    flex-shrink: 0;
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 1.8px solid rgba(255,255,255,0.24);
    display: grid; place-items: center;
    transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.15s var(--ease);
}
.bill__check:active { transform: scale(0.85); }
.bill__check svg { opacity: 0; transition: opacity 0.15s var(--ease); }
.bill.is-paid .bill__check {
    background: var(--green);
    border-color: var(--green);
}
.bill.is-paid .bill__check svg { opacity: 1; }

/* ---------- empty / skeleton ---------- */
.empty-state {
    text-align: center;
    padding: 56px 20px;
    color: var(--text-soft);
}
.empty-state__icon {
    width: 72px; height: 72px;
    margin: 0 auto 14px;
    display: grid; place-items: center;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.empty-state__title { margin: 6px 0 4px; font-size: 16px; color: var(--text); }
.empty-state__text { margin: 0; font-size: 13px; }

.skeleton { display: flex; flex-direction: column; gap: 10px; }
.skeleton__row {
    height: 72px;
    border-radius: var(--radius-lg);
    background: linear-gradient(90deg,
        rgba(255,255,255,0.04) 0%,
        rgba(255,255,255,0.09) 50%,
        rgba(255,255,255,0.04) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ================================================================
   FLOATING ACTION BUTTON
================================================================ */
.fab {
    position: fixed;
    right: calc(var(--safe-right) + 20px);
    bottom: calc(var(--safe-bottom) + 24px);
    width: 60px; height: 60px;
    border-radius: 50%;
    background: var(--grad-primary);
    color: white;
    display: grid; place-items: center;
    box-shadow: 0 14px 36px rgba(59, 130, 246, 0.4), 0 0 0 1px rgba(255,255,255,0.08) inset;
    transition: transform 0.15s var(--ease), filter 0.18s var(--ease);
    z-index: 20;
}
.fab:active { transform: scale(0.92); filter: brightness(0.95); }

/* ================================================================
   BOTTOM SHEETS
================================================================ */
.sheet {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    align-items: end;
}
.sheet[hidden],
[hidden] {
    display: none !important;
}
.sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: fade-in 0.25s var(--ease);
}
.sheet__panel {
    position: relative;
    background: #121218;
    border-top-left-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-xl);
    border-top: 1px solid var(--border-strong);
    padding: 10px 20px calc(var(--safe-bottom) + 24px);
    max-height: 85dvh;
    overflow-y: auto;
    animation: slide-up 0.32s var(--ease);
    box-shadow: 0 -30px 60px rgba(0,0,0,0.5);
}
.sheet__panel--tall { min-height: 70dvh; }
.sheet__handle {
    width: 40px; height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 999px;
    margin: 6px auto 14px;
}
.sheet__title {
    margin: 0 0 14px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
}
.sheet__header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 16px;
}
.sheet__header .sheet__title { margin: 0; }
.sheet__cancel { justify-self: start; color: var(--text-soft); font-weight: 500; padding: 8px 4px; }
.sheet__save { justify-self: end; color: #93C5FD; font-weight: 700; padding: 8px 4px; }
.sheet__save:active { opacity: 0.5; }

.bill-form { display: flex; flex-direction: column; gap: 14px; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ---------- menu items ---------- */
.menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    transition: background 0.18s var(--ease), transform 0.12s var(--ease);
}
.menu-item:active { transform: scale(0.99); background: var(--surface-hover); }
.menu-item__icon {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: 12px;
    background: var(--surface-strong);
    color: var(--text);
}
.menu-item__body { display: flex; flex-direction: column; }
.menu-item__title { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.menu-item__sub { font-size: 12px; color: var(--text-soft); }
.menu-item--danger .menu-item__icon { color: var(--red); background: var(--red-soft); }
.menu-item--danger .menu-item__title { color: var(--red); }

/* ---------- toggle ---------- */
.toggle {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle__label { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.toggle__hint { font-size: 12px; color: var(--text-soft); }
.toggle__track {
    position: relative;
    width: 50px; height: 30px;
    background: rgba(255,255,255,0.12);
    border-radius: 999px;
    transition: background 0.2s var(--ease);
}
.toggle__thumb {
    position: absolute;
    top: 3px; left: 3px;
    width: 24px; height: 24px;
    background: white;
    border-radius: 50%;
    transition: transform 0.22s var(--ease);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.toggle input:checked ~ .toggle__track { background: var(--green); }
.toggle input:checked ~ .toggle__track .toggle__thumb { transform: translateX(20px); }
/* The real checkbox is transparent, so focusing it showed nothing at all: a
   keyboard user landed on an invisible control. Paint the ring on the track. */
.toggle input:focus-visible ~ .toggle__track {
    outline: 2px solid #93C5FD;
    outline-offset: 3px;
}

/* ================================================================
   TOAST
================================================================ */
.toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--safe-bottom) + 100px);
    transform: translateX(-50%);
    padding: 12px 18px;
    background: rgba(20, 20, 28, 0.94);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
    z-index: 60;
    animation: toast-in 0.28s var(--ease);
    max-width: 85vw;
    text-align: center;
}
.toast.is-success { color: #86EFAC; border-color: rgba(48, 209, 88, 0.35); }
.toast.is-error { color: #FCA5A5; border-color: rgba(255, 69, 58, 0.35); }

.toast__text { min-width: 0; }
@keyframes toast-in {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ================================================================
   FORM HINT
================================================================ */
.form-hint {
    margin: 0 0 4px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-soft);
}

/* ================================================================
   FOCUS VISIBILITY

   Nothing here had a focus ring, which made the app unusable with a
   keyboard or a switch control. :focus-visible keeps it invisible for
   touch and mouse, where it would just be noise.
================================================================ */
:focus-visible {
    outline: 2px solid #93C5FD;
    outline-offset: 2px;
    border-radius: 6px;
}
.bill:focus-visible,
.menu-item:focus-visible {
    outline-offset: -2px;
}

/* ================================================================
   REDUCED MOTION
================================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ================================================================
   Tiny screens polish
================================================================ */
@media (max-width: 360px) {
    .balance-card__amount { font-size: 30px; }
    .app-header { padding-left: 16px; padding-right: 16px; }
    .app-main { padding-left: 12px; padding-right: 12px; }
}
