/* ===== KUSUITE ERP — Custom Theme ===== */
/* Brand: Dark mode + Orange (#2563EB) accent */
/* Font: Inter (matches marketing site) */

/* ===== FORCE DARK MODE ===== */
html {
    color-scheme: dark;
}
html:not(.fi-theme-light) {
    --kusuite-bg: #0A0A0C;
    --kusuite-surface: #111114;
    --kusuite-surface-hover: #18181B;
    --kusuite-border: rgba(255,255,255,0.06);
    --kusuite-primary: #2563EB;
    --kusuite-primary-light: #3B82F6;
}

/* ===== GLOBAL FONT ===== */
body,
.fi-body,
.fi-sidebar,
.fi-topbar,
.fi-header,
.fi-main {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ===== SIDEBAR CUSTOMIZATION ===== */
.dark .fi-sidebar {
    background-color: #0A0A0C !important;
    border-right-color: rgba(255,255,255,0.06) !important;
}

.dark .fi-sidebar-header {
    border-bottom-color: rgba(255,255,255,0.06) !important;
}

/* Sidebar nav items */
.dark .fi-sidebar-item-button {
    transition: all 0.15s ease;
}

.dark .fi-sidebar-item-button:hover {
    background-color: rgba(37,99,235, 0.08) !important;
}

.dark .fi-sidebar-item-active .fi-sidebar-item-button {
    background-color: rgba(37,99,235, 0.12) !important;
}

/* Sidebar group labels */
.dark .fi-sidebar-group-label {
    color: #71717A !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
}

/* ===== TOPBAR / HEADER ===== */
.dark .fi-topbar {
    background-color: rgba(10, 10, 12, 0.85) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom-color: rgba(255,255,255,0.06) !important;
}

/* ===== MAIN CONTENT AREA ===== */
.dark .fi-main {
    background-color: #0E0E11 !important;
}

/* ===== CARDS & SECTIONS ===== */
.dark .fi-section,
.dark .fi-wi-stats-overview-stat,
.dark .fi-card {
    background-color: #111114 !important;
    border-color: rgba(255,255,255,0.06) !important;
    border-radius: 12px !important;
}

.dark .fi-section:hover,
.dark .fi-card:hover {
    border-color: rgba(255,255,255,0.1) !important;
}

/* ===== STATS WIDGET ===== */
.dark .fi-wi-stats-overview-stat {
    transition: all 0.2s ease;
}

.dark .fi-wi-stats-overview-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* ===== TABLES ===== */
.dark .fi-ta-table {
    background-color: #111114 !important;
}

.dark .fi-ta-row:hover td {
    background-color: rgba(37,99,235, 0.04) !important;
}

.dark .fi-ta-header-cell {
    background-color: #0A0A0C !important;
    border-bottom-color: rgba(255,255,255,0.08) !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    color: #71717A !important;
}

.dark .fi-ta-cell {
    border-bottom-color: rgba(255,255,255,0.04) !important;
}

/* ===== BUTTONS ===== */
.dark .fi-btn-primary {
    box-shadow: 0 0 20px rgba(37,99,235, 0.2) !important;
    transition: all 0.2s ease !important;
}

.dark .fi-btn-primary:hover {
    box-shadow: 0 0 30px rgba(37,99,235, 0.35) !important;
    transform: translateY(-1px);
}

/* ===== FORM INPUTS ===== */
.dark .fi-input,
.dark .fi-select,
.dark .fi-textarea {
    background-color: #0A0A0C !important;
    border-color: rgba(255,255,255,0.08) !important;
    transition: border-color 0.2s ease !important;
}

.dark .fi-input:focus,
.dark .fi-select:focus,
.dark .fi-textarea:focus {
    border-color: #2563EB !important;
    box-shadow: 0 0 0 1px rgba(37,99,235, 0.3) !important;
}

/* ===== TABS ===== */
.dark .fi-tabs-tab-active {
    border-bottom-color: #2563EB !important;
}

/* ===== BADGES ===== */
.dark .fi-badge {
    font-weight: 600 !important;
    font-size: 0.72rem !important;
}

/* ===== MODAL ===== */
.dark .fi-modal-window {
    background-color: #111114 !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-radius: 16px !important;
}

/* ===== LOGIN PAGE ===== */
.fi-simple-layout {
    background-color: #0A0A0C !important;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(37,99,235, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(29,78,216, 0.04) 0%, transparent 50%) !important;
}

.dark .fi-simple-main {
    background-color: #111114 !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5) !important;
}

/* Login brand logo/text */
.fi-simple-layout .fi-logo {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-weight: 800 !important;
    font-size: 1.8rem !important;
    letter-spacing: -0.03em !important;
}

/* ===== SCROLLBAR ===== */
.dark ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.dark ::-webkit-scrollbar-track {
    background: #0A0A0C;
}

.dark ::-webkit-scrollbar-thumb {
    background: #27272A;
    border-radius: 3px;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #3F3F46;
}

/* ===== NOTIFICATIONS ===== */
.dark .fi-no-notification {
    background-color: #111114 !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-radius: 12px !important;
}

/* ===== PAGINATION ===== */
.dark .fi-pagination-item-active {
    background-color: #2563EB !important;
}

/* ===== BREADCRUMBS ===== */
.dark .fi-breadcrumbs li a {
    color: #71717A !important;
    transition: color 0.2s ease !important;
}

.dark .fi-breadcrumbs li a:hover {
    color: #2563EB !important;
}

/* ===== LOADING INDICATOR ===== */
.dark .fi-loading-indicator {
    background-color: #2563EB !important;
}

/* ===== EMPTY STATE ===== */
.dark .fi-ta-empty-state {
    color: #52525B !important;
}

.dark .fi-ta-empty-state-icon {
    color: #3F3F46 !important;
}

/* ===== HEADER ACTIONS ===== */
.dark .fi-header-heading {
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
}

/* ===== RESOURCE NAVIGATION (Relation Managers tabs) ===== */
.dark .fi-resource-tabs {
    border-bottom-color: rgba(255,255,255,0.06) !important;
}

/* ===== GLOBAL SEARCH ===== */
.dark .fi-global-search-input {
    background-color: rgba(255,255,255,0.04) !important;
    border-color: rgba(255,255,255,0.08) !important;
}

.dark .fi-global-search-input:focus {
    border-color: #2563EB !important;
}

/* ===== ANIMATIONS ===== */
.dark .fi-section,
.dark .fi-wi-stats-overview-stat,
.dark .fi-ta-table {
    animation: kusuiteFadeIn 0.3s ease-out;
}

@keyframes kusuiteFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== WIDGET CHART CONTAINERS ===== */
.dark .fi-wi-chart {
    background-color: #111114 !important;
    border-color: rgba(255,255,255,0.06) !important;
    border-radius: 12px !important;
}

/* ===== INFOLIST (View pages) ===== */
.dark .fi-in-entry-wrp {
    border-bottom-color: rgba(255,255,255,0.04) !important;
}

/* ===== FOOTER ATTRIBUTION ===== */
.fi-footer {
    opacity: 0.5;
}
