/* ==========================================================================
   RemainderKu UI v3 — simple, smooth & modern
   Built on Bootstrap 5.3 (kept for modal/dropdown/grid) with custom tokens.
   ========================================================================== */

:root {
    --rk-font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    --rk-primary: #6366f1;
    --rk-primary-2: #8b5cf6;
    --rk-primary-rgb: 99, 102, 241;
    --rk-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #d946ef 100%);
    --rk-grad-soft: linear-gradient(135deg, rgba(99,102,241,.12), rgba(217,70,239,.10));

    --rk-success: #10b981;
    --rk-warning: #f59e0b;
    --rk-danger: #f43f5e;
    --rk-info: #0ea5e9;

    --rk-bg: #f5f6fb;
    --rk-surface: #ffffff;
    --rk-surface-2: #f1f3f9;
    --rk-border: rgba(15, 23, 42, .07);
    --rk-text: #0f172a;
    --rk-muted: #64748b;
    --rk-shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 2px 8px rgba(15,23,42,.04);
    --rk-shadow: 0 4px 24px -6px rgba(15,23,42,.10);
    --rk-shadow-lg: 0 18px 50px -12px rgba(79,70,229,.35);
    --rk-radius: 20px;
    --rk-radius-sm: 14px;
    --rk-ease: cubic-bezier(.22, 1, .36, 1);

    --bs-body-font-family: var(--rk-font);
    --bs-primary: var(--rk-primary);
    --bs-primary-rgb: var(--rk-primary-rgb);
    --bs-link-color: var(--rk-primary);
    --bs-link-color-rgb: var(--rk-primary-rgb);
    --bs-link-hover-color: #4f46e5;
    --bs-border-radius: 12px;
}

[data-bs-theme="dark"] {
    --rk-bg: #0b0d17;
    --rk-surface: #141726;
    --rk-surface-2: #1c2033;
    --rk-border: rgba(255, 255, 255, .07);
    --rk-text: #e8eaf6;
    --rk-muted: #8f97b2;
    --rk-shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --rk-shadow: 0 6px 28px -8px rgba(0,0,0,.55);
    --rk-grad-soft: linear-gradient(135deg, rgba(99,102,241,.18), rgba(217,70,239,.12));
    --bs-body-bg: var(--rk-bg);
    --bs-body-color: var(--rk-text);
    --bs-secondary-color: var(--rk-muted);
    --bs-tertiary-bg: var(--rk-surface-2);
    --bs-border-color: rgba(255,255,255,.09);
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body {
    font-family: var(--rk-font);
    background: var(--rk-bg);
    color: var(--rk-text);
    -webkit-font-smoothing: antialiased;
    letter-spacing: -.005em;
    transition: background-color .3s ease, color .3s ease;
    min-height: 100vh;
    overflow-x: clip;
}
h1, h2, h3, h4, h5, h6, .fw-bold { letter-spacing: -.02em; }
a { text-decoration: none; transition: color .2s ease; }
.text-muted, .text-secondary { color: var(--rk-muted) !important; }
.text-body-emphasis { color: var(--rk-text) !important; }
.text-gradient { background: var(--rk-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.small-xs { font-size: .74rem; }
::selection { background: rgba(var(--rk-primary-rgb), .25); }

/* subtle background decoration */
body::before {
    content: ""; position: fixed; inset: -20% -10% auto auto; width: 60vw; height: 60vw; max-width: 720px; max-height: 720px;
    background: radial-gradient(circle, rgba(139,92,246,.10), transparent 65%);
    pointer-events: none; z-index: -1;
}

/* ---------- Layout ---------- */
.app-container { max-width: 1080px; padding-bottom: 110px; }
@media (min-width: 768px) { .app-container { padding-bottom: 48px; } }

.rk-topbar {
    position: sticky; top: 0; z-index: 1030;
    background: color-mix(in srgb, var(--rk-surface) 78%, transparent);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--rk-border);
}
.rk-topbar .container { max-width: 1080px; }
.rk-brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.12rem; color: var(--rk-text); }
.rk-brand:hover { color: var(--rk-text); }
.rk-logo {
    width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
    background: var(--rk-grad); color: #fff; font-size: 1.05rem; box-shadow: 0 6px 16px -4px rgba(99,102,241,.55);
}
.rk-nav { display: flex; gap: .25rem; }
.rk-nav a {
    display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .85rem; border-radius: 12px;
    color: var(--rk-muted); font-weight: 600; font-size: .9rem; transition: all .25s var(--rk-ease);
}
.rk-nav a:hover { color: var(--rk-text); background: var(--rk-surface-2); }
.rk-nav a.active { color: var(--rk-primary); background: rgba(var(--rk-primary-rgb), .10); }

.icon-btn {
    width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; position: relative;
    background: var(--rk-surface-2); color: var(--rk-muted); border: 1px solid transparent; font-size: 1.1rem;
    transition: all .25s var(--rk-ease);
}
.icon-btn:hover { color: var(--rk-primary); transform: translateY(-1px); border-color: var(--rk-border); }
.icon-btn .dot-badge {
    position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
    background: var(--rk-danger); color: #fff; font-size: .66rem; font-weight: 700; display: grid; place-items: center;
    border: 2px solid var(--rk-surface); animation: pop .4s var(--rk-ease);
}
.avatar {
    width: 36px; height: 36px; border-radius: 12px; display: inline-grid; place-items: center; font-weight: 700; font-size: .82rem;
    background: var(--rk-grad); color: #fff; flex-shrink: 0;
}
.avatar-lg { width: 64px; height: 64px; border-radius: 20px; font-size: 1.35rem; }
.user-chip { display: inline-flex; align-items: center; gap: .55rem; padding: 3px 12px 3px 3px; border-radius: 14px; background: var(--rk-surface-2); color: var(--rk-text); font-weight: 600; font-size: .86rem; border: 0; }

/* Mobile bottom navigation */
.mobile-bottom-nav {
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 1040; height: 66px;
    display: flex; align-items: center; justify-content: space-around;
    background: color-mix(in srgb, var(--rk-surface) 88%, transparent);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--rk-border); border-radius: 22px; box-shadow: 0 10px 40px -10px rgba(15,23,42,.25);
    padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 768px) { .mobile-bottom-nav { display: none; } }
.mobile-nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--rk-muted);
    font-size: .66rem; font-weight: 600; padding: 6px 0; transition: color .2s ease;
}
.mobile-nav-item i { font-size: 1.25rem; transition: transform .3s var(--rk-ease); }
.mobile-nav-item.active { color: var(--rk-primary); }
.mobile-nav-item.active i { transform: translateY(-2px); }
.mobile-nav-add {
    width: 56px; height: 56px; margin-top: -30px; border-radius: 18px; display: grid; place-items: center;
    background: var(--rk-grad); color: #fff; font-size: 1.7rem; box-shadow: var(--rk-shadow-lg);
    border: 4px solid var(--rk-bg); transition: transform .25s var(--rk-ease);
}
.mobile-nav-add:hover, .mobile-nav-add:active { color: #fff; transform: scale(1.06) rotate(90deg); }

/* ---------- Cards ---------- */
.rk-card, .card-rk {
    background: var(--rk-surface); border: 1px solid var(--rk-border); border-radius: var(--rk-radius);
    box-shadow: var(--rk-shadow-sm); transition: transform .3s var(--rk-ease), box-shadow .3s var(--rk-ease), border-color .3s;
}
.rk-card-hover:hover { transform: translateY(-3px); box-shadow: var(--rk-shadow); }
.rk-card .card-header, .rk-card-header {
    background: transparent; border-bottom: 1px solid var(--rk-border); padding: 1rem 1.25rem;
}
.section-title { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--rk-muted); display: flex; align-items: center; gap: .5rem; margin: 0; }
.section-title .count { background: var(--rk-surface-2); color: var(--rk-text); padding: 1px 8px; border-radius: 8px; font-size: .72rem; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head h1 { font-size: 1.55rem; font-weight: 800; margin: 0; }
.page-head p { margin: 2px 0 0; color: var(--rk-muted); font-size: .9rem; }
.back-btn { width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; background: var(--rk-surface); border: 1px solid var(--rk-border); color: var(--rk-text); transition: all .25s var(--rk-ease); }
.back-btn:hover { transform: translateX(-2px); color: var(--rk-primary); }

/* Hero */
.rk-hero {
    position: relative; overflow: hidden; border-radius: 26px; padding: 1.6rem; color: #fff;
    background: var(--rk-grad); box-shadow: var(--rk-shadow-lg);
}
.rk-hero::before, .rk-hero::after {
    content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.14); pointer-events: none;
}
.rk-hero::before { width: 260px; height: 260px; right: -70px; top: -110px; }
.rk-hero::after { width: 160px; height: 160px; right: 110px; bottom: -90px; background: rgba(255,255,255,.08); }
.rk-hero > * { position: relative; z-index: 1; }
.rk-hero.dark { background: linear-gradient(135deg, #1e1b4b, #312e81 60%, #4c1d95); }
.hero-pill { display: inline-flex; align-items: center; gap: .4rem; background: rgba(255,255,255,.18); padding: .3rem .75rem; border-radius: 999px; font-size: .76rem; font-weight: 600; backdrop-filter: blur(6px); }
.progress-ring { --p: 0; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
    background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255,255,255,.22) 0); flex-shrink: 0; }
.progress-ring span { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: rgba(79,70,229,.55); font-weight: 800; font-size: .95rem; backdrop-filter: blur(4px); }

/* Stat tiles */
.stat-tile {
    display: block; padding: 1rem; border-radius: 18px; background: var(--rk-surface); border: 1px solid var(--rk-border);
    color: var(--rk-text); box-shadow: var(--rk-shadow-sm); transition: all .3s var(--rk-ease); height: 100%;
}
.stat-tile:hover { transform: translateY(-3px); box-shadow: var(--rk-shadow); color: var(--rk-text); }
.stat-tile .chip { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 1.05rem; margin-bottom: .7rem; }
.stat-tile .num { font-size: 1.7rem; font-weight: 800; line-height: 1; }
.stat-tile .lbl { font-size: .78rem; color: var(--rk-muted); font-weight: 600; margin-top: .3rem; }
.chip-danger { background: rgba(244,63,94,.12); color: var(--rk-danger); }
.chip-warning { background: rgba(245,158,11,.14); color: #d97706; }
.chip-info { background: rgba(14,165,233,.12); color: var(--rk-info); }
.chip-primary { background: rgba(var(--rk-primary-rgb),.12); color: var(--rk-primary); }
.chip-success { background: rgba(16,185,129,.12); color: var(--rk-success); }
.chip-muted { background: var(--rk-surface-2); color: var(--rk-muted); }

/* ---------- Reminder item ---------- */
.reminder-item {
    position: relative; display: flex; align-items: center; gap: .9rem; padding: .9rem 1rem; padding-left: 1.15rem;
    background: var(--rk-surface); border: 1px solid var(--rk-border); border-radius: 18px; box-shadow: var(--rk-shadow-sm);
    transition: transform .3s var(--rk-ease), box-shadow .3s var(--rk-ease), opacity .3s;
    overflow: hidden;
}
.reminder-item::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--cat, var(--rk-primary)); }
.reminder-item:hover { transform: translateY(-2px); box-shadow: var(--rk-shadow); }
.reminder-item .cat-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; font-size: 1.15rem; color: var(--cat); background: color-mix(in srgb, var(--cat) 14%, transparent); }
.reminder-item .r-title { font-weight: 700; color: var(--rk-text); font-size: .97rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reminder-item .r-title:hover { color: var(--rk-primary); }
.reminder-item .r-meta { display: flex; flex-wrap: wrap; gap: .35rem .75rem; font-size: .78rem; color: var(--rk-muted); margin-top: .2rem; }
.reminder-item .r-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.reminder-item .r-body { min-width: 0; flex: 1; }
.reminder-item.is-completed { opacity: .62; }
.reminder-item.is-completed .r-title { text-decoration: line-through; }
.reminder-item.is-overdue { background: linear-gradient(90deg, rgba(244,63,94,.06), var(--rk-surface) 45%); }
.reminder-item.is-today { background: linear-gradient(90deg, rgba(245,158,11,.07), var(--rk-surface) 45%); }

.act-btn {
    width: 38px; height: 38px; border-radius: 12px; display: inline-grid; place-items: center; border: 1px solid var(--rk-border);
    background: var(--rk-surface-2); color: var(--rk-muted); font-size: 1.05rem; transition: all .25s var(--rk-ease); padding: 0;
}
.act-btn:hover { transform: translateY(-1px); }
.act-btn.done:hover { background: var(--rk-success); color: #fff; border-color: var(--rk-success); }
.act-btn.snooze:hover { background: var(--rk-warning); color: #fff; border-color: var(--rk-warning); }
.act-btn.go:hover { background: var(--rk-primary); color: #fff; border-color: var(--rk-primary); }

/* Status badges */
.badge-status { display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .6rem; border-radius: 8px; font-size: .7rem; font-weight: 700; white-space: nowrap; }
.status-overdue { background: rgba(244,63,94,.12); color: #e11d48; }
.status-today { background: rgba(245,158,11,.15); color: #b45309; }
.status-upcoming { background: rgba(14,165,233,.12); color: #0284c7; }
.status-snoozed { background: rgba(139,92,246,.13); color: #7c3aed; }
.status-safe { background: rgba(16,185,129,.12); color: #059669; }
.status-completed { background: var(--rk-surface-2); color: var(--rk-muted); }
[data-bs-theme="dark"] .status-overdue { color: #fb7185; }
[data-bs-theme="dark"] .status-today { color: #fbbf24; }
[data-bs-theme="dark"] .status-upcoming { color: #38bdf8; }
[data-bs-theme="dark"] .status-snoozed { color: #a78bfa; }
[data-bs-theme="dark"] .status-safe { color: #34d399; }

.tag { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .6rem; border-radius: 8px; font-size: .74rem; font-weight: 600; background: var(--rk-surface-2); color: var(--rk-muted); }

/* ---------- Buttons ---------- */
.btn { font-weight: 600; border-radius: 12px; padding: .55rem 1.05rem; transition: all .25s var(--rk-ease); }
.btn:active { transform: scale(.97); }
.btn-lg { border-radius: 16px; padding: .8rem 1.4rem; font-size: 1rem; }
.btn-sm { border-radius: 10px; padding: .35rem .75rem; }
.btn-primary, .btn-gradient {
    background: var(--rk-grad); background-size: 140% 140%; border: 0; color: #fff;
    box-shadow: 0 8px 20px -8px rgba(99,102,241,.65);
}
.btn-primary:hover, .btn-gradient:hover, .btn-primary:focus { color: #fff; background-position: 100% 0; box-shadow: 0 12px 26px -8px rgba(99,102,241,.75); transform: translateY(-1px); }
.btn-primary:disabled { background: var(--rk-grad); opacity: .6; }
.btn-soft { background: rgba(var(--rk-primary-rgb), .10); color: var(--rk-primary); border: 0; }
.btn-soft:hover { background: rgba(var(--rk-primary-rgb), .18); color: var(--rk-primary); }
.btn-ghost { background: var(--rk-surface-2); color: var(--rk-text); border: 1px solid var(--rk-border); }
.btn-ghost:hover { background: var(--rk-surface); color: var(--rk-primary); border-color: rgba(var(--rk-primary-rgb),.3); }
.btn-success { background: var(--rk-success); border-color: var(--rk-success); }
.btn-danger { background: var(--rk-danger); border-color: var(--rk-danger); }
.btn-soft-danger { background: rgba(244,63,94,.10); color: var(--rk-danger); border: 0; }
.btn-soft-danger:hover { background: var(--rk-danger); color: #fff; }
.btn-soft-success { background: rgba(16,185,129,.12); color: var(--rk-success); border: 0; }
.btn-soft-success:hover { background: var(--rk-success); color: #fff; }
.btn-soft-warning { background: rgba(245,158,11,.14); color: #d97706; border: 0; }
.btn-soft-warning:hover { background: var(--rk-warning); color: #fff; }
.btn-white { background: #fff; color: #4f46e5; border: 0; }
.btn-white:hover { background: #fff; color: #4338ca; transform: translateY(-1px); box-shadow: 0 10px 22px -8px rgba(0,0,0,.35); }
.btn-glass { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.25); }
.btn-glass:hover { background: rgba(255,255,255,.28); color: #fff; }
.btn.is-loading { pointer-events: none; opacity: .8; }
.btn.is-loading::after { content: ""; width: 14px; height: 14px; margin-left: .5rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; vertical-align: -2px; animation: spin .7s linear infinite; }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .86rem; margin-bottom: .4rem; color: var(--rk-text); }
.form-control, .form-select {
    border-radius: var(--rk-radius-sm); border: 1.5px solid var(--rk-border); background-color: var(--rk-surface-2);
    padding: .7rem .95rem; font-size: .95rem; color: var(--rk-text); transition: all .2s ease;
}
.form-control::placeholder { color: color-mix(in srgb, var(--rk-muted) 75%, transparent); }
.form-control:focus, .form-select:focus {
    background-color: var(--rk-surface); border-color: rgba(var(--rk-primary-rgb), .55);
    box-shadow: 0 0 0 4px rgba(var(--rk-primary-rgb), .14); color: var(--rk-text);
}
.form-control-lg { font-size: 1.05rem; padding: .85rem 1.05rem; border-radius: 16px; }
.form-control-sm, .form-select-sm { padding: .45rem .75rem; font-size: .85rem; border-radius: 10px; }
.form-text { color: var(--rk-muted); font-size: .78rem; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--rk-muted); pointer-events: none; font-size: 1rem; }
.input-icon > .form-control { padding-left: 2.6rem; }
.input-icon .toggle-pass { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--rk-muted); padding: 6px 8px; }
.form-check-input:checked { background-color: var(--rk-primary); border-color: var(--rk-primary); }
.form-check-input:focus { box-shadow: 0 0 0 4px rgba(var(--rk-primary-rgb), .14); }
.form-switch .form-check-input { width: 2.6em; height: 1.4em; }
.is-invalid { border-color: var(--rk-danger) !important; }

/* Choice pills (radio / checkbox) */
.choice-group { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice-group input { position: absolute; opacity: 0; pointer-events: none; }
.choice-group label {
    display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .9rem; border-radius: 12px; cursor: pointer;
    border: 1.5px solid var(--rk-border); background: var(--rk-surface-2); color: var(--rk-text); font-weight: 600; font-size: .85rem;
    transition: all .2s var(--rk-ease); user-select: none;
}
.choice-group label:hover { border-color: rgba(var(--rk-primary-rgb), .4); }
.choice-group input:checked + label { background: rgba(var(--rk-primary-rgb), .12); border-color: var(--rk-primary); color: var(--rk-primary); }
.choice-group input:focus-visible + label { box-shadow: 0 0 0 4px rgba(var(--rk-primary-rgb), .18); }
.choice-list { display: grid; gap: .5rem; }
.choice-list label { justify-content: space-between; width: 100%; padding: .8rem 1rem; }

/* Category picker */
.cat-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .55rem; }
.cat-picker input { position: absolute; opacity: 0; pointer-events: none; }
.cat-picker label {
    display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .8rem .4rem; border-radius: 16px; cursor: pointer;
    border: 1.5px solid var(--rk-border); background: var(--rk-surface-2); font-size: .8rem; font-weight: 600; text-align: center;
    transition: all .2s var(--rk-ease);
}
.cat-picker label i { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 1.1rem; color: var(--cat); background: color-mix(in srgb, var(--cat) 15%, transparent); transition: all .2s; }
.cat-picker label:hover { transform: translateY(-2px); }
.cat-picker input:checked + label { border-color: var(--cat); background: color-mix(in srgb, var(--cat) 9%, var(--rk-surface)); }
.cat-picker input:checked + label i { background: var(--cat); color: #fff; }

.form-section { padding: 1.25rem; border-radius: 18px; background: var(--rk-surface-2); border: 1px solid var(--rk-border); }
.collapse-smooth { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--rk-ease), opacity .3s; opacity: 0; }
.collapse-smooth > div { overflow: hidden; }
.collapse-smooth.show { grid-template-rows: 1fr; opacity: 1; }

.magic-input { position: relative; border-radius: 18px; padding: 2px; background: var(--rk-grad); }
.magic-input .form-control { border: 0; border-radius: 16px; background: var(--rk-surface); padding-left: 2.8rem; }
.magic-input > i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); z-index: 2; color: var(--rk-primary-2); }
.parse-hint { display: flex; flex-wrap: wrap; gap: .35rem; min-height: 0; margin-top: .5rem; }
.parse-hint .tag { background: rgba(var(--rk-primary-rgb), .10); color: var(--rk-primary); animation: pop .35s var(--rk-ease); }

/* ---------- Toasts ---------- */
.rk-toast-wrap { position: fixed; top: 76px; right: 16px; left: 16px; z-index: 1090; display: flex; flex-direction: column; align-items: flex-end; gap: .6rem; pointer-events: none; }
@media (min-width: 576px) { .rk-toast-wrap { left: auto; width: 400px; } }
.rk-toast {
    pointer-events: auto; width: 100%; display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 16px;
    background: var(--rk-surface); border: 1px solid var(--rk-border); box-shadow: 0 16px 40px -12px rgba(15,23,42,.3);
    animation: toastIn .5s var(--rk-ease) both; position: relative; overflow: hidden;
}
.rk-toast.hide { animation: toastOut .35s ease forwards; }
.rk-toast .t-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; font-size: 1rem; }
.rk-toast .t-body { flex: 1; font-size: .87rem; line-height: 1.45; padding-top: 6px; word-break: break-word; }
.rk-toast .t-close { border: 0; background: transparent; color: var(--rk-muted); padding: 4px; line-height: 1; }
.rk-toast .t-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: currentColor; opacity: .35; animation: bar 6s linear forwards; }
.rk-toast.success { color: var(--rk-success); } .rk-toast.success .t-icon { background: rgba(16,185,129,.12); }
.rk-toast.error { color: var(--rk-danger); } .rk-toast.error .t-icon { background: rgba(244,63,94,.12); }
.rk-toast.warning { color: #d97706; } .rk-toast.warning .t-icon { background: rgba(245,158,11,.14); }
.rk-toast .t-body { color: var(--rk-text); }
.rk-toast:hover .t-bar { animation-play-state: paused; }

.rk-alert { display: flex; gap: .75rem; padding: 1rem 1.1rem; border-radius: 16px; border: 1px solid rgba(244,63,94,.25); background: rgba(244,63,94,.07); margin-bottom: 1rem; animation: fadeUp .45s var(--rk-ease) both; }
.rk-alert ul { margin: .25rem 0 0; padding-left: 1.1rem; font-size: .88rem; }

.announce-bar { background: var(--rk-grad-soft); border-bottom: 1px solid var(--rk-border); font-size: .85rem; }
.announce-bar .container { max-width: 1080px; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 2.2rem 1.2rem; }
.empty-state .e-icon { width: 72px; height: 72px; margin: 0 auto 1rem; border-radius: 22px; display: grid; place-items: center; font-size: 1.9rem; background: var(--rk-grad-soft); color: var(--rk-primary); animation: float 4s ease-in-out infinite; }
.empty-state h6 { font-weight: 700; margin-bottom: .3rem; }
.empty-state p { color: var(--rk-muted); font-size: .88rem; max-width: 380px; margin: 0 auto 1rem; }

/* ---------- Filter tabs ---------- */
.tabs-scroll { display: flex; gap: .45rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.tabs-scroll::-webkit-scrollbar { display: none; }
.tab-pill { flex-shrink: 0; padding: .48rem .95rem; border-radius: 12px; font-weight: 600; font-size: .85rem; color: var(--rk-muted); background: var(--rk-surface); border: 1px solid var(--rk-border); transition: all .25s var(--rk-ease); }
.tab-pill:hover { color: var(--rk-text); }
.tab-pill.active { background: var(--rk-text); color: var(--rk-surface); border-color: var(--rk-text); }

/* ---------- Calendar ---------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-head { text-align: center; font-size: .72rem; font-weight: 700; color: var(--rk-muted); text-transform: uppercase; padding: .3rem 0; }
.cal-head.sun { color: var(--rk-danger); }
.cal-day {
    aspect-ratio: 1 / 1; min-height: 44px; border-radius: 14px; padding: 6px; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
    background: var(--rk-surface-2); color: var(--rk-text); font-weight: 600; font-size: .88rem; transition: all .2s var(--rk-ease); border: 1.5px solid transparent;
}
@media (min-width: 768px) { .cal-day { aspect-ratio: auto; height: 78px; align-items: flex-start; padding: 8px 10px; } }
.cal-day:hover { border-color: rgba(var(--rk-primary-rgb), .4); color: var(--rk-text); transform: translateY(-1px); }
.cal-day.empty { background: transparent; pointer-events: none; }
.cal-day.today .n { background: var(--rk-grad); color: #fff; }
.cal-day.selected { border-color: var(--rk-primary); background: rgba(var(--rk-primary-rgb), .08); }
.cal-day .n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; }
.cal-dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; display: block; }
.cal-more { font-size: .6rem; color: var(--rk-muted); line-height: 6px; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 1.6rem; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--rk-border); border-radius: 2px; }
.tl-item { position: relative; padding-bottom: 1.1rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -1.6rem; top: 2px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .66rem; color: #fff; box-shadow: 0 0 0 4px var(--rk-surface); }

/* ---------- Detail info grid ---------- */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; }
.info-box { padding: .9rem 1rem; border-radius: 16px; background: var(--rk-surface-2); }
.info-box .k { font-size: .74rem; color: var(--rk-muted); font-weight: 600; display: flex; gap: .35rem; align-items: center; }
.info-box .v { font-weight: 700; margin-top: .2rem; font-size: .95rem; }

/* ---------- Vehicle ---------- */
.vehicle-card { overflow: hidden; }
.vehicle-card .v-top { padding: 1.15rem 1.25rem; background: var(--rk-grad-soft); position: relative; }
.plate { display: inline-flex; align-items: center; padding: .25rem .7rem; border-radius: 8px; background: #0f172a; color: #fff; font-weight: 800; letter-spacing: .08em; font-size: .78rem; border: 2px solid rgba(255,255,255,.18); }
.odo { font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: -.02em; }

/* ---------- Tables (admin) ---------- */
.rk-table { margin: 0; --bs-table-bg: transparent; }
.rk-table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--rk-muted); font-weight: 700; border-bottom: 1px solid var(--rk-border); padding: .85rem 1rem; background: var(--rk-surface-2); white-space: nowrap; }
.rk-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--rk-border); vertical-align: middle; font-size: .9rem; }
.rk-table tbody tr { transition: background .2s; }
.rk-table tbody tr:hover { background: var(--rk-surface-2); }
.rk-table tbody tr:last-child td { border-bottom: 0; }

/* Admin sidebar layout */
.admin-shell { display: flex; min-height: 100vh; }
.admin-side {
    width: 250px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; padding: 1.25rem 1rem; display: flex; flex-direction: column; gap: .3rem;
    background: var(--rk-surface); border-right: 1px solid var(--rk-border); overflow-y: auto;
}
.admin-side .side-link { display: flex; align-items: center; gap: .7rem; padding: .65rem .85rem; border-radius: 12px; color: var(--rk-muted); font-weight: 600; font-size: .9rem; transition: all .2s var(--rk-ease); }
.admin-side .side-link i { font-size: 1.05rem; }
.admin-side .side-link:hover { background: var(--rk-surface-2); color: var(--rk-text); }
.admin-side .side-link.active { background: rgba(var(--rk-primary-rgb), .1); color: var(--rk-primary); }
.admin-side .side-label { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--rk-muted); padding: 1rem .85rem .35rem; }
.admin-main { flex: 1; min-width: 0; }
.admin-main .admin-content { max-width: 1180px; padding: 1.5rem; margin: 0 auto; }
@media (max-width: 991.98px) {
    .admin-side { position: fixed; left: 0; top: 0; z-index: 1050; transform: translateX(-105%); transition: transform .35s var(--rk-ease); box-shadow: var(--rk-shadow); }
    .admin-side.open { transform: none; }
    .admin-main .admin-content { padding: 1rem; }
}
.side-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1045; opacity: 0; pointer-events: none; transition: opacity .3s; backdrop-filter: blur(2px); }
.side-backdrop.show { opacity: 1; pointer-events: auto; }

/* ---------- Auth ---------- */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; position: relative; overflow-x: hidden; }
.auth-body::before { content: ""; position: fixed; inset: 0; z-index: -1;
    background: radial-gradient(600px circle at 10% 10%, rgba(99,102,241,.18), transparent 60%), radial-gradient(500px circle at 90% 85%, rgba(217,70,239,.16), transparent 60%), var(--rk-bg); }
.auth-card { width: 100%; max-width: 440px; padding: 2rem; border-radius: 26px; background: color-mix(in srgb, var(--rk-surface) 88%, transparent); backdrop-filter: blur(20px); border: 1px solid var(--rk-border); box-shadow: 0 30px 60px -20px rgba(15,23,42,.25); animation: fadeUp .6s var(--rk-ease) both; }
.auth-logo { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; font-size: 1.6rem; color: #fff; background: var(--rk-grad); margin: 0 auto 1rem; box-shadow: var(--rk-shadow-lg); animation: float 5s ease-in-out infinite; }

/* ---------- Modal & dropdown ---------- */
.modal-content { border: 1px solid var(--rk-border); border-radius: 24px; background: var(--rk-surface); box-shadow: 0 30px 70px -20px rgba(15,23,42,.45); }
.modal-header, .modal-footer { border: 0; padding: 1.2rem 1.4rem; }
.modal-body { padding: .4rem 1.4rem 1rem; }
.modal.fade .modal-dialog { transform: translateY(24px) scale(.97); transition: transform .35s var(--rk-ease); }
.modal.show .modal-dialog { transform: none; }
.modal-backdrop.show { opacity: .45; }
@media (max-width: 575.98px) {
    .modal-sheet .modal-dialog { margin: 0; position: fixed; bottom: 0; left: 0; right: 0; max-width: none; }
    .modal-sheet .modal-content { border-radius: 26px 26px 0 0; padding-bottom: env(safe-area-inset-bottom); }
    .modal-sheet.fade .modal-dialog { transform: translateY(100%); }
    .modal-sheet.show .modal-dialog { transform: none; }
}
.dropdown-menu { border: 1px solid var(--rk-border); border-radius: 16px; padding: .4rem; background: var(--rk-surface); box-shadow: 0 16px 40px -12px rgba(15,23,42,.25); animation: dropIn .22s var(--rk-ease); }
.dropdown-item { border-radius: 10px; padding: .55rem .8rem; font-size: .88rem; font-weight: 500; color: var(--rk-text); display: flex; align-items: center; gap: .6rem; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--rk-surface-2); color: var(--rk-text); }
.dropdown-item.text-danger:hover { background: rgba(244,63,94,.1); }
.dropdown-divider { border-color: var(--rk-border); margin: .3rem 0; }

/* ---------- Animations ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px) scale(.96); height: 0; padding: 0; margin: 0; } }
@keyframes bar { from { width: 100%; } to { width: 0; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.reveal { animation: fadeUp .55s var(--rk-ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
.page-enter { animation: fadeUp .45s var(--rk-ease) both; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Utilities ---------- */
.gap-xs { gap: .35rem; }
.min-w-0 { min-width: 0; }
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bg-surface { background: var(--rk-surface) !important; }
.bg-surface-2 { background: var(--rk-surface-2) !important; }
.border-soft { border: 1px solid var(--rk-border) !important; }
.rounded-xl { border-radius: var(--rk-radius) !important; }
.fs-7 { font-size: .85rem; }
hr { border-color: var(--rk-border); opacity: 1; }
code { color: var(--rk-primary-2); }
.ico-chip { width: 42px; height: 42px; border-radius: 13px; display: inline-grid; place-items: center; font-size: 1.15rem; flex-shrink: 0; }
.ico-chip.lg { width: 54px; height: 54px; border-radius: 16px; font-size: 1.45rem; }
@media (max-width: 575.98px) {
    .cal-grid { gap: 4px; }
    .cal-day { min-height: 0; padding: 3px 0 4px; border-radius: 11px; font-size: .8rem; }
    .cal-day .n { width: 24px; height: 24px; }
    .cal-head { font-size: .64rem; }
    .mobile-nav-item { font-size: .62rem; white-space: nowrap; }
}
.cal-grid > * { min-width: 0; }

/* WhatsApp-like preview (admin template editor) */
.wa-preview { padding: 1rem; border-radius: 18px; min-height: 220px; background: #0b141a radial-gradient(circle at 20% 20%, rgba(255,255,255,.04) 0, transparent 40%); }
[data-bs-theme="light"] .wa-preview { background: #efeae2; }
.wa-bubble { max-width: 100%; padding: .7rem .85rem; border-radius: 4px 14px 14px 14px; background: #005c4b; color: #e9edef; font-size: .88rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word; box-shadow: 0 1px 1px rgba(0,0,0,.2); }
[data-bs-theme="light"] .wa-bubble { background: #d9fdd3; color: #111b21; }
.wa-bubble .wa-link { color: #53bdeb; text-decoration: underline; }
[data-bs-theme="light"] .wa-bubble .wa-link { color: #027eb5; }
#tplChips .tag { cursor: pointer; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .74rem; }
#tplChips .tag:hover { background: rgba(var(--rk-primary-rgb), .14); color: var(--rk-primary); }
