:root {
    --bg-color: #f9fafb;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --primary: #000000;
    --primary-hover: #374151;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --success: #16a34a;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-main);
    margin-top: 0;
}

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

/* Containers */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    text-decoration: none;
    border: 1px solid transparent;
}

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

.btn-outline {
    background-color: #ffffff;
    border-color: var(--border-color);
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}
.btn-outline:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.btn-danger {
    background-color: #ffffff;
    border-color: #fca5a5;
    color: var(--danger);
    box-shadow: var(--shadow-sm);
}
.btn-danger:hover {
    background-color: #fef2f2;
    border-color: var(--danger);
}

.btn-icon {
    padding: 0.4rem;
    border-radius: 4px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-icon:hover {
    background: #f3f4f6;
    color: var(--text-main);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(17, 24, 39, 0.4);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    width: 100%; max-width: 420px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform 0.2s;
}
.modal-overlay.active .modal-content { transform: scale(1); }
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1.5rem;
}
.modal-header h3 { margin: 0; font-size: 1.125rem; }
.close-modal { background: none; border: none; font-size: 1.25rem; color: var(--text-muted); cursor: pointer; }
.close-modal:hover { color: var(--text-main); }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.5rem; color: var(--text-main); }
.form-control {
    width: 100%; padding: 0.5rem 0.75rem;
    background: #ffffff; border: 1px solid var(--border-color);
    color: var(--text-main); border-radius: 6px;
    font-size: 0.875rem; font-family: inherit;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }

/* Tables */
.table-container { overflow-x: auto; border: 1px solid var(--border-color); border-radius: 8px; background: #fff; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-color); }
th {
    background: #f9fafb; font-size: 0.75rem;
    font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f9fafb; }

/* Switch */
.switch { position: relative; display: inline-block; width: 44px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #e5e7eb; transition: .2s; border-radius: 22px;
}
.slider:before {
    position: absolute; content: ""; height: 18px; width: 18px; left: 2px; bottom: 2px;
    background-color: white; transition: .2s; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(22px); }

/* Badges */
.badge { padding: 0.25rem 0.5rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 500; }
.badge-gray { background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }
.badge-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.badge-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* Utilities */
.w-100 { width: 100%; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Toast */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 1050; }
.toast {
    background: #111827; color: white; padding: 1rem; border-radius: 8px;
    display: flex; align-items: center; gap: 0.75rem;
    box-shadow: var(--shadow-lg); transform: translateY(20px); opacity: 0; transition: all 0.2s;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* SVG Icon Helpers */
.lucide {
    width: 16px;
    height: 16px;
    stroke-width: 2;
    display: inline-block;
    vertical-align: middle;
}
.icon-md { width: 20px; height: 20px; }
.icon-lg { width: 32px; height: 32px; }
.icon-xl { width: 48px; height: 48px; }
.btn .lucide { margin-right: 0.5rem; }
.btn-icon .lucide { margin-right: 0; }

/* Responsive Media Queries */
@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid var(--border-color);
        padding: 1.25rem !important;
    }
    .main-content {
        padding: 1.5rem 1rem !important;
    }
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        margin-bottom: 1.5rem !important;
    }
    .search-container {
        flex-direction: column;
        align-items: stretch !important;
        gap: 1rem;
    }
    .search-container input {
        max-width: 100% !important;
        width: 100%;
    }
    .search-container .d-flex {
        width: 100%;
        justify-content: space-between;
    }
    .search-container .d-flex button {
        flex: 1;
    }
    .header-actions {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    .header-actions .d-flex {
        width: 100%;
        justify-content: space-between;
    }
    .header-actions .d-flex a, .header-actions .d-flex button {
        flex: 1;
        text-align: center;
    }
    /* Modals responsive */
    .modal-content {
        width: 95% !important;
        margin: 10px;
        padding: 1.25rem !important;
    }
    /* Historial page responsive */
    .page-container {
        padding: 1.5rem 1rem !important;
    }
    .header-actions {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    .header-actions .badge {
        margin-top: 0.5rem;
    }
}



