@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@500;600;700&display=swap');
@import url('https://fonts.cdnfonts.com/css/geist');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Corporate Professional Light Theme - High Spec */
    --bg-main: #f8fafc;
    /* slate-50 */
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-accent: #f1f5f9;
    /* slate-100 */

    --text-primary: #0f172a;
    /* slate-900 */
    --text-secondary: #334155;
    /* slate-700 */
    --text-muted: #64748b;
    /* slate-500 */

    --brand-primary: #2563eb;
    /* blue-600 */
    --brand-secondary: #059669;
    /* emerald-600 */
    --brand-danger: #ef4444;
    /* red-500 */
    --brand-warning: #f59e0b;
    /* amber-500 */

    --border-subtle: #e2e8f0;
    /* slate-200 */
    --border-strong: #cbd5e1;
    /* slate-300 */

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);

    --transition-base: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-main: #0f172a;
        --bg-sidebar: #1e293b;
        --bg-card: #1e293b;
        --bg-accent: #334155;

        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
        --text-muted: #94a3b8;

        --brand-primary: #3b82f6;
        --brand-secondary: #10b981;
        --brand-danger: #f87171;
        --brand-warning: #fbbf24;

        --border-subtle: #334155;
        --border-strong: #475569;

        --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
        --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    }
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Geist', 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

h1,
h2,
h3,
h4,
.font-display {
    font-family: 'Geist', 'Outfit', sans-serif;
    color: var(--text-primary);
}

/* Code and monospace elements */
code,
pre,
.font-mono,
.monospace {
    font-family: 'JetBrains Mono', monospace;
}

h1,
h2,
h3,
h4,
.font-display {
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Components */
.corp-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
}

.corp-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.input-field {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background-color: #ffffff;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: var(--transition-base);
}

.input-field:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
    line-height: 1.25rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--brand-primary);
    color: #ffffff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary:not(:disabled):hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
}

.btn-secondary {
    background-color: var(--brand-secondary);
    color: #ffffff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-secondary:not(:disabled):hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
}

.btn-danger {
    background-color: var(--brand-danger);
    color: #ffffff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-danger:not(:disabled):hover {
    background-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
}

.btn-ghost {
    background-color: transparent;
    color: var(--text-secondary);
    border-color: var(--border-subtle);
}

.btn-ghost:not(:disabled):hover {
    background-color: white;
    color: var(--text-primary);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

/* Modal */
.modal {
    display: none !important;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    max-height: 90vh;
    overflow-y: auto;
}

/* Sidebar */
.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin: 0.25rem 0.75rem;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition-base);
}

.sidebar-btn:hover {
    background-color: var(--bg-accent);
    color: var(--text-primary);
}

.sidebar-btn.active {
    background-color: rgba(37, 99, 235, 0.08);
    color: var(--brand-primary);
    font-weight: 600;
}

/* Tables */
.table-header {
    background-color: var(--bg-accent);
    border-bottom: 2px solid var(--border-subtle);
}

.table-header th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.table-row {
    border-bottom: 1px solid var(--border-subtle);
    transition: var(--transition-base);
}

.table-row:hover {
    background-color: var(--bg-accent);
}

.table-cell {
    padding: 1rem;
    font-size: 0.875rem;
}

/* Tab Management */
.tab-content {
    display: none !important;
}

.tab-content.active {
    display: block !important;
}

/* Glass Effect Utilities */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

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

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

.animate-slide {
    animation: slideIn 0.4s ease-out forwards;
    opacity: 0;
    /* Start invisible */
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    animation: toastIn 0.3s ease-out;
    max-width: 400px;
    line-height: 1.4;
}

.toast.toast-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.toast.toast-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.toast.toast-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.toast.toast-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.toast.toast-out {
    animation: toastOut 0.2s ease-in forwards;
}

.toast .toast-close {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.15s;
    background: none;
    border: none;
    color: inherit;
    font-size: 1rem;
    padding: 0 0.25rem;
}

.toast .toast-close:hover {
    opacity: 1;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(1rem);
    }

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

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

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

/* Skip to content link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--brand-primary);
    color: #fff;
    padding: 0.5rem 1rem;
    z-index: 10000;
    font-size: 0.875rem;
    border-radius: 0 0 8px 0;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

/* Focus visible styles for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* Pagination Controls */
.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-base);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Breadcrumb Styles */
.breadcrumb-link {
    color: var(--text-muted);
    transition: var(--transition-base);
}

.breadcrumb-link:hover {
    color: var(--brand-primary);
}