/* ============================================
   VALLAS HABITAT - DISEÑO MINIMALISTA
   Paleta: Negro + Rojo
   ============================================ */

/* Reset y Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colores principales */
    --primary-red: #ef4444;
    --primary-red-dark: #dc2626;
    --primary-red-light: #f87171;
    
    /* Escala de grises */
    --black: #0a0a0a;
    --gray-900: #1a1a1a;
    --gray-800: #262626;
    --gray-700: #404040;
    --gray-600: #525252;
    --gray-500: #737373;
    --gray-400: #a3a3a3;
    --gray-300: #d4d4d4;
    --gray-200: #e5e5e5;
    --gray-100: #f5f5f5;
    --white: #ffffff;
    
    /* Colores de estado */
    --success: #10b981;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    /* Dimensiones */
    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
    --topbar-height: 70px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--black);
    color: var(--white);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--gray-900);
}

/* Collapsed removido - solo móvil usa toggle */

/* Header del Sidebar */
.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--gray-900);
    min-height: var(--topbar-height);
    position: relative;
}

.sidebar-close {
    display: none;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gray-900);
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.sidebar-close:hover {
    background: var(--primary-red);
}

@media (max-width: 1024px) {
    .sidebar-close {
        display: flex;
    }
}

.sidebar-toggle {
    background: var(--gray-900);
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.3s;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: var(--primary-red);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    flex: 1;
    letter-spacing: -0.5px;
}

.sidebar-logo i {
    font-size: 1.75rem;
    color: var(--primary-red);
}

.sidebar.collapsed .sidebar-title {
    display: none;
}

.sidebar.collapsed .sidebar-logo {
    justify-content: center;
}

.sidebar.collapsed .sidebar-header {
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
}

/* Navegación del Sidebar */
.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: var(--gray-900);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--gray-700);
    border-radius: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--gray-400);
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
    font-weight: 500;
    font-size: 0.95rem;
}

.sidebar-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary-red);
    transition: height 0.3s;
}

.sidebar-link:hover {
    color: var(--white);
    background: var(--gray-900);
}

.sidebar-link:hover::before {
    height: 60%;
}

.sidebar-link.active {
    color: var(--white);
    background: var(--gray-900);
}

.sidebar-link.active::before {
    height: 60%;
}

.sidebar-link i {
    font-size: 1.25rem;
    min-width: 24px;
    text-align: center;
}

.sidebar.collapsed .sidebar-link {
    justify-content: center;
    padding: 1rem 0;
    gap: 0;
}

.sidebar.collapsed .sidebar-link span {
    display: none;
}

.sidebar.collapsed .sidebar-link i {
    margin: 0;
}

/* Footer del Sidebar */
.sidebar-footer {
    border-top: 1px solid var(--gray-900);
    padding: 1rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--gray-900);
    border-radius: 12px;
    margin-bottom: 0.5rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-red);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar i {
    font-size: 1.5rem;
    color: var(--white);
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar.collapsed .user-info {
    display: none;
}

.sidebar.collapsed .sidebar-user {
    justify-content: center;
    padding: 0.75rem 0;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: var(--gray-400);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    font-weight: 500;
    font-size: 0.875rem;
}

.sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--primary-red);
}

.sidebar.collapsed .sidebar-logout {
    justify-content: center;
    padding: 0.75rem 0;
    gap: 0;
}

.sidebar.collapsed .sidebar-logout span {
    display: none;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    background: var(--gray-100);
}

/* Expanded removido - sidebar siempre visible en desktop */

/* Topbar */
.topbar {
    background: var(--white);
    padding: 0 2rem;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-toggle {
    display: none;
    background: var(--gray-100);
    border: none;
    color: var(--gray-900);
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.3s;
}

.mobile-toggle:hover {
    background: var(--primary-red);
    color: var(--white);
}

.topbar-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.5px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--gray-100);
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.topbar-user i {
    color: var(--primary-red);
}

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

/* ============================================
   CARDS Y COMPONENTES
   ============================================ */
.card {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--gray-200);
    transition: all 0.3s;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.card h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card h2 i {
    color: var(--primary-red);
}

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

/* Dashboard Grid - 2 columnas */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: var(--white);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--gray-200);
    transition: all 0.3s;
    min-width: 0;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-red);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--white);
    flex-shrink: 0;
}

.stat-icon.red {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
}

.stat-icon.black {
    background: linear-gradient(135deg, var(--gray-800) 0%, var(--black) 100%);
}

.stat-icon.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-icon.orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-icon.purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.stat-icon.blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.stat-icon.yellow {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.stat-icon.gray {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
}

.stat-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.stat-content h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
    margin-bottom: 0.25rem;
    word-break: break-all;
    overflow-wrap: anywhere;
    max-width: 100%;
}

/* Ajustar tamaño para números muy largos */
@media (max-width: 1400px) {
    .stat-number {
        font-size: 1.5rem;
    }
}

@media (max-width: 1200px) {
    .stat-number {
        font-size: 1.35rem;
    }
}

@media (max-width: 768px) {
    .stat-number {
        font-size: 1.5rem;
    }
}

.stat-content small {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.5px;
}

.page-header h1 i {
    color: var(--primary-red);
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
}

.alert i {
    font-size: 1.25rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    border: none;
    border-radius: 10px;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary-red);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-red-dark);
}

.btn-secondary {
    background: var(--gray-800);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--black);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--primary-red);
    color: var(--white);
}

.btn-danger:hover {
    background: var(--primary-red-dark);
}

.btn-info {
    background: #3b82f6;
    color: var(--white);
}

.btn-info:hover {
    background: #2563eb;
}

.btn-warning {
    background: #f59e0b;
    color: var(--white);
}

.btn-warning:hover {
    background: #d97706;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Utilities */
.flex {
    display: flex;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--gray-500);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-toggle {
        display: flex;
    }
    
    .topbar {
        padding: 0 1rem;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}


/* ============================================
   TABLAS
   ============================================ */
.table-container {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: var(--gray-900);
}

.table th {
    padding: 1.25rem 1.5rem;
    text-align: left;
    font-weight: 600;
    color: var(--white);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
    font-size: 0.95rem;
}

.table tbody tr {
    transition: all 0.3s;
}

.table tbody tr:hover {
    background: var(--gray-100);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Filtros */
.filters-bar {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--gray-200);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.filters-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
    width: 100%;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--gray-900);
    background: var(--white);
    transition: all 0.3s;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Page Header Actions */
.page-header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* Grid de vallas */
.vallas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.valla-card {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    border: 2px solid var(--gray-200);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.valla-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gray-300);
    transition: all 0.3s;
}

.valla-card.disponible::before {
    background: var(--success);
}

.valla-card.ocupada::before {
    background: var(--primary-red);
}

.valla-card.reservada::before {
    background: var(--warning);
}

.valla-card.bloqueada::before {
    background: var(--gray-600);
}

.valla-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-red);
}

.valla-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.valla-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

.valla-card-body {
    margin-bottom: 1rem;
}

.valla-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--gray-600);
    font-size: 0.875rem;
}

.valla-info i {
    color: var(--primary-red);
    width: 20px;
}

.valla-card-footer {
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--gray-200);
}

.tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab:hover {
    color: var(--gray-900);
}

.tab.active {
    color: var(--primary-red);
    border-bottom-color: var(--primary-red);
}


/* ============================================
   CALENDARIO
   ============================================ */
.calendar-container {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--gray-200);
    overflow-x: auto;
}

.calendar-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 800px;
}

.calendar-table thead th {
    background: var(--gray-900);
    color: var(--white);
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.calendar-table thead th:first-child {
    border-radius: 12px 0 0 0;
    text-align: left;
    padding-left: 1.5rem;
}

.calendar-table thead th:last-child {
    border-radius: 0 12px 0 0;
}

.calendar-table tbody td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    border-right: 1px solid var(--gray-200);
    text-align: center;
    vertical-align: middle;
    transition: all 0.3s;
}

.calendar-table tbody td:first-child {
    text-align: left;
    font-weight: 600;
    color: var(--gray-900);
    background: var(--gray-100);
    padding-left: 1.5rem;
    position: sticky;
    left: 0;
    z-index: 5;
}

.calendar-table tbody td:last-child {
    border-right: none;
}

.calendar-table tbody tr:last-child td {
    border-bottom: none;
}

.calendar-table tbody tr:hover td {
    background: var(--gray-50);
}

.calendar-cell {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.calendar-cell.disponible {
    background: #d1fae5;
    color: #065f46;
}

.calendar-cell.ocupada {
    background: #fee2e2;
    color: #991b1b;
}

.calendar-cell.reservada {
    background: #fef3c7;
    color: #92400e;
}

.calendar-cell.bloqueada {
    background: #e5e7eb;
    color: #6b7280;
}

.calendar-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.calendar-legend {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-200);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.legend-color {
    width: 40px;
    height: 24px;
    border-radius: 6px;
}

/* Controles de fecha */
.date-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.date-controls input[type="date"],
.date-controls input[type="month"] {
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--gray-900);
    background: var(--white);
    transition: all 0.3s;
}

.date-controls input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Timeline view */
.timeline-container {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--gray-200);
}

.timeline-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    border-left: 4px solid var(--gray-300);
    margin-bottom: 1rem;
    border-radius: 0 12px 12px 0;
    background: var(--gray-50);
    transition: all 0.3s;
}

.timeline-item:hover {
    border-left-color: var(--primary-red);
    background: var(--white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.timeline-date {
    min-width: 120px;
    font-weight: 700;
    color: var(--gray-900);
}

.timeline-content {
    flex: 1;
}

.timeline-title {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.timeline-details {
    color: var(--gray-600);
    font-size: 0.875rem;
}


/* ============================================
   FORMULARIOS
   ============================================ */
.form-container {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--gray-200);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.875rem;
}

.form-group label i {
    color: var(--primary-red);
    margin-right: 0.5rem;
}

.form-group label .required {
    color: var(--primary-red);
    margin-left: 0.25rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--gray-900);
    background-color: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-control:disabled {
    background-color: var(--gray-100);
    cursor: not-allowed;
    color: var(--gray-500);
}

.form-control::placeholder {
    color: var(--gray-400);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ef4444' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px 12px;
    padding-right: 3rem;
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--gray-600);
}

.form-group small i {
    color: var(--info);
}

/* File upload */
.file-upload {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
    border: 2px dashed var(--gray-300);
    border-radius: 10px;
    background: var(--gray-50);
    cursor: pointer;
    transition: all 0.3s;
    color: var(--gray-600);
    font-weight: 500;
}

.file-upload-label:hover {
    border-color: var(--primary-red);
    background: rgba(239, 68, 68, 0.05);
    color: var(--primary-red);
}

.file-upload-label i {
    font-size: 1.5rem;
}

/* Form sections */
.form-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.form-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.form-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-section-title i {
    color: var(--primary-red);
    font-size: 1.5rem;
}

/* Form actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-200);
    margin-top: 2rem;
}

/* Input groups */
.input-group {
    display: flex;
    gap: 0.5rem;
}

.input-group .form-control {
    flex: 1;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    color: var(--gray-700);
    font-weight: 600;
}

/* Radio y Checkbox */
.radio-group,
.checkbox-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    flex-direction: row;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 1rem 1.5rem;
    border: 2px solid var(--gray-300);
    border-radius: 10px;
    transition: all 0.3s;
    font-weight: 500;
    background: var(--white);
    min-width: 180px;
    position: relative;
}

.radio-label:hover {
    border-color: var(--primary-red);
    background: rgba(239, 68, 68, 0.05);
}

.radio-label input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-red);
    margin: 0;
    flex-shrink: 0;
    vertical-align: middle;
}

.radio-label span {
    line-height: 1.2;
    vertical-align: middle;
}

.radio-label input[type="radio"]:checked ~ span {
    color: var(--primary-red);
    font-weight: 700;
}

.radio-label:has(input[type="radio"]:checked) {
    border-color: var(--primary-red);
    background: rgba(239, 68, 68, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 1rem 1.5rem;
    border: 2px solid var(--gray-300);
    border-radius: 10px;
    transition: all 0.3s;
    font-weight: 500;
    background: var(--white);
}

.checkbox-label:hover {
    border-color: var(--primary-red);
    background: rgba(239, 68, 68, 0.05);
}

.checkbox-label input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--primary-red);
    margin: 0;
    flex-shrink: 0;
    vertical-align: middle;
}

.checkbox-label span {
    line-height: 24px;
    vertical-align: middle;
}

.checkbox-label input[type="checkbox"]:checked ~ span {
    color: var(--primary-red);
    font-weight: 700;
}

.checkbox-label:has(input[type="checkbox"]:checked) {
    border-color: var(--primary-red);
    background: rgba(239, 68, 68, 0.1);
}

/* Error states */
.form-control.error {
    border-color: var(--primary-red);
}

.error-message {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--primary-red);
    font-weight: 500;
}

/* Success states */
.form-control.success {
    border-color: var(--success);
}

.success-message {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 500;
}


/* ============================================
   VISTA DETALLE
   ============================================ */
.detail-container {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--gray-200);
    margin-bottom: 2rem;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--gray-200);
}

.detail-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.detail-header h2 i {
    color: var(--primary-red);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-label i {
    color: var(--primary-red);
    font-size: 1rem;
}

.detail-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.5;
}

.detail-value.large {
    font-size: 2rem;
}

.detail-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--gray-100);
    border-radius: 12px;
    border: 1px solid var(--gray-200);
}

.detail-section h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-section h3 i {
    color: var(--primary-red);
}

.detail-section p {
    margin: 0;
    color: var(--gray-700);
    line-height: 1.7;
}

/* Gallery */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.photo-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--gray-200);
    transition: all 0.3s;
    cursor: pointer;
}

.photo-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-red);
}

.photo-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s;
}

.photo-item:hover .photo-overlay {
    opacity: 1;
}

.photo-overlay i {
    font-size: 2rem;
    color: var(--white);
}

/* Info boxes */
.info-box {
    background: var(--gray-100);
    border-left: 4px solid var(--primary-red);
    padding: 1.5rem;
    border-radius: 0 12px 12px 0;
    margin-bottom: 1.5rem;
}

.info-box-title {
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-box-content {
    color: var(--gray-700);
    line-height: 1.6;
}

/* Map container */
.map-container {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--gray-200);
}

/* ============================================
   CALENDARIO DE VALLAS
   ============================================ */

.calendar-container {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1rem;
}

.calendar-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 800px;
}

.calendar-table thead th {
    background: var(--primary);
    color: white;
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.calendar-table thead th:first-child {
    text-align: left;
    min-width: 200px;
}

.calendar-table tbody td {
    padding: 0.5rem;
    border: 1px solid var(--gray-200);
    vertical-align: middle;
}

.calendar-table tbody td.td-split {
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 90px;
}

.calendar-table tbody td:first-child {
    background: var(--gray-50);
    font-weight: 500;
    position: sticky;
    left: 0;
    z-index: 5;
}

.calendar-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-radius: 4px;
    font-size: 1.25rem;
    transition: all 0.2s;
    cursor: pointer;
    min-height: 50px;
}

.calendar-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.calendar-cell.disponible {
    background: #d1fae5;
    color: #065f46;
}

.calendar-cell.ocupada {
    background: #fee2e2;
    color: #991b1b;
}

.calendar-cell.reservada {
    background: #fef3c7;
    color: #92400e;
}

.calendar-cell.bloqueada {
    background: #e5e7eb;
    color: #374151;
}

/* Celdas divididas para múltiples caras */
.calendar-cell-split {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    cursor: pointer;
    min-height: 45px;
    position: relative;
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.calendar-cell-split:last-child {
    border-bottom: none;
}

.calendar-cell-split:hover {
    filter: brightness(0.95);
}

.calendar-cell-split.disponible {
    background: #d1fae5 !important;
    color: #065f46 !important;
}

.calendar-cell-split.ocupada {
    background: #fee2e2 !important;
    color: #991b1b !important;
}

.calendar-cell-split.reservada {
    background: #fef3c7 !important;
    color: #92400e !important;
}

.calendar-cell-split.bloqueada {
    background: #e5e7eb !important;
    color: #374151 !important;
}

.cara-label {
    font-size: 0.7rem;
    font-weight: 700;
    opacity: 0.7;
    text-transform: uppercase;
}

.calendar-legend {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 2rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Timeline */
.timeline-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.timeline-item {
    display: flex;
    gap: 1.5rem;
    padding: 1rem;
    border-left: 3px solid var(--primary);
    margin-bottom: 1rem;
    background: var(--gray-50);
    border-radius: 0 8px 8px 0;
    transition: all 0.2s;
}

.timeline-item:hover {
    background: var(--gray-100);
    transform: translateX(4px);
}

.timeline-date {
    min-width: 120px;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-content {
    flex: 1;
}

.timeline-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.timeline-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--gray-600);
}


/* ============================================
   RESPONSIVE - MÓVILES Y TABLETS
   ============================================ */

/* Tablets y móviles */
@media (max-width: 1024px) {
    /* Main content ocupa todo el ancho */
    .main-content {
        margin-left: 0 !important;
        width: 100%;
    }
    
    /* Mostrar botón mobile-toggle */
    .mobile-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    
    /* Sidebar con sombra en móvil */
    .sidebar {
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
        z-index: 2000;
    }
    
    /* Topbar ajustes */
    .topbar {
        padding: 0 1rem;
    }
    
    /* Content wrapper padding reducido */
    .content-wrapper {
        padding: 1rem;
    }
}

/* Desktop */
@media (min-width: 1025px) {
    /* Ocultar botón mobile-toggle en desktop */
    .mobile-toggle {
        display: none;
    }
    
    /* Sidebar siempre visible en desktop */
    .sidebar {
        transform: translateX(0);
    }
}

/* Móviles pequeños */
@media (max-width: 640px) {
    .topbar-title h2 {
        font-size: 1.25rem;
    }
    
    .topbar-user {
        display: none;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .page-header-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
    }
}
