/* ========================================
   SISTEMA DE DISEÑO GLOBAL - Web Publisher
   ======================================== */

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --text: #2c3e50;
    --muted: #7f8c8d;
    --border: #e0e0e0;
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.05);
    --shadow-md: 0 5px 20px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    height: 100%;
}

/* Typography */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #f0f2f5;
    color: var(--text);
    line-height: 1.6;
    font-size: 14px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--dark);
}

h1 { font-size: 28px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }

/* ========================================
   HEADER & NAVIGATION
   ======================================== */

.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    color: white;
}

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

.btn-header-secondary,
.btn-header-danger {
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 5px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.btn-header-secondary {
    background: rgba(255,255,255,0.2);
    color: white;
}

.btn-header-secondary:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

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

.btn-header-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* Navigation */
.nav {
    background: white;
    padding: 0 30px;
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 5px;
    border-bottom: 1px solid var(--light);
}

.nav-link {
    color: var(--muted);
    text-decoration: none;
    padding: 15px 20px;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    font-weight: 500;
    font-size: 14px;
}

.nav-link:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ========================================
   CONTAINER & LAYOUT
   ======================================== */

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

.container-sm {
    max-width: 900px;
    margin: 30px auto;
    padding: 0 30px;
}

.container-xs {
    max-width: 600px;
    margin: 30px auto;
    padding: 0 30px;
}

/* Grid System */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* ========================================
   CARDS
   ======================================== */

.card {
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--light);
}

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

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

.card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid var(--light);
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

/* Stat Card */
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.stat-card .icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.stat-card .value {
    font-size: 32px;
    font-weight: bold;
    color: var(--dark);
    margin-bottom: 5px;
}

.stat-card .label {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.stat-card .trend {
    margin-top: 10px;
    font-size: 12px;
    color: var(--muted);
}

/* ========================================
   FORMULARIOS
   ======================================== */

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

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

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: white;
}

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

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

/* ========================================
   BOTONES
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

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

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

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: var(--light);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #e8e9f0;
}

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

.btn-success:hover {
    opacity: 0.9;
}

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

.btn-danger:hover {
    opacity: 0.9;
}

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

.btn-warning:hover {
    opacity: 0.9;
}

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

.btn-info:hover {
    opacity: 0.9;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-large {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

/* ========================================
   TABLAS
   ======================================== */

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

th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
    border-bottom: 2px solid var(--light);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

tr:hover {
    background: #f8f9fa;
}

tr:last-child td {
    border-bottom: none;
}

/* ========================================
   BADGES & ETIQUETAS
   ======================================== */

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-default {
    background: var(--light);
    color: var(--muted);
}

.badge-primary {
    background: rgba(102, 126, 234, 0.2);
    color: var(--primary);
}

.badge-success {
    background: rgba(39, 174, 96, 0.2);
    color: var(--success);
}

.badge-danger {
    background: rgba(231, 76, 60, 0.2);
    color: var(--danger);
}

.badge-warning {
    background: rgba(243, 156, 18, 0.2);
    color: var(--warning);
}

.badge-info {
    background: rgba(52, 152, 219, 0.2);
    color: var(--info);
}

/* ========================================
   ALERTAS
   ======================================== */

.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid var(--light);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-primary {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
}

.alert-success {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success);
    border-left-color: var(--success);
}

.alert-danger {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger);
    border-left-color: var(--danger);
}

.alert-warning {
    background: rgba(243, 156, 18, 0.1);
    color: var(--warning);
    border-left-color: var(--warning);
}

.alert-info {
    background: rgba(52, 152, 219, 0.1);
    color: var(--info);
    border-left-color: var(--info);
}

/* ========================================
   UTILIDADES
   ======================================== */

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

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

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

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

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

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

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

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mt-40 { margin-top: 40px; }

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

.p-10 { padding: 10px; }
.p-20 { padding: 20px; }
.p-30 { padding: 30px; }

.gap-10 { gap: 10px; }
.gap-15 { gap: 15px; }
.gap-20 { gap: 20px; }

.rounded { border-radius: 5px; }
.rounded-lg { border-radius: 10px; }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

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

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

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.cursor-pointer {
    cursor: pointer;
}

/* ========================================
   BANNERS
   ======================================== */

.banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.banner h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: white;
}

.banner p {
    opacity: 0.9;
    margin: 0;
}

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

@media (max-width: 768px) {
    .container,
    .container-sm,
    .container-xs {
        padding: 0 15px;
    }

    .header {
        padding: 15px 15px;
        flex-direction: column;
        gap: 15px;
    }

    .header h1 {
        font-size: 20px;
    }

    .user-info {
        width: 100%;
        justify-content: space-between;
    }

    .nav {
        padding: 0 15px;
        overflow-x: auto;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .stat-card .value {
        font-size: 24px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .card-footer {
        flex-direction: column;
    }
}

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

    .header .user-info {
        flex-direction: column;
        gap: 10px;
    }

    .nav-link {
        padding: 12px 15px;
    }

    h2 { font-size: 20px; }
    h3 { font-size: 16px; }
}
