:root {
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e5edf7;
    --panel: rgba(255,255,255,.86);
    --bg: #eef4fb;
    --primary: #2563eb;
    --primary-2: #1d4ed8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --sidebar-a: #07111f;
    --sidebar-b: #0f2552;
    --radius: 22px;
    --shadow: 0 18px 45px rgba(15, 23, 42, .10);
    --shadow-sm: 0 10px 25px rgba(15, 23, 42, .07);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:
        radial-gradient(circle at 15% 0%, rgba(37, 99, 235, .18), transparent 25%),
        radial-gradient(circle at 85% 10%, rgba(20, 184, 166, .12), transparent 28%),
        linear-gradient(180deg, #f7fbff 0%, var(--bg) 42%, #f8fafc 100%);
    color: #334155;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -.02em;
}

a { transition: all .22s ease; }

.app-shell { background: transparent; }
.main-content { min-height: 100vh; padding-bottom: 35px; }

/* SIDEBAR PREMIUM */
.sidebar {
    width: 285px;
    min-height: 100vh;
    color: #fff;
    background:
        radial-gradient(circle at 25% 0%, rgba(96, 165, 250, .27), transparent 28%),
        linear-gradient(180deg, var(--sidebar-a) 0%, var(--sidebar-b) 52%, #061120 100%);
    box-shadow: 14px 0 45px rgba(2, 6, 23, .18);
    z-index: 1000;
    position: sticky;
    top: 0;
}

.sidebar-inner {
    width: 100%;
    min-height: 100vh;
    padding: 18px 16px 18px;
    display: flex;
    flex-direction: column;
}

.brand-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 22px;
    color: #fff;
    text-decoration: none;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    box-shadow: 0 12px 28px rgba(37, 99, 235, .32);
}

.brand-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 5px; }
.brand-logo i { color: white; font-size: 1.65rem; }

.brand-title { display: block; font-weight: 900; line-height: 1.1; color: #fff; max-width: 164px; }
.brand-subtitle { display: block; color: #bfdbfe; font-size: .72rem; margin-top: 3px; letter-spacing: .06em; text-transform: uppercase; }

.side-kpi {
    margin: 14px 0 6px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(16,185,129,.12);
    border: 1px solid rgba(16,185,129,.18);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.side-kpi small { display: block; color: #a7f3d0; font-size: .74rem; }
.side-kpi strong { color: #fff; }
.side-kpi i { color: #34d399; font-size: 1.3rem; }

.nav-section {
    font-size: .68rem;
    letter-spacing: .12em;
    color: #93a4bd;
    text-transform: uppercase;
    font-weight: 800;
    padding: 16px 10px 6px;
}

.sidebar .nav { gap: 4px; }
.sidebar .nav-link {
    color: #cbd5e1;
    border-radius: 15px;
    padding: 11px 12px !important;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    font-weight: 700;
    font-size: .91rem;
}
.sidebar .nav-link i {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.07);
    font-size: 1rem;
    margin: 0;
}
.sidebar .nav-link span { white-space: nowrap; }
.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,.08);
    transform: translateX(3px);
}
.sidebar .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #14b8a6);
    box-shadow: 0 12px 28px rgba(37, 99, 235, .26);
}
.sidebar .nav-link.active i { background: rgba(255,255,255,.18); }
.sidebar .nav-link.text-warning { color: #fde68a !important; }
.sidebar .nav-link.disabled { opacity: .45; }

.side-alert {
    background: linear-gradient(135deg, rgba(239,68,68,.95), rgba(249,115,22,.88)) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.13);
}

.user-box {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,.11);
}
.user-toggle {
    width: 100%;
    border-radius: 18px;
    padding: 10px 12px;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.10);
}
.user-avatar {
    width: 38px; height: 38px; border-radius: 14px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, #22c55e, #14b8a6);
    color: #fff; font-weight: 900;
}
.user-name { display: block; color: #fff; font-weight: 800; line-height: 1; }
.user-role { color: #bfdbfe; font-size: .75rem; }

/* TOPBAR */
.topbar {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 10px 0;
    backdrop-filter: blur(12px);
}
.topbar-card {
    width: 100%;
    background: rgba(255,255,255,.74);
    border: 1px solid rgba(226, 232, 240, .86);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.search-pill {
    min-width: 280px;
    max-width: 430px;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 9px 14px;
    color: var(--muted);
}
.search-pill input { border: 0; background: transparent; outline: none; width: 100%; color: var(--ink); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.soft-chip {
    border-radius: 999px;
    padding: 8px 12px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 800;
    font-size: .82rem;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid #dbeafe;
}

/* DASHBOARD */
.dashboard-hero {
    background:
        radial-gradient(circle at 85% 20%, rgba(255,255,255,.24), transparent 20%),
        linear-gradient(135deg, #061224 0%, #102a6a 48%, #2563eb 100%);
    color: #fff;
    border-radius: 30px;
    padding: 30px;
    display: grid;
    grid-template-columns: 1.35fr .65fr;
    gap: 24px;
    box-shadow: 0 22px 55px rgba(15, 23, 42, .22);
    overflow: hidden;
    position: relative;
}
.dashboard-hero:before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,.12) 0 1px, transparent 1px 100%), linear-gradient(0deg, rgba(255,255,255,.08) 0 1px, transparent 1px 100%);
    background-size: 34px 34px;
    mask-image: linear-gradient(90deg, black, transparent 70%);
    opacity: .35;
}
.dashboard-hero > * { position: relative; z-index: 2; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.13);
    color: #dbeafe;
    font-size: .82rem;
    font-weight: 800;
    margin-bottom: 12px;
}
.dashboard-hero h1 { color: #fff; font-size: clamp(1.75rem, 3vw, 2.7rem); margin-bottom: 8px; }
.hero-copy { max-width: 720px; color: #dbeafe; margin-bottom: 18px; }
.hero-actions { display: flex; gap: 11px; flex-wrap: wrap; }
.hero-side {
    border-radius: 24px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.14);
    padding: 18px;
    backdrop-filter: blur(10px);
}
.hero-side-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.12); }
.hero-side-row:last-child { border-bottom: 0; }
.hero-side small { color: #bfdbfe; }
.hero-side strong { color: #fff; }

.metric-card {
    min-height: 152px;
    border-radius: 26px;
    padding: 22px;
    color: #fff;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
    isolation: isolate;
}
.metric-card:before {
    content: "";
    position: absolute;
    width: 145px;
    height: 145px;
    right: -44px;
    top: -52px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    z-index: -1;
}
.metric-card:after {
    content: "";
    position: absolute;
    width: 80px;
    height: 80px;
    right: 22px;
    bottom: -32px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.20);
}
.metric-card p {
    margin: 0 0 6px;
    color: rgba(255,255,255,.78);
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    font-weight: 900;
}
.metric-card h3 {
    color: #fff;
    margin: 0;
    font-size: clamp(1.45rem, 2vw, 1.9rem);
    line-height: 1.1;
    word-break: break-word;
}
.metric-card small { color: rgba(255,255,255,.78); font-weight: 700; }
.metric-icon {
    width: 58px; height: 58px;
    border-radius: 20px;
    background: rgba(255,255,255,.16);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
}
.metric-blue { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.metric-green { background: linear-gradient(135deg, #059669, #10b981); }
.metric-orange { background: linear-gradient(135deg, #d97706, #f59e0b); }
.metric-red { background: linear-gradient(135deg, #dc2626, #ef4444); }

.premium-card, .card-box {
    border: 1px solid rgba(226, 232, 240, .9) !important;
    border-radius: var(--radius) !important;
    background: var(--panel) !important;
    box-shadow: var(--shadow-sm) !important;
    overflow: hidden;
    backdrop-filter: blur(10px);
}
.card-header {
    background: rgba(255,255,255,.86) !important;
    border-bottom: 1px solid var(--line);
    font-weight: 900;
    padding: 16px 18px;
}
.card-header h5 { font-size: 1rem; }

.mini-stat {
    background: rgba(255,255,255,.86);
    border: 1px solid var(--line);
    border-radius: 21px;
    padding: 16px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
    height: 100%;
    position: relative;
    overflow: hidden;
}
.mini-stat:after {
    content: "";
    position: absolute;
    width: 72px; height: 72px; border-radius: 50%;
    right: -28px; top: -28px; background: #dbeafe;
}
.mini-stat .mini-label {
    display: block;
    font-size: .72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 900;
    margin-bottom: 7px;
}
.mini-stat strong { display: block; font-size: 1.12rem; color: var(--ink); position: relative; z-index: 2; }
.mini-stat small { color: var(--muted); position: relative; z-index: 2; }

/* TABLES */
.table { margin-bottom: 0; }
.table thead th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 900;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 1px solid #e2e8f0;
    padding: 14px 16px;
    white-space: nowrap;
}
.table tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #eef2f7;
}
.table-hover tbody tr:hover { background-color: #f8fbff; }
.customer-avatar {
    width: 40px; height: 40px; border-radius: 14px;
    display: grid; place-items: center;
    color: #fff; font-weight: 900;
    background: linear-gradient(135deg, #2563eb, #14b8a6);
}

/* COMPONENTS */
.btn {
    border-radius: 12px;
    padding: 9px 16px;
    font-weight: 800;
    border-width: 1px;
}
.btn-sm { padding: 7px 12px; border-radius: 11px; }
.btn-primary { background: linear-gradient(135deg, #2563eb, #1d4ed8); border-color: #2563eb; box-shadow: 0 10px 22px rgba(37, 99, 235, .18); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(37, 99, 235, .24); }
.btn-success { background: linear-gradient(135deg, #10b981, #059669); border-color: #10b981; }
.badge { padding: 7px 10px; border-radius: 999px; font-weight: 900; }

.form-control, .form-select {
    border-radius: 14px;
    padding: 11px 14px;
    border: 1px solid #dbe4f0;
    background-color: #f8fafc;
    font-weight: 600;
}
.form-control:focus, .form-select:focus {
    background-color: #fff;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
}
.form-label { font-weight: 800; color: #475569; font-size: .88rem; }

.risk-panel {
    display: grid;
    gap: 14px;
}
.risk-item {
    border-radius: 18px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
}
.risk-title { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-weight: 900; }
.progress { height: 10px; border-radius: 999px; background: #e2e8f0; }
.progress-bar { border-radius: 999px; }

.week-list { display: grid; gap: 10px; }
.week-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    border: 1px solid #e8edf5; border-radius: 18px; padding: 13px 14px;
    background: #fff;
}
.week-item.active-day { border-color: #bfdbfe; background: linear-gradient(135deg, #eff6ff, #fff); }
.week-item strong { display: block; color: var(--ink); text-transform: capitalize; }
.week-item small { color: var(--muted); font-weight: 700; }

.empty-state { text-align: center; color: var(--muted); }
.empty-state i { font-size: 3.2rem; display: block; margin-bottom: 12px; }

.quick-action {
    height: 100%; min-height: 132px;
    border: 1px solid #dbeafe;
    background: linear-gradient(180deg, #fff, #f8fbff);
    border-radius: 22px;
    padding: 18px;
    text-decoration: none;
    display: flex; flex-direction: column; justify-content: center;
    color: #1d4ed8;
    transition: all .25s ease;
}
.quick-action:hover { transform: translateY(-5px); box-shadow: 0 18px 32px rgba(37, 99, 235, .14); }
.quick-action i { font-size: 2rem; margin-bottom: 8px; }
.quick-action span { font-weight: 900; color: var(--ink); }
.quick-action small { color: var(--muted); font-weight: 600; }
.quick-action.success { color: #059669; border-color: #bbf7d0; }
.quick-action.danger { color: #dc2626; border-color: #fecaca; }
.quick-action.dark { color: #0f172a; border-color: #cbd5e1; }

.activity-list { display: grid; gap: 14px; }
.activity-item { display: flex; align-items: center; gap: 12px; }
.activity-item small { display: block; color: var(--muted); font-weight: 700; }
.activity-dot { width: 11px; height: 11px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 6px rgba(16, 185, 129, .12); }

.timeline-rail { display: grid; gap: 12px; }
.timeline-item {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 12px;
    align-items: center;
    border-radius: 18px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e8edf5;
}
.timeline-date {
    width: 44px; height: 44px; border-radius: 15px;
    display: grid; place-items: center;
    background: #eff6ff; color: #1d4ed8; font-weight: 900;
}

.receipt-banner {
    border: 1px solid #bbf7d0;
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
    border-radius: 18px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}
.receipt-banner strong { color: #047857; }
.payment-summary-card { background: linear-gradient(180deg, #ffffff, #f8fafc); border-radius: 22px; }

/* LOGIN PREMIUM */
.login-premium-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background:
        radial-gradient(circle at 18% 12%, rgba(37,99,235,.35), transparent 26%),
        radial-gradient(circle at 88% 16%, rgba(20,184,166,.26), transparent 25%),
        linear-gradient(135deg, #061224, #0f172a 52%, #0b1e42);
}
.login-shell {
    width: min(980px, 100%);
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 28px 80px rgba(0,0,0,.34);
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.14);
    backdrop-filter: blur(14px);
}
.login-visual { padding: 44px; color: #fff; position: relative; overflow: hidden; }
.login-visual:after { content: ""; position: absolute; width: 240px; height: 240px; border-radius: 50%; background: rgba(255,255,255,.08); right: -70px; bottom: -70px; }
.login-visual h1 { color: #fff; font-size: clamp(2rem, 4vw, 3.2rem); }
.login-visual p { color: #cbd5e1; }
.login-features { display: grid; gap: 12px; margin-top: 28px; }
.login-feature { display: flex; gap: 10px; align-items: center; color: #dbeafe; font-weight: 700; }
.login-feature i { color: #34d399; }
.login-card { background: rgba(255,255,255,.96); padding: 42px; }
.login-card h4 { font-size: 1.55rem; }
.login-icon {
    width: 58px; height: 58px; border-radius: 20px; display: grid; place-items: center;
    background: linear-gradient(135deg, #2563eb, #14b8a6); color: #fff; font-size: 1.7rem;
    margin-bottom: 18px;
}

@media (max-width: 1200px) {
    .dashboard-hero { grid-template-columns: 1fr; }
    .sidebar { width: 245px; }
}
@media (max-width: 992px) {
    .sidebar { width: 86px; }
    .brand-card { justify-content: center; padding: 12px; }
    .brand-title, .brand-subtitle, .side-kpi div, .nav-section, .sidebar .nav-link span, .user-toggle .user-meta { display: none !important; }
    .sidebar .nav-link { justify-content: center; }
    .sidebar .nav-link i { margin: 0; }
    .topbar-card { flex-direction: column; align-items: stretch; }
    .search-pill { min-width: auto; max-width: none; }
    .login-shell { grid-template-columns: 1fr; }
    .login-visual { display: none; }
}
@media (max-width: 576px) {
    .sidebar { width: 72px; }
    .sidebar-inner { padding: 12px 8px; }
    .main-content { padding-inline: 0 !important; }
    .dashboard-hero { border-radius: 22px; padding: 22px; }
    .hero-actions, .hero-actions .btn { width: 100%; }
    .metric-card { min-height: auto; }
    .topbar { position: static; }
    .topbar-actions { flex-wrap: wrap; }
    .login-premium-body { padding: 14px; }
    .login-card { padding: 30px 24px; }
}

/* =========================================================
   FIX HOSTINGER + RESPONSIVE PREMIUM
   Esta sección fuerza el layout correcto aunque Bootstrap
   intente darle width:100% a los hijos de .row.
   ========================================================= */
:root { --sidebar-w: 285px; --sidebar-compact-w: 88px; }

.container-fluid.app-shell {
    max-width: none !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow-x: hidden;
}

.app-shell > .row,
.container-fluid.app-shell > .row.flex-nowrap {
    --bs-gutter-x: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    min-height: 100vh;
    width: 100%;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch;
}

.app-shell > .row > .sidebar,
.container-fluid.app-shell > .row.flex-nowrap > .sidebar {
    flex: 0 0 var(--sidebar-w) !important;
    width: var(--sidebar-w) !important;
    max-width: var(--sidebar-w) !important;
    min-width: var(--sidebar-w) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.app-shell > .row > main.main-content,
.container-fluid.app-shell > .row.flex-nowrap > main.main-content {
    flex: 1 1 auto !important;
    width: calc(100% - var(--sidebar-w)) !important;
    max-width: calc(100% - var(--sidebar-w)) !important;
    min-width: 0 !important;
    padding: 22px 0 38px !important;
}

.main-content > .container-fluid {
    max-width: 1500px;
    margin-left: auto;
    margin-right: auto;
}

/* Evita que tablas y tarjetas rompan la pantalla */
.table-responsive,
.premium-card,
.card-box,
.dashboard-hero,
.metric-card,
.mini-stat {
    min-width: 0;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
}

/* Login: fuerza el diseño premium y evita que se vea plano por caché */
body.login-premium-body {
    margin: 0 !important;
    min-height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 28px !important;
    background:
        radial-gradient(circle at 18% 12%, rgba(37,99,235,.35), transparent 26%),
        radial-gradient(circle at 88% 16%, rgba(20,184,166,.26), transparent 25%),
        linear-gradient(135deg, #061224, #0f172a 52%, #0b1e42) !important;
}

.login-shell {
    width: min(1050px, 100%) !important;
    display: grid !important;
    grid-template-columns: 1.05fr .95fr !important;
}

.login-card,
.login-visual {
    min-width: 0;
}

/* Botones de menú móvil */
.mobile-menu-btn,
.mobile-sidebar-backdrop,
.sidebar-mobile-head {
    display: none;
}

/* Tablet: sidebar compacta */
@media (max-width: 1199.98px) and (min-width: 992px) {
    :root { --sidebar-w: var(--sidebar-compact-w); }

    .app-shell > .row > .sidebar,
    .container-fluid.app-shell > .row.flex-nowrap > .sidebar {
        flex-basis: var(--sidebar-compact-w) !important;
        width: var(--sidebar-compact-w) !important;
        max-width: var(--sidebar-compact-w) !important;
        min-width: var(--sidebar-compact-w) !important;
    }

    .app-shell > .row > main.main-content,
    .container-fluid.app-shell > .row.flex-nowrap > main.main-content {
        width: calc(100% - var(--sidebar-compact-w)) !important;
        max-width: calc(100% - var(--sidebar-compact-w)) !important;
    }

    .sidebar .brand-title,
    .sidebar .brand-subtitle,
    .sidebar .side-kpi div,
    .sidebar .nav-section,
    .sidebar .nav-link span,
    .sidebar .user-toggle .user-meta {
        display: none !important;
    }

    .brand-card,
    .sidebar .nav-link {
        justify-content: center !important;
    }
}

/* Celular y tablet pequeña: menú off-canvas */
@media (max-width: 991.98px) {
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .mobile-menu-btn {
        position: fixed;
        left: 16px;
        top: 16px;
        z-index: 1600;
        width: 48px;
        height: 48px;
        display: grid;
        place-items: center;
        border: 0;
        border-radius: 16px;
        color: #fff;
        background: linear-gradient(135deg, #2563eb, #14b8a6);
        box-shadow: 0 14px 32px rgba(15, 23, 42, .28);
        font-size: 1.45rem;
    }

    .mobile-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(2, 6, 23, .55);
        backdrop-filter: blur(3px);
        z-index: 1490;
        opacity: 0;
        pointer-events: none;
        transition: opacity .22s ease;
    }

    body.sidebar-open .mobile-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .app-shell > .row,
    .container-fluid.app-shell > .row.flex-nowrap {
        display: block !important;
        min-height: 100vh;
    }

    .app-shell > .row > .sidebar,
    .container-fluid.app-shell > .row.flex-nowrap > .sidebar,
    .sidebar {
        position: fixed !important;
        left: 0;
        top: 0;
        bottom: 0;
        height: 100vh;
        min-height: 100vh;
        width: min(84vw, 330px) !important;
        max-width: min(84vw, 330px) !important;
        min-width: 0 !important;
        flex: none !important;
        transform: translateX(-105%);
        transition: transform .25s ease;
        z-index: 1500;
        border-radius: 0 28px 28px 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-inner {
        min-height: 100vh;
        padding-top: 14px;
    }

    .sidebar-mobile-head {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        color: #fff;
        padding: 4px 4px 14px;
    }

    .sidebar-close-btn {
        width: 42px;
        height: 42px;
        border: 1px solid rgba(255,255,255,.14);
        border-radius: 14px;
        background: rgba(255,255,255,.09);
        color: #fff;
        display: grid;
        place-items: center;
    }

    .sidebar .brand-title,
    .sidebar .brand-subtitle,
    .sidebar .side-kpi div,
    .sidebar .nav-section,
    .sidebar .nav-link span,
    .sidebar .user-toggle .user-meta {
        display: block !important;
    }

    .sidebar .nav-link {
        justify-content: flex-start !important;
    }

    .app-shell > .row > main.main-content,
    .container-fluid.app-shell > .row.flex-nowrap > main.main-content,
    main.main-content {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        padding: 82px 0 28px !important;
    }

    .main-content > .container-fluid {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .topbar {
        position: static !important;
        margin-bottom: 14px;
        padding: 0;
    }

    .topbar-card {
        border-radius: 22px;
        padding: 12px;
    }

    .search-pill {
        width: 100%;
    }

    .dashboard-hero {
        grid-template-columns: 1fr !important;
        border-radius: 24px !important;
        padding: 22px !important;
    }

    .dashboard-hero h1 {
        font-size: 1.65rem !important;
    }

    .hero-actions .btn,
    .topbar-actions .btn,
    .topbar-actions .soft-chip {
        width: 100%;
        justify-content: center;
    }

    .topbar-actions {
        width: 100%;
        display: grid !important;
        grid-template-columns: 1fr;
    }

    .metric-card {
        border-radius: 22px;
        padding: 18px;
    }

    .metric-icon {
        width: 48px;
        height: 48px;
        border-radius: 16px;
        font-size: 1.35rem;
    }

    .card-header {
        padding: 14px 16px;
    }

    .btn-group {
        flex-wrap: wrap;
        gap: 6px;
    }

    .btn-group > .btn {
        border-radius: 12px !important;
    }

    .receipt-banner,
    .week-item,
    .timeline-item {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: flex-start;
    }

    body.login-premium-body {
        padding: 16px !important;
    }

    .login-shell {
        grid-template-columns: 1fr !important;
        border-radius: 28px !important;
        max-height: none;
    }

    .login-visual {
        display: none !important;
    }

    .login-card {
        padding: 32px 24px !important;
    }
}

@media (max-width: 575.98px) {
    .mobile-menu-btn {
        left: 12px;
        top: 12px;
        width: 46px;
        height: 46px;
    }

    .main-content > .container-fluid {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .dashboard-hero {
        padding: 18px !important;
    }

    .premium-card,
    .card-box {
        border-radius: 20px !important;
    }

    .table thead {
        font-size: .72rem;
    }

    .table tbody td,
    .table thead th {
        padding: 11px 12px;
    }

    .login-card {
        padding: 28px 20px !important;
    }
}

/* RUTAS Y COBRADORES */
.route-card {
    transition: transform .2s ease, box-shadow .2s ease;
}
.route-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow) !important;
}
.route-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #2563eb, #14b8a6);
    box-shadow: 0 12px 26px rgba(37, 99, 235, .22);
}
.route-meta {
    display: grid;
    gap: 7px;
    color: #475569;
    font-size: .92rem;
}
.route-summary-list {
    display: grid;
    gap: 12px;
}
.route-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(248, 250, 252, .82);
}
@media (max-width: 575.98px) {
    .route-summary-item {
        align-items: flex-start;
        flex-direction: column;
    }
    .route-summary-item .text-end {
        text-align: left !important;
    }
}


/* =========================================================
   MOBILE HARD FIX 20260626
   Fuerza el menú tipo app en celulares incluso cuando el
   navegador/Hostinger no aplica correctamente el breakpoint.
   ========================================================= */
html.mobile-layout,
html.mobile-layout body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

html.mobile-layout .container-fluid,
html.mobile-layout .app-shell {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow-x: hidden !important;
}

html.mobile-layout .container-fluid > .row.flex-nowrap,
html.mobile-layout .app-shell > .row,
html.mobile-layout .container-fluid.app-shell > .row.flex-nowrap {
    display: block !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100vh !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

html.mobile-layout .mobile-menu-btn {
    position: fixed !important;
    left: 14px !important;
    top: 14px !important;
    z-index: 3000 !important;
    width: 48px !important;
    height: 48px !important;
    display: grid !important;
    place-items: center !important;
    border: 0 !important;
    border-radius: 16px !important;
    color: #fff !important;
    background: linear-gradient(135deg, #2563eb, #14b8a6) !important;
    box-shadow: 0 16px 34px rgba(15, 23, 42, .30) !important;
    font-size: 1.45rem !important;
}

html.mobile-layout .mobile-sidebar-backdrop {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(2, 6, 23, .60) !important;
    backdrop-filter: blur(3px) !important;
    z-index: 2890 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity .22s ease !important;
}

html.mobile-layout body.sidebar-open .mobile-sidebar-backdrop {
    opacity: 1 !important;
    pointer-events: auto !important;
}

html.mobile-layout .sidebar,
html.mobile-layout .container-fluid > .row.flex-nowrap > .sidebar,
html.mobile-layout .app-shell > .row > .sidebar,
html.mobile-layout .container-fluid.app-shell > .row.flex-nowrap > .sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    width: min(86vw, 330px) !important;
    min-width: 0 !important;
    max-width: min(86vw, 330px) !important;
    flex: none !important;
    transform: translateX(-110%) !important;
    transition: transform .24s ease !important;
    z-index: 2950 !important;
    border-radius: 0 28px 28px 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

html.mobile-layout body.sidebar-open .sidebar {
    transform: translateX(0) !important;
}

html.mobile-layout .sidebar-inner {
    min-height: 100dvh !important;
    padding: 14px 16px 18px !important;
}

html.mobile-layout .sidebar-mobile-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    color: #fff !important;
    padding: 4px 4px 14px !important;
}

html.mobile-layout .sidebar-close-btn {
    width: 42px !important;
    height: 42px !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    border-radius: 14px !important;
    background: rgba(255,255,255,.09) !important;
    color: #fff !important;
    display: grid !important;
    place-items: center !important;
}

html.mobile-layout .sidebar .brand-title,
html.mobile-layout .sidebar .brand-subtitle,
html.mobile-layout .sidebar .side-kpi div,
html.mobile-layout .sidebar .nav-section,
html.mobile-layout .sidebar .nav-link span,
html.mobile-layout .sidebar .user-toggle .user-meta {
    display: block !important;
}

html.mobile-layout .brand-card,
html.mobile-layout .sidebar .nav-link {
    justify-content: flex-start !important;
}

html.mobile-layout .sidebar .nav-link {
    padding: 11px 12px !important;
}

html.mobile-layout .container-fluid > .row.flex-nowrap > .col,
html.mobile-layout .container-fluid > .row.flex-nowrap > .main-content,
html.mobile-layout .container-fluid > .row.flex-nowrap > main.main-content,
html.mobile-layout .app-shell > .row > main.main-content,
html.mobile-layout .container-fluid.app-shell > .row.flex-nowrap > main.main-content,
html.mobile-layout main.main-content,
html.mobile-layout .main-content {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
    margin-left: 0 !important;
    padding: 82px 0 28px !important;
}

html.mobile-layout .container,
html.mobile-layout .main-content > .container,
html.mobile-layout .main-content > .container-fluid,
html.mobile-layout .row.flex-nowrap > .col > .container,
html.mobile-layout .row.flex-nowrap > .col > .container-fluid {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

html.mobile-layout .d-flex.justify-content-between,
html.mobile-layout .d-flex.align-items-center.justify-content-between,
html.mobile-layout .d-flex.justify-content-between.align-items-center {
    flex-wrap: wrap !important;
    gap: 12px !important;
}

html.mobile-layout .d-flex.justify-content-between > .d-flex,
html.mobile-layout .d-flex.align-items-center.justify-content-between > .d-flex,
html.mobile-layout .d-flex.justify-content-between.align-items-center > .d-flex {
    width: 100% !important;
    flex-wrap: wrap !important;
}

html.mobile-layout .btn,
html.mobile-layout .btn-group .btn {
    white-space: normal !important;
}

html.mobile-layout .card-box,
html.mobile-layout .premium-card,
html.mobile-layout .card {
    border-radius: 20px !important;
}

html.mobile-layout .table-responsive {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

html.mobile-layout table.table {
    min-width: 760px;
}

html.mobile-layout form.row .col-auto,
html.mobile-layout form.row .col,
html.mobile-layout form.row .col-md-2,
html.mobile-layout form.row .col-md-3,
html.mobile-layout form.row .col-md-4,
html.mobile-layout form.row .col-md-6,
html.mobile-layout form.row .col-lg-2,
html.mobile-layout form.row .col-lg-3,
html.mobile-layout form.row .col-lg-4,
html.mobile-layout form.row .col-lg-6 {
    width: 100% !important;
    flex: 0 0 100% !important;
}

@media (max-width: 575.98px) {
    html.mobile-layout .container,
    html.mobile-layout .main-content > .container,
    html.mobile-layout .main-content > .container-fluid,
    html.mobile-layout .row.flex-nowrap > .col > .container,
    html.mobile-layout .row.flex-nowrap > .col > .container-fluid {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    html.mobile-layout h1 { font-size: 1.75rem !important; }
    html.mobile-layout h2 { font-size: 1.35rem !important; }
    html.mobile-layout h3 { font-size: 1.15rem !important; }
}
