/* =============================================================================
   FMG NEXUS ADMIN - Executive Dashboard Stylesheet
   Professional CMS/Business Dashboard Aesthetic
   ============================================================================= */

@font-face {
    font-family: 'BDO Grotesk';
    src: url("/static/fonts/bdo-grotesk/BDOGrotesk-VF.b6a722e8fef8.ttf") format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Recursive';
    src: url("/static/fonts/recursive/Recursive_VF_1.085--subset-GF_latin_basic.abcbe11d1f0d.woff2") format('woff2');
    font-weight: 300 1000;
    font-style: normal;
    font-display: swap;
}

/* --- CSS Custom Properties --- */
:root {
    --fmg-font: 'BDO Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --fmg-font-mono: 'Recursive', 'SFMono-Regular', ui-monospace, Consolas, 'Liberation Mono', Menlo, monospace;
    --fmg-font-accent: 'Recursive', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --fmg-primary: #cd3301;
    --fmg-primary-light: #f36b45;
    --fmg-primary-dark: #7b1200;
    --fmg-navy: #0c1222;
    --fmg-navy-light: #1a1f2e;
    --fmg-surface: #f8f9fc;
    --fmg-surface-alt: #f1f3f9;
    --fmg-card: #ffffff;
    --fmg-card-border: #e8ecf4;
    --fmg-card-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    --fmg-card-shadow-hover: 0 2px 8px rgba(15, 23, 42, 0.06);
    --fmg-card-radius: 8px;
    --fmg-text: #1e293b;
    --fmg-text-secondary: #64748b;
    --fmg-text-muted: #94a3b8;
    --fmg-success: #10b981;
    --fmg-success-bg: #ecfdf5;
    --fmg-warning: #f59e0b;
    --fmg-warning-bg: #fffbeb;
    --fmg-info: #3b82f6;
    --fmg-info-bg: #eff6ff;
    --fmg-danger: #ef4444;
    --fmg-danger-bg: #fef2f2;
    --fmg-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    /* --- Dashboard Typography Scale ---
       All dashboard widgets reference these tokens so sizes stay in sync
       with the KPI stat cards. Change here to change everywhere. */
    --fmg-text-2xs:  0.6875rem;   /* 11px — timestamps, IDs */
    --fmg-text-xs:   0.75rem;     /* 12px — badge text, mini labels */
    --fmg-text-sm:   0.8125rem;   /* 13px — secondary body, footer text */
    --fmg-text-base: 0.9375rem;   /* 15px — card titles, body copy */
    --fmg-text-lg:   1.125rem;    /* 18px — sub-heading values */
    --fmg-text-xl:   1.5rem;      /* 24px — medium stat values */
    --fmg-text-2xl:  1.875rem;    /* 30px — KPI values (matches .fmg-kpi-value) */

    /* label / upper-tag style */
    --fmg-label-size:    var(--fmg-text-xs);
    --fmg-label-weight:  700;
    --fmg-label-spacing: 0.06em;

    /* card section title */
    --fmg-section-title-size:   var(--fmg-text-base);
    --fmg-section-title-weight: 600;
}

/* Dark mode properties */
.dark {
    --fmg-surface: #0f1219;
    --fmg-surface-alt: #151a24;
    --fmg-card: #1a1f2e;
    --fmg-card-border: #2a3040;
    --fmg-card-shadow: 0 1px 2px rgba(0, 0, 0, 0.16);
    --fmg-card-shadow-hover: 0 2px 8px rgba(0, 0, 0, 0.24);
    --fmg-text: #f1f5f9;
    --fmg-text-secondary: #94a3b8;
    --fmg-text-muted: #64748b;
    --fmg-success-bg: rgba(16, 185, 129, 0.1);
    --fmg-warning-bg: rgba(245, 158, 11, 0.1);
    --fmg-info-bg: rgba(59, 130, 246, 0.1);
    --fmg-danger-bg: rgba(239, 68, 68, 0.1);
}

/* --- Base Typography --- */
body,
#container,
.font-sans,
input,
select,
textarea,
button {
    font-family: var(--fmg-font) !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
[class*="text-font-important"] {
    font-family: var(--fmg-font) !important;
    letter-spacing: -0.02em;
}

.font-mono,
code,
pre,
kbd,
samp {
    font-family: var(--fmg-font-mono) !important;
    font-variation-settings: "MONO" 1, "CASL" 0, "wght" 560, "slnt" 0, "CRSV" 0;
}

.fmg-font-accent {
    font-family: var(--fmg-font-accent) !important;
    font-variation-settings: "MONO" 0, "CASL" 0.92, "wght" 720, "slnt" -5, "CRSV" 0.4;
    letter-spacing: -0.025em;
}

/* Tabular figures for numbers */
.tabular-nums {
    font-variant-numeric: tabular-nums;
}

/* --- Animation Keyframes --- */
@keyframes fmg-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fmg-slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fmg-scale-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes fmg-count-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fmg-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes fmg-pulse-ring {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

@keyframes fmg-spin {
    to { transform: rotate(360deg); }
}

/* --- Animation Utilities --- */
.fmg-animate-in {
    animation: fmg-fade-in 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.fmg-animate-slide {
    animation: fmg-slide-up 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.fmg-animate-scale {
    animation: fmg-scale-in 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Stagger delays */
.fmg-delay-1 { animation-delay: 0.05s; }
.fmg-delay-2 { animation-delay: 0.1s; }
.fmg-delay-3 { animation-delay: 0.15s; }
.fmg-delay-4 { animation-delay: 0.2s; }
.fmg-delay-5 { animation-delay: 0.25s; }
.fmg-delay-6 { animation-delay: 0.3s; }
.fmg-delay-7 { animation-delay: 0.35s; }
.fmg-delay-8 { animation-delay: 0.4s; }

/* --- KPI Card Component --- */
.fmg-kpi-card {
    position: relative;
    background: var(--fmg-card);
    border: 1px solid var(--fmg-card-border);
    border-radius: var(--fmg-card-radius);
    padding: 1.5rem;
    box-shadow: var(--fmg-card-shadow);
    transition: var(--fmg-transition);
    overflow: hidden;
}

.fmg-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--fmg-card-radius) var(--fmg-card-radius) 0 0;
}

.fmg-kpi-card:hover {
    box-shadow: var(--fmg-card-shadow-hover);
    transform: translateY(-2px);
}
.fmg-kpi-clickable {
    cursor: pointer;
}
.fmg-kpi-clickable:hover .fmg-kpi-label .material-symbols-outlined {
    opacity: 1 !important;
    color: var(--fmg-primary, #cd3301);
}

.fmg-kpi-card--primary::before { background: linear-gradient(135deg, var(--fmg-primary), var(--fmg-primary-light)); }
.fmg-kpi-card--success::before { background: linear-gradient(135deg, #059669, var(--fmg-success)); }
.fmg-kpi-card--warning::before { background: linear-gradient(135deg, #d97706, var(--fmg-warning)); }
.fmg-kpi-card--info::before { background: linear-gradient(135deg, #2563eb, var(--fmg-info)); }

.fmg-kpi-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 22px;
    margin-bottom: 1rem;
}

.fmg-kpi-icon--primary { background: rgba(205, 51, 1, 0.08); color: var(--fmg-primary); }
.fmg-kpi-icon--success { background: rgba(16, 185, 129, 0.08); color: var(--fmg-success); }
.fmg-kpi-icon--warning { background: rgba(245, 158, 11, 0.08); color: var(--fmg-warning); }
.fmg-kpi-icon--info { background: rgba(59, 130, 246, 0.08); color: var(--fmg-info); }

.dark .fmg-kpi-icon--primary { background: rgba(205, 51, 1, 0.15); }
.dark .fmg-kpi-icon--success { background: rgba(16, 185, 129, 0.15); }
.dark .fmg-kpi-icon--warning { background: rgba(245, 158, 11, 0.15); }
.dark .fmg-kpi-icon--info { background: rgba(59, 130, 246, 0.15); }

.fmg-kpi-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--fmg-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.375rem;
}

.fmg-kpi-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--fmg-text);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.fmg-kpi-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: var(--fmg-text-muted);
}

.fmg-kpi-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.fmg-kpi-badge--up {
    background: var(--fmg-success-bg);
    color: var(--fmg-success);
}

.fmg-kpi-badge--down {
    background: var(--fmg-danger-bg);
    color: var(--fmg-danger);
}

/* --- Enhanced Card Component --- */
.fmg-card {
    background: var(--fmg-card);
    border: 1px solid var(--fmg-card-border);
    border-radius: var(--fmg-card-radius);
    box-shadow: var(--fmg-card-shadow);
    overflow: hidden;
    transition: var(--fmg-transition);
}

.fmg-card:hover {
    box-shadow: var(--fmg-card-shadow-hover);
}

.fmg-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--fmg-card-border);
}

.fmg-card-header--stack {
    align-items: flex-start;
    gap: 1rem;
}

.fmg-admin-notifications {
    position: relative;
}

.fmg-admin-notifications summary {
    list-style: none;
}

.fmg-admin-notifications summary::-webkit-details-marker {
    display: none;
}

.fmg-admin-notifications__button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--fmg-card-border);
    background: var(--fmg-surface);
    color: var(--fmg-text-secondary);
    cursor: pointer;
    transition: var(--fmg-transition);
}

.fmg-admin-notifications__button:hover {
    color: var(--fmg-text);
    background: var(--fmg-surface-alt);
}

.fmg-admin-notifications__count {
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--fmg-primary);
    color: #ffffff;
    font-size: 0.6875rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.fmg-admin-notifications__panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    width: 320px;
    background: var(--fmg-surface);
    border: 1px solid var(--fmg-card-border);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15);
    padding: 0.85rem;
    z-index: 50;
}

.fmg-admin-notifications__title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fmg-text-muted);
    margin-bottom: 0.5rem;
}

.fmg-admin-notifications__item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--fmg-card-border);
}

.fmg-admin-notifications__item:last-child {
    border-bottom: none;
}

.fmg-admin-notifications__text {
    font-size: 0.8125rem;
    color: var(--fmg-text);
}

.fmg-admin-notifications__time {
    font-size: 0.6875rem;
    color: var(--fmg-text-muted);
    margin-top: 0.25rem;
}

.fmg-admin-purge {
    margin-left: 0.5rem;
}

.fmg-admin-purge__button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: #b91c1c;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: var(--fmg-transition);
}

.fmg-admin-purge__button:hover {
    background: #991b1b;
}

.fmg-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--fmg-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fmg-card-subtitle {
    font-size: 0.8125rem;
    color: var(--fmg-text-muted);
    margin-top: 0.25rem;
}

.fmg-card-title .material-symbols-outlined {
    font-size: 20px;
    color: var(--fmg-text-secondary);
}

.fmg-chart-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 999px;
    background: var(--fmg-surface-alt);
    border: 1px solid var(--fmg-card-border);
}

.fmg-toggle-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--fmg-text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    cursor: pointer;
    transition: var(--fmg-transition);
}

.fmg-toggle-btn.is-active {
    background: var(--fmg-primary);
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.fmg-toggle-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.fmg-card-body {
    padding: 1.5rem;
}

/* --- Admin Dashboard Shell --- */
.fmg-admin-dashboard {
    --fmg-dashboard-gap: 1rem;
    display: flex;
    flex-direction: column;
    gap: var(--fmg-dashboard-gap);
    max-width: 1440px;
}

.fmg-admin-dashboard *,
.fmg-admin-dashboard h1,
.fmg-admin-dashboard h2,
.fmg-admin-dashboard h3,
.fmg-admin-dashboard h4,
.fmg-admin-dashboard h5,
.fmg-admin-dashboard h6 {
    letter-spacing: 0;
}

.fmg-admin-dashboard .fmg-card,
.fmg-admin-dashboard .fmg-kpi-card,
.fmg-admin-dashboard .fmg-dashboard-toolbar,
.fmg-admin-dashboard .ew-module,
.fmg-dashboard-overview {
    border: 1px solid var(--fmg-card-border);
    border-radius: var(--fmg-card-radius);
    background: var(--fmg-card);
    box-shadow: var(--fmg-card-shadow);
}

.fmg-admin-dashboard .fmg-card:hover,
.fmg-admin-dashboard .fmg-kpi-card:hover,
.fmg-admin-dashboard .fmg-quick-action:hover {
    box-shadow: var(--fmg-card-shadow-hover);
    transform: none;
}

.fmg-dashboard-section {
    display: flex;
    flex-direction: column;
    gap: var(--fmg-dashboard-gap);
}

.fmg-dashboard-section > .fmg-grid-2,
.fmg-dashboard-section > .fmg-grid-4 {
    margin-bottom: 0 !important;
}

.fmg-admin-dashboard > .fmg-grid-2,
.fmg-admin-dashboard > .fmg-grid-4,
.fmg-admin-dashboard > .fmg-card,
.fmg-admin-dashboard > .ew-module,
.fmg-admin-dashboard > .fmg-dashboard-toolbar,
.fmg-admin-dashboard > .fmg-dashboard-overview {
    margin-bottom: 0 !important;
}

.fmg-admin-dashboard .fmg-card-header {
    min-height: 56px;
    padding: 0.9rem 1rem;
}

.fmg-admin-dashboard .fmg-card-body {
    padding: 1rem;
}

.fmg-admin-dashboard .fmg-card-title {
    font-size: 0.95rem;
    font-weight: 700;
}

.fmg-admin-dashboard .fmg-card-title .material-symbols-outlined,
.fmg-admin-dashboard .fmg-kpi-icon .material-symbols-outlined {
    font-size: 18px;
}

.fmg-admin-dashboard .fmg-kpi-card {
    min-height: 146px;
    padding: 1rem;
}

.fmg-admin-dashboard .fmg-kpi-card::before {
    height: 2px;
    border-radius: var(--fmg-card-radius) var(--fmg-card-radius) 0 0;
}

.fmg-admin-dashboard .fmg-kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.fmg-admin-dashboard .fmg-kpi-label {
    font-size: 0.75rem;
    font-weight: 650;
    text-transform: none;
    letter-spacing: 0;
}

.fmg-admin-dashboard .fmg-kpi-value {
    font-size: clamp(1.35rem, 2vw, 1.75rem);
    letter-spacing: 0;
}

.fmg-admin-dashboard .fmg-kpi-footer,
.fmg-admin-dashboard .fmg-card-subtitle {
    font-size: 0.78rem;
}

.fmg-admin-dashboard .fmg-chart-toggle {
    border-radius: 8px;
    padding: 0.2rem;
}

.fmg-admin-dashboard .fmg-toggle-btn {
    border-radius: 6px;
    letter-spacing: 0;
}

.fmg-admin-dashboard .fmg-dashboard-toolbar,
.fmg-admin-dashboard .ew-module {
    background: var(--fmg-card);
    overflow: hidden;
}

.fmg-admin-dashboard .fmg-dashboard-toolbar__form,
.fmg-admin-dashboard .ew-hero {
    padding: 1rem;
}

.fmg-admin-dashboard .fmg-dashboard-toolbar__label,
.fmg-admin-dashboard .ew-kicker,
.fmg-admin-dashboard .ew-news-meta,
.fmg-admin-dashboard .jo-metric-lbl {
    text-transform: none;
    letter-spacing: 0;
}

.fmg-admin-dashboard .ew-title {
    font-size: 1rem;
    line-height: 1.35;
}

.fmg-admin-dashboard .ew-subtitle,
.fmg-admin-dashboard .ew-news-summary {
    font-size: 0.84rem;
    line-height: 1.5;
}

.fmg-admin-dashboard .ew-logo,
.fmg-admin-dashboard .ew-news-rank,
.fmg-admin-dashboard .ew-pill,
.fmg-admin-dashboard .jo-metric,
.fmg-admin-dashboard .jo-signal,
.fmg-admin-dashboard .jo-expand-btn,
.fmg-admin-dashboard .fmg-task-pill,
.fmg-admin-dashboard [style*="border-radius: 999px"] {
    border-radius: 8px !important;
}

.fmg-admin-dashboard .fmg-dashboard-toolbar__button,
.fmg-admin-dashboard .fmg-dashboard-toolbar__date,
.fmg-admin-dashboard .jo-nav-btn,
.fmg-admin-dashboard .fmg-tasks-view-btn,
.fmg-admin-dashboard .fmg-study-fb-btn,
.fmg-admin-dashboard .fmg-study-done-btn {
    border-radius: 8px !important;
}

.fmg-admin-dashboard #fmg-job-openings-widget,
.fmg-admin-dashboard #fmg-tasks-widget {
    overflow: hidden;
}

.fmg-admin-dashboard .fmg-table thead th {
    text-transform: none;
    letter-spacing: 0;
    border-bottom-width: 1px;
}

/* --- Dashboard Toolbar --- */
.fmg-dashboard-toolbar__form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    min-height: 64px;
}

.fmg-dashboard-toolbar__meta {
    display: flex;
    flex: 1 1 18rem;
    flex-direction: column;
    gap: 0.18rem;
    min-width: 0;
}

.fmg-dashboard-toolbar__label {
    color: var(--fmg-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.fmg-dashboard-toolbar__caption {
    color: var(--fmg-text);
    font-size: 0.86rem;
    font-weight: 650;
    line-height: 1.35;
}

.fmg-dashboard-toolbar__controls {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    min-width: 0;
}

.fmg-dashboard-toolbar__button,
.fmg-dashboard-toolbar__date {
    box-sizing: border-box;
    height: 2.1rem;
    border: 1px solid var(--fmg-card-border);
    background: var(--fmg-card);
    color: var(--fmg-text);
    transition:
        border-color 0.18s ease,
        background-color 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease;
}

.fmg-dashboard-toolbar__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0 0.68rem;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.fmg-dashboard-toolbar__button .material-symbols-outlined {
    font-size: 16px;
    line-height: 1;
}

.fmg-dashboard-toolbar__button:hover,
.fmg-dashboard-toolbar__date:hover {
    border-color: rgba(15, 23, 42, 0.18);
    background: var(--fmg-surface-alt);
    color: var(--fmg-text);
}

.dark .fmg-dashboard-toolbar__button:hover,
.dark .fmg-dashboard-toolbar__date:hover {
    border-color: rgba(148, 163, 184, 0.24);
}

.fmg-dashboard-toolbar__button:focus-visible,
.fmg-dashboard-toolbar__date:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(205, 51, 1, 0.14);
}

.fmg-dashboard-toolbar__button--nav {
    width: 2.1rem;
    padding: 0;
}

.fmg-dashboard-toolbar__date {
    min-width: 10.5rem;
    padding: 0 0.72rem;
    font-size: 0.82rem;
}

.fmg-dashboard-toolbar__button--today {
    background: var(--fmg-navy);
    border-color: var(--fmg-navy);
    color: #ffffff;
}

.fmg-dashboard-toolbar__button--today:hover {
    background: #1e293b;
    border-color: #1e293b;
    color: #ffffff;
}

.dark .fmg-dashboard-toolbar__button--today {
    background: #e2e8f0;
    border-color: #e2e8f0;
    color: #0f172a;
}

.fmg-dashboard-toolbar__button--pdf {
    background: var(--fmg-primary);
    border-color: var(--fmg-primary);
    color: #ffffff;
}

.fmg-dashboard-toolbar__button--pdf:hover:not(:disabled) {
    background: var(--fmg-primary-dark);
    border-color: var(--fmg-primary-dark);
    color: #ffffff;
}

.fmg-dashboard-toolbar__button--pdf:disabled {
    opacity: 0.55;
    cursor: wait;
}

.fmg-dashboard-toolbar__button--link {
    color: var(--fmg-primary-dark);
}

.fmg-dashboard-toolbar__button--link:hover {
    border-color: var(--fmg-primary);
    color: var(--fmg-primary-dark);
}

.dark .fmg-dashboard-toolbar__button--link {
    color: #fdba74;
}

.fmg-dashboard-toolbar__button--link.is-hidden {
    display: none;
}

#fmg-base-date::-webkit-calendar-picker-indicator {
    opacity: 0.65;
    cursor: pointer;
}

#fmg-base-date::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.fmg-admin-dashboard ::-webkit-datetime-edit {
    color: inherit;
}

@media (max-width: 720px) {
    .fmg-dashboard-toolbar__form {
        align-items: flex-start;
    }

    .fmg-dashboard-toolbar__controls {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        width: 100%;
    }

    .fmg-dashboard-toolbar__date {
        min-width: 0;
        width: 100%;
    }

    .fmg-dashboard-toolbar__button--today,
    .fmg-dashboard-toolbar__button--pdf,
    .fmg-dashboard-toolbar__button--link {
        grid-column: 1 / -1;
        width: 100%;
    }
}

/* --- Quick Actions --- */
.fmg-quick-actions {
    overflow: hidden;
}

.fmg-quick-actions__header {
    align-items: center;
}

.fmg-quick-actions__body {
    display: flex;
    flex-direction: column;
    gap: 0.62rem;
}

.fmg-admin-dashboard .fmg-quick-action {
    min-height: 62px;
    padding: 0.8rem 0.9rem;
    border-radius: 8px;
    box-shadow: none;
}

.fmg-admin-dashboard .fmg-quick-action:hover {
    border-color: rgba(205, 51, 1, 0.32);
    box-shadow: 0 2px 8px rgba(205, 51, 1, 0.07);
}

.fmg-admin-dashboard .fmg-quick-action-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
}

.fmg-admin-dashboard .fmg-quick-action-icon .material-symbols-outlined {
    font-size: 18px;
}

.fmg-quick-action__content {
    min-width: 0;
}

.fmg-admin-dashboard .fmg-quick-action-text {
    color: var(--fmg-text);
    font-size: 0.84rem;
    font-weight: 750;
    line-height: 1.25;
}

.fmg-admin-dashboard .fmg-quick-action-desc {
    margin-top: 0.15rem;
    font-size: 0.7rem;
    line-height: 1.35;
}

/* --- Dashboard Theme / News Block --- */
.fmg-dashboard-theme {
    overflow: hidden;
}

.fmg-dashboard-theme__hero {
    display: block;
    border-bottom: 1px solid var(--fmg-card-border);
}

.fmg-dashboard-theme__brand {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: flex-start;
    gap: 0.85rem;
    min-width: 0;
}

.fmg-dashboard-theme__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.4rem;
    min-height: 2.6rem;
    padding: 0.45rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 8px;
    background: #ffffff;
}

.fmg-dashboard-theme__logo img {
    display: block;
    max-width: 100%;
    max-height: 1.8rem;
    object-fit: contain;
}

.fmg-dashboard-theme__header-text {
    min-width: 0;
}

.fmg-dashboard-theme__kicker {
    display: block;
    margin-bottom: 0.22rem;
    color: var(--fmg-primary);
    font-size: 0.72rem;
    font-weight: 750;
    line-height: 1.35;
}

.fmg-dashboard-theme__title {
    margin: 0;
    color: var(--fmg-text);
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.35;
}

.fmg-dashboard-theme__subtitle {
    max-width: 60rem;
    margin: 0.35rem 0 0;
    color: var(--fmg-text-secondary);
    font-size: 0.84rem;
    line-height: 1.5;
}

.fmg-dashboard-theme__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.75rem;
}

.fmg-dashboard-theme__pill,
.fmg-dashboard-theme__source {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    min-height: 1.75rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 750;
    line-height: 1;
    text-decoration: none;
}

.fmg-dashboard-theme__pill {
    padding: 0.22rem 0.55rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(148, 163, 184, 0.08);
    color: var(--fmg-text-secondary);
}

.fmg-dashboard-theme__source {
    padding: 0.2rem 0;
    color: var(--fmg-primary);
}

.fmg-dashboard-theme__source:hover {
    color: var(--fmg-primary-dark);
    text-decoration: underline;
}

.ew-pill__icon,
.ew-source-link__icon {
    font-size: 15px;
    line-height: 1;
}

.fmg-dashboard-theme__news-wrap {
    padding: 0.35rem 0;
}

.fmg-dashboard-theme__news-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.fmg-dashboard-theme__news-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.82rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.fmg-dashboard-theme__news-item:last-child {
    border-bottom: 0;
}

.fmg-dashboard-theme__news-item:hover {
    background: rgba(148, 163, 184, 0.04);
}

.fmg-dashboard-theme__news-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 1.8rem;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 8px;
    background: rgba(205, 51, 1, 0.08);
    color: var(--fmg-primary);
    font-size: 0.76rem;
    font-weight: 800;
}

.fmg-dashboard-theme__news-body {
    min-width: 0;
}

.fmg-dashboard-theme__news-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.16rem;
    color: var(--fmg-text-muted);
    font-size: 0.68rem;
    font-weight: 650;
    line-height: 1.35;
}

.fmg-dashboard-theme__news-link {
    color: var(--fmg-text);
    font-size: 0.84rem;
    font-weight: 750;
    line-height: 1.42;
    text-decoration: none;
}

.fmg-dashboard-theme__news-link:hover {
    color: var(--fmg-primary);
    text-decoration: underline;
}

.fmg-dashboard-theme__news-summary {
    margin: 0.25rem 0 0;
    color: var(--fmg-text-secondary);
    font-size: 0.76rem;
    line-height: 1.5;
}

.fmg-dashboard-theme__empty {
    margin: 0;
    padding: 1rem;
    color: var(--fmg-text-muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.dark .fmg-dashboard-theme__logo {
    background: rgba(255, 255, 255, 0.94);
}

.dark .fmg-dashboard-theme__source {
    color: #fdba74;
}

@media (max-width: 760px) {
    .fmg-dashboard-theme__brand {
        grid-template-columns: 1fr;
    }

    .fmg-dashboard-theme__actions {
        align-items: stretch;
        flex-direction: column;
    }

    .fmg-dashboard-theme__pill,
    .fmg-dashboard-theme__source {
        width: 100%;
    }

    .fmg-dashboard-theme__news-item {
        padding: 0.82rem;
    }
}

/* --- KPI Cards and Chart Panels --- */
.fmg-kpi-grid,
.fmg-chart-panel-grid {
    margin-bottom: 0;
}

.fmg-kpi-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.fmg-kpi-card__arrow {
    margin-left: 0.2rem;
    color: currentColor;
    font-size: 14px;
    line-height: 1;
    opacity: 0.48;
    vertical-align: middle;
    transition:
        color 0.15s ease,
        opacity 0.15s ease,
        transform 0.15s ease;
}

.fmg-kpi-clickable:hover .fmg-kpi-card__arrow {
    color: var(--fmg-primary);
    opacity: 1;
    transform: translateX(1px);
}

.fmg-chart-panel {
    overflow: hidden;
}

.fmg-chart-panel__header {
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.fmg-chart-panel .fmg-card-title {
    min-width: 0;
}

.fmg-chart-container--bar,
.fmg-chart-container--trend {
    box-sizing: border-box;
    width: 100%;
    padding: 1rem 1.25rem;
}

.fmg-chart-container--bar {
    height: 300px;
}

.fmg-chart-container--trend {
    height: 320px;
}

.fmg-chart-container--bar canvas,
.fmg-chart-container--trend canvas {
    max-height: 100%;
}

.fmg-chart-toggle--range {
    flex-shrink: 0;
}

.fmg-sales-trend {
    margin-bottom: 0;
}

@media (max-width: 760px) {
    .fmg-chart-panel__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .fmg-chart-toggle--range {
        width: 100%;
    }

    .fmg-chart-container--bar {
        height: 260px;
        padding: 0.75rem;
    }

    .fmg-chart-container--trend {
        height: 280px;
        padding: 0.75rem;
    }
}

/* --- Country Chart and Detail Tables --- */
.fmg-country-table-grid,
.fmg-detail-table-grid {
    margin-bottom: 0;
}

.fmg-country-chart,
.fmg-detail-table-card {
    overflow: hidden;
}

.fmg-country-chart__body {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1rem;
}

.fmg-country-chart__canvas-wrap {
    flex: 0 0 190px;
    width: 190px;
    height: 190px;
}

.fmg-country-chart__legend {
    display: flex;
    flex: 1;
    min-width: 0;
    max-height: 190px;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
}

.fmg-country-chart__legend-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.fmg-country-chart__flag {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 50%;
    object-fit: cover;
}

.fmg-country-chart__dot {
    display: inline-block;
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.fmg-country-chart__label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: var(--fmg-text-secondary);
    font-size: 0.75rem;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fmg-country-chart__badge {
    flex-shrink: 0;
    color: var(--fmg-text-muted);
    font-size: 0.68rem;
    line-height: 1.35;
}

.fmg-detail-table-card__header {
    align-items: center;
}

.fmg-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.fmg-detail-table {
    min-width: 520px;
}

.fmg-detail-table tbody td {
    vertical-align: top;
}

@media (max-width: 760px) {
    .fmg-country-chart__body {
        align-items: stretch;
        flex-direction: column;
    }

    .fmg-country-chart__canvas-wrap {
        align-self: center;
    }

    .fmg-country-chart__legend {
        max-height: 220px;
    }
}

/* --- Daily Briefing --- */
.fmg-daily-briefing {
    overflow: hidden;
    border-color: rgba(205, 51, 1, 0.18) !important;
}

.fmg-daily-briefing__header {
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background:
        linear-gradient(90deg, rgba(205, 51, 1, 0.08), rgba(59, 130, 246, 0.04)),
        var(--fmg-card);
}

.fmg-daily-briefing__title {
    min-width: 0;
}

.fmg-daily-briefing__date {
    color: var(--fmg-text-muted);
    font-size: 0.76rem;
    font-weight: 500;
}

.fmg-daily-briefing__counts {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    color: var(--fmg-text-muted);
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
}

.fmg-daily-briefing__count-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    min-height: 1.85rem;
    padding: 0.24rem 0.58rem;
    border: 1px solid rgba(205, 51, 1, 0.18);
    border-radius: 8px;
    background: rgba(205, 51, 1, 0.08);
    color: var(--fmg-primary);
    font-size: 0.7rem;
    font-weight: 750;
}

.fmg-daily-briefing__count-pill .material-symbols-outlined {
    font-size: 15px;
}

.fmg-daily-briefing__count-pill--lead {
    border-color: rgba(59, 130, 246, 0.2);
    background: rgba(59, 130, 246, 0.08);
    color: #2563eb;
}

.fmg-daily-briefing__fallback {
    margin: 0.85rem 1rem 0;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(245, 158, 11, 0.22);
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.08);
    color: #92400e;
    font-size: 0.76rem;
    line-height: 1.45;
}

.dark .fmg-daily-briefing__fallback {
    color: #fbbf24;
}

.fmg-daily-briefing__week {
    padding: 1rem 1rem 0;
}

.fmg-daily-briefing__section-label {
    margin: 0 0 0.65rem;
    color: var(--fmg-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.fmg-daily-briefing__week-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 0.5rem;
}

.fmg-daily-briefing__week-link {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    min-width: 0;
    padding: 0.65rem 0.72rem;
    border: 1px solid var(--fmg-card-border);
    border-radius: 8px;
    background: var(--fmg-surface);
    color: inherit;
    text-decoration: none;
}

.fmg-daily-briefing__week-link:hover,
.fmg-daily-briefing__week-link.is-active {
    border-color: var(--fmg-primary);
    background: rgba(205, 51, 1, 0.06);
    color: var(--fmg-text);
}

.fmg-daily-briefing__week-date {
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.3;
}

.fmg-daily-briefing__week-meta {
    color: var(--fmg-text-muted);
    font-size: 0.68rem;
    line-height: 1.35;
}

.fmg-daily-briefing__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    border-top: 1px solid var(--fmg-card-border);
    margin-top: 1rem;
}

.fmg-daily-briefing__panel {
    min-width: 0;
    padding: 1rem;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.75), transparent);
}

.fmg-daily-briefing__panel--news {
    border-right: 1px solid var(--fmg-card-border);
}

.fmg-daily-briefing__news-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0;
    padding-left: 1rem;
}

.fmg-daily-briefing__news-item {
    padding: 0.78rem;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 8px;
    background: var(--fmg-card);
    color: var(--fmg-text);
    font-size: 0.8rem;
}

.fmg-daily-briefing__news-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.6rem;
}

.fmg-daily-briefing__news-body {
    flex: 1;
    min-width: 0;
}

.fmg-daily-briefing__news-link,
.fmg-daily-briefing__news-title {
    color: var(--fmg-text);
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
}

.fmg-daily-briefing__news-link:hover {
    color: var(--fmg-primary);
    text-decoration: underline;
}

.fmg-daily-briefing__news-relevance {
    margin: 0.22rem 0 0;
    color: var(--fmg-text-secondary);
    font-size: 0.74rem;
    line-height: 1.45;
}

.fmg-daily-briefing__news-source {
    margin: 0.12rem 0 0;
    color: var(--fmg-text-muted);
    font-size: 0.66rem;
}

.fmg-daily-briefing__share {
    flex-shrink: 0;
    margin-top: 0.08rem;
}

.fmg-daily-briefing__feedback {
    margin-top: 0.38rem;
}

.fmg-daily-briefing__lead-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.fmg-daily-briefing__lead-card {
    padding: 0.8rem;
    border: 1px solid rgba(59, 130, 246, 0.18);
    border-left: 3px solid #2563eb;
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.78), var(--fmg-card));
}

.fmg-daily-briefing__lead-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 0.28rem;
}

.fmg-daily-briefing__lead-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.28rem;
    min-width: 0;
}

.fmg-daily-briefing__lead-name {
    font-size: 0.82rem;
    font-weight: 750;
    line-height: 1.3;
}

.fmg-daily-briefing__lead-location-icon,
.fmg-daily-briefing__external-link .material-symbols-outlined {
    color: var(--fmg-primary);
    font-size: 15px;
    line-height: 1;
}

.fmg-daily-briefing__external-link .material-symbols-outlined {
    color: var(--fmg-text-muted);
}

.fmg-daily-briefing__external-link:hover .material-symbols-outlined {
    color: var(--fmg-primary);
}

.fmg-daily-briefing__lead-scores {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.16rem;
    flex-shrink: 0;
}

.fmg-daily-briefing__score {
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

.fmg-daily-briefing__score--fit {
    color: #0f766e;
}

.fmg-daily-briefing__score--signal {
    color: #d97706;
}

.fmg-daily-briefing__lead-meta,
.fmg-daily-briefing__lead-status {
    color: var(--fmg-text-muted);
    font-size: 0.7rem;
    line-height: 1.45;
}

.fmg-daily-briefing__lead-meta,
.fmg-daily-briefing__lead-summary,
.fmg-daily-briefing__lead-note,
.fmg-daily-briefing__lead-next,
.fmg-daily-briefing__lead-status {
    margin: 0.24rem 0 0;
}

.fmg-daily-briefing__lead-summary,
.fmg-daily-briefing__lead-note {
    color: var(--fmg-text-secondary);
    font-size: 0.73rem;
    line-height: 1.45;
}

.fmg-daily-briefing__lead-next {
    color: var(--fmg-primary);
    font-size: 0.73rem;
    font-weight: 700;
    line-height: 1.4;
}

.fmg-daily-briefing__tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.42rem;
}

.fmg-daily-briefing__tag {
    padding: 0.12rem 0.42rem;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
}

.fmg-daily-briefing__tag--supplier {
    background: rgba(205, 51, 1, 0.08);
    color: var(--fmg-primary);
}

.fmg-daily-briefing__tag--category {
    background: rgba(14, 165, 233, 0.1);
    color: #0369a1;
}

.fmg-daily-briefing__lead-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--fmg-card-border);
}

.fmg-daily-briefing__lead-action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.fmg-daily-briefing__empty {
    margin: 0;
    padding: 1rem;
    color: var(--fmg-text-muted);
    font-size: 0.86rem;
    line-height: 1.55;
}

.fmg-brief-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    min-height: 1.8rem;
    padding: 0.22rem 0.55rem;
    border: 1px solid var(--fmg-card-border);
    border-radius: 8px;
    background: transparent;
    color: var(--fmg-text-secondary);
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition:
        border-color 0.15s ease,
        background-color 0.15s ease,
        color 0.15s ease;
    vertical-align: middle;
}

.fmg-brief-btn__icon {
    font-size: 15px;
    line-height: 1;
}

.fmg-brief-btn--share:hover {
    border-color: rgba(15, 23, 42, 0.2);
    background: var(--fmg-surface-alt);
    color: var(--fmg-text);
}

.fmg-brief-btn--crm {
    border-color: rgba(205, 51, 1, 0.34);
    color: var(--fmg-primary);
}

.fmg-brief-btn--crm:hover {
    background: var(--fmg-primary);
    border-color: var(--fmg-primary);
    color: #ffffff;
}

.fmg-brief-btn--contacts {
    border-color: rgba(15, 23, 42, 0.22);
    color: var(--fmg-navy);
}

.fmg-brief-btn--contacts:hover {
    background: var(--fmg-navy);
    border-color: var(--fmg-navy);
    color: #ffffff;
}

.dark .fmg-brief-btn--contacts {
    border-color: rgba(226, 232, 240, 0.26);
    color: #e2e8f0;
}

.dark .fmg-brief-btn--contacts:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.fmg-brief-btn--copied {
    border-color: #16a34a !important;
    color: #16a34a !important;
}

.fmg-brief-btn[disabled] {
    opacity: 0.6;
    cursor: wait;
}

.fmg-fb-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.22rem;
}

.fmg-fb-btn {
    padding: 0.16rem 0.42rem;
    border: 1px solid var(--fmg-card-border);
    border-radius: 6px;
    background: transparent;
    color: var(--fmg-text-muted);
    cursor: pointer;
    font-size: 0.61rem;
    font-weight: 700;
    line-height: 1.3;
    transition:
        border-color 0.15s ease,
        background-color 0.15s ease,
        color 0.15s ease;
}

.fmg-fb-btn:hover {
    border-color: rgba(148, 163, 184, 0.55);
    color: var(--fmg-text-secondary);
}

.fmg-fb-btn--not_relevant.is-selected {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}

.fmg-fb-btn--relevant.is-selected {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
    color: #f59e0b;
}

.fmg-fb-btn--very_relevant.is-selected {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.08);
    color: #22c55e;
}

@media (max-width: 860px) {
    .fmg-daily-briefing__grid {
        grid-template-columns: 1fr;
    }

    .fmg-daily-briefing__panel--news {
        border-right: 0;
        border-bottom: 1px solid var(--fmg-card-border);
    }
}

@media (max-width: 640px) {
    .fmg-daily-briefing__header,
    .fmg-daily-briefing__lead-top,
    .fmg-daily-briefing__lead-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .fmg-daily-briefing__counts,
    .fmg-daily-briefing__lead-scores {
        align-items: flex-start;
        white-space: normal;
    }

    .fmg-daily-briefing__news-row {
        flex-direction: column;
    }
}

/* --- Tasks Calendar --- */
.fmg-tasks-calendar {
    overflow: hidden;
    border-color: rgba(16, 185, 129, 0.18) !important;
}

.fmg-tasks-calendar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid var(--fmg-card-border);
    background:
        linear-gradient(90deg, rgba(16, 185, 129, 0.08), rgba(205, 51, 1, 0.04)),
        var(--fmg-card);
}

.fmg-tasks-calendar__heading {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}

.fmg-tasks-calendar__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(16, 185, 129, 0.24);
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.fmg-tasks-calendar__icon .material-symbols-outlined {
    font-size: 18px;
}

.fmg-tasks-calendar__title {
    color: var(--fmg-text);
    font-size: 0.92rem;
    font-weight: 750;
    line-height: 1.25;
}

.fmg-tasks-calendar__subtitle {
    color: var(--fmg-text-muted);
    font-size: 0.7rem;
    line-height: 1.4;
}

.fmg-tasks-calendar__summary {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.fmg-tasks-calendar__status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 1.75rem;
    padding: 0.24rem 0.58rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 8px;
    background: rgba(148, 163, 184, 0.08);
    color: var(--fmg-text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.fmg-tasks-calendar__status .material-symbols-outlined {
    font-size: 14px;
}

.fmg-tasks-calendar__status--complete {
    border-color: rgba(16, 185, 129, 0.18);
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
}

.fmg-tasks-calendar__status--overdue {
    border-color: rgba(239, 68, 68, 0.18);
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
}

.fmg-tasks-calendar__all-link,
.fmg-tasks-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-height: 1.75rem;
    padding: 0.24rem 0.58rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition:
        border-color 0.15s ease,
        background-color 0.15s ease,
        color 0.15s ease;
}

.fmg-tasks-calendar__all-link {
    color: var(--fmg-primary);
}

.fmg-tasks-calendar__all-link .material-symbols-outlined,
.fmg-tasks-view-btn__icon {
    font-size: 15px;
}

.fmg-tasks-calendar__all-link:hover {
    background: rgba(205, 51, 1, 0.06);
    color: var(--fmg-primary-dark);
}

.fmg-tasks-view-btn {
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(148, 163, 184, 0.08);
    color: var(--fmg-text-muted);
    cursor: pointer;
}

.fmg-tasks-view-btn:hover {
    border-color: rgba(205, 51, 1, 0.22);
    background: rgba(205, 51, 1, 0.06);
    color: var(--fmg-primary);
}

.fmg-tasks-calendar__progress {
    height: 3px;
    background: rgba(148, 163, 184, 0.1);
}

.fmg-tasks-calendar__progress-bar {
    height: 100%;
    border-radius: 0 2px 2px 0;
    background: linear-gradient(90deg, #10b981, #34d399);
    transition: width 0.5s ease;
}

.fmg-tasks-calendar__overdue {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid rgba(239, 68, 68, 0.1);
    background: rgba(239, 68, 68, 0.04);
}

.fmg-tasks-calendar__overdue-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.38rem;
}

.fmg-tasks-calendar__overdue-icon {
    color: #ef4444;
    font-size: 15px;
}

.fmg-tasks-calendar__grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: 120px;
}

.fmg-day-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-right: 1px solid rgba(148, 163, 184, 0.08);
}

.fmg-day-col--last {
    border-right: 0;
}

.fmg-day-col--today {
    background: linear-gradient(180deg, rgba(205, 51, 1, 0.075), rgba(205, 51, 1, 0.025));
}

.dark .fmg-day-col--today {
    background: rgba(205, 51, 1, 0.05);
}

.fmg-day-header {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 0.14rem;
    min-height: 72px;
    padding: 0.65rem 0.4rem 0.55rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    position: relative;
}

.fmg-day-header--today {
    border-bottom-color: rgba(205, 51, 1, 0.18);
}

.fmg-day-name {
    color: var(--fmg-text-muted);
    font-size: 0.62rem;
    font-weight: 750;
    letter-spacing: 0;
    text-transform: none;
}

.fmg-day-header--today .fmg-day-name {
    color: var(--fmg-primary);
}

.fmg-day-num {
    color: var(--fmg-text);
    font-size: 1rem;
    font-weight: 650;
    line-height: 1;
}

.fmg-day-num--today {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--fmg-primary);
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 800;
}

.fmg-day-badge {
    padding: 0.05rem 0.35rem;
    border-radius: 6px;
    background: rgba(148, 163, 184, 0.1);
    color: var(--fmg-text-muted);
    font-size: 0.56rem;
    font-weight: 750;
    line-height: 1.4;
}

.fmg-day-badge--today {
    background: rgba(205, 51, 1, 0.1);
    color: var(--fmg-primary);
}

.fmg-day-tasks {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.34rem;
    min-height: 72px;
    padding: 0.42rem;
}

.fmg-day-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 56px;
}

.fmg-day-empty__icon {
    color: rgba(148, 163, 184, 0.38);
    font-size: 16px;
}

.fmg-task-card {
    display: flex;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-radius: 8px;
    background: var(--fmg-card);
    color: inherit;
    text-decoration: none;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.fmg-task-card:hover {
    border-color: rgba(205, 51, 1, 0.26);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    transform: translateY(-1px);
}

.fmg-task-card--done {
    opacity: 0.48;
}

.fmg-task-card--done .fmg-task-card__title {
    text-decoration: line-through;
}

.fmg-task-card__accent {
    flex: 0 0 3px;
    border-radius: 3px 0 0 3px;
}

.fmg-task-card__body {
    flex: 1;
    min-width: 0;
    padding: 0.36rem 0.42rem;
}

.fmg-task-card__row,
.fmg-task-card__meta {
    display: flex;
    align-items: center;
    min-width: 0;
}

.fmg-task-card__row {
    gap: 0.25rem;
}

.fmg-task-card__type-icon {
    flex-shrink: 0;
    font-size: 12px;
    opacity: 0.82;
}

.fmg-task-card__title {
    overflow: hidden;
    color: var(--fmg-text);
    font-size: 0.66rem;
    font-weight: 650;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fmg-task-card__meta {
    gap: 0.2rem;
    margin-top: 0.14rem;
    overflow: hidden;
    color: var(--fmg-text-muted);
    font-size: 0.59rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fmg-task-card__meta .material-symbols-outlined {
    font-size: 10px;
}

.fmg-task-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-size: 0.66rem;
    font-weight: 700;
    text-decoration: none;
    transition:
        border-color 0.15s ease,
        background-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.fmg-task-pill--overdue {
    border: 1px solid rgba(239, 68, 68, 0.18);
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
}

.fmg-task-pill--overdue:hover {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.14);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.12);
    transform: translateY(-1px);
}

.fmg-task-pill__icon {
    font-size: 12px;
}

.fmg-task-pill__label {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fmg-task-pill__dot {
    flex-shrink: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.dark .fmg-task-card {
    background: rgba(30, 41, 59, 0.42);
    border-color: rgba(148, 163, 184, 0.08);
}

.dark .fmg-task-card:hover {
    border-color: rgba(205, 51, 1, 0.32);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dark .fmg-task-card__title,
.dark .fmg-day-num {
    color: #e2e8f0;
}

.dark .fmg-task-pill--overdue {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.22);
    color: #fca5a5;
}

.dark .fmg-tasks-view-btn {
    border-color: rgba(148, 163, 184, 0.12);
    background: rgba(148, 163, 184, 0.06);
    color: #94a3b8;
}

.dark .fmg-tasks-view-btn:hover {
    border-color: rgba(205, 51, 1, 0.22);
    background: rgba(205, 51, 1, 0.08);
    color: #f36b45;
}

@media (max-width: 760px) {
    .fmg-tasks-calendar__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .fmg-tasks-calendar__summary {
        justify-content: flex-start;
        width: 100%;
    }

    .fmg-tasks-calendar__grid {
        grid-template-columns: 1fr;
    }

    .fmg-day-col {
        border-right: 0;
    }
}

/* --- Pipeline Tracker --- */
.fmg-pipeline-widget {
    overflow: hidden;
}

.fmg-pipeline-widget__header {
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.fmg-pipeline-widget__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.6rem;
}

.fmg-pipeline-widget__count,
.fmg-pipeline-widget__value {
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
}

.fmg-pipeline-widget__count {
    color: var(--fmg-text-muted);
}

.fmg-pipeline-widget__value {
    color: #059669;
}

.fmg-pipeline-widget__board {
    display: flex;
    gap: 0.75rem;
    min-height: 210px;
    overflow-x: auto;
    padding: 1rem;
}

.fmg-pipeline-stage {
    display: flex;
    flex: 1 0 180px;
    min-width: 180px;
    flex-direction: column;
}

.fmg-pipeline-stage__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.62rem;
    border: 1px solid color-mix(in srgb, var(--stage-color) 18%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--stage-color) 8%, transparent);
}

.fmg-pipeline-stage__dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--stage-color);
}

.fmg-pipeline-stage__label {
    overflow: hidden;
    color: var(--stage-color);
    font-size: 0.74rem;
    font-weight: 750;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fmg-pipeline-stage__count {
    margin-left: auto;
    padding: 0.12rem 0.4rem;
    border-radius: 8px;
    background: color-mix(in srgb, var(--stage-color) 12%, transparent);
    color: var(--stage-color);
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1.2;
}

.fmg-pipeline-stage__list {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.38rem;
}

.fmg-pipeline-card {
    display: block;
    min-width: 0;
    padding: 0.65rem;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 8px;
    background: var(--fmg-card);
    color: inherit;
    text-decoration: none;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.fmg-pipeline-card:hover {
    border-color: rgba(205, 51, 1, 0.3);
    box-shadow: 0 2px 8px rgba(205, 51, 1, 0.08);
    transform: translateY(-1px);
}

.fmg-pipeline-card__row,
.fmg-pipeline-card__footer {
    display: flex;
    align-items: center;
    min-width: 0;
}

.fmg-pipeline-card__row {
    gap: 0.38rem;
    margin-bottom: 0.25rem;
}

.fmg-pipeline-card__footer {
    gap: 0.5rem;
}

.fmg-pipeline-card__priority {
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.fmg-pipeline-card__account-logo {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    object-fit: contain;
}

.fmg-pipeline-card__account-name,
.fmg-pipeline-card__title,
.fmg-pipeline-card__next-action {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fmg-pipeline-card__account-name {
    color: var(--fmg-text);
    font-size: 0.8rem;
    font-weight: 700;
}

.fmg-pipeline-card__title {
    margin-bottom: 0.25rem;
    color: var(--fmg-text-secondary);
    font-size: 0.7rem;
    line-height: 1.35;
}

.fmg-pipeline-card__value {
    color: #059669;
    font-size: 0.7rem;
    font-weight: 750;
}

.fmg-pipeline-card__supplier-logo {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-left: auto;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 50%;
    background: #ffffff;
    object-fit: contain;
}

.fmg-pipeline-card__next-action {
    margin-top: 0.25rem;
    color: #d97706;
    font-size: 0.65rem;
    font-weight: 650;
}

.fmg-pipeline-stage__empty,
.fmg-pipeline-widget__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fmg-text-muted);
    font-size: 0.78rem;
}

.fmg-pipeline-stage__empty {
    flex: 1;
    min-height: 64px;
    border: 1px dashed rgba(148, 163, 184, 0.24);
    border-radius: 8px;
}

.fmg-pipeline-widget__empty {
    min-height: 110px;
    padding: 2rem;
}

.dark .fmg-pipeline-card {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(148, 163, 184, 0.1);
}

.dark .fmg-pipeline-card:hover {
    border-color: rgba(205, 51, 1, 0.4);
    box-shadow: 0 2px 8px rgba(205, 51, 1, 0.15);
}

@media (max-width: 760px) {
    .fmg-pipeline-widget__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .fmg-pipeline-widget__meta {
        justify-content: flex-start;
    }
}

/* --- Hiring Signals Carousel --- */
.fmg-hiring-signals {
    overflow: hidden;
}

.fmg-hiring-signals__header {
    gap: 0.75rem;
    padding: 0.85rem 1rem;
}

.fmg-hiring-signals__title-group,
.fmg-hiring-signals__nav,
.fmg-hiring-signals__account-identity {
    display: flex;
    align-items: center;
    min-width: 0;
}

.fmg-hiring-signals__title-group {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.fmg-hiring-signals__title-group > .material-symbols-outlined {
    color: var(--fmg-text-secondary);
    font-size: 18px;
}

.fmg-hiring-signals__title {
    color: var(--fmg-text);
    font-size: 0.88rem;
    font-weight: 750;
}

.fmg-hiring-signals__badge,
.fmg-hiring-signals__pipeline-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.55rem;
    padding: 0.18rem 0.5rem;
    border-radius: 8px;
    font-size: 0.68rem;
    font-weight: 750;
    line-height: 1;
    white-space: nowrap;
}

.fmg-hiring-signals__badge {
    border: 1px solid rgba(205, 51, 1, 0.14);
    background: rgba(205, 51, 1, 0.08);
    color: var(--fmg-primary);
}

.fmg-hiring-signals__pipeline-badge {
    border: 1px solid rgba(15, 118, 110, 0.16);
    background: rgba(15, 118, 110, 0.08);
    color: #0f766e;
}

.fmg-hiring-signals__nav {
    flex-shrink: 0;
    gap: 0.35rem;
}

.jo-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 8px;
    background: var(--fmg-card);
    color: var(--fmg-text-secondary);
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        background-color 0.15s ease,
        color 0.15s ease;
}

.jo-nav-btn:hover {
    border-color: rgba(205, 51, 1, 0.22);
    background: rgba(205, 51, 1, 0.06);
    color: var(--fmg-primary);
}

.jo-nav-btn .material-symbols-outlined {
    font-size: 18px;
}

.fmg-hiring-signals__counter {
    min-width: 3rem;
    color: var(--fmg-text-muted);
    font-size: 0.68rem;
    font-weight: 750;
    text-align: center;
}

.fmg-hiring-signals__slide-body {
    padding: 1rem;
}

.fmg-hiring-signals__account-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
}

.fmg-hiring-signals__account-identity {
    gap: 0.625rem;
}

.fmg-hiring-signals__account-logo {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 0.2rem;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 8px;
    background: #ffffff;
    object-fit: contain;
}

.fmg-hiring-signals__account-copy {
    min-width: 0;
}

.fmg-hiring-signals__account-link {
    display: block;
    overflow: hidden;
    color: var(--fmg-text);
    font-size: 0.92rem;
    font-weight: 750;
    line-height: 1.35;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fmg-hiring-signals__account-link:hover {
    color: var(--fmg-primary);
}

.fmg-hiring-signals__metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.jo-metric {
    flex: 1 1 64px;
    min-width: 64px;
    padding: 0.52rem 0.62rem;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 8px;
    background: rgba(148, 163, 184, 0.06);
    text-align: center;
}

.jo-metric-val {
    color: var(--fmg-text);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
}

.jo-metric-val--accent {
    color: var(--fmg-primary);
}

.jo-metric-lbl {
    margin-top: 0.1rem;
    color: var(--fmg-text-muted);
    font-size: 0.62rem;
    font-weight: 650;
    letter-spacing: 0;
    text-transform: none;
}

.fmg-hiring-signals__signals {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.jo-signal {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-size: 0.66rem;
    font-weight: 750;
}

.jo-signal-rapid_growth {
    background: rgba(205, 51, 1, 0.1);
    color: var(--fmg-primary);
}

.jo-signal-eng_hiring {
    background: rgba(15, 118, 110, 0.1);
    color: #0f766e;
}

.jo-signal-prod_expansion {
    background: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
}

.jo-signal-hiring_surge {
    background: rgba(217, 119, 6, 0.1);
    color: #d97706;
}

.jo-signal-no_pipeline {
    border: 1px dashed rgba(220, 38, 38, 0.25);
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
}

.jo-expand-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 8px;
    background: rgba(148, 163, 184, 0.05);
    color: var(--fmg-text-secondary);
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        background-color 0.15s ease,
        color 0.15s ease;
}

.jo-expand-btn:hover {
    background: rgba(148, 163, 184, 0.1);
    color: var(--fmg-text);
}

.jo-expand-btn__label {
    font-size: 0.72rem;
    font-weight: 750;
}

.jo-arrow {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.jo-arrow-up {
    transform: rotate(180deg);
}

.jo-roles-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.jo-roles-list.jo-open {
    max-height: 600px;
    overflow-y: auto;
}

.jo-role-row {
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.jo-role-row:last-child {
    border-bottom: 0;
}

.jo-role-row__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.jo-role-row__title-wrap {
    min-width: 0;
}

.jo-role-row__link,
.jo-role-row__title {
    color: var(--fmg-text);
    font-size: 0.8rem;
    font-weight: 650;
    line-height: 1.35;
    text-decoration: none;
}

.jo-role-row__link:hover {
    color: var(--fmg-primary);
}

.jo-role-row__date,
.jo-role-row__meta {
    color: var(--fmg-text-muted);
    font-size: 0.67rem;
    line-height: 1.35;
}

.jo-role-row__date {
    flex-shrink: 0;
    white-space: nowrap;
}

.jo-role-row__meta {
    margin-top: 0.15rem;
}

.dark .jo-nav-btn {
    border-color: rgba(148, 163, 184, 0.12);
    background: rgba(15, 23, 42, 0.4);
    color: #94a3b8;
}

.dark .jo-metric {
    background: rgba(15, 23, 42, 0.3);
    border-color: rgba(148, 163, 184, 0.08);
}

.dark .jo-expand-btn {
    border-color: rgba(148, 163, 184, 0.08);
    background: rgba(15, 23, 42, 0.2);
}

@media (max-width: 720px) {
    .fmg-hiring-signals__header,
    .fmg-hiring-signals__account-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .fmg-hiring-signals__nav {
        width: 100%;
    }

    .fmg-hiring-signals__counter {
        flex: 1;
    }

    .fmg-hiring-signals__pipeline-badge {
        white-space: normal;
    }
}

/* --- Weekly Study Deck --- */
.fmg-weekly-study {
    overflow: hidden;
}

.fmg-weekly-study__header {
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.fmg-weekly-study__week {
    color: var(--fmg-text-muted);
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1.35;
    white-space: nowrap;
}

.fmg-weekly-study__body {
    padding: 0.75rem;
}

.fmg-study-deck {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    width: 100%;
    min-height: 380px;
    overflow: hidden;
}

.fmg-study-card {
    position: relative;
    display: flex;
    flex: 0 0 52px;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    background: var(--fmg-card);
    cursor: pointer;
    transition:
        flex 0.28s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.fmg-study-card:hover:not(.is-active) {
    border-color: rgba(148, 163, 184, 0.38);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.fmg-study-card.is-active {
    flex: 1;
    border-color: rgba(205, 51, 1, 0.55);
    box-shadow: 0 2px 10px rgba(205, 51, 1, 0.08);
    cursor: default;
}

.fmg-study-tab {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 0.55rem;
    height: 100%;
    padding: 0.8rem 0.3rem;
}

.fmg-study-card.is-active .fmg-study-tab {
    display: none;
}

.fmg-study-tab-check {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
    border: 1px solid rgba(148, 163, 184, 0.42);
    border-radius: 6px;
    background: var(--fmg-card);
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        background-color 0.15s ease;
}

.fmg-study-tab-check.is-done {
    border-color: var(--fmg-primary);
    background: var(--fmg-primary);
}

.fmg-study-check-icon {
    color: #ffffff;
    font-size: 0.72rem;
    line-height: 1;
}

.fmg-study-tab-day,
.fmg-study-tab-cat {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
}

.fmg-study-tab-day {
    color: var(--fmg-text-muted);
    font-size: 0.62rem;
    font-weight: 750;
}

.fmg-study-tab-cat {
    color: var(--fmg-primary);
    font-size: 0.6rem;
    font-weight: 650;
    line-height: 1.3;
    text-align: center;
}

.fmg-study-content {
    display: none;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    padding: 1rem 1.1rem;
}

.fmg-study-card.is-active .fmg-study-content {
    display: flex;
}

.fmg-study-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
}

.fmg-study-badge-day,
.fmg-study-badge-cat {
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.4;
}

.fmg-study-badge-day {
    background: rgba(148, 163, 184, 0.1);
    color: var(--fmg-text-muted);
}

.fmg-study-badge-cat {
    background: rgba(205, 51, 1, 0.08);
    color: var(--fmg-primary);
}

.fmg-study-main-title {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--fmg-text);
    font-size: 0.88rem;
    font-weight: 750;
    line-height: 1.4;
    text-decoration: none;
}

.fmg-study-main-title:hover {
    color: var(--fmg-primary);
    text-decoration: underline;
}

.fmg-study-main-title--static,
.fmg-study-main-title--static:hover {
    color: var(--fmg-text);
    cursor: default;
    text-decoration: none;
}

.fmg-study-summary {
    flex-shrink: 0;
    margin-bottom: 0.5rem;
    color: var(--fmg-text-secondary);
    font-size: 0.78rem;
    line-height: 1.55;
}

.fmg-study-meta {
    margin-bottom: 0.7rem;
    color: var(--fmg-text-muted);
    font-size: 0.65rem;
}

.fmg-study-feedback-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
}

.fmg-study-feedback-label {
    color: var(--fmg-text-muted);
    font-size: 0.65rem;
}

.fmg-study-feedback {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.25rem;
}

.fmg-study-fb-btn {
    display: flex;
    align-items: center;
    padding: 0.15rem 0.25rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 6px;
    background: transparent;
    color: var(--fmg-text-muted);
    cursor: pointer;
    line-height: 1;
    transition:
        border-color 0.15s ease,
        background-color 0.15s ease,
        color 0.15s ease;
}

.fmg-study-fb-btn:hover {
    border-color: rgba(148, 163, 184, 0.5);
    color: var(--fmg-text-secondary);
}

.fmg-study-fb-btn.active-up {
    border-color: rgba(22, 163, 74, 0.42);
    background: rgba(22, 163, 74, 0.1);
    color: #16a34a;
}

.fmg-study-fb-btn.active-down {
    border-color: rgba(220, 38, 38, 0.42);
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

.fmg-study-fb-btn .material-symbols-outlined {
    font-size: 0.85rem;
}

.fmg-study-links-heading {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0.7rem 0 0.35rem;
    color: var(--fmg-text-muted);
    font-size: 0.65rem;
    font-weight: 750;
}

.fmg-study-links-heading__icon {
    font-size: 0.75rem;
}

.fmg-study-link-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.fmg-study-link-row:last-child {
    border-bottom: 0;
}

.fmg-study-link-a {
    flex: 1;
    min-width: 0;
    color: #1d4ed8;
    font-size: 0.76rem;
    line-height: 1.35;
    text-decoration: none;
}

.fmg-study-link-a:hover {
    color: var(--fmg-primary);
    text-decoration: underline;
}

.fmg-study-done-btn {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 0.35rem;
    margin-top: auto;
    padding: 0.38rem 0.7rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    background: var(--fmg-card);
    color: var(--fmg-text-muted);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
    transition:
        border-color 0.15s ease,
        background-color 0.15s ease,
        color 0.15s ease;
}

.fmg-study-done-btn:hover {
    border-color: rgba(205, 51, 1, 0.42);
    color: var(--fmg-primary);
}

.fmg-study-done-btn.is-done {
    border-color: var(--fmg-primary);
    background: var(--fmg-primary);
    color: #ffffff;
}

.fmg-study-done-btn .material-symbols-outlined {
    font-size: 0.9rem;
}

.fmg-weekly-study__empty {
    margin: 0;
    padding: 0.5rem 0;
    color: var(--fmg-text-muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.dark .fmg-study-card,
.dark .fmg-study-tab-check,
.dark .fmg-study-done-btn {
    background: rgba(30, 41, 59, 0.42);
}

.dark .fmg-study-link-a {
    color: #93c5fd;
}

@media (max-width: 760px) {
    .fmg-weekly-study__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .fmg-study-deck {
        flex-direction: column;
        min-height: 0;
    }

    .fmg-study-card,
    .fmg-study-card.is-active {
        flex: 0 0 auto;
    }

    .fmg-study-tab,
    .fmg-study-card.is-active .fmg-study-tab {
        display: grid;
        grid-template-columns: auto auto minmax(0, 1fr);
        align-items: center;
        height: auto;
        padding: 0.65rem;
    }

    .fmg-study-tab-day,
    .fmg-study-tab-cat {
        writing-mode: horizontal-tb;
        transform: none;
        white-space: normal;
    }

    .fmg-study-card.is-active .fmg-study-content {
        display: flex;
    }
}

/* --- Welcome Banner --- */
.fmg-welcome-banner {
    position: relative;
    padding: 1rem;
    color: var(--fmg-text);
    margin-bottom: 1.5rem;
}

.fmg-welcome-banner h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
    position: relative;
    z-index: 1;
}

.fmg-welcome-banner p {
    font-size: 0.86rem;
    color: var(--fmg-text-secondary);
    margin: 0;
    position: relative;
    z-index: 1;
}

.fmg-welcome-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0;
    position: relative;
    z-index: 1;
}

.fmg-welcome-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.8rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--fmg-transition);
    cursor: pointer;
    border: none;
}

.fmg-welcome-btn--primary {
    background: var(--fmg-primary);
    color: #ffffff;
}

.fmg-welcome-btn--primary:hover {
    background: var(--fmg-primary-dark);
}

.fmg-welcome-btn--secondary {
    background: var(--fmg-surface);
    color: var(--fmg-text);
    border: 1px solid var(--fmg-card-border);
}

.fmg-welcome-btn--secondary:hover {
    background: var(--fmg-surface-alt);
}

/* --- Chart Container Enhancement --- */
.fmg-chart-container {
    position: relative;
    padding: 1rem 1rem 0.5rem;
}

.fmg-chart-container canvas {
    border-radius: 8px;
}

/* --- Status Badge System --- */
.fmg-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.fmg-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.fmg-status--active { background: var(--fmg-success-bg); color: #059669; }
.fmg-status--active::before { background: var(--fmg-success); }
.fmg-status--pending { background: var(--fmg-warning-bg); color: #d97706; }
.fmg-status--pending::before { background: var(--fmg-warning); }
.fmg-status--info { background: var(--fmg-info-bg); color: #2563eb; }
.fmg-status--info::before { background: var(--fmg-info); }
.fmg-status--danger { background: var(--fmg-danger-bg); color: #dc2626; }
.fmg-status--danger::before { background: var(--fmg-danger); }

/* --- Enhanced Table Styles --- */
.fmg-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.fmg-table thead th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fmg-text-muted);
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--fmg-card-border);
    text-align: left;
}

.fmg-table tbody tr {
    transition: var(--fmg-transition);
}

.fmg-table tbody tr:hover {
    background: var(--fmg-surface-alt);
}

.fmg-table tbody td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--fmg-card-border);
    font-size: 0.875rem;
    color: var(--fmg-text);
}

.fmg-table tbody td:first-child {
    font-weight: 500;
}

/* --- Quick Action Cards --- */
.fmg-quick-action {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--fmg-card);
    border: 1px solid var(--fmg-card-border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--fmg-text);
    transition: var(--fmg-transition);
    cursor: pointer;
}

.fmg-quick-action:hover {
    border-color: var(--fmg-primary);
    box-shadow: 0 0 0 1px var(--fmg-primary), var(--fmg-card-shadow);
    transform: translateY(-1px);
    color: var(--fmg-text);
}

.fmg-quick-action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(205, 51, 1, 0.06);
    color: var(--fmg-primary);
    flex-shrink: 0;
}

.dark .fmg-quick-action-icon {
    background: rgba(205, 51, 1, 0.12);
}

.fmg-quick-action-text {
    font-size: 0.875rem;
    font-weight: 600;
}

.fmg-quick-action-desc {
    font-size: 0.75rem;
    color: var(--fmg-text-muted);
    margin-top: 0.125rem;
}

/* --- Section Divider --- */
.fmg-section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--fmg-text);
    margin: 2rem 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--fmg-card-border);
}

.fmg-section-title .material-symbols-outlined {
    color: var(--fmg-primary);
    font-size: 24px;
}

/* --- Activity Feed --- */
.fmg-activity-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--fmg-card-border);
}

.fmg-activity-item:last-child {
    border-bottom: none;
}

.fmg-activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 0.375rem;
    flex-shrink: 0;
}

.fmg-activity-dot--primary { background: var(--fmg-primary); }
.fmg-activity-dot--success { background: var(--fmg-success); }
.fmg-activity-dot--warning { background: var(--fmg-warning); }
.fmg-activity-dot--info { background: var(--fmg-info); }

.fmg-activity-text {
    font-size: 0.875rem;
    color: var(--fmg-text);
    line-height: 1.5;
}

.fmg-activity-time {
    font-size: 0.75rem;
    color: var(--fmg-text-muted);
    margin-top: 0.25rem;
}

/* --- Global Overrides for Unfold --- */

/* Better breadcrumbs */
#container .breadcrumbs {
    font-family: var(--fmg-font) !important;
}

/* Softer focus rings — let Unfold/Tailwind handle per-component focus styles */
*:focus-visible {
    outline: 2px solid var(--color-base-400) !important;
    outline-offset: 2px !important;
}
/* Suppress outline on all search/text inputs and their wrappers */
#changelist-search *:focus-visible,
input[type="search"]:focus-visible,
input[type="text"]:focus-visible,
input[type="search"]:focus,
input[type="text"]:focus,
.map-search input:focus-visible,
.map-search input:focus,
.map-search__input-wrap:focus-visible,
.map-search__input-wrap:focus {
    outline: none !important;
}

/* Improved scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--fmg-text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--fmg-text-secondary);
}

/* Fix action dropdown text */
.actions select {
    color: #111827 !important;
    background-color: #ffffff !important;
    border: 1px solid #d1d5db !important;
}

.dark .actions select {
    color: #f9fafb !important;
    background-color: #1f2937 !important;
    border: 1px solid #374151 !important;
}

.dark .actions select option {
    background-color: #1f2937;
    color: #f9fafb;
}

/* Unfold bulk action row: align action dropdown, extra fields, and Run button */
#changelist-actions .group.primary {
    align-items: center;
    flex-wrap: wrap;
    row-gap: 0.5rem;
}

/* Hide legacy import/export buttons from CRM object-tools (Unfold moves these to header) */
.object-tools a.import_link,
.object-tools a.export_link,
.object-tools .import_link,
.object-tools .export_link,
.object-tools a[href^="/import-"],
.object-tools a[href^="/import_"],
.object-tools a[href^="/export-"],
.object-tools a[href^="/export_"],
.object-tools a[href*="massmail"],
.object-tools a[href*="make_massmail"] {
    display: none !important;
}

/* --- Dropzone Component --- */
.fmg-dropzone {
    position: relative;
    border: 2px dashed var(--fmg-card-border);
    border-radius: var(--fmg-card-radius);
    padding: 3rem 2rem;
    text-align: center;
    transition: var(--fmg-transition);
    background: var(--fmg-surface-alt);
    cursor: pointer;
}

.fmg-dropzone:hover,
.fmg-dropzone--active {
    border-color: var(--fmg-primary);
    background: rgba(205, 51, 1, 0.02);
}

.dark .fmg-dropzone:hover,
.dark .fmg-dropzone--active {
    background: rgba(205, 51, 1, 0.05);
}

.fmg-dropzone input[type="file"] {
    display: none;
}

.fmg-dropzone-icon {
    font-size: 48px;
    color: var(--fmg-text-muted);
    margin-bottom: 1rem;
    transition: var(--fmg-transition);
}

.fmg-dropzone:hover .fmg-dropzone-icon {
    color: var(--fmg-primary);
    transform: translateY(-4px);
}

.fmg-dropzone-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--fmg-text);
    margin-bottom: 0.375rem;
}

.fmg-dropzone-hint {
    font-size: 0.8125rem;
    color: var(--fmg-text-muted);
}

.fmg-dropzone-browse {
    color: var(--fmg-primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --- File List Item --- */
.fmg-file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--fmg-card);
    border: 1px solid var(--fmg-card-border);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    animation: fmg-fade-in 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.fmg-file-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--fmg-info-bg);
    color: var(--fmg-info);
    flex-shrink: 0;
}

.fmg-file-item-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--fmg-text);
}

.fmg-file-item-size {
    font-size: 0.75rem;
    color: var(--fmg-text-muted);
}

/* --- Info Box --- */
.fmg-info-box {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--fmg-info-bg);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.dark .fmg-info-box {
    background: rgba(59, 130, 246, 0.06);
    border-color: rgba(59, 130, 246, 0.12);
}

.fmg-info-box-icon {
    display: flex;
    align-items: flex-start;
    padding-top: 0.125rem;
    color: var(--fmg-info);
    flex-shrink: 0;
}

.fmg-info-box-content h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--fmg-text);
    margin-bottom: 0.5rem;
}

.fmg-info-box-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.fmg-info-box-content li {
    position: relative;
    padding-left: 1.25rem;
    font-size: 0.8125rem;
    color: var(--fmg-text-secondary);
    margin-bottom: 0.375rem;
    line-height: 1.5;
}

.fmg-info-box-content li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--fmg-info);
}

/* --- Form Enhancements --- */
.fmg-form-group {
    margin-bottom: 1.5rem;
}

.fmg-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--fmg-text);
    margin-bottom: 0.5rem;
}

.fmg-form-help {
    font-size: 0.8125rem;
    color: var(--fmg-text-muted);
    margin-top: 0.375rem;
}

.fmg-form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--fmg-card-border);
    border-radius: 10px;
    font-size: 0.9375rem;
    color: var(--fmg-text);
    background: var(--fmg-card);
    transition: var(--fmg-transition);
    font-family: var(--fmg-font);
}

.fmg-form-input:focus {
    outline: none;
    border-color: var(--fmg-primary);
    box-shadow: 0 0 0 3px rgba(205, 51, 1, 0.08);
}

/* --- Primary Button --- */
.fmg-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--fmg-primary), var(--fmg-primary-light));
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--fmg-transition);
    font-family: var(--fmg-font);
    box-shadow: 0 2px 8px rgba(205, 51, 1, 0.25);
}

.fmg-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(205, 51, 1, 0.35);
}

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

.fmg-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--fmg-card);
    color: var(--fmg-text);
    border: 1px solid var(--fmg-card-border);
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--fmg-transition);
    font-family: var(--fmg-font);
    text-decoration: none;
}

.fmg-btn-secondary:hover {
    background: var(--fmg-surface-alt);
    border-color: var(--fmg-text-muted);
    color: var(--fmg-text);
}

/* --- Search Page Enhancements --- */
.fmg-search-hero {
    text-align: center;
    padding: 2.5rem 0 1.5rem;
}

.fmg-search-hero h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--fmg-text);
    margin-bottom: 0.5rem;
}

.fmg-search-hero p {
    font-size: 1rem;
    color: var(--fmg-text-secondary);
}

.fmg-search-input-wrap {
    position: relative;
    max-width: 720px;
    margin: 1.5rem auto 0;
}

.fmg-search-input-wrap .search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--fmg-text-muted);
    font-size: 24px;
    pointer-events: none;
}

.fmg-search-input-wrap input {
    width: 100%;
    padding: 1rem 1.25rem 1rem 3.5rem;
    border: 2px solid var(--fmg-card-border);
    border-radius: var(--fmg-card-radius);
    font-size: 1.0625rem;
    color: var(--fmg-text);
    background: var(--fmg-card);
    box-shadow: var(--fmg-card-shadow);
    transition: var(--fmg-transition);
    font-family: var(--fmg-font);
}

.fmg-search-input-wrap input:focus {
    outline: none;
    border-color: var(--fmg-primary);
    box-shadow: 0 0 0 4px rgba(205, 51, 1, 0.08), var(--fmg-card-shadow-hover);
}

.fmg-search-input-wrap input::placeholder {
    color: var(--fmg-text-muted);
}

/* Search result card */
.fmg-search-result {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.125rem 1.25rem;
    background: var(--fmg-card);
    border: 1px solid var(--fmg-card-border);
    border-radius: 12px;
    transition: var(--fmg-transition);
    text-decoration: none;
    color: inherit;
    border-left: 3px solid transparent;
}

.fmg-search-result:hover {
    border-color: var(--fmg-card-border);
    border-left-color: var(--fmg-primary);
    box-shadow: var(--fmg-card-shadow-hover);
    transform: translateX(2px);
    color: inherit;
}

.fmg-search-result--customer { border-left-color: var(--fmg-info); }
.fmg-search-result--supplier { border-left-color: var(--fmg-success); }
.fmg-search-result--order { border-left-color: var(--fmg-warning); }
.fmg-search-result--part { border-left-color: #8b5cf6; }
.fmg-search-result--contact { border-left-color: #ec4899; }

.fmg-search-result:hover.fmg-search-result--customer { border-left-color: var(--fmg-info); }
.fmg-search-result:hover.fmg-search-result--supplier { border-left-color: var(--fmg-success); }
.fmg-search-result:hover.fmg-search-result--order { border-left-color: var(--fmg-warning); }
.fmg-search-result:hover.fmg-search-result--part { border-left-color: #8b5cf6; }
.fmg-search-result:hover.fmg-search-result--contact { border-left-color: #ec4899; }

/* Example query chips */
.fmg-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: var(--fmg-card);
    border: 1px solid var(--fmg-card-border);
    border-radius: 999px;
    font-size: 0.8125rem;
    color: var(--fmg-text);
    cursor: pointer;
    transition: var(--fmg-transition);
    font-family: var(--fmg-font);
}

.fmg-chip:hover {
    border-color: var(--fmg-primary);
    color: var(--fmg-primary);
    background: rgba(205, 51, 1, 0.02);
}

/* --- Shared FMG App Wordmark --- */
.fmg-app-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
    color: #0a0a0a;
    text-decoration: none;
}

.fmg-app-logo__image {
    display: block;
    width: 38px;
    height: auto;
    max-height: 30px;
    border-radius: 7px;
    object-fit: contain;
    box-shadow: 0 6px 14px rgba(124, 18, 0, 0.14);
}

.fmg-app-logo__glyph {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(145deg, #111111 0%, #000000 100%);
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.fmg-app-logo__glyph::before {
    content: "F";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -54%);
    font-family: var(--base-display, "Uber Move", "Inter", system-ui, -apple-system, sans-serif);
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.fmg-app-logo__glyph::after {
    content: "";
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #cd3301;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14);
}

.fmg-app-logo__wordmark {
    display: inline-flex;
    flex-direction: column;
    min-width: 0;
}

.fmg-app-logo__title {
    font-family: var(--base-display, "Uber Move", "Inter", system-ui, -apple-system, sans-serif);
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    color: #0a0a0a;
}

.fmg-app-logo__subtitle {
    margin-top: 0.2rem;
    font-family: var(--fmg-font, "Inter", system-ui, -apple-system, sans-serif);
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #6b7280;
}

.fmg-nav-logo {
    display: inline-flex;
    align-items: center;
    transition: var(--fmg-transition);
}

.dark .fmg-app-logo__title {
    color: #f8fafc;
}

.dark .fmg-app-logo__subtitle {
    color: #94a3b8;
}

/* --- Utility: Gradient Text --- */
.fmg-gradient-text {
    background: linear-gradient(135deg, var(--fmg-primary), var(--fmg-primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Utility: Skeleton Loading --- */
.fmg-skeleton {
    background: linear-gradient(90deg, var(--fmg-surface-alt) 25%, var(--fmg-card-border) 50%, var(--fmg-surface-alt) 75%);
    background-size: 200% 100%;
    animation: fmg-shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

/* --- Empty State --- */
.fmg-empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.fmg-empty-state .material-symbols-outlined {
    font-size: 56px;
    color: var(--fmg-text-muted);
    opacity: 0.4;
    margin-bottom: 1rem;
}

.fmg-empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--fmg-text);
    margin-bottom: 0.5rem;
}

.fmg-empty-state p {
    font-size: 0.9375rem;
    color: var(--fmg-text-muted);
}

/* --- Responsive Grid Helpers --- */
.fmg-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.fmg-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.fmg-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

@media (max-width: 1024px) {
    .fmg-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .fmg-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .fmg-grid-4,
    .fmg-grid-3,
    .fmg-grid-2 { grid-template-columns: 1fr; }
}

/* =============================================================================
   UNFOLD SIDEBAR - Smaller Text Size (Matching Live Preview)
   ============================================================================= */

/* Main sidebar navigation items - smaller text like the live preview */
.unfold-sidebar nav a,
.unfold-sidebar .nav-link,
.unfold-sidebar [role="menuitem"],
aside nav a,
aside .nav-link,
.sidebar nav a,
.sidebar .nav-link,
[data-testid="sidebar"] nav a,
[data-testid="sidebar"] .nav-link {
    font-size: 0.8125rem !important; /* 13px */
    line-height: 1.25rem !important;
}

/* Sidebar section/group titles */
.unfold-sidebar .nav-group-title,
.unfold-sidebar .section-title,
.unfold-sidebar [role="group"] > [role="heading"],
aside .nav-group-title,
aside .section-title,
.sidebar .nav-group-title,
.sidebar .section-title,
[data-testid="sidebar"] .nav-group-title,
[data-testid="sidebar"] .section-title {
    font-size: 0.6875rem !important; /* 11px - smaller for section titles */
    line-height: 1rem !important;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Search input in sidebar */
.unfold-sidebar input[type="search"],
.unfold-sidebar input[type="text"],
aside input[type="search"],
.sidebar input[type="search"],
[data-testid="sidebar"] input[type="search"] {
    font-size: 0.8125rem !important;
}

/* All applications button at bottom of sidebar */
.unfold-sidebar .show-all-applications,
.unfold-sidebar [data-testid="all-applications-button"],
.unfold-sidebar button[aria-label*="applications"],
aside .show-all-applications,
.sidebar .show-all-applications,
[data-testid="sidebar"] .show-all-applications {
    font-size: 0.75rem !important; /* 12px */
    font-weight: 500;
}

/* Icon sizing to match smaller text */
.unfold-sidebar .material-symbols-outlined,
.unfold-sidebar .nav-icon,
aside .material-symbols-outlined,
aside .nav-icon,
.sidebar .material-symbols-outlined,
.sidebar .nav-icon,
[data-testid="sidebar"] .material-symbols-outlined,
[data-testid="sidebar"] .nav-icon {
    font-size: 1.125rem !important; /* 18px - slightly smaller to match */
}

/* Keep sidebar account/theme dropdowns above surrounding admin content */
aside.unfold-sidebar [role="menu"],
.unfold-sidebar [role="menu"],
.sidebar [role="menu"],
[data-testid="sidebar"] [role="menu"] {
    z-index: 1200 !important;
    pointer-events: auto !important;
}

/* =============================================================================
   MOBILE RESPONSIVE STYLES - Comprehensive Mobile Optimization
   ============================================================================= */

/* Base mobile viewport settings */
@media (max-width: 768px) {
    /* Container adjustments */
    #container {
        padding: 0.5rem !important;
        min-width: 320px;
    }
    
    /* Header mobile optimization */
    #header {
        padding: 0.75rem 1rem !important;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    #branding {
        flex: 1;
        min-width: 0;
    }
    
    #user-tools {
        width: 100%;
        justify-content: flex-end;
        padding-top: 0.5rem;
        border-top: 1px solid var(--fmg-card-border);
        margin-top: 0.5rem;
    }
    
    /* Breadcrumbs mobile */
    .breadcrumbs {
        padding: 0.75rem 1rem !important;
        font-size: 0.75rem !important;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Content area */
    #content {
        padding: 1rem !important;
    }
    
    #content-main {
        width: 100% !important;
        float: none !important;
    }
    
    /* Object tools (action buttons) */
    .object-tools {
        float: none !important;
        margin: 0 0 1rem 0 !important;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .object-tools li {
        float: none !important;
        margin: 0 !important;
    }
    
    .object-tools a {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.8125rem !important;
    }
    
    /* Page title */
    #content h1 {
        font-size: 1.25rem !important;
        margin-bottom: 1rem !important;
        word-wrap: break-word;
    }
}

/* Sidebar mobile behavior */
@media (max-width: 1024px) {
    /* Make sidebar overlay on mobile */
    aside.unfold-sidebar,
    .unfold-sidebar,
    .sidebar {
        position: fixed !important;
        left: 0;
        top: 0;
        height: 100vh !important;
        z-index: 1000 !important;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        width: 260px !important;
        max-width: 85vw !important;
    }
    
    /* Sidebar open state */
    aside.unfold-sidebar.is-open,
    .unfold-sidebar.is-open,
    .sidebar.is-open,
    body.sidebar-open aside.unfold-sidebar,
    body.sidebar-open .unfold-sidebar,
    body.sidebar-open .sidebar {
        transform: translateX(0);
    }
    
    /* Overlay backdrop */
    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    body.sidebar-open .sidebar-backdrop {
        display: block;
    }
    
    /* Mobile menu toggle button */
    .sidebar-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: none;
        background: var(--fmg-card);
        color: var(--fmg-text);
        border-radius: 8px;
        cursor: pointer;
        margin-right: 0.75rem;
    }
    
    .sidebar-toggle .material-symbols-outlined {
        font-size: 24px !important;
    }
    
    /* Adjust main content when sidebar is hidden */
    body:not(.sidebar-open) #content {
        margin-left: 0 !important;
    }
}

@media (min-width: 1025px) {
    .sidebar-toggle {
        display: none !important;
    }
}

/* Table mobile optimization */
@media (max-width: 768px) {
    /* Make tables horizontally scrollable */
    .results,
    #changelist-form,
    .change-list .results {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    
    #result_list,
    .results table {
        min-width: 600px;
        font-size: 0.8125rem !important;
    }
    
    /* Table cells */
    #result_list th,
    #result_list td,
    .results th,
    .results td {
        padding: 0.625rem 0.5rem !important;
        white-space: nowrap;
    }
    
    /* Hide less important columns on mobile */
    #result_list th:nth-child(n+6),
    #result_list td:nth-child(n+6) {
        display: none;
    }
    
    /* Action checkbox */
    .action-checkbox-column {
        width: 30px !important;
    }
    
    /* Changelist actions */
    .changelist-actions {
        flex-direction: column !important;
        gap: 0.75rem;
    }
    
    .changelist-actions label {
        width: 100%;
    }
    
    .changelist-actions select {
        width: 100% !important;
        max-width: none !important;
    }
    
    /* Pagination */
    .paginator {
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }
    
    .paginator a,
    .paginator span {
        padding: 0.375rem 0.625rem !important;
        font-size: 0.8125rem !important;
    }
}

/* Form mobile optimization */
@media (max-width: 768px) {
    /* Form rows */
    .form-row {
        padding: 0.75rem !important;
    }
    
    /* Labels */
    .form-row label {
        font-size: 0.8125rem !important;
        margin-bottom: 0.375rem;
        display: block;
    }
    
    /* Input fields */
    .form-row input[type="text"],
    .form-row input[type="email"],
    .form-row input[type="number"],
    .form-row input[type="url"],
    .form-row input[type="tel"],
    .form-row textarea,
    .form-row select {
        width: 100% !important;
        max-width: none !important;
        padding: 0.625rem 0.75rem !important;
        font-size: 16px !important; /* Prevent zoom on iOS */
    }
    
    /* Field help text */
    .help {
        font-size: 0.75rem !important;
        margin-top: 0.375rem;
    }
    
    /* Submit row */
    .submit-row {
        flex-direction: column !important;
        gap: 0.5rem;
        padding: 1rem !important;
    }
    
    .submit-row input,
    .submit-row button,
    .submit-row a {
        width: 100% !important;
        justify-content: center;
    }
    
    /* Fieldsets */
    fieldset {
        margin-bottom: 1rem !important;
    }
    
    fieldset.collapsed {
        padding: 0.5rem 0.75rem !important;
    }
    
    fieldset h2 {
        font-size: 0.9375rem !important;
        padding: 0.625rem 0.75rem !important;
    }
    
    /* Inline forms */
    .inline-related {
        margin-bottom: 1rem !important;
    }
    
    .inline-related h3 {
        font-size: 0.875rem !important;
        padding: 0.625rem 0.75rem !important;
    }
    
    /* Tabular inlines */
    .tabular.inline-related {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    
    .tabular.inline-related table {
        min-width: 500px;
    }
}

/* Dashboard mobile optimization */
@media (max-width: 768px) {
    /* KPI cards */
    .fmg-kpi-card {
        padding: 1rem !important;
    }
    
    .fmg-kpi-value {
        font-size: 1.5rem !important;
    }
    
    .fmg-kpi-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 18px !important;
    }
    
    /* Welcome banner */
    .fmg-welcome-banner {
        padding: 1.5rem !important;
        border-radius: 12px !important;
    }
    
    .fmg-welcome-banner h2 {
        font-size: 1.125rem !important;
    }
    
    .fmg-welcome-banner p {
        font-size: 0.8125rem !important;
    }
    
    .fmg-welcome-actions {
        flex-direction: column !important;
        gap: 0.5rem;
    }
    
    .fmg-welcome-btn {
        width: 100% !important;
        justify-content: center;
    }
    
    /* Chart containers */
    .fmg-chart-container {
        padding: 0.75rem !important;
    }
    
    .fmg-chart-container canvas {
        max-height: 250px !important;
    }
    
    /* Card headers */
    .fmg-card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem;
        padding: 1rem !important;
    }
    
    .fmg-card-header--stack {
        gap: 0.5rem;
    }
    
    .fmg-card-title {
        font-size: 0.875rem !important;
    }
    
    .fmg-chart-toggle {
        width: 100%;
        justify-content: center;
    }
    
    /* Quick actions */
    .fmg-quick-action {
        padding: 0.875rem 1rem !important;
    }
    
    .fmg-quick-action-icon {
        width: 36px !important;
        height: 36px !important;
    }
    
    .fmg-quick-action-text {
        font-size: 0.8125rem !important;
    }
    
    /* Activity feed */
    .fmg-activity-item {
        padding: 0.75rem 0 !important;
    }
    
    .fmg-activity-text {
        font-size: 0.8125rem !important;
    }
    
    /* Section titles */
    .fmg-section-title {
        font-size: 1rem !important;
        margin: 1.5rem 0 0.75rem !important;
        padding-bottom: 0.5rem !important;
    }
    
    /* Search */
    .fmg-search-hero {
        padding: 1.5rem 0 1rem !important;
    }
    
    .fmg-search-hero h1 {
        font-size: 1.375rem !important;
    }
    
    .fmg-search-input-wrap {
        margin-top: 1rem !important;
    }
    
    .fmg-search-input-wrap input {
        padding: 0.875rem 1rem 0.875rem 2.75rem !important;
        font-size: 16px !important; /* Prevent zoom on iOS */
    }
    
    .fmg-search-input-wrap .search-icon {
        left: 0.875rem;
        font-size: 20px;
    }
    
    /* Search results */
    .fmg-search-result {
        padding: 0.875rem 1rem !important;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    #container {
        padding: 0.25rem !important;
    }
    
    #content {
        padding: 0.75rem !important;
    }
    
    /* Stack action buttons */
    .object-tools {
        flex-direction: column;
    }
    
    .object-tools li {
        width: 100%;
    }
    
    .object-tools a {
        display: block;
        text-align: center;
    }
    
    /* Form inputs full width */
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="password"],
    input[type="url"],
    input[type="tel"],
    textarea,
    select {
        font-size: 16px !important; /* Prevent zoom */
    }
    
    /* Smaller KPI values */
    .fmg-kpi-value {
        font-size: 1.25rem !important;
    }
    
    /* Tighter cards */
    .fmg-card {
        border-radius: 10px !important;
    }
    
    .fmg-card-body {
        padding: 1rem !important;
    }
    
    /* Simpler notification panel */
    .fmg-admin-notifications__panel {
        width: calc(100vw - 2rem);
        right: -0.5rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .unfold-sidebar nav a,
    .unfold-sidebar .nav-link,
    aside nav a,
    .sidebar nav a {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
        min-height: 44px;
    }
    
    /* Buttons */
    .button,
    input[type="submit"],
    .submit-row input,
    .object-tools a {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Checkboxes and radios */
    input[type="checkbox"],
    input[type="radio"] {
        width: 20px;
        height: 20px;
    }
    
    /* Form inputs */
    .form-row input,
    .form-row select,
    .form-row textarea {
        min-height: 44px;
    }
    
    /* Table rows */
    #result_list tbody tr {
        min-height: 44px;
    }
    
    #result_list tbody td {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }
    
    /* Quick actions */
    .fmg-quick-action {
        min-height: 60px;
    }
    
    /* KPI cards */
    .fmg-kpi-card {
        min-height: 100px;
    }
    
    /* Remove hover effects on touch devices */
    .fmg-kpi-card:hover,
    .fmg-card:hover,
    .fmg-quick-action:hover {
        transform: none !important;
    }
}

/* =============================================================================
   Import / export (Unfold header + change form) — compact grey like notification-btn
   ============================================================================= */

.object-tools:has(.fmg-import-export-tool-link) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.fmg-import-export-tool {
    list-style: none;
    margin: 0;
}

.fmg-import-export-tool-link {
    display: inline-flex !important;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.625rem !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    line-height: 1.25 !important;
    border-radius: 0.5rem !important;
    background: #f3f4f6 !important;
    color: #6b7280 !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: none !important;
    text-decoration: none !important;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.dark .fmg-import-export-tool-link {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #94a3b8 !important;
    border-color: #334155 !important;
}

.fmg-import-export-tool-link:hover {
    background: #e5e7eb !important;
    color: #374151 !important;
}

.dark .fmg-import-export-tool-link:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
}

.fmg-import-export-tool-link .material-symbols-outlined {
    font-size: 16px;
    line-height: 1;
    opacity: 0.85;
}

.fmg-import-export-form-export {
    display: inline-flex !important;
    align-items: center;
    padding: 0.375rem 0.75rem !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    line-height: 1.25 !important;
    border-radius: 0.5rem !important;
    background: #f3f4f6 !important;
    color: #6b7280 !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: none !important;
    cursor: pointer !important;
    margin-right: 0.5rem !important;
}

.dark .fmg-import-export-form-export {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #94a3b8 !important;
    border-color: #334155 !important;
}

.fmg-import-export-form-export:hover {
    background: #e5e7eb !important;
    color: #374151 !important;
}

/* Print styles */
@media print {
    aside.unfold-sidebar,
    .unfold-sidebar,
    .sidebar,
    .sidebar-toggle,
    .sidebar-backdrop,
    #header,
    .breadcrumbs,
    .object-tools,
    .submit-row {
        display: none !important;
    }
    
    #container {
        padding: 0 !important;
    }
    
    #content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .fmg-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }
}

/* =============================================================================
   DASHBOARD TYPOGRAPHY NORMALIZATION
   Ensures every widget matches the KPI card type scale.
   These rules layer over widget-specific inline styles via specificity.
   ============================================================================= */

/* --- Card/widget section titles --- */
.fmg-card-title,
.fmg-card-header .fmg-card-title {
    font-size: var(--fmg-section-title-size) !important;
    font-weight: var(--fmg-section-title-weight) !important;
    letter-spacing: -0.01em;
    color: var(--fmg-text);
}

.fmg-card-title .material-symbols-outlined {
    font-size: 18px;
    color: var(--fmg-text-secondary);
    flex-shrink: 0;
}

/* --- Section label / uppercase kicker (matches .fmg-kpi-label) --- */
.fmg-card .fmg-label,
[class*="fmg-"][class*="-label"],
[class*="fmg-"][class*="-section"] > div:first-child {
    font-size: var(--fmg-label-size);
    font-weight: var(--fmg-label-weight);
    letter-spacing: var(--fmg-label-spacing);
    text-transform: uppercase;
    color: var(--fmg-text-muted);
}

/* --- Widget body / secondary text --- */
.fmg-card p,
.fmg-card-body,
.fmg-kpi-footer,
.jo-metric-lbl {
    font-size: var(--fmg-text-sm);
    color: var(--fmg-text-secondary);
}

/* --- Stat / metric values inside cards --- */
.fmg-kpi-value,
.jo-metric-val {
    font-size: var(--fmg-text-2xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--fmg-text);
}

.jo-metric-val {
    font-size: var(--fmg-text-lg);   /* smaller inline stats */
}

/* --- Badge text --- */
.fmg-job-badge,
.jo-signal,
.fmg-kpi-badge,
[class*="fmg-"][class*="-badge"] {
    font-size: var(--fmg-text-xs);
    font-weight: var(--fmg-label-weight);
}

/* --- Pipeline & chart section headers --- */
.fmg-pipeline-stage-name,
.fmg-pipeline-label {
    font-size: var(--fmg-text-xs);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* --- News / briefing widget text --- */
.ew-kicker,
.ew-news-meta,
.ew-capture-kicker {
    font-size: var(--fmg-label-size) !important;
    letter-spacing: var(--fmg-label-spacing);
    font-weight: var(--fmg-label-weight);
}

.ew-title {
    font-size: var(--fmg-text-xl) !important;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.ew-news-link {
    font-size: var(--fmg-text-base) !important;
    font-weight: 700;
}

.ew-news-summary,
.ew-subtitle {
    font-size: var(--fmg-text-sm) !important;
}

/* --- Tasks widget --- */
#fmg-tasks-widget .fmg-card-title {
    font-size: var(--fmg-section-title-size) !important;
}

/* --- Job openings carousel --- */
.jo-expand-btn span:first-child {
    font-size: var(--fmg-text-sm);
    font-weight: 700;
}

/* --- Ensure BDO Grotesk applies everywhere in dashboard --- */
#fmg-job-openings-widget,
#fmg-tasks-widget,
.fmg-kpi-card,
.fmg-card,
.fmg-pipeline-card {
    font-family: var(--fmg-font) !important;
}

/* --- Pipeline card: normalize inline-style text --- */
/* Stage header: uppercase label already matches KPI label — bump weight to 700 */
.fmg-card [style*="text-transform: uppercase"][style*="letter-spacing"] {
    font-weight: 700 !important;
    font-family: var(--fmg-font) !important;
}

/* All text inside pipeline opportunity cards */
.fmg-pipeline-card * {
    font-family: var(--fmg-font) !important;
}

/* Company / opportunity name row — keep at sm */
.fmg-pipeline-card > div:first-child span:last-child {
    font-size: var(--fmg-text-sm) !important;
    font-weight: 600 !important;
}

/* Pipeline header meta (count + total value) */
.fmg-card-header span[style*="0.8rem"],
.fmg-card-header span[style*="0.75rem"] {
    font-size: var(--fmg-text-sm) !important;
    font-family: var(--fmg-font) !important;
}
