:root {
    /* Estética "Flat Outline" */
    --bg-body: #ffffff;
    /* Fondo de pantalla blanco puro */
    --bg-surface: #ffffff;
    /* Tarjetas blanco puro (mismo que el fondo) */

    --text-main: #09090b;
    /* Casi negro, más elegante que el negro puro */
    --text-muted: #71717a;

    --border-color: #e4e4e7;
    /* Borde gris ultra suave pero definido */

    --brand-accent: #4f46e5;
    --brand-accent-light: rgba(79, 70, 229, 0.08);

    /* Sombras reducidas al mínimo, el borde hace el trabajo */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.02);

    /* Layout */
    --sidebar-width: 260px;
    --topbar-height: 75px;
}

[data-theme="dark"] {
    /* En modo oscuro, usamos un negro casi total para ese look de terminal premium */
    --bg-body: #0a0a0a;
    --bg-surface: #0a0a0a;

    --text-main: #fafafa;
    --text-muted: #a1a1aa;

    --border-color: #27272a;
    /* Borde gris oscuro */

    --brand-accent: #818cf8;
    --brand-accent-light: rgba(129, 140, 248, 0.15);

    /* Sin sombras en modo oscuro, solo bordes */
    --shadow-sm: none;
    --shadow-md: none;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

/* Layout Principal */
.app-layout {
    display: flex;
    height: 100dvh;
}

/* --- SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    justify-content: space-between;
}

.nav-menu {
    flex: 1;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    /* Más compacto, estilo Tailwind */
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 0.5rem;
    /* rounded-lg */
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.nav-item i {
    width: 20px;
    height: 20px;
}

/* Iconos ligeramente más finos */

.nav-item:hover {
    background-color: var(--bg-body);
    color: var(--text-main);
}

.nav-item.active {
    background-color: var(--bg-body);
    color: var(--primary);
    font-weight: 600;
}

[data-theme="dark"] .nav-item:hover,
[data-theme="dark"] .nav-item.active {
    background-color: rgba(255, 255, 255, 0.05);
}

/* --- MAIN CONTENT & TOPBAR --- */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: calc(100% - var(--sidebar-width));
}

.top-bar {
    height: var(--topbar-height);
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 30;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: none;
    transition: color 0.2s;
}

.menu-toggle:hover {
    color: var(--text-main);
}

.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.theme-toggle-btn:hover {
    color: var(--primary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    padding-left: 1.25rem;
    border-left: 1px solid var(--border-color);
}

.role-badge {
    background: var(--primary);
    color: var(--bg-surface);
    padding: 2px 10px;
    border-radius: 9999px;
    /* rounded-full */
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.content-area {
    min-width: 0;
    overflow-x: hidden;
}

/* --- COMPONENTES DEL DASHBOARD (Tablas y Filtros) --- */
.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.header-actions h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* Filtros (Estilo Card) */
.filter-panel {
    background-color: var(--bg-surface);
    padding: 1.5rem;
    border-radius: 0.75rem;
    /* rounded-xl */
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.filter-panel label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Inputs Modernos con Focus Ring */
.filter-panel input,
.filter-panel select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.filter-panel input:focus,
.filter-panel select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
    /* Anillo de enfoque sutil */
    background-color: var(--bg-surface);
}

[data-theme="dark"] .filter-panel input:focus,
[data-theme="dark"] .filter-panel select:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Botones estilo Tailwind */
.btn-secondary {
    padding: 0.5rem 1rem;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 0.5rem;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.hero-buttons .btn-secondary {
    color: white;
}

.btn-secondary:hover {
    background-color: var(--bg-body);
    color: var(--text-main);
}

.btn-primary {
    padding: 0.5rem 1.25rem;
    background: var(--primary);
    color: var(--bg-surface);
    border: 1px solid transparent;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    opacity: 0.5;
    transform: translateY(-1px);
}

/* Tabla (Cards con sombras) */
.table-container {
    background-color: var(--bg-surface);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 100%;
    overflow-x: scroll;
    /* Activa el scroll suave con inercia en móviles (especialmente iOS) */
    -webkit-overflow-scrolling: touch;
    /* Asegura que la caja respete los límites */
    display: block;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    white-space: nowrap;
}

.data-table th,
.data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    background-color: rgba(0, 0, 0, 0.01);
}

[data-theme="dark"] .data-table th {
    background-color: rgba(255, 255, 255, 0.02);
}

.data-table td {
    font-size: 0.9rem;
}

.data-table tbody tr {
    transition: background-color 0.15s ease;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background-color: var(--bg-body);
}

/* Badges de Estado (Más vibrantes y redondeados) */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #f1f5f9;
    color: #475569;
}

.status-login {
    background: #dcfce7;
    color: #166534;
}

[data-theme="dark"] .status-login {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Paginación */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.5rem;
}

.page-info {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.page-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-page {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn-page:hover {
    background-color: var(--bg-body);
    border-color: var(--text-muted);
}

.current-page {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0 0.5rem;
}

/* --- GLOBAL SEARCH (Top Bar) --- */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
    /* Permite que la barra de búsqueda crezca */
}

.global-search-container {
    position: relative;
    max-width: 450px;
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

/* --- SEARCH BAR --- */
.global-search-container input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.8rem;
    border: 1px solid var(--border-color);
    /* Ahora sí le ponemos borde inicial */

    background-color: transparent;
    /* Se funde con el header */
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.global-search-container input:focus {
    outline: none;
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px var(--brand-accent-light);
}

[data-theme="dark"] .global-search-container input {
    background-color: transparent;
}

/* --- FILTROS --- */
.filter-panel input,
.filter-panel select {
    background-color: transparent;
    /* Se funde con la tarjeta */
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.filter-panel input:focus,
.filter-panel select:focus {
    background-color: transparent;
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px var(--brand-accent-light);
}

/* Dropdown de Resultados */
.search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    width: 100%;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    max-height: 400px;
    overflow-y: auto;
    z-index: 50;
    display: flex;
    flex-direction: column;
}

.search-results.hidden {
    display: none;
}

.search-result-item {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: var(--bg-body);
}

.search-result-icon {
    color: var(--text-muted);
    width: 18px;
    height: 18px;
}

.search-result-title {
    font-size: 0.9rem;
    font-weight: 600;
    display: block;
}

.search-result-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
}

/* Responsive adjustments for search */
@media (max-width: 768px) {
    .global-search-container {
        display: none;
        /* Ocultar en el top-bar para móviles */
    }
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .menu-toggle {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 100;
        transform: translateX(-100%);
        box-shadow: var(--shadow-md);
        /* Sombra en móvil para separarlo del contenido */
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-wrapper {
        width: 100%;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(4px);
        /* Overlay estilo glass */
        z-index: 90;
    }

    .sidebar-overlay.open {
        display: block;
    }

    .content-area {
        padding: 1.5rem 1rem;
    }
}


/* --- SIDEBAR (Estilo SaaS) --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 91;
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    /* Sin borde inferior para verse más limpio */
}

.nav-menu {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

/* Subtítulos del menú (Ej: "MAIN MENU") */
.nav-section {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 700;
    padding: 1.5rem 1rem 0.5rem 1rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.65rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.nav-item i {
    width: 18px;
    height: 18px;
    transition: color 0.2s ease;
}

.nav-item:hover {
    color: var(--text-main);
}

/* Item Activo con Tinte de Marca */
.nav-item.active {
    background-color: var(--brand-accent-light);
    color: var(--brand-accent);
    font-weight: 600;
}

.nav-item.active i {
    color: var(--brand-accent);
}

/* --- TOP BAR --- */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: calc(100% - var(--sidebar-width));
}

.top-bar {
    height: var(--topbar-height);
    background-color: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 30;
    /* Sombrecita ultra sutil en lugar de borde duro */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.menu-toggle,
.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.menu-toggle:hover,
.theme-toggle-btn:hover {
    color: var(--brand-accent);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    padding-left: 1.25rem;
    border-left: 2px solid var(--bg-body);
}

.role-badge {
    background: var(--brand-accent-light);
    color: var(--brand-accent);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
}

/* --- SEARCH BAR (Estilo Píldora / Sin Borde Fuerte) --- */
.topbar-left {
    flex: 1;
}

.global-search-container {
    position: relative;
    max-width: 400px;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.global-search-container input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.8rem;
    border: 1px solid transparent;
    /* Sin borde inicial */
    border-radius: 8px;
    background-color: var(--bg-body);
    /* Fondo gris claro */
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.global-search-container input:focus {
    outline: none;
    background-color: var(--bg-surface);
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 4px var(--brand-accent-light);
}

[data-theme="dark"] .global-search-container input:focus {
    background-color: var(--bg-surface);
}

/* (El CSS de .search-results y el dropdown de búsqueda de mi respuesta anterior sigue igual aquí) */

/* --- CONTENT & TABLES (Cards limpias) --- */
.content-area {
    padding: 2rem 2.5rem;
    flex: 1;
    overflow-y: auto;
}

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header-actions h2 {
    font-size: 1.4rem;
    font-weight: 700;
}

.table-container,
.filter-panel {
    background-color: var(--bg-surface);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.filter-panel input,
.filter-panel select {
    background-color: var(--bg-body);
}

.filter-panel input:focus,
.filter-panel select:focus {
    background-color: var(--bg-surface);
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 4px var(--brand-accent-light);
}

.btn-primary {
    background: var(--brand-accent);
    color: white;
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Botones de acción en tablas */
.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    transition: 0.2s;
}

.btn-icon:hover {
    color: var(--brand-accent);
}

.btn-icon.delete:hover {
    color: #ef4444;
}

.hidden {
    display: none;
}

/* Tablas ultra limpias Outline */
.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: transparent;
    /* Sin fondo gris */
}

.data-table td {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Hover súper sutil para no romper la estética blanca */
.data-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.015);
}

[data-theme="dark"] .data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

/* Badges estilo Zendenta */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.status-login {
    background: #dcfce7;
    color: #166534;
}

.status-logout {
    background: #fee2e2;
    color: #b91c1c;
}

/* ... (resto del CSS Responsive igual) ... */

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--brand-accent);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--brand-accent);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Switch Toggle Estilo SaaS */
/* Switch Toggle Moderno */
.switch-container {
    position: relative;
    display: inline-block;
    min-width: 42px;
    min-height: 22px;
}

.switch-container input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--brand-accent);
}

input:checked+.slider:before {
    transform: translateX(19px);
}

/* Estilo de Inputs de tiempo */
.input-mini {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.85rem;
    background: transparent;
    color: var(--text-main);
}

/* --- CALENDAR GRID (Flat Outline) --- */
.calendar-grid-container {
    display: grid;
    grid-template-columns: 80px 1fr;
    /* Columna de tiempo fija */
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    position: relative;
    max-height: 700px;
    overflow-y: auto;
}

.time-column {
    border-right: 1px solid var(--border-color);
    display: grid;
    /* Las filas se calculan dinámicamente con JS para coincidir con el cuerpo */
}

.time-label {
    height: 60px;
    /* Altura por hora */
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.calendar-body {
    position: relative;
    display: grid;
    grid-template-rows: repeat(auto-fill, 15px);
    /* Filas de 15 min (antes 30 min) */
}

/* Líneas de fondo (Grid lines) — ahora 4 por hora (15/30/45/60 min) */
.grid-line {
    height: 15px;
    border-bottom: 1px dotted var(--border-color);
    opacity: 0.35;
}

/* Marca de media hora (:30) */
.grid-line:nth-child(4n+2) {
    border-bottom-style: dashed;
    opacity: 0.65;
}

/* Marca de la hora en punto */
.grid-line:nth-child(4n) {
    border-bottom-style: solid;
    opacity: 1;
}

/* Estilo de la Cita (Appointment Card) */
.appointment-card {
    position: absolute;
    left: 10px;
    right: 10px;
    background-color: var(--brand-accent-light);
    border-left: 4px solid var(--brand-accent);
    border-radius: 8px;
    padding: 8px 12px;
    z-index: 10;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.appointment-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.appointment-time {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--brand-accent);
}

.appointment-client {
    font-size: 0.85rem;
    font-weight: 600;
    display: block;
}

.appointment-service {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- RESPONSIVO PARA LA TABLA DE HORARIOS (Flat Outline) --- */
.availability-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    /* Permite que los elementos salten de línea si no caben */
    gap: 1rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border-color);
}

.day-label {
    flex: 0 0 100px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.time-inputs {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    /* Ocupa el espacio intermedio */
    min-width: 240px;
    /* Si la pantalla es más pequeña que esto, forzará el wrap */
}

/* Los inputs se estiran para ocupar todo el espacio disponible */
.time-inputs .input-mini {
    flex: 1;
    width: 100%;
}

.toggle-wrapper {
    margin-left: auto;
    display: flex;
    align-items: center;
}

/* Salto inteligente para móviles */
@media (max-width: 576px) {
    .availability-row {
        gap: 0.5rem;
        padding: 1rem 0;
    }

    .day-label {
        flex: 1;
        /* El día toma todo el espacio a la izquierda */
    }

    .toggle-wrapper {
        order: 2;
        /* El toggle se queda arriba a la derecha */
    }

    .time-inputs {
        order: 3;
        /* Los inputs bajan a una nueva línea */
        flex: 0 0 100%;
        /* Ocupan el 100% del ancho del contenedor */
        margin-top: 0.5rem;
    }
}

/* Panel Lateral (Slide-in) */
.slide-panel-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(9, 9, 11, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.slide-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

.slide-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 550px;
    height: 100dvh;
    background-color: var(--bg-surface);
    box-shadow: -10px 0 25px rgba(0, 0, 0, 0.05);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.slide-panel-overlay.active .slide-panel {
    transform: translateX(0);
}

.slide-panel-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Corrección para que el formulario respete el alto y permita el scroll */
.slide-panel form {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: auto !important;
    /* Sobrescribe el alto en línea */
    overflow: hidden;
    /* Evita que empuje el footer fuera de la pantalla */
}

.slide-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}


.slide-panel-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface);
}

/* Zona de Carga de Imágenes (Dropzone) */
.image-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background-color: var(--bg-media);
    margin-bottom: 1.5rem;
}

.image-dropzone.dragover {
    border-color: var(--brand-accent);
    background-color: rgba(59, 130, 246, 0.05);
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    cursor: grab;
    background: #fff;
}

.image-item:active {
    cursor: grabbing;
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   ESTILOS DE FORMULARIO PARA EL PANEL LATERAL
   ========================================= */

/* Cuadrícula del formulario */
.modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.full-width {
    grid-column: span 2;
}

/* Estilo de los Labels */
.input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* Estilo unificado para Inputs, Selects y Textareas */
.slide-panel-body input[type="text"],
.slide-panel-body input[type="number"],
.slide-panel-body select,
.slide-panel-body textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: transparent;
    /* Mantiene la estética limpia */
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-main);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

/* Estado de Foco (Focus Ring) con color de acento */
.slide-panel-body input:focus,
.slide-panel-body select:focus,
.slide-panel-body textarea:focus {
    outline: none;
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 4px var(--brand-accent-light);
    background-color: var(--bg-surface);
}

/* Reglas específicas para el Textarea */
.slide-panel-body textarea {
    resize: vertical;
    /* Solo permite estirar hacia abajo */
    min-height: 85px;
    line-height: 1.5;
}

/* Ajuste Responsive para móviles: pasa de 2 a 1 columna */
@media (max-width: 480px) {
    .modal-grid {
        grid-template-columns: 1fr;
    }

    .full-width {
        grid-column: span 1;
    }
}

/* Animación de carga para botones */
@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.spin-icon {
    animation: spin 1s linear infinite;
}

/* Perfil de Barbero - Estilo Portafolio */
.profile-header {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    padding: 2rem 0;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border-color);
}

.profile-pic-container {
    flex-shrink: 0;
}

.profile-pic-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    padding: 4px;
}

.profile-info h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-bio {
    max-width: 450px;
    line-height: 1.6;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.profile-link {
    color: var(--brand-accent);
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* El Feed (Grilla de 3 columnas) */
.work-feed {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.post-item {
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.post-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-item:hover img {
    transform: scale(1.05);
}

.post-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: opacity 0.2s;
}

.post-item:hover .post-overlay {
    opacity: 1;
}

/* =========================================
   DIRECTORIO DE EQUIPO
   ========================================= */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.team-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

/* Efecto al pasar el ratón */
.team-card:hover {
    transform: translateY(-5px);
    border-color: var(--brand-accent);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

.team-card-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    /* Anillo exterior sutil */
    border: 4px solid var(--bg-body);
    box-shadow: 0 0 0 1px var(--border-color);
    transition: transform 0.3s ease;
}

.team-card:hover .team-card-img {
    transform: scale(1.05);
}

.team-card-img img,
.team-card-img .placeholder-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-img {
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.team-card-info h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.view-profile-link {
    font-size: 0.85rem;
    color: var(--brand-accent);
    font-weight: 600;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.team-card:hover .view-profile-link {
    opacity: 1;
    transform: translateY(0);
}