:root {
    --primary-blue: #0066cc;
    --primary-blue-dark: #0052a3;
    --accent-blue: #00d4ff;
    --success-green: #10b981;
    --danger-red: #ef4444;
    --warning-yellow: #f59e0b;
    
    /* Colores CLAROS */
    --bg-main-light: #ffffff;
    --bg-card-light: #f8fafc;
    --bg-hover-light: #f1f5f9;
    --bg-input-light: #ffffff;
    --text-main-light: #1e293b;
    --text-light-light: #64748b;
    --text-muted-light: #94a3b8;
    --border-light-light: #e2e8f0;
    
    /* Colores OSCUROS */
    --bg-main-dark: #0f172a;
    --bg-card-dark: #1e293b;
    --bg-hover-dark: #334155;
    --bg-input-dark: #1e293b;
    --text-main-dark: #f1f5f9;
    --text-light-dark: #cbd5e1;
    --text-muted-dark: #94a3b8;
    --border-dark-dark: #334155;
}

/* TEMA POR DEFECTO: CLARO */
:root {
    --bg-main: var(--bg-main-light);
    --bg-card: var(--bg-card-light);
    --bg-hover: var(--bg-hover-light);
    --bg-input: var(--bg-input-light);
    --text-main: var(--text-main-light);
    --text-light: var(--text-light-light);
    --text-muted: var(--text-muted-light);
    --border-color: var(--border-light-light);
}

/* TEMA OSCURO */
body.dark-mode {
    --bg-main: var(--bg-main-dark);
    --bg-card: var(--bg-card-dark);
    --bg-hover: var(--bg-hover-dark);
    --bg-input: var(--bg-input-dark);
    --text-main: var(--text-main-dark);
    --text-light: var(--text-light-dark);
    --text-muted: var(--text-muted-dark);
    --border-color: var(--border-dark-dark);
}

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

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* HEADER */
header {
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
    color: white;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 18px;
}

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

.header-title {
    flex: 1;
    text-align: center;
    font-weight: 600;
    font-size: 18px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

/* THEME TOGGLE */
.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
}

/* MAIN CONTAINER */
main.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 100px;
}

/* TABS INFERIORES */
.tabs-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    z-index: 999;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

.tabs-container a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 11px;
    text-align: center;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
}

.tabs-container a:hover {
    background: var(--bg-hover);
    color: var(--primary-blue);
}

.tabs-container a.active {
    color: var(--primary-blue);
    border-bottom-color: var(--primary-blue);
    background: var(--bg-hover);
}

.tab-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

/* BOTONES */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
}

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

.btn-primary:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-2px);
}

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

.btn-success:hover {
    background: #059669;
}

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

.btn-danger:hover {
    background: #dc2626;
}

/* INPUTS */
input, textarea, select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

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

/* TABLAS */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

th {
    background: var(--bg-hover);
    padding: 12px;
    text-align: left;
    font-weight: 700;
    border-bottom: 2px solid var(--border-color);
}

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

tr:hover {
    background: var(--bg-hover);
}

/* UTILS */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.gap-12 {
    gap: 12px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    header {
        padding: 12px 16px;
    }

    .header-content {
        gap: 12px;
    }

    .header-title {
        font-size: 16px;
    }

    main.container {
        padding: 16px;
    }

    .tab-icon {
        font-size: 18px;
    }

    .tabs-container a {
        padding: 10px 6px;
        font-size: 10px;
    }
}

/* ANIMACIONES */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animated {
    animation: slideInUp 0.3s ease-out;
}
