/* ============================================
   MACSALUD - Sistema de Gestión de Reclamos
   Estilos principales
   ============================================ */

:root {
    --primary: #0077B6;
    --primary-dark: #005f8a;
    --primary-light: #90E0EF;
    --accent: #00B4D8;
    --success: #2D9F6F;
    --warning: #E6A817;
    --danger: #D32F2F;
    --info: #0288D1;
    --bg: #F0F4F8;
    --bg-card: #FFFFFF;
    --text: #1A2332;
    --text-light: #5A6A7E;
    --border: #D1D9E6;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --radius: 10px;
    --radius-sm: 6px;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --transition: all 0.25s ease;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

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

/* ============================================
   HEADER / NAVBAR
   ============================================ */
.navbar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.navbar-brand svg {
    width: 32px;
    height: 32px;
    fill: #fff;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
}

.navbar-nav a {
    color: rgba(255, 255, 255, 0.85);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.navbar-nav a:hover,
.navbar-nav a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.navbar-user {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-user .btn-logout {
    color: rgba(255, 255, 255, 0.6);
    display: inline-flex;
    align-items: center;
    padding: 0.3rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.navbar-user .btn-logout:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0077B6 0%, #023E8A 50%, #005f8a 100%);
    padding: 1rem;
}

.login-card {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    text-align: center;
}

.login-logo {
    width: 70px;
    height: 70px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo svg {
    width: 36px;
    height: 36px;
    fill: #fff;
}

.login-card h1 {
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.login-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ============================================
   CONTAINER / LAYOUT
   ============================================ */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

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

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-header h1 svg {
    width: 28px;
    height: 28px;
    fill: var(--primary);
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--primary-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title svg {
    width: 22px;
    height: 22px;
    fill: var(--primary);
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
    margin-bottom: 0.35rem;
}

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

.form-control {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: var(--font);
    color: var(--text);
    background: #fff;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.12);
}

.form-control::placeholder {
    color: #aab5c4;
}

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

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235A6A7E' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

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

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1.25rem;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0 1.25rem;
}

.form-row-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 0 1.25rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

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

.form-check label {
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text);
}

.form-radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.35rem;
}

.form-radio {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.form-radio input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-radio label {
    font-size: 0.9rem;
    cursor: pointer;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 119, 182, 0.3);
}

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

.btn-success:hover {
    background: #248a5e;
    color: #fff;
    transform: translateY(-1px);
}

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

.btn-warning:hover {
    background: #c99214;
    color: #fff;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #b71c1c;
    color: #fff;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.btn-icon svg {
    margin: 0;
}

.btn-lg {
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ============================================
   TABLES
   ============================================ */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-sm);
}

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

table thead {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}

table thead th {
    padding: 0.75rem 0.85rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

table tbody tr:hover {
    background: #F0F7FF;
}

table tbody td {
    padding: 0.65rem 0.85rem;
    vertical-align: middle;
}

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

/* ============================================
   BADGES / STATUS
   ============================================ */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    white-space: nowrap;
}

.badge-recibido {
    background: #E3F2FD;
    color: #1565C0;
}

.badge-evaluacion {
    background: #FFF3E0;
    color: #E65100;
}

.badge-audiencia {
    background: #F3E5F5;
    color: #7B1FA2;
}

.badge-acuerdo {
    background: #E8F5E9;
    color: #2E7D32;
}

.badge-sinacuerdo {
    background: #FFEBEE;
    color: #C62828;
}

.badge-finalizado {
    background: #ECEFF1;
    color: #37474F;
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.25s ease;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 2px solid var(--primary-light);
}

.modal-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    padding: 0 0.25rem;
    transition: var(--transition);
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    color: var(--danger);
    background: #FFEBEE;
}

.modal-body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-body table tbody tr {
    cursor: pointer;
}

.modal-body table tbody tr:hover {
    background: #E3F2FD;
}

.modal-body table tbody tr.selected-row {
    background: #BBDEFB;
}

/* ============================================
   FILTERS BAR
   ============================================ */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.filters-bar .form-control {
    max-width: 280px;
}

.filters-bar .filter-periodo {
    max-width: 160px;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #A5D6A7;
}

.alert-danger {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #EF9A9A;
}

.alert-warning {
    background: #FFF8E1;
    color: #F57F17;
    border: 1px solid #FFE082;
}

.alert-info {
    background: #E3F2FD;
    color: #1565C0;
    border: 1px solid #90CAF9;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 1.25rem;
    list-style: none;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-color: var(--primary-light);
}

.pagination .active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ============================================
   SECTION SEPARATOR
   ============================================ */
.section-separator {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 1.25rem 0;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-light);
    font-size: 0.8rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    fill: var(--border);
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1rem;
}

/* ============================================
   TOOLTIP CLASIFICACION
   ============================================ */
.clasificacion-info {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.35rem;
    padding: 0.5rem 0.75rem;
    background: #F0F4F8;
    border-radius: var(--radius-sm);
    display: none;
    line-height: 1.5;
}

.clasificacion-info.visible {
    display: block;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .navbar {
        padding: 0 1rem;
        height: auto;
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .navbar-nav {
        gap: 0.25rem;
    }

    .container {
        padding: 1rem;
    }

    .form-row-2,
    .form-row-3,
    .form-row-4 {
        grid-template-columns: 1fr;
    }

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

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-bar .form-control,
    .filters-bar .filter-periodo {
        max-width: 100%;
    }

    .btn-group {
        width: 100%;
    }

    .btn-group .btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 1.5rem;
    }
}
