/* ============================================================
   Intranet ISPDN - Estilos Globales
   ============================================================ */

:root {
    --primary:       #1a73e8;
    --primary-dark:  #1557b0;
    --primary-light: #e8f0fe;
    --success:       #34a853;
    --danger:        #ea4335;
    --warning:       #fbbc04;
    --dark:          #202124;
    --gray-900:      #3c4043;
    --gray-700:      #5f6368;
    --gray-500:      #9aa0a6;
    --gray-300:      #dadce0;
    --gray-100:      #f1f3f4;
    --white:         #ffffff;
    --shadow:        0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
    --shadow-md:     0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg:     0 10px 25px rgba(0,0,0,0.15);
    --radius:        8px;
    --radius-lg:     12px;
    --transition:    all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    color: var(--gray-900);
    background-color: var(--gray-100);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ============================================================
   Utilidades
   ============================================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center { text-align: center; }
.text-muted  { color: var(--gray-700); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ============================================================
   Alertas
   ============================================================ */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-danger {
    background-color: #fce8e6;
    color: #c5221f;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #e6f4ea;
    color: #137333;
    border: 1px solid #ceead6;
}

.alert-warning {
    background-color: #fef7e0;
    color: #b06000;
    border: 1px solid #feefc3;
}

/* ============================================================
   Botones
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.5;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: var(--white);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background-color: #c5221f;
    color: var(--white);
}

.btn-outline {
    background-color: transparent;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-outline:hover {
    background-color: var(--gray-100);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-google {
    background-color: var(--white);
    color: var(--gray-900);
    border: 1px solid var(--gray-300);
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 500;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.btn-google:hover {
    background-color: var(--gray-100);
    box-shadow: var(--shadow-md);
}

.btn-google img {
    width: 20px;
    height: 20px;
}

/* ============================================================
   Cards
   ============================================================ */

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
}

/* ============================================================
   Tablas
   ============================================================ */

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table thead {
    background-color: var(--gray-100);
}

table th,
table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-300);
}

table th {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table tbody tr:hover {
    background-color: var(--primary-light);
}

/* ============================================================
   Badges (Roles)
   ============================================================ */

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-admin              { background: #e8f0fe; color: #1967d2; }
.badge-docente            { background: #e6f4ea; color: #137333; }
.badge-estudiante         { background: #fef7e0; color: #b06000; }
.badge-director-academico { background: #fce8e6; color: #c5221f; }
.badge-director-administrativo { background: #f3e8fd; color: #7627bb; }
.badge-activo             { background: #e6f4ea; color: #137333; }
.badge-inactivo           { background: #fce8e6; color: #c5221f; }

/* ============================================================
   Forms
   ============================================================ */

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: var(--gray-900);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--gray-900);
    background: var(--white);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f6368' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 36px;
}

/* ============================================================
   Modal
   ============================================================ */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 18px;
    color: var(--dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-500);
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--gray-900);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-300);
}

/* ============================================================
   Spinners
   ============================================================ */

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--gray-300);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   Avatar
   ============================================================ */

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-lg {
    width: 64px;
    height: 64px;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }

    .card {
        padding: 16px;
    }

    table th,
    table td {
        padding: 8px 10px;
    }

    .modal {
        margin: 16px;
        padding: 20px;
    }
}
