/* =========================================
   1. VARIABLES DEL SISTEMA (Design System)
   ========================================= */
:root {
    --bg-body: #f8fafc;
    --text-primary: #1e293b;
    --card-bg: #ffffff;
    --input-bg: #f8fafc;
    --border-color: #62a6ffb1;
}

:root {
    /* Marca TecnoAires */
    --brand-blue: #1D5597;
    --brand-blue-dark: #0a2342;
    --brand-green: #62B145;
    --brand-green-hover: #4e9135;
    
    /* Colores por Rol */
    --color-admin: #1D5597;
    --color-secretaria: #0891b2;
    --color-tecnico: #62B145;
    
    /* Sistema de Color Neutro */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --white: #ffffff;
    
    /* UI Dimensions */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 20px 40px rgba(0, 0, 0, 0.12);
    --shadow-input-focus: 0 0 0 4px rgba(29, 85, 151, 0.15);
}

/* =========================================
   2. RESET & BASE
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background-color: var(--bg-body);
    transition: background-color 0.3s, color 0.3s;
}

/* =========================================
   3. ESTILOS DEL LOGIN
   ========================================= */

.login-page {
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-dark) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-page .container {
    width: 100%;
    max-width: 420px;
    padding: 3rem 2.5rem;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.6);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-page img {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    margin-bottom: 1.5rem !important;
}

.login-page h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--brand-blue);
    margin-bottom: 2rem;
    text-align: center;
    letter-spacing: -0.5px;
}

/* =========================================
   4. INPUTS Y FORMULARIOS
   ========================================= */

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

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    margin-left: 4px;
    letter-spacing: 0.5px;
}

input[type="input"],
input[type="password"],
input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    color: var(--text-primary);
    background-color: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
    background-color: var(--white);
    border-color: var(--brand-blue);
    box-shadow: var(--shadow-input-focus);
    outline: none;
}

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

small {
    margin-top: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #e11d48;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* =========================================
   5. BOTONES
   ========================================= */

.btn-login {
    width: 100%;
    padding: 14px;
    margin-top: 1rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    background: linear-gradient(135deg, var(--brand-green) 0%, var(--brand-green-hover) 100%);
    box-shadow: 0 4px 12px rgba(98, 177, 69, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(98, 177, 69, 0.4);
}

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

.btn-login:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn {
    padding: 12px 24px;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-blue) 0%, #0d3d82 100%);
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(29, 85, 151, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--brand-green) 0%, var(--brand-green-hover) 100%);
    color: var(--white);
    display: block;
    margin: 0 auto;
    width: 55%;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(98, 177, 69, 0.3);
}

.btn-secondary {
    background-color: var(--text-light);
    color: var(--white);
}

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

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

.btn-danger:hover {
    background-color: #be185d;
}

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

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

/* =========================================
   6. NAVBAR Y HEADER
   ========================================= */

.navbar {
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.bg-admin {
    background: linear-gradient(135deg, #1D5597 0%, #155e96 100%) !important;
}

.bg-secretaria {
    background: linear-gradient(135deg, #0891b2 0%, #0a7da3 100%) !important;
}

.bg-tecnico {
    background: linear-gradient(135deg, #62B145 0%, #529136 100%) !important;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--white) !important;
    text-decoration: none;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    opacity: 0.9;
}

.logo-navbar {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
    transition: transform 0.3s ease;
}

.navbar-brand:hover .logo-navbar {
    transform: scale(1.05);
}

.brand-text {
    color: var(--white);
    letter-spacing: -0.5px;
}

.badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.4rem 0.8rem;
    border-radius: 0.4rem;
    background-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.95);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.navbar .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    padding: 0.6rem 1rem !important;
}

.navbar .nav-link:hover {
    color: var(--white) !important;
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
}

.navbar .nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.dropdown-menu-dark {
    background-color: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
}

.dropdown-item {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.8rem 1rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--white);
    transform: translateX(4px);
}

.dropdown-item i {
    width: 18px;
    margin-right: 0.8rem;
    text-align: center;
}

.dropdown-header {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-divider {
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-user {
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--white) !important;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
}

.btn-user:hover {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-user i {
    font-size: 1.2rem;
}

.text-danger {
    color: #e11d48 !important;
}

.dropdown-item.text-danger:hover {
    background-color: rgba(225, 29, 72, 0.2) !important;
}

/* =========================================
   7. CONTENIDO PRINCIPAL
   ========================================= */


.main-content {
    min-height: calc(100vh - 70px);
    padding: 1.5rem 2rem;
    background-color: var(--bg-body);
}

.container-dashboard {
    max-width: 1400px;
    margin: 0 auto;
}

/* Page Title */
.page-title {
    margin-bottom: 1rem;
    padding-top: 0;
    margin-top: 0;
}

.page-title h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.page-title p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
}

/* =========================================
   8. TARJETAS Y CARDS
   ========================================= */

.card {
    background-color: var(--card-bg);
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    overflow: hidden;
}

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

.card-header {
    background-color: var(--card-bg);
    border-bottom: 2px solid var(--border-color);
    padding: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.card-header i {
    color: var(--brand-blue);
    font-size: 1.3rem;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background-color: var(--bg-body);
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* =========================================
   9. DASHBOARD STATS
   ========================================= */

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: all 0.3s ease;
    border-top: 4px solid transparent;
}

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

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Colores para stats */
.stat-blue {
    border-top-color: var(--color-admin);
}

.stat-blue .stat-icon {
    background-color: rgba(29, 85, 151, 0.1);
    color: var(--color-admin);
}

.stat-cyan {
    border-top-color: var(--color-secretaria);
}

.stat-cyan .stat-icon {
    background-color: rgba(8, 145, 178, 0.1);
    color: var(--color-secretaria);
}

.stat-green {
    border-top-color: var(--color-tecnico);
}

.stat-green .stat-icon {
    background-color: rgba(98, 177, 69, 0.1);
    color: var(--color-tecnico);
}

/* =========================================
   10. TABLAS
   ========================================= */

.table-responsive {
    border-radius: var(--radius-md);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--card-bg);
}

thead {
    background-color: rgba(0,0,0,0.05);
    border-bottom: 2px solid var(--border-color);
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

tbody tr {
    transition: all 0.2s ease;
}

tbody tr:hover {
    background-color: rgba(0,0,0,0.02);
}

/* =========================================
   11. BADGES Y ESTADOS
   ========================================= */

.badge-success {
    background-color: rgba(98, 177, 69, 0.15);
    color: var(--color-tecnico);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8rem;
    display: inline-block;
}

.badge-warning {
    background-color: rgba(251, 146, 60, 0.15);
    color: #c2410c;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8rem;
    display: inline-block;
}

.badge-danger {
    background-color: rgba(225, 29, 72, 0.15);
    color: #be185d;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8rem;
    display: inline-block;
}

.badge-info {
    background-color: rgba(8, 145, 178, 0.15);
    color: var(--color-secretaria);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8rem;
    display: inline-block;
}

/* =========================================
   12. UTILIDADES
   ========================================= */

.text-primary {
    color: var(--color-admin) !important;
}

.text-success {
    color: var(--color-tecnico) !important;
}

.text-info {
    color: var(--color-secretaria) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.fw-bold {
    font-weight: 700 !important;
}

.me-2 {
    margin-right: 0.5rem !important;
}

.me-3 {
    margin-right: 1rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.d-flex {
    display: flex !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

/* =========================================
   13. ANIMACIONES
   ========================================= */

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

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slideUp {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-fadeIn {
    animation: fadeIn 0.4s ease-in;
}

/* =========================================
   14. SCROLLBAR
   ========================================= */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brand-blue);
}

/* =========================================
   15. RESPONSIVE
   ========================================= */

@media (max-width: 768px) {
    .navbar-collapse {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    th, td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    .page-title h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 576px) {
    .brand-text {
        font-size: 1.1rem;
    }
    
    .badge {
        font-size: 0.6rem;
        padding: 0.3rem 0.6rem;
    }
    
    .nav-link span {
        display: none;
    }
    
    .btn-user span {
        display: none;
    }
    
    .stat-value {
        font-size: 2rem;
    }

    .page-title h1 {
        font-size: 1.5rem;
    }
}