@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary-color: #15554A;
    --secondary-color: #0f3f36;
    --success-color: #16a34a;
    --danger-color: #dc2626;
    --warning-color: #f59e0b;
    --info-color: #0891b2;
    --light-color: #f3f4f6;
    --dark-color: #1f2937;
    --white: #ffffff;
    --black: #000000;
    --brand-green: #15554A;
    --border-radius: 8px;
    --transition: all 0.3s ease;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Typography improvements */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

p, span, div, label {
    font-family: var(--font-family);
    font-weight: 500;
}

.btn, button {
    font-family: var(--font-family);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: 0.875rem;
    color: var(--dark-color);
}

.nav-link {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.card-title {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.table th {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: 0.875rem;
}

.alert {
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background-color: var(--white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--brand-green);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--brand-green);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-img {
    height: 40px;
    width: auto;
}

.login-logo {
    height: 80px;
    width: auto;
    margin-bottom: 1rem;
}

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

.nav-link {
    color: var(--dark-color);
    text-decoration: none;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--brand-green);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    text-align: center;
}

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

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

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

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

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

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--brand-green);
    color: var(--brand-green);
}

.btn-outline:hover {
    background-color: var(--brand-green);
    color: var(--white);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-green);
    box-shadow: 0 0 0 3px rgba(21, 85, 74, 0.1);
}

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

/* Cards */
.card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--light-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--light-color);
}

.table th {
    background-color: var(--light-color);
    font-weight: 600;
}

.table tbody tr:hover {
    background-color: #f9fafb;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.75rem;
}

.col {
    flex: 1;
    padding: 0.75rem;
}

.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; }
.col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-md-3 { flex: 0 0 25%; max-width: 25%; }
.col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-md-9 { flex: 0 0 75%; max-width: 75%; }

/* Sidebar */
.sidebar {
    background-color: var(--white);
    min-height: calc(100vh - 70px);
    padding: 1.5rem;
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}

.sidebar-menu {
    list-style: none;
}

.sidebar-item {
    margin-bottom: 0.5rem;
}

.sidebar-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--dark-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.sidebar-link:hover,
.sidebar-link.active {
    background-color: var(--light-color);
    color: var(--brand-green);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* RESPONSIVE DESIGN COMPLETO - Compatible Chrome 100% */

/* Tablet Large (1024px - 1199px) */
@media (max-width: 1199px) {
    .container {
        max-width: 1024px;
        padding: 0 16px;
    }
    
    .navbar {
        padding: 0.8rem 0;
    }
    
    .logo-img {
        height: 35px;
    }
    
    .nav-menu {
        gap: 1.5rem;
    }
    
    .nav-link {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    .card {
        padding: 1.5rem;
    }
}

/* Tablet Portrait (768px - 1023px) */
@media (max-width: 1023px) {
    .container {
        max-width: 768px;
        padding: 0 15px;
    }
    
    /* Grid responsive para tablet */
    .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .col-md-8 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .col-md-9 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
    
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .table th,
    .table td {
        padding: 0.6rem 0.4rem;
    }
    
    /* Ocultar elementos no esenciales en tablet */
    .table .d-none-tablet {
        display: none !important;
    }
}

/* Mobile Large (576px - 767px) */
@media (max-width: 767px) {
    .container {
        padding: 0 12px;
        max-width: 100%;
    }
    
    /* Header móvil mejorado */
    .header {
        position: sticky;
        top: 0;
        z-index: 1001;
    }
    
    .navbar {
        padding: 0.6rem 0;
        position: relative;
    }
    
    .logo-img {
        height: 30px;
        width: auto;
    }
    
    /* Menu hamburguesa mejorado */
    .menu-toggle {
        display: block;
        background: var(--primary-color);
        color: white;
        border: none;
        padding: 0.5rem 0.8rem;
        border-radius: 6px;
        font-size: 0.8rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        -webkit-appearance: none;
        appearance: none;
    }
    
    .menu-toggle:hover {
        background: var(--secondary-color);
        transform: translateY(-1px);
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 60px;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        text-align: center;
        transition: all 0.3s ease;
        box-shadow: 0 10px 27px rgba(0,0,0,0.15);
        padding: 2rem 0;
        border-top: 2px solid var(--primary-color);
        height: calc(100vh - 60px);
        overflow-y: auto;
        z-index: 1000;
    }

    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu li {
        margin: 0.5rem 0;
    }
    
    .nav-link {
        display: block;
        padding: 1rem 2rem;
        font-size: 1rem;
        border-bottom: 1px solid #f0f0f0;
        transition: all 0.3s ease;
    }
    
    .nav-link:hover {
        background: #f8f9fa;
        color: var(--primary-color);
    }

    /* Grid completamente responsive para móvil */
    .col-md-3,
    .col-md-4,
    .col-md-6,
    .col-md-8,
    .col-md-9 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }
    
    /* Typography móvil */
    h1 {
        font-size: 1.8rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.2rem;
        line-height: 1.4;
    }
    
    /* Botones optimizados para móvil */
    .btn {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
        width: 100%;
        margin-bottom: 0.5rem;
        border-radius: 8px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .btn-sm {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
        width: auto;
        margin-bottom: 0.25rem;
    }
    
    /* Cards responsive */
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 10px;
    }
    
    .card-header {
        padding: 1rem 1rem 0.5rem;
    }
    
    .card-body {
        padding: 0.5rem 1rem 1rem;
    }
    
    /* Tablas responsive */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        font-size: 0.8rem;
        min-width: 600px;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.3rem;
        white-space: nowrap;
    }
    
    /* Formularios móvil */
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    .form-control {
        padding: 0.8rem;
        font-size: 1rem;
        border-radius: 8px;
        border: 2px solid #e5e7eb;
        transition: all 0.3s ease;
    }
    
    .form-control:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(21, 85, 74, 0.1);
        outline: none;
    }
    
    /* Alerts móvil */
    .alert {
        padding: 1rem;
        border-radius: 8px;
        margin-bottom: 1rem;
        font-size: 0.9rem;
    }
    
    /* Sidebar móvil */
    .sidebar {
        margin-bottom: 2rem;
        min-height: auto;
    }
    
    /* Ocultar elementos en móvil */
    .d-none-mobile {
        display: none !important;
    }
}

/* Mobile Small (480px - 575px) */
@media (max-width: 575px) {
    .container {
        padding: 0 10px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
    
    .card {
        padding: 0.8rem;
        border-radius: 8px;
    }
    
    .btn {
        padding: 0.7rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .nav-link {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .table {
        font-size: 0.75rem;
    }
    
    .form-control {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
}

/* Mobile Extra Small (menos de 480px) */
@media (max-width: 479px) {
    .container {
        padding: 0 8px;
    }
    
    .logo-img {
        height: 25px;
    }
    
    h1 {
        font-size: 1.4rem;
    }
    
    h2 {
        font-size: 1.2rem;
    }
    
    .card {
        padding: 0.6rem;
    }
    
    .btn {
        padding: 0.6rem;
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 0.4rem 0.2rem;
    }
}

/* Orientación landscape en móviles */
@media (max-height: 500px) and (orientation: landscape) {
    .nav-menu {
        height: calc(100vh - 50px);
        top: 50px;
    }
    
    .nav-link {
        padding: 0.5rem 2rem;
    }
}

/* Mejoras para Chrome específicamente */
@supports (-webkit-appearance: none) {
    .btn,
    .form-control,
    .menu-toggle {
        -webkit-appearance: none;
        -webkit-border-radius: 8px;
    }
    
    .form-control:focus {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Smooth scrolling para Chrome */
    html {
        scroll-behavior: smooth;
        -webkit-text-size-adjust: 100%;
    }
    
    /* Optimización de fuentes para Chrome */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
    }
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-color);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background-color: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-title {
    font-size: 2rem;
    color: var(--brand-green);
    margin-bottom: 0.5rem;
}

/* File Upload */
.file-upload {
    position: relative;
    display: inline-block;
    overflow: hidden;
}

.file-upload input[type="file"] {
    position: absolute;
    left: -9999px;
}

.file-upload-label {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--light-color);
    border: 2px dashed var(--brand-green);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.file-upload-label:hover {
    background-color: var(--brand-green);
    color: var(--white);
}