/* ========================================
   MICROSOFT FLUENT WEB DESIGN SYSTEM
   iCRM24 — Complete Design Token Foundation
   ======================================== */

/* ---- Fluent Design Tokens ---- */
:root {
    /* Brand */
    --fluent-brand: #0078D4;
    --fluent-brand-hover: #106EBE;
    --fluent-brand-pressed: #005A9E;
    --fluent-brand-selected: #E1F0FF;
    --fluent-brand-bg: #DEECF9;
    --fluent-brand-text: #004578;
    --fluent-brand-10: #0078d40d;
    --fluent-brand-20: #0078d41a;
    --fluent-brand-30: #0078d426;
    --fluent-brand-60: #0078d466;
    --fluent-brand-80: #0078d480;

    /* Neutral */
    --fluent-neutral-black: #242424;
    --fluent-neutral-gray-220: #201f1e;
    --fluent-neutral-gray-210: #323130;
    --fluent-neutral-gray-200: #484644;
    --fluent-neutral-gray-190: #605e5c;
    --fluent-neutral-gray-180: #777573;
    --fluent-neutral-gray-170: #8a8886;
    --fluent-neutral-gray-160: #a19f9d;
    --fluent-neutral-gray-150: #c8c6c4;
    --fluent-neutral-gray-140: #d2d0ce;
    --fluent-neutral-gray-130: #e1dfdd;
    --fluent-neutral-gray-120: #edebe9;
    --fluent-neutral-gray-110: #f3f2f1;
    --fluent-neutral-gray-100: #faf9f8;
    --fluent-neutral-white: #ffffff;

    /* Semantic Colors */
    --fluent-success: #107c10;
    --fluent-success-bg: #dff6dd;
    --fluent-success-text: #0e7a0d;
    --fluent-warning: #ffb900;
    --fluent-warning-bg: #fff4ce;
    --fluent-warning-text: #a47600;
    --fluent-error: #d13438;
    --fluent-error-bg: #fde7e9;
    --fluent-error-text: #c4314b;
    --fluent-info: #0078d4;
    --fluent-info-bg: #deecf9;

    /* Surface */
    --fluent-surface: #ffffff;
    --fluent-surface-alt: #faf9f8;
    --fluent-surface-container: #f5f5f5;
    --fluent-surface-card: #ffffff;
    --fluent-surface-disabled: #f3f2f1;
    --fluent-on-surface: #242424;
    --fluent-on-surface-secondary: #605e5c;
    --fluent-on-surface-tertiary: #a19f9d;
    --fluent-border: #e1dfdd;
    --fluent-border-strong: #c8c6c4;
    --fluent-divider: #e8e6e4;

    /* Elevation (Fluent shadow levels) */
    --fluent-shadow-2: 0 1.6px 3.6px 0 rgba(0,0,0,0.132), 0 0.3px 0.9px 0 rgba(0,0,0,0.108);
    --fluent-shadow-4: 0 3.2px 7.2px 0 rgba(0,0,0,0.132), 0 0.6px 1.8px 0 rgba(0,0,0,0.108);
    --fluent-shadow-8: 0 6.4px 14.4px 0 rgba(0,0,0,0.132), 0 1.2px 3.6px 0 rgba(0,0,0,0.108);
    --fluent-shadow-16: 0 12.8px 28.8px 0 rgba(0,0,0,0.132), 0 2.4px 7.2px 0 rgba(0,0,0,0.108);
    --fluent-shadow-28: 0 22.4px 57.6px 0 rgba(0,0,0,0.22), 0 4.8px 14.4px 0 rgba(0,0,0,0.16);
    --fluent-shadow-64: 0 51.2px 115.2px 0 rgba(0,0,0,0.28), 0 9.6px 28.8px 0 rgba(0,0,0,0.2);

    /* Border Radius (Fluent) */
    --fluent-radius-none: 0;
    --fluent-radius-sm: 2px;
    --fluent-radius-md: 4px;
    --fluent-radius-lg: 8px;
    --fluent-radius-xl: 12px;

    /* Spacing Scale */
    --fluent-space-xxs: 2px;
    --fluent-space-xs: 4px;
    --fluent-space-sm: 8px;
    --fluent-space-md: 12px;
    --fluent-space-lg: 16px;
    --fluent-space-xl: 20px;
    --fluent-space-xxl: 24px;
    --fluent-space-xxxl: 32px;
    --fluent-space-xxxxl: 40px;

    /* Typography (Fluent) */
    --fluent-font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Google Sans', Roboto, 'Helvetica Neue', sans-serif;
    --fluent-font-size-100: 10px;
    --fluent-font-size-200: 12px;
    --fluent-font-size-300: 14px;
    --fluent-font-size-400: 16px;
    --fluent-font-size-500: 20px;
    --fluent-font-size-600: 24px;
    --fluent-font-size-700: 28px;
    --fluent-font-size-800: 32px;
    --fluent-font-size-900: 40px;
    --fluent-font-size-1000: 48px;
    --fluent-line-height-tight: 20px;
    --fluent-line-height-base: 24px;
    --fluent-line-height-relaxed: 28px;
    --fluent-line-height-loose: 32px;
    --fluent-line-height-loooser: 36px;
    --fluent-font-weight-regular: 400;
    --fluent-font-weight-semibold: 600;
    --fluent-font-weight-bold: 700;

    /* Motion (Fluent easing curves) */
    --fluent-duration-fast: 83ms;
    --fluent-duration-normal: 150ms;
    --fluent-duration-slow: 250ms;
    --fluent-duration-generous: 400ms;
    --fluent-easing-decelerate: cubic-bezier(0, 0, 0, 1);
    --fluent-easing-accelerate: cubic-bezier(1, 0, 1, 1);
    --fluent-easing-standard: cubic-bezier(0.8, 0, 0.2, 1);
    --fluent-easing-soft: cubic-bezier(0.33, 0, 0.67, 1);

    /* Backwards Compatibility Aliases (mapped from old MD3 tokens) */
    --md-primary: var(--fluent-brand);
    --md-on-primary: var(--fluent-neutral-white);
    --md-primary-container: var(--fluent-brand-bg);
    --md-on-primary-container: var(--fluent-brand-text);
    --md-surface: var(--fluent-surface);
    --md-surface-variant: var(--fluent-surface-alt);
    --md-on-surface: var(--fluent-on-surface);
    --md-on-surface-variant: var(--fluent-on-surface-secondary);
    --md-outline: var(--fluent-border);
    --md-outline-variant: var(--fluent-neutral-gray-120);
    --md-error: var(--fluent-error);
    --md-on-error: var(--fluent-neutral-white);
    --md-shadow-1: var(--fluent-shadow-2);
    --md-shadow-2: var(--fluent-shadow-4);
    --md-shadow-3: var(--fluent-shadow-8);
    --md-radius-xs: var(--fluent-radius-md);
    --md-radius-sm: var(--fluent-radius-lg);
    --md-radius-md: var(--fluent-radius-xl);
    --md-radius-lg: var(--fluent-radius-xl);
    --md-radius-xl: var(--fluent-radius-xl);
    --md-spacing-xs: var(--fluent-space-xs);
    --md-spacing-sm: var(--fluent-space-sm);
    --md-spacing-md: var(--fluent-space-lg);
    --md-spacing-lg: var(--fluent-space-xxl);
    --md-spacing-xl: var(--fluent-space-xxxl);
    --md-font-body: var(--fluent-font-family);
    --md-transition-fast: var(--fluent-duration-normal) var(--fluent-easing-standard);
    --md-transition-medium: var(--fluent-duration-slow) var(--fluent-easing-standard);
    --md-transition-slow: var(--fluent-duration-generous) var(--fluent-easing-standard);
}

/* ========================================
   BASE RESET & GLOBAL STYLES
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--fluent-font-family);
    font-size: var(--fluent-font-size-300);
    font-weight: var(--fluent-font-weight-regular);
    line-height: var(--fluent-line-height-base);
    background-color: var(--fluent-neutral-gray-110);
    color: var(--fluent-on-surface);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: env(safe-area-inset-bottom);
}

img, svg { display: inline-block; vertical-align: middle; }
a { color: var(--fluent-brand); text-decoration: none; }
a:hover { text-decoration: underline; }
table { border-collapse: collapse; border-spacing: 0; }

/* ========================================
   TYPOGRAPHY (Fluent type ramp)
   ======================================== */
h1, .fluent-text-hero { font-size: var(--fluent-font-size-1000); font-weight: var(--fluent-font-weight-bold); line-height: var(--fluent-line-height-loooser); }
h2, .fluent-text-title1 { font-size: var(--fluent-font-size-900); font-weight: var(--fluent-font-weight-bold); line-height: var(--fluent-line-height-loose); }
h3, .fluent-text-title2 { font-size: var(--fluent-font-size-800); font-weight: var(--fluent-font-weight-semibold); line-height: var(--fluent-line-height-relaxed); }
h4, .fluent-text-title3 { font-size: var(--fluent-font-size-700); font-weight: var(--fluent-font-weight-semibold); line-height: var(--fluent-line-height-relaxed); }
h5, .fluent-text-subtitle1 { font-size: var(--fluent-font-size-600); font-weight: var(--fluent-font-weight-semibold); line-height: var(--fluent-line-height-loose); }
h6, .fluent-text-subtitle2 { font-size: var(--fluent-font-size-500); font-weight: var(--fluent-font-weight-semibold); line-height: var(--fluent-line-height-relaxed); }
p, .fluent-text-body1 { font-size: var(--fluent-font-size-300); line-height: var(--fluent-line-height-base); }
.fluent-text-body2 { font-size: var(--fluent-font-size-400); line-height: var(--fluent-line-height-base); }
.fluent-text-caption { font-size: var(--fluent-font-size-200); line-height: var(--fluent-line-height-tight); }
.fluent-text-overline { font-size: var(--fluent-font-size-100); font-weight: var(--fluent-font-weight-semibold); text-transform: uppercase; letter-spacing: 0.12em; }

/* ========================================
   SCROLLBAR (Fluent thin style)
   ======================================== */
* { scrollbar-width: thin; scrollbar-color: var(--fluent-neutral-gray-150) transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--fluent-neutral-gray-150); border-radius: 3px; }
*::-webkit-scrollbar-thumb:hover { background: var(--fluent-neutral-gray-170); }

/* ========================================
   CONTAINER
   ======================================== */
.container { width: 100%; max-width: 100%; padding: 0 var(--fluent-space-md); margin: 0 auto; }
@media (min-width: 768px) { .container { padding: 0 var(--fluent-space-xxl); } }
@media (min-width: 1280px) { .container { padding: 0 var(--fluent-space-xxxl); } }
@media (min-width: 1536px) { .container { padding: 0 48px; } }

/* ========================================
   FLUENT CARD SYSTEM
   ======================================== */
.card {
    background: var(--fluent-surface);
    border: 1px solid var(--fluent-border);
    border-radius: var(--fluent-radius-lg);
    box-shadow: var(--fluent-shadow-2);
    margin-bottom: var(--fluent-space-lg);
    padding: var(--fluent-space-xxl);
    transition: box-shadow var(--fluent-duration-normal) var(--fluent-easing-standard), border-color var(--fluent-duration-normal) var(--fluent-easing-standard);
}
@media (min-width: 768px) { .card { border-radius: var(--fluent-radius-xl); padding: var(--fluent-space-xxl); margin-bottom: var(--fluent-space-lg); } }
@media (min-width: 1024px) { .card { padding: var(--fluent-space-xxxl); } }

.md3-card--outlined { background: var(--fluent-surface); border: 1px solid var(--fluent-border); border-radius: var(--fluent-radius-lg); box-shadow: none; padding: var(--fluent-space-xxl); margin-bottom: var(--fluent-space-lg); }
.md3-card--elevated { background: var(--fluent-surface); border: 1px solid var(--fluent-border); border-radius: var(--fluent-radius-lg); box-shadow: var(--fluent-shadow-4); padding: var(--fluent-space-xxl); margin-bottom: var(--fluent-space-lg); }

/* Stat Cards (Dashboard) */
.stat-card {
    background: var(--fluent-surface);
    border: 1px solid var(--fluent-border);
    border-radius: var(--fluent-radius-lg);
    padding: var(--fluent-space-xl);
    box-shadow: var(--fluent-shadow-2);
    transition: box-shadow var(--fluent-duration-normal) var(--fluent-easing-standard), border-color var(--fluent-duration-normal) var(--fluent-easing-standard);
}
.stat-card:hover {
    box-shadow: var(--fluent-shadow-4);
    border-color: var(--fluent-neutral-gray-150);
}
@media (max-width: 640px) { .stat-card { padding: var(--fluent-space-lg); } }

/* Table Card Wrapper */
.table-card {
    background: var(--fluent-surface);
    border: 1px solid var(--fluent-border);
    border-radius: var(--fluent-radius-lg);
    box-shadow: var(--fluent-shadow-2);
    overflow: hidden;
}
.table-card-header {
    padding: var(--fluent-space-lg) var(--fluent-space-xl);
    border-bottom: 1px solid var(--fluent-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--fluent-space-md);
}
.table-card-header h3 {
    font-size: var(--fluent-font-size-200);
    font-weight: var(--fluent-font-weight-semibold);
    color: var(--fluent-neutral-gray-190);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0;
}
.table-card-body { overflow-x: auto; }
@media (max-width: 640px) { .table-card-header { padding: var(--fluent-space-md) var(--fluent-space-lg); } }

/* ========================================
   ICON CONTAINER
   ======================================== */
.icon-box {
    width: 40px;
    height: 40px;
    border-radius: var(--fluent-radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.icon-box svg { width: 20px; height: 20px; }

/* ========================================
   QUICK ACTION
   ======================================== */
.quick-action {
    display: flex;
    align-items: center;
    gap: var(--fluent-space-md);
    padding: var(--fluent-space-md) var(--fluent-space-lg);
    border-radius: var(--fluent-radius-lg);
    text-decoration: none;
    color: var(--fluent-on-surface);
    transition: background-color var(--fluent-duration-normal) var(--fluent-easing-standard);
    font-weight: var(--fluent-font-weight-semibold);
    font-size: var(--fluent-font-size-300);
}
.quick-action:hover { background-color: var(--fluent-neutral-gray-110); text-decoration: none; }
.quick-action .icon-box { width: 36px; height: 36px; border-radius: var(--fluent-radius-md); }

/* ========================================
   FLUENT BUTTON SYSTEM
   ======================================== */
/* Primary filled button (Fluent brand) */
.btn-google,
.fluent-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--fluent-space-sm);
    padding: 5px var(--fluent-space-lg);
    font-family: var(--fluent-font-family);
    font-size: var(--fluent-font-size-300);
    font-weight: var(--fluent-font-weight-semibold);
    line-height: var(--fluent-line-height-tight);
    color: var(--fluent-neutral-white);
    background-color: var(--fluent-brand);
    border: none;
    border-radius: var(--fluent-radius-md);
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color var(--fluent-duration-fast) var(--fluent-easing-standard), box-shadow var(--fluent-duration-fast) var(--fluent-easing-standard);
    user-select: none;
    white-space: nowrap;
}
.btn-google:hover,
.fluent-btn-primary:hover {
    background-color: var(--fluent-brand-hover);
}
.btn-google:active,
.fluent-btn-primary:active {
    background-color: var(--fluent-brand-pressed);
}
.btn-google:disabled,
.fluent-btn-primary:disabled {
    background-color: var(--fluent-neutral-gray-130);
    color: var(--fluent-neutral-gray-160);
    cursor: not-allowed;
    pointer-events: none;
}

/* Secondary / Outline button */
.btn-secondary,
.fluent-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--fluent-space-sm);
    padding: 5px var(--fluent-space-lg);
    font-family: var(--fluent-font-family);
    font-size: var(--fluent-font-size-300);
    font-weight: var(--fluent-font-weight-semibold);
    line-height: var(--fluent-line-height-tight);
    color: var(--fluent-on-surface);
    background-color: var(--fluent-surface);
    border: 1px solid var(--fluent-border-strong);
    border-radius: var(--fluent-radius-md);
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color var(--fluent-duration-fast) var(--fluent-easing-standard), border-color var(--fluent-duration-fast) var(--fluent-easing-standard);
    user-select: none;
    white-space: nowrap;
}
.btn-secondary:hover,
.fluent-btn-secondary:hover {
    background-color: var(--fluent-neutral-gray-110);
}
.btn-secondary:active,
.fluent-btn-secondary:active {
    background-color: var(--fluent-neutral-gray-120);
}

/* Text button */
.btn-text,
.fluent-btn-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--fluent-space-sm);
    padding: 5px var(--fluent-space-sm);
    font-family: var(--fluent-font-family);
    font-size: var(--fluent-font-size-300);
    font-weight: var(--fluent-font-weight-semibold);
    line-height: var(--fluent-line-height-tight);
    color: var(--fluent-brand);
    background-color: transparent;
    border: none;
    border-radius: var(--fluent-radius-md);
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color var(--fluent-duration-fast) var(--fluent-easing-standard);
    user-select: none;
}
.btn-text:hover,
.fluent-btn-text:hover {
    background-color: var(--fluent-brand-10);
}

/* Subtle button */
.fluent-btn-subtle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--fluent-space-sm);
    padding: 5px var(--fluent-space-lg);
    font-family: var(--fluent-font-family);
    font-size: var(--fluent-font-size-300);
    font-weight: var(--fluent-font-weight-semibold);
    color: var(--fluent-on-surface);
    background-color: transparent;
    border: none;
    border-radius: var(--fluent-radius-md);
    cursor: pointer;
    transition: background-color var(--fluent-duration-fast) var(--fluent-easing-standard);
}
.fluent-btn-subtle:hover { background-color: var(--fluent-neutral-gray-120); }

/* Danger button */
.fluent-btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--fluent-space-sm);
    padding: 5px var(--fluent-space-lg);
    font-family: var(--fluent-font-family);
    font-size: var(--fluent-font-size-300);
    font-weight: var(--fluent-font-weight-semibold);
    color: var(--fluent-neutral-white);
    background-color: var(--fluent-error);
    border: none;
    border-radius: var(--fluent-radius-md);
    cursor: pointer;
    transition: background-color var(--fluent-duration-fast) var(--fluent-easing-standard);
}
.fluent-btn-danger:hover { background-color: #c4314b; }

/* MD3 button compatibility */
.md3-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 5px var(--fluent-space-lg); font-family: var(--fluent-font-family); font-size: var(--fluent-font-size-300); font-weight: var(--fluent-font-weight-semibold); letter-spacing: 0; border-radius: var(--fluent-radius-md); border: none; cursor: pointer; touch-action: manipulation; transition: background-color var(--fluent-duration-fast) var(--fluent-easing-standard); position: relative; user-select: none; white-space: nowrap; line-height: 1.4; }
.md3-btn:disabled { opacity: 0.38; cursor: not-allowed; pointer-events: none; }
.md3-btn--filled { background-color: var(--fluent-brand); color: var(--fluent-neutral-white); }
.md3-btn--filled:hover { background-color: var(--fluent-brand-hover); }
.md3-btn--tonal { background-color: var(--fluent-brand-bg); color: var(--fluent-brand-text); }
.md3-btn--tonal:hover { background-color: #c7e0f4; }
.md3-btn--outlined { background-color: var(--fluent-surface); color: var(--fluent-brand); border: 1px solid var(--fluent-border-strong); }
.md3-btn--outlined:hover { background-color: var(--fluent-brand-10); }
.md3-btn--text { background-color: transparent; color: var(--fluent-brand); }
.md3-btn--text:hover { background-color: var(--fluent-brand-10); }
.md3-btn--elevated { background-color: var(--fluent-surface); color: var(--fluent-brand); box-shadow: var(--fluent-shadow-2); }
.md3-btn--elevated:hover { box-shadow: var(--fluent-shadow-4); }
.md3-btn--sm { padding: 3px var(--fluent-space-sm); font-size: var(--fluent-font-size-200); }
.md3-btn--lg { padding: 8px var(--fluent-space-xxl); font-size: var(--fluent-font-size-400); }

/* ========================================
   FORM INPUTS (Fluent outlined style)
   ======================================== */
input, select, textarea {
    font-size: var(--fluent-font-size-300);
    font-family: var(--fluent-font-family);
    padding: 7px var(--fluent-space-md);
    border: 1px solid var(--fluent-border-strong);
    border-radius: var(--fluent-radius-md);
    width: 100%;
    background-color: var(--fluent-surface);
    color: var(--fluent-on-surface);
    -webkit-appearance: none;
    appearance: none;
    transition: border-color var(--fluent-duration-fast) var(--fluent-easing-standard), box-shadow var(--fluent-duration-fast) var(--fluent-easing-standard);
    box-sizing: border-box;
    outline: none;
}
input:hover, select:hover, textarea:hover { border-color: var(--fluent-neutral-gray-190); }
input:focus, select:focus, textarea:focus {
    border-color: var(--fluent-brand);
    box-shadow: 0 0 0 1px var(--fluent-brand);
}
input::placeholder, textarea::placeholder {
    color: var(--fluent-neutral-gray-170);
}

/* MD3 textfield compatibility */
.md3-textfield { position: relative; margin-bottom: var(--fluent-space-lg); }
.md3-textfield input, .md3-textfield textarea {
    width: 100%;
    padding: 9px var(--fluent-space-md);
    font-size: var(--fluent-font-size-300);
    background: transparent;
    border: 1px solid var(--fluent-border-strong);
    border-radius: var(--fluent-radius-md);
    outline: none;
}
.md3-textfield textarea { min-height: 100px; resize: vertical; }
.md3-textfield input:focus, .md3-textfield textarea:focus { border-color: var(--fluent-brand); box-shadow: 0 0 0 1px var(--fluent-brand); }
.md3-textfield--pw input { padding-right: 44px; }

/* MD3 search compatibility */
.md3-search { position: relative; }
.md3-search .search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--fluent-on-surface-tertiary); pointer-events: none; }
.md3-search input { padding: 7px var(--fluent-space-md) 7px 36px; font-size: var(--fluent-font-size-300); background: var(--fluent-surface); border: 1px solid var(--fluent-border-strong); border-radius: var(--fluent-radius-md); color: var(--fluent-on-surface); transition: border-color var(--fluent-duration-fast) var(--fluent-easing-standard); outline: none; width: 100%; box-sizing: border-box; }
.md3-search input::placeholder { color: var(--fluent-neutral-gray-170); }
.md3-search input:hover { border-color: var(--fluent-neutral-gray-190); }
.md3-search input:focus { border-color: var(--fluent-brand); box-shadow: 0 0 0 1px var(--fluent-brand); }

/* Dropdown arrow */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23605e5c'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 18px 18px;
    padding-right: 36px;
    cursor: pointer;
}
select:focus { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230078D4'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E"); }
select::-ms-expand { display: none; }

/* ========================================
   FLUENT CHECKBOX
   ======================================== */
.md3-checkbox {
    display: inline-flex;
    align-items: center;
    gap: var(--fluent-space-sm);
    cursor: pointer;
    user-select: none;
}
.md3-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    width: 16px;
    height: 16px;
    margin: 0;
    border: 1px solid var(--fluent-neutral-gray-190);
    border-radius: var(--fluent-radius-sm);
    background-color: var(--fluent-surface);
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--fluent-duration-fast) var(--fluent-easing-standard);
}
.md3-checkbox input[type="checkbox"]:hover { border-color: var(--fluent-on-surface); }
.md3-checkbox input[type="checkbox"]:focus-visible { border-color: var(--fluent-brand); box-shadow: 0 0 0 1px var(--fluent-brand); }
.md3-checkbox input[type="checkbox"]:checked {
    background-color: var(--fluent-brand);
    border-color: var(--fluent-brand);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23ffffff' d='M13.5 4.5l-7 7L3 8' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
}
.md3-checkbox input[type="checkbox"]:checked:hover { background-color: var(--fluent-brand-hover); }
.md3-checkbox label { font-size: var(--fluent-font-size-300); line-height: 20px; font-weight: var(--fluent-font-weight-regular); color: var(--fluent-on-surface); cursor: pointer; }
.modern-checkbox { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; border: 1px solid var(--fluent-neutral-gray-190); border-radius: var(--fluent-radius-sm); cursor: pointer; position: relative; transition: all var(--fluent-duration-fast) var(--fluent-easing-standard); flex-shrink: 0; background-color: var(--fluent-surface); }
.modern-checkbox:checked { background-color: var(--fluent-brand); border-color: var(--fluent-brand); }
.modern-checkbox:checked::after { content: ''; position: absolute; left: 4px; top: 1px; width: 5px; height: 8px; border: solid white; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.modern-checkbox:hover { border-color: var(--fluent-brand); }

/* ========================================
   FLUENT SWITCH / TOGGLE
   ======================================== */
.fluent-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.fluent-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.fluent-switch .switch-track {
    width: 40px; height: 20px; border-radius: 999px; padding: 2px;
    background: var(--fluent-neutral-gray-150);
    transition: background-color var(--fluent-duration-fast) var(--fluent-easing-standard);
    display: inline-flex; align-items: center;
}
.fluent-switch .switch-thumb {
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--fluent-surface);
    box-shadow: var(--fluent-shadow-2);
    transition: transform var(--fluent-duration-fast) var(--fluent-easing-standard), background-color var(--fluent-duration-fast) var(--fluent-easing-standard);
    transform: translateX(0);
}
.fluent-switch input:checked + .switch-track { background: var(--fluent-brand); }
.fluent-switch input:checked + .switch-track .switch-thumb { transform: translateX(20px); background: var(--fluent-surface); }
.fluent-switch:hover .switch-track { background: var(--fluent-neutral-gray-140); }
.fluent-switch:hover input:checked + .switch-track { background: var(--fluent-brand-hover); }
.fluent-switch input:focus-visible + .switch-track { box-shadow: 0 0 0 2px var(--fluent-surface), 0 0 0 4px var(--fluent-brand); }
.fluent-switch input:disabled + .switch-track { opacity: 0.38; cursor: not-allowed; }
.fluent-switch input:disabled + .switch-track .switch-thumb { background: var(--fluent-neutral-gray-130); }

/* ========================================
   TABLES (Fluent)
   ======================================== */
.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: 800px; }
.table-card-body table thead th,
table thead th {
    background: var(--fluent-neutral-gray-100);
    border-bottom: 1px solid var(--fluent-border);
    color: var(--fluent-neutral-gray-190);
    font-size: var(--fluent-font-size-200);
    font-weight: var(--fluent-font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: var(--fluent-space-md) var(--fluent-space-lg);
    text-align: left;
}
.table-card-body table tbody td,
table tbody td {
    border-bottom: 1px solid var(--fluent-neutral-gray-120);
    color: var(--fluent-on-surface);
    padding: 10px var(--fluent-space-lg);
    font-size: var(--fluent-font-size-300);
    transition: background-color var(--fluent-duration-fast) var(--fluent-easing-standard);
}
.table-card-body table tbody tr:hover td,
table tbody tr:hover td { background-color: var(--fluent-neutral-gray-100); }
.table-card-body table tbody tr:last-child td,
table tbody tr:last-child td { border-bottom: none; }

/* ========================================
   BADGES (Fluent)
   ======================================== */
.md3-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px var(--fluent-space-sm);
    font-size: var(--fluent-font-size-100);
    font-weight: var(--fluent-font-weight-semibold);
    letter-spacing: 0.04em;
    line-height: var(--fluent-line-height-tight);
    border-radius: var(--fluent-radius-md);
    white-space: nowrap;
    min-width: 20px;
}
.md3-badge--primary { background-color: var(--fluent-brand-bg); color: var(--fluent-brand-text); }
.md3-badge--on-primary { background-color: var(--fluent-brand); color: var(--fluent-neutral-white); }
.md3-badge--surface { background-color: var(--fluent-neutral-gray-110); color: var(--fluent-on-surface-secondary); }
.md3-badge--error { background-color: var(--fluent-error-bg); color: var(--fluent-error-text); }
.md3-badge--success { background-color: var(--fluent-success-bg); color: var(--fluent-success-text); }
.md3-badge--dot { width: 8px; height: 8px; padding: 0; border-radius: 50%; min-width: unset; }
.md3-badge--dot.md3-badge--primary { background-color: var(--fluent-brand); }
.md3-badge--dot.md3-badge--error { background-color: var(--fluent-error); }
.md3-badge--dot.md3-badge--success { background-color: var(--fluent-success); }
.md3-badge--lg { padding: 4px var(--fluent-space-md); font-size: var(--fluent-font-size-200); }
.md3-badge--sm { padding: 1px 6px; font-size: var(--fluent-font-size-100); }

/* ========================================
   TOAST NOTIFICATIONS (Fluent)
   ======================================== */
.md3-toast {
    display: flex;
    align-items: flex-start;
    gap: var(--fluent-space-md);
    padding: var(--fluent-space-md) var(--fluent-space-lg);
    border-radius: var(--fluent-radius-md);
    background: var(--fluent-neutral-gray-220);
    color: var(--fluent-neutral-white);
    box-shadow: var(--fluent-shadow-8);
    font-size: var(--fluent-font-size-300);
    line-height: var(--fluent-line-height-base);
    max-width: 400px;
    min-width: 280px;
    position: relative;
    z-index: 100;
    animation: toastIn var(--fluent-duration-slow) var(--fluent-easing-decelerate) both;
}
.md3-toast--success { border-left: 3px solid var(--fluent-success); }
.md3-toast--error { border-left: 3px solid var(--fluent-error); }
.md3-toast--warning { border-left: 3px solid var(--fluent-warning); }
.md3-toast--info { border-left: 3px solid var(--fluent-brand); }
.md3-toast__icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; }
.md3-toast__body { flex: 1; min-width: 0; }
.md3-toast__title { font-weight: var(--fluent-font-weight-semibold); font-size: var(--fluent-font-size-300); margin-bottom: 2px; }
.md3-toast__message { font-size: var(--fluent-font-size-200); opacity: 0.85; line-height: var(--fluent-line-height-tight); }
.md3-toast__close { flex-shrink: 0; background: transparent; border: none; cursor: pointer; padding: 4px; border-radius: var(--fluent-radius-sm); color: var(--fluent-neutral-white); display: inline-flex; opacity: 0.7; transition: opacity var(--fluent-duration-fast) var(--fluent-easing-standard); }
.md3-toast__close:hover { opacity: 1; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ========================================
   MODALS & OVERLAYS (Fluent)
   ======================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 250;
}
.modal-content {
    background: var(--fluent-surface);
    border-radius: var(--fluent-radius-lg);
    box-shadow: var(--fluent-shadow-28);
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
@media (min-width: 768px) { .modal-content { max-width: 600px; margin: 0 auto; } }

/* ========================================
   MOBILE BOTTOM NAVIGATION (Fluent)
   ======================================== */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--fluent-surface);
    border-top: 1px solid var(--fluent-border);
    display: flex;
    justify-content: space-around;
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
    z-index: 50;
    box-shadow: var(--fluent-shadow-4);
}
.mobile-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 8px;
    color: var(--fluent-on-surface-secondary);
    text-decoration: none;
    font-size: 10px;
    touch-action: manipulation;
    flex: 1;
    max-width: 80px;
}
.mobile-bottom-nav-item.active { color: var(--fluent-brand); }
.mobile-bottom-nav-item svg { width: 22px; height: 22px; margin-bottom: 2px; }
.mobile-bottom-nav-item span { font-weight: var(--fluent-font-weight-semibold); letter-spacing: 0.02em; }

/* ========================================
   MOBILE SIDEBAR (Fluent)
   ======================================== */
@media (max-width: 767px) {
    .mobile-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        height: 100dvh;
        z-index: 210;
        background: var(--fluent-surface);
        box-shadow: var(--fluent-shadow-16);
        border-right: 1px solid var(--fluent-border);
    }
    .mobile-sidebar nav { visibility: visible; opacity: 1; }
    .mobile-sidebar nav a {
        display: flex;
        align-items: center;
        gap: var(--fluent-space-md);
        padding: 10px var(--fluent-space-lg);
        border-radius: var(--fluent-radius-md);
        font-size: var(--fluent-font-size-300);
        font-weight: var(--fluent-font-weight-regular);
        color: var(--fluent-on-surface);
        text-decoration: none;
        transition: background-color var(--fluent-duration-fast) var(--fluent-easing-standard);
    }
    .mobile-sidebar nav a:hover { background-color: var(--fluent-neutral-gray-110); }
    .mobile-sidebar nav a:active { background-color: var(--fluent-neutral-gray-120); }
    .mobile-sidebar .sidebar-footer a { color: var(--fluent-error); }
}

/* ========================================
   LOGIN (Fluent)
   ======================================== */
.login-gradient {
    background-color: var(--fluent-neutral-gray-110);
}
.login-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--fluent-space-lg);
    position: relative;
    z-index: 1;
}
@media (min-width: 768px) {
    .login-shell {
        padding-left: 0;
        padding-right: 0;
    }
}
.login-particles-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.login-liquid-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.client-login-dark { background-color: #07070b; }
.tubes-canvas { position: fixed; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; z-index: 0; overflow: hidden; pointer-events: none; }
.login-card {
    width: 100%;
    max-width: 64rem;
    background: var(--fluent-surface);
    border: 1px solid var(--fluent-border);
    border-radius: var(--fluent-radius-xl);
    box-shadow: var(--fluent-shadow-28);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: loginCardIn var(--fluent-duration-generous) var(--fluent-easing-decelerate) both;
}
@media (min-width: 768px) { .login-card { flex-direction: row; min-height: 32rem; } }
@keyframes loginCardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.login-brand {
    background: linear-gradient(135deg, var(--fluent-brand) 0%, #005A9E 100%);
    color: var(--fluent-neutral-white);
    position: relative;
    overflow: hidden;
}
.login-brand::before, .login-brand::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}
.login-brand::before { width: 200px; height: 200px; top: -60px; right: -50px; }
.login-brand::after { width: 140px; height: 140px; bottom: -40px; left: -30px; }
.login-brand.login-brand-green {
    background: linear-gradient(135deg, #16A34A 0%, #047857 100%);
}
.login-pw-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--fluent-on-surface-secondary);
    display: inline-flex;
    padding: 4px;
    border-radius: var(--fluent-radius-sm);
    line-height: 0;
}
.login-pw-toggle:hover { color: var(--fluent-brand); }

/* ========================================
   INPUT VALIDATION
   ======================================== */
.input-helper { font-size: var(--fluent-font-size-200); margin-top: var(--fluent-space-xs); color: var(--fluent-on-surface-secondary); }
.input-error { border-color: var(--fluent-error) !important; }
.input-error:focus { border-color: var(--fluent-error) !important; box-shadow: 0 0 0 1px var(--fluent-error) !important; }
.error-text { color: var(--fluent-error); font-size: var(--fluent-font-size-200); margin-top: var(--fluent-space-xs); }

/* ========================================
   UTILITY CLASSES
   ======================================== */
.focus-ring:focus-visible { outline: 2px solid var(--fluent-brand); outline-offset: 2px; }
.shadow-soft { box-shadow: var(--fluent-shadow-2); }
.shadow-soft-lg { box-shadow: var(--fluent-shadow-4); }
.transition-all-smooth { transition: all var(--fluent-duration-slow) var(--fluent-easing-standard); }
.touch-manipulation { touch-action: manipulation; }
.safe-area-bottom { padding-bottom: env(safe-area-inset-bottom); }
.safe-area-top { padding-top: env(safe-area-inset-top); }

/* Skeleton / Shimmer */
.skeleton {
    background: linear-gradient(90deg, var(--fluent-neutral-gray-120) 25%, var(--fluent-neutral-gray-110) 50%, var(--fluent-neutral-gray-120) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--fluent-radius-md);
}
@keyframes skeleton-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }
.animate-fade-in { animation: fadeIn var(--fluent-duration-slow) var(--fluent-easing-decelerate); }
.animate-slide-up { animation: slideUp var(--fluent-duration-generous) var(--fluent-easing-decelerate); }
.animate-fade-in-up { animation: fadeInUp var(--fluent-duration-generous) var(--fluent-easing-decelerate) both; }
.animate-slide-in-right { animation: slideInRight var(--fluent-duration-slow) var(--fluent-easing-decelerate) both; }
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }

/* ========================================
   DARK MODE (Fluent)
   ======================================== */
.dark, [data-theme="dark"] {
    --fluent-surface: #1e1e1e;
    --fluent-surface-alt: #2d2d2d;
    --fluent-surface-card: #2d2d2d;
    --fluent-on-surface: #e3e3e3;
    --fluent-on-surface-secondary: #9e9e9e;
    --fluent-on-surface-tertiary: #6e6e6e;
    --fluent-border: #404040;
    --fluent-border-strong: #505050;
    --fluent-neutral-gray-110: #2d2d2d;
    --fluent-neutral-gray-100: #383838;
    --fluent-neutral-gray-120: #404040;
    --fluent-brand-bg: #0d47a1;
    --fluent-brand-text: #e3f2fd;
    --fluent-shadow-2: 0 1px 2px 0 rgba(0,0,0,0.3);
    --fluent-shadow-4: 0 2px 4px 0 rgba(0,0,0,0.3);
    --fluent-shadow-8: 0 4px 8px 0 rgba(0,0,0,0.3);
}
.dark .card, [data-theme="dark"] .card { box-shadow: var(--fluent-shadow-2); border-color: var(--fluent-border); }

/* ========================================
   MD3 SEMANTIC UTILITY CLASSES (Compat)
   ======================================== */
.md3-bg-primary { background-color: var(--fluent-brand); }
.md3-bg-on-primary { background-color: var(--fluent-neutral-white); }
.md3-bg-primary-container { background-color: var(--fluent-brand-bg); }
.md3-bg-on-primary-container { background-color: var(--fluent-brand-text); }
.md3-bg-surface { background-color: var(--fluent-surface); }
.md3-bg-surface-variant { background-color: var(--fluent-surface-alt); }
.md3-bg-on-surface { background-color: var(--fluent-on-surface); }
.md3-bg-on-surface-variant { background-color: var(--fluent-on-surface-secondary); }
.md3-bg-error { background-color: var(--fluent-error); }
.md3-bg-on-error { background-color: var(--fluent-neutral-white); }
.md3-bg-outline { background-color: var(--fluent-border); }
.md3-bg-outline-variant { background-color: var(--fluent-neutral-gray-120); }
.md3-text-primary { color: var(--fluent-brand); }
.md3-text-on-primary { color: var(--fluent-neutral-white); }
.md3-text-primary-container { color: var(--fluent-brand-bg); }
.md3-text-on-primary-container { color: var(--fluent-brand-text); }
.md3-text-surface { color: var(--fluent-surface); }
.md3-text-surface-variant { color: var(--fluent-surface-alt); }
.md3-text-on-surface { color: var(--fluent-on-surface); }
.md3-text-on-surface-variant { color: var(--fluent-on-surface-secondary); }
.md3-text-error { color: var(--fluent-error); }
.md3-text-on-error { color: var(--fluent-neutral-white); }
.md3-text-outline { color: var(--fluent-border); }
.md3-text-outline-variant { color: var(--fluent-neutral-gray-120); }
.md3-border-primary { border-color: var(--fluent-brand); }
.md3-border-on-primary { border-color: var(--fluent-neutral-white); }
.md3-border-primary-container { border-color: var(--fluent-brand-bg); }
.md3-border-surface { border-color: var(--fluent-surface); }
.md3-border-surface-variant { border-color: var(--fluent-surface-alt); }
.md3-border-on-surface { border-color: var(--fluent-on-surface); }
.md3-border-on-surface-variant { border-color: var(--fluent-on-surface-secondary); }
.md3-border-error { border-color: var(--fluent-error); }
.md3-border-outline { border-color: var(--fluent-border); }
.md3-border-outline-variant { border-color: var(--fluent-neutral-gray-120); }

/* ========================================
   ACCESSIBILITY
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
*:focus-visible { outline: 2px solid var(--fluent-brand); outline-offset: 0px; }

/* ========================================
   RESPONSIVE — TABLET (min-width: 768px)
   ======================================== */
@media (min-width: 768px) {
    .mobile-bottom-nav { display: none !important; }
    main { padding-top: 8px; }
}

/* ========================================
   RESPONSIVE — MOBILE (max-width: 767px)
   ======================================== */
@media (max-width: 767px) {
    body { font-size: 15px; }

    button, a, input[type="submit"], input[type="button"] {
        min-height: 44px;
        min-width: 44px;
    }

    input[type="checkbox"], input[type="radio"] {
        min-width: 44px;
        min-height: 44px;
        accent-color: var(--fluent-brand);
        cursor: pointer;
    }

    input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], select, textarea {
        min-height: 44px;
    }

    th:first-child, td:first-child { min-width: 44px; width: 44px; text-align: center; }

    .hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
    .hide-scrollbar::-webkit-scrollbar { display: none; }

    .form-group { margin-bottom: var(--fluent-space-lg); }

    .flex-mobile-stack { flex-direction: column; }
    .flex-mobile-stack > * { width: 100%; margin-bottom: var(--fluent-space-sm); }

    header { padding-top: env(safe-area-inset-top); }
    main { padding-bottom: 80px; }

    .card { border-radius: var(--fluent-radius-md); margin-bottom: var(--fluent-space-sm); box-shadow: var(--fluent-shadow-2); border: 1px solid var(--fluent-border); }

    .btn-google { border-radius: var(--fluent-radius-md); }

    .table-container { margin: 0 calc(-1 * var(--fluent-space-md)); padding: 0; }
}

/* ========================================
   TAILWIND → FLUENT UTILITY OVERRIDES
   Maps existing Tailwind color classes to Fluent tokens
   ======================================== */

/* --- Background: White → Fluent Surface --- */
.bg-white { background-color: var(--fluent-surface) !important; }

/* --- Background: Gray scale → Fluent Neutral --- */
.bg-gray-50 { background-color: var(--fluent-neutral-gray-100) !important; }
.bg-gray-100 { background-color: var(--fluent-neutral-gray-110) !important; }
.bg-gray-200 { background-color: var(--fluent-neutral-gray-130) !important; }
.bg-gray-50\/80, .hover\:bg-gray-50\/80:hover { background-color: rgba(250,249,248,0.8) !important; }

/* --- Background: Brand → Fluent Blue --- */
.bg-blue-50 { background-color: var(--fluent-brand-bg) !important; }
.bg-blue-100 { background-color: var(--fluent-brand-bg) !important; }
.bg-blue-600 { background-color: var(--fluent-brand) !important; }

/* --- Background: Error/Danger → Fluent Red --- */
.bg-red-50 { background-color: var(--fluent-error-bg) !important; }
.bg-red-100 { background-color: var(--fluent-error-bg) !important; }
.bg-red-600 { background-color: var(--fluent-error) !important; }

/* --- Background: Success → Fluent Green --- */
.bg-green-50 { background-color: var(--fluent-success-bg) !important; }
.bg-green-100 { background-color: var(--fluent-success-bg) !important; }
.bg-green-600 { background-color: var(--fluent-success) !important; }

/* --- Background: Hover states --- */
.hover\:bg-gray-50:hover { background-color: var(--fluent-neutral-gray-100) !important; }
.hover\:bg-gray-100:hover { background-color: var(--fluent-neutral-gray-120) !important; }
.hover\:bg-gray-200:hover { background-color: var(--fluent-neutral-gray-130) !important; }
.hover\:bg-blue-50:hover { background-color: var(--fluent-brand-bg) !important; }
.hover\:bg-red-50:hover { background-color: var(--fluent-error-bg) !important; }
.hover\:bg-green-50:hover { background-color: var(--fluent-success-bg) !important; }
.hover\:bg-blue-100:hover { background-color: var(--fluent-brand-bg) !important; }
.hover\:bg-red-100:hover { background-color: var(--fluent-error-bg) !important; }
.hover\:bg-green-100:hover { background-color: var(--fluent-success-bg) !important; }
.hover\:bg-blue-700:hover { background-color: var(--fluent-brand-hover) !important; }
.hover\:bg-red-700:hover { background-color: #c4314b !important; }
.hover\:bg-green-700:hover { background-color: #0b6a0b !important; }

/* --- Active states --- */
.active\:bg-blue-700:active { background-color: var(--fluent-brand-pressed) !important; }
.active\:bg-red-700:active { background-color: #a4262c !important; }

/* --- Text: Neutral → Fluent --- */
.text-gray-900 { color: var(--fluent-on-surface) !important; }
.text-gray-800 { color: var(--fluent-on-surface) !important; }
.text-gray-700 { color: var(--fluent-on-surface) !important; }
.text-gray-600 { color: var(--fluent-on-surface-secondary) !important; }
.text-gray-500 { color: var(--fluent-on-surface-secondary) !important; }
.text-gray-400 { color: var(--fluent-on-surface-tertiary) !important; }
.text-gray-300 { color: var(--fluent-neutral-gray-160) !important; }

/* --- Text: Brand → Fluent Blue --- */
.text-blue-600 { color: var(--fluent-brand) !important; }
.text-blue-700 { color: var(--fluent-brand) !important; }

/* --- Text: Error/Danger → Fluent Red --- */
.text-red-500 { color: var(--fluent-error) !important; }
.text-red-600 { color: var(--fluent-error) !important; }
.text-red-700 { color: var(--fluent-error-text) !important; }

/* --- Text: Success → Fluent Green --- */
.text-green-600 { color: var(--fluent-success) !important; }
.text-green-700 { color: var(--fluent-success-text) !important; }

/* --- Text: Hover states --- */
.hover\:text-gray-700:hover { color: var(--fluent-on-surface) !important; }
.hover\:text-gray-900:hover { color: var(--fluent-on-surface) !important; }
.hover\:text-blue-600:hover { color: var(--fluent-brand-hover) !important; }
.hover\:text-blue-700:hover { color: var(--fluent-brand-hover) !important; }
.hover\:text-red-600:hover { color: #a4262c !important; }

/* --- Border: Gray → Fluent --- */
.border-gray-100 { border-color: var(--fluent-neutral-gray-120) !important; }
.border-gray-200 { border-color: var(--fluent-border) !important; }
.border-gray-200\/80 { border-color: rgba(225,223,221,0.8) !important; }
.border-gray-300 { border-color: var(--fluent-border-strong) !important; }

/* --- Border: Brand → Fluent Blue --- */
.border-blue-100 { border-color: var(--fluent-brand-bg) !important; }
.border-blue-200 { border-color: var(--fluent-brand-bg) !important; }
.border-blue-500 { border-color: var(--fluent-brand) !important; }

/* --- Border: Error → Fluent Red --- */
.border-red-100 { border-color: var(--fluent-error-bg) !important; }
.border-red-200 { border-color: #f4c7c3 !important; }
.border-red-300 { border-color: var(--fluent-error) !important; }

/* --- Border: Success → Fluent Green --- */
.border-green-200 { border-color: #b7eb8f !important; }
.border-green-300 { border-color: var(--fluent-success) !important; }

/* --- Focus ring → Fluent --- */
.focus\:border-blue-500:focus { border-color: var(--fluent-brand) !important; }
.focus\:ring-blue-500\/10:focus, .focus\:ring-2:focus { box-shadow: 0 0 0 1px var(--fluent-brand) !important; }

/* --- Hover border --- */
.hover\:border-blue-200:hover { border-color: var(--fluent-brand-bg) !important; }
.hover\:border-gray-300:hover { border-color: var(--fluent-neutral-gray-150) !important; }
.hover\:border-red-300:hover { border-color: var(--fluent-error) !important; }
.hover\:border-green-300:hover { border-color: var(--fluent-success) !important; }

/* --- Divide → Fluent --- */
.divide-gray-100 > :not([hidden]) ~ :not([hidden]) { border-color: var(--fluent-neutral-gray-120) !important; }

/* --- Shadow overrides (Fluent) --- */
.shadow-sm { box-shadow: var(--fluent-shadow-2) !important; }
.shadow-md { box-shadow: var(--fluent-shadow-4) !important; }
.shadow-lg { box-shadow: var(--fluent-shadow-8) !important; }
.shadow-xl { box-shadow: var(--fluent-shadow-16) !important; }
.shadow-2xl { box-shadow: var(--fluent-shadow-28) !important; }
.shadow-lg:hover { box-shadow: var(--fluent-shadow-16) !important; }
.shadow-xl:hover { box-shadow: var(--fluent-shadow-28) !important; }

/* --- Border radius (Fluent) --- */
.rounded-sm { border-radius: var(--fluent-radius-sm) !important; }
.rounded { border-radius: var(--fluent-radius-md) !important; }
.rounded-md { border-radius: var(--fluent-radius-md) !important; }
.rounded-lg { border-radius: var(--fluent-radius-lg) !important; }
.rounded-xl { border-radius: var(--fluent-radius-lg) !important; }
.rounded-2xl { border-radius: var(--fluent-radius-xl) !important; }
.rounded-full { border-radius: 9999px !important; }
.rounded-lg { border-radius: var(--fluent-radius-lg) !important; }

/* --- Inline style overrides for Fluent brand --- */
/* These target the inline style="background: ..." patterns in views */
div[style*="background: #e3f2fd"] { background-color: var(--fluent-brand-bg) !important; }
div[style*="color: #1565c0"] { color: var(--fluent-brand-text) !important; }
div[style*="background: #fff3e0"] { background-color: #fff8e1 !important; }
div[style*="color: #ef6c00"] { color: #bf5600 !important; }
div[style*="background: #e8f5e9"] { background-color: var(--fluent-success-bg) !important; }
div[style*="color: #2e7d32"] { color: var(--fluent-success-text) !important; }
div[style*="background: #f3e5f5"] { background-color: #f3e5f5 !important; }
div[style*="color: #7b1fa2"] { color: #7b1fa2 !important; }
div[style*="background: #f3f4f6"] { background-color: var(--fluent-neutral-gray-110) !important; }
div[style*="color: #4b5563"] { color: var(--fluent-on-surface-secondary) !important; }
span[style*="background: #e3f2fd"] { background-color: var(--fluent-brand-bg) !important; }
span[style*="color: #1565c0"] { color: var(--fluent-brand-text) !important; }

/* --- Body background override --- */
body[style*="background: #f8f9fa"] { background-color: var(--fluent-neutral-gray-110) !important; }
body[style*="font-family"] { font-family: var(--fluent-font-family) !important; }

/* --- Inline blue gradient (CRM badge) --- */
div[style*="linear-gradient(135deg, #1a73e8"] { background: linear-gradient(135deg, var(--fluent-brand) 0%, #005A9E 100%) !important; }

/* --- Header search focus override --- */
.focus\:bg-white:focus { background-color: var(--fluent-surface) !important; }

/* --- Backdrop overrides --- */
.backdrop-blur-sm { backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }

/* --- File input Fluent style --- */
input[type="file"] { font-size: var(--fluent-font-size-300); }
input[type="file"]::file-selector-button {
    font-family: var(--fluent-font-family);
    font-size: var(--fluent-font-size-300);
    font-weight: var(--fluent-font-weight-semibold);
    color: var(--fluent-brand-text);
    background-color: var(--fluent-brand-bg);
    border: none;
    border-radius: var(--fluent-radius-md);
    padding: 5px 12px;
    margin-right: 8px;
    cursor: pointer;
    transition: background-color var(--fluent-duration-fast) var(--fluent-easing-standard);
}
input[type="file"]::file-selector-button:hover {
    background-color: var(--fluent-brand-bg);
    filter: brightness(0.96);
}

/* --- Fluent brand gradient background (login) --- */
.login-brand {
    background: linear-gradient(135deg, var(--fluent-brand) 0%, #005A9E 100%) !important;
}

/* ========================================
   FLUENT TOOLTIP (pure CSS, data-tip attribute)
   ======================================== */
[data-tip] {
    position: relative;
    cursor: pointer;
}
[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    white-space: nowrap;
    padding: 4px 10px;
    font-size: 12px;
    font-family: var(--fluent-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-weight: 500;
    line-height: 1.3;
    color: #fff;
    background: var(--fluent-neutral-gray-220, #201f1e);
    border-radius: var(--fluent-radius-sm, 4px);
    box-shadow: var(--fluent-shadow-4, 0 2px 4px rgba(0,0,0,0.3));
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--fluent-duration-fast, 0.15s) var(--fluent-easing-standard, ease),
                transform var(--fluent-duration-fast, 0.15s) var(--fluent-easing-standard, ease);
    z-index: 1000;
    max-width: 80vw;
    overflow: hidden;
    text-overflow: ellipsis;
}
[data-tip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    border: 4px solid transparent;
    border-top-color: var(--fluent-neutral-gray-220, #201f1e);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--fluent-duration-fast, 0.15s) var(--fluent-easing-standard, ease),
                transform var(--fluent-duration-fast, 0.15s) var(--fluent-easing-standard, ease);
    z-index: 1000;
}
[data-tip]:hover::after,
[data-tip]:hover::before,
[data-tip]:focus-visible::after,
[data-tip]:focus-visible::before {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* ========================================
   FLUENT PAGINATION
   ======================================== */
.fluent-pagination {
    display: inline-flex;
    align-items: center;
    gap: var(--fluent-space-xs, 4px);
    padding: var(--fluent-space-xs, 4px);
    border-radius: var(--fluent-radius-md, 8px);
}
.fluent-pagination__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--fluent-space-sm, 8px);
    font-size: var(--fluent-font-size-300, 14px);
    font-weight: var(--fluent-font-weight-semibold, 600);
    line-height: var(--fluent-line-height-tight, 1.25);
    color: var(--fluent-on-surface, #323130);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--fluent-radius-md, 8px);
    cursor: pointer;
    transition: all var(--fluent-duration-fast, 0.15s) var(--fluent-easing-standard, ease);
    user-select: none;
    white-space: nowrap;
}
.fluent-pagination__item:hover:not(:disabled) {
    background: var(--fluent-neutral-gray-110, #f3f2f1);
    border-color: var(--fluent-neutral-gray-130, #e1dfdd);
}
.fluent-pagination__item:focus-visible {
    outline: 2px solid var(--fluent-brand, #0078D4);
    outline-offset: 1px;
}
.fluent-pagination__item--active {
    background: var(--fluent-brand, #0078D4);
    color: var(--fluent-neutral-white, #fff);
    border-color: var(--fluent-brand, #0078D4);
}
.fluent-pagination__item--active:hover {
    background: var(--fluent-brand-hover, #106EBE);
    border-color: var(--fluent-brand-hover, #106EBE);
}
.fluent-pagination__item:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.fluent-pagination__ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    color: var(--fluent-on-surface-tertiary, #8a8886);
    font-size: var(--fluent-font-size-300, 14px);
    font-weight: var(--fluent-font-weight-regular, 400);
}
.fluent-pagination__info {
    display: inline-flex;
    align-items: center;
    gap: var(--fluent-space-xs, 4px);
    font-size: var(--fluent-font-size-200, 12px);
    color: var(--fluent-on-surface-secondary, #605e5c);
    padding: 0 var(--fluent-space-sm, 8px);
}

/* ========================================
   FLUENT STAFF HOVER CARD
   ======================================== */
.staff-hover-card {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    min-width: 220px;
    max-width: 280px;
    background: var(--fluent-surface, #fff);
    border: 1px solid var(--fluent-border, #e1dfdd);
    border-radius: var(--fluent-radius-lg, 8px);
    box-shadow: var(--fluent-shadow-8, 0 4px 12px rgba(0,0,0,0.15));
    padding: 12px 14px;
    font-size: var(--fluent-font-size-300, 14px);
    color: var(--fluent-on-surface, #323130);
    z-index: 1050;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--fluent-duration-fast, 0.15s) var(--fluent-easing-standard, ease),
                transform var(--fluent-duration-fast, 0.15s) var(--fluent-easing-standard, ease);
}
.group:hover .staff-hover-card,
.group:focus-within .staff-hover-card {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    pointer-events: auto;
}
.staff-hover-card__arrow {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    background: var(--fluent-surface, #fff);
    border-right: 1px solid var(--fluent-border, #e1dfdd);
    border-bottom: 1px solid var(--fluent-border, #e1dfdd);
}

/* ========================================
   ULTRA-WIDE (min-width: 1536px) — FULL WIDTH LAYOUT
   ======================================== */
@media (min-width: 1536px) {
    /* Tables: tighter cell padding, more data density */
    .table-card-header { padding: var(--fluent-space-lg) var(--fluent-space-xxl); }
    .stat-card { padding: var(--fluent-space-xxl); }
    .card { padding: var(--fluent-space-xxxl); }
}

@media (min-width: 1920px) {
    .stat-card { padding: var(--fluent-space-xxxl); }
    .table-card-header { padding: var(--fluent-space-xl) var(--fluent-space-xxxl); }
}

@media (min-width: 2560px) {
    /* Extra-large screens: increase content density */
    .stat-card { padding: 24px 28px; }
    .stat-card .icon-box { width: 48px; height: 48px; }
    .stat-card .icon-box svg { width: 24px; height: 24px; }
    .card { padding: 32px; }
    .table-card-header { padding: 20px 32px; }
    table th, table td { padding-left: 24px; padding-right: 24px; }
}
