/* ==========================================================================
   Microsoft Fluent 2 Design Theme for Filament 5 — CRM Grupo DAE
   ========================================================================== */

:root {
    --fluent-bg: #f3f3f3;
    --fluent-surface: #ffffff;
    --fluent-surface-alt: #fbfbfb;
    --fluent-acrylic: rgba(247, 247, 247, 0.84);
    --fluent-border: rgba(0, 0, 0, 0.08);
    --fluent-border-strong: rgba(0, 0, 0, 0.14);
    --fluent-input-bottom: #868686;
    --fluent-accent: #0067c0;
    --fluent-accent-hover: #005a9e;
    --fluent-hover-bg: rgba(0, 0, 0, 0.038);
    --fluent-active-bg: rgba(0, 0, 0, 0.055);
    --fluent-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 0 2px rgba(0, 0, 0, 0.05);
    --fluent-shadow-flyout: 0 8px 16px rgba(0, 0, 0, 0.12), 0 0 2px rgba(0, 0, 0, 0.06);
}

.dark {
    --fluent-bg: #202020;
    --fluent-surface: #2b2b2b;
    --fluent-surface-alt: #323232;
    --fluent-acrylic: rgba(32, 32, 32, 0.84);
    --fluent-border: rgba(255, 255, 255, 0.075);
    --fluent-border-strong: rgba(255, 255, 255, 0.14);
    --fluent-input-bottom: #9a9a9a;
    --fluent-accent: #60cdff;
    --fluent-accent-hover: #4cc2ff;
    --fluent-hover-bg: rgba(255, 255, 255, 0.055);
    --fluent-active-bg: rgba(255, 255, 255, 0.08);
    --fluent-shadow-card: 0 2px 4px rgba(0, 0, 0, 0.22);
    --fluent-shadow-flyout: 0 10px 24px rgba(0, 0, 0, 0.45);
}

/* Global Typography & Mica Canvas */
body.fi-body {
    font-family: 'Segoe UI Variable', 'Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, sans-serif !important;
    background-color: var(--fluent-bg) !important;
    -webkit-font-smoothing: antialiased;
}

/* Acrylic Topbar & Sidebar */
.fi-topbar > nav,
.fi-sidebar {
    background-color: var(--fluent-acrylic) !important;
    backdrop-filter: blur(24px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(150%) !important;
    border-color: var(--fluent-border) !important;
}

.fi-topbar > nav {
    box-shadow: none !important;
    border-bottom: 1px solid var(--fluent-border) !important;
}

.fi-sidebar {
    border-right: 1px solid var(--fluent-border) !important;
}

/* Fluent 2 Sidebar Navigation Items + Signature Left Accent Pill */
.fi-sidebar-item-button {
    position: relative;
    border-radius: 6px !important;
    transition: background-color 0.12s ease !important;
}

.fi-sidebar-item-button:hover {
    background-color: var(--fluent-hover-bg) !important;
}

.fi-sidebar-item-active > .fi-sidebar-item-button {
    background-color: var(--fluent-active-bg) !important;
    font-weight: 600 !important;
}

.fi-sidebar-item-active > .fi-sidebar-item-button::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    border-radius: 9999px;
    background-color: var(--fluent-accent);
}

/* Fluent 2 Elevated Cards, Sections, Tables, Stats & Widgets */
.fi-section:not(.fi-section-not-contained),
.fi-ta-ctn,
.fi-wi-stats-overview-stat,
.fi-wi-account,
.qa-card,
.crm-kpi-card,
.tpl-card {
    background-color: var(--fluent-surface) !important;
    border: 1px solid var(--fluent-border) !important;
    border-radius: 8px !important;
    box-shadow: var(--fluent-shadow-card) !important;
    --tw-ring-shadow: 0 0 #0000 !important;
}

/* Keep StatsOverview wrapper transparent so only individual stat cards are elevated */
.fi-wi-stats-overview .fi-section,
.fi-wi-stats-overview .fi-section-content,
.fi-section.fi-section-not-contained {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* Tables: Crisp Fluent Rows & Subtle Header */
.fi-ta-ctn,
.fi-ta-main {
    border-radius: 8px !important;
    overflow: hidden;
}

.fi-ta-header-ctn,
.fi-ta-table thead {
    background-color: var(--fluent-surface-alt) !important;
}

.fi-ta-row {
    transition: background-color 0.1s ease;
}

.fi-ta-row:hover {
    background-color: var(--fluent-hover-bg) !important;
}

/* Fluent 2 Signature Inputs (Bottom Accent Line on Focus) */
.fi-input-wrp {
    border-radius: 5px !important;
    background-color: var(--fluent-surface) !important;
    border: 1px solid var(--fluent-border-strong) !important;
    border-bottom: 1.5px solid var(--fluent-input-bottom) !important;
    box-shadow: none !important;
    --tw-ring-shadow: 0 0 #0000 !important;
    transition: border-color 0.12s ease, background-color 0.12s ease !important;
}

.fi-input-wrp:focus-within {
    border-color: var(--fluent-border-strong) !important;
    border-bottom: 2px solid var(--fluent-accent) !important;
    box-shadow: none !important;
}

/* Fluent 2 Buttons */
.fi-btn {
    border-radius: 5px !important;
    font-weight: 500 !important;
    transition: background-color 0.12s ease, transform 0.08s ease !important;
}

.fi-btn:active {
    transform: scale(0.985);
}

/* Fluent 2 Modals & Dropdowns (Acrylic Flyout Depth) */
.fi-modal-window,
.fi-dropdown-panel {
    background-color: var(--fluent-surface) !important;
    border: 1px solid var(--fluent-border-strong) !important;
    border-radius: 8px !important;
    box-shadow: var(--fluent-shadow-flyout) !important;
    --tw-ring-shadow: 0 0 #0000 !important;
}

/* Fluent 2 Badges & Tabs */
.fi-badge {
    border-radius: 4px !important;
    font-weight: 600 !important;
}

.fi-tabs {
    background-color: transparent !important;
    border-bottom: 1px solid var(--fluent-border) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    --tw-ring-shadow: 0 0 #0000 !important;
}

.fi-tabs-item-active {
    border-bottom: 2.5px solid var(--fluent-accent) !important;
    border-radius: 4px 4px 0 0 !important;
}

/* Voice Dictation Button matches Fluent Blue */
#crm-voice-btn {
    background-color: var(--fluent-accent) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 6px !important;
    box-shadow: var(--fluent-shadow-flyout) !important;
}
