/* ============================================
   PREMIUM DESIGN SYSTEM — "Crystalline Glass"
   A world-class design language for light & dark themes
   ============================================ */

/* ============================================
   SMOOTH THEME TRANSITIONS
   ============================================ */
html,
body,
.card,
.form-control,
.form-select,
.btn,
.alert,
.modal-content,
input,
textarea,
select {
    transition: background-color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ============================================
   CSS VARIABLES — LIGHT THEME
   ============================================ */
:root, [data-theme="light"], [data-bs-theme="light"] {
    /* Primary palette — Rich indigo-blue */
    --primary-color: #4f6ef7;
    --primary-hover: #3b5de5;
    --primary-light: #eef1fe;
    --primary-rgb: 79, 110, 247;
    --accent-gradient: linear-gradient(135deg, #4f6ef7 0%, #7c5cfc 50%, #a855f7 100%);
    --accent-gradient-subtle: linear-gradient(135deg, rgba(79,110,247,0.08) 0%, rgba(168,85,247,0.06) 100%);

    /* Secondary */
    --secondary-color: #64748b;

    /* Surfaces */
    --bg-primary: #f0f2f8;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8f9fd;
    --card-bg: rgba(255, 255, 255, 0.82);
    --card-bg-solid: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.9);

    /* Sidebar */
    --sidebar-bg: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);

    /* Interaction */
    --hover-bg: rgba(79, 110, 247, 0.06);
    --active-bg: rgba(79, 110, 247, 0.12);

    /* Text */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;

    /* Borders */
    --border-color: rgba(148, 163, 184, 0.2);
    --border-color-strong: rgba(148, 163, 184, 0.35);
    --focus-ring: rgba(79, 110, 247, 0.35);

    /* Semantic */
    --danger-color: #ef4444;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --danger-bg: rgba(239, 68, 68, 0.08);
    --success-bg: rgba(16, 185, 129, 0.08);
    --warning-bg: rgba(245, 158, 11, 0.08);
    --info-bg: rgba(59, 130, 246, 0.08);

    /* Shadows — Warm, layered */
    --shadow-xs: 0 1px 2px rgba(30, 41, 59, 0.04);
    --shadow-sm: 0 1px 3px rgba(30, 41, 59, 0.06), 0 1px 2px rgba(30, 41, 59, 0.04);
    --shadow: 0 4px 12px rgba(30, 41, 59, 0.07), 0 1px 4px rgba(30, 41, 59, 0.04);
    --shadow-md: 0 6px 20px rgba(30, 41, 59, 0.08), 0 2px 6px rgba(30, 41, 59, 0.05);
    --shadow-lg: 0 12px 32px rgba(30, 41, 59, 0.10), 0 4px 12px rgba(30, 41, 59, 0.06);
    --shadow-xl: 0 20px 48px rgba(30, 41, 59, 0.12), 0 8px 20px rgba(30, 41, 59, 0.08);
    --shadow-glow: 0 0 24px rgba(79, 110, 247, 0.15);
    --shadow-card-hover: 0 16px 40px rgba(79, 110, 247, 0.12), 0 6px 16px rgba(30, 41, 59, 0.08);
}

/* ============================================
   CSS VARIABLES — DARK THEME
   ============================================ */
[data-theme="dark"], [data-bs-theme="dark"] {
    /* Primary palette — Electric blue-violet */
    --primary-color: #818cf8;
    --primary-hover: #6c7bf0;
    --primary-light: rgba(129, 140, 248, 0.12);
    --primary-rgb: 129, 140, 248;
    --accent-gradient: linear-gradient(135deg, #818cf8 0%, #a78bfa 50%, #c084fc 100%);
    --accent-gradient-subtle: linear-gradient(135deg, rgba(129,140,248,0.10) 0%, rgba(192,132,252,0.08) 100%);

    /* Secondary */
    --secondary-color: #94a3b8;

    /* Surfaces */
    --bg-primary: #0b0f1a;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2035;
    --card-bg: rgba(22, 28, 45, 0.75);
    --card-bg-solid: #161c2d;
    --glass-bg: rgba(22, 28, 45, 0.55);
    --glass-border: rgba(148, 163, 184, 0.08);

    /* Sidebar */
    --sidebar-bg: linear-gradient(180deg, #070b14 0%, #0f1524 100%);

    /* Interaction */
    --hover-bg: rgba(129, 140, 248, 0.08);
    --active-bg: rgba(129, 140, 248, 0.15);

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;

    /* Borders */
    --border-color: rgba(148, 163, 184, 0.1);
    --border-color-strong: rgba(148, 163, 184, 0.2);
    --focus-ring: rgba(129, 140, 248, 0.4);

    /* Semantic */
    --danger-color: #f87171;
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --info-color: #60a5fa;
    --danger-bg: rgba(248, 113, 113, 0.12);
    --success-bg: rgba(52, 211, 153, 0.12);
    --warning-bg: rgba(251, 191, 36, 0.12);
    --info-bg: rgba(96, 165, 250, 0.12);

    /* Shadows — Deep, luminous */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.15);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 1px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.45), 0 8px 20px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 30px rgba(129, 140, 248, 0.2);
    --shadow-card-hover: 0 16px 40px rgba(129, 140, 248, 0.15), 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Smooth theme change for all elements */
*, *::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;
}

/* ============================================
   BASE TYPOGRAPHY & BODY
   ============================================ */
html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 15.4px;
    scroll-behavior: smooth;
    text-rendering: optimizeLegibility;
    letter-spacing: -0.01em;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.35s ease, color 0.35s ease;
}

a, .btn-link {
    color: var(--primary-color);
    transition: color 0.2s ease;
}

a:hover, .btn-link:hover {
    color: var(--primary-hover);
}

.border {
    border-color: var(--border-color) !important;
}

/* ============================================
   HEADINGS — Premium gradient & weight
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 750;
    letter-spacing: -0.025em;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
    line-height: 1.25;
}

h1 {
    font-size: 2.2rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: slideInLeft 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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);
}

h1:focus {
    outline: none;
}

/* ============================================
   CONTENT AREA ENTRANCE ANIMATION
   ============================================ */
.content {
    padding-top: 12px;
    padding-bottom: 9px !important;
    animation: fadeInUp 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-15px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(15px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   PREMIUM BUTTON STYLES
   ============================================ */
.btn {
    font-weight: 600;
    letter-spacing: 0.01em;
    border-radius: 0.5rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    padding: 0.5rem 1.15rem;
    font-size: 0.9625rem;
    border: 1px solid transparent;
}

/* Ripple effect on buttons */
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Primary button — Rich gradient with glow */
.btn-primary {
    color: #fff;
    background: var(--accent-gradient);
    border: none;
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.3);
}

.btn-primary:hover {
    background: var(--accent-gradient);
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.4);
    color: #fff;
}

.btn-primary:active {
    transform: translateY(0);
    filter: brightness(0.95);
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
}

/* Secondary */
.btn-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    border: none;
    box-shadow: 0 3px 10px rgba(100, 116, 139, 0.2);
    color: #fff;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(100, 116, 139, 0.3);
    filter: brightness(1.1);
    color: #fff;
}

/* Success */
.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.25);
    color: #fff;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(16, 185, 129, 0.35);
    filter: brightness(1.1);
    color: #fff;
}

/* Danger */
.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.25);
    color: #fff;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(239, 68, 68, 0.35);
    filter: brightness(1.1);
    color: #fff;
}

/* Warning */
.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.25);
    color: #fff;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(245, 158, 11, 0.35);
    filter: brightness(1.1);
    color: #fff;
}

/* Info */
.btn-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.25);
    color: #fff;
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(59, 130, 246, 0.35);
    filter: brightness(1.1);
    color: #fff;
}

/* Focus styles */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.22rem var(--primary-color);
}

/* ============================================
   OUTLINE BUTTON STYLES — Refined borders
   ============================================ */
.btn.btn-outline-primary {
    color: var(--primary-color) !important;
    border: 1.5px solid var(--primary-color) !important;
    background: transparent !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn.btn-outline-primary:hover {
    background: rgba(var(--primary-rgb), 0.08) !important;
    border-color: var(--primary-hover) !important;
    color: var(--primary-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.15);
}

.btn.btn-outline-primary:active {
    background: rgba(var(--primary-rgb), 0.15) !important;
    transform: translateY(0);
}

.btn.btn-outline-success {
    color: var(--success-color) !important;
    border: 1.5px solid var(--success-color) !important;
    background: transparent !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn.btn-outline-success:hover {
    background: var(--success-bg) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.btn.btn-outline-success:active {
    background: rgba(16, 185, 129, 0.18) !important;
    transform: translateY(0);
}

.btn.btn-outline-danger {
    color: var(--danger-color) !important;
    border: 1.5px solid var(--danger-color) !important;
    background: transparent !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn.btn-outline-danger:hover {
    background: var(--danger-bg) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.btn.btn-outline-danger:active {
    background: rgba(239, 68, 68, 0.18) !important;
    transform: translateY(0);
}

.btn.btn-outline-warning {
    color: var(--warning-color) !important;
    border: 1.5px solid var(--warning-color) !important;
    background: transparent !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn.btn-outline-warning:hover {
    background: var(--warning-bg) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.btn.btn-outline-warning:active {
    background: rgba(245, 158, 11, 0.18) !important;
    transform: translateY(0);
}

.btn.btn-outline-info {
    color: var(--info-color) !important;
    border: 1.5px solid var(--info-color) !important;
    background: transparent !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn.btn-outline-info:hover {
    background: var(--info-bg) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.btn.btn-outline-info:active {
    background: rgba(59, 130, 246, 0.18) !important;
    transform: translateY(0);
}

/* Outline button size variants */
.btn.btn-outline-primary.btn-sm,
.btn.btn-outline-success.btn-sm,
.btn.btn-outline-danger.btn-sm,
.btn.btn-outline-warning.btn-sm,
.btn.btn-outline-info.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.875rem;
}

/* ============================================
   PREMIUM FORM STYLES
   ============================================ */
.form-control, .form-select {
    border-radius: 0.5rem;
    border: 1.5px solid var(--border-color-strong);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.55rem 0.9625rem;
    font-size: 0.9625rem;
    background: var(--card-bg-solid);
    color: var(--text-primary);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--focus-ring), var(--shadow-sm);
    transform: translateY(-1px);
    background: var(--card-bg-solid);
}

.form-floating {
    position: relative;
}

.form-floating > label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9625rem;
}

.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;
}

/* ============================================
   VALIDATION STYLES
   ============================================ */
.valid.modified:not([type=checkbox]) {
    outline: 1.5px solid var(--success-color);
    outline-offset: 1.5px;
}

.invalid {
    outline: 1.5px solid var(--danger-color);
    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: var(--danger-color);
    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: '⚠';
}

/* ============================================
   PREMIUM TABLE STYLES
   ============================================ */
.table {
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--card-bg-solid);
    border: 1px solid var(--border-color);
}

.table thead {
    background: var(--accent-gradient);
    color: white;
}

.table thead th {
    font-weight: 600;
    font-size: 0.89375rem;
    letter-spacing: 0.03em;
    padding: 0.825rem;
    border: none;
}

.table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.table tbody tr:hover {
    background: var(--hover-bg);
    transform: scale(1.001);
}

.table tbody td {
    padding: 0.825rem;
    border-color: var(--border-color);
    vertical-align: middle;
    font-size: 0.9625rem;
}

/* ============================================
   PREMIUM CARD STYLES — Glassmorphism
   ============================================ */
.card {
    border-radius: 0.875rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(var(--primary-rgb), 0.15);
}

.card-header {
    color: white;
    font-weight: 600;
    border: none;
    font-size: 1.03125rem;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    padding: 0.825rem 1.25rem;
}

/* ============================================
   PREMIUM ALERT STYLES
   ============================================ */
.alert {
    border-radius: 0.75rem;
    border: none;
    padding: 0.85rem 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    font-size: 0.9625rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-success::before {
    content: '✓';
    font-size: 1.25rem;
    font-weight: 700;
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.alert-danger::before {
    content: '✕';
    font-size: 1.25rem;
    font-weight: 700;
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning-color);
    border-left: 4px solid var(--warning-color);
}


.alert-info {
    background: var(--info-bg);
    color: var(--info-color);
    border-left: 4px solid var(--info-color);
}

.alert-info::before {
    content: '' !important;
    font-size: 1.25rem;
}

/* ============================================
   BADGE STYLES — Refined pills
   ============================================ */
.badge {
    border-radius: 0.5rem;
    padding: 0.3rem 0.7rem;
    font-weight: 600;
    font-size: 0.89375rem;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge i {
    font-size: 0.875rem;
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.spinner-border {
    animation: spin 0.85s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   ERROR BOUNDARY
   ============================================ */
.blazor-error-boundary {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    padding: 0.9625rem 0.9625rem 0.9625rem 3.5rem;
    color: white;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-xl);
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* ============================================
   THEME SWITCHER COMPONENT
   ============================================ */
.theme-switcher {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem;
    background: var(--card-bg-solid);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xs);
}

.theme-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.theme-button:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.theme-button.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 3px 10px rgba(var(--primary-rgb), 0.3);
}

.theme-button.active::after {
    content: '';
    position: absolute;
    bottom: -0.2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 0.35rem;
    height: 0.35rem;
    background: var(--primary-color);
    border-radius: 50%;
}

.theme-button svg {
    width: 1.2rem;
    height: 1.2rem;
}

.theme-switcher[data-user-set="true"] {
    border-width: 1.5px;
    border-color: var(--primary-color);
}

.theme-switcher[data-user-set="true"]::before {
    content: '✓';
    position: absolute;
    top: -0.4rem;
    right: -0.4rem;
    font-size: 0.7rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 0.95rem;
    height: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* ============================================
   PREMIUM SCROLLBAR STYLES
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color-strong);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
    border: 2px solid transparent;
    background-clip: padding-box;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.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.2rem;
        padding: 0.2rem;
    }

    .theme-button {
        width: 2rem;
        height: 2rem;
    }

    .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 — Premium data grid
   ============================================ */
.grid-container {
    width: 100%;
    overflow-x: auto;
}

.btn-toolbar {
    margin-top: 15px !important;
}

.quickgrid {
    width: 100%;
    border-collapse: collapse;
}

.quickgrid thead th {
    background: linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%);
    color: #0f172a;
    border-bottom: 2px solid rgba(99, 102, 241, 0.5);
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 1rem 1.1rem !important;
    position: sticky;
    top: 0;
    z-index: 10;
    vertical-align: middle;
    line-height: 1.4;
}

[data-theme="dark"] .quickgrid thead th,
[data-bs-theme="dark"] .quickgrid thead th,
html[data-bs-theme="dark"] .quickgrid thead th,
body[data-bs-theme="dark"] .quickgrid thead th {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
    color: #f8fafc !important;
    border-bottom: 2px solid #6366f1 !important;
}

.quickgrid thead th[aria-sort] {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 2rem;
}

.quickgrid thead th:hover {
    filter: brightness(1.1);
}

/* Override Bootstrap table-striped dark backgrounds that cause black rows */
.quickgrid,
.quickgrid.table-striped,
.table.table-striped,
.table {
    --bs-table-striped-bg: transparent !important;
    --bs-table-bg: transparent !important;
    --bs-table-accent-bg: transparent !important;
}

[data-theme="dark"] .quickgrid,
[data-bs-theme="dark"] .quickgrid,
[data-theme="dark"] .quickgrid.table-striped,
[data-bs-theme="dark"] .quickgrid.table-striped,
[data-theme="dark"] .table.table-striped,
[data-bs-theme="dark"] .table.table-striped,
[data-theme="dark"] .table,
[data-bs-theme="dark"] .table {
    --bs-table-striped-bg: transparent !important;
    --bs-table-bg: transparent !important;
    --bs-table-accent-bg: transparent !important;
    --bs-table-hover-bg: rgba(74, 158, 255, 0.15) !important;
}

.quickgrid tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    background-color: transparent !important;
}

.quickgrid tbody tr td {
    background-color: transparent !important;
}

[data-theme="dark"] .quickgrid tbody tr,
[data-bs-theme="dark"] .quickgrid tbody tr {
    background-color: transparent !important;
}

[data-theme="dark"] .quickgrid tbody tr td,
[data-bs-theme="dark"] .quickgrid tbody tr td {
    background-color: transparent !important;
}

/* Eliminate ALL QuickGrid spacer, placeholder, aria-hidden, and empty TR rows */
.quickgrid tbody tr[aria-hidden="true"],
.table tbody tr[aria-hidden="true"],
.quickgrid tbody tr.quickgrid-spacer,
.table tbody tr.quickgrid-spacer,
.quickgrid tbody tr.placeholder-row,
.table tbody tr.placeholder-row,
.quickgrid tbody tr.spacer-row,
.table tbody tr.spacer-row,
.quickgrid tbody tr[role="presentation"],
.table tbody tr[role="presentation"],
.quickgrid tbody tr:empty,
.table tbody tr:empty,
.quickgrid tbody tr:not(:has(td)),
.table tbody tr:not(:has(td)),
.quickgrid tbody tr:not(:has(td:not(:empty))),
.table tbody tr:not(:has(td:not(:empty))),
.quickgrid tbody tr:has(td:only-child:empty),
.table tbody tr:has(td:only-child:empty),
.quickgrid tbody tr:not(:has(*)),
.table tbody tr:not(:has(*)) {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    line-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-bottom: none !important;
    background: transparent !important;
    background-color: transparent !important;
}

.quickgrid tbody tr[aria-hidden="true"] td,
.table tbody tr[aria-hidden="true"] td,
.quickgrid tbody tr.quickgrid-spacer td,
.table tbody tr.quickgrid-spacer td,
.quickgrid tbody tr:not(:has(td:not(:empty))) td,
.table tbody tr:not(:has(td:not(:empty))) td {
    display: none !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-bottom: none !important;
}

.quickgrid tbody tr:hover {
    background: var(--hover-bg);
    transform: scale(1.001);
}

/* Selected row highlighting — Light theme */
.quickgrid tbody tr.selected-row {
    background: rgba(var(--primary-rgb), 0.1) !important;
    box-shadow: inset 3px 0 0 0 var(--primary-color), inset 0 0 0 1px rgba(var(--primary-rgb), 0.2);
}

.quickgrid tbody tr.selected-row:hover {
    background: rgba(var(--primary-rgb), 0.15) !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(var(--primary-rgb), 0.15) !important;
    box-shadow: inset 3px 0 0 0 var(--primary-color), inset 0 0 0 1px rgba(var(--primary-rgb), 0.25);
}

[data-theme="dark"] .quickgrid tbody tr.selected-row:hover,
[data-bs-theme="dark"] .quickgrid tbody tr.selected-row:hover {
    background: rgba(var(--primary-rgb), 0.2) !important;
}

.quickgrid tbody td {
    padding: 0.875rem;
    vertical-align: middle;
    font-size: 0.9375rem;
}

/* 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.375rem;
    transition: background 0.2s;
}

.col-options-button:hover {
    background: rgba(255, 255, 255, 0.15);
}

.search-box {
    box-shadow: var(--shadow-md);
    min-width: 200px;
    border-radius: 0.5rem;
}

.search-box input,
.search-box select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background: var(--card-bg-solid);
    color: var(--text-primary);
}

/* ============================================
   PREMIUM PAGINATION STYLES
   ============================================ */
.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: 1.5px solid var(--border-color);
    background: var(--card-bg-solid);
    color: var(--text-primary);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: var(--shadow-xs);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.paginator button:hover:not(:disabled) {
    background: var(--hover-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.paginator button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--shadow-xs);
}

.paginator button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: var(--bg-tertiary);
    box-shadow: none;
}

/* Current/Active Page Button */
.paginator button.current-page {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.35),
                0 0 0 2px rgba(var(--primary-rgb), 0.15);
    font-weight: 700;
    transform: scale(1.05);
}

.paginator button.current-page:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Navigation Arrows */
.paginator button[aria-label*="Go to first page"]::before,
.paginator button[aria-label*="first"]::before {
    content: '◀◀ ';
    font-size: 10px;
    font-weight: 700;
    opacity: 0.9;
}

.paginator button[aria-label*="Go to previous page"]::before,
.paginator button[aria-label*="previous"]::before {
    content: '◀ ';
    font-size: 11px;
    font-weight: 900;
}

.paginator button[aria-label*="Go to next page"]::after,
.paginator button[aria-label*="next"]::after {
    content: ' ▶';
    font-size: 11px;
    font-weight: 900;
}

.paginator button[aria-label*="Go to last page"]::after,
.paginator button[aria-label*="last"]::after {
    content: ' ▶▶';
    font-size: 10px;
    font-weight: 700;
    opacity: 0.9;
}

.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;
}

.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;
}

/* Responsive pagination */
@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;
    }
}

/* ============================================
   PREMIUM MODAL STYLES — Glass effect
   ============================================ */
.modal.show {
    animation: fadeIn 0.3s ease;
}

.modal-dialog {
    animation: modalSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content {
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
}

/* ============================================
   QUICKGRID CUSTOM OVERRIDES
   ============================================ */
.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: 700;
    padding: 1rem 1.1rem !important;
}

.border-bottom {
    border-bottom: none !important;
}

/* 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;
    }
}

/* ============================================
   PREMIUM TOAST NOTIFICATION STYLES
   ============================================ */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 99999 !important;
    display: flex !important;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 420px;
    width: 100%;
    pointer-events: none;
    visibility: visible !important;
    opacity: 1 !important;
}

.toast {
    display: flex !important;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    border-radius: 0.875rem;
    background: rgba(255, 255, 255, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    border-left: 4px solid var(--primary-color) !important;
    box-shadow: 0 20px 50px rgba(30, 41, 59, 0.15), 0 0 25px rgba(99, 102, 241, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.9) !important;
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    visibility: visible !important;
    opacity: 1 !important;
    max-height: none !important;
    min-width: 320px;
    animation: toastSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .toast,
[data-bs-theme="dark"] .toast {
    background: rgba(15, 23, 42, 0.75) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55), 0 0 30px rgba(99, 102, 241, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.15) !important;
}

/* Toast Enter Animation */
.toast-enter {
    animation: toastSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Toast Exit Animation */
.toast-exit {
    animation: toastSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.92);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(100%) scale(0.92);
    }
}

/* Toast Type Glassmorphism Gradient Styles */
.toast-success {
    border-left-color: #10b981 !important;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.14) 0%, rgba(255, 255, 255, 0.75) 100%) !important;
}

.toast-success .toast-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

[data-theme="dark"] .toast-success,
[data-bs-theme="dark"] .toast-success {
    border-left-color: #34d399 !important;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(15, 23, 42, 0.78) 100%) !important;
}

.toast-error {
    border-left-color: #ef4444 !important;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.14) 0%, rgba(255, 255, 255, 0.75) 100%) !important;
}

.toast-error .toast-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

[data-theme="dark"] .toast-error,
[data-bs-theme="dark"] .toast-error {
    border-left-color: #f87171 !important;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(15, 23, 42, 0.78) 100%) !important;
}

.toast-warning {
    border-left-color: #f59e0b !important;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.14) 0%, rgba(255, 255, 255, 0.75) 100%) !important;
}

.toast-warning .toast-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

[data-theme="dark"] .toast-warning,
[data-bs-theme="dark"] .toast-warning {
    border-left-color: #fbbf24 !important;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(15, 23, 42, 0.78) 100%) !important;
}

.toast-info {
    border-left-color: #3b82f6 !important;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.14) 0%, rgba(255, 255, 255, 0.75) 100%) !important;
}

.toast-info .toast-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

[data-theme="dark"] .toast-info,
[data-bs-theme="dark"] .toast-info {
    border-left-color: #60a5fa !important;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(15, 23, 42, 0.78) 100%) !important;
}

.toast-loading {
    border-left-color: #a78bfa !important;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.14) 0%, rgba(255, 255, 255, 0.75) 100%) !important;
}

[data-theme="dark"] .toast-loading,
[data-bs-theme="dark"] .toast-loading {
    border-left-color: #c084fc !important;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.2) 0%, rgba(15, 23, 42, 0.78) 100%) !important;
}

.toast-loading .toast-icon {
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
    color: white;
}

/* Toast Icon */
.toast-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Toast Spinner */
.toast-spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: toastSpin 0.8s linear infinite;
}

@keyframes toastSpin {
    to { transform: rotate(360deg); }
}

/* Toast Content */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.toast-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    word-break: break-word;
}

/* Toast Action Button */
.toast-action {
    margin-top: 0.5rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.1);
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toast-action:hover {
    background: rgba(var(--primary-rgb), 0.18);
    transform: translateY(-1px);
}

.toast-action:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Toast Close Button */
.toast-close {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.25rem;
    line-height: 1;
}

.toast-close:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.toast-close:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Toast Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border-radius: 0 0 0.875rem 0.875rem;
}

.toast-progress-bar {
    height: 100%;
    background: currentColor;
    animation: progressShrink linear forwards;
    transform-origin: left;
}

.toast-success .toast-progress-bar { background: var(--success-color); }
.toast-error .toast-progress-bar { background: var(--danger-color); }
.toast-warning .toast-progress-bar { background: var(--warning-color); }
.toast-info .toast-progress-bar { background: var(--info-color); }

@keyframes progressShrink {
    from { width: 100%; }
    to { width: 0%; }
}

/* Dark Theme Toast Support */
[data-theme="dark"] .toast-close:hover,
[data-bs-theme="dark"] .toast-close:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Responsive Toasts — Top Right corner on mobile */
@media (max-width: 768px) {
    .toast-container {
        top: 1rem !important;
        bottom: auto !important;
        right: 1rem !important;
        left: auto !important;
        max-width: calc(100vw - 2rem) !important;
        width: auto !important;
        z-index: 99999 !important;
    }

    .toast {
        padding: 0.875rem;
    }

    .toast-icon {
        width: 2rem;
        height: 2rem;
        font-size: 1rem;
    }
}

/* Focus visible for accessibility */
.toast:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ============================================
   EXPORT NOTIFICATION TOAST (legacy compat)
   ============================================ */
.toast-header {
    border-top-left-radius: 0.875rem;
    border-top-right-radius: 0.875rem;
    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.15);
}

/* Dark theme legacy toast */
[data-theme="dark"] .toast,
[data-bs-theme="dark"] .toast {
    background-color: var(--card-bg);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .toast-header,
[data-bs-theme="dark"] .toast-header {
    background-color: var(--success-color);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .toast-body,
[data-bs-theme="dark"] .toast-body {
    background-color: var(--card-bg-solid);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   PREMIUM CRYSTALLINE GLASS MODALS — GLOBAL DESIGN
   ============================================ */

/* Dark Backdrop Overlay with Rich Blur */
.modal-backdrop {
    background-color: rgba(7, 11, 20, 0.72) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

.modal-backdrop.show {
    opacity: 1 !important;
}

/* Modal Content Glass Container */
.modal-content {
    background: rgba(255, 255, 255, 0.94) !important;
    border: 1.5px solid rgba(99, 102, 241, 0.3) !important;
    border-radius: 1.25rem !important;
    box-shadow: 0 25px 70px rgba(15, 23, 42, 0.25), 0 0 35px rgba(99, 102, 241, 0.18), inset 0 1px 1px rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    overflow: hidden !important;
    color: var(--text-primary) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

[data-theme="dark"] .modal-content,
[data-bs-theme="dark"] .modal-content {
    background: rgba(17, 24, 39, 0.94) !important;
    border: 1.5px solid rgba(129, 140, 248, 0.35) !important;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.75), 0 0 40px rgba(99, 102, 241, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.15) !important;
    color: #f8fafc !important;
}

/* Premium Modal Header */
.modal-header {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    color: #ffffff !important;
    padding: 1.15rem 1.5rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
}

[data-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-header {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%) !important;
}

.modal-header .modal-title,
.modal-header h5,
.modal-header h4 {
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
    color: #ffffff !important;
    margin: 0 !important;
}

.modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%) !important;
    opacity: 0.85 !important;
    transition: all 0.2s ease !important;
}

.modal-header .btn-close:hover {
    opacity: 1 !important;
    transform: scale(1.15) rotate(90deg) !important;
}

/* Premium Modal Body */
.modal-body {
    padding: 1.5rem !important;
    color: var(--text-primary) !important;
}

.modal-body label {
    font-size: 0.78rem !important;
    font-weight: 750 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: var(--text-secondary) !important;
    margin-bottom: 0.35rem !important;
}

.modal-body .form-control,
.modal-body .form-select,
.modal-body textarea {
    background-color: var(--card-bg-solid, rgba(248, 250, 252, 0.95)) !important;
    border: 1.5px solid var(--border-color-strong, rgba(99, 102, 241, 0.25)) !important;
    border-radius: 0.75rem !important;
    color: var(--text-primary) !important;
    font-size: 0.9rem !important;
    padding: 0.55rem 0.85rem !important;
    transition: all 0.2s ease !important;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus,
.modal-body textarea:focus {
    background-color: var(--card-bg-solid, #ffffff) !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3) !important;
}

[data-theme="dark"] .modal-body .form-control,
[data-theme="dark"] .modal-body .form-select,
[data-theme="dark"] .modal-body textarea,
[data-bs-theme="dark"] .modal-body .form-control,
[data-bs-theme="dark"] .modal-body .form-select,
[data-bs-theme="dark"] .modal-body textarea {
    background-color: rgba(15, 23, 42, 0.75) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .modal-body .form-control:focus,
[data-theme="dark"] .modal-body .form-select:focus,
[data-theme="dark"] .modal-body textarea:focus,
[data-bs-theme="dark"] .modal-body .form-control:focus,
[data-bs-theme="dark"] .modal-body .form-select:focus,
[data-bs-theme="dark"] .modal-body textarea:focus {
    background-color: rgba(15, 23, 42, 0.95) !important;
    border-color: #818cf8 !important;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.35) !important;
}

/* Premium Modal Footer */
.modal-footer {
    padding: 1rem 1.5rem !important;
    border-top: 1px solid var(--border-color, rgba(99, 102, 241, 0.15)) !important;
    background: var(--card-bg-solid, rgba(248, 250, 252, 0.5)) !important;
}

[data-theme="dark"] .modal-footer,
[data-bs-theme="dark"] .modal-footer {
    background: rgba(15, 23, 42, 0.5) !important;
    border-top-color: rgba(255, 255, 255, 0.08) !important;
}

/* Modal Footer Buttons */
.modal-footer .btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 0.88rem !important;
    border-radius: 0.75rem !important;
    padding: 0.55rem 1.25rem !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.modal-footer .btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45) !important;
}

/* Modal Footer Buttons & Global Cancel Buttons */
.btn-secondary,
.btn-outline-secondary,
.modal .btn-secondary,
.modal .btn-outline-secondary,
.modal-footer .btn-secondary,
.modal-footer .btn-outline-secondary {
    background: rgba(100, 116, 139, 0.16) !important;
    border: 1.5px solid rgba(148, 163, 184, 0.35) !important;
    color: var(--text-primary) !important;
    font-weight: 650 !important;
    font-size: 0.88rem !important;
    border-radius: 0.75rem !important;
    padding: 0.55rem 1.25rem !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-secondary:hover:not(:disabled),
.btn-outline-secondary:hover:not(:disabled),
.modal .btn-secondary:hover:not(:disabled),
.modal .btn-outline-secondary:hover:not(:disabled),
.modal-footer .btn-secondary:hover:not(:disabled),
.modal-footer .btn-outline-secondary:hover:not(:disabled) {
    background: rgba(100, 116, 139, 0.28) !important;
    border-color: rgba(148, 163, 184, 0.5) !important;
    color: var(--text-primary) !important;
    transform: translateY(-1px) !important;
}

[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .btn-outline-secondary,
[data-theme="dark"] .modal .btn-secondary,
[data-theme="dark"] .modal .btn-outline-secondary,
[data-bs-theme="dark"] .btn-secondary,
[data-bs-theme="dark"] .btn-outline-secondary,
[data-bs-theme="dark"] .modal .btn-secondary,
[data-bs-theme="dark"] .modal .btn-outline-secondary {
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.25) !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .btn-secondary:hover:not(:disabled),
[data-theme="dark"] .btn-outline-secondary:hover:not(:disabled),
[data-theme="dark"] .modal .btn-secondary:hover:not(:disabled),
[data-theme="dark"] .modal .btn-outline-secondary:hover:not(:disabled),
[data-bs-theme="dark"] .btn-secondary:hover:not(:disabled),
[data-bs-theme="dark"] .btn-outline-secondary:hover:not(:disabled),
[data-bs-theme="dark"] .modal .btn-secondary:hover:not(:disabled),
[data-bs-theme="dark"] .modal .btn-outline-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.22) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
}

/* ============================================
   GLOBAL USER PROFILE DROPDOWN MENU
   ============================================ */

.user-dropdown-menu {
    --bs-dropdown-bg: transparent !important;
    min-width: 280px !important;
    border-radius: 1.15rem !important;
    padding: 0 !important;
    margin-top: 0.5rem !important;
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    transform: none !important;
    overflow: hidden !important;
    z-index: 1060 !important;
    
    /* Light Theme Glass Surface */
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1.5px solid rgba(99, 102, 241, 0.3) !important;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2), 0 0 25px rgba(99, 102, 241, 0.15) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
}

[data-theme="dark"] .user-dropdown-menu,
[data-bs-theme="dark"] .user-dropdown-menu,
html[data-bs-theme="dark"] .user-dropdown-menu,
html[data-theme="dark"] .user-dropdown-menu,
body[data-bs-theme="dark"] .user-dropdown-menu,
body[data-theme="dark"] .user-dropdown-menu {
    /* Dark Theme Glass — Deep Slate, Zero White Background */
    background: rgba(17, 24, 39, 0.95) !important;
    border: 1.5px solid rgba(129, 140, 248, 0.35) !important;
    box-shadow: 0 25px 65px rgba(0, 0, 0, 0.85), 0 0 35px rgba(99, 102, 241, 0.25) !important;
}

/* User Info Header Banner */
.user-dropdown-menu .user-info-header {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    margin: 0 !important;
    border-radius: 1rem 1rem 0 0 !important;
    padding: 1.1rem 1.25rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
}

[data-theme="dark"] .user-dropdown-menu .user-info-header,
[data-bs-theme="dark"] .user-dropdown-menu .user-info-header,
html[data-bs-theme="dark"] .user-dropdown-menu .user-info-header,
html[data-theme="dark"] .user-dropdown-menu .user-info-header,
body[data-bs-theme="dark"] .user-dropdown-menu .user-info-header,
body[data-theme="dark"] .user-dropdown-menu .user-info-header {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%) !important;
}

.user-dropdown-menu .user-name {
    color: #ffffff !important;
    font-size: 1rem !important;
    font-weight: 800 !important;
}

.user-dropdown-menu .user-role {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
}

/* Dropdown Menu Items */
.user-dropdown-menu .dropdown-item {
    padding: 0.7rem 1.15rem !important;
    color: #1e293b !important;
    font-weight: 650 !important;
    font-size: 0.92rem !important;
    border-radius: 0.65rem !important;
    margin: 0.35rem 0.5rem !important;
    width: calc(100% - 1rem) !important;
    display: flex !important;
    align-items: center !important;
    background: transparent !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.user-dropdown-menu .dropdown-item:hover {
    background: rgba(99, 102, 241, 0.1) !important;
    color: #4f46e5 !important;
    transform: translateX(4px) !important;
}

[data-theme="dark"] .user-dropdown-menu .dropdown-item,
[data-bs-theme="dark"] .user-dropdown-menu .dropdown-item,
html[data-bs-theme="dark"] .user-dropdown-menu .dropdown-item,
html[data-theme="dark"] .user-dropdown-menu .dropdown-item,
body[data-bs-theme="dark"] .user-dropdown-menu .dropdown-item,
body[data-theme="dark"] .user-dropdown-menu .dropdown-item {
    color: #f1f5f9 !important;
    background: transparent !important;
}

[data-theme="dark"] .user-dropdown-menu .dropdown-item:hover,
[data-bs-theme="dark"] .user-dropdown-menu .dropdown-item:hover,
html[data-bs-theme="dark"] .user-dropdown-menu .dropdown-item:hover,
html[data-theme="dark"] .user-dropdown-menu .dropdown-item:hover,
body[data-bs-theme="dark"] .user-dropdown-menu .dropdown-item:hover,
body[data-theme="dark"] .user-dropdown-menu .dropdown-item:hover {
    background: rgba(129, 140, 248, 0.18) !important;
    color: #ffffff !important;
    transform: translateX(4px) !important;
}

/* Icons inside items */
.user-dropdown-menu .dropdown-item i,
.user-dropdown-menu .dropdown-item .bi {
    font-size: 1.15rem !important;
    margin-right: 0.85rem !important;
    transition: transform 0.2s ease !important;
}

.user-dropdown-menu .dropdown-item:hover i,
.user-dropdown-menu .dropdown-item:hover .bi {
    transform: scale(1.15) !important;
}

/* Logout Button Item */
.user-dropdown-menu .dropdown-item.text-danger,
.user-dropdown-menu button.text-danger {
    color: #ef4444 !important;
    background: transparent !important;
}

.user-dropdown-menu .dropdown-item.text-danger:hover,
.user-dropdown-menu button.text-danger:hover {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #f87171 !important;
}

/* Divider */
.user-dropdown-menu .dropdown-divider {
    margin: 0.25rem 0 !important;
    border-color: rgba(99, 102, 241, 0.15) !important;
    opacity: 1 !important;
}

[data-theme="dark"] .user-dropdown-menu .dropdown-divider,
[data-bs-theme="dark"] .user-dropdown-menu .dropdown-divider,
html[data-bs-theme="dark"] .user-dropdown-menu .dropdown-divider,
html[data-theme="dark"] .user-dropdown-menu .dropdown-divider,
body[data-theme="dark"] .user-dropdown-menu .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* ============================================
   GLOBAL PREMIUM DROPDOWN LISTS & SELECTS
   ============================================ */

/* Select Input Box */
select,
.form-select {
    background-color: var(--card-bg-solid, rgba(248, 250, 252, 0.95)) !important;
    border: 1.5px solid var(--border-color-strong, rgba(99, 102, 241, 0.3)) !important;
    border-radius: 0.75rem !important;
    color: var(--text-primary, #0f172a) !important;
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    padding: 0.5rem 2.25rem 0.5rem 0.85rem !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236366f1' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 16px 12px !important;
}

select:focus,
.form-select:focus {
    background-color: #ffffff !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3.5px rgba(99, 102, 241, 0.25), 0 4px 14px rgba(99, 102, 241, 0.15) !important;
    outline: none !important;
}

/* Dark Theme Select Input Box */
[data-theme="dark"] select,
[data-theme="dark"] .form-select,
[data-bs-theme="dark"] select,
[data-bs-theme="dark"] .form-select,
html[data-bs-theme="dark"] select,
html[data-bs-theme="dark"] .form-select,
body[data-bs-theme="dark"] select,
body[data-bs-theme="dark"] .form-select {
    background-color: rgba(17, 24, 39, 0.9) !important;
    border: 1.5px solid rgba(129, 140, 248, 0.35) !important;
    color: #f8fafc !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23818cf8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
}

[data-theme="dark"] select:focus,
[data-theme="dark"] .form-select:focus,
[data-bs-theme="dark"] select:focus,
[data-bs-theme="dark"] .form-select:focus,
html[data-bs-theme="dark"] select:focus,
html[data-bs-theme="dark"] .form-select:focus,
body[data-bs-theme="dark"] select:focus,
body[data-bs-theme="dark"] .form-select:focus {
    background-color: rgba(15, 23, 42, 0.95) !important;
    border-color: #818cf8 !important;
    box-shadow: 0 0 0 3.5px rgba(129, 140, 248, 0.35), 0 4px 16px rgba(99, 102, 241, 0.25) !important;
}

/* Dropdown Option Items List */
select option,
.form-select option {
    background-color: #ffffff !important;
    color: #0f172a !important;
    padding: 0.65rem 1rem !important;
    font-weight: 550 !important;
    font-size: 0.9rem !important;
}

[data-theme="dark"] select option,
[data-theme="dark"] .form-select option,
[data-bs-theme="dark"] select option,
[data-bs-theme="dark"] .form-select option,
html[data-bs-theme="dark"] select option,
html[data-bs-theme="dark"] .form-select option,
body[data-bs-theme="dark"] select option,
body[data-theme="dark"] .form-select option {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    padding: 0.65rem 1rem !important;
}

select option:hover,
select option:focus,
select option:active,
select option:checked,
.form-select option:hover,
.form-select option:focus,
.form-select option:active,
.form-select option:checked {
    background-color: #6366f1 !important;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    color: #ffffff !important;
}

[data-theme="dark"] select option:checked,
[data-bs-theme="dark"] select option:checked,
html[data-bs-theme="dark"] select option:checked,
body[data-bs-theme="dark"] select option:checked {
    background-color: #4f46e5 !important;
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%) !important;
    color: #ffffff !important;
}

/* Global QuickGrid & Table Standard Typography (13px / 0.8125rem) */
table tbody tr td,
table.table tbody tr td,
.quickgrid tbody tr td {
    font-size: 0.8125rem !important;
    padding: 0.45rem 0.75rem !important;
    vertical-align: middle !important;
}

table thead tr th,
table.table thead tr th,
.quickgrid thead tr th {
    font-size: 0.8125rem !important;
    padding: 0.65rem 0.85rem !important;
}

/* Universal Data Grid Mobile Row Margin (< 640px) */
@media (max-width: 640px) {
    #universal-data-grid-row {
        margin: 5px !important;
    }
}

/* Vault Detail Mobile Padding (< 640px) */
@media (max-width: 640px) {
    .vault-detail {
        padding: 5px !important;
    }
}

/* Global Universal Data Grid Toolbar Action Buttons (Synchronized across Users, LoginDetails, MyDownload) */
.btn-toolbar .action-btn,
.btn-group .action-btn,
.action-btn {
    height: 31px !important;
    border-radius: 0.5rem !important;
    padding: 0.35rem 0.75rem !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.35rem !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}

.action-btn:disabled,
.action-btn.disabled {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
}