/* ============================================
   CAIUSACH System - Global CSS
   Colores principales:
   - Púrpura: #7c4991
   - Teal: #009895
   - Naranja: #cc5d2f
   - Gris Oscuro: #384049
   ============================================ */

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

:root {
    --color-primary: #7c4991;
    --color-secondary: #009895;
    --color-accent: #cc5d2f;
    --color-text: #384049;
    --color-text-light: #666;
    --color-bg: #f5f5f5;
    --color-border: #e0e0e0;
    --color-success: #4caf50;
    --color-warning: #ff9800;
    --color-error: #f44336;

    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-heading: 'BEBAS NEUE PRO', sans-serif;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* ============================================
   RESET & GENERAL
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

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

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

a:hover {
    color: var(--color-secondary);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-text);
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

h1 {
    font-size: 32px;
    font-weight: 700;
}

h2 {
    font-size: 24px;
    font-weight: 700;
}

h3 {
    font-size: 20px;
    font-weight: 700;
}

h4 {
    font-size: 18px;
    font-weight: 600;
}

p {
    margin-bottom: 10px;
    color: var(--color-text-light);
}

small {
    font-size: 12px;
    color: var(--color-text-light);
}

/* ============================================
   BUTTONS
   ============================================ */

button, .btn {
    font-family: var(--font-primary);
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

.btn-secondary:hover {
    background: #008080;
    transform: translateY(-2px);
}

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

.btn-accent:hover {
    background: #b84620;
    transform: translateY(-2px);
}

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

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

/* ============================================
   FORMS
   ============================================ */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 14px;
    color: var(--color-text);
    background: white;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(124, 73, 145, 0.1);
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--color-text);
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

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

/* ============================================
   CARDS & CONTAINERS
   ============================================ */

.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: box-shadow 0.3s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

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

/* ============================================
   ALERTS
   ============================================ */

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: var(--radius-md);
    border-left: 4px solid;
}

.alert-success {
    background: #e8f5e9;
    border-color: var(--color-success);
    color: #1b5e20;
}

.alert-warning {
    background: #fff3e0;
    border-color: var(--color-warning);
    color: #e65100;
}

.alert-error,
.alert-danger {
    background: #ffebee;
    border-color: var(--color-error);
    color: #b71c1c;
}

.alert-info {
    background: #e1f5fe;
    border-color: #0277bd;
    color: #01579b;
}

/* ============================================
   TABLES
   ============================================ */

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead {
    background: #f5f5f5;
}

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

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

tbody tr:hover {
    background: #fafafa;
}

/* ============================================
   UTILITIES
   ============================================ */

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

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

.text-accent {
    color: var(--color-accent);
}

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

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

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

.ml-auto {
    margin-left: auto;
}

.mr-auto {
    margin-right: auto;
}

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

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

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

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

.p-10 {
    padding: 10px;
}

.p-20 {
    padding: 20px;
}

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-10 {
    gap: 10px;
}

.gap-20 {
    gap: 20px;
}

/* ============================================
   GRID SYSTEM
   ============================================ */

.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    .card {
        padding: 15px;
    }

    table {
        font-size: 12px;
    }

    th,
    td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 20px;
    }

    h2 {
        font-size: 18px;
    }

    button, .btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    input,
    textarea,
    select {
        font-size: 16px; /* Evita zoom en iOS */
    }
}

/* ============================================
   SCROLLBAR (Webkit)
   ============================================ */

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-in {
    animation: slideIn 0.3s ease;
}
