/**
 * ERP System - Modern B2B SaaS Theme
 * Color scheme: Dark blue/white with turquoise accent
 */

:root {
    --primary-blue: #1a2332;
    --secondary-blue: #2c3e50;
    --accent-turquoise: #00d9ff;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --light-gray-2: #e9ecef;
    --text-gray: #6c757d;
    --text-dark: #1a2332;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background: var(--light-gray);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary-blue);
    font-weight: 700;
    letter-spacing: -0.5px;
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -2px;
}

h2 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

h3 {
    font-size: 1.75rem;
}

/* Fixed Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 1.5rem 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    z-index: var(--z-modal);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-blue);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo span {
    color: #666666;
}

/* Buttons */
.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.btn-primary:hover {
    background: #00c4e6;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 217, 255, 0.3);
}

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

.btn-secondary:hover {
    background: var(--secondary-blue);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(26, 35, 50, 0.2);
}

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

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

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

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(40, 167, 69, 0.3);
}

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

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

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 193, 7, 0.3);
}

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

.btn-light:hover {
    background: var(--light-gray-2);
}

.btn-sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
}

.btn-lg {
    padding: 1.25rem 3rem;
    font-size: 1.1rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

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

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.card-subtitle {
    color: var(--text-gray);
    font-size: 0.95rem;
}

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-blue);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--light-gray-2);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    color: var(--text-dark);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-turquoise);
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1);
}

.form-control::placeholder {
    color: var(--text-gray);
    opacity: 0.6;
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 7.5rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
}

thead th {
    background: var(--light-gray);
    color: var(--primary-blue);
    font-weight: 700;
    padding: 1.25rem 1.5rem;
    text-align: left;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--light-gray);
    color: var(--text-dark);
}

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

tbody tr:hover {
    background: var(--light-gray);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02rem;
}

.badge-primary {
    background: rgba(102, 102, 102, 0.1);
    color: #666666;
}

.badge-success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #d39e00;
}

.badge-danger {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.badge-info {
    background: rgba(23, 162, 184, 0.1);
    color: var(--info);
}

.badge-light {
    background: var(--light-gray);
    color: var(--text-gray);
}

/* Alerts */
.alert {
    padding: 1.25rem 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    background: white;
}

.alert-success {
    border-color: var(--success);
    background: rgba(40, 167, 69, 0.05);
    color: var(--success);
}

.alert-error {
    border-color: var(--danger);
    background: rgba(220, 53, 69, 0.05);
    color: var(--danger);
}

.alert-warning {
    border-color: var(--warning);
    background: rgba(255, 193, 7, 0.05);
    color: #d39e00;
}

.alert-info {
    border-color: var(--info);
    background: rgba(23, 162, 184, 0.05);
    color: var(--info);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 3rem;
}

.container-fluid {
    width: 100%;
    padding: 0 3rem;
}

/* Grid */
.grid {
    display: grid;
    gap: 2rem;
}

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

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

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

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

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

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

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

.text-primary { color: #666666; }
.text-secondary { color: var(--text-gray); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.fw-bold { font-weight: 700; }
.fw-normal { font-weight: 400; }

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-gray);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 2.5rem;
    height: 2.5rem;
    border: 4px solid var(--light-gray-2);
    border-top-color: var(--accent-turquoise);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-gray);
}

.empty-state h3 {
    color: var(--text-gray);
    margin-bottom: 0.5rem;
}

/* ===== RESPONSIVE - MOBILE-FIRST ===== */

/* Base móvil */
.container,
.container-fluid,
.header-container {
    padding: 0 1.5rem;
}

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

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.75rem;
}

table {
    font-size: 0.9rem;
}

thead th,
tbody td {
    padding: 1rem;
}

/* Tablet (768px+) */
@media (min-width: 768px) {
    .container,
    .container-fluid,
    .header-container {
        padding: 0 2rem;
    }

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

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .container,
    .container-fluid,
    .header-container {
        padding: 0 3rem;
    }

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

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

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

    h1 {
        font-size: 3rem;
    }

    h2 {
        font-size: 2.5rem;
    }

    table {
        font-size: 1rem;
    }

    thead th,
    tbody td {
        padding: 1.25rem 1.5rem;
    }
}
