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

/* --- Font Import --- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,500&display=swap');

/* --- CSS Custom Properties --- */
:root {
    --fmg-font: 'Plus Jakarta Sans', -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 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --fmg-card-shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.06), 0 4px 10px rgba(0, 0, 0, 0.04);
    --fmg-card-radius: 14px;
    --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);
}

/* Dark mode properties */
.dark {
    --fmg-surface: #0f1219;
    --fmg-surface-alt: #151a24;
    --fmg-card: #1a1f2e;
    --fmg-card-border: #2a3040;
    --fmg-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.12);
    --fmg-card-shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.3), 0 4px 10px rgba(0, 0, 0, 0.2);
    --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;
}

/* 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-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;
}

/* --- Welcome Banner --- */
.fmg-welcome-banner {
    position: relative;
    background: linear-gradient(135deg, var(--fmg-navy) 0%, #1a2744 50%, var(--fmg-primary-dark) 100%);
    border-radius: var(--fmg-card-radius);
    padding: 2rem 2.5rem;
    color: #ffffff;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.fmg-welcome-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(205, 51, 1, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.fmg-welcome-banner h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.375rem;
    position: relative;
    z-index: 1;
}

.fmg-welcome-banner p {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.7);
    position: relative;
    z-index: 1;
}

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

.fmg-welcome-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 10px;
    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-light);
    transform: translateY(-1px);
}

.fmg-welcome-btn--secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.fmg-welcome-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

/* --- 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 */
*:focus-visible {
    outline: 2px solid var(--fmg-primary) !important;
    outline-offset: 2px !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;
}

/* 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);
}

/* --- Sidebar Enhancement --- */
.fmg-nav-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
    transition: var(--fmg-transition);
}

/* --- 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 */
}
