﻿/* ========================================
   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);
}

/* ═══════════════════════════════════════════
   BUTTON GROUP — wraps multiple sibling buttons
   desktop: horizontal row; mobile: column stack
═══════════════════════════════════════════ */
.fc-btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* ═══════════════════════════════════════════
   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;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   ORINEX OS — MOBILE-FIRST RESPONSIVE SYSTEM
   ─────────────────────────────────────────────────────────────────────
   Breakpoints:
     Mobile  : < 768px  (default — designed here first)
     Tablet  : ≥ 768px  (@media min-width:768px)
     Desktop : ≥ 1024px (@media min-width:1024px)
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Global: prevent horizontal overflow on every page ── */
html { overflow-x: hidden; }
body { overflow-x: hidden; max-width: 100vw; }
.fc-app  { overflow-x: hidden; }
.fc-main { overflow-x: hidden; }

/* ── Utility: visibility helpers ─────────────────────────────────────── */

/* Hidden on mobile, shown on tablet+ */
.fc-desktop-only { display: none; }
@media (min-width:768px) { .fc-desktop-only { display: revert; } }

/* Shown only on mobile */
.fc-mobile-only { display: revert; }
@media (min-width:768px) { .fc-mobile-only { display: none !important; } }

/* Simple hide class applied in markup */
.fc-mobile-hide { }
@media (max-width:767px) { .fc-mobile-hide { display: none !important; } }

/* Already used across pages */
.fc-hide-mobile { }
@media (max-width:767px) { .fc-hide-mobile { display: none !important; } }

/* ── Utility: safe bottom padding (clears the bottom nav bar) ─────────── */
/* Applied to .fc-content automatically via the mobile block below.       */
/* Also available as a standalone class for custom layouts.               */
.fc-safe-bottom {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
}

/* ── Utility: mobile stack (children stack vertically on mobile) ──────── */
.fc-mobile-stack { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width:767px) {
    .fc-mobile-stack { flex-direction: column; }
    .fc-mobile-stack > * { width: 100%; box-sizing: border-box; }
}

/* ── Utility: btn-group (row on desktop, column on mobile) ───────────── */
.fc-btn-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ═══════════════════════════════════════════════════════════════════════
   TABLE → MOBILE CARD PATTERN
   ─────────────────────────────────────────────────────────────────────
   Usage:
     1. Add class="fc-mob-table" to any <table>.
     2. Add data-label="Field Name" to each <td> in tbody rows.
     3. Add class="fc-mob-actions" to the <td> that holds action buttons.
     4. Add class="fc-mob-hide" to any <td>/<th> to hide on mobile.

   Result on mobile  : each <tr> becomes a bordered card, each <td>
                        renders as a label-value row.
   Result on desktop : normal table layout restored via min-width:768px.
   ═══════════════════════════════════════════════════════════════════════ */

/* Mobile (default): card list */
.fc-mob-table              { display: block; width: 100%; }
.fc-mob-table thead        { display: none; }
.fc-mob-table tbody        { display: block; }

.fc-mob-table tbody tr {
    display: block;
    background: var(--fc-bg-surface);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius-lg);
    margin-bottom: 10px;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.fc-mob-table tbody tr:hover {
    border-color: var(--fc-border-strong);
    box-shadow: var(--fc-shadow-sm);
}

.fc-mob-table tbody td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--fc-border);
    font-size: 13px;
    white-space: normal;
    text-align: left !important;
    min-height: 0;
}
.fc-mob-table tbody td:last-child { border-bottom: none; }

/* Label from data-label attribute */
.fc-mob-table tbody td[data-label]::before {
    content: attr(data-label);
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--fc-text-muted);
    flex-shrink: 0;
    min-width: 80px;
    padding-top: 2px;
}

/* Cells hidden on mobile */
.fc-mob-table tbody td.fc-mob-hide { display: none !important; }

/* Actions cell — full-width bar at the bottom of each card */
.fc-mob-table tbody td.fc-mob-actions {
    background: var(--fc-bg-elevated);
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-bottom: none;
}
.fc-mob-table tbody td.fc-mob-actions::before { content: none; display: none; }

/* Buttons inside action cells: restore natural sizing */
.fc-mob-table td.fc-mob-actions .fc-btn  { width: auto !important; }
.fc-mob-table td.fc-mob-actions .fc-btn-xs { padding: 6px 12px; font-size: 12px; }

/* Desktop (768px+): restore normal table layout */
@media (min-width:768px) {
    .fc-mob-table              { display: table; }
    .fc-mob-table thead        { display: table-header-group; }
    .fc-mob-table tbody        { display: table-row-group; }
    .fc-mob-table tbody tr     { display: table-row; background: transparent; border: none;
                                  border-radius: 0; margin-bottom: 0; overflow: visible;
                                  transition: background 0.12s; }
    .fc-mob-table tbody tr:hover { box-shadow: none; border-color: transparent; }
    .fc-mob-table tbody td     { display: table-cell; border-bottom: 1px solid var(--fc-border);
                                  padding: 12px 14px; font-size: 13px; }
    .fc-mob-table tbody td:last-child { border-bottom: 1px solid var(--fc-border); }
    .fc-mob-table tbody td[data-label]::before { display: none; }
    .fc-mob-table tbody td.fc-mob-hide { display: table-cell; }
    .fc-mob-table tbody td.fc-mob-actions { background: transparent; justify-content: flex-start; }
    .fc-mob-table td.fc-mob-actions .fc-btn-xs { padding: 3px 8px; font-size: 11px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   MOBILE OVERRIDES  ≤ 767px
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width:767px) {

    /* ── Sidebar: slide off-screen ─────────────────────────────────── */
    .fc-sidebar {
        transform: translateX(-100%);
        width: 280px !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-close-btn { display: flex !important; }

    .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; } }

    /* ── Main content: no sidebar offset ──────────────────────────── */
    .fc-main { margin-left: 0 !important; overflow-x: hidden; }
    #sidebar-toggle { display: flex !important; }

    /* ── Topbar ────────────────────────────────────────────────────── */
    .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; }

    /* Icon button minimum touch targets */
    .fc-btn-icon, .fc-quick-action-btn, .fc-theme-toggle {
        min-width: 40px; min-height: 40px;
    }

    /* ── Content area ──────────────────────────────────────────────── */
    .fc-content {
        padding: 14px 12px;
        /* Safe bottom padding so bottom nav never covers content */
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
        overflow-x: hidden;
    }

    /* ── KPI stat cards: 2-column grid ────────────────────────────── */
    .fc-stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .fc-stat-card  { padding: 14px; }
    .fc-stat-card .stat-value { font-size: 20px; }
    .fc-stat-card .stat-icon  { width: 34px; height: 34px; font-size: 14px; }

    /* ── Page header: title + actions stack ────────────────────────── */
    .fc-page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 16px;
    }
    /* All direct children stretch full-width */
    .fc-page-header > * { width: 100% !important; box-sizing: border-box !important; }

    /* btn-group inside header: column */
    .fc-page-header .fc-btn-group { flex-direction: column; }

    /* Inline styled flex divs (style="display:flex;gap:8px") → column */
    .fc-page-header > div[style*="display:flex"],
    .fc-page-header > div[style*="display: flex"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
    }

    /* Every fc-btn inside page header → full-width, centred */
    .fc-page-header .fc-btn,
    .fc-page-header > a,
    .fc-page-header > button,
    .fc-page-header > div > a,
    .fc-page-header > div > button {
        display: flex !important;
        width: 100% !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }

    /* ── Card header ────────────────────────────────────────────────── */
    .fc-card-header { flex-wrap: wrap; gap: 8px; }

    /* ── Cards ──────────────────────────────────────────────────────── */
    .fc-card { overflow-x: auto; padding: 14px; }

    /* Inner table wrappers: they hold horizontal scroll */
    .fc-card > div[style*="overflow-x:auto"],
    .fc-card > div[style*="overflow-x: auto"] {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        touch-action: pan-x pinch-zoom;
    }

    /* ── Filters ────────────────────────────────────────────────────── */
    /* Works whether inside .fc-filters or a .fc-card */
    .fc-filters { overflow-x: visible; padding-bottom: 0; }
    .fc-filters form,
    .fc-card form[method="get"] {
        flex-wrap: wrap !important;
        min-width: unset !important;
        gap: 8px !important;
    }
    .fc-filters select,
    .fc-filters input,
    .fc-card form[method="get"] select,
    .fc-card form[method="get"] input {
        width: 100% !important;
        min-width: unset !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    .fc-filters .fc-form-group,
    .fc-card form[method="get"] .fc-form-group {
        width: 100% !important;
        min-width: unset !important;
        flex: 0 0 100% !important;
    }
    .fc-filters .fc-search-bar,
    .fc-card form[method="get"] .fc-search-bar { width: 100%; }
    .fc-filters > form > div[style*="flex"],
    .fc-card form[method="get"] > div[style*="flex"] {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 8px !important;
    }
    .fc-btn-group + .fc-btn-group { margin-top: 0; }
    .fc-filters .fc-btn,
    .fc-filters button,
    .fc-card form[method="get"] .fc-btn,
    .fc-card form[method="get"] button {
        display: flex !important;
        width: 100% !important;
        justify-content: center !important;
    }

    /* ── Legacy fc-table (pages not yet using fc-mob-table) ────────── */
    /* Give tables a sensible min-width so they scroll inside the card */
    .fc-table:not(.fc-mob-table) { min-width: 420px; width: 100%; }
    .fc-table th, .fc-table td   { padding: 9px 8px; font-size: 12px; white-space: normal; }
    .fc-table .fc-badge           { font-size: 10px; padding: 2px 6px; }
    .fc-table .fc-btn-xs          { padding: 4px 8px; font-size: 11px; }

    /* ── Label helpers ──────────────────────────────────────────────── */
    .fc-btn-label-mobile  { display: none; }
    .fc-badge-text        { display: none; }

    /* ── Toast ──────────────────────────────────────────────────────── */
    #fc-toast-container { top: 10px; right: 10px; left: 10px; }
    .fc-toast           { min-width: unset; max-width: 100%; }

    /* ── Create/Edit/Details form grids ─────────────────────────────── */
    div[style*="grid-template-columns:1fr 300px"],
    div[style*="grid-template-columns: 1fr 300px"] { grid-template-columns: 1fr !important; }
    div[style*="grid-template-columns:1fr 1fr"],
    div[style*="grid-template-columns: 1fr 1fr"]   { grid-template-columns: 1fr !important; }
    div[style*="grid-column:span 2"],
    div[style*="grid-column: span 2"]               { grid-column: span 1 !important; }
    div[style*="position:sticky"][style*="top:88px"] {
        position: relative !important; top: auto !important;
    }

    /* ── Misc layout ────────────────────────────────────────────────── */
    .fc-split-2, .fc-split-3 { grid-template-columns: 1fr; }
}

/* ── Small phones: additional overrides ≤ 479px ────────────────────── */
@media (max-width:479px) {
    .fc-topbar  { padding: 0 10px; }
    .fc-content { padding: 12px 8px; padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important; }
    .fc-card    { padding: 12px; }
    .search-kbd { display: none; }
    /* On very small phones stat icons take too much space */
    .fc-stat-card .stat-icon { display: none; }
    /* Stack stat cards to 1 column below 360px to avoid overflow */
    @media (max-width:359px) {
        .fc-stats-grid { grid-template-columns: 1fr; }
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   MOBILE BOTTOM NAV + QUICK-CREATE FAB
   Hidden on desktop, visible only at ≤768px.
   ═══════════════════════════════════════════════════════════════════════ */

.fc-bottom-nav,
.fc-fab-backdrop,
.fc-fab-sheet {
    display: none;
}

.fc-bnav-fab {
    display: none;
}

@media (max-width: 768px) {

    /* ── Give content room above the nav bar ── */
    .fc-content {
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* ═══ Bottom Navigation Bar ═══════════════════════════════════════ */

    .fc-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 850;
        height: 60px;
        background: var(--fc-surface);
        border-top: 1px solid var(--fc-border);
        align-items: center;
        justify-content: space-around;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    /* Individual tab button / link */
    .fc-bnav-tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: 1;
        gap: 3px;
        padding: 6px 4px 4px;
        color: var(--fc-text-muted);
        text-decoration: none;
        font-size: 10px;
        font-weight: 600;
        letter-spacing: 0.2px;
        border: none;
        background: none;
        cursor: pointer;
        font-family: var(--fc-font);
        transition: color 0.14s;
        -webkit-tap-highlight-color: transparent;
        min-width: 0;
    }

        .fc-bnav-tab i {
            font-size: 19px;
            line-height: 1;
            margin-bottom: 1px;
        }

        .fc-bnav-tab.active {
            color: var(--fc-primary);
        }

        .fc-bnav-tab--ghost {
            opacity: 0.28;
            pointer-events: none;
        }

    /* ═══ Centre FAB (raised above the bar) ═══════════════════════════ */

    .fc-bnav-fab {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 54px;
        height: 54px;
        border-radius: 50%;
        background: var(--fc-primary);
        color: #fff;
        border: none;
        cursor: pointer;
        font-size: 22px;
        /* Lift the button above the nav bar */
        transform: translateY(-14px);
        box-shadow: 0 4px 18px rgba(99,102,241,0.45);
        transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1),
                    box-shadow 0.2s,
                    background 0.15s;
        -webkit-tap-highlight-color: transparent;
        position: relative;
        z-index: 860;
    }

        .fc-bnav-fab i {
            transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
        }

        .fc-bnav-fab.open {
            background: var(--fc-danger);
            box-shadow: 0 6px 24px rgba(239,68,68,0.45);
        }

            .fc-bnav-fab.open i {
                transform: rotate(45deg);
            }

        .fc-bnav-fab:active {
            transform: translateY(-14px) scale(0.92);
        }

    /* ═══ FAB Backdrop ═════════════════════════════════════════════════ */

    .fc-fab-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1050;
        background: rgba(0, 0, 0, 0.55);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s;
    }

        .fc-fab-backdrop.open {
            display: block;
            opacity: 1;
            pointer-events: auto;
        }

    /* ═══ Quick-Create Action Sheet ════════════════════════════════════ */

    .fc-fab-sheet {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1060;
        background: var(--fc-surface);
        border-radius: 22px 22px 0 0;
        padding: 10px 16px calc(76px + env(safe-area-inset-bottom, 0px));
        transform: translateY(100%);
        transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 -6px 40px rgba(0, 0, 0, 0.3);
        /* Show display:flex only when open — avoids flash */
        display: flex;
        flex-direction: column;
        pointer-events: none;
    }

        .fc-fab-sheet.open {
            transform: translateY(0);
            pointer-events: auto;
        }

    /* Drag handle */
    .fc-fab-sheet-drag {
        width: 38px;
        height: 4px;
        background: var(--fc-border);
        border-radius: 2px;
        margin: 4px auto 14px;
        flex-shrink: 0;
    }

    /* "Quick Create" label */
    .fc-fab-sheet-title {
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.9px;
        color: var(--fc-text-muted);
        margin-bottom: 10px;
        padding: 0 6px;
        flex-shrink: 0;
    }

    /* Action list container */
    .fc-fab-sheet-actions {
        display: flex;
        flex-direction: column;
        gap: 2px;
        overflow-y: auto;
    }

    /* Individual action row */
    .fc-fab-action {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 12px 10px;
        border-radius: var(--fc-radius-lg);
        text-decoration: none;
        color: var(--fc-text);
        transition: background 0.1s;
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
    }

        .fc-fab-action:active {
            background: var(--fc-bg-subtle);
        }

    /* Coloured icon badge */
    .fc-fab-action-icon {
        width: 44px;
        height: 44px;
        border-radius: var(--fc-radius-lg);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 17px;
        flex-shrink: 0;
    }

    .fc-fab-action-label {
        font-size: 15px;
        font-weight: 600;
        color: var(--fc-text-bright);
        line-height: 1.25;
    }

    .fc-fab-action-sub {
        font-size: 12px;
        color: var(--fc-text-muted);
        margin-top: 1px;
    }

    /* Chevron at the end of each row */
    .fc-fab-action-arrow {
        margin-left: auto;
        font-size: 11px;
        color: var(--fc-text-muted);
        flex-shrink: 0;
    }
}

/* ── Print styles ── */

/* Remove browser-generated print headers and footers (page title, URL, date, page numbers) */
@page {
    margin-top: 0mm;
    margin-bottom: 0mm;
    margin-left: 10mm;
    margin-right: 10mm;
}

@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: 8mm 0 8mm !important;
    }

    body, html {
        background: #fff !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
