/* ========================================
   SISTEMA DE PERMISOS DE EMPLEADOS - QUIMPO
   Diseno Minimalista Moderno
   Color Principal: #2e3094
   ======================================== */

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

:root {
    /* Colores principales */
    --primary: #2e3094;
    --primary-light: #4a4fb8;
    --primary-dark: #1f2166;
    --accent: #6b9fff;
    --accent-light: #a8c7ff;

    /* Colores de estado */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Grises */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Bordes */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--gray-900);
    background: var(--gray-50);
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
}

a {
    color: var(--primary);
}

/* ========================================
   SIDEBAR LAYOUT
   ======================================== */

body.has-sidebar {
    display: flex;
    min-height: 100vh;
    flex-direction: row;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .logo svg {
    width: 36px;
    height: 36px;
    color: var(--accent-light);
    flex-shrink: 0;
}

.sidebar-header .logo h1 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

.sidebar-header .logo p {
    font-size: 11px;
    margin: 0;
    opacity: 0.7;
    font-weight: 500;
}

.sidebar-user {
    padding: 20px;
    background: rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-size: 15px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
}

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

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-sede {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
}

.user-badge {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(107, 159, 255, 0.25);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-light);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
}

.sidebar .nav-menu {
    list-style: none;
    padding: 0 12px;
    margin: 0;
    flex: 1;
}

.sidebar .nav-menu li {
    display: block;
    width: 100%;
    margin: 0 0 4px 0;
}

.sidebar .nav-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border-radius: var(--radius-sm);
    position: relative;
}

.sidebar .nav-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar .nav-menu li.active a {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(107, 159, 255, 0.3);
}

.sidebar .nav-menu a svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-separador {
    padding: 16px 16px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    color: #fca5a5;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    width: 100%;
    justify-content: center;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
}

body.has-sidebar .main-content {
    margin-left: 260px;
    width: calc(100% - 260px);
    min-height: 100vh;
}

.content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 32px 0 32px;
}

/* Badge de notificaciones en el menu */
.notification-badge-menu {
    margin-left: auto;
    background: var(--danger);
    color: white;
    border-radius: 10px;
    padding: 2px 7px;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

/* Menu movil: ocultos en escritorio */
.mobile-menu-toggle {
    display: none;
}

.sidebar-overlay {
    display: none;
}

body.menu-open {
    overflow: hidden;
}

/* ========================================
   PAGE COMPONENTS
   ======================================== */

.page-header {
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.dashboard-subtitle {
    font-size: 15px;
    color: var(--gray-600);
    font-weight: 500;
}

.page-header-acciones {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

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

.stat-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s;
    border: 1px solid var(--gray-200);
    text-decoration: none;
    color: inherit;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card.stat-primary .stat-icon {
    background: linear-gradient(135deg, #2e3094 0%, #4a4fb8 100%);
}

.stat-card.stat-info .stat-icon {
    background: linear-gradient(135deg, #6b9fff 0%, #a8c7ff 100%);
}

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

.stat-card.stat-success .stat-icon {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
}

.stat-card.stat-danger .stat-icon {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    box-shadow: var(--shadow-md);
}

.stat-icon svg {
    width: 30px;
    height: 30px;
}

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

.stat-label {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -1px;
    line-height: 1.1;
}

.stat-hint {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* Section header */
.section-header {
    margin-bottom: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.section-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.section-header p {
    font-size: 14px;
    color: var(--gray-600);
    margin-top: 4px;
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.dashboard-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    text-align: center;
    transition: all 0.3s;
    border: 1px solid var(--gray-200);
}

.dashboard-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.card-icon-svg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 50%;
    color: white;
    box-shadow: 0 4px 12px rgba(46, 48, 148, 0.3);
}

.card-icon-svg svg {
    width: 36px;
    height: 36px;
}

.dashboard-card:nth-child(2) .card-icon-svg {
    background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.dashboard-card:nth-child(3) .card-icon-svg {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    box-shadow: 0 4px 12px rgba(107, 159, 255, 0.3);
}

.dashboard-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    letter-spacing: -0.3px;
}

.dashboard-card p {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 24px;
    line-height: 1.6;
}

/* Content Box */
.content-box {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    margin-bottom: 24px;
    border: 1px solid var(--gray-200);
}

.content-box-titulo {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-box-titulo svg {
    width: 20px;
    height: 20px;
}

/* Estado vacio */
.estado-vacio {
    text-align: center;
    padding: 56px 24px;
    color: var(--gray-500);
}

.estado-vacio svg {
    width: 64px;
    height: 64px;
    color: var(--gray-300);
    margin-bottom: 20px;
}

.estado-vacio h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.estado-vacio p {
    font-size: 14px;
    max-width: 420px;
    margin: 0 auto 24px;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(46, 48, 148, 0.3);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(46, 48, 148, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background-color: var(--gray-300);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background-color: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #fbbf24 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-outline {
    background: white;
    color: var(--primary);
    border: 2px solid var(--gray-300);
}

.btn-outline:hover {
    border-color: var(--primary);
    background: var(--gray-50);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
}

.btn-icon:hover {
    transform: scale(1.1);
}

.btn-icon.btn-danger {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.btn-icon.btn-danger:hover {
    color: white;
    background: var(--danger);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 28px;
    font-size: 16px;
}

.btn-bloque {
    width: 100%;
}

.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-lg svg {
    width: 20px;
    height: 20px;
}

.grupo-botones {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ========================================
   TABLES
   ======================================== */

.table-container {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    background: white;
    box-shadow: var(--shadow);
    -webkit-overflow-scrolling: touch;
}

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

table thead {
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--gray-100) 100%);
}

table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 2px solid var(--primary);
    white-space: nowrap;
}

table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 14px;
    color: var(--gray-900);
    vertical-align: middle;
}

table tbody tr {
    transition: background-color 0.2s;
}

table tbody tr:hover {
    background-color: var(--gray-50);
}

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

/* Fila resaltada cuando la solicitud tiene cruce grave */
table tbody tr.fila-critica {
    background-color: #fef2f2;
}

table tbody tr.fila-critica:hover {
    background-color: #fee2e2;
}

table tbody tr.fila-urgente td:first-child {
    box-shadow: inset 3px 0 0 var(--warning);
}

.celda-principal {
    font-weight: 600;
    color: var(--primary);
}

.celda-secundaria {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

/* ========================================
   FORMS
   ======================================== */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.form-label .requerido {
    color: var(--danger);
    margin-left: 2px;
}

.form-input,
.form-select,
textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    background: white;
    font-family: inherit;
    color: var(--gray-900);
}

/* 16px evita el zoom automatico de iOS al enfocar un campo */
input[type="date"].form-input,
input[type="time"].form-input {
    font-size: 16px;
    min-height: 48px;
}

.form-input:focus,
.form-select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 48, 148, 0.1);
}

.form-input:disabled,
.form-select:disabled,
textarea:disabled {
    background: var(--gray-100);
    color: var(--gray-500);
    cursor: not-allowed;
}

.form-input.tiene-error,
.form-select.tiene-error,
textarea.tiene-error {
    border-color: var(--danger);
}

textarea {
    resize: vertical;
    min-height: 96px;
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--gray-500);
}

.form-error {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--danger);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 24px;
    border-top: 2px solid var(--gray-200);
    margin-top: 24px;
}

.form-seccion {
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
}

.form-seccion:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-seccion-titulo {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gray-500);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-seccion-titulo svg {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-700);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Search Box */
.search-box {
    position: relative;
    flex: 1;
}

.search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
    width: 18px;
    height: 18px;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    font-size: 14px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    font-family: inherit;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 48, 148, 0.1);
}

/* Barra de filtros */
.barra-filtros {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
    align-items: center;
    flex-wrap: wrap;
}

.barra-filtros form {
    display: flex;
    gap: 12px;
    flex: 1;
    flex-wrap: wrap;
    align-items: center;
}

.barra-filtros .form-select {
    width: auto;
    min-width: 170px;
}

/* ========================================
   ALERTS & BADGES
   ======================================== */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    border-left: 4px solid;
    font-size: 14px;
}

.alert svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.alert-error,
.alert-danger {
    background-color: #fef2f2;
    border-color: var(--danger);
    color: #991b1b;
}

.alert-success {
    background-color: #d1fae5;
    border-color: var(--success);
    color: #065f46;
}

.alert-warning {
    background-color: #fff7ed;
    border-color: var(--warning);
    color: #92400e;
}

.alert-info {
    background-color: #eff6ff;
    border-color: var(--info);
    color: #1e40af;
}

.alert strong {
    display: block;
    margin-bottom: 2px;
}

.info-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    border-left: 4px solid var(--info);
    border-radius: var(--radius-sm);
    color: #1e40af;
    font-size: 14px;
    margin-top: 16px;
}

.info-box svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-status {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.badge-gray { background-color: #f3f4f6; color: #374151; }
.badge-blue { background-color: #dbeafe; color: #1e40af; }
.badge-green { background-color: #d1fae5; color: #065f46; }
.badge-yellow { background-color: #fef3c7; color: #92400e; }
.badge-red { background-color: #fee2e2; color: #991b1b; }
.badge-purple { background-color: #e9d5ff; color: #6b21a8; }
.badge-orange { background-color: #fed7aa; color: #9a3412; }
.badge-pink { background-color: #fce7f3; color: #9f1239; }
.badge-indigo { background-color: #e0e7ff; color: #3730a3; }
.badge-teal { background-color: #ccfbf1; color: #115e59; }

/* Punto de color del tipo de permiso */
.punto-tipo {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Etiqueta de urgencia */
.marca-urgente {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: white;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.marca-urgente svg {
    width: 12px;
    height: 12px;
}

/* ========================================
   SEMAFORO DE CONFLICTOS
   El componente central del sistema: avisa si la fecha y hora
   solicitada choca con permisos de otros companeros.
   ======================================== */

.panel-conflicto {
    border-radius: var(--radius);
    border: 2px solid var(--gray-200);
    background: white;
    overflow: hidden;
    margin-bottom: 24px;
    transition: border-color 0.3s;
}

.panel-conflicto.nivel-ninguno { border-color: var(--success); }
.panel-conflicto.nivel-bajo    { border-color: var(--info); }
.panel-conflicto.nivel-medio   { border-color: var(--warning); }
.panel-conflicto.nivel-alto    { border-color: #fb923c; }
.panel-conflicto.nivel-critico { border-color: var(--danger); }

.panel-conflicto-cabecera {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
}

.panel-conflicto.nivel-ninguno .panel-conflicto-cabecera { background: #d1fae5; }
.panel-conflicto.nivel-bajo    .panel-conflicto-cabecera { background: #eff6ff; }
.panel-conflicto.nivel-medio   .panel-conflicto-cabecera { background: #fef3c7; }
.panel-conflicto.nivel-alto    .panel-conflicto-cabecera { background: #fed7aa; }
.panel-conflicto.nivel-critico .panel-conflicto-cabecera { background: #fee2e2; }

.semaforo {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px 6px;
    background: var(--gray-800);
    border-radius: 20px;
    flex-shrink: 0;
}

.semaforo span {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    transition: all 0.3s;
}

.panel-conflicto.nivel-ninguno .semaforo span:nth-child(3) {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
}

.panel-conflicto.nivel-bajo .semaforo span:nth-child(2),
.panel-conflicto.nivel-medio .semaforo span:nth-child(2) {
    background: var(--warning);
    box-shadow: 0 0 10px var(--warning);
}

.panel-conflicto.nivel-alto .semaforo span:nth-child(1),
.panel-conflicto.nivel-critico .semaforo span:nth-child(1) {
    background: var(--danger);
    box-shadow: 0 0 10px var(--danger);
}

.panel-conflicto.nivel-critico .semaforo span:nth-child(1) {
    animation: pulso 1.4s ease-in-out infinite;
}

@keyframes pulso {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.panel-conflicto-texto {
    flex: 1;
    min-width: 0;
}

.panel-conflicto-texto h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 3px;
    color: var(--gray-900);
}

.panel-conflicto-texto p {
    font-size: 13px;
    color: var(--gray-700);
    margin: 0;
}

.panel-conflicto-cuerpo {
    padding: 20px 22px;
}

.panel-conflicto-cuerpo:empty {
    display: none;
}

/* Tarjeta de cada companero que ya tiene permiso en ese rango */
.choque {
    display: flex;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--gray-300);
    margin-bottom: 12px;
}

.choque:last-child {
    margin-bottom: 0;
}

.choque.severidad-critico { border-left-color: var(--danger); background: #fef2f2; }
.choque.severidad-alto    { border-left-color: #fb923c; background: #fff7ed; }
.choque.severidad-medio   { border-left-color: var(--warning); background: #fffbeb; }
.choque.severidad-bajo    { border-left-color: var(--info); background: #eff6ff; }

.choque-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.choque-datos {
    flex: 1;
    min-width: 0;
}

.choque-nombre {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-900);
}

.choque-cargo {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.choque-detalle {
    font-size: 13px;
    color: var(--gray-700);
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    align-items: center;
}

.choque-detalle span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.choque-detalle svg {
    width: 14px;
    height: 14px;
    color: var(--gray-400);
}

/* Medidor de cobertura de la sede */
.cobertura {
    margin-top: 18px;
    padding: 16px 18px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
}

.cobertura-cabecera {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
    gap: 12px;
    flex-wrap: wrap;
}

.cobertura-cabecera strong {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--gray-600);
}

.cobertura-cifra {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
}

.cobertura-barra {
    height: 10px;
    border-radius: 6px;
    background: var(--gray-200);
    overflow: hidden;
}

.cobertura-relleno {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--success) 0%, #34d399 100%);
    transition: width 0.4s ease;
}

.cobertura-relleno.en-riesgo {
    background: linear-gradient(90deg, var(--warning) 0%, #fbbf24 100%);
}

.cobertura-relleno.insuficiente {
    background: linear-gradient(90deg, var(--danger) 0%, #f87171 100%);
}

.cobertura-nota {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 8px;
}

/* Bloque de justificacion de urgencia, aparece solo si hay cruce */
.bloque-urgencia {
    display: none;
    padding: 20px 22px;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 2px solid var(--warning);
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.bloque-urgencia.visible {
    display: block;
    animation: aparecer 0.3s ease;
}

@keyframes aparecer {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.bloque-urgencia h3 {
    font-size: 15px;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bloque-urgencia h3 svg {
    width: 18px;
    height: 18px;
}

.bloque-urgencia p {
    font-size: 13px;
    color: #92400e;
    margin-bottom: 14px;
}

.bloque-urgencia textarea {
    border-color: var(--warning);
    background: white;
}

/* ========================================
   FORMULARIO DE SOLICITUD (booking)
   ======================================== */

/* Selector de modalidad: dia completo / por horas */
.selector-modalidad {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 4px;
}

.opcion-modalidad {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 14px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    text-align: center;
}

.opcion-modalidad input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.opcion-modalidad svg {
    width: 26px;
    height: 26px;
    color: var(--gray-400);
    transition: color 0.2s;
}

.opcion-modalidad strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
}

.opcion-modalidad small {
    font-size: 12px;
    color: var(--gray-500);
}

.opcion-modalidad:has(input:checked) {
    border-color: var(--primary);
    background: rgba(46, 48, 148, 0.04);
    box-shadow: 0 0 0 3px rgba(46, 48, 148, 0.1);
}

.opcion-modalidad:has(input:checked) svg {
    color: var(--primary);
}

.opcion-modalidad:has(input:checked) strong {
    color: var(--primary);
}

/* Rejilla de tipos de permiso */
.rejilla-tipos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.opcion-tipo {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.opcion-tipo input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.opcion-tipo-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.opcion-tipo span {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    line-height: 1.3;
}

.opcion-tipo:has(input:checked) {
    border-color: var(--primary);
    background: rgba(46, 48, 148, 0.04);
    box-shadow: 0 0 0 3px rgba(46, 48, 148, 0.08);
}

.opcion-tipo:has(input:checked) span {
    color: var(--primary);
}

/* Resumen del permiso solicitado */
.resumen-permiso {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 18px;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    margin-top: 16px;
}

.resumen-dato {
    flex: 1;
    min-width: 120px;
}

.resumen-dato .etiqueta {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--gray-500);
    margin-bottom: 2px;
}

.resumen-dato .valor {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
}

/* ========================================
   ADJUNTOS: subir archivo o tomar foto
   ======================================== */

.zona-adjunto {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    background: var(--gray-50);
    transition: all 0.2s;
}

.zona-adjunto.resaltada {
    border-color: var(--primary);
    background: rgba(46, 48, 148, 0.04);
}

.zona-adjunto svg.icono-zona {
    width: 40px;
    height: 40px;
    color: var(--gray-400);
    margin-bottom: 12px;
}

.zona-adjunto p {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 16px;
}

.acciones-adjunto {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 460px;
    margin: 0 auto;
}

/* La camara se ofrece primero en pantallas pequenas */
.btn-camara,
.btn-archivo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-camara:hover,
.btn-archivo:hover {
    border-color: var(--primary);
    background: var(--gray-50);
}

.btn-camara svg,
.btn-archivo svg {
    width: 20px;
    height: 20px;
}

.entrada-oculta {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

/* Vista previa de los archivos elegidos */
.previsualizacion {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.previsualizacion:empty {
    display: none;
}

.miniatura {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    background: white;
    box-shadow: var(--shadow-sm);
}

.miniatura img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    display: block;
}

.miniatura-pdf {
    height: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--gray-100);
    color: var(--gray-600);
}

.miniatura-pdf svg {
    width: 30px;
    height: 30px;
    color: var(--danger);
}

.miniatura-nombre {
    padding: 8px 10px;
    font-size: 11px;
    color: var(--gray-600);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.miniatura-quitar {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: rgba(17, 24, 39, 0.75);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    line-height: 1;
    transition: background 0.2s;
}

.miniatura-quitar:hover {
    background: var(--danger);
}

/* Lista de adjuntos ya guardados */
.lista-adjuntos {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.adjunto-fila {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: var(--gray-50);
    text-decoration: none;
    color: var(--gray-800);
    transition: all 0.2s;
}

.adjunto-fila:hover {
    border-color: var(--primary);
    background: white;
    box-shadow: var(--shadow-sm);
}

.adjunto-fila svg {
    width: 22px;
    height: 22px;
    color: var(--primary);
    flex-shrink: 0;
}

.adjunto-fila .adjunto-nombre {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adjunto-fila .adjunto-peso {
    font-size: 12px;
    color: var(--gray-500);
}

/* ========================================
   DETALLE DE SOLICITUD
   ======================================== */

.detalle-encabezado {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    padding-bottom: 22px;
    margin-bottom: 22px;
    border-bottom: 2px solid var(--gray-200);
}

.detalle-codigo {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--gray-500);
    text-transform: uppercase;
}

.detalle-titulo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin: 4px 0 8px;
    letter-spacing: -0.4px;
}

.detalle-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.rejilla-datos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 22px;
}

.dato {
    min-width: 0;
}

.dato .etiqueta {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.dato .valor {
    font-size: 15px;
    color: var(--gray-900);
    font-weight: 600;
}

.dato .valor.multilinea {
    font-weight: 400;
    line-height: 1.6;
    white-space: pre-line;
}

/* Empleado en la cabecera del detalle */
.tarjeta-empleado {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tarjeta-empleado .avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 700;
    flex-shrink: 0;
}

.tarjeta-empleado .nombre {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
}

.tarjeta-empleado .puesto {
    font-size: 13px;
    color: var(--gray-500);
}

/* Caja de decision del aprobador */
.caja-decision {
    background: white;
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.caja-decision h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.caja-decision > p {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 18px;
}

.acciones-decision {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ========================================
   CALENDARIO DE AUSENCIAS
   ======================================== */

.calendario-barra {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.calendario-mes-titulo {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    text-transform: capitalize;
    letter-spacing: -0.3px;
}

.calendario-nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.calendario {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.calendario-dias {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--gray-100) 100%);
    border-bottom: 2px solid var(--primary);
}

.calendario-dias div {
    padding: 12px 6px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--primary);
}

.calendario-rejilla {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendario-celda {
    min-height: 108px;
    padding: 8px;
    border-right: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
    background: white;
    position: relative;
}

.calendario-celda:nth-child(7n) {
    border-right: none;
}

.calendario-celda.otro-mes {
    background: var(--gray-50);
}

.calendario-celda.otro-mes .calendario-numero {
    color: var(--gray-300);
}

.calendario-celda.es-hoy {
    background: rgba(107, 159, 255, 0.08);
    box-shadow: inset 0 0 0 2px var(--accent);
}

.calendario-celda.es-festivo {
    background: #fef2f2;
}

.calendario-numero {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.calendario-festivo {
    font-size: 9px;
    font-weight: 700;
    color: var(--danger);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
}

.calendario-evento {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 6px;
    margin-bottom: 3px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    background: var(--gray-100);
    color: var(--gray-800);
    border-left: 3px solid var(--gray-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}

.calendario-evento:hover {
    background: var(--gray-200);
}

.calendario-evento.pendiente {
    border-left-color: var(--warning);
    background: #fef3c7;
    color: #92400e;
}

.calendario-evento.aprobada {
    border-left-color: var(--success);
    background: #d1fae5;
    color: #065f46;
}

/* Aviso de que ese dia la sede queda corta de personal */
.calendario-celda.dia-saturado {
    background: #fff7ed;
}

.calendario-alerta-dia {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendario-mas {
    font-size: 10px;
    font-weight: 700;
    color: var(--gray-500);
    padding-left: 6px;
}

.leyenda {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding: 16px 18px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
}

.leyenda-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--gray-600);
}

.leyenda-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
}

/* ========================================
   NOTIFICACIONES
   ======================================== */

.lista-notificaciones {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notificacion {
    display: flex;
    gap: 14px;
    padding: 18px 20px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}

.notificacion:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.notificacion.sin-leer {
    background: #f5f8ff;
    border-color: var(--accent-light);
}

.notificacion-icono {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.notificacion-icono svg {
    width: 22px;
    height: 22px;
}

.notificacion.prioridad-alta .notificacion-icono {
    background: linear-gradient(135deg, var(--warning) 0%, #fbbf24 100%);
}

.notificacion.prioridad-critica .notificacion-icono {
    background: linear-gradient(135deg, var(--danger) 0%, #f87171 100%);
}

.notificacion-cuerpo {
    flex: 1;
    min-width: 0;
}

.notificacion-titulo {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.notificacion-mensaje {
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.5;
}

.notificacion-tiempo {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 6px;
}

.punto-sin-leer {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    margin-top: 8px;
}

/* ========================================
   LOGIN PAGE
   ======================================== */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--accent) 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, 20px); }
}

.login-container {
    width: 100%;
    max-width: 460px;
    position: relative;
    z-index: 1;
}

.login-box {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 48px;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo {
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(46, 48, 148, 0.3);
}

.login-logo svg {
    width: 40px;
    height: 40px;
}

.login-logo img {
    max-width: 100%;
    height: auto;
}

.login-header h1 {
    font-size: 30px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-header p {
    font-size: 15px;
    color: var(--gray-600);
    font-weight: 500;
}

.login-error {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 2px solid var(--danger);
    border-radius: var(--radius-sm);
    color: var(--danger);
    margin-bottom: 28px;
    font-weight: 600;
    font-size: 14px;
}

.login-error svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.login-aviso {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #fff7ed;
    border: 2px solid var(--warning);
    border-radius: var(--radius-sm);
    color: #92400e;
    margin-bottom: 24px;
    font-weight: 600;
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 24px;
}

.login-form .form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.login-form .form-label svg {
    width: 18px;
    height: 18px;
}

.login-form .form-input {
    padding: 14px 16px;
    font-size: 16px;
}

.btn-login {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(46, 48, 148, 0.3);
    margin-top: 32px;
    font-family: inherit;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 48, 148, 0.4);
}

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

.btn-login svg {
    width: 20px;
    height: 20px;
}

.login-footer {
    margin-top: 32px;
    text-align: center;
    padding-top: 24px;
    border-top: 2px solid var(--gray-200);
}

.login-footer p {
    font-size: 13px;
    color: var(--gray-500);
    margin: 0;
}

.login-credits {
    margin-top: 12px;
    font-size: 12px;
    color: var(--gray-500);
}

.login-credits a,
.app-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.login-credits a:hover,
.app-footer a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* Mostrar u ocultar contrasena */
.campo-con-boton {
    position: relative;
}

.campo-con-boton .form-input {
    padding-right: 52px;
}

.btn-ver-clave {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    border-radius: 6px;
}

.btn-ver-clave:hover {
    color: var(--primary);
    background: var(--gray-100);
}

.btn-ver-clave svg {
    width: 20px;
    height: 20px;
}

/* ========================================
   APP FOOTER
   ======================================== */

.app-footer {
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 24px 32px;
    text-align: center;
    margin-top: 60px;
    width: 100%;
    clear: both;
}

.app-footer p {
    margin: 0;
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.8;
}

.footer-credits {
    margin-top: 8px;
    font-size: 12px;
    color: var(--gray-500);
}

/* ========================================
   PAGINATION
   ======================================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
    padding: 24px 0;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    background: white;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.pagination-btn:hover {
    background: var(--gray-50);
    border-color: var(--primary);
}

.pagination-btn.disabled {
    color: var(--gray-400);
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.5;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    background: white;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.2s;
}

.pagination-number:hover {
    background: var(--gray-50);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-number.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-color: var(--primary);
    color: white;
    cursor: default;
    box-shadow: 0 2px 8px rgba(46, 48, 148, 0.3);
}

/* ========================================
   TARJETAS DE CONFIGURACION
   Se usan para los tipos de permiso y los cargos.
   ======================================== */

.rejilla-config {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.tarjeta-config {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s;
}

.tarjeta-config:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.tarjeta-config.inactiva {
    background: var(--gray-50);
    opacity: 0.75;
}

.tarjeta-config-cabecera {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.tarjeta-config-cabecera h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    letter-spacing: -0.2px;
}

.tarjeta-config-codigo {
    font-size: 11px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--gray-400);
    margin: 4px 0 0;
    letter-spacing: 0.3px;
}

.tarjeta-config-desc {
    font-size: 13px;
    color: var(--gray-600);
    margin: 0;
    line-height: 1.5;
}

.tarjeta-config-etiquetas {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tarjeta-config-uso {
    font-size: 12px;
    color: var(--gray-500);
    margin: 0;
    padding-top: 10px;
    border-top: 1px solid var(--gray-200);
}

.tarjeta-config-acciones {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.tarjeta-config-acciones form {
    margin: 0;
}

/* ========================================
   SELECTOR DE OPCIONES EXCLUYENTES
   Se usa para elegir la version de reCAPTCHA.
   ======================================== */

.opciones-radio {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.opcion-radio {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.opcion-radio input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--primary);
    flex-shrink: 0;
    cursor: pointer;
}

.opcion-radio-texto strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 3px;
}

.opcion-radio-texto small {
    display: block;
    font-size: 13px;
    color: var(--gray-500);
    line-height: 1.5;
}

.opcion-radio:has(input:checked) {
    border-color: var(--primary);
    background: rgba(46, 48, 148, 0.04);
    box-shadow: 0 0 0 3px rgba(46, 48, 148, 0.08);
}

.opcion-radio:has(input:checked) .opcion-radio-texto strong {
    color: var(--primary);
}

/* Bloques que se muestran u ocultan segun la opcion elegida */
.bloque-condicional {
    display: none;
    padding: 20px;
    margin-top: 4px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
}

.bloque-condicional.visible {
    display: block;
    animation: aparecer 0.25s ease;
}

/* Campos de clave de API: monoespaciado para poder revisarlos */
.campo-clave {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    letter-spacing: 0.3px;
}

/* Caja de la casilla de reCAPTCHA en el login */
.recaptcha-caja {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

/* En pantallas angostas el widget de Google se escala para que quepa */
@media (max-width: 380px) {
    .recaptcha-caja {
        transform: scale(0.87);
        transform-origin: center;
    }
}

/* ========================================
   PAGINAS DE ERROR
   ======================================== */

.pagina-error {
    text-align: center;
    padding: 70px 24px;
}

.pagina-error .codigo {
    font-size: 84px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    letter-spacing: -3px;
}

.pagina-error h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 12px 0 10px;
}

.pagina-error p {
    font-size: 15px;
    color: var(--gray-600);
    max-width: 460px;
    margin: 0 auto 28px;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-primary { color: var(--primary); }
.fw-bold { font-weight: 700; }
.fs-small { font-size: 13px; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.oculto { display: none !important; }
.solo-movil { display: none; }
.sin-envoltura { white-space: nowrap; }

/* Accesibilidad: visible solo para lectores de pantalla */
.solo-lectores {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Indicador de foco visible para navegacion por teclado */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.opcion-modalidad:focus-within,
.opcion-tipo:focus-within {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* Indicador de carga */
.cargando {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: white;
    border-radius: 50%;
    animation: girar 0.7s linear infinite;
}

.cargando-oscuro {
    border-color: var(--gray-300);
    border-top-color: var(--primary);
}

@keyframes girar {
    to { transform: rotate(360deg); }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    /* Sidebar movil */
    .sidebar {
        width: 280px;
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        transition: left 0.3s ease;
        z-index: 1001;
    }

    .sidebar.active {
        left: 0;
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 16px;
        left: 16px;
        width: 48px;
        height: 48px;
        background: var(--primary);
        color: white;
        border: none;
        border-radius: var(--radius);
        cursor: pointer;
        z-index: 1000;
        box-shadow: var(--shadow-lg);
        transition: all 0.3s ease;
    }

    .mobile-menu-toggle:hover {
        background: var(--primary-light);
        transform: scale(1.05);
    }

    .mobile-menu-toggle svg {
        width: 24px;
        height: 24px;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    body.has-sidebar .main-content {
        margin-left: 0;
        width: 100%;
        padding-top: 80px;
    }

    .content-wrapper {
        padding: 24px 16px 0 16px;
    }

    /* Cabecera de pagina */
    .page-header {
        margin-bottom: 26px;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .dashboard-subtitle {
        font-size: 13px;
    }

    .page-header-acciones {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header-acciones .btn {
        width: 100%;
    }

    /* Tarjetas */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 26px;
    }

    .stat-card {
        padding: 16px;
        gap: 14px;
    }

    .stat-icon {
        width: 52px;
        height: 52px;
    }

    .stat-icon svg {
        width: 24px;
        height: 24px;
    }

    .stat-value {
        font-size: 26px;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .dashboard-card {
        padding: 24px 20px;
    }

    .content-box {
        padding: 20px 16px;
    }

    /* Formularios */
    .form-row,
    .form-row-2 {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .form-actions {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .form-actions .btn {
        width: 100%;
    }

    .barra-filtros form {
        flex-direction: column;
        align-items: stretch;
    }

    .barra-filtros .form-select,
    .barra-filtros .btn {
        width: 100%;
        min-width: 0;
    }

    /* Modalidad y tipos de permiso */
    .rejilla-tipos {
        grid-template-columns: 1fr 1fr;
    }

    /* En el celular la camara va primero y a lo ancho */
    .acciones-adjunto {
        grid-template-columns: 1fr;
        max-width: none;
    }

    .btn-camara {
        order: -1;
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
        border-color: var(--primary);
        color: white;
        padding: 16px;
        font-size: 15px;
    }

    .btn-camara:hover {
        background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    }

    .zona-adjunto {
        padding: 20px 14px;
    }

    /* Decision del aprobador apilada */
    .acciones-decision {
        grid-template-columns: 1fr;
    }

    .caja-decision {
        padding: 20px 16px;
    }

    /* Detalle */
    .detalle-encabezado {
        flex-direction: column;
        gap: 14px;
    }

    .detalle-titulo {
        font-size: 20px;
    }

    .rejilla-datos {
        grid-template-columns: 1fr 1fr;
        gap: 18px;
    }

    /* Panel de conflicto */
    .panel-conflicto-cabecera {
        padding: 16px;
        gap: 12px;
    }

    .panel-conflicto-cuerpo {
        padding: 16px;
    }

    .panel-conflicto-texto h3 {
        font-size: 15px;
    }

    .semaforo {
        flex-direction: row;
        border-radius: 14px;
    }

    /* Calendario: en movil se vuelve lista */
    .calendario-dias {
        display: none;
    }

    .calendario-rejilla {
        grid-template-columns: 1fr;
    }

    .calendario-celda {
        min-height: 0;
        border-right: none;
        display: flex;
        gap: 12px;
        padding: 12px 14px;
    }

    .calendario-celda.otro-mes {
        display: none;
    }

    .calendario-celda.sin-eventos {
        display: none;
    }

    .calendario-numero {
        min-width: 62px;
        margin-bottom: 0;
        font-size: 12px;
        color: var(--gray-500);
        text-transform: capitalize;
    }

    .calendario-eventos-movil {
        flex: 1;
        min-width: 0;
    }

    .calendario-evento {
        white-space: normal;
        font-size: 12px;
        padding: 6px 8px;
    }

    .calendario-alerta-dia {
        position: static;
        margin-left: auto;
    }

    /* Tablas con scroll horizontal */
    .tabla-ancha {
        min-width: 640px;
    }

    /* Notificaciones */
    .notificacion {
        padding: 14px 16px;
        gap: 12px;
    }

    .notificacion-icono {
        width: 38px;
        height: 38px;
    }

    .notificacion-icono svg {
        width: 18px;
        height: 18px;
    }

    /* Login */
    .login-box {
        padding: 32px 24px;
    }

    .login-header h1 {
        font-size: 25px;
    }

    .login-header {
        margin-bottom: 30px;
    }

    /* Botones y footer */
    .btn {
        padding: 12px 20px;
    }

    .grupo-botones {
        flex-direction: column;
    }

    .grupo-botones .btn {
        width: 100%;
    }

    .app-footer {
        padding: 16px 20px;
        margin-top: 40px;
    }

    .app-footer p {
        font-size: 12px;
    }

    .pagina-error .codigo {
        font-size: 62px;
    }

    /* Utilidades responsivas */
    .solo-movil { display: block; }
    .solo-escritorio { display: none !important; }
}

@media (max-width: 420px) {
    .rejilla-tipos {
        grid-template-columns: 1fr;
    }

    .rejilla-datos {
        grid-template-columns: 1fr;
    }

    .selector-modalidad {
        grid-template-columns: 1fr;
    }

    .resumen-permiso {
        flex-direction: column;
        gap: 14px;
    }
}

/* Respeta la preferencia de menos movimiento */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Impresion del permiso */
@media print {
    .sidebar,
    .mobile-menu-toggle,
    .sidebar-overlay,
    .app-footer,
    .form-actions,
    .caja-decision,
    .btn {
        display: none !important;
    }

    body.has-sidebar .main-content {
        margin-left: 0;
        width: 100%;
    }

    .content-box,
    .panel-conflicto {
        box-shadow: none;
        border: 1px solid #999;
    }

    body {
        background: white;
        font-size: 12px;
    }
}
