:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-input: #ffffff;
    --border-color: #e2e8f0;
    --border-subtle: #cbd5e1;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
}

[data-theme="dark"], .dark {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --bg-input: #0f172a;
    --border-color: #334155;
    --border-subtle: #475569;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    transition: background-color 0.15s ease, color 0.15s ease;
}

[data-theme="dark"] body, .dark body {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

[data-theme="dark"] header, .dark header {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] footer, .dark footer {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .custom-card, .dark .custom-card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .bg-white, .dark .bg-white {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .bg-slate-50, .dark .bg-slate-50 {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .bg-slate-100, .dark .bg-slate-100 {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .bg-blue-50, .dark .bg-blue-50 {
    background-color: #1e3a8a33 !important;
    color: #60a5fa !important;
    border-color: #1d4ed844 !important;
}

[data-theme="dark"] .bg-emerald-50, .dark .bg-emerald-50 {
    background-color: #064e3b33 !important;
    color: #34d399 !important;
}

[data-theme="dark"] .bg-amber-50, .dark .bg-amber-50 {
    background-color: #78350f33 !important;
    color: #fbbf24 !important;
    border-color: #92400e44 !important;
}

[data-theme="dark"] .bg-red-50, .dark .bg-red-50 {
    background-color: #7f1d1d33 !important;
    color: #f87171 !important;
    border-color: #991b1b44 !important;
}

[data-theme="dark"] .bg-cyan-50, .dark .bg-cyan-50 {
    background-color: #164e6333 !important;
    color: #22d3ee !important;
}

[data-theme="dark"] .bg-purple-50, .dark .bg-purple-50 {
    background-color: #581c8733 !important;
    color: #c084fc !important;
}

[data-theme="dark"] .text-slate-900, .dark .text-slate-900,
[data-theme="dark"] .text-slate-800, .dark .text-slate-800,
[data-theme="dark"] .text-slate-700, .dark .text-slate-700 {
    color: #f8fafc !important;
}

[data-theme="dark"] .text-slate-600, .dark .text-slate-600,
[data-theme="dark"] .text-slate-500, .dark .text-slate-500 {
    color: #94a3b8 !important;
}

[data-theme="dark"] .border-slate-100, .dark .border-slate-100,
[data-theme="dark"] .border-slate-200, .dark .border-slate-200,
[data-theme="dark"] .border-slate-300, .dark .border-slate-300 {
    border-color: #334155 !important;
}

[data-theme="dark"] input, .dark input,
[data-theme="dark"] select, .dark select,
[data-theme="dark"] textarea, .dark textarea {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

[data-theme="dark"] input:focus, .dark input:focus,
[data-theme="dark"] select:focus, .dark select:focus,
[data-theme="dark"] textarea:focus, .dark textarea:focus {
    border-color: #3b82f6 !important;
}

[data-theme="dark"] .modal-content, .dark .modal-content {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] #mobile-menu, .dark #mobile-menu {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .toast, .dark .toast {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
}

.custom-table th {
    background-color: #f1f5f9;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
}

.custom-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    color: #1e293b;
    font-size: 0.875rem;
}

.custom-table tbody tr:hover {
    background-color: #f8fafc;
}

[data-theme="dark"] .custom-table th, .dark .custom-table th {
    background-color: #0f172a !important;
    color: #94a3b8 !important;
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .custom-table td, .dark .custom-table td {
    color: #f8fafc !important;
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .custom-table tbody tr:hover, .dark .custom-table tbody tr:hover {
    background-color: #33415544 !important;
}

.modal-backdrop {
    background: rgba(0, 0, 0, 0.6);
}

.modal-content {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
}

#toast-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 90vw;
    width: 350px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    font-size: 0.875rem;
}

.toast.toast-success { border-left: 4px solid var(--success); }
.toast.toast-error { border-left: 4px solid var(--danger); }
.toast.toast-info { border-left: 4px solid var(--primary); }
.toast.toast-warning { border-left: 4px solid var(--warning); }

.copy-badge {
    cursor: pointer;
    user-select: none;
}
.copy-badge:hover {
    opacity: 0.8;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}
