/* Estilos generales */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(135deg, #0f172a, #1d4ed8);
    color: #0f172a;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Cabecera */
.main-header {
    background: rgba(15, 23, 42, 0.95);
    color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logo-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    background: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.6);
}

.logo-text {
    font-weight: 700;
    letter-spacing: 0.04em;
    font-size: 1rem;
    text-transform: uppercase;
}
.logo-sic {
    font-size: 1.4rem;         /* Más grande */
    font-weight: 700;          /* Negrita */
    color: #facc15;            /* Amarillo (tailwind yellow-400) */
    margin: 0 0.4rem;          /* Separación lateral */
    letter-spacing: 0.03em;    /* Ligera separación */
    text-shadow: 0 0 4px rgba(0,0,0,0.45); /* Mejor visibilidad sobre fondos oscuros */
}

.main-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Botón hamburguesa */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    margin-left: auto;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #e5e7eb;
    border-radius: 999px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Layout principal */
.container {
    max-width: 1100px;
    margin: 1.5rem auto 2rem;
    padding: 0 1rem;
    flex: 1;
}

.hero {
    color: #e5e7eb;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}

.hero p {
    opacity: 0.9;
}

/* Tarjetas */
.card {
    background: #f9fafb;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 20px 40px rgba(15,23,42,0.35);
    margin-bottom: 1.5rem;
    animation: cardIn 0.4s ease-out;
}

.card-centered {
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

@keyframes cardIn {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Grid */
.grid-2 {
    display: grid;
    gap: 1.5rem;
}
@media (min-width: 800px) {
    .grid-2 {
        grid-template-columns: 1.2fr 1fr;
    }
}

/* Formularios */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem 1.25rem;
    margin-top: 0.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

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

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f172a;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="time"],
select,
textarea {
    border-radius: 0.75rem;
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
    background: #ffffff;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.25);
    transform: translateY(-1px);
}

/* Botones */
.btn {
    border: none;
    border-radius: 999px;
    padding: 0.45rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease, color 0.15s ease;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.4), transparent 55%);
    opacity: 0;
    transform: scale(0.1);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.btn:active::after {
    opacity: 1;
    transform: scale(1);
}

.btn-primary {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: #eff6ff;
    box-shadow: 0 10px 25px rgba(37,99,235,0.4);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(37,99,235,0.55);
}

.btn-secondary {
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    color: #eff6ff;
    box-shadow: 0 10px 25px rgba(14,165,233,0.4);
}

.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(14,165,233,0.55);
}

.btn-outline {
    border: 1px solid #60a5fa;
    background: transparent;
    color: #bfdbfe;
}

.btn-outline:hover {
    background: rgba(37,99,235,0.12);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #b91c1c, #dc2626);
    color: #fee2e2;
    box-shadow: 0 8px 22px rgba(220,38,38,0.5);
}

.btn-small {
    padding: 0.25rem 0.7rem;
    font-size: 0.78rem;
}

.btn-block {
    width: 100%;
}

.mt-1 { margin-top: 0.5rem; }

/* Tablas */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.table th,
.table td {
    padding: 0.45rem 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.table thead th {
    background: #e5f0ff;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.table tbody tr:hover {
    background: #eff6ff;
}

/* Alertas */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

.alert-error {
    background: #fee2e2;
    color: #b91c1c;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.13rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-success {
    background: #bbf7d0;
    color: #166534;
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 0.75rem 1rem 1.25rem;
    font-size: 0.8rem;
    color: #cbd5f5;
}

/* Lista de atajos */
.shortcut-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Botones de atajos en azul más intenso */
.shortcut-list .btn-outline {
    color: #1e3a8a;
    border-color: #1e3a8a;
}
.shortcut-list .btn-outline:hover {
    background: rgba(30,58,138,0.08);
}

/* Radio pills para intervalos */
.radio-pill {
    display: inline-flex;
    align-items: center;
    margin-right: 0.4rem;
    margin-bottom: 0.4rem;
}

.radio-pill input[type="radio"] {
    display: none;
}

.radio-pill span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    border: 1px solid #c4d2ff;
    font-size: 0.82rem;
    background: #eef2ff;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.radio-pill input[type="radio"]:checked + span {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #eff6ff;
    box-shadow: 0 8px 18px rgba(37,99,235,0.4);
    transform: translateY(-1px);
}

/* Formularios en línea */
.inline-form {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.inline-form textarea {
    font-size: 0.75rem;
}

/* Utilidades */
.mt-1 {
    margin-top: 0.5rem;
}

/* Navegación responsive */
@media (max-width: 768px) {
    .main-header {
        flex-wrap: wrap;
        padding: 0.5rem 0.75rem;
    }
    .main-nav {
        width: 100%;
        margin-top: 0.35rem;
        flex-direction: column;
        align-items: stretch;
        display: none;
    }
    .main-nav.open {
        display: flex;
    }
    .nav-toggle {
        display: flex;
    }
    .main-nav .btn {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Responsivo extra */
@media (max-width: 640px) {
    .hero h1 {
        font-size: 1.4rem;
    }
    .card {
        padding: 1.1rem;
    }
}

/* Clases para impresión */
.no-print { }

.print-section { }

/* Márgenes y ajustes PDF/impresión */
@page {
    margin: 15mm;
}

/* Modal para mostrar observaciones de citas */
.comentario-modal {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}

.comentario-modal-content {
    background: #f9fafb;
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(15,23,42,0.5);
}

.comentario-modal-content h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.comentario-modal-content p {
    font-size: 0.9rem;
    white-space: pre-wrap;
}

@media print {
    body {
        background: #ffffff;
    }
    .main-header,
    .main-footer,
    .btn,
    .nav-toggle,
    .no-print {
        display: none !important;
    }
    .card {
        box-shadow: none;
        margin: 0 0 10mm 0;
        padding: 0;
    }
    .container {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
    .table {
        font-size: 0.8rem;
    }
}
