/* ============================================
   SMOOTH THEME TRANSITIONS (Minimal CSS)
   ============================================ */
/* Bootstrap handles most theming - we just add smooth transitions */
html,
body,
.card,
.form-control,
.form-select,
.btn,
.alert,
.modal-content,
input,
textarea,
select {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

html, body {
    font-family: 'Inter', 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 15.4px;
    scroll-behavior: smooth;
}

a, .btn-link {
    color: #006bb7;
}

/* ============================================
   ENHANCED BUTTON STYLES (COMPACT)
   ============================================ */

.btn {
    font-weight: 600;
    letter-spacing: 0.2px;
    border-radius: 0.4rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    padding: -0.45rem 1.1rem;
    font-size: 0.9625rem;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 250px;
    height: 250px;
}

.btn-primary {
    color: #fff;
    background: #4094f5; /*linear-gradient(135deg, #1b6ec2 0%, #1558a8 100%)*/;
    border: none;
    box-shadow: 0 3px 10px rgba(27, 110, 194, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1558a8 0%, #124a8f 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(27, 110, 194, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    border: none;
    box-shadow: 0 3px 10px rgba(108, 117, 125, 0.25);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    border: none;
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.25);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: none;
    box-shadow: 0 3px 10px rgba(220, 53, 69, 0.25);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    border: none;
    box-shadow: 0 3px 10px rgba(255, 193, 7, 0.25);
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    border: none;
    box-shadow: 0 3px 10px rgba(23, 162, 184, 0.25);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.08rem white, 0 0 0 0.2rem #258cfb;
}

/* ============================================
   ENHANCED FORM STYLES (COMPACT)
   ============================================ */

.form-control, .form-select {
    border-radius: 0.4rem;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    padding: 0.55rem 0.9625rem;
    font-size: 0.9625rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.15rem rgba(27, 110, 194, 0.12);
    transform: translateY(-1px);
}

.form-floating {
    position: relative;
}

.form-floating > label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9625rem;
}

.content {
    padding-top: 1rem;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

h1 {
    font-size: 2.2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: slideInLeft 0.5s ease;
}

h2 {
    font-size: 1.7875rem;
    color: var(--text-primary);
}

h3 {
    font-size: 1.375rem;
    color: var(--text-primary);
}

h4 {
    font-size: 1.16875rem;
    color: var(--text-primary);
}

h5 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

h1:focus {
    outline: none;
}

/* ============================================
   ENHANCED VALIDATION STYLES
   ============================================ */

.valid.modified:not([type=checkbox]) {
    outline: 1.5px solid #26b050;
    outline-offset: 1.5px;
}

.invalid {
    outline: 1.5px solid #e50000;
    outline-offset: 1.5px;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.validation-message {
    color: #e50000;
    font-size: 0.89375rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    animation: slideDown 0.3s ease;
}

.validation-message::before {
    content: '⚠';
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   ENHANCED TABLE STYLES (COMPACT)
   ============================================ */

.table, .quickgrid {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--glass-shadow);
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
}

.table thead, .quickgrid thead th {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
    color: white !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.table thead th, .quickgrid thead th {
    font-weight: 700;
    font-size: 0.89375rem;
    letter-spacing: 0.5px;
    padding: 0.9rem 1rem;
    border: none;
}

.table tbody tr, .quickgrid tbody tr {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.table tbody tr:hover, .quickgrid tbody tr:hover {
    background: var(--hover-bg) !important;
    transform: scale(1.001);
}

.table tbody td, .quickgrid tbody td {
    padding: 0.85rem 1rem;
    border-color: var(--border-color);
    vertical-align: middle;
    font-size: 0.9375rem;
}

/* ============================================
   ENHANCED CARD STYLES (CRYSTALLINE GLASS)
   ============================================ */

.card {
    border-radius: 18px;
    border: 1px solid var(--border-color);
    box-shadow: var(--glass-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--glass-shadow), 0 0 25px rgba(99, 102, 241, 0.2);
    border-color: var(--border-hover);
}

.card-header {
    background: rgba(99, 102, 241, 0.05);
    color: inherit;
    font-weight: 600;
    padding: 0.9625rem 1.2375rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.03125rem;
}

.card-body {
    padding: 1.2375rem;
}

.card-footer {
    background: rgba(15, 23, 42, 0.2);
    border-top: 1px solid var(--border-color);
    padding: 0.825rem 1.2375rem;
}
    padding: 0.825rem 1.2375rem;
}



/* ============================================
   ALERT STYLES (COMPACT)
   ============================================ */

.alert {
    border-radius: 0.625rem;
    border: none;
    padding: 0.825rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.6875rem;
    animation: slideInRight 0.4s ease;
    box-shadow: var(--shadow-sm);
    font-size: 0.9625rem;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-success::before {
    content: '✓';
    font-size: 1.2375rem;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.alert-danger::before {
    content: '✕';
    font-size: 1.2375rem;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    color: #856404;
}

.alert-warning::before {
  /* content: '⚠';
    font-size: 1.2375rem;*/
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

.alert-info::before {
    content: '' !important;
    font-size: 1.2375rem;
}

/* ============================================
   BADGE STYLES (COMPACT)
   ============================================ */

.badge {
    border-radius: 0.375rem;
    padding: 0.275rem 0.6875rem;
    font-weight: 600;
    font-size: 0.89375rem;
    letter-spacing: 0.2px;
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.spinner-border {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   ENHANCED ERROR BOUNDARY
   ============================================ */

.blazor-error-boundary {
    background: linear-gradient(135deg, #b32121 0%, #8b1a1a 100%);
    padding: 0.9625rem 0.9625rem 0.9625rem 3.52rem;
    color: white;
    border-radius: 0.625rem;
    box-shadow: var(--shadow-xl);
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ============================================
   CSS VARIABLES FOR LIGHT AND DARK THEMES (CRYSTALLINE GLASS & GLASSMORPHISM)
   ============================================ */

:root, [data-theme="light"], [data-bs-theme="light"] {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-rgb: 99, 102, 241;
    --secondary-color: #64748b;
    --secondary-rgb: 100, 116, 139;
    --bg-primary: #f0f4f9;
    --bg-secondary: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.82);
    --sidebar-bg: rgba(15, 23, 42, 0.94);
    --hover-bg: rgba(99, 102, 241, 0.08);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-hover: #ffffff;
    --border-color: rgba(226, 232, 240, 0.8);
    --border-glass: rgba(255, 255, 255, 0.6);
    --border-hover: rgba(99, 102, 241, 0.4);
    --danger-color: #ef4444;
    --danger-rgb: 239, 68, 68;
    --success-color: #10b981;
    --success-rgb: 16, 185, 129;
    --warning-color: #f59e0b;
    --warning-rgb: 245, 158, 11;
    --info-color: #06b6d4;
    --info-rgb: 6, 182, 212;
    --btn-bg-opacity: 0.1;
    --btn-border-opacity: 0.6;
    --glass-blur: blur(20px);
    --glass-shadow: 0 20px 50px rgba(0, 0, 0, 0.08), 0 0 25px rgba(99, 102, 241, 0.1);
    --glass-glow: 0 0 20px rgba(99, 102, 241, 0.15);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.04);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 15px 35px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 25px 60px rgba(0, 0, 0, 0.16);
}

/* Ensure the sidebar background is ALWAYS dark in both light and dark themes */
.sidebar,
.nav-container,
[data-theme="light"] .sidebar,
[data-theme="light"] .nav-container,
[data-bs-theme="light"] .sidebar,
[data-bs-theme="light"] .nav-container {
    background: rgba(15, 23, 42, 0.96) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.sidebar .nav-link,
.nav-container .nav-link,
[data-theme="light"] .sidebar .nav-link,
[data-theme="light"] .nav-container .nav-link {
    color: #cbd5e1 !important;
}

.sidebar .nav-link:hover,
.nav-container .nav-link:hover,
.sidebar .nav-link.active,
.nav-container .nav-link.active,
[data-theme="light"] .sidebar .nav-link.active,
[data-theme="light"] .nav-container .nav-link.active {
    color: #ffffff !important;
}

[data-theme="dark"], [data-bs-theme="dark"] {
    --primary-color: #818cf8;
    --primary-hover: #6366f1;
    --primary-rgb: 129, 140, 248;
    --secondary-color: #94a3b8;
    --secondary-rgb: 148, 163, 184;
    --bg-primary: #090d16;
    --bg-secondary: #0f172a;
    --card-bg: rgba(15, 23, 42, 0.78);
    --sidebar-bg: rgba(10, 14, 26, 0.94);
    --hover-bg: rgba(99, 102, 241, 0.14);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-hover: #0f172a;
    --border-color: rgba(255, 255, 255, 0.12);
    --border-glass: rgba(255, 255, 255, 0.16);
    --border-hover: rgba(129, 140, 248, 0.45);
    --danger-color: #f87171;
    --danger-rgb: 248, 113, 113;
    --success-color: #34d399;
    --success-rgb: 52, 211, 153;
    --warning-color: #fbbf24;
    --warning-rgb: 251, 191, 36;
    --info-color: #22d3ee;
    --info-rgb: 34, 211, 238;
    --btn-bg-opacity: 0.2;
    --btn-border-opacity: 0.4;
    --glass-blur: blur(20px);
    --glass-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 35px rgba(99, 102, 241, 0.2);
    --glass-glow: 0 0 25px rgba(99, 102, 241, 0.3);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 45px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 30px 70px rgba(0, 0, 0, 0.7);
}

/* Ensure theme changes are smooth */
*, *::before, *::after {
    transition: background-color 0.25s ease-in-out, 
                border-color 0.25s ease-in-out, 
                color 0.25s ease-in-out,
                box-shadow 0.25s ease-in-out,
                backdrop-filter 0.25s ease-in-out;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.border {
    border-color: var(--border-color) !important;
}

/* ============================================
   THEME SWITCHER COMPONENT (COMPACT)
   ============================================ */

.theme-switcher {
    display: flex;
    align-items: center;
    gap: 0.4125rem;
    padding: -0.4125rem;
    background: var(--card-bg);
    border-radius: 0.6875rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.theme-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.3375rem;
    height: 2.3375rem;
    border: none;
    border-radius: 0.44rem;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.theme-button:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.theme-button.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(var(--primary-rgb), 0.25);
}

.theme-button.active::after {
    content: '';
    position: absolute;
    bottom: -0.22rem;
    left: 50%;
    transform: translateX(-50%);
    width: 0.4125rem;
    height: 0.4125rem;
    background: var(--primary-color);
    border-radius: 50%;
}

.theme-button svg {
    width: 1.2375rem;
    height: 1.2375rem;
}

.theme-switcher[data-user-set="true"] {
    border-width: 1.65px;
    border-color: var(--primary-color);
}

.theme-switcher[data-user-set="true"]::before {
    content: '✓';
    position: absolute;
    top: -0.4125rem;
    right: -0.4125rem;
    font-size: 0.75625rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 0.9625rem;
    height: 0.9625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* ============================================
   SCROLLBAR STYLES (COMPACT)
   ============================================ */

::-webkit-scrollbar {
    width: 11px;
    height: 11px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5.5px;
    border: 2.2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.glass-effect {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Modal overlay styles - NO BLUR */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1040 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.dark-modal-overlay {
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.modal-content-custom {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-clip: padding-box;
    border-radius: 0.75rem;
    outline: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Remove filter from page elements when modal is open */
body.modal-open {
    filter: none !important;
}

body.modal-open .top-row {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.modal-open .page,
body.modal-open main {
    filter: none !important;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-hover {
    transition: all 0.3s ease;
}

.shadow-hover:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    html, body {
        font-size: 14.3px;
    }

    .theme-switcher {
        gap: 0.275rem;
        padding: 0.33rem;
    }

    .theme-button {
        width: 2.0625rem;
        height: 2.0625rem;
    }

    .theme-button svg {
        width: 1.1rem;
        height: 1.1rem;
    }
    
    h1 {
        font-size: 1.925rem;
    }
    
    h2 {
        font-size: 1.5125rem;
    }

    h3 {
        font-size: 1.2375rem;
    }

    .btn {
        padding: 0.44rem 0.9625rem;
        font-size: 0.89375rem;
    }
}

/* ============================================
   QUICKGRID STYLES
   ============================================ */

.grid-container {
    width: 100%;
    overflow-x: auto;
}

.quickgrid {
    width: 100%;
    border-collapse: collapse;
}

.quickgrid thead th {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    font-weight: 600;
    /*text-transform: uppercase;*/
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    padding: 1rem;
    border: none;
    position: sticky;
    top: 0;
    z-index: 10;
}

.quickgrid thead th[aria-sort] {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 2rem;
}

/*.quickgrid thead th[aria-sort]::after {
    content: '⇅';
    position: absolute;
    right: 0.75rem;
    opacity: 0.5;
    font-size: 0.875rem;
}

.quickgrid thead th[aria-sort="ascending"]::after {
    content: '↑';
    opacity: 1;
}

.quickgrid thead th[aria-sort="descending"]::after {
    content: '↓';
    opacity: 1;
}*/

.quickgrid thead th:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-color) 100%);
}

.quickgrid tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.quickgrid tbody tr:hover {
    background: var(--hover-bg);
    transform: scale(1.002);
}

/* Selected row highlighting - Light theme */
.quickgrid tbody tr.selected-row {
    background: rgba(13, 110, 253, 0.15) !important;
    /*border: 2px solid var(--primary-color);*/
    box-shadow: inset 0 0 0 1px rgba(13, 110, 253, 0.3);
}

.quickgrid tbody tr.selected-row:hover {
    background: rgba(13, 110, 253, 0.2) !important;
}

/* Selected row highlighting - Dark theme */
[data-theme="dark"] .quickgrid tbody tr.selected-row,
[data-bs-theme="dark"] .quickgrid tbody tr.selected-row {
    background: rgba(74, 158, 255, 0.2) !important;
   /* border: 2px solid var(--primary-color);*/
    box-shadow: inset 0 0 0 1px rgba(74, 158, 255, 0.4);
}

[data-theme="dark"] .quickgrid tbody tr.selected-row:hover,
[data-bs-theme="dark"] .quickgrid tbody tr.selected-row:hover {
    background: rgba(74, 158, 255, 0.25) !important;
}


.quickgrid tbody td {
    padding: 0.875rem;
    vertical-align: middle;
    font-size: 0.9375rem;
    /* Prevent text wrapping and enable ellipsis for long text */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px; /* Adjustable based on needs */
}

/* Theme-Aware Secondary Action Buttons */
.btn-outline-secondary,
.btn-secondary {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    opacity: 1 !important;
    visibility: visible !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-outline-secondary:hover,
.btn-secondary:hover {
    background: var(--hover-bg) !important;
    border-color: var(--primary-color, #6366f1) !important;
    color: var(--primary-color, #6366f1) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15) !important;
}

/* QuickGrid Column Options */
.col-options-button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    margin-left: 0.5rem;
    border-radius: 0.25rem;
    transition: background 0.2s;
}

.col-options-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .col-options-button,
[data-bs-theme="light"] .col-options-button {
    color: white;
}

[data-theme="light"] .col-options-button:hover,
[data-bs-theme="light"] .col-options-button:hover {
    background: rgba(255, 255, 255, 0.15);
}

.search-box {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
}

.search-box input,
.search-box select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

/* ============================================
   GLOBAL CRYSTALLINE DROPDOWNS, FORM SELECTS & ACTION BUTTONS
   ============================================ */

.dropdown-menu {
    background: var(--card-bg) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 16px !important;
    box-shadow: var(--glass-shadow) !important;
    color: var(--text-primary) !important;
    padding: 0.5rem !important;
}

.dropdown-item {
    color: var(--text-primary) !important;
    border-radius: 10px !important;
    padding: 0.55rem 0.85rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.dropdown-item:hover, .dropdown-item:focus {
    background: var(--hover-bg) !important;
    color: var(--primary-color) !important;
    transform: translateX(3px) !important;
}

.form-select, .form-control {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 10px !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    transition: all 0.2s ease !important;
}

.form-select:focus, .form-control:focus {
    border-color: var(--primary-color, #6366f1) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3) !important;
}

select option {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    padding: 0.5rem !important;
}

.action-btn, .btn-toolbar .btn {
    border-radius: 10px !important;
    font-weight: 600 !important;
    letter-spacing: 0.2px !important;
    backdrop-filter: blur(10px) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.action-btn:hover:not(:disabled), .btn-toolbar .btn:hover:not(:disabled) {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3) !important;
}

/* ============================================
   GLOBAL ULTRA-PREMIUM BLUE PRIMARY BUTTON STYLES
   ============================================ */
.btn-primary,
.btn-modern.btn-primary,
.cm-btn-save,
button.btn-primary,
a.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #3b82f6 50%, #2563eb 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 20px rgba(99, 102, 241, 0.35) !important;
    border-radius: 12px !important;
    padding: 0.55rem 1.25rem !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-primary:hover:not(:disabled),
.btn-modern.btn-primary:hover:not(:disabled),
.cm-btn-save:hover:not(:disabled),
button.btn-primary:hover:not(:disabled),
a.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #4f46e5 0%, #2563eb 50%, #1d4ed8 100%) !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 10px 28px rgba(99, 102, 241, 0.5) !important;
    transform: translateY(-2px) !important;
}

.btn-primary:active:not(:disabled),
.btn-modern.btn-primary:active:not(:disabled),
button.btn-primary:active:not(:disabled) {
    transform: translateY(0) !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(99, 102, 241, 0.3) !important;
}

.btn-primary:focus,
.btn-modern.btn-primary:focus {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 0 3px rgba(99, 102, 241, 0.45) !important;
}

/* ============================================
   TEXT TRUNCATION AND TOOLTIP STYLES
   ============================================ */
/* Ensure cell-clickable divs inherit truncation behavior */
.quickgrid tbody td .cell-clickable {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
}

/* Utility class for cells with custom max-width */
.text-truncate-cell {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: inline-block !important;
}

/* Override Bootstrap's text-truncate to ensure it works in tables */
.quickgrid .text-truncate {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* ============================================
   ENHANCED PAGINATION STYLES (QuickGrid Style)
   ============================================ */
.paginator {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    padding: 1rem 0;
}

.paginator button {
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0.5rem 0.75rem;
    border: 2px solid transparent;
    background: linear-gradient(135deg, #4094f5 0%, #2673d8 100%);
    color: white;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(64, 148, 245, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.paginator button:hover:not(:disabled) {
    background: linear-gradient(135deg, #2673d8 0%, #1558a8 100%);
    box-shadow: 0 4px 12px rgba(64, 148, 245, 0.35);
    border-color: transparent;
}

.paginator button:active:not(:disabled) {
    box-shadow: 0 2px 6px rgba(64, 148, 245, 0.25);
}

.paginator button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #6c757d;
    box-shadow: none;
}

/* Current/Active Page Button */
.paginator button.current-page {
    background: linear-gradient(135deg, #1558a8 0%, #124a8f 100%);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px rgba(21, 88, 168, 0.4), 
                0 0 0 3px rgba(64, 148, 245, 0.2);
    font-weight: 700;
    transform: scale(1.05);
}

.paginator button.current-page:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #1558a8 0%, #124a8f 100%);
}

/* Navigation Arrows - Make them highly visible INSIDE the button */
/* First page button */
    .paginator button[aria-label*="Go to first page"]::before,
    .paginator button[aria-label*="first"]::before {
        content: '◀◀ ';
        font-size: 10px;
        font-weight: 700;
        opacity: 0.95;
    }

/* Previous page button */
    .paginator button[aria-label*="Go to previous page"]::before,
    .paginator button[aria-label*="previous"]::before {
        content: '◀ ';
        font-size: 11px;
        font-weight: 900;
    }

/* Next page button - Arrow pointing RIGHT */
    .paginator button[aria-label*="Go to next page"]::after,
    .paginator button[aria-label*="next"]::after {
            content: ' ▶';
            font-size: 11px;
            font-weight: 900;
            transform: scaleX(1);
        }
        /* Last page button - Arrow pointing RIGHT */
    .paginator button[aria-label*="Go to last page"]::after,
    .paginator button[aria-label*="last"]::after {
        content: ' ▶▶';
        font-size: 10px;
        font-weight: 700;
        opacity: 0.95;
        transform: scaleX(1);
    }
        /* Make navigation buttons wider and show text with arrows */
    .paginator button[aria-label*="Go to first page"],
    .paginator button[aria-label*="first"],
    .paginator button[aria-label*="Go to previous page"],
    .paginator button[aria-label*="previous"],
    .paginator button[aria-label*="Go to next page"],
    .paginator button[aria-label*="next"],
    .paginator button[aria-label*="Go to last page"],
    .paginator button[aria-label*="last"] {
        min-width: auto;
        padding: 0.5rem 1rem;
        font-weight: 700;
        transform: scaleX(1);
    }
            /* Ensure button text is visible */
            .paginator button[aria-label*="Go to first page"]::before,
            .paginator button[aria-label*="first"]::before,
            .paginator button[aria-label*="Go to previous page"]::before,
            .paginator button[aria-label*="previous"]::before,
            .paginator button[aria-label*="Go to next page"]::after,
            .paginator button[aria-label*="next"]::after,
            .paginator button[aria-label*="Go to last page"]::after,
            .paginator button[aria-label*="last"]::after {
                display: inline;
                margin: 0;
            }
        /* Pagination Info Text */
        .paginator .pagination-info {
            color: var(--text-secondary);
            font-size: 0.875rem;
            padding: 0 0.5rem;
            white-space: nowrap;
        }
        /* Dark Theme Adjustments */
        [data-theme="dark"] .paginator button,
        [data-bs-theme="dark"] .paginator button {
            background: linear-gradient(135deg, #4a9eff 0%, #3a8eef 100%);
            box-shadow: 0 2px 8px rgba(74, 158, 255, 0.25);
        }

            [data-theme="dark"] .paginator button:hover:not(:disabled),
            [data-bs-theme="dark"] .paginator button:hover:not(:disabled) {
                background: linear-gradient(135deg, #3a8eef 0%, #2563eb 100%);
                box-shadow: 0 4px 12px rgba(74, 158, 255, 0.4);
            }

            [data-theme="dark"] .paginator button.current-page,
            [data-bs-theme="dark"] .paginator button.current-page {
                background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
                box-shadow: 0 4px 16px rgba(37, 99, 235, 0.5), 0 0 0 3px rgba(74, 158, 255, 0.25);
            }

            [data-theme="dark"] .paginator button:disabled,
            [data-bs-theme="dark"] .paginator button:disabled {
                background: #374151;
            }

        /* light Theme Adjustments */
        [data-theme="light"] .paginator button,
        [data-bs-theme="light"] .paginator button {
            background: linear-gradient(135deg, #4a9eff 0%, #3a8eef 100%);
            box-shadow: 0 2px 8px rgba(74, 158, 255, 0.25);
        }
            
                [data-theme="light"] .paginator button:hover:not(:disabled),
                [data-bs-theme="light"] .paginator button:hover:not(:disabled) {
                    background: linear-gradient(135deg, #3a8eef 0%, #2563eb 100%);
                    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.4);
                }
            
                [data-theme="light"] .paginator button.current-page,
                [data-bs-theme="light"] .paginator button.current-page {
                    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
                    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.5), 0 0 0 3px rgba(74, 158, 255, 0.25);
                }
            
                [data-theme="light"] .paginator button:disabled,
                [data-bs-theme="light"] .paginator button:disabled {
                    background: #374151;
                }

        /* Responsive */
        @media (max-width: 640px) {
            .paginator {
                gap: 0.375rem;
            }

                .paginator button {
                    min-width: 2.25rem;
                    height: 2.25rem;
                    padding: 0.375rem 0.625rem;
                    font-size: 0.8125rem;
                }
        }
        /* Modal Styles Enhancement */
        .modal.show {
            animation: fadeIn 0.3s ease;
        }

        .modal-dialog {
            animation: slideUp 0.3s ease;
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .modal-content, .modal-content-custom {
            border-radius: 20px;
            border: 1px solid rgba(255, 255, 255, 0.16);
            box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 40px rgba(99, 102, 241, 0.25);
            background: var(--card-bg);
            backdrop-filter: var(--glass-blur);
            -webkit-backdrop-filter: var(--glass-blur);
        }

        .modal-header {
            background: rgba(99, 102, 241, 0.08);
            backdrop-filter: blur(12px);
            border-bottom: 1px solid var(--border-color);
            padding: 1.25rem 1.5rem;
            border-top-left-radius: 20px;
            border-top-right-radius: 20px;
        }

        .modal-body {
            padding: 1.5rem;
        }

        .modal-footer {
            background: rgba(15, 23, 42, 0.3);
            border-top: 1px solid var(--border-color);
            padding: 1rem 1.25rem;
            border-bottom-left-radius: 20px;
            border-bottom-right-radius: 20px;
        }
        /* Badge enhancements for login methods */
        .badge {
            display: inline-flex;
            align-items: center;
            gap: 0.25rem;
            padding: 0.375rem 0.75rem;
            font-size: 0.875rem;
            font-weight: 600;
            border-radius: 0.375rem;
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }

            .badge i {
                font-size: 0.875rem;
            }
        /* Loading state for grid */
        .quickgrid-loading {
            text-align: center;
            padding: 3rem;
            color: var(--text-secondary);
        }

            .quickgrid-loading .spinner-border {
                width: 3rem;
                height: 3rem;
                margin-bottom: 1rem;
            }
        /* Empty state */
        .quickgrid-empty {
            text-align: center;
            padding: 3rem;
            color: var(--text-secondary);
        }

            .quickgrid-empty i {
                font-size: 3rem;
                margin-bottom: 1rem;
                opacity: 0.5;
            }
        /* Responsive QuickGrid */
        @media (max-width: 992px) {
            .quickgrid thead th {
                font-size: 0.8125rem;
                padding: 0.75rem;
            }

            .quickgrid tbody td {
                font-size: 0.875rem;
                padding: 0.75rem;
            }
        }

        @media (max-width: 768px) {
            .grid-container {
                border-radius: 0.5rem;
            }

            .quickgrid thead th {
                font-size: 0.75rem;
                padding: 0.625rem;
            }

            .quickgrid tbody td {
                font-size: 0.8125rem;
                padding: 0.625rem;
            }

            .badge {
                font-size: 0.75rem;
                padding: 0.25rem 0.5rem;
            }
        }
        /**************************************/
        /********Custome Css For QuickGrid Changes********/

        .text-muted {
            margin-right: 12px !important;
            margin-left: 12px !important;
        }

        .container-fluid {
            margin: 0 !important;
            padding: 0 !important;
        }

        .row > * {
            margin: 0 !important;
            padding: 0 !important;
        }

        .py-2 {
            padding: 0 !important;
            margin: 0 !important;
        }

        .px-3 {
            padding-right: 1rem !important;
            padding-left: 0.5rem !important;
        }

        .quickgrid[theme=default] > thead > tr > th {
            font-weight: normal;
            padding: 0;
        }

        .border-bottom {
            border-bottom: none !important;
        }
        /* ============================================
   EXPORT NOTIFICATION TOAST STYLES
   ============================================ */

        .toast-container {
            z-index: 9999;
        }

        .toast {
            min-width: 320px;
            border-radius: 0.75rem;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
            animation: slideInUp 0.4s ease-out;
        }

        @keyframes slideInUp {
            from {
                transform: translateY(100%);
                opacity: 0;
            }

            to {
                transform: translateY(0);
                opacity: 1;
            }
        }

        .toast-header {
            border-top-left-radius: 0.75rem;
            border-top-right-radius: 0.75rem;
            padding: 0.75rem 1rem;
            font-weight: 600;
        }

        .toast-body {
            padding: 1rem;
        }

            .toast-body .btn {
                transition: all 0.3s ease;
            }

                .toast-body .btn:hover {
                    transform: translateY(-2px);
                    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
                }
        /* Dark theme toast styles */
        [data-theme="dark"] .toast,
        [data-bs-theme="dark"] .toast {
            background-color: #2d3748;
            color: #e2e8f0;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
        }

        [data-theme="dark"] .toast-header,
        [data-bs-theme="dark"] .toast-header {
            background-color: #10b981;
            border-bottom-color: rgba(255, 255, 255, 0.1);
        }

        [data-theme="dark"] .toast-body,
        [data-bs-theme="dark"] .toast-body {
            background-color: #2d3748;
        }

        /* Custom styling for task notes and attachments metadata cards in both light and dark themes */
        .task-meta-card {
            background-color: #f8f9fa !important;
            color: #212529 !important;
            border: 1px solid #dee2e6 !important;
        }

        .task-meta-card p,
        .task-meta-card h6 {
            color: #212529 !important;
        }

        .task-meta-card small {
            color: #495057 !important;
        }

[data-theme="dark"] .task-meta-card,
[data-bs-theme="dark"] .task-meta-card {
    background-color: #1e2126 !important;
    color: #e2e8f0 !important;
    border: 1px solid #4a5568 !important;
}

        [data-theme="dark"] .task-meta-card p,
        [data-theme="dark"] .task-meta-card h6,
        [data-bs-theme="dark"] .task-meta-card p,
        [data-bs-theme="dark"] .task-meta-card h6 {
            color: #e2e8f0 !important;
        }

        [data-theme="dark"] .task-meta-card small,
        [data-bs-theme="dark"] .task-meta-card small {
            color: #cbd5e1 !important;
        }