/* ==========================================================================
   BASE STYLES FOR MAGI
   Shared across: Upload Reports, Code Mapping, SAF-T Editor, Firm Register
   ========================================================================== */

:root {
    /* =========== COMPREHENSIVE COLOR SYSTEM =========== */
    
    /* 1. LEGACY BLUES - Keep all your original blue colors */
    --primary-blue: #1e7fcf;
    --secondary-blue: #0d5fa3;
    --light-blue: #e8f4fd;
    --navy-blue: #1a2238;
    --bg-light-blue: #f0f8ff;
    
    /* 2. OFFICIAL NAVY THEME COLORS (from edit-saft) */
    --navy-darkest: #0a1929;
    --navy-dark:   #0f3d5c;
    --navy-main:   #1a5a8e;
    --navy-light:  #2d6a9f;
    --navy-lighter:#5ba3d0;
    --navy-pale:   #8bc4e6;
    
    /* 3. ACCENT COLORS (all your accent colors) */
    --accent-purple: #6c5ce7;
    --accent-teal: #00cec9;
    --accent-orange: #fd79a8;
    --accent-gold: #f4c542;
    --accent-gold-light: #ffd54f;
    --accent-gold-pale: #fff9e6;
    
    /* 4. SEMANTIC STATUS COLORS (multiple definitions combined) */
    /* Success Colors */
    --success-green: #28a745;          /* Original */
    --success-green-alt: #4caf50;      /* New */
    --success: #10b981;                /* Edit-saft */
    --color-success-600: #10b981;
    --color-success-500: #34d399;
    --color-success-400: #a7f3d0;
    
    /* Warning/Orange Colors */
    --warning-orange: #f39c12;         /* Original */
    --warning: #ff9800;                /* Edit-saft */
    --color-warning-600: #ff9800;
    --color-warning-500: #fbbf24;
    --color-warning-400: #fde68a;
    
    /* Error/Red Colors */
    --danger-red: #dc3545;             /* Original */
    --danger-red-alt: #f44336;         /* New */
    --error: #f44336;                  /* Edit-saft */
    --color-error-600: #f44336;
    --color-error-500: #f87171;
    --color-error-400: #fca5a5;
    
    /* Info Colors */
    --info: #2196f3;                   /* Edit-saft */
    --color-info-600: #2196f3;
    --color-info-500: #60a5fa;
    --color-info-400: #93c5fd;
    
    /* 5. TEAL COLORS */
    --teal: #5dbcd2;
    --teal-light: #a8e6f7;
    
    /* 6. TEXT COLORS */
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --text-light-alt: #546e7a;
    --color-text-primary: #2c3e50;
    --color-text-secondary: #6c757d;
    --color-text-tertiary: #95a1b3;
    
    /* 7. BACKGROUND COLORS */
    --bg-cream: #fff9e6;
    --color-gray-50:  #f9fafb;
    --color-gray-100: #f0f2f5;
    --color-gray-200: #e3e7ec;
    --color-gray-300: #d1d7df;
    --color-gray-400: #b8c0cc;
    --color-gray-500: #95a1b3;
    --color-gray-600: #6c7a8a;
    --color-gray-700: #4a5568;
    --color-gray-800: #374151;
    --color-gray-900: #1a202c;
    
    /* 8. OPACITY VARIATIONS (all your opacity colors) */
    --blue-5: rgba(30, 127, 207, 0.05);
    --blue-10: rgba(30, 127, 207, 0.1);
    --blue-15: rgba(30, 127, 207, 0.15);
    --blue-20: rgba(30, 127, 207, 0.2);
    --blue-30: rgba(30, 127, 207, 0.3);
    
    --gold-5: rgba(244, 197, 66, 0.05);
    --gold-10: rgba(244, 197, 66, 0.1);
    --gold-15: rgba(244, 197, 66, 0.15);
    --gold-20: rgba(244, 197, 66, 0.2);
    --gold-30: rgba(244, 197, 66, 0.3);
    
    --teal-5: rgba(93, 188, 210, 0.05);
    --teal-10: rgba(93, 188, 210, 0.1);
    --teal-15: rgba(93, 188, 210, 0.15);
    
    /* 9. SHADOW COLORS */
    --shadow-light: rgba(0, 0, 0, 0.08);
    --shadow-medium: rgba(0, 0, 0, 0.12);
    --shadow-heavy: rgba(0, 0, 0, 0.2);
    --shadow-blue: rgba(30, 127, 207, 0.3);
    --shadow-gold: rgba(244, 197, 66, 0.3);
    
    /* =========== SPACING SYSTEM =========== */
    --spacing-xxs: 0.125rem;    /* 2px */
    --spacing-xs:  0.25rem;     /* 4px */
    --spacing-sm:  0.5rem;      /* 8px */
    --spacing-md:  0.75rem;     /* 12px */
    --spacing-lg:  1rem;        /* 16px */
    --spacing-xl:  1.25rem;     /* 20px */
    --spacing-xxl: 1.5rem;      /* 24px */
    --spacing-3xl: 2rem;        /* 32px */
    --spacing-4xl: 2.5rem;      /* 40px */
    
    /* =========== TYPOGRAPHY =========== */
    --font-family-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-family-mono: 'SF Mono', 'Monaco', 'Consolas', monospace;
    
    /* Font Sizes */
    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.8125rem;  /* 13px */
    --font-size-base: 0.875rem; /* 14px */
    --font-size-lg: 0.9375rem;  /* 15px */
    --font-size-xl: 1rem;       /* 16px */
    --font-size-xxl: 1.125rem;  /* 18px */
    --font-size-3xl: 1.25rem;   /* 20px */
    --font-size-4xl: 1.5rem;    /* 24px */
    --font-size-5xl: 1.75rem;   /* 28px */
    --font-size-6xl: 2rem;      /* 32px */
    
    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-base: 1.5;
    --line-height-loose: 1.75;
    
    /* Font Weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* =========== BORDER RADIUS =========== */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 10px;
    --radius-2xl: 12px;
    --radius-3xl: 16px;
    --radius-full: 9999px;
    
    /* =========== SHADOWS =========== */
    --shadow-xs: 0 1px 1px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.16);
    --shadow-xl: 0 6px 12px rgba(0, 0, 0, 0.2);
    --shadow-2xl: 0 8px 16px rgba(0, 0, 0, 0.24);
    --shadow-inner: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    
    /* =========== TRANSITIONS =========== */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* =========== COMPONENT SIZES =========== */
    --button-height-sm: 28px;
    --button-height-md: 32px;
    --button-height-lg: 40px;
    --input-height: 36px;
    --header-height: 56px;
    --sidebar-width: 280px;
    
    /* =========== Z-INDEX LAYERS =========== */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
    
    /* =========== LAYOUT =========== */
    --container-max-width: 1600px;
    --container-padding: var(--spacing-xl);
    
    /* =========== SEMANTIC TOKENS (Optional for future use) =========== */
    --color-primary: var(--navy-main);
    --color-primary-hover: var(--navy-light);
    --color-primary-light: var(--navy-lighter);
    
    --color-bg-primary: var(--color-gray-100);
    --color-bg-secondary: var(--color-gray-50);
    --color-bg-surface: white;
    --color-bg-elevated: var(--color-gray-50);
    
    --color-border-light: var(--color-gray-200);
    --color-border-medium: var(--color-gray-300);
    --color-border-heavy: var(--color-gray-400);
    
    --color-text-inverse: white;
}

/* ==========================================================================
   BASE STYLES
   ========================================================================== */
*,
*::before,
*::after {
    margin: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-family-sans);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-dark);
    background: linear-gradient(135deg, var(--light-blue) 0%, rgba(255, 255, 255, 0.9) 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--text-dark);
    margin-bottom: var(--spacing-md);
}

h1 { font-size: var(--font-size-5xl); }
h2 { font-size: var(--font-size-4xl); }
h3 { font-size: var(--font-size-3xl); }
h4 { font-size: var(--font-size-xxl); }
h5 { font-size: var(--font-size-xl); }
h6 { font-size: var(--font-size-lg); }

p {
    margin-bottom: var(--spacing-md);
    line-height: var(--line-height-base);
}

small {
    font-size: var(--font-size-sm);
    color: var(--text-light);
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--navy-main);
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */
main .container,
.content-container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* Color Utilities */
.text-primary { color: var(--primary-blue); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-info { color: var(--info); }

.text-accent-purple { color: var(--accent-purple); }
.text-accent-teal { color: var(--accent-teal); }
.text-accent-orange { color: var(--accent-orange); }
.text-accent-gold { color: var(--accent-gold); }

.bg-primary { background-color: var(--primary-blue); color: white; }
.bg-success { background-color: var(--success); color: white; }
.bg-warning { background-color: var(--warning); color: white; }
.bg-error { background-color: var(--error); color: white; }
.bg-info { background-color: var(--info); color: white; }

.bg-accent-purple { background-color: var(--accent-purple); color: white; }
.bg-accent-teal { background-color: var(--accent-teal); color: white; }
.bg-accent-orange { background-color: var(--accent-orange); color: white; }
.bg-accent-gold { background-color: var(--accent-gold); color: white; }

/* Spacing Utilities */
.p-xs { padding: var(--spacing-xs); }
.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }
.p-xl { padding: var(--spacing-xl); }

.m-xs { margin: var(--spacing-xs); }
.m-sm { margin: var(--spacing-sm); }
.m-md { margin: var(--spacing-md); }
.m-lg { margin: var(--spacing-lg); }
.m-xl { margin: var(--spacing-xl); }

/* ==========================================================================
   FOCUS STATES (Accessibility)
   ========================================================================== */
:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--blue-20);
}

/* ==========================================================================
   DARK MODE READY - Placeholder for future implementation
   ========================================================================== */
@media (prefers-color-scheme: dark) {
    :root {
        /* Will be implemented later - keeping structure ready */
        /* Example dark mode overrides */
        /*
        --text-dark: #f8fafc;
        --color-text-primary: #f8fafc;
        --color-bg-primary: #0f172a;
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
        */
    }
}


/* ================================================
   PAGE LOADING OVERLAY - CLEAN & PROFESSIONAL
   ================================================ */
.page-loading-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, var(--navy-main) 0%, #1a2a3f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.page-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.page-loading-overlay.gone {
    display: none;
}

.page-loading-content {
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    max-width: 400px;
    padding: 2.5rem;

        border: 1px solid rgba(94, 159, 246, 0.1); /* Whisper-thin blue border */
    border-radius: 32px; /* Slightly more rounded to match logo */
}

.page-loading-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(145deg, 
        rgba(30, 127, 207, 0.15) 0%, 
        rgba(94, 159, 246, 0.08) 100%);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    border: 1.5px solid rgba(94, 159, 246, 0.25);
    color: white;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.page-loading-title {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: white;
    line-height: 1.2;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.page-loading-firm {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    padding: 0.4rem 1.2rem;
    background: rgba(30, 127, 207, 0.1); /* Match to your blue theme */
    border: 1px solid rgba(94, 159, 246, 0.2);
    border-radius: 60px;
    backdrop-filter: blur(4px);
    margin: 0.25rem 0;
}

.page-loading-spinner {
    font-size: 2rem;
    color: var(--primary-blue);
    margin: 0.75rem 0 0.25rem;
    animation: spin 1s linear infinite;
}

.page-loading-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* Optional subtle progress indicator */
.page-loading-progress {
    width: 200px;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.page-loading-progress-bar {
    height: 100%;
    width: 30%;
    background: var(--primary-blue);
    border-radius: 2px;
    animation: progress 1.5s ease-in-out infinite;
    box-shadow: 0 0 8px var(--primary-blue);
}

@keyframes progress {
    0% { width: 0%; margin-left: 0%; }
    50% { width: 60%; margin-left: 20%; }
    100% { width: 0%; margin-left: 100%; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .page-loading-content {
        padding: 2rem;
        gap: 1rem;
    }
    
    .page-loading-logo {
        width: 70px;
        height: 70px;
        font-size: 2.2rem;
    }
    
    .page-loading-title {
        font-size: 1.75rem;
    }
    
    .page-loading-firm {
        font-size: 1rem;
    }
}

/*
==================================================
27. BUTTONS
==================================================
*/

.btn {
    padding: 0.75rem 1.5rem; /* Avg from all files */
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 20px; /* Avg 10-50px; CTA overrides to 50px */
    transition: all 0.3s ease;
    border: 2px solid;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    min-width: 120px;
    text-align: center;
    overflow: hidden; /* For CTA shine/glow */
}

/* Primary Variant (Actions/Submit: Firm/Home/Login/Register) */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    border: none; /* Login/register no border */
    box-shadow: 0 4px 15px rgba(30, 127, 207, 0.3); /* Home/login shadow */
    width: 100%; /* Full-width for login/register */
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 127, 207, 0.4);
    color: white;
    background: linear-gradient(135deg, var(--secondary-blue), var(--primary-blue)); /* Home reverse */
}

.btn-primary:disabled {
    opacity: 0.6;
    transform: none;
    box-shadow: 0 4px 15px rgba(30, 127, 207, 0.3);
}

/* Success Variant (Positive/Add: Firm/Register/Home) */
.btn-success {
    background: linear-gradient(135deg, var(--success-green), #20a138);
    color: white;
    border-color: var(--success-green);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    color: white;
}

/* Warning Variant (Caution: Firm/Home) */
.btn-warning {
    background: linear-gradient(135deg, var(--warning-orange), #e0a800);
    color: white;
    border-color: var(--warning-orange);
}

.btn-warning:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
    color: white;
}

/* Secondary Variant - Premium Subtle Gradient */
/* Replace your current btn-secondary with this */
.btn-secondary {
    background: white;
    color: #2d7aaf;
    border: 2px solid rgba(45, 122, 175, 0.4);
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(45, 122, 175, 0.06);
    color: #1a5a8e;
    border-color: rgba(45, 122, 175, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(45, 122, 175, 0.15);
}

.btn-secondary:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.15);
}

/* Danger Variant (Destructive: Firm/Register) */
.btn-danger {
    background: linear-gradient(135deg, var(--danger-red), #c82333);
    color: white;
    border-color: var(--danger-red);
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
    color: white;
}

/* CTA Variant (Preserves Home Flair) */
.btn-cta {
    background: linear-gradient(135deg, var(--accent-teal), var(--accent-purple));
    color: white;
    border: 2px solid transparent;
    box-shadow: 0 8px 25px rgba(0, 206, 201, 0.3);
    font-size: 1.2rem;
    padding: 1.2rem 3rem;
    border-radius: 50px;
    position: relative;
    overflow: hidden;
}

.btn-cta:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 206, 201, 0.4);
    color: white;
}

.btn-cta .btn-glow {
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    background: linear-gradient(135deg, var(--accent-teal), var(--accent-purple));
    border-radius: 50px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.btn-cta:hover .btn-glow {
    opacity: 1;
}

.btn-cta .btn-shine {
    position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-cta:hover .btn-shine {
    left: 100%;
}


/* Modal Variant (Dialog: Home) */
.btn-modal {
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-weight: 600;
}

.btn-modal.confirm { background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue)); color: white; }
.btn-modal.cancel { background: #6c757d; color: white; border-radius: 50%; width: 32px; height: 32px; padding: 0; font-size: 14px; }
.btn-modal.warning { background: linear-gradient(135deg, var(--warning-orange), #e0a800); color: white; }

.btn-modal:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-modal.cancel:hover { background: var(--danger-red); transform: scale(1.1) rotate(180deg); box-shadow: 0 4px 15px rgba(220,53,69,0.3); }

/* Field Controls (Toggle: Register - Small Secondary) */
.btn-field-control {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 20px;
}

.btn-field-control.active { /* For mandatory/optional toggle */
    background: var(--primary-blue); /* Or secondary */
    color: white;
}

/* Disabled (Global - All Files) */
.btn:disabled, .btn-disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

.btn:disabled:hover, .btn-disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Responsive (All Files) */
@media (max-width: 768px) {
    .btn-full { width: 100%; max-width: 300px; padding: 1rem 2rem; font-size: 1.1rem; }
}

/*
==================================================
27. ALLERTS
==================================================
*/



.alert {
    border-radius: 12px;
    border: none;
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: var(--danger-red);
}

.alert-success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: var(--success-green);
}


/* ==========================================================================
   DELETE FIRM MODAL - CONSOLIDATED FIX
   ========================================================================== */

/* ============================================
   CRITICAL Z-INDEX & CLICKABILITY FIXES
   ============================================ */

/* Fix #1: Remove container's stacking context when modal is open */
body.modal-open .container {
    z-index: auto !important;
}

/* Fix #2: Force modal to create its own root-level stacking context */
#deleteFirmModal {
    position: fixed !important;
    z-index: 1060 !important;
}

#deleteFirmModal.modal.show {
    z-index: 1060 !important;
}

#deleteFirmModal .modal-dialog {
    z-index: 1061 !important;
    pointer-events: auto !important;
}

#deleteFirmModal .modal-content {
    z-index: 1062 !important;
    pointer-events: auto !important;
}

/* Fix #3: Make backdrop non-clickable */
.modal-backdrop {
    z-index: 1040 !important;
    pointer-events: none !important;
}

/* Fix #4: Hide custom modal when Bootstrap modal is open */
body.modal-open #userActionModal {
    display: none !important;
}

/* Fix #5: Force ALL modal content to be clickable */
#deleteFirmModal,
#deleteFirmModal *,
#deleteFirmModal button,
#deleteFirmModal form,
#deleteFirmModal input {
    pointer-events: auto !important;
}

/* ============================================
   MODAL LAYOUT & DIMENSIONS
   ============================================ */

/* Make modal wider */
#deleteFirmModal .modal-dialog {
    max-width: 900px !important;
}

/* Modal content with max-height and flex layout for scrolling */
#deleteFirmModal .modal-content {
    border: 2px solid #dc3545;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

/* Header - fixed, no scroll */
#deleteFirmModal .modal-header {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border-bottom: none;
    flex-shrink: 0;
}

/* Body - scrollable */
#deleteFirmModal .modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* Footer - fixed, no scroll */
#deleteFirmModal .modal-footer {
    background: #f8f9fa;
    border-top: 2px solid #dee2e6;
    flex-shrink: 0;
}

/* ============================================
   RED SCROLLBAR
   ============================================ */

/* Webkit browsers (Chrome, Safari, Edge) */
#deleteFirmModal .modal-body::-webkit-scrollbar {
    width: 12px;
}

#deleteFirmModal .modal-body::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 10px;
}

#deleteFirmModal .modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #dc3545 0%, #c82333 100%);
    border-radius: 10px;
    border: 2px solid #f8f9fa;
}

#deleteFirmModal .modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #c82333 0%, #bd2130 100%);
}

/* Firefox scrollbar */
#deleteFirmModal .modal-body {
    scrollbar-width: thin;
    scrollbar-color: #dc3545 #f8f9fa;
}

/* ============================================
   FIRM NAME VISIBILITY FIX
   ============================================ */

/* Force firm name alert to ALWAYS be visible */
#deleteFirmModal .alert-danger {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    border-left: 4px solid #dc3545;
    background: #f8d7da;
}

/* Ensure firm name span is always visible */
#deleteFirmName {
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-weight: 600 !important;
    font-size: 1.1em !important;
}

/* Ensure warning alert is always visible */
#deleteFirmModal .alert-warning {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    border-left: 4px solid #ffc107;
    background: #fff3cd;
}

/* ============================================
   CATEGORY CARDS STYLING
   ============================================ */

.delete-category-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    height: 100%;
    background: #f8f9fa;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.delete-category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.2);
}

/* ============================================
   MODAL RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    #deleteFirmModal .modal-dialog {
        max-width: 95% !important;
        margin: 1rem auto;
    }
    
    #deleteFirmModal .modal-body {
        padding: 1rem;
    }
    
    #deleteFirmModal .modal-header,
    #deleteFirmModal .modal-footer {
        padding: 1rem 1.5rem;
    }
}

/* ============================================
   CUSTOM USER ACTION MODAL (separate modal)
   ============================================ */

#userActionModal.custom-modal {
    /* full‑screen fixed container just like other custom modals */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;                  /* shown via `style="display:flex"` in JS */
    align-items: center;
    justify-content: center;
    z-index: 1020 !important;
    pointer-events: none;           /* disable interaction until shown */
}

/* when the inline style contains flex or block we want pointer events */
#userActionModal[style*="flex"],
#userActionModal[style*="block"] {
    pointer-events: auto !important;
}

.user-action-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.16s ease;
    cursor: pointer;
    z-index: 1019 !important;
}

/* core content box */
.user-action-content {
    position: relative;
    background: linear-gradient(135deg, rgba(10, 37, 64, 0.98), rgba(20, 47, 74, 0.98));
    border: 0.75px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 80px rgba(45, 122, 175, 0.15);
    width: 90%;
    max-width: 357px;
    overflow: hidden;
    animation: modalSlideIn 0.24s ease;
    pointer-events: auto;
    z-index: 1021;
}

.user-action-header {
    padding: 1rem;
    background: linear-gradient(135deg, rgba(45, 122, 175, 0.2), rgba(64, 143, 196, 0.15));
    border-bottom: 0.75px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-action-header h5 {
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.9375rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    max-width: 85%;
}

.user-action-header h5 span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-action-close {
    background: rgba(255, 255, 255, 0.1);
    border: 0.75px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.16s ease;
    flex-shrink: 0;
}

.user-action-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
    transform: scale(1.1);
}

.user-action-body {
    padding: 0.75rem;
}

.user-action-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 0.75px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.24s ease;
    cursor: pointer;
}

.user-action-item:hover {
    background: linear-gradient(135deg, rgba(45, 122, 175, 0.3), rgba(64, 143, 196, 0.2));
    border-color: rgba(45, 122, 175, 0.5);
    color: white;
}


/* ==========================================================================
   FOOTER ANIMATIONS
   ========================================================================== */

@keyframes divider-glow {
    0%, 100% {
        opacity: 0.3;
        transform: translateX(-50%) scaleX(1);
    }
    50% {
        opacity: 0.6;
        transform: translateX(-50%) scaleX(1.2);
    }
}

/* ==========================================================================
   FOOTER RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .footer {
        padding: 3rem 0 1.5rem;
    }
    
    .footer-main {
        margin-bottom: 2rem;
    }
    
    .social-icons {
        justify-content: flex-start;
    }
    
    .footer-legal {
        justify-content: flex-start;
        margin-top: 1rem;
    }
    
    .contact-item {
        align-items: center;
    }
}






.status-banner {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 500;
    font-size: 0.95rem;
}

.status-banner.status-mapping {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    border: 1px solid #ffc107;
    color: #856404;
}

.status-banner.status-completed {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #28a745;
    color: #155724;
}

.status-banner.status-editing {
    background: linear-gradient(135deg, #cce5ff 0%, #b8daff 100%);
    border: 1px solid #007bff;
    color: #004085;
}

.status-banner.status-validating {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    border: 1px solid #ffc107;
    color: #856404;
}

.status-banner.status-generated {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #28a745;
    color: #155724;
}
/* ── Shared modal close button (white-on-dark, used across all modals) ── */
.modal-close-btn {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    border-radius: 7px;
    border: 1.5px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.88);
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    transform: scale(1.08);
}
