/* Insurance CRM — modernization layer: motion, depth, polish on top of Filament's light theme. */

:root {
    --crm-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --crm-hero-from: #1d4ed8;
    --crm-hero-to: #0ea5e9;
    --crm-sidebar-bg: #0f172a;
    --crm-sidebar-text: #e2e8f0;
    --crm-sidebar-icon: #94a3b8;
    --crm-sidebar-muted: #64748b;
}

* {
    scroll-behavior: smooth;
}

body {
    animation: crm-fade-in 0.25s var(--crm-ease);
}

@keyframes crm-fade-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes crm-card-in {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Sidebar + navigation */
.fi-sidebar,
.fi-sidebar-nav-item,
.fi-sidebar-item-button {
    transition: background-color 0.18s var(--crm-ease), color 0.18s var(--crm-ease), box-shadow 0.18s var(--crm-ease);
}

.fi-sidebar-item-button:hover {
    transform: translateX(2px);
}

/* Buttons */
.fi-btn {
    transition: transform 0.15s var(--crm-ease), box-shadow 0.15s var(--crm-ease), background-color 0.15s var(--crm-ease), filter 0.15s var(--crm-ease);
}

.fi-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

.fi-btn:active {
    transform: translateY(0);
}

/* Cards / panels */
.fi-section,
.fi-wi-stats-overview-stat,
.fi-ta-ctn,
.fi-modal-window {
    transition: box-shadow 0.2s var(--crm-ease), transform 0.2s var(--crm-ease);
}

.fi-wi-stats-overview-stat:hover {
    box-shadow: 0 8px 20px -8px rgb(0 0 0 / 0.12);
    transform: translateY(-2px);
}

/* Table rows */
.fi-ta-row {
    transition: background-color 0.15s var(--crm-ease);
}

/* Badges pop in */
.fi-badge {
    transition: transform 0.15s var(--crm-ease);
}

.fi-badge:hover {
    transform: scale(1.05);
}

/* Custom pages: pipeline board + my day */
.crm-animate-in {
    animation: crm-card-in 0.3s var(--crm-ease) both;
}

.crm-kanban-card {
    transition: transform 0.18s var(--crm-ease), box-shadow 0.18s var(--crm-ease), border-color 0.18s var(--crm-ease);
}

.crm-kanban-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px -10px rgb(0 0 0 / 0.18);
    border-color: rgb(59 130 246 / 0.4);
}

.crm-kanban-column {
    transition: background-color 0.2s var(--crm-ease);
}

.crm-kanban-board {
    scroll-snap-type: x proximity;
}

.crm-kanban-col {
    flex-shrink: 0;
    width: 18rem;
    scroll-snap-align: start;
}

.crm-kanban-col-body {
    min-height: 120px;
}

@media (max-width: 639px) {
    .crm-kanban-col {
        width: 84vw;
    }
}

/* Scrollbar */
.crm-scroll::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.crm-scroll::-webkit-scrollbar-thumb {
    background-color: rgb(148 163 184 / 0.5);
    border-radius: 9999px;
}

.crm-scroll::-webkit-scrollbar-track {
    background: transparent;
}

/* Notifications slide */
.fi-no-notification {
    animation: crm-card-in 0.25s var(--crm-ease) both;
}

@media (max-width: 640px) {
    .crm-kanban-board {
        gap: 0.75rem;
    }
}

/* Dashboard hero */
.crm-hero {
    background: linear-gradient(135deg, var(--crm-hero-from), var(--crm-hero-to));
    border-radius: 1rem;
    padding: 1.75rem;
    color: #fff;
    box-shadow: 0 20px 40px -20px rgb(29 78 216 / 0.45);
}

.crm-hero-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.crm-hero-eyebrow {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: rgb(255 255 255 / 0.75);
    margin-bottom: 0.25rem;
}

.crm-hero-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
}

.crm-hero-subtitle {
    font-size: 0.875rem;
    color: rgb(255 255 255 / 0.85);
    margin-top: 0.25rem;
}

.crm-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.crm-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    background: rgb(255 255 255 / 0.12);
    border: 1px solid rgb(255 255 255 / 0.25);
    border-radius: 0.5rem;
    padding: 0.5rem 0.875rem;
    text-decoration: none;
    transition: background-color 0.15s var(--crm-ease), transform 0.15s var(--crm-ease);
}

.crm-hero-btn:hover {
    background: rgb(255 255 255 / 0.22);
    transform: translateY(-1px);
    color: #fff;
}

.crm-hero-btn-solid {
    background: #fff;
    color: var(--crm-hero-from);
    border-color: #fff;
}

.crm-hero-btn-solid:hover {
    background: rgb(255 255 255 / 0.9);
    color: var(--crm-hero-from);
}

.crm-hero-chips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1.5rem;
}

@media (min-width: 768px) {
    .crm-hero-chips {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .crm-hero-chips {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.crm-hero-chip {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    background: rgb(255 255 255 / 0.1);
    border: 1px solid rgb(255 255 255 / 0.18);
    border-radius: 0.625rem;
    padding: 0.75rem 0.875rem;
    text-decoration: none;
    color: #fff;
    transition: background-color 0.15s var(--crm-ease), transform 0.15s var(--crm-ease);
}

.crm-hero-chip:hover {
    background: rgb(255 255 255 / 0.18);
    transform: translateY(-2px);
    color: #fff;
}

.crm-hero-chip svg {
    flex-shrink: 0;
    opacity: 0.85;
}

.crm-hero-chip-value {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.1;
}

.crm-hero-chip-label {
    font-size: 0.75rem;
    color: rgb(255 255 255 / 0.8);
}

/* User chips (avatar + name) used across tables */
.crm-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.2;
}

.crm-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 9999px;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.crm-avatar-lg {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.875rem;
}

/* Section header accents on resource pages */
.crm-page-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .crm-page-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.crm-mini-stat {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid rgb(0 0 0 / 0.06);
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
    transition: box-shadow 0.18s var(--crm-ease), transform 0.18s var(--crm-ease);
}

.crm-mini-stat:hover {
    box-shadow: 0 8px 20px -10px rgb(0 0 0 / 0.15);
    transform: translateY(-2px);
}

.crm-mini-stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.625rem;
    flex-shrink: 0;
}

.crm-mini-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.crm-mini-stat-label {
    font-size: 0.75rem;
    color: #6b7280;
}

.crm-mini-stat-description {
    font-size: 0.6875rem;
    margin-top: 0.125rem;
}

/* Colored icon chip variants for mini stats */
.crm-icon-bg-primary { background: rgb(37 99 235 / 0.12); color: #1d4ed8; }
.crm-icon-bg-success { background: rgb(22 163 74 / 0.12); color: #15803d; }
.crm-icon-bg-warning { background: rgb(217 119 6 / 0.14); color: #b45309; }
.crm-icon-bg-danger  { background: rgb(220 38 38 / 0.12); color: #b91c1c; }
.crm-icon-bg-info    { background: rgb(14 165 233 / 0.14); color: #0369a1; }
.crm-icon-bg-gray    { background: rgb(100 116 139 / 0.12); color: #475569; }

.crm-text-primary { color: #1d4ed8; }
.crm-text-success { color: #15803d; }
.crm-text-warning { color: #b45309; }
.crm-text-danger  { color: #b91c1c; }
.crm-text-info    { color: #0369a1; }
.crm-text-gray    { color: #6b7280; }

/* ===================== Sidebar & Topbar redesign ===================== */

.crm-brand-stripe {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1d4ed8, #0ea5e9, #22c55e);
    z-index: 60;
}

.fi-topbar {
    margin-top: 3px;
}

.fi-sidebar {
    margin-top: 3px;
    background: var(--crm-sidebar-bg) !important;
    border-right: 1px solid rgb(255 255 255 / 0.06);
}

.fi-sidebar-header {
    background: linear-gradient(135deg, var(--crm-hero-from), var(--crm-hero-to)) !important;
    box-shadow: none !important;
    border-bottom: 1px solid rgb(255 255 255 / 0.08);
}

.fi-sidebar-header .fi-logo {
    color: #fff !important;
    font-weight: 700;
}

.fi-sidebar-nav {
    background: var(--crm-sidebar-bg);
}

.fi-sidebar-group-label {
    font-weight: 700 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase;
    font-size: 0.6875rem !important;
    color: var(--crm-sidebar-muted) !important;
}

.fi-sidebar-group-icon {
    color: var(--crm-sidebar-muted) !important;
}

.fi-sidebar-item-button {
    position: relative;
    border-radius: 0.5rem !important;
}

.fi-sidebar-item-label {
    color: var(--crm-sidebar-text) !important;
}

.fi-sidebar-item-icon {
    color: var(--crm-sidebar-icon) !important;
}

.fi-sidebar-item-button:hover {
    background: rgb(255 255 255 / 0.06) !important;
}

.fi-sidebar-item-button:hover .fi-sidebar-item-label {
    color: #fff !important;
}

.fi-sidebar-item-button:hover .fi-sidebar-item-icon {
    color: #fff !important;
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-button {
    background: linear-gradient(90deg, var(--crm-hero-from), var(--crm-hero-to)) !important;
    font-weight: 600;
    box-shadow: 0 4px 14px -4px rgb(29 78 216 / 0.55);
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-button .fi-sidebar-item-label,
.fi-sidebar-item.fi-active > .fi-sidebar-item-button .fi-sidebar-item-icon {
    color: #fff !important;
}

.fi-sidebar-group-button .fi-sidebar-group-label,
.fi-sidebar-group-collapse-button svg {
    color: var(--crm-sidebar-muted) !important;
}

.fi-sidebar-nav-groups {
    border-color: rgb(255 255 255 / 0.06) !important;
}

/* badge on sidebar items (e.g. Tender Feed new-count) should stay legible on dark bg */
.fi-sidebar-item-button .fi-badge {
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1);
}

/* Sidebar scrollbar — thin and dark-matching instead of the default system bar */
.fi-sidebar-nav {
    scrollbar-width: thin;
    scrollbar-color: rgb(255 255 255 / 0.18) transparent;
}

.fi-sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.fi-sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.fi-sidebar-nav::-webkit-scrollbar-thumb {
    background-color: rgb(255 255 255 / 0.15);
    border-radius: 9999px;
}

.fi-sidebar-nav::-webkit-scrollbar-thumb:hover {
    background-color: rgb(255 255 255 / 0.28);
}

/* Mobile drawer: rounded leading edge, stronger shadow, bigger tap targets */
@media (max-width: 1023px) {
    .fi-sidebar {
        border-top-right-radius: 1rem;
        border-bottom-right-radius: 1rem;
        box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.45);
        overflow: hidden;
    }

    .fi-sidebar-header {
        border-top-right-radius: 1rem;
    }

    .fi-sidebar-item-button {
        padding-top: 0.625rem !important;
        padding-bottom: 0.625rem !important;
    }

    .fi-sidebar-item-label {
        font-size: 0.9375rem !important;
    }

    .fi-sidebar-item-icon {
        height: 1.375rem !important;
        width: 1.375rem !important;
    }
}

/* Topbar */
.fi-topbar nav {
    background: #fff;
    border-bottom: 1px solid rgb(0 0 0 / 0.06);
}

.fi-user-avatar {
    box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px rgb(37 99 235 / 0.35);
}
