﻿/* ========================================
   Orinex OS — Premium Financial Operations Platform
   Design System v3.0  |  Dark-first
   ======================================== */

/* ── Design Tokens ── */
:root {
    /* Backgrounds */
    --fc-bg-base: #0A0F1A;
    --fc-bg-surface: #111827;
    --fc-bg-elevated: #151f30;
    --fc-bg-overlay: #1a2540;
    --fc-bg-subtle: rgba(255,255,255,0.03);
    --fc-bg-hover: rgba(255,255,255,0.05);
    /* Glass */
    --fc-glass: rgba(17,24,39,0.72);
    --fc-glass-border: rgba(255,255,255,0.07);
    --fc-glass-hover: rgba(255,255,255,0.09);
    /* Accent — Teal (Orinex signature) */
    --fc-accent: #2DD4BF;
    --fc-accent-dim: rgba(45,212,191,0.12);
    --fc-accent-glow: rgba(45,212,191,0.24);
    --fc-accent-bright: #5eead4;
    /* Primary Blue */
    --fc-primary: #2F80ED;
    --fc-primary-dim: rgba(47,128,237,0.14);
    --fc-primary-glow: rgba(47,128,237,0.28);
    /* Highlight Violet */
    --fc-highlight: #7B61FF;
    --fc-highlight-dim: rgba(123,97,255,0.12);
    /* Semantic */
    --fc-success: #22C55E;
    --fc-success-dim: rgba(34,197,94,0.12);
    --fc-warning: #F59E0B;
    --fc-warning-dim: rgba(245,158,11,0.12);
    --fc-danger: #EF4444;
    --fc-danger-dim: rgba(239,68,68,0.12);
    --fc-info: #06B6D4;
    --fc-info-dim: rgba(6,182,212,0.12);
    --fc-purple: #7B61FF;
    --fc-purple-dim: rgba(123,97,255,0.12);
    /* Text */
    --fc-text: #E5E7EB;
    --fc-text-secondary: #9CA3AF;
    --fc-text-muted: #4B5563;
    --fc-text-bright: #F9FAFB;
    /* Border */
    --fc-border: #1F2937;
    --fc-border-strong: rgba(255,255,255,0.13);
    /* Sidebar */
    --fc-sidebar-width: 240px;
    /* Topbar */
    --fc-topbar-height: 60px;
    /* Radius */
    --fc-radius-sm: 6px;
    --fc-radius: 10px;
    --fc-radius-lg: 14px;
    --fc-radius-xl: 20px;
    --fc-radius-full: 9999px;
    /* Shadows */
    --fc-shadow-sm: 0 1px 4px rgba(0,0,0,0.4);
    --fc-shadow: 0 4px 16px rgba(0,0,0,0.4);
    --fc-shadow-lg: 0 12px 40px rgba(0,0,0,0.55);
    /* Transitions */
    --fc-transition: all 0.17s cubic-bezier(0.4,0,0.2,1);
    --fc-transition-slow: all 0.26s cubic-bezier(0.4,0,0.2,1);
    /* Font */
    --fc-font: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    /* Orinex signature gradient */
    --fc-gradient: linear-gradient(135deg, #2F80ED, #2DD4BF, #7B61FF);
}

/* ── Light Theme ── */
[data-theme="light"] {
    --fc-bg-base: #f5f7fa;
    --fc-bg-surface: #ffffff;
    --fc-bg-elevated: #ffffff;
    --fc-bg-overlay: #f0f2f5;
    --fc-bg-subtle: rgba(0,0,0,0.02);
    --fc-bg-hover: rgba(0,0,0,0.04);
    --fc-glass: rgba(255,255,255,0.82);
    --fc-glass-border: rgba(0,0,0,0.08);
    --fc-glass-hover: rgba(0,0,0,0.10);
    --fc-accent: #0d9488;
    --fc-accent-dim: rgba(13,148,136,0.10);
    --fc-accent-glow: rgba(13,148,136,0.18);
    --fc-accent-bright: #2DD4BF;
    --fc-primary: #2563eb;
    --fc-primary-dim: rgba(37,99,235,0.10);
    --fc-primary-glow: rgba(37,99,235,0.18);
    --fc-highlight: #6d28d9;
    --fc-highlight-dim: rgba(109,40,217,0.08);
    --fc-success: #16a34a;
    --fc-success-dim: rgba(22,163,74,0.10);
    --fc-warning: #d97706;
    --fc-warning-dim: rgba(217,119,6,0.10);
    --fc-danger: #dc2626;
    --fc-danger-dim: rgba(220,38,38,0.08);
    --fc-info: #0891b2;
    --fc-info-dim: rgba(8,145,178,0.08);
    --fc-purple: #6d28d9;
    --fc-purple-dim: rgba(109,40,217,0.08);
    --fc-text: #374151;
    --fc-text-secondary: #6B7280;
    --fc-text-muted: #9CA3AF;
    --fc-text-bright: #111827;
    --fc-border: #E5E7EB;
    --fc-border-strong: rgba(0,0,0,0.15);
    --fc-shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --fc-shadow: 0 4px 12px rgba(0,0,0,0.08);
    --fc-shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
}

    /* ── Light theme overrides ── */
    [data-theme="light"] ::-webkit-scrollbar-thumb {
        background: rgba(0,0,0,0.12);
    }

        [data-theme="light"] ::-webkit-scrollbar-thumb:hover {
            background: rgba(0,0,0,0.22);
        }

    [data-theme="light"] .fc-topbar {
        background: rgba(255,255,255,0.88);
    }

    [data-theme="light"] .fc-sidebar::before {
        background: radial-gradient(ellipse at 50% 0%, rgba(47,128,237,0.05) 0%, transparent 70%);
    }

    [data-theme="light"] #fc-search-overlay {
        background: rgba(0,0,0,0.35) !important;
    }

    [data-theme="light"] .fc-pub-nav {
        background: rgba(255,255,255,0.88);
    }

    [data-theme="light"] .fc-activity-panel {
        box-shadow: -8px 0 32px rgba(0,0,0,0.08);
    }

    [data-theme="light"] .fc-btn-primary {
        box-shadow: 0 0 12px rgba(47,128,237,0.18);
    }

        [data-theme="light"] .fc-btn-primary:hover {
            box-shadow: 0 0 18px rgba(47,128,237,0.28);
        }

    [data-theme="light"] .fc-btn-accent {
        box-shadow: 0 0 12px rgba(37,99,235,0.2);
    }

    [data-theme="light"] select.fc-form-control,
    [data-theme="light"] select.fc-input {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' fill='%236B7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        padding-right: 34px;
        cursor: pointer;
    }
    /* Alert text overrides for light theme only */
    [data-theme="light"] .fc-alert-success {
        color: #065f46;
    }

    [data-theme="light"] .fc-alert-danger {
        color: #991b1b;
    }

    [data-theme="light"] .fc-alert-warning {
        color: #92400e;
    }

    [data-theme="light"] .fc-alert-info {
        color: #164e63;
    }

/* Theme toggle button */
.fc-theme-toggle {
    width: 34px;
    height: 34px;
    border-radius: var(--fc-radius-sm);
    background: var(--fc-bg-elevated);
    border: 1px solid var(--fc-border);
    color: var(--fc-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--fc-transition);
    font-size: 13px;
    padding: 0;
    font-family: var(--fc-font);
}

    .fc-theme-toggle:hover {
        background: var(--fc-bg-hover);
        color: var(--fc-text);
        border-color: var(--fc-border-strong);
    }

/* ── Reset ── */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--fc-font);
    font-size: 14px;
    color: var(--fc-text);
    background: var(--fc-bg-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.09);
    border-radius: 3px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: rgba(255,255,255,0.18);
    }

/* ═══════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════ */
.fc-app {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.fc-sidebar {
    width: var(--fc-sidebar-width);
    background: var(--fc-bg-base);
    border-right: 1px solid var(--fc-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    overflow: hidden;
    transition: var(--fc-transition-slow);
}

    .fc-sidebar::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 200px;
        background: radial-gradient(ellipse at 50% 0%,rgba(47,128,237,0.07) 0%,transparent 70%);
        pointer-events: none;
    }

.fc-sidebar-brand {
    padding: 0 18px;
    height: var(--fc-topbar-height);
    display: flex;
    align-items: center;
    gap: 11px;
    border-bottom: 1px solid var(--fc-border);
    flex-shrink: 0;
}

    .fc-sidebar-brand .brand-logo {
        height: 52px;
        width: auto;
        object-fit: contain;
        flex-shrink: 0;
    }

    .fc-sidebar-brand .brand-text h1 {
        font-size: 14.5px;
        font-weight: 800;
        color: var(--fc-text-bright);
        margin: 0;
        letter-spacing: -0.2px;
        white-space: nowrap;
    }

    .fc-sidebar-brand .brand-text .brand-tag {
        font-size: 10px;
        color: var(--fc-text-muted);
        text-transform: uppercase;
        letter-spacing: 1.3px;
        white-space: nowrap;
    }

.fc-sidebar-nav {
    flex: 1;
    padding: 10px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.fc-nav-section {
    padding: 14px 20px 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--fc-text-muted);
    white-space: nowrap;
}

.fc-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 18px;
    margin: 1px 8px;
    border-radius: var(--fc-radius-sm);
    color: var(--fc-text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--fc-transition);
    position: relative;
    white-space: nowrap;
}

    .fc-nav-item:hover {
        background: var(--fc-bg-hover);
        color: var(--fc-text);
    }

    .fc-nav-item.active {
        background: var(--fc-primary-dim);
        color: var(--fc-accent-bright);
        font-weight: 600;
    }

        .fc-nav-item.active::before {
            content: '';
            position: absolute;
            left: 0;
            top: 22%;
            bottom: 22%;
            width: 3px;
            border-radius: 0 2px 2px 0;
            background: linear-gradient(180deg,var(--fc-primary),var(--fc-accent));
            box-shadow: 0 0 8px var(--fc-primary-glow);
        }

    .fc-nav-item .nav-icon {
        width: 18px;
        text-align: center;
        font-size: 14px;
        flex-shrink: 0;
        opacity: 0.6;
        transition: opacity 0.17s;
    }

    .fc-nav-item:hover .nav-icon, .fc-nav-item.active .nav-icon {
        opacity: 1;
    }

.fc-sidebar-footer {
    padding: 10px 8px;
    border-top: 1px solid var(--fc-border);
}

/* ── Main ── */
.fc-main {
    flex: 1;
    margin-left: var(--fc-sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Topbar ── */
.fc-topbar {
    height: var(--fc-topbar-height);
    background: rgba(10,15,26,0.85);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--fc-border);
    padding: 0 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.fc-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fc-topbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Global search */
.fc-global-search {
    position: relative;
    margin-right: 6px;
}

    .fc-global-search input {
        width: 220px;
        background: var(--fc-bg-elevated);
        border: 1px solid var(--fc-border);
        border-radius: var(--fc-radius-full);
        color: var(--fc-text);
        font-size: 12.5px;
        padding: 6px 52px 6px 34px;
        transition: var(--fc-transition);
        font-family: var(--fc-font);
    }

        .fc-global-search input:focus {
            outline: none;
            border-color: var(--fc-primary);
            box-shadow: 0 0 0 3px var(--fc-primary-glow);
            width: 280px;
        }

        .fc-global-search input::placeholder {
            color: var(--fc-text-muted);
        }

    .fc-global-search .search-icon {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--fc-text-muted);
        font-size: 11px;
        pointer-events: none;
    }

    .fc-global-search .search-kbd {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        background: var(--fc-bg-overlay);
        border: 1px solid var(--fc-border);
        border-radius: 4px;
        padding: 1px 6px;
        font-size: 10px;
        color: var(--fc-text-muted);
        pointer-events: none;
        white-space: nowrap;
    }

/* Quick action buttons */
.fc-quick-action-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--fc-radius-sm);
    background: var(--fc-bg-elevated);
    border: 1px solid var(--fc-border);
    color: var(--fc-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--fc-transition);
    text-decoration: none;
    font-size: 13px;
}

    .fc-quick-action-btn:hover {
        background: var(--fc-bg-hover);
        color: var(--fc-text);
        border-color: var(--fc-border-strong);
    }

/* User chip */
.fc-topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: var(--fc-radius);
    border: 1px solid var(--fc-border);
    background: var(--fc-bg-elevated);
    cursor: pointer;
    transition: var(--fc-transition);
    margin-left: 4px;
}

    .fc-topbar-user:hover {
        border-color: var(--fc-border-strong);
        background: var(--fc-bg-hover);
    }

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--fc-radius-sm);
    background: linear-gradient(135deg,var(--fc-primary),var(--fc-accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

.fc-topbar-user .user-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--fc-text);
    white-space: nowrap;
}

/* ── Dropdown ── */
.fc-dropdown {
    display: none;
    position: fixed;
    top: calc(var(--fc-topbar-height) + 4px);
    right: 20px;
    z-index: 500;
    background: var(--fc-bg-elevated);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius-lg);
    min-width: 210px;
    box-shadow: var(--fc-shadow-lg);
    padding: 5px;
}

    .fc-dropdown.open {
        display: block;
    }

.fc-dropdown-header {
    padding: 10px 13px;
    border-bottom: 1px solid var(--fc-border);
    margin-bottom: 4px;
}

.fc-dropdown-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 13px;
    font-size: 13px;
    color: var(--fc-text-secondary);
    text-decoration: none;
    border-radius: var(--fc-radius-sm);
    transition: var(--fc-transition);
    cursor: pointer;
}

    .fc-dropdown-item:hover {
        background: var(--fc-bg-hover);
        color: var(--fc-text);
    }

.fc-dropdown-item-danger {
    color: var(--fc-danger);
}

    .fc-dropdown-item-danger:hover {
        background: var(--fc-danger-dim);
        color: var(--fc-danger);
    }

.fc-dropdown-divider {
    height: 1px;
    background: var(--fc-border);
    margin: 4px 0;
}

/* ── Page content ── */
.fc-content {
    flex: 1;
    padding: 28px 30px;
}

/* ═══════════════════════════════════════════
   CARDS
═══════════════════════════════════════════ */
.fc-card {
    background: var(--fc-bg-surface);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    transition: var(--fc-transition-slow);
}

    .fc-card:hover {
        border-color: var(--fc-glass-hover);
    }

.fc-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--fc-border);
}

    .fc-card-header h3 {
        font-size: 14px;
        font-weight: 600;
        color: var(--fc-text);
        margin: 0;
    }

/* ═══════════════════════════════════════════
   KPI / STAT CARDS
═══════════════════════════════════════════ */
.fc-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(200px,1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.fc-stat-card {
    background: var(--fc-bg-surface);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius-lg);
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
    transition: var(--fc-transition-slow);
}

    .fc-stat-card::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 2px;
        background: var(--card-accent,var(--fc-accent));
        opacity: 0.5;
        transition: opacity 0.2s;
    }

    .fc-stat-card:hover {
        border-color: var(--fc-border-strong);
        transform: translateY(-1px);
        box-shadow: var(--fc-shadow);
    }

        .fc-stat-card:hover::after {
            opacity: 1;
        }

    .fc-stat-card .stat-content h4 {
        font-size: 10.5px;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        color: var(--fc-text-muted);
        margin: 0 0 8px;
        font-weight: 600;
    }

    .fc-stat-card .stat-value {
        font-size: 26px;
        font-weight: 800;
        color: var(--fc-text-bright);
        line-height: 1.1;
        letter-spacing: -0.5px;
    }

    .fc-stat-card .stat-delta {
        font-size: 11.5px;
        margin-top: 5px;
        color: var(--fc-text-muted);
    }

    .fc-stat-card .stat-icon {
        width: 42px;
        height: 42px;
        border-radius: var(--fc-radius);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 17px;
        flex-shrink: 0;
    }

.stat-icon.emerald {
    background: var(--fc-success-dim);
    color: var(--fc-success);
}

.stat-icon.blue {
    background: var(--fc-primary-dim);
    color: var(--fc-primary);
}

.stat-icon.red {
    background: var(--fc-danger-dim);
    color: var(--fc-danger);
}

.stat-icon.amber {
    background: var(--fc-warning-dim);
    color: var(--fc-warning);
}

.stat-icon.purple {
    background: var(--fc-purple-dim);
    color: var(--fc-purple);
}

.stat-icon.green {
    background: var(--fc-success-dim);
    color: var(--fc-success);
}

.stat-icon.orange {
    background: var(--fc-warning-dim);
    color: var(--fc-warning);
}

.stat-icon.yellow {
    background: var(--fc-warning-dim);
    color: var(--fc-warning);
}

.stat-icon.teal {
    background: var(--fc-accent-dim);
    color: var(--fc-accent);
}

/* ═══════════════════════════════════════════
   PAGE HEADER
═══════════════════════════════════════════ */
.fc-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

    .fc-page-header h1 {
        font-size: 21px;
        font-weight: 700;
        color: var(--fc-text-bright);
        margin: 0;
        letter-spacing: -0.3px;
    }

    .fc-page-header p {
        font-size: 13px;
        color: var(--fc-text-secondary);
        margin: 4px 0 0;
    }

/* ═══════════════════════════════════════════
   TABLES
═══════════════════════════════════════════ */
.fc-table {
    width: 100%;
    border-collapse: collapse;
}

    .fc-table thead th {
        padding: 10px 14px;
        text-align: left;
        font-size: 10.5px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        color: var(--fc-text-muted);
        background: var(--fc-bg-elevated);
        border-bottom: 1px solid var(--fc-border);
        white-space: nowrap;
    }

    .fc-table tbody td {
        padding: 12px 14px;
        border-bottom: 1px solid var(--fc-border);
        font-size: 13px;
        color: var(--fc-text);
        vertical-align: middle;
    }

    .fc-table tbody tr {
        transition: background 0.12s ease;
    }

        .fc-table tbody tr:hover td {
            background: var(--fc-bg-hover);
        }

        .fc-table tbody tr:last-child td {
            border-bottom: none;
        }

/* Skeleton rows */
.fc-skeleton-cell {
    height: 13px;
    border-radius: 4px;
    background: linear-gradient(90deg,var(--fc-bg-elevated) 25%,var(--fc-bg-overlay) 50%,var(--fc-bg-elevated) 75%);
    background-size: 200% 100%;
    animation: fc-shimmer 1.4s infinite;
}

@keyframes fc-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ═══════════════════════════════════════════
   BADGES
═══════════════════════════════════════════ */
.fc-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: var(--fc-radius-full);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1px;
    white-space: nowrap;
}

.fc-badge-success {
    background: var(--fc-success-dim);
    color: var(--fc-success);
}

.fc-badge-danger {
    background: var(--fc-danger-dim);
    color: var(--fc-danger);
}

.fc-badge-warning {
    background: var(--fc-warning-dim);
    color: var(--fc-warning);
}

.fc-badge-info {
    background: var(--fc-info-dim);
    color: var(--fc-info);
}

.fc-badge-purple {
    background: var(--fc-purple-dim);
    color: var(--fc-purple);
}

.fc-badge-muted {
    background: var(--fc-bg-elevated);
    color: var(--fc-text-muted);
}

.fc-badge-default {
    background: var(--fc-bg-elevated);
    color: var(--fc-text-secondary);
}

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
.fc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--fc-radius);
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--fc-transition);
    text-decoration: none;
    font-family: var(--fc-font);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    line-height: 1.4;
}

    .fc-btn:active {
        transform: scale(0.97);
    }

.fc-btn-primary {
    background: linear-gradient(135deg,#2F80ED,#2DD4BF);
    color: #fff;
    box-shadow: 0 0 20px rgba(47,128,237,0.3);
}

    .fc-btn-primary:hover {
        background: linear-gradient(135deg,#3d8ef5,#38e4cc);
        color: #fff;
        box-shadow: 0 0 28px rgba(47,128,237,0.45);
    }

.fc-btn-secondary {
    background: var(--fc-bg-elevated);
    color: var(--fc-text);
    border: 1px solid var(--fc-border);
}

    .fc-btn-secondary:hover {
        background: var(--fc-bg-overlay);
        border-color: var(--fc-border-strong);
        color: var(--fc-text-bright);
    }

.fc-btn-outline {
    background: transparent;
    color: var(--fc-text-secondary);
    border: 1px solid var(--fc-border);
}

    .fc-btn-outline:hover {
        background: var(--fc-bg-hover);
        color: var(--fc-text);
        border-color: var(--fc-border-strong);
    }

.fc-btn-accent {
    background: var(--fc-primary);
    color: #fff;
    box-shadow: 0 0 18px var(--fc-primary-glow);
}

    .fc-btn-accent:hover {
        filter: brightness(1.12);
        color: #fff;
    }

.fc-btn-danger {
    background: var(--fc-danger-dim);
    color: var(--fc-danger);
    border: 1px solid rgba(239,68,68,0.3);
}

    .fc-btn-danger:hover {
        background: var(--fc-danger);
        color: #fff;
    }

.fc-btn-ghost {
    background: transparent;
    color: var(--fc-text-secondary);
    border: none;
}

    .fc-btn-ghost:hover {
        color: var(--fc-text);
        background: var(--fc-bg-hover);
    }

.fc-btn-sm {
    padding: 5px 11px;
    font-size: 12px;
    border-radius: var(--fc-radius-sm);
}

.fc-btn-xs {
    padding: 3px 8px;
    font-size: 11px;
    border-radius: var(--fc-radius-sm);
}

.fc-btn-lg {
    padding: 11px 22px;
    font-size: 14px;
}

.fc-btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: var(--fc-radius-sm);
}

/* ═══════════════════════════════════════════
   FORMS
═══════════════════════════════════════════ */
.fc-form-group {
    margin-bottom: 16px;
}

    .fc-form-group label, .fc-label {
        display: block;
        font-size: 11.5px;
        font-weight: 600;
        color: var(--fc-text-secondary);
        margin-bottom: 6px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

.fc-form-control, .fc-input, select.fc-input {
    width: 100%;
    padding: 9px 13px;
    background: var(--fc-bg-elevated);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    font-size: 13.5px;
    color: var(--fc-text);
    transition: var(--fc-transition);
    font-family: var(--fc-font);
    appearance: none;
    -webkit-appearance: none;
}

    .fc-form-control:focus, .fc-input:focus, select.fc-input:focus {
        outline: none;
        border-color: var(--fc-primary);
        box-shadow: 0 0 0 3px var(--fc-primary-glow);
        background: var(--fc-bg-overlay);
    }

    .fc-form-control::placeholder, .fc-input::placeholder {
        color: var(--fc-text-muted);
    }

    .fc-form-control:disabled, .fc-input:disabled, select.fc-input:disabled {
        opacity: 0.45;
        cursor: not-allowed;
    }

textarea.fc-form-control, textarea.fc-input {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

select.fc-form-control, select.fc-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' fill='%239CA3AF' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
    cursor: pointer;
}

.fc-validation-error {
    display: block;
    font-size: 11.5px;
    color: var(--fc-danger);
    margin-top: 4px;
    font-weight: 500;
}

fieldset {
    border: none;
    margin: 0;
    padding: 0;
}

/* ═══════════════════════════════════════════
   ALERTS
═══════════════════════════════════════════ */
.fc-alert {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px 15px;
    border-radius: var(--fc-radius);
    font-size: 13px;
    border: 1px solid;
    margin-bottom: 14px;
    line-height: 1.5;
}

.fc-alert-success {
    background: var(--fc-success-dim);
    border-color: rgba(34,197,94,0.25);
    color: #86efac;
}

.fc-alert-danger {
    background: var(--fc-danger-dim);
    border-color: rgba(239,68,68,0.25);
    color: #fca5a5;
}

.fc-alert-warning {
    background: var(--fc-warning-dim);
    border-color: rgba(245,158,11,0.25);
    color: #fcd34d;
}

.fc-alert-info {
    background: var(--fc-info-dim);
    border-color: rgba(6,182,212,0.25);
    color: #67e8f9;
}

/* ═══════════════════════════════════════════
   TOAST NOTIFICATIONS
═══════════════════════════════════════════ */
#fc-toast-container {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.fc-toast {
    pointer-events: all;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 15px;
    background: var(--fc-bg-elevated);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius-lg);
    box-shadow: var(--fc-shadow-lg);
    min-width: 300px;
    max-width: 370px;
    animation: fc-toast-in 0.22s cubic-bezier(0.34,1.56,0.64,1) both;
    position: relative;
    overflow: hidden;
}

    .fc-toast::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 3px;
        background: var(--toast-accent,var(--fc-accent));
    }

    .fc-toast.toast-success {
        --toast-accent: var(--fc-success);
    }

    .fc-toast.toast-error {
        --toast-accent: var(--fc-danger);
    }

    .fc-toast.toast-warning {
        --toast-accent: var(--fc-warning);
    }

    .fc-toast.toast-info {
        --toast-accent: var(--fc-primary);
    }

.fc-toast-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--fc-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.toast-success .fc-toast-icon {
    background: var(--fc-success-dim);
    color: var(--fc-success);
}

.toast-error .fc-toast-icon {
    background: var(--fc-danger-dim);
    color: var(--fc-danger);
}

.toast-warning .fc-toast-icon {
    background: var(--fc-warning-dim);
    color: var(--fc-warning);
}

.toast-info .fc-toast-icon {
    background: var(--fc-primary-dim);
    color: var(--fc-primary);
}

.fc-toast-body {
    flex: 1;
    min-width: 0;
}

.fc-toast-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--fc-text-bright);
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fc-toast-desc {
    font-size: 12px;
    color: var(--fc-text-secondary);
    margin: 0;
    line-height: 1.4;
}

.fc-toast-close {
    background: none;
    border: none;
    color: var(--fc-text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 2px;
    line-height: 1;
    transition: color 0.14s;
    flex-shrink: 0;
}

    .fc-toast-close:hover {
        color: var(--fc-text);
    }

.fc-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--toast-accent,var(--fc-accent));
    animation: fc-toast-progress 4s linear forwards;
    opacity: 0.45;
}

@keyframes fc-toast-in {
    0% {
        opacity: 0;
        transform: translateX(110%);
    }

    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fc-toast-out {
    0% {
        opacity: 1;
        transform: translateX(0);
        max-height: 120px;
        margin-bottom: 8px;
    }

    100% {
        opacity: 0;
        transform: translateX(110%);
        max-height: 0;
        margin-bottom: 0;
    }
}

.fc-toast.removing {
    animation: fc-toast-out 0.2s ease forwards;
}

@keyframes fc-toast-progress {
    0% {
        width: 100%;
    }

    100% {
        width: 0%;
    }
}

/* ═══════════════════════════════════════════
   CONFIDENCE INDICATORS
═══════════════════════════════════════════ */
.fc-confidence {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
}

    .fc-confidence .conf-dot {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        flex-shrink: 0;
    }

.fc-confidence-high {
    color: var(--fc-success);
}

    .fc-confidence-high .conf-dot {
        background: var(--fc-success);
        box-shadow: 0 0 5px rgba(34,197,94,0.5);
    }

.fc-confidence-medium {
    color: var(--fc-warning);
}

    .fc-confidence-medium .conf-dot {
        background: var(--fc-warning);
        box-shadow: 0 0 5px rgba(245,158,11,0.5);
    }

.fc-confidence-low {
    color: var(--fc-danger);
}

    .fc-confidence-low .conf-dot {
        background: var(--fc-danger);
        box-shadow: 0 0 5px rgba(239,68,68,0.5);
    }

/* ═══════════════════════════════════════════
   EMPTY STATES
═══════════════════════════════════════════ */
.fc-empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--fc-text-muted);
}

    .fc-empty-state .empty-icon {
        font-size: 40px;
        margin-bottom: 14px;
        opacity: 0.2;
        display: block;
    }

    .fc-empty-state h3 {
        font-size: 15px;
        font-weight: 600;
        color: var(--fc-text-secondary);
        margin: 0 0 8px;
    }

    .fc-empty-state p {
        font-size: 13px;
        color: var(--fc-text-muted);
        max-width: 320px;
        margin: 0 auto 20px;
        line-height: 1.5;
    }

/* ═══════════════════════════════════════════
   PROGRESS
═══════════════════════════════════════════ */
.fc-progress {
    height: 4px;
    background: var(--fc-bg-elevated);
    border-radius: var(--fc-radius-full);
    overflow: hidden;
}

.fc-progress-bar {
    height: 100%;
    border-radius: var(--fc-radius-full);
    background: linear-gradient(90deg,var(--fc-primary),var(--fc-accent));
    transition: width 0.3s ease;
}

.fc-progress-indeterminate .fc-progress-bar {
    width: 38%;
    animation: fc-prog-slide 1.2s ease infinite;
}

@keyframes fc-prog-slide {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(360%);
    }
}

/* ═══════════════════════════════════════════
   PULSE DOT
═══════════════════════════════════════════ */
.fc-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

    .fc-pulse::after {
        content: '';
        position: absolute;
        inset: -3px;
        border-radius: 50%;
        border: 2px solid currentColor;
        opacity: 0.35;
        animation: fc-pulse-anim 1.8s ease infinite;
    }

@keyframes fc-pulse-anim {
    0%,100% {
        transform: scale(1);
        opacity: 0.35;
    }

    50% {
        transform: scale(1.7);
        opacity: 0;
    }
}

/* ═══════════════════════════════════════════
   GRID UTILITIES
═══════════════════════════════════════════ */
.fc-split-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.fc-split-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 18px;
}

.fc-split-wide {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 18px;
}

.fc-split-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 18px;
}

.fc-divider {
    height: 1px;
    background: var(--fc-border);
    margin: 14px 0;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width:1280px) {
    .fc-split-3 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width:1024px) {
    :root {
        --fc-sidebar-width: 210px;
    }

    .fc-split-2, .fc-split-wide, .fc-split-sidebar {
        grid-template-columns: 1fr;
    }
}

@media (max-width:768px) {
    .fc-sidebar {
        transform: translateX(-100%);
        width: 260px !important;
        transition: transform 0.24s cubic-bezier(0.4,0,0.2,1);
        z-index: 1200;
        box-shadow: none;
    }

        .fc-sidebar.open {
            transform: translateX(0);
            box-shadow: 4px 0 32px rgba(0,0,0,0.55);
        }

    .fc-sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 1100;
        background: rgba(0,0,0,0.55);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        animation: fc-backdrop-in 0.2s ease forwards;
    }

        .fc-sidebar-backdrop.open {
            display: block;
        }

    @keyframes fc-backdrop-in {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }

    .fc-sidebar-close-btn {
        display: flex !important;
    }

    .fc-main {
        margin-left: 0 !important;
    }

    #sidebar-toggle {
        display: flex !important;
    }

    .fc-topbar {
        padding: 0 12px;
        gap: 4px;
    }

    .fc-topbar-right {
        gap: 4px;
    }

    .fc-global-search {
        display: none;
    }

    .fc-mobile-search-btn {
        display: flex !important;
    }

    .fc-topbar-user .user-name {
        display: none;
    }

    .fc-topbar-user {
        padding: 4px 6px 4px 4px;
    }

    .fc-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .fc-content {
        padding: 16px 12px;
    }

    .fc-split-3 {
        grid-template-columns: 1fr;
    }

    .fc-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

        .fc-page-header > div:last-child,
        .fc-page-header > a:last-child,
        .fc-page-header > button:last-child {
            align-self: stretch;
        }

        .fc-page-header .fc-btn {
            width: 100%;
            justify-content: center;
        }

    .fc-card {
        overflow-x: auto;
    }

    .fc-table {
        min-width: 560px;
    }

    .fc-filters {
        overflow-x: auto;
        padding-bottom: 8px;
    }

        .fc-filters form {
            flex-wrap: nowrap;
            min-width: max-content;
        }

    .fc-card {
        padding: 14px;
    }

    #fc-toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .fc-toast {
        min-width: unset;
        max-width: 100%;
    }

    .fc-split-2 {
        grid-template-columns: 1fr;
    }

    .fc-stat-card .stat-value {
        font-size: 22px;
    }
}

@media (max-width:480px) {
    .fc-stats-grid {
        grid-template-columns: 1fr;
    }

    .fc-topbar {
        padding: 0 10px;
    }

    .fc-content {
        padding: 12px 8px;
    }

    .fc-card {
        padding: 12px;
    }

    .search-kbd {
        display: none;
    }

    .fc-stat-card .stat-icon {
        display: none;
    }
}

/* ── Print styles ── */
@media print {
    .fc-sidebar, .fc-topbar, .fc-page-header, #fc-toast-container, #fc-search-overlay, #fc-cmd-palette-overlay, #fc-activity-panel, #fc-user-dropdown {
        display: none !important;
    }

    .fc-app {
        display: block !important;
    }

    .fc-main {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    .fc-content {
        padding: 0 !important;
    }

    body, html {
        background: #fff !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
