:root {
    --bg-base: #0b1622;
    --bg-card: #101b2a;
    --bg-elevated: #14243a;
    --text-body: #e9eef7;
    --accent: #4fd1c5;
    --muted: #7c8a9e;
    --danger: #f44336;
    --ok: #4caf50;
}

[data-bs-theme="light"] {
    --bg-base: #f8fafc;
    --bg-card: #ffffff;
    --bg-elevated: #f1f5f9;
    --text-body: #0f172a;
    --accent: #2563eb;
    --muted: #64748b;
    --danger: #dc2626;
    --ok: #16a34a;
}

body.bg-base {
    background-color: var(--bg-base);
    color: var(--text-body);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-main {
    flex: 1 1 auto;
    padding-bottom: 72px; /* space for bottom bar */
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-card);
}

.card-soft {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}

.btn-pill {
    border-radius: 999px;
    padding: 12px 16px;
    font-weight: 700;
}

.bite {
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.stat-chip {
    border-radius: 12px;
    padding: 10px;
    background: var(--bg-elevated);
}

.list-compact .list-group-item {
    background: transparent;
    padding: 12px 0;
    border-color: rgba(255,255,255,0.06);
}

.app-bottombar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
}

.nav-pill {
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.nav-pill.active {
    color: var(--accent);
}

.nav-pill .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
}

.nav-pill.active .dot {
    background: var(--accent);
}

.badge-soft {
    background: rgba(79, 209, 197, 0.15);
    color: var(--accent);
    border: 1px solid rgba(79, 209, 197, 0.3);
}

.form-control,
.form-select {
    font-size: 1rem;
    min-height: 48px;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

body.no-scroll {
    overflow: hidden;
}

.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 990;
}

.sheet-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-card);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -18px 40px rgba(0,0,0,0.35);
    transform: translateY(100%);
    transition: transform 0.25s ease;
    z-index: 995;
    padding: 16px;
    max-height: 70vh;
    overflow-y: auto;
}

.sheet.show {
    transform: translateY(0);
}

.sheet-handle {
    width: 48px;
    height: 5px;
    background: rgba(255,255,255,0.25);
    border-radius: 999px;
    margin: 0 auto 12px auto;
}

/* Toast notifications */
.toast-stack {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 360px;
}

.toast-item {
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    color: #0f172a;
    background: #fff;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toast-in 180ms ease-out;
}

.toast-item.fade-out { animation: toast-out 200ms ease-in forwards; }

.toast-item.success { border-color: #c7f9cc; background: #f0fff4; }
.toast-item.error { border-color: #fecdd3; background: #fff1f2; }
.toast-item.info { border-color: #bfdbfe; background: #eff6ff; }

.toast-title { font-weight: 700; font-size: 14px; }
.toast-msg { margin: 0; font-size: 14px; color: #334155; }
.toast-close { margin-left: auto; border: none; background: transparent; font-size: 16px; line-height: 1; cursor: pointer; color: #64748b; }
.toast-close:hover { color: #0f172a; }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-6px); }
}

@media (max-width: 575px) {
    .toast-stack { left: 12px; right: 12px; top: 12px; }
    .toast-item { width: 100%; }
}

.offer-picker-trigger {
    cursor: pointer;
}

.sheet-trigger {
    cursor: pointer;
}

.offer-option {
    background: transparent;
    color: var(--text-body);
    border-color: rgba(255,255,255,0.08);
}

.offer-option:hover {
    background: rgba(255,255,255,0.04);
}

.form-floating > label {
    color: var(--muted);
}

.card-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.card-action .state {
    font-weight: 700;
}

.shadow-sm-up {
    box-shadow: 0 -8px 24px rgba(0,0,0,0.18);
}

.text-ok { color: var(--ok); }
.text-danger-soft { color: var(--danger); }

@media (min-width: 992px) {
    /* Still keep narrow width to focus mobile layout */
    .container-fluid {
        max-width: 520px;
    }
}
