﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

body {
    font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
    background-color: #f8fafc;
    color: #334155;
    line-height: 1.6
}

.dashboard-container {
    display: flex;
    min-height: 100vh
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000
}

/* Contenido con scroll */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden
}

    .sidebar-content::-webkit-scrollbar {
        width: 8px
    }

    .sidebar-content::-webkit-scrollbar-thumb {
        background: rgba(0,0,0,.2);
        border-radius: 4px
    }

        .sidebar-content::-webkit-scrollbar-thumb:hover {
            background: rgba(0,0,0,.3)
        }

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0
}

/* ───── Footer + Logout ───── */
.sidebar-footer {
    padding: 1.5rem 20px 1.5rem 1.5rem; /* aire a la derecha */
    border-top: 1px solid #e2e8f0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px
}

.logout-form {
    margin-left: auto !important;
    display: inline-flex;
    flex-shrink: 0
}

/* Botón logout CIRCULAR (todas las vistas) */
.logout-btn {
    --c: #ef4444;
    --c2: #dc2626;
    box-sizing: border-box !important;
    width: 40px;
    height: 40px; /* círculo real desktop */
    padding: 0 !important;
    min-width: 0 !important;
    border-radius: 50% !important;
    display: inline-grid !important;
    place-items: center !important;
    gap: 0;
    line-height: 1;
    color: var(--c) !important;
    background: transparent !important;
    border: 1px solid var(--c) !important;
    cursor: pointer;
    transition: background-color .15s,color .15s,border-color .15s,transform .08s
}
    /* neutraliza clases Bootstrap si quedaran */
    .logout-btn.btn, .logout-btn[class*="btn-"] {
        width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
        min-width: 0 !important;
        border-radius: 50% !important;
        border: 1px solid var(--c) !important;
        color: var(--c) !important;
        background: transparent !important;
        display: inline-grid !important;
        place-items: center !important
    }

    /* Icono + oculta texto para no deformar el círculo */
    .logout-btn i {
        font-size: 16px;
        color: currentColor
    }

    .logout-btn span {
        display: none !important
    }

    /* Hover invertido */
    .logout-btn:hover, .logout-btn:focus {
        background: var(--c) !important;
        color: #fff !important;
        border-color: var(--c2) !important;
        transform: translateY(-1px)
    }

        .logout-btn:hover i, .logout-btn:focus i {
            color: #fff !important
        }

    .logout-btn:active {
        background: var(--c2) !important;
        color: #fff !important;
        transform: translateY(0)
    }

    .logout-btn:focus-visible {
        outline: 2px solid rgba(239,68,68,.35);
        outline-offset: 2px
    }

/* Mobile: diámetro un poco menor */
@media (max-width:768px) {
    .logout-btn, .logout-btn.btn, .logout-btn[class*="btn-"] {
        width: 36px !important;
        height: 36px !important
    }

        .logout-btn i {
            font-size: 14px
        }
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: .75rem
}

    .logo i {
        width: 2rem;
        height: 2rem;
        background: #3b82f6;
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: .5rem;
        font-size: 1rem
    }

.logo-text h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b
}

.logo-text span {
    font-size: .75rem;
    color: #64748b
}

/* Nav */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0
}

    .sidebar-nav ul {
        list-style: none
    }

.nav-item {
    margin: .25rem 0
}

    .nav-item a {
        display: flex;
        align-items: center;
        gap: .75rem;
        padding: .75rem 1.5rem;
        color: #64748b;
        text-decoration: none;
        transition: .2s;
        border-radius: .375rem;
        margin: 0 .75rem
    }

        .nav-item a:hover {
            background: #f1f5f9;
            color: #1e293b
        }

    .nav-item.active {
        background: #3b82f6;
        color: #fff
    }

        .nav-item.active a {
            background: #3b82f6;
            color: #fff
        }

    .nav-item i {
        width: 1.25rem;
        text-align: center
    }

/* Perfil */
.user-profile {
    display: flex;
    align-items: center;
    gap: .75rem
}

.user-avatar {
    width: 2rem;
    height: 2rem;
    background: #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 600;
    color: #64748b
}

.user-info {
    display: flex;
    flex-direction: column
}

.user-name {
    font-size: .875rem;
    font-weight: 600;
    color: #1e293b
}

.user-role {
    font-size: .75rem;
    color: #64748b
}

/* Main */
.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column
}

.dashboard-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem
}

.sidebar-close {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #334155;
    cursor: pointer;
    z-index: 1001
}

@media (max-width:768px) {
    .sidebar-close {
        display: block
    }
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #64748b;
    cursor: pointer;
    padding: .5rem;
    border-radius: .375rem
}

    .sidebar-toggle:hover {
        background: #f1f5f9
    }

.search-container {
    position: relative;
    max-width: 400px;
    width: 100%
}

    .search-container i {
        position: absolute;
        left: .75rem;
        top: 50%;
        transform: translateY(-50%);
        color: #64748b;
        font-size: .875rem
    }

    .search-container input {
        width: 100%;
        padding: .5rem .75rem .5rem 2.25rem;
        border: 1px solid #e2e8f0;
        border-radius: .375rem;
        font-size: .875rem;
        background: #f8fafc
    }

        .search-container input:focus {
            outline: none;
            border-color: #3b82f6;
            background: #fff
        }

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem
}

.notification-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.125rem;
    color: #64748b;
    cursor: pointer;
    padding: .5rem;
    border-radius: .375rem
}

    .notification-btn:hover {
        background: #f1f5f9
    }

.notification-badge {
    position: absolute;
    top: .25rem;
    right: .25rem;
    background: #ef4444;
    color: #fff;
    font-size: .625rem;
    padding: .125rem .375rem;
    border-radius: .75rem;
    min-width: 1.25rem;
    text-align: center
}

/* Content */
.dashboard-content {
    flex: 1;
    padding: 2rem
}

.page-title {
    margin-bottom: 2rem
}

    .page-title h1 {
        font-size: 2rem;
        font-weight: 700;
        color: #1e293b;
        margin-bottom: .5rem
    }

    .page-title p {
        color: #64748b;
        font-size: .875rem
    }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(250px,1fr));
    gap: 1.5rem;
    margin-bottom: 2rem
}

.stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: .75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0,0,0,.1)
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem
}

.stat-title {
    font-size: .875rem;
    font-weight: 500;
    color: #64748b
}

.stat-icon {
    color: #64748b;
    font-size: 1.125rem
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: .5rem
}

.stat-change {
    display: flex;
    align-items: center;
    gap: .25rem;
    font-size: .75rem
}

    .stat-change.positive {
        color: #059669
    }

    .stat-change.negative {
        color: #dc2626
    }

    .stat-change i {
        font-size: .625rem
    }

.stat-description {
    color: #64748b;
    margin-left: .25rem
}

/* Content grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem
}

.card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: .75rem;
    box-shadow: 0 1px 3px 0 rgba(0,0,0,.1)
}

.card-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #f1f5f9
}

    .card-header h3 {
        font-size: 1.125rem;
        font-weight: 600;
        color: #1e293b;
        margin-bottom: .25rem
    }

    .card-header p {
        font-size: .875rem;
        color: #64748b
    }

.card-content {
    padding: 1.5rem
}

/* Booking */
.booking-list {
    display: flex;
    flex-direction: column;
    gap: 1rem
}

.booking-item {
    display: flex;
    align-items: center;
    gap: 1rem
}

.booking-avatar {
    width: 2.25rem;
    height: 2.25rem;
    background: #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 600;
    color: #64748b
}

.booking-info {
    flex: 1
}

.booking-customer {
    font-size: .875rem;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: .125rem
}

.booking-details {
    font-size: .75rem;
    color: #64748b
}

.booking-status {
    display: flex;
    align-items: center;
    gap: .75rem
}

.booking-amount {
    font-size: .875rem;
    font-weight: 600;
    color: #1e293b
}

/* Badges */
.status-badge {
    padding: .25rem .5rem;
    border-radius: .375rem;
    font-size: .75rem;
    font-weight: 500;
    text-transform: capitalize
}

    .status-badge.active {
        background: #dbeafe;
        color: #1d4ed8
    }

    .status-badge.confirmed {
        background: #f3e8ff;
        color: #7c3aed
    }

    .status-badge.pending {
        background: #fef3c7;
        color: #d97706
    }

    .status-badge.completed {
        background: #d1fae5;
        color: #059669
    }

    .status-badge.available {
        background: #d1fae5;
        color: #059669
    }

    .status-badge.rented {
        background: #dbeafe;
        color: #1d4ed8
    }

    .status-badge.maintenance {
        background: #fee2e2;
        color: #dc2626
    }

/* Fleet */
.fleet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(300px,1fr));
    gap: 1rem
}

.fleet-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: .5rem
}

.fleet-image {
    width: 7rem;
    height: 5rem;
    border-radius: .375rem;
    overflow: hidden;
    background: #f1f5f9
}

    .fleet-image img {
        width: 100%;
        height: 100%;
        object-fit: cover
    }

.fleet-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .5rem
}

.fleet-header {
    display: flex;
    justify-content: space-between;
    align-items: center
}

    .fleet-header h4 {
        font-size: .875rem;
        font-weight: 600;
        color: #1e293b
    }

.fleet-menu {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: .25rem;
    border-radius: .25rem
}

    .fleet-menu:hover {
        background: #f1f5f9
    }

.fleet-details {
    display: flex;
    gap: 1rem;
    font-size: .75rem;
    color: #64748b
}

    .fleet-details span {
        display: flex;
        align-items: center;
        gap: .25rem
    }

    .fleet-details i {
        font-size: .625rem
    }

.fleet-footer {
    display: flex;
    justify-content: space-between;
    align-items: center
}

.fleet-rate {
    font-size: .875rem;
    font-weight: 600;
    color: #1e293b
}

/* Responsive */
@media (max-width:1024px) {
    .content-grid {
        grid-template-columns: 1fr
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit,minmax(200px,1fr))
    }
}

@media (max-width:768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .3s ease
    }

        .sidebar.open {
            transform: translateX(0)
        }

    .main-content {
        margin-left: 0
    }

    .sidebar-toggle {
        display: block
    }

    .dashboard-content {
        padding: 1rem
    }

    .stats-grid {
        grid-template-columns: 1fr
    }

    .fleet-grid {
        grid-template-columns: 1fr
    }

    .fleet-item {
        flex-direction: column
    }

    .fleet-image {
        width: 100%;
        height: 8rem
    }
}

@media (max-width:480px) {
    .booking-item {
        flex-direction: column;
        align-items: flex-start;
        gap: .75rem
    }

    .booking-status {
        width: 100%;
        justify-content: space-between
    }

    .search-container {
        max-width: 200px
    }
}

@media (max-width:768px) {
    .main-content.expanded {
        width: 100%;
        margin-left: 0
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 100%;
        z-index: 999;
        background: #fff
    }
}

/* Submenú */
.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
    list-style: none;
    padding-left: 1.5rem;
    margin-top: .25rem
}

.nav-item.open > .submenu {
    display: block
}

.submenu-icon {
    margin-left: auto;
    font-size: .8rem
}

.submenu li {
    margin: .25rem 0
}

    .submenu li a {
        font-size: .9rem;
        color: #64748b;
        padding: .5rem .75rem;
        display: block;
        border-radius: .375rem
    }

        .submenu li a.active {
            background: #3b82f6;
            color: #fff
        }

.swal2-container {
    z-index: 99999 !important
}

.has-submenu.open > .submenu {
    max-height: 500px
}

.nav-link.active {
    background-color: #3b82f6;
    font-weight: bold;
    color: #fff
}

    .nav-link.active:hover {
        background-color: #2563eb;
        color: #fff
    }

/* Skeletons */
.skel {
    position: relative;
    background: #eee;
    border-radius: 8px;
    overflow: hidden
}

    .skel::after {
        content: "";
        position: absolute;
        inset: 0;
        transform: translateX(-100%);
        background: linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,.6),rgba(255,255,255,0));
        animation: skel-shimmer 1.2s infinite
    }

@keyframes skel-shimmer {
    100% {
        transform: translateX(100%)
    }
}

.skel-btn {
    height: 36px;
    width: 180px
}

.skel-title {
    height: 24px;
    width: 40%;
    margin-bottom: 12px
}

.skel-row {
    height: 14px;
    width: 100%;
    margin: 10px 0
}


/* Paleta y tokens */
:root {
    --btn-radius: .6rem;
    --btn-shadow: 0 4px 14px rgba(0,0,0,.08);
    --btn-shadow-hover: 0 6px 18px rgba(0,0,0,.12);
    --brand-success: #10B981; /* emerald */
    --brand-success-hover: #059669; /* emerald darker */
    --brand-danger: #EF4444; /* red-500 */
    --brand-danger-hover: #DC2626; /* red-600 */
}

/* Base para TODOS tus “brand buttons” */
.btn-brand {
    border: none;
    border-radius: var(--btn-radius);
    color: #fff !important;
    box-shadow: var(--btn-shadow);
    transition: background-color .15s ease, box-shadow .2s ease, transform .05s ease;
}

    .btn-brand:hover {
        transform: translateY(-1px);
        box-shadow: var(--btn-shadow-hover);
        filter: none; /* evita grises por filtros globales */
    }

    .btn-brand:focus-visible {
        outline: 3px solid rgba(99,102,241,.35); /* ring morado suave */
        outline-offset: 2px;
    }

    .btn-brand:disabled {
        opacity: .6;
        cursor: not-allowed;
        transform: none;
        box-shadow: var(--btn-shadow);
    }

/* Variantes */
.btn-brand-success {
    background: var(--brand-success);
}

    .btn-brand-success:hover {
        background: var(--brand-success-hover);
    }

.btn-brand-danger {
    background: var(--brand-danger);
}

    .btn-brand-danger:hover {
        background: var(--brand-danger-hover);
    }

/* --- RadzenButton compat: aplicar el mismo look --- */
.rz-button.btn-brand {
    border: none;
    border-radius: var(--btn-radius);
    color: #fff;
    box-shadow: var(--btn-shadow);
}

    .rz-button.btn-brand:hover,
    .rz-button.btn-brand:focus {
        box-shadow: var(--btn-shadow-hover);
        transform: translateY(-1px);
    }

.rz-button.btn-brand-success {
    background: var(--brand-success);
    border-color: var(--brand-success);
}

    .rz-button.btn-brand-success:hover,
    .rz-button.btn-brand-success:focus {
        background: var(--brand-success-hover);
        border-color: var(--brand-success-hover);
    }

.rz-button.btn-brand-danger {
    background: var(--brand-danger);
    border-color: var(--brand-danger);
}

    .rz-button.btn-brand-danger:hover,
    .rz-button.btn-brand-danger:focus {
        background: var(--brand-danger-hover);
        border-color: var(--brand-danger-hover);
    }

/* Asegura que ningún tema/grisaje sobrescriba el hover */
.btn-brand:hover,
.rz-button.btn-brand:hover {
    filter: none !important;
}

/* Base ghost con soporte de color por variables */
.btn-ghost {
    --ghost-color: #6366f1; /* indigo por default */
    --ghost-color-strong: #4f46e5;
    --ghost-bg-weak: rgba(99,102,241,.12);
    border: 1px solid var(--ghost-color);
    background: transparent;
    color: var(--ghost-color);
    border-radius: .6rem;
    padding: .5rem 1rem;
    transition: background-color .15s ease, box-shadow .2s ease, color .15s ease, transform .05s ease;
}

    .btn-ghost:hover {
        background: var(--ghost-bg-weak);
        color: var(--ghost-color-strong);
        transform: translateY(-1px);
        box-shadow: 0 6px 18px rgba(0,0,0,.08);
    }

    .btn-ghost:focus-visible {
        outline: 3px solid rgba(99,102,241,.35);
        outline-offset: 2px;
    }

    .btn-ghost:disabled {
        opacity: .6;
        cursor: not-allowed;
        transform: none;
    }

/* Variantes de color (ajustan las variables) */
.btn-ghost-indigo {
    --ghost-color: #6366f1; /* indigo-500 */
    --ghost-color-strong: #4f46e5; /* indigo-600 */
    --ghost-bg-weak: rgba(99,102,241,.12);
}

.btn-ghost-emerald {
    --ghost-color: #10b981; /* emerald-500 */
    --ghost-color-strong: #059669; /* emerald-600 */
    --ghost-bg-weak: rgba(16,185,129,.12);
}

.btn-ghost-sky {
    --ghost-color: #0ea5e9; /* sky-500 */
    --ghost-color-strong: #0284c7; /* sky-600 */
    --ghost-bg-weak: rgba(14,165,233,.12);
}

.btn-ghost-rose {
    --ghost-color: #f43f5e; /* rose-500 */
    --ghost-color-strong: #e11d48; /* rose-600 */
    --ghost-bg-weak: rgba(244,63,94,.12);
}

/* Compatibilidad RadzenButton */
.rz-button.btn-ghost {
    border: 1px solid var(--ghost-color);
    background: transparent;
    color: var(--ghost-color);
    border-radius: .6rem;
}

    .rz-button.btn-ghost:hover,
    .rz-button.btn-ghost:focus {
        background: var(--ghost-bg-weak);
        color: var(--ghost-color-strong);
        transform: translateY(-1px);
        box-shadow: 0 6px 18px rgba(0,0,0,.08);
    }

.action-buttons {
    display: inline-flex;
    gap: 8px; /* separa sin “pegar” botones */
    align-items: center;
}
    /* opcional: tamaño cuadrado para icon-only */
    .action-buttons .rz-button {
        min-width: 36px;
        height: 36px;
        padding: 0 10px; /* deja un poco de aire si agregas Text */
        border-radius: .6rem; /* mismo token que usas en btn-brand */
    }


/* ================= LeadSales – botón hamburguesa ================= */
.ls-hamburger {
    display: none; /* oculto por defecto */
    border: 0;
    background: transparent;
    padding: .4rem .5rem;
    border-radius: .5rem;
    cursor: pointer;
    align-items: center;
}

    .ls-hamburger:hover {
        background: #f1f5f9;
    }

/* No mostrar el botón en mobile (≤768) */
@media (max-width: 768px) {
    .ls-hamburger {
        display: none;
    }
}

/* Mostrar el botón SÓLO en desktop (≥769) */
@media (min-width: 769px) {
    .ls-hamburger {
        display: inline-flex;
    }
}

/* ================= LeadSales – comportamiento del sidebar en desktop ================= */
/* Estado base: oculto SIEMPRE */
.ls-toolbar .ls-hamburger {
    display: none !important;
}

/* Mobile (≤768): mantener oculto sí o sí */
@media (max-width: 768px) {
    .ls-toolbar .ls-hamburger {
        display: none !important;
    }
}

/* Desktop (≥769): mostrar */
@media (min-width: 769px) {
    .ls-toolbar .ls-hamburger {
        display: inline-flex !important;
        align-items: center;
        border: 0;
        background: transparent;
        padding: .4rem .5rem;
        border-radius: .5rem;
        cursor: pointer;
    }

        .ls-toolbar .ls-hamburger:hover {
            background: #f1f5f9;
        }
}

/* Desktop por defecto: sidebar oculto, main a ancho completo */
/* Solo LeadSales (porque el checkbox #ls-toggle solo existe ahí) */
@media (min-width: 769px) {

    /* Transiciones SOLO si hay toggle en la página */
    .dashboard-container:has(#ls-toggle) .sidebar {
        will-change: transform;
        transition: transform .25s ease;
    }

    .dashboard-container:has(#ls-toggle) .main-content {
        transition: margin-left .25s ease;
    }

    /* Estado por defecto en LeadSales (unchecked): sidebar oculto, main ancho completo */
    .dashboard-container:has(#ls-toggle:not(:checked)) .sidebar {
        transform: translateX(-280px) !important;
    }

    .dashboard-container:has(#ls-toggle:not(:checked)) .main-content {
        margin-left: 0 !important;
    }

    /* Cuando el usuario activa el toggle: mostrar sidebar y empujar main */
    .dashboard-container:has(#ls-toggle:checked) .sidebar {
        transform: translateX(0) !important;
    }

    .dashboard-container:has(#ls-toggle:checked) .main-content {
        margin-left: 280px !important;
    }
}


/* Mobile se queda como ya lo tienes (overlay); el toggle no afecta nada ahí */
