
/* Required table baseline */
table,
td,
th {
    border: 1px solid;
}

table {
    border-collapse: collapse;
}
/* ============================================================
   Cobalt Blue design tokens
   Deep #172554 · Royal #1D4ED8 · Azure #3B82F6 · Ice #DBEAFE · White
   ============================================================ */

:root,
[data-theme='light'] {
    --app-bg: #F8FAFC;
    --app-surface: #FFFFFF;
    --app-border: #E2E8F0;
    --app-text: #0F172A;
    --app-text-muted: #64748B;
    --app-text-subtle: #94A3B8;

    --primary: #1D4ED8;
    --primary-rgb: 29, 78, 216;
    --primary-hover: #1E40AF;
    --primary-active: #1E3A8A;
    --secondary: #3B82F6;
    --secondary-rgb: 59, 130, 246;
    --secondary-hover: #2563EB;
    --deep: #172554;
    --ice: #DBEAFE;
    --rose: #F43F5E;
    --rose-rgb: 244, 63, 94;
    --success: #059669;
    --warning: #D97706;
    --danger: #DC2626;
    --info: #3B82F6;
    --accent: #1D4ED8;
    --accent-2: #3B82F6;

    --input-bg: #FFFFFF;
    --input-border: #CBD5E1;
    --hover-bg: #EFF6FF;
    --selected-bg: #DBEAFE;

    --accent-gradient: linear-gradient(135deg, #172554 0%, #1D4ED8 55%, #3B82F6 100%);
    --brand-gradient-vertical: linear-gradient(180deg, #1D4ED8 0%, #172554 100%);
    --brand-gradient-diagonal: linear-gradient(135deg, #172554 0%, #1D4ED8 55%, #3B82F6 100%);

    --nav-bg: #FFFFFF;
    --nav-text: #0F172A;
    --nav-muted: #64748B;

    --sidebar-bg: #172554;
    --sidebar-text: #CBD5E1;
    --sidebar-active-bg: #1D4ED8;
    --sidebar-active-text: #FFFFFF;

    /* Semantic design tokens (single source of truth) */
    --color-primary: var(--primary);
    --color-primary-hover: var(--primary-hover);
    --color-secondary: var(--secondary);
    --color-accent: var(--secondary);
    --color-accent-hover: #2563EB;
    --color-page-bg: var(--app-bg);
    --color-surface: var(--app-surface);
    --color-surface-elevated: var(--app-surface);
    --color-text: var(--app-text);
    --color-text-secondary: var(--app-text-muted);
    --color-border: var(--app-border);
    --color-input-bg: var(--input-bg);
    --color-input-border: var(--input-border);
    --color-focus-ring: rgba(59, 130, 246, 0.25);
    --color-success: var(--success);
    --color-warning: var(--warning);
    --color-danger: var(--danger);
}

[data-theme='dark'] {
    --app-bg: #0B1120;
    --app-surface: #111C33;
    --app-border: #263449;
    --app-text: #F8FAFC;
    --app-text-muted: #CBD5E1;
    --app-text-subtle: #94A3B8;

    --primary: #3B82F6;
    --primary-rgb: 59, 130, 246;
    --primary-hover: #60A5FA;
    --primary-active: #2563EB;
    --secondary: #60A5FA;
    --secondary-rgb: 96, 165, 250;
    --secondary-hover: #93C5FD;
    --deep: #172554;
    --ice: #DBEAFE;
    --rose: #FB7185;
    --rose-rgb: 251, 113, 133;
    --success: #059669;
    --warning: #B45309;
    --danger: #DC2626;
    --info: #2563EB;
    --accent: #3B82F6;
    --accent-2: #60A5FA;

    --input-bg: #111C33;
    --input-border: #334155;
    --hover-bg: #172554;
    --selected-bg: #1E3A5F;

    --accent-gradient: linear-gradient(135deg, #0B1120 0%, #1D4ED8 55%, #3B82F6 100%);
    --brand-gradient-vertical: linear-gradient(180deg, #3B82F6 0%, #0B1120 100%);
    --brand-gradient-diagonal: linear-gradient(135deg, #172554 0%, #1D4ED8 55%, #3B82F6 100%);

    --nav-bg: #111C33;
    --nav-text: #F8FAFC;
    --nav-muted: #CBD5E1;

    --sidebar-bg: #080F24;
    --sidebar-text: #CBD5E1;
    --sidebar-active-bg: #1D4ED8;
    --sidebar-active-text: #FFFFFF;

    --color-accent-hover: #93C5FD;
    --color-focus-ring: rgba(96, 165, 250, 0.35);
}

:root,
[data-bs-theme='light'] {
    --bs-primary: #1D4ED8;
    --bs-primary-rgb: 29, 78, 216;
    --bs-secondary: #3B82F6;
    --bs-secondary-rgb: 59, 130, 246;
    --bs-success: #059669;
    --bs-success-rgb: 5, 150, 105;
    --bs-warning: #D97706;
    --bs-warning-rgb: 217, 119, 6;
    --bs-danger: #DC2626;
    --bs-danger-rgb: 220, 38, 38;
    --bs-info: #3B82F6;
    --bs-info-rgb: 59, 130, 246;
    --bs-link-color: #1D4ED8;
    --bs-link-hover-color: #1E40AF;
    --bs-focus-ring-color: rgba(29, 78, 216, 0.25);
    --bs-primary-text-emphasis: #1E3A8A;
    --bs-primary-bg-subtle: #EFF6FF;
    --bs-primary-border-subtle: #BFDBFE;
    --bs-success-text-emphasis: #065F46;
    --bs-success-bg-subtle: #ECFDF5;
    --bs-success-border-subtle: #A7F3D0;
    --bs-secondary-text-emphasis: #2563EB;
    --bs-secondary-bg-subtle: #DBEAFE;
    --bs-secondary-border-subtle: #93C5FD;
}

[data-bs-theme='dark'] {
    --bs-primary: #3B82F6;
    --bs-primary-rgb: 59, 130, 246;
    --bs-secondary: #60A5FA;
    --bs-secondary-rgb: 96, 165, 250;
    --bs-success: #059669;
    --bs-success-rgb: 5, 150, 105;
    --bs-warning: #B45309;
    --bs-warning-rgb: 180, 83, 9;
    --bs-danger: #DC2626;
    --bs-danger-rgb: 220, 38, 38;
    --bs-info: #2563EB;
    --bs-info-rgb: 37, 99, 235;
    --bs-link-color: #60A5FA;
    --bs-link-hover-color: #93C5FD;
    --bs-focus-ring-color: rgba(96, 165, 250, 0.35);
    --bs-primary-text-emphasis: #93C5FD;
    --bs-primary-bg-subtle: #1E3A5F;
    --bs-primary-border-subtle: #1D4ED8;
    --bs-success-text-emphasis: #6EE7B7;
    --bs-success-bg-subtle: #064E3B;
    --bs-success-border-subtle: #059669;
    --bs-secondary-text-emphasis: #93C5FD;
    --bs-secondary-bg-subtle: #1E3A5F;
    --bs-secondary-border-subtle: #3B82F6;
}

/* ============================================================
   Base
   ============================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--app-bg);
    color: var(--app-text);
    transition: background-color 0.25s ease, color 0.25s ease;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ============================================================
   Login page
   ============================================================ */

.login-page-body {
    background: linear-gradient(145deg, #EFF6FF 0%, #DBEAFE 45%, #F8FAFC 100%);
    min-height: 100vh;
}

[data-theme='dark'] .login-page-body {
    background: radial-gradient(ellipse at 15% 10%, #1E3A5F 0%, #0B1120 45%, #080F24 100%);
}

.login-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.login-bubble {
    position: absolute;
    border-radius: 50%;
    filter: blur(1px);
}

@keyframes float {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.5;
    }

    33% {
        transform: translateY(-30px) translateX(15px) scale(1.05);
        opacity: 0.7;
    }

    66% {
        transform: translateY(-10px) translateX(-10px) scale(0.95);
        opacity: 0.4;
    }

    100% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.5;
    }
}

@keyframes float2 {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.4;
    }

    50% {
        transform: translateY(-40px) translateX(-20px) scale(1.1);
        opacity: 0.65;
    }

    100% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.4;
    }
}

.login-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

[data-theme='dark'] .login-card {
    background: rgba(17, 28, 51, 0.92);
    color: var(--app-text);
}

[data-theme='dark'] .login-card .form-control,
[data-theme='dark'] .login-card .input-group-text {
    background: rgba(17, 28, 51, 0.6);
    color: var(--app-text);
    border-color: var(--app-border);
}

.login-card-accent {
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--secondary));
}

.login-logo {
    width: 3.6rem;
    height: 3.6rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.login-label {
    font-size: 0.7rem;
    letter-spacing: 0.04em;
}

.login-btn {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border: none;
    letter-spacing: 0.02em;
    color: #fff;
}

.login-btn:hover {
    background: linear-gradient(90deg, var(--primary-hover), var(--primary-hover));
    color: #fff;
}

.login-btn:disabled {
    opacity: 0.7;
}

.captcha-question {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.8rem;
}

[data-theme='dark'] .captcha-question {
    background: rgba(var(--primary-rgb), 0.15);
    color: #93C5FD;
}

/* ============================================================
   Admin shell
   ============================================================ */

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--app-bg);
}

/* Sidebar */

@keyframes brandIconFloat {
    0% {
        transform: translateY(0) rotate(0deg);
        box-shadow: 0 4px 12px rgba(var(--secondary-rgb), 0.25);
    }
    50% {
        transform: translateY(-2px) rotate(-1deg);
        box-shadow: 0 8px 20px rgba(var(--secondary-rgb), 0.45);
    }
    100% {
        transform: translateY(0) rotate(0deg);
        box-shadow: 0 4px 12px rgba(var(--secondary-rgb), 0.25);
    }
}

.sidebar-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    z-index: 1030;
    color: #fff;
    background: var(--sidebar-bg, #172554);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, width 0.25s ease;
    overflow: hidden;
}

.sidebar-drawer::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.8) 0%, rgba(59, 130, 246, 0.25) 100%);
    pointer-events: none;
    z-index: 2;
}

[data-theme='dark'] .sidebar-drawer {
    background: var(--sidebar-bg, #080F24);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand-header {
    min-height: 60px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    position: relative;
    z-index: 1;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    font-weight: 600;
}

.sidebar-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #3B82F6, #1D4ED8);
    color: #FFFFFF;
    margin-right: 0.6rem;
    box-shadow: 0 5px 14px rgba(var(--secondary-rgb), 0.25);
    animation: brandIconFloat 4s ease-in-out infinite;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sidebar-brand-header:hover .sidebar-brand-icon {
    transform: scale(1.1) rotate(6deg);
}

.sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0.75rem 0.5rem;
    position: relative;
    z-index: 1;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.sidebar-nav .nav {
    flex-direction: column;
}

.sidebar-nav .nav-item {
    margin-bottom: 0.25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    border-radius: 9px;
    color: var(--sidebar-text, #CBD5E1);
    font-size: 0.875rem;
    text-decoration: none;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease, color 0.2s ease;
    position: relative;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
    transform: translateX(4px);
}

.sidebar-link.active {
    background: var(--sidebar-active-bg, #1D4ED8);
    box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.35);
    color: var(--sidebar-active-text, #FFFFFF);
    font-weight: 600;
}

.sidebar-link.active i {
    color: var(--sidebar-active-text, #FFFFFF);
}

.sidebar-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--sidebar-text, #CBD5E1);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    border-radius: 10px;
}

.sidebar-group-header:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-submenu {
    list-style: none;
    padding-left: 0.75rem;
    margin-top: 0.25rem;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-subgroup-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.45rem 0.75rem;
    color: rgba(255, 255, 255, 0.75);
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: left;
    transition: all 0.15s ease;
}

.sidebar-subgroup-toggle:hover,
.sidebar-subgroup-toggle.active,
.sidebar-subgroup-toggle[aria-expanded="true"] {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-group-header .bi-chevron-down,
.sidebar-subgroup-toggle .bi-chevron-down {
    transition: transform 0.2s ease;
}

.sidebar-group-header[aria-expanded="true"] .bi-chevron-down,
.sidebar-subgroup-toggle[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

.sidebar-footer {
    min-height: 60px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Content wrapper */

.content-wrapper {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s ease;
}

/* Navbar */

.navbar-sticky {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    min-height: 60px;
    color: var(--app-text);
    /* Do NOT add overflow/backdrop-filter here: both break the navbar
       dropdowns (clipping, and a containing block for fixed panels). */
    background: var(--app-surface);
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.14);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}

.navbar-sticky::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    pointer-events: none;
}

[data-theme='dark'] .navbar-sticky {
    background: var(--app-surface);
    border-bottom: 1px solid rgba(var(--secondary-rgb), 0.18);
    box-shadow: 0 4px 22px rgba(0, 0, 0, 0.4);
}

.navbar-title {
    color: var(--app-text);
    font-weight: 600;
    margin: 0;
    font-size: 0.95rem;
}

.navbar-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: #EFF6FF;
    color: var(--primary);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.navbar-icon-btn:hover {
    background: #DBEAFE;
    color: var(--primary-hover);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.18);
}

.navbar-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem 0.25rem 0.25rem;
    border: none;
    border-radius: 999px;
    background: #EFF6FF;
    color: var(--app-text);
    font-weight: 500;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease, box-shadow 0.2s ease;
}

.navbar-user-btn:hover {
    background: #DBEAFE;
    color: var(--primary-hover);
    transform: translateY(-1.5px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.15);
}

[data-theme='dark'] .navbar-icon-btn,
[data-theme='dark'] .navbar-user-btn {
    color: var(--app-text);
    background: #172554;
}

[data-theme='dark'] .navbar-icon-btn:hover,
[data-theme='dark'] .navbar-user-btn:hover {
    color: var(--secondary);
    background: #1E3A5F;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.navbar-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Content area */

.content-area {
    flex-grow: 1;
    padding: 1.5rem;
    padding-top: 1.75rem;
}

@media (min-width: 992px) {
    .content-area {
        padding: 2rem;
        padding-top: 1.75rem;
    }
}

/* Footer */

.app-footer {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--app-border);
    background: var(--app-surface);
    color: var(--app-text-muted);
    font-size: 0.8rem;
}

/* Mobile */

@media (max-width: 991.98px) {
    .sidebar-drawer {
        transform: translateX(-100%);
    }

    .sidebar-drawer.sidebar-open {
        transform: translateX(0);
    }

    .content-wrapper {
        margin-left: 0;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(17, 28, 51, 0.55);
        z-index: 1025;
        display: none;
    }

    .sidebar-backdrop.show {
        display: block;
    }
}

/* Desktop collapsed mode */

@media (min-width: 992px) {
    body.sidebar-collapsed .sidebar-drawer {
        width: 72px;
    }

    body.sidebar-collapsed .content-wrapper {
        margin-left: 72px;
    }

    body.sidebar-collapsed .sidebar-brand .sidebar-label,
    body.sidebar-collapsed .sidebar-link .sidebar-label,
    body.sidebar-collapsed .sidebar-group-header .sidebar-label,
    body.sidebar-collapsed .sidebar-subgroup-toggle .sidebar-label,
    body.sidebar-collapsed .sidebar-subgroup-toggle .bi-chevron-down,
    body.sidebar-collapsed .sidebar-submenu {
        display: none;
    }

    body.sidebar-collapsed .sidebar-link,
    body.sidebar-collapsed .sidebar-group-header,
    body.sidebar-collapsed .sidebar-subgroup-toggle {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    body.sidebar-collapsed .sidebar-brand {
        justify-content: center;
        margin: 0 auto;
    }

    body.sidebar-collapsed .sidebar-brand-icon {
        margin: 0;
    }
}

/* ============================================================
   Page header
   ============================================================ */

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    color: var(--app-text);
    margin: 0;
}

.page-breadcrumb {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.page-breadcrumb .breadcrumb {
    margin-bottom: 0.25rem;
}

.page-breadcrumb .breadcrumb-item a {
    color: var(--accent);
    text-decoration: none;
}

.page-breadcrumb .breadcrumb-item.active {
    color: var(--app-text);
}

/* ============================================================
   Cards
   ============================================================ */

.ui-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.05) !important;
}

.ui-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--app-border);
    background: linear-gradient(110deg, rgba(var(--primary-rgb), 0.055), transparent 55%);
}

.ui-card-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--app-text);
    margin: 0;
}

.ui-card-subtitle {
    font-size: 0.78rem;
    color: var(--app-text-muted);
    margin: 0.15rem 0 0;
}

.ui-card-body {
    padding: 1.25rem;
}

.ui-card-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--app-border);
    background: rgba(var(--primary-rgb), 0.025);
}

[data-theme='dark'] .ui-card-footer {
    background: rgba(var(--primary-rgb), 0.04);
}

/* ============================================================
   Data table
   ============================================================ */

.dt-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.05) !important;
}

.dt-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--app-border);
    background: linear-gradient(110deg, rgba(var(--primary-rgb), 0.055), transparent 55%);
}

.dt-card-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--app-text);
    margin: 0;
}

.dt-card-subtitle {
    font-size: 0.78rem;
    color: var(--app-text-muted);
    margin: 0.15rem 0 0;
}

.dt-card-head-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dt-card-body {
    padding: 0;
}

.dt-card-foot {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--app-border);
    background: rgba(var(--primary-rgb), 0.025);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

[data-theme='dark'] .dt-card-foot {
    background: rgba(var(--primary-rgb), 0.04);
}

/* Table */

.dt-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
    margin: 0;
}

.dt-table thead th {
    padding: 0.75rem 1rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.075em;
    color: var(--primary-hover);
    background: #EFF6FF;
    border-bottom: 1px solid var(--app-border);
    text-align: left;
    white-space: nowrap;
}

[data-theme='dark'] .dt-table thead th {
    background: #172554;
    color: #93C5FD;
}

.dt-table tbody td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--app-border);
    color: var(--app-text);
    vertical-align: middle;
}

.dt-table tbody tr:last-child td {
    border-bottom: none;
}

.dt-table tbody tr:hover {
    background: rgba(var(--primary-rgb), 0.055);
}

[data-theme='dark'] .dt-table tbody tr:hover {
    background: rgba(var(--primary-rgb), 0.08);
}

/* DataTables wrapper overrides */

.dataTables_wrapper .row:first-child,
.dataTables_wrapper .row:last-child {
    display: none;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    display: none;
}

/* ============================================================
   Pagination
   ============================================================ */

.pg-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    width: 100%;
}

.pg-info {
    font-size: 0.8rem;
    color: var(--app-text-muted);
}

.pg-list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    margin: 0;
    padding: 0;
}

.pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 0.5rem;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
    color: var(--primary);
    font-size: 0.83rem;
    font-weight: 500;
    cursor: pointer;
}

.pg-btn:hover:not(:disabled) {
    border-color: rgba(var(--primary-rgb), 0.45);
    background: #EFF6FF;
    color: var(--primary-hover);
}

.pg-btn.is-active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.2);
}

.pg-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================================
   Forms
   ============================================================ */

.form-field {
    margin-bottom: 1rem;
}

.form-field-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--app-text);
    margin-bottom: 0.35rem;
}

.form-field-error {
    font-size: 0.78rem;
    color: var(--danger);
    margin-top: 4px;
}

.form-field-help {
    font-size: 0.75rem;
    color: var(--app-text-muted);
    margin-top: 4px;
}

.form-control,
.form-select {
    min-height: 42px;
    background: var(--app-surface);
    color: var(--app-text) !important;
    border: 1px solid var(--app-border);
    border-radius: 9px;
}

.form-control:focus,
.form-select:focus {
    background: var(--app-surface);
    color: var(--app-text);
    border-color: var(--secondary);
    box-shadow: 0 0 0 0.22rem rgba(var(--secondary-rgb), 0.28);
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #DC2626;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

[data-theme='dark'] .form-control,
[data-theme='dark'] .form-select {
    background: var(--input-bg);
    color: var(--app-text) !important;
}

/* ============================================================
   Badges
   ============================================================ */

.ui-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
}

.ui-badge-success {
    background: rgba(5, 150, 105, 0.16);
    color: #065F46;
}

.ui-badge-danger {
    background: rgba(220, 38, 38, 0.15);
    color: #B91C1C;
}

.ui-badge-warning {
    background: rgba(var(--secondary-rgb), 0.18);
    color: #92400E;
}

.ui-badge-info {
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary);
}

.ui-badge-muted {
    background: rgba(100, 116, 139, 0.15);
    color: #64748B;
}

.ui-badge-primary {
    background: rgba(var(--primary-rgb), 0.15);
    color: var(--primary);
}

[data-theme='dark'] .ui-badge-success {
    color: #6EE7B7;
}

[data-theme='dark'] .ui-badge-danger {
    color: #fca5a5;
}

[data-theme='dark'] .ui-badge-warning {
    color: var(--secondary);
}

[data-theme='dark'] .ui-badge-info {
    color: #93C5FD;
}

[data-theme='dark'] .ui-badge-muted {
    color: #cbd5e1;
}

[data-theme='dark'] .ui-badge-primary {
    color: #93C5FD;
}

/* ============================================================
   Admin list cells
   ============================================================ */

.admin-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.admin-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-cell-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-cell-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--app-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-cell-username {
    font-size: 0.72rem;
    color: var(--app-text-muted);
}

.admin-role-chip {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    white-space: nowrap;
}

[data-theme='dark'] .admin-role-chip {
    background: rgba(var(--primary-rgb), 0.15);
    color: #93C5FD;
}

.admin-last-login {
    font-size: 0.78rem;
    color: var(--app-text-muted);
}

/* ============================================================
   Alerts
   ============================================================ */

.alert {
    border: none;
    border-radius: 10px;
    font-size: 0.875rem;
}

.alert-success {
    --bs-alert-color: #065F46;
    --bs-alert-bg: #ECFDF5;
    --bs-alert-border-color: #A7F3D0;
}

.alert-warning {
    --bs-alert-color: #92400E;
    --bs-alert-bg: #FFFBEB;
    --bs-alert-border-color: #FCD34D;
}

.alert-danger {
    --bs-alert-color: #991B1B;
    --bs-alert-bg: #FEF2F2;
    --bs-alert-border-color: #FECACA;
}

[data-theme='dark'] .alert-success {
    --bs-alert-color: #6EE7B7;
    --bs-alert-bg: #064E3B;
    --bs-alert-border-color: #059669;
}

[data-theme='dark'] .alert-warning {
    --bs-alert-color: #FDE68A;
    --bs-alert-bg: #422006;
    --bs-alert-border-color: #92400E;
}

[data-theme='dark'] .alert-danger {
    --bs-alert-color: #FCA5A5;
    --bs-alert-bg: #7F1D1D;
    --bs-alert-border-color: #991B1B;
}

/* ============================================================
   Empty / loading / error states
   ============================================================ */

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: rgba(var(--primary-rgb), 0.15);
    color: var(--primary);
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--app-text);
    margin: 0 0 0.35rem;
}

.empty-state-message {
    font-size: 0.85rem;
    color: var(--app-text-muted);
    margin: 0;
}

/* ============================================================
   Table actions dropdown
   ============================================================ */

.table-actions {
    position: relative;
    display: inline-block;
}

.table-actions-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
    color: var(--app-text-muted);
    cursor: pointer;
}

.table-actions-trigger:hover {
    border-color: rgba(var(--primary-rgb), 0.45);
    background: #EFF6FF;
    color: var(--primary);
}

.table-actions-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 180px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
    z-index: 1050;
    padding: 0.45rem;
    display: none;
}

.table-actions-menu.show {
    display: block;
}

.table-action-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--app-text);
    font-size: 0.83rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.table-action-item:hover {
    background: #EFF6FF;
    text-decoration: none;
    color: var(--app-text);
}

.table-action-item.is-danger {
    color: #DC2626;
}

.table-action-item.is-danger:hover {
    background: rgba(220, 38, 38, 0.1);
}

[data-theme='dark'] .table-action-item:hover {
    background: #172554;
}

[data-theme='dark'] .table-actions-trigger:hover {
    border-color: rgba(var(--primary-rgb), 0.45);
    background: #172554;
    color: var(--secondary);
}

/* ============================================================
   Table search
   ============================================================ */

.table-search {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 240px;
    max-width: 320px;
}

.table-search i {
    position: absolute;
    left: 0.75rem;
    color: var(--app-text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.table-search input {
    width: 100%;
    padding: 0.5rem 2.25rem 0.5rem 2.25rem;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: var(--app-surface);
    color: var(--app-text);
    font-size: 0.83rem;
    outline: none;
}

.table-search input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 0.15rem rgba(var(--secondary-rgb), 0.28);
}

.table-search-clear {
    position: absolute;
    right: 0.5rem;
    border: none;
    background: transparent;
    color: var(--app-text-muted);
    padding: 0;
    cursor: pointer;
}

/* ============================================================
   Misc Bootstrap overrides
   ============================================================ */

.bg-primary,
.text-bg-primary,
.progress-bar,
.list-group-item.active {
    background-color: var(--primary) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.text-warning {
    color: #B45309 !important;
}

.text-danger {
    color: #DC2626 !important;
}

[data-theme='dark'] .text-warning {
    color: #FCD34D !important;
}

[data-theme='dark'] .text-danger {
    color: #F87171 !important;
}

.dropdown-menu {
    --bs-dropdown-link-hover-bg: #EFF6FF;
    --bs-dropdown-link-active-bg: #1D4ED8;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
    padding: 0.45rem;
}

[data-theme='dark'] .dropdown-menu {
    --bs-dropdown-link-hover-bg: #172554;
    --bs-dropdown-link-active-bg: #1E3A5F;
}

.dropdown-item {
    border-radius: 7px;
    padding: 0.5rem 0.7rem;
}

.dropdown-item:active {
    background-color: var(--primary);
}

/* ============================================================
   Reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   Captcha refresh
   ============================================================ */

.captcha-refresh {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--app-border);
    border-radius: 6px;
    background: transparent;
    color: var(--app-text-muted);
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.captcha-refresh:hover:not(:disabled) {
    background: rgba(var(--primary-rgb), 0.08);
    border-color: rgba(var(--primary-rgb), 0.3);
    color: var(--primary);
}

.captcha-refresh:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.captcha-refresh i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.captcha-refresh.is-loading i {
    animation: captcha-spin 0.8s linear infinite;
}

@keyframes captcha-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 575.98px) {
    .captcha-refresh span {
        display: none;
    }
}

/* ============================================================
   Notifications — modern panel
   ============================================================ */

.notification-wrap {
    position: relative;
}

.notification-trigger {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: linear-gradient(135deg, #F43F5E, #E11D48);
    color: #FFFFFF;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow:
        0 0 0 2px var(--app-surface),
        0 2px 6px rgba(var(--rose-rgb), 0.45);
    animation: notification-badge-pulse 2s ease-in-out infinite;
}

@keyframes notification-badge-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

.notification-panel {
    width: 400px;
    max-width: calc(100vw - 2rem);
    padding: 0;
    border-radius: 18px;
    overflow: hidden;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    box-shadow:
        0 24px 56px rgba(15, 23, 42, 0.18),
        0 8px 16px rgba(15, 23, 42, 0.08);
    animation: notification-in 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: top right;
}

[data-theme='dark'] .notification-panel {
    box-shadow:
        0 24px 56px rgba(0, 0, 0, 0.6),
        0 8px 16px rgba(0, 0, 0, 0.3);
}

@keyframes notification-in {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.notification-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.06), rgba(var(--secondary-rgb), 0.04));
    border-bottom: 1px solid var(--app-border);
}

[data-theme='dark'] .notification-panel-head {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.12), rgba(var(--secondary-rgb), 0.08));
}

.notification-panel-head-text {
    min-width: 0;
}

.notification-panel-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--app-text);
    letter-spacing: -0.01em;
}

.notification-panel-sub {
    font-size: 0.72rem;
    color: var(--app-text-muted);
    margin-top: 2px;
    font-weight: 500;
}

.notification-mark-all {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
    color: var(--app-text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.notification-mark-all:hover {
    background: rgba(var(--primary-rgb), 0.08);
    border-color: rgba(var(--primary-rgb), 0.3);
    color: var(--primary);
}

.notification-mark-all i {
    font-size: 0.8rem;
}

.notification-panel-body {
    max-height: 440px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.notification-panel-body::-webkit-scrollbar {
    width: 6px;
}

.notification-panel-body::-webkit-scrollbar-track {
    background: transparent;
}

.notification-panel-body::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-rgb), 0.25);
    border-radius: 6px;
    border: 2px solid var(--app-surface);
}

.notification-panel-body::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--primary-rgb), 0.45);
}

.notification-panel-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 2.5rem 1rem;
    color: var(--app-text-muted);
    font-size: 0.83rem;
}

.notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
}

.notification-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.12), rgba(var(--secondary-rgb), 0.08));
    color: var(--primary);
    font-size: 1.6rem;
    margin-bottom: 0.85rem;
}

[data-theme='dark'] .notification-empty-icon {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.18), rgba(var(--secondary-rgb), 0.12));
    color: #93C5FD;
}

.notification-empty-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--app-text);
    margin: 0 0 0.25rem;
}

.notification-empty-text {
    font-size: 0.78rem;
    color: var(--app-text-muted);
    margin: 0;
}

.notification-item {
    position: relative;
    display: flex;
    gap: 0.85rem;
    padding: 0.9rem 1.15rem 0.9rem 1.4rem;
    border-bottom: 1px solid var(--app-border);
    color: inherit;
    text-decoration: none;
    transition: background-color 0.15s ease;
    cursor: pointer;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: rgba(var(--primary-rgb), 0.04);
    text-decoration: none;
    color: inherit;
}

[data-theme='dark'] .notification-item:hover {
    background: rgba(var(--primary-rgb), 0.08);
}

.notification-item.is-unread {
    background: rgba(var(--rose-rgb), 0.08);
}

.notification-item.is-unread:hover {
    background: rgba(var(--rose-rgb), 0.14);
}

[data-theme='dark'] .notification-item.is-unread {
    background: rgba(var(--primary-rgb), 0.08);
}

.notification-item.is-unread::before {
    content: '';
    position: absolute;
    left: 0.55rem;
    top: 1.35rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #F43F5E;
    box-shadow: 0 0 0 4px rgba(var(--rose-rgb), 0.22);
}

.notification-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 1rem;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.notification-item:hover .notification-icon {
    transform: scale(1.06);
}

.notification-icon.variant-success {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.18), rgba(var(--primary-rgb), 0.12));
    color: var(--primary-hover);
}

.notification-icon.variant-danger {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.18), rgba(248, 113, 113, 0.12));
    color: #B91C1C;
}

.notification-icon.variant-info {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.18), rgba(var(--primary-rgb), 0.12));
    color: var(--primary);
}

.notification-icon.variant-warning {
    background: linear-gradient(135deg, rgba(var(--secondary-rgb), 0.18), rgba(var(--secondary-rgb), 0.12));
    color: #B45309;
}

.notification-icon.variant-muted {
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.18), rgba(168, 179, 205, 0.12));
    color: #64748B;
}

[data-theme='dark'] .notification-icon.variant-success {
    color: #93C5FD;
}

[data-theme='dark'] .notification-icon.variant-danger {
    color: #fca5a5;
}

[data-theme='dark'] .notification-icon.variant-info {
    color: #93C5FD;
}

[data-theme='dark'] .notification-icon.variant-warning {
    color: var(--secondary);
}

[data-theme='dark'] .notification-icon.variant-muted {
    color: #cbd5e1;
}

.notification-body {
    flex-grow: 1;
    min-width: 0;
    padding-top: 2px;
}

.notification-title {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--app-text);
    margin-bottom: 3px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-message {
    font-size: 0.78rem;
    color: var(--app-text-muted);
    line-height: 1.4;
    margin-bottom: 5px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notification-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    color: var(--app-text-muted);
    opacity: 0.85;
    flex-wrap: wrap;
}

.notification-meta-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.5;
}

.notification-panel-foot {
    padding: 0.6rem 1.15rem;
    border-top: 1px solid var(--app-border);
    background: var(--app-bg);
    text-align: center;
}

.notification-view-all {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    transition: background-color 0.15s ease, gap 0.15s ease;
}

.notification-view-all:hover {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-hover);
    text-decoration: none;
    gap: 0.55rem;
}

.notification-view-all i {
    font-size: 0.75rem;
    transition: transform 0.15s ease;
}

.notification-view-all:hover i {
    transform: translateX(2px);
}

@media (max-width: 575.98px) {
    .notification-panel {
        position: fixed !important;
        top: 64px;
        left: 1rem;
        right: 1rem;
        width: auto;
        max-width: none;
    }

    .notification-panel-head {
        padding: 0.85rem 1rem;
    }

    .notification-item {
        padding: 0.85rem 1rem 0.85rem 1.25rem;
    }
}

/* ------------------------------------------------------------
   Notification item states (read/unread) & panel utilities
   ------------------------------------------------------------ */
.notification-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: 20px;
    flex-shrink: 0;
    color: var(--app-text-muted);
    opacity: 0.65;
}

.notification-unread-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #F43F5E;
    box-shadow: 0 0 0 3px rgba(var(--rose-rgb), 0.25);
}

.notification-item:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.notification-empty-icon--error {
    background: rgba(var(--rose-rgb), 0.16);
    color: #E11D48;
}

.notification-retry {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.85rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid rgba(var(--primary-rgb), 0.35);
    border-radius: 8px;
    background: var(--app-surface);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.notification-retry:hover {
    background: rgba(var(--primary-rgb), 0.08);
    border-color: var(--primary);
}

.notification-mark-all:disabled {
    opacity: 0.55;
    cursor: wait;
}

/* ============================================================
   User menu
   ============================================================ */

.user-menu-wrap {
    position: relative;
}

.user-menu-panel {
    width: 320px;
    max-width: calc(100vw - 2rem);
    padding: 0;
    border-radius: 18px;
    overflow: hidden;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    box-shadow:
        0 24px 56px rgba(15, 23, 42, 0.18),
        0 8px 16px rgba(15, 23, 42, 0.08);
    animation: user-menu-in 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: top right;
}

[data-theme='dark'] .user-menu-panel {
    box-shadow:
        0 24px 56px rgba(0, 0, 0, 0.6),
        0 8px 16px rgba(0, 0, 0, 0.3);
}

@keyframes user-menu-in {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.user-menu-profile {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.15rem 1.15rem 1rem;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.06), rgba(var(--secondary-rgb), 0.04));
    border-bottom: 1px solid var(--app-border);
}

[data-theme='dark'] .user-menu-profile {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.12), rgba(var(--secondary-rgb), 0.08));
}

.user-menu-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.35);
}

.user-menu-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-menu-info {
    min-width: 0;
    flex-grow: 1;
}

.user-menu-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--app-text);
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-email {
    font-size: 0.72rem;
    color: var(--app-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 1px;
}

.user-menu-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.4rem;
}

.user-menu-role {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 5px;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary);
}

[data-theme='dark'] .user-menu-role {
    background: rgba(var(--primary-rgb), 0.2);
    color: #93C5FD;
}

.user-menu-section {
    padding: 0.35rem;
}

.user-menu-separator {
    height: 1px;
    background: var(--app-border);
    margin: 0;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--app-text);
    text-align: left;
    text-decoration: none;
    transition: background-color 0.15s ease;
    cursor: pointer;
}

.user-menu-item:hover {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--app-text);
    text-decoration: none;
}

[data-theme='dark'] .user-menu-item:hover {
    background: rgba(var(--primary-rgb), 0.12);
}

.user-menu-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

[data-theme='dark'] .user-menu-item-icon {
    background: rgba(var(--primary-rgb), 0.15);
    color: #93C5FD;
}

.user-menu-item:hover .user-menu-item-icon {
    transform: scale(1.06);
}

.user-menu-item-text {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
}

.user-menu-item-label {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--app-text);
    line-height: 1.2;
}

.user-menu-item-hint {
    font-size: 0.68rem;
    color: var(--app-text-muted);
    line-height: 1.2;
    margin-top: 1px;
}

.user-menu-item-arrow {
    font-size: 0.7rem;
    color: var(--app-text-muted);
    opacity: 0.4;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.user-menu-item:hover .user-menu-item-arrow {
    opacity: 0.9;
    transform: translateX(2px);
}

.user-menu-item-danger .user-menu-item-icon {
    background: rgba(220, 38, 38, 0.1);
    color: #DC2626;
}

.user-menu-item-danger .user-menu-item-label {
    color: #DC2626;
}

.user-menu-item-danger:hover {
    background: rgba(220, 38, 38, 0.08);
}

[data-theme='dark'] .user-menu-item-danger .user-menu-item-icon {
    background: rgba(248, 113, 113, 0.15);
    color: #fca5a5;
}

[data-theme='dark'] .user-menu-item-danger .user-menu-item-label {
    color: #fca5a5;
}

.user-menu-meta {
    padding: 0.6rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.user-menu-meta-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--app-text-muted);
}

.user-menu-meta-row>i {
    width: 14px;
    text-align: center;
    opacity: 0.6;
    flex-shrink: 0;
}

.user-menu-meta-value {
    margin-left: auto;
    font-weight: 600;
    color: var(--app-text);
    font-size: 0.7rem;
}

.user-menu-meta-row code.user-menu-meta-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    background: rgba(var(--primary-rgb), 0.15);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-weight: 500;
}

.user-menu-section-signout {
    border-top: 1px solid var(--app-border);
    background: var(--app-bg);
}

@media (max-width: 575.98px) {
    .user-menu-panel {
        position: fixed !important;
        top: 64px;
        left: 1rem;
        right: 1rem;
        width: auto;
        max-width: none;
    }

    .user-menu-profile {
        padding: 1rem;
    }

    .user-menu-item-hint {
        display: none;
    }
}

.dropdown-menu li .dropdown-item {
    text-decoration: none;
    font-weight: bolder;
}

.action-btn {
    text-decoration: none;
    font-weight: bolder;
    color: var(--primary);
}

.action-btn:hover,
.dropdown-menu li .dropdown-item:hover {
    color: var(--primary-hover);
}

/* ============================================================
   Unified Theme System: Tables, Cards, Buttons, and Forms
   Standardized to Green / Gold / Vermilion brand palette
   ============================================================ */

/* ------------------------------------------------------------
   1. TABLES
   ------------------------------------------------------------ */

.table,
.dt-table,
#base-table,
#responsiveTable,
table.dataTable {
    --bs-table-bg: var(--app-surface);
    --bs-table-color: var(--app-text);
    --bs-table-border-color: var(--app-border);
    --bs-table-hover-bg: rgba(var(--primary-rgb), 0.055);
    --bs-table-hover-color: var(--app-text);
    --bs-table-striped-bg: rgba(var(--primary-rgb), 0.025);
    --bs-table-striped-color: var(--app-text);
    width: 100%;
    margin-bottom: 0;
    color: var(--app-text);
    border: 1px solid var(--app-border) !important;
    border-color: var(--app-border) !important;
    border-collapse: separate;
    border-spacing: 0;
    vertical-align: middle;
}

[data-theme='dark'] .table,
[data-theme='dark'] .dt-table,
[data-theme='dark'] #base-table,
[data-theme='dark'] #responsiveTable,
[data-theme='dark'] table.dataTable,
[data-bs-theme='dark'] .table,
[data-bs-theme='dark'] .dt-table,
[data-bs-theme='dark'] #base-table,
[data-bs-theme='dark'] #responsiveTable,
[data-bs-theme='dark'] table.dataTable {
    --bs-table-bg: var(--app-surface);
    --bs-table-color: var(--app-text);
    --bs-table-border-color: var(--app-border);
    --bs-table-hover-bg: rgba(var(--primary-rgb), 0.09);
    --bs-table-hover-color: var(--app-text);
    --bs-table-striped-bg: rgba(var(--primary-rgb), 0.035);
    --bs-table-striped-color: var(--app-text);
    border: 1px solid var(--app-border) !important;
    border-color: var(--app-border) !important;
}

.table thead th,
.dt-table thead th,
#base-table thead th,
#responsiveTable thead th,
table.dataTable thead th,
.table-light,
.table-light th,
thead.table-light th {
    padding: 0.8rem 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.055em;
    background-color: #EFF6FF !important;
    color: var(--primary-hover) !important;
    border-bottom: 1px solid var(--app-border) !important;
    border-top: none;
    border-color: var(--app-border) !important;
    white-space: nowrap;
    text-align: left;
}

[data-theme='dark'] .table thead th,
[data-theme='dark'] .dt-table thead th,
[data-theme='dark'] #base-table thead th,
[data-theme='dark'] #responsiveTable thead th,
[data-theme='dark'] table.dataTable thead th,
[data-theme='dark'] .table-light,
[data-theme='dark'] .table-light th,
[data-theme='dark'] thead.table-light th,
[data-bs-theme='dark'] .table thead th,
[data-bs-theme='dark'] .dt-table thead th,
[data-bs-theme='dark'] #base-table thead th,
[data-bs-theme='dark'] #responsiveTable thead th,
[data-bs-theme='dark'] table.dataTable thead th,
[data-bs-theme='dark'] .table-light,
[data-bs-theme='dark'] .table-light th,
[data-bs-theme='dark'] thead.table-light th {
    background-color: #172554 !important;
    color: #93C5FD !important;
    border-bottom: 1px solid var(--app-border) !important;
    border-color: var(--app-border) !important;
}

.table tbody td,
.dt-table tbody td,
#base-table tbody td,
#responsiveTable tbody td,
table.dataTable tbody td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--app-border) !important;
    border-color: var(--app-border) !important;
    color: var(--app-text);
    vertical-align: middle;
}

.table tbody tr:last-child td,
.dt-table tbody tr:last-child td,
#base-table tbody tr:last-child td,
#responsiveTable tbody tr:last-child td {
    border-bottom: none !important;
}

.table-bordered,
.table-bordered th,
.table-bordered td,
.table-bordered > :not(caption) > * > * {
    border: 1px solid var(--app-border) !important;
    border-color: var(--app-border) !important;
}

.table-responsive {
    border: 1px solid var(--app-border);
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: hidden;
}

.table-responsive > .table,
.table-responsive > .dt-table,
.table-responsive > #base-table,
.table-responsive > #responsiveTable,
.table-responsive > table.dataTable {
    border: none !important;
}

.table-hover tbody tr:hover,
.dt-table tbody tr:hover,
#base-table tbody tr:hover,
#responsiveTable tbody tr:hover,
table.dataTable tbody tr:hover {
    background-color: rgba(var(--primary-rgb), 0.055) !important;
}

[data-theme='dark'] .table-hover tbody tr:hover,
[data-theme='dark'] .dt-table tbody tr:hover,
[data-theme='dark'] #base-table tbody tr:hover,
[data-theme='dark'] #responsiveTable tbody tr:hover,
[data-theme='dark'] table.dataTable tbody tr:hover,
[data-bs-theme='dark'] .table-hover tbody tr:hover,
[data-bs-theme='dark'] .dt-table tbody tr:hover,
[data-bs-theme='dark'] #base-table tbody tr:hover,
[data-bs-theme='dark'] #responsiveTable tbody tr:hover,
[data-bs-theme='dark'] table.dataTable tbody tr:hover {
    background-color: rgba(var(--primary-rgb), 0.09) !important;
}

.table-striped > tbody > tr:nth-of-type(odd) > *,
.table-striped tbody tr:nth-of-type(odd) {
    --bs-table-bg-type: rgba(var(--primary-rgb), 0.025);
    background-color: rgba(var(--primary-rgb), 0.025);
}

[data-theme='dark'] .table-striped > tbody > tr:nth-of-type(odd) > *,
[data-theme='dark'] .table-striped tbody tr:nth-of-type(odd),
[data-bs-theme='dark'] .table-striped > tbody > tr:nth-of-type(odd) > *,
[data-bs-theme='dark'] .table-striped tbody tr:nth-of-type(odd) {
    --bs-table-bg-type: rgba(var(--primary-rgb), 0.035);
    background-color: rgba(var(--primary-rgb), 0.035);
}

/* Bulk action bar */
.bulk-action-bar,
#bulkActionBar {
    background-color: var(--app-surface) !important;
    border: 1px solid var(--app-border) !important;
    border-radius: 12px !important;
    color: var(--app-text);
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.08) !important;
}

[data-theme='dark'] .bulk-action-bar,
[data-theme='dark'] #bulkActionBar {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

/* Table action buttons & trigger */
.table-actions-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
    color: var(--app-text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.table-actions-trigger:hover {
    border-color: rgba(var(--primary-rgb), 0.45);
    background-color: #EFF6FF;
    color: var(--primary);
}

[data-theme='dark'] .table-actions-trigger:hover {
    border-color: rgba(var(--primary-rgb), 0.45);
    background-color: #172554;
    color: var(--secondary);
}

.action-btn {
    text-decoration: none;
    font-weight: 600;
    color: var(--primary);
    transition: color 0.15s ease;
}

.action-btn:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

[data-theme='dark'] .action-btn {
    color: var(--primary);
}

[data-theme='dark'] .action-btn:hover {
    color: var(--secondary);
}

/* Mobile responsive card list */
.list-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rc-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.rc-card:hover {
    box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.08);
}

[data-theme='dark'] .rc-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.rc-card-head {
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid var(--app-border);
    background: linear-gradient(110deg, rgba(var(--primary-rgb), 0.05), transparent 60%);
    color: var(--app-text);
}

[data-theme='dark'] .rc-card-head {
    background: linear-gradient(110deg, rgba(var(--primary-rgb), 0.08), transparent 60%);
}

.rc-card-body {
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rc-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.83rem;
}

.rc-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--app-text-muted);
    flex-shrink: 0;
}

.rc-value {
    color: var(--app-text);
    text-align: right;
    word-break: break-word;
}

.rc-card-foot {
    padding: 0.65rem 0.9rem;
    border-top: 1px solid var(--app-border);
    background: rgba(var(--primary-rgb), 0.025);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

[data-theme='dark'] .rc-card-foot {
    background: rgba(var(--primary-rgb), 0.04);
}

.rc-action {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--app-border);
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--app-surface);
    text-decoration: none;
    transition: all 0.15s ease;
}

.rc-action:hover {
    border-color: var(--accent);
    background: #EFF6FF;
    color: var(--primary-hover);
    text-decoration: none;
}

[data-theme='dark'] .rc-action:hover {
    background: #172554;
    color: var(--secondary);
}

.rc-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--app-surface);
    border: 1px dashed var(--app-border);
    border-radius: 12px;
    color: var(--app-text-muted);
}

.rc-empty i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
    opacity: 0.6;
}

/* ------------------------------------------------------------
   2. CARDS
   ------------------------------------------------------------ */

.card,
.ui-card,
.dt-card {
    background-color: var(--app-surface) !important;
    border: 1px solid var(--app-border) !important;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(var(--primary-rgb), 0.04) !important;
    color: var(--app-text);
    overflow: hidden;
    transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

[data-theme='dark'] .card,
[data-theme='dark'] .ui-card,
[data-theme='dark'] .dt-card,
[data-bs-theme='dark'] .card,
[data-bs-theme='dark'] .ui-card,
[data-bs-theme='dark'] .dt-card {
    background-color: var(--app-surface) !important;
    border: 1px solid var(--app-border) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35) !important;
}

.card-header,
.ui-card-header,
.dt-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--app-border) !important;
    background: linear-gradient(110deg, rgba(var(--primary-rgb), 0.06), transparent 55%) !important;
    color: var(--app-text);
}

[data-theme='dark'] .card-header,
[data-theme='dark'] .ui-card-header,
[data-theme='dark'] .dt-card-head,
[data-bs-theme='dark'] .card-header,
[data-bs-theme='dark'] .ui-card-header,
[data-bs-theme='dark'] .dt-card-head {
    background: linear-gradient(110deg, rgba(var(--primary-rgb), 0.1), transparent 60%) !important;
    border-bottom: 1px solid var(--app-border) !important;
}

.card-body,
.ui-card-body,
.dt-card-body {
    padding: 1.25rem;
    color: var(--app-text);
}

.card-footer,
.ui-card-footer,
.dt-card-foot {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--app-border) !important;
    background-color: rgba(var(--primary-rgb), 0.025) !important;
    color: var(--app-text-muted);
}

[data-theme='dark'] .card-footer,
[data-theme='dark'] .ui-card-footer,
[data-theme='dark'] .dt-card-foot,
[data-bs-theme='dark'] .card-footer,
[data-bs-theme='dark'] .ui-card-footer,
[data-bs-theme='dark'] .dt-card-foot {
    background-color: rgba(var(--primary-rgb), 0.04) !important;
    border-top: 1px solid var(--app-border) !important;
}

.card-title,
.ui-card-title,
.dt-card-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--app-text);
    margin: 0;
}

.card-subtitle,
.ui-card-subtitle,
.dt-card-subtitle {
    font-size: 0.78rem;
    color: var(--app-text-muted);
    margin: 0.15rem 0 0;
}

/* Inner cards and boxes */
.border.rounded,
.p-3.border,
.p-2.border {
    border-color: var(--app-border) !important;
    background-color: var(--app-surface);
    color: var(--app-text);
    transition: border-color 0.15s ease;
}

.border.rounded:hover {
    border-color: rgba(var(--primary-rgb), 0.35) !important;
}

[data-theme='dark'] .border.rounded:hover {
    border-color: rgba(var(--primary-rgb), 0.4) !important;
}

/* Modals */
.modal-content {
    background-color: var(--app-surface) !important;
    border: 1px solid var(--app-border) !important;
    border-radius: 16px !important;
    color: var(--app-text);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15) !important;
    overflow: hidden;
}

[data-theme='dark'] .modal-content,
[data-bs-theme='dark'] .modal-content {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6) !important;
}

.modal-header {
    border-bottom: 1px solid var(--app-border) !important;
    background: linear-gradient(110deg, rgba(var(--primary-rgb), 0.05), transparent 55%) !important;
    padding: 1rem 1.25rem;
}

[data-theme='dark'] .modal-header,
[data-bs-theme='dark'] .modal-header {
    background: linear-gradient(110deg, rgba(var(--primary-rgb), 0.08), transparent 60%) !important;
}

.modal-header .modal-title {
    color: var(--app-text);
    font-weight: 700;
    font-size: 1.05rem;
}

.modal-footer {
    border-top: 1px solid var(--app-border) !important;
    background: var(--app-bg) !important;
    padding: 0.85rem 1.25rem;
}

.modal-body {
    padding: 1.25rem;
    color: var(--app-text);
}

[data-theme='dark'] .btn-close,
[data-bs-theme='dark'] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ------------------------------------------------------------
   3. BUTTONS — Cobalt palette · 8px radius · 150–200ms motion
   ------------------------------------------------------------ */

/* Primary — Save, Create, Submit, Add New, Continue */
.btn-primary {
    --bs-btn-color: #FFFFFF;
    --bs-btn-bg: #1D4ED8;
    --bs-btn-border-color: #1D4ED8;
    --bs-btn-hover-color: #FFFFFF;
    --bs-btn-hover-bg: #1E40AF;
    --bs-btn-hover-border-color: #1E40AF;
    --bs-btn-active-bg: #1E3A8A;
    --bs-btn-active-border-color: #1E3A8A;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease;
}

.btn-primary:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(29, 78, 216, 0.25);
}

.btn-primary:not(:disabled):active {
    transform: translateY(0);
    box-shadow: none;
}

[data-theme='dark'] .btn-primary,
[data-bs-theme='dark'] .btn-primary {
    --bs-btn-bg: #3B82F6;
    --bs-btn-border-color: #3B82F6;
    --bs-btn-hover-bg: #60A5FA;
    --bs-btn-hover-border-color: #60A5FA;
    --bs-btn-active-bg: #2563EB;
    --bs-btn-active-border-color: #2563EB;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

/* Success — Approve, Confirm, Activate, Complete */
.btn-success {
    --bs-btn-color: #FFFFFF;
    --bs-btn-bg: #059669;
    --bs-btn-border-color: #059669;
    --bs-btn-hover-color: #FFFFFF;
    --bs-btn-hover-bg: #047857;
    --bs-btn-hover-border-color: #047857;
    --bs-btn-active-bg: #065F46;
    --bs-btn-active-border-color: #065F46;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

[data-theme='dark'] .btn-success,
[data-bs-theme='dark'] .btn-success {
    --bs-btn-bg: #059669;
    --bs-btn-border-color: #059669;
    --bs-btn-hover-bg: #10B981;
    --bs-btn-hover-border-color: #10B981;
    --bs-btn-active-bg: #047857;
    --bs-btn-active-border-color: #047857;
}

/* Danger — Delete, Remove, Reject (confirmation dialogs preserved) */
.btn-danger {
    --bs-btn-color: #FFFFFF;
    --bs-btn-bg: #DC2626;
    --bs-btn-border-color: #DC2626;
    --bs-btn-hover-color: #FFFFFF;
    --bs-btn-hover-bg: #B91C1C;
    --bs-btn-hover-border-color: #B91C1C;
    --bs-btn-active-bg: #991B1B;
    --bs-btn-active-border-color: #991B1B;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

[data-theme='dark'] .btn-danger,
[data-bs-theme='dark'] .btn-danger {
    --bs-btn-bg: #DC2626;
    --bs-btn-border-color: #DC2626;
    --bs-btn-hover-bg: #EF4444;
    --bs-btn-hover-border-color: #EF4444;
    --bs-btn-active-bg: #B91C1C;
    --bs-btn-active-border-color: #B91C1C;
}

/* Warning — Suspend, Disable, warning actions */
.btn-warning {
    --bs-btn-color: #FFFFFF;
    --bs-btn-bg: #D97706;
    --bs-btn-border-color: #D97706;
    --bs-btn-hover-color: #FFFFFF;
    --bs-btn-hover-bg: #B45309;
    --bs-btn-hover-border-color: #B45309;
    --bs-btn-active-bg: #92400E;
    --bs-btn-active-border-color: #92400E;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

[data-theme='dark'] .btn-warning,
[data-bs-theme='dark'] .btn-warning {
    --bs-btn-bg: #B45309;
    --bs-btn-border-color: #B45309;
    --bs-btn-hover-bg: #D97706;
    --bs-btn-hover-border-color: #D97706;
    --bs-btn-active-bg: #92400E;
    --bs-btn-active-border-color: #92400E;
}

/* Info — View, Details, Preview */
.btn-info {
    --bs-btn-color: #FFFFFF;
    --bs-btn-bg: #3B82F6;
    --bs-btn-border-color: #3B82F6;
    --bs-btn-hover-color: #FFFFFF;
    --bs-btn-hover-bg: #2563EB;
    --bs-btn-hover-border-color: #2563EB;
    --bs-btn-active-bg: #1D4ED8;
    --bs-btn-active-border-color: #1D4ED8;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

[data-theme='dark'] .btn-info,
[data-bs-theme='dark'] .btn-info {
    --bs-btn-bg: #2563EB;
    --bs-btn-border-color: #2563EB;
    --bs-btn-hover-bg: #3B82F6;
    --bs-btn-hover-border-color: #3B82F6;
    --bs-btn-active-bg: #1D4ED8;
    --bs-btn-active-border-color: #1D4ED8;
}

/* Secondary — Cancel, Back, Reset */
.btn-secondary {
    --bs-btn-color: #1E293B;
    --bs-btn-bg: #E2E8F0;
    --bs-btn-border-color: #E2E8F0;
    --bs-btn-hover-color: #1E293B;
    --bs-btn-hover-bg: #CBD5E1;
    --bs-btn-hover-border-color: #CBD5E1;
    --bs-btn-active-bg: #94A3B8;
    --bs-btn-active-border-color: #94A3B8;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

[data-theme='dark'] .btn-secondary,
[data-bs-theme='dark'] .btn-secondary {
    --bs-btn-color: #F1F5F9;
    --bs-btn-bg: #263449;
    --bs-btn-border-color: #334155;
    --bs-btn-hover-color: #F1F5F9;
    --bs-btn-hover-bg: #334155;
    --bs-btn-hover-border-color: #334155;
    --bs-btn-active-bg: #1E3A5F;
    --bs-btn-active-border-color: #334155;
}

/* Outline primary — ice-blue outline treatment */
.btn-outline-primary {
    --bs-btn-color: #1D4ED8;
    --bs-btn-bg: #FFFFFF;
    --bs-btn-border-color: #BFDBFE;
    --bs-btn-hover-color: #1D4ED8;
    --bs-btn-hover-bg: #EFF6FF;
    --bs-btn-hover-border-color: #93C5FD;
    --bs-btn-active-bg: #DBEAFE;
    --bs-btn-active-border-color: #3B82F6;
    --bs-btn-active-color: #1D4ED8;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

[data-theme='dark'] .btn-outline-primary,
[data-bs-theme='dark'] .btn-outline-primary {
    --bs-btn-color: #93C5FD;
    --bs-btn-bg: #111C33;
    --bs-btn-border-color: #334155;
    --bs-btn-hover-color: #93C5FD;
    --bs-btn-hover-bg: #172554;
    --bs-btn-hover-border-color: #3B82F6;
    --bs-btn-active-bg: #1E3A5F;
    --bs-btn-active-border-color: #60A5FA;
    --bs-btn-active-color: #93C5FD;
}

/* Outline success / warning / danger */
.btn-outline-success {
    --bs-btn-color: #059669;
    --bs-btn-bg: transparent;
    --bs-btn-border-color: #A7F3D0;
    --bs-btn-hover-color: #047857;
    --bs-btn-hover-bg: #ECFDF5;
    --bs-btn-hover-border-color: #059669;
    --bs-btn-active-bg: #D1FAE5;
    --bs-btn-active-border-color: #047857;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

[data-theme='dark'] .btn-outline-success,
[data-bs-theme='dark'] .btn-outline-success {
    --bs-btn-color: #6EE7B7;
    --bs-btn-bg: transparent;
    --bs-btn-border-color: #059669;
    --bs-btn-hover-color: #6EE7B7;
    --bs-btn-hover-bg: #064E3B;
    --bs-btn-hover-border-color: #10B981;
    --bs-btn-active-bg: #065F46;
}

.btn-outline-warning {
    --bs-btn-color: #B45309;
    --bs-btn-bg: transparent;
    --bs-btn-border-color: #FCD34D;
    --bs-btn-hover-color: #92400E;
    --bs-btn-hover-bg: #FFFBEB;
    --bs-btn-hover-border-color: #D97706;
    --bs-btn-active-bg: #FEF3C7;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

[data-theme='dark'] .btn-outline-warning,
[data-bs-theme='dark'] .btn-outline-warning {
    --bs-btn-color: #FCD34D;
    --bs-btn-bg: transparent;
    --bs-btn-border-color: #92400E;
    --bs-btn-hover-color: #FCD34D;
    --bs-btn-hover-bg: #78350F;
    --bs-btn-hover-border-color: #B45309;
}

.btn-outline-danger {
    --bs-btn-color: #DC2626;
    --bs-btn-bg: transparent;
    --bs-btn-border-color: #FECACA;
    --bs-btn-hover-color: #B91C1C;
    --bs-btn-hover-bg: #FEF2F2;
    --bs-btn-hover-border-color: #DC2626;
    --bs-btn-active-bg: #FEE2E2;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

[data-theme='dark'] .btn-outline-danger,
[data-bs-theme='dark'] .btn-outline-danger {
    --bs-btn-color: #FCA5A5;
    --bs-btn-bg: transparent;
    --bs-btn-border-color: #DC2626;
    --bs-btn-hover-color: #FFFFFF;
    --bs-btn-hover-bg: #B91C1C;
    --bs-btn-hover-border-color: #EF4444;
}

/* Outline secondary — neutral ghost outline */
.btn-outline-secondary {
    --bs-btn-color: #475569;
    --bs-btn-bg: #FFFFFF;
    --bs-btn-border-color: #CBD5E1;
    --bs-btn-hover-color: #1E293B;
    --bs-btn-hover-bg: #F1F5F9;
    --bs-btn-hover-border-color: #94A3B8;
    --bs-btn-active-bg: #E2E8F0;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

[data-theme='dark'] .btn-outline-secondary,
[data-bs-theme='dark'] .btn-outline-secondary {
    --bs-btn-color: #CBD5E1;
    --bs-btn-bg: #111C33;
    --bs-btn-border-color: #334155;
    --bs-btn-hover-color: #F1F5F9;
    --bs-btn-hover-bg: #172554;
    --bs-btn-hover-border-color: #334155;
}

/* ------------------------------------------------------------
   4. PAGINATION
   ------------------------------------------------------------ */

.pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.pagination-text {
    color: var(--app-text-muted);
    font-size: 0.85rem;
}

.pagination {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination .page-item .page-link,
.page-link,
.pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.55rem;
    border: 1px solid var(--app-border) !important;
    border-radius: 8px !important;
    background-color: var(--app-surface) !important;
    color: var(--accent) !important;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    line-height: 1;
    transition: all 0.15s ease;
}

.pagination .page-item:not(.active):not(.disabled) .page-link:hover,
.pagination a.page-link:hover,
.page-link:hover,
.pg-btn:hover:not(:disabled) {
    border-color: var(--accent) !important;
    background-color: #EFF6FF !important;
    color: var(--primary-hover) !important;
}

[data-theme='dark'] .pagination .page-item:not(.active):not(.disabled) .page-link:hover,
[data-theme='dark'] .pagination a.page-link:hover,
[data-theme='dark'] .page-link:hover,
[data-theme='dark'] .pg-btn:hover:not(:disabled),
[data-bs-theme='dark'] .pagination .page-item:not(.active):not(.disabled) .page-link:hover,
[data-bs-theme='dark'] .pagination a.page-link:hover,
[data-bs-theme='dark'] .page-link:hover,
[data-bs-theme='dark'] .pg-btn:hover:not(:disabled) {
    border-color: var(--accent) !important;
    background-color: #172554 !important;
    color: var(--secondary) !important;
}

.pagination .page-item.active .page-link,
.pagination .page-link.active,
.pg-btn.is-active {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
    box-shadow: 0 3px 8px rgba(var(--primary-rgb), 0.25) !important;
    font-weight: 600;
    cursor: default;
}

[data-theme='dark'] .pagination .page-item.active .page-link,
[data-theme='dark'] .pagination .page-link.active,
[data-theme='dark'] .pg-btn.is-active,
[data-bs-theme='dark'] .pagination .page-item.active .page-link,
[data-bs-theme='dark'] .pagination .page-link.active,
[data-bs-theme='dark'] .pg-btn.is-active {
    background: linear-gradient(135deg, var(--primary), var(--primary)) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4) !important;
}

.pagination .page-item.disabled .page-link,
.pagination .page-link.disabled,
.pg-btn:disabled {
    background-color: var(--app-bg) !important;
    border-color: var(--app-border) !important;
    color: var(--app-text-muted) !important;
    opacity: 0.45 !important;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-sm .page-link {
    min-width: 1.8rem;
    height: 1.8rem;
    font-size: 0.8rem;
    padding: 0 0.4rem;
}

@media (max-width: 640px) {
    .pagination-container {
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }
}

/* ------------------------------------------------------------
   5. FORM CONTROLS & INPUT GROUPS
   ------------------------------------------------------------ */

.form,
form {
    color: var(--app-text);
}

.form-label,
.form-field-label {
    color: var(--app-text);
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
}

.form-control,
.form-select {
    background-color: var(--app-surface);
    color: var(--app-text) !important;
    border: 1px solid var(--app-border);
    border-radius: 9px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus,
.form-select:focus {
    color: var(--app-text) !important;
    border-color: var(--secondary);
    background-color: var(--app-surface);
    box-shadow: 0 0 0 0.2rem rgba(var(--secondary-rgb), 0.28);
}

[data-theme='dark'] .form-control,
[data-theme='dark'] .form-select,
[data-bs-theme='dark'] .form-control,
[data-bs-theme='dark'] .form-select {
    background-color: rgba(17, 28, 51, 0.6);
    color: var(--app-text) !important;
    border-color: var(--app-border);
}

[data-theme='dark'] .form-control:focus,
[data-theme='dark'] .form-select:focus,
[data-bs-theme='dark'] .form-control:focus,
[data-bs-theme='dark'] .form-select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 0.2rem rgba(var(--secondary-rgb), 0.3);
}

.input-group-text {
    background-color: var(--app-surface);
    color: var(--app-text-muted);
    border: 1px solid var(--app-border);
}

[data-theme='dark'] .input-group-text,
[data-bs-theme='dark'] .input-group-text {
    background-color: rgba(17, 28, 51, 0.6);
    color: var(--app-text-muted);
    border-color: var(--app-border);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

[data-theme='dark'] .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.select2 {
    color: var(--app-text) !important;
    border: 1px solid var(--app-border);
    background-color: var(--app-surface);
    border-radius: 8px !important;
}

.select2-container--default .select2-selection {
    background-color: var(--app-surface) !important;
    color: var(--app-text) !important;
    border: 1px solid var(--input-border) !important;
    border-radius: 8px !important;
    min-height: 42px;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    background: var(--input-bg);
    color: var(--app-text);
    border: 1px solid var(--input-border);
    border-radius: 8px;
}

.select2-container--default .select2-results__option[aria-selected='true'] {
    background: var(--selected-bg);
    color: var(--app-text);
    font-weight: 600;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--hover-bg);
    color: var(--primary);
}

[data-theme='dark'] .select2-container--default .select2-results__option[aria-selected='true'] {
    background: var(--selected-bg);
    color: var(--app-text);
}

[data-theme='dark'] .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--hover-bg);
    color: #93C5FD;
}

.select2-container--default .select2-results__group {
    color: var(--app-text-muted);
    background: transparent;
}

/* ------------------------------------------------------------
   Toast notifications (toastr) — semantic Cobalt palette
   ------------------------------------------------------------ */

.toast-success {
    background-color: #059669 !important;
}

.toast-info {
    background-color: #3B82F6 !important;
}

.toast-warning {
    background-color: #D97706 !important;
}

.toast-error {
    background-color: #DC2626 !important;
}

/* ------------------------------------------------------------
   6. BADGES & PILLS
   ------------------------------------------------------------ */

.badge {
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge.bg-primary {
    background-color: var(--primary) !important;
    color: #fff !important;
}

.badge.bg-primary-subtle,
.badge-subtle-primary {
    background-color: #EFF6FF !important;
    color: var(--primary-hover) !important;
    border: 1px solid #BFDBFE;
}

[data-theme='dark'] .badge.bg-primary-subtle,
[data-theme='dark'] .badge-subtle-primary {
    background-color: #172554 !important;
    color: #93C5FD !important;
    border-color: #1E3A5F;
}

.badge.bg-success-subtle {
    background-color: #ECFDF5 !important;
    color: #065F46 !important;
    border: 1px solid #A7F3D0;
}

[data-theme='dark'] .badge.bg-success-subtle {
    background-color: #064E3B !important;
    color: #6EE7B7 !important;
    border-color: #059669;
}

.badge.bg-warning-subtle {
    background-color: #FFFBEB !important;
    color: #92400E !important;
    border: 1px solid #FCD34D;
}

[data-theme='dark'] .badge.bg-warning-subtle {
    background-color: #422006 !important;
    color: #FDE68A !important;
    border-color: #92400E;
}

.badge.bg-danger-subtle {
    background-color: #FEF2F2 !important;
    color: #991B1B !important;
    border: 1px solid #FECACA;
}

[data-theme='dark'] .badge.bg-danger-subtle {
    background-color: #7F1D1D !important;
    color: #FCA5A5 !important;
    border-color: #991B1B;
}

.badge.bg-secondary-subtle {
    background-color: rgba(var(--primary-rgb), 0.08) !important;
    color: var(--app-text) !important;
    border: 1px solid var(--app-border);
}

[data-theme='dark'] .badge.bg-secondary-subtle {
    background-color: rgba(var(--primary-rgb), 0.12) !important;
    color: var(--app-text) !important;
    border-color: var(--app-border);
}

/* Nav pills */
.nav-pills .nav-link {
    color: var(--app-text-muted);
    border-radius: 9px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.nav-pills .nav-link:hover {
    color: var(--accent);
    background-color: rgba(var(--primary-rgb), 0.08);
}

.nav-pills .nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover)) !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.2);
}

[data-theme='dark'] .nav-pills .nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--primary)) !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

/* ------------------------------------------------------------
   7. PROFILE MODULE
   ------------------------------------------------------------ */

.profile-side-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.04);
}

[data-theme='dark'] .profile-side-card {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.profile-side-cover {
    height: 90px;
    background: var(--brand-gradient-diagonal);
}

.profile-side-body {
    padding: 0 20px 20px;
    text-align: center;
    margin-top: -46px;
}

.profile-avatar {
    width: 92px;
    height: 92px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: var(--app-surface);
    border: 4px solid var(--app-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.2);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--app-text);
    margin: 0;
}

.profile-handle {
    color: var(--app-text-muted);
    font-size: .85rem;
    margin-bottom: 10px;
}

.profile-role-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: 10px;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: .72rem;
    font-weight: 600;
    text-transform: capitalize;
}

[data-theme='dark'] .role-badge {
    background: rgba(var(--primary-rgb), 0.16);
    color: #93C5FD;
    border-color: rgba(var(--primary-rgb), 0.3);
}

.role-badge-lg {
    font-size: .8rem;
    padding: 5px 12px;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
}

.status-active {
    background: #ECFDF5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

[data-theme='dark'] .status-active {
    background: #064E3B;
    color: #6EE7B7;
    border-color: #059669;
}

.status-inactive {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

[data-theme='dark'] .status-inactive {
    background: #7F1D1D;
    color: #FCA5A5;
    border-color: #991B1B;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.profile-meta {
    margin-top: 18px;
    text-align: left;
}

.profile-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: .82rem;
    color: var(--app-text);
    min-width: 0;
}

.profile-meta-row i:first-child {
    color: var(--app-text-muted);
    flex-shrink: 0;
}

.profile-meta-row .text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.verified-icon {
    color: var(--primary);
    font-size: .95rem;
}

[data-theme='dark'] .verified-icon {
    color: var(--primary);
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--app-border);
}

.profile-stat {
    text-align: center;
}

.profile-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--app-text);
}

.profile-stat-label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--app-text-muted);
}

.profile-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 16px;
}

.profile-tab {
    flex: 1;
    min-width: 110px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border: 0;
    background: transparent;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--app-text-muted);
    transition: background .15s, color .15s;
    cursor: pointer;
}

.profile-tab:hover {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--accent);
}

[data-theme='dark'] .profile-tab:hover {
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--secondary);
}

.profile-tab.is-active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.2);
}

[data-theme='dark'] .profile-tab.is-active {
    background: linear-gradient(135deg, var(--primary), var(--primary));
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.profile-content {
    min-height: 320px;
}

.profile-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.04);
    color: var(--app-text);
}

[data-theme='dark'] .profile-card {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.profile-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--app-text);
    margin-bottom: 16px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.detail-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid var(--app-border);
}

.detail-row:last-child {
    border-bottom: 0;
}

.detail-row-icon {
    width: 36px;
    height: 36px;
    background: rgba(var(--primary-rgb), 0.1);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
    font-size: 1rem;
}

[data-theme='dark'] .detail-row-icon {
    background: rgba(var(--primary-rgb), 0.15);
    color: #93C5FD;
}

.detail-row-label {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--app-text-muted);
}

.detail-row-value {
    font-size: .9rem;
    font-weight: 500;
    color: var(--app-text);
    word-break: break-word;
}

.empty-block {
    text-align: center;
    padding: 40px 20px;
    color: var(--app-text-muted);
}

.empty-block i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 12px;
    opacity: .5;
}

.passkey-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.passkey-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: var(--app-surface);
}

.passkey-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

[data-theme='dark'] .passkey-icon {
    background: rgba(var(--primary-rgb), 0.15);
    color: #93C5FD;
}

.passkey-body {
    flex: 1;
    min-width: 0;
}

.passkey-name {
    font-weight: 600;
    font-size: .9rem;
    color: var(--app-text);
}

.passkey-meta {
    font-size: .75rem;
    color: var(--app-text-muted);
}

.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--app-border);
}

.activity-item:last-child {
    border-bottom: 0;
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 8px;
    flex-shrink: 0;
}

[data-theme='dark'] .activity-dot {
    background: var(--primary);
}

.activity-description {
    font-size: .9rem;
    color: var(--app-text);
}

.activity-meta {
    font-size: .75rem;
    color: var(--app-text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.activity-action {
    background: rgba(var(--primary-rgb), 0.08);
    padding: 1px 6px;
    border-radius: 4px;
    color: var(--app-text-muted);
    font-size: .7rem;
}

/* ============================================================
   Navigation Tabs & Pills
   ============================================================ */

.nav-pills .nav-link {
    color: var(--app-text);
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.nav-pills .nav-link:hover {
    color: var(--accent);
    background-color: rgba(var(--primary-rgb), 0.08);
}

[data-theme='dark'] .nav-pills .nav-link:hover {
    color: #93C5FD;
    background-color: rgba(var(--primary-rgb), 0.12);
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover)) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(var(--primary-rgb), 0.25);
}

[data-theme='dark'] .nav-pills .nav-link.active,
[data-theme='dark'] .nav-pills .show > .nav-link {
    background: linear-gradient(135deg, var(--primary), #1E3A5F) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.nav-tabs {
    border-bottom-color: var(--app-border);
}

.nav-tabs .nav-link {
    color: var(--app-text-muted);
    border: none;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    padding: 0.6rem 1rem;
    transition: all 0.15s ease-in-out;
}

.nav-tabs .nav-link:hover {
    color: var(--accent);
    border-color: transparent;
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
    color: var(--accent) !important;
    background: transparent !important;
    border-bottom: 2px solid var(--accent) !important;
}

/* ============================================================
   Form Controls Theme Focus & Checks
   ============================================================ */

.form-control:focus,
.form-select:focus {
    border-color: var(--secondary) !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--secondary-rgb), 0.28) !important;
}

[data-theme='dark'] .form-control:focus,
[data-theme='dark'] .form-select:focus {
    border-color: var(--secondary) !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--secondary-rgb), 0.3) !important;
}

.form-check-input:checked {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

[data-theme='dark'] .form-check-input:checked {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.form-check-input:focus {
    border-color: var(--secondary) !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--secondary-rgb), 0.28) !important;
}

[data-theme='dark'] .form-check-input:focus {
    border-color: var(--secondary) !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--secondary-rgb), 0.3) !important;
}

/* ============================================================
   Code & Pre
   ============================================================ */

code {
    color: var(--primary-hover);
    background-color: rgba(var(--primary-rgb), 0.08);
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    font-size: 0.875em;
}

[data-theme='dark'] code {
    color: #93C5FD;
    background-color: rgba(var(--primary-rgb), 0.12);
}

pre {
    color: var(--app-text);
}

/* ============================================================
   Table borders (1px solid black for rows and columns)
   ============================================================ */

table,
.table,
.dt-table {
    border-collapse: collapse !important;
    border: 1px solid var(--app-border) !important;
}

table th,
table td,
.table th,
.table td,
.dt-table thead th,
.dt-table tbody td,
.table > :not(caption) > * > *,
.dt-table > :not(caption) > * > * {
    border: 1px solid var(--app-border) !important;
    border-width: 1px !important;
}

/* ============================================================
   Button shape & motion — flat Cobalt fills (no heavy gradients)
   ============================================================ */

.btn {
    border-radius: 8px;
    transition: background-color 0.18s ease, background-image 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease;
}

.btn:not(:disabled):hover {
    transform: translateY(-1px);
}

.btn:not(:disabled):active {
    transform: translateY(0);
}

.btn:not(:disabled):focus-visible {
    box-shadow: 0 0 0 0.2rem var(--color-focus-ring, rgba(59, 130, 246, 0.25));
}

/* Ghost / light / dark utility buttons */
.btn-light {
    --bs-btn-bg: #FFFFFF;
    --bs-btn-border-color: #E2E8F0;
    --bs-btn-color: #1E293B;
    --bs-btn-hover-bg: #F1F5F9;
    --bs-btn-hover-border-color: #CBD5E1;
    --bs-btn-hover-color: #0F172A;
    --bs-btn-active-bg: #E2E8F0;
}

.btn-dark {
    --bs-btn-bg: #172554;
    --bs-btn-border-color: #172554;
    --bs-btn-color: #FFFFFF;
    --bs-btn-hover-bg: #1E3A5F;
    --bs-btn-hover-border-color: #1E3A5F;
    --bs-btn-hover-color: #FFFFFF;
    --bs-btn-active-bg: #0B1120;
}

[data-theme='dark'] .btn-light,
[data-bs-theme='dark'] .btn-light {
    --bs-btn-bg: #172554;
    --bs-btn-border-color: #334155;
    --bs-btn-color: #F1F5F9;
    --bs-btn-hover-bg: #263449;
    --bs-btn-hover-color: #FFFFFF;
    --bs-btn-active-bg: #1E3A5F;
}

[data-theme='dark'] .btn-dark,
[data-bs-theme='dark'] .btn-dark {
    --bs-btn-bg: #0B1120;
    --bs-btn-border-color: #0B1120;
    --bs-btn-hover-bg: #172554;
    --bs-btn-hover-border-color: #172554;
}

/* ============================================================
   Theme polish — headings, focus states, dashboard stat tiles
   ============================================================ */

/* Important headings use the primary blue */
.navbar-title,
.page-title {
    color: var(--primary);
}

[data-theme='dark'] .navbar-title,
[data-theme='dark'] .page-title {
    color: #93C5FD;
}

/* Visible keyboard focus everywhere */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

.sidebar-drawer :focus-visible,
.login-btn:focus-visible,
.btn-primary:focus-visible,
.btn-success:focus-visible {
    outline-color: var(--secondary);
}

/* Navbar control open/hover states */
.notification-trigger[aria-expanded='true'],
.navbar-icon-btn[aria-expanded='true'] {
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary);
}

.navbar-user-btn[aria-expanded='true'] {
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.18);
}

[data-theme='dark'] .notification-trigger[aria-expanded='true'],
[data-theme='dark'] .navbar-icon-btn[aria-expanded='true'],
[data-theme='dark'] .navbar-user-btn[aria-expanded='true'] {
    background: rgba(var(--secondary-rgb), 0.16);
    color: var(--secondary);
}

/* Prevent horizontal overflow from long flex children */
.navbar-title,
.user-menu-name,
.user-menu-email,
.notification-title {
    min-width: 0;
}

/* Dashboard stat icon tiles */
.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 1.25rem;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.stat-icon--primary {
    background: linear-gradient(135deg, #1D4ED8, #172554);
    color: #fff;
}

.stat-icon--sky {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: #fff;
}

.stat-icon--pink {
    background: linear-gradient(135deg, #F43F5E, #E11D48);
    color: #fff;
}

.stat-icon--navy {
    background: linear-gradient(135deg, #172554, #0B1120);
    color: #DBEAFE;
}

/* Subtle ice-blue accent card */
.ui-card--cream {
    background: linear-gradient(160deg, #EFF6FF 0%, #FFFFFF 65%);
    border-color: #DBEAFE;
}

[data-theme='dark'] .ui-card--cream {
    background: linear-gradient(160deg, #172554 0%, #111C33 65%);
    border-color: #263449;
}

/* Dark overlays outside the main tree use the elevated Cobalt surface */
[data-bs-theme='dark'] .popover {
    --bs-popover-bg: #172554;
    --bs-popover-header-bg: #111C33;
    --bs-popover-body-color: #F8FAFC;
    --bs-popover-border-color: #263449;
    --bs-popover-arrow-color: #172554;
}

[data-bs-theme='dark'] .tooltip-inner {
    background-color: #172554;
    color: #F8FAFC;
    border: 1px solid #334155;
}

/* Dropdown menus always render above page content */
.dropdown-menu {
    z-index: 1055;
}

/* ------------------------------------------------------------
   Navbar global search
   ------------------------------------------------------------ */
.navbar-search-col {
    flex: 1 1 340px;
    min-width: 0;
    max-width: 460px;
    display: none;
}

@media (min-width: 768px) {
    .navbar-search-col {
        display: block;
    }
}

.navbar-search {
    position: relative;
}

.navbar-search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--app-text-muted);
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 1;
}

.navbar-search-input {
    height: 38px;
    padding-left: 2.4rem;
    padding-right: 3.6rem;
    border-radius: 12px;
    border: 1px solid transparent;
    background: rgba(var(--primary-rgb), 0.07);
    font-size: 0.85rem;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.navbar-search-input::placeholder {
    color: var(--app-text-muted);
    opacity: 0.9;
}

.navbar-search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.navbar-search-input:focus {
    background: var(--app-surface);
    border-color: rgba(var(--primary-rgb), 0.55);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.14);
    color: var(--app-text);
}

.navbar-search-kbd {
    position: absolute;
    right: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.62rem;
    line-height: 1;
    padding: 0.25rem 0.4rem;
    border-radius: 6px;
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    color: var(--app-text-muted);
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 1;
}

.navbar-search:focus-within .navbar-search-kbd,
.navbar-search.is-open .navbar-search-kbd {
    opacity: 0;
}

.navbar-search-panel {
    position: absolute;
    top: calc(100% + 0.55rem);
    left: 0;
    right: 0;
    max-height: min(70vh, 460px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 14px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
    padding: 0.5rem;
    z-index: 1030;
}

.navbar-search-status {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.75rem;
    color: var(--app-text-muted);
    font-size: 0.82rem;
}

.navbar-search-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(var(--primary-rgb), 0.25);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: navbarSearchSpin 0.7s linear infinite;
}

@keyframes navbarSearchSpin {
    to {
        transform: rotate(360deg);
    }
}

.search-result-group + .search-result-group {
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px dashed var(--app-border);
}

.search-result-group-label {
    display: block;
    padding: 0.4rem 0.6rem 0.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--app-text-muted);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.6rem;
    border-radius: 10px;
    color: var(--app-text);
    text-decoration: none;
    transition: background-color 0.12s ease;
}

.search-result-item > .bi:first-child {
    color: var(--primary);
    font-size: 0.95rem;
}

.search-result-item-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.search-result-item-label {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item-sub {
    font-size: 0.72rem;
    color: var(--app-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item-go {
    opacity: 0;
    color: var(--app-text-muted);
    transform: translateX(-3px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.search-result-item:hover,
.search-result-item.is-active {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--app-text);
    text-decoration: none;
}

.search-result-item:hover .search-result-item-go,
.search-result-item.is-active .search-result-item-go {
    opacity: 1;
    transform: translateX(0);
}

.search-result-item:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

/* ------------------------------------------------------------
   Notifications page: row actions & read state
   ------------------------------------------------------------ */
.notification-row {
    align-items: center;
}

.notification-row .notification-body {
    flex: 1;
    min-width: 0;
}

.notification-row-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: auto;
}

.notification-mark-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.65rem;
    border: 1px solid rgba(var(--primary-rgb), 0.35);
    border-radius: 8px;
    background: transparent;
    color: var(--primary);
    font-size: 0.75rem;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.notification-mark-btn:hover:not(:disabled) {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: var(--primary);
    color: var(--primary-hover);
}

.notification-mark-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.notification-mark-btn.is-loading {
    opacity: 0.65;
    pointer-events: none;
}

.notification-mark-btn.is-error {
    border-color: rgba(var(--rose-rgb), 0.75);
    color: #DC2626;
    animation: notificationMarkShake 0.3s ease;
}

@keyframes notificationMarkShake {
    25% {
        transform: translateX(-2px);
    }

    75% {
        transform: translateX(2px);
    }
}

.notification-read-flag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.35rem;
    color: var(--app-text-muted);
    font-size: 0.75rem;
    line-height: 1.2;
}

.notification-read-flag .bi {
    color: var(--primary);
}

.notification-open-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: var(--app-text-muted);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.notification-open-link:hover {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

/* ------------------------------------------------------------
   Profile → Preferences (theme radios)
   ------------------------------------------------------------ */
.preference-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.preference-option:hover {
    border-color: rgba(var(--primary-rgb), 0.45);
    background: rgba(var(--primary-rgb), 0.04);
}

.preference-option:has(input:checked) {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.08);
    box-shadow: 0 0 0 0.15rem rgba(var(--primary-rgb), 0.12);
}

.preference-option-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.preference-option-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--app-text);
}

.preference-option-hint {
    font-size: 0.78rem;
    color: var(--app-text-muted);
}


/* ------------------------------------------------------------
   Respect reduced-motion preferences
   ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ------------------------------------------------------------
   Settings form — sticky save bar & switch rows
   ------------------------------------------------------------ */

.settings-save-bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.85rem 1.1rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 12px;
    box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.08);
}

[data-theme='dark'] .settings-save-bar {
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.45);
}

.setting-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 42px;
    margin: 0;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: var(--app-bg);
}

.setting-switch .form-check-input {
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
}

.setting-switch .form-check-label {
    margin: 0;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--app-text);
}

.setting-switch .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.setting-switch:has(.form-check-input:focus-visible) {
    border-color: var(--secondary);
    box-shadow: 0 0 0 0.2rem var(--color-focus-ring, rgba(59, 130, 246, 0.25));
}

.setting-switch:has(.form-check-input:disabled) {
    opacity: 0.65;
}
