/* ============================================================================
   Elixir Brand — Design Tokens
   Source: docs/brand/elixir_brand_guidelines_sprint1.html + Design Tokens.json
   Matches the web app at src/Presentation/eixir-web/src/app/globals.css
   ============================================================================ */

:root {
    /* Primary — Digital Teal */
    --primary-color: #00838f;
    --primary-50: #e6f7f7;
    --primary-100: #b2e0e3;
    --primary-200: #8ccfd3;
    --primary-300: #59b7bd;
    --primary-400: #38a8af;
    --primary-500: #00838f;
    --primary-600: #007782;
    --primary-700: #005d66;
    --primary-800: #00484f;
    --primary-900: #00373d;
    --primary-foreground: #ffffff;

    /* Brand text / ink */
    --deep-teal: #004d52;
    --ink: #0f2226;

    /* Secondary — Emerald */
    --accent-color: #26a69a;
    --secondary-50: #e6f5f3;
    --secondary-100: #bfe3de;
    --secondary-200: #99d1ca;
    --secondary-300: #72bfb5;
    --secondary-400: #4cada1;
    --secondary-500: #26a69a;
    --secondary-600: #209583;
    --secondary-700: #1a7d6d;
    --secondary-foreground: #ffffff;

    /* Surfaces / backgrounds */
    --bg-light: #f7fbfb;
    --bg-light-dim: #e9f1f1;
    --bg-light-bright: #ffffff;
    --surface-container-low: #f3f9f9;
    --surface-container: #eef4f4;
    --surface-container-high: #e6eeee;
    --on-surface: #0f2226;
    --on-surface-variant: #5b7a7d;
    --outline: #b8cacc;
    --outline-variant: #ddeae9;
    --border: #ddeae9;

    /* Sidebar (light surface with teal accents — brand default) */
    --sidebar-bg: #ffffff;
    --sidebar-hover: #e6f7f7;
    --sidebar-active: #e6f7f7;
    --sidebar-text: #3a5f63;
    --sidebar-text-active: #004d52;
    --sidebar-accent: #00838f;
    --sidebar-divider: #ddeae9;
    --sidebar-width: 260px;
    --sidebar-dock: 64px;

    /* Status / semantic */
    --success: #00b894;
    --success-container: #e6f9f3;
    --warning: #f5a623;
    --warning-container: #fef5e6;
    --danger: #e5484d;
    --danger-container: #fdedee;
    --on-danger-container: #751c1a;
    --info: #00838f;
    --info-container: #e6f7f7;

    /* Shadows — teal-tinted depth */
    --shadow-card: 0 2px 12px rgba(0, 77, 82, 0.06);
    --shadow-card-hover: 0 8px 32px rgba(0, 77, 82, 0.10);
    --shadow-overlay: 0 16px 48px rgba(0, 77, 82, 0.12);

    /* Border radii */
    --radius-card: 18px;
    --radius-btn: 14px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-pill: 999px;

    /* Fonts — Cairo for Arabic, Manrope for English */
    --font-ar: 'Cairo', 'Tajawal', 'Segoe UI', system-ui, sans-serif;
    --font-en: 'Manrope', 'Segoe UI', system-ui, sans-serif;

    /* Animations */
    --transition-fast: 150ms ease-out;
    --transition: 200ms ease-out;
    --transition-slow: 350ms ease-out;
}

/* ---------------------------------------------------------------------------
   Brand typography — switch by `dir` attribute
   --------------------------------------------------------------------------- */
html, body {
    font-family: var(--font-en);
}
html[dir="rtl"], html[dir="rtl"] body {
    font-family: var(--font-ar);
}

/* ---------------------------------------------------------------------------
   Brand surfaces
   --------------------------------------------------------------------------- */
.page {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-light);
    color: var(--ink);
}

.sidebar-content {
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    border-inline-end: 1px solid var(--sidebar-divider);
}

.sidebar-content .nav-link {
    color: var(--sidebar-text);
    padding: 10px 16px;
    transition: background-color var(--transition), color var(--transition);
    border-radius: 0;
    border-inline-start: 3px solid transparent;
}

.sidebar-content .nav-link:hover {
    background-color: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.sidebar-content .nav-link.active {
    color: var(--sidebar-text-active);
    background-color: var(--sidebar-active);
    border-inline-start-color: var(--sidebar-accent);
    font-weight: 600;
}

.sidebar-content .nav-category {
    color: var(--on-surface-variant);
    font-size: 0.7rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    font-weight: 600;
    padding: 12px 16px 6px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: var(--bg-light);
}

.content-body {
    flex: 1;
    min-height: 100%;
    background-color: #f5f7f8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66ZM28 100L0 84L0 50L28 34L56 50L56 84L28 100Z' fill='none' stroke='rgba(0,77,82,0.06)' stroke-width='0.75' stroke-linejoin='miter' stroke-miterlimit='1'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------------------
   Cards
   --------------------------------------------------------------------------- */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background-color: #ffffff;
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--transition), transform var(--transition);
}

.card .card-body {
    padding: 1.5rem;
}

.card:hover {
    box-shadow: var(--shadow-card-hover);
}

.appbar-hide-xs {
    display: inline-block;
}

@media (max-width: 575.98px) {
    .appbar-hide-xs {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .appbar-hide-sm {
        display: none !important;
    }
}

/* ---------------------------------------------------------------------------
   Brand buttons (overrides Bootstrap primary)
   --------------------------------------------------------------------------- */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    border-radius: var(--radius-btn);
    transition: background-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-700);
    border-color: var(--primary-700);
    color: #ffffff;
    box-shadow: 0 0 0 0.2rem rgba(0, 131, 143, 0.20);
}

.btn-primary:active {
    background-color: var(--primary-800) !important;
    border-color: var(--primary-800) !important;
    transform: scale(0.98);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: transparent;
    border-radius: var(--radius-btn);
    transition: background-color var(--transition), color var(--transition);
}

.btn-outline-primary:hover {
    background-color: var(--primary-50);
    color: var(--primary-700);
    border-color: var(--primary-color);
}

.btn-success {
    background-color: var(--success);
    border-color: var(--success);
    color: #ffffff;
    border-radius: var(--radius-btn);
}

/* ---------------------------------------------------------------------------
   Brand text helpers
   --------------------------------------------------------------------------- */
.text-deep {
    color: var(--deep-teal) !important;
}
.text-primary-brand {
    color: var(--primary-color) !important;
}
.text-secondary-brand {
    color: var(--secondary-500) !important;
}
.text-muted-brand {
    color: var(--on-surface-variant) !important;
}

.bg-primary-brand { background-color: var(--primary-color) !important; color: #fff; }
.bg-primary-soft { background-color: var(--primary-50) !important; color: var(--primary-700); }
.bg-secondary-soft { background-color: var(--secondary-50) !important; color: var(--secondary-700); }
.bg-success-soft { background-color: var(--success-container) !important; color: var(--success); }
.bg-warning-soft { background-color: var(--warning-container) !important; color: var(--warning); }
.bg-danger-soft { background-color: var(--danger-container) !important; color: var(--danger); }
.bg-info-soft { background-color: var(--info-container) !important; color: var(--info); }

/* Brand gradient text (with animated shift) */
.gradient-heading {
    background: linear-gradient(135deg, #004d52 0%, #00838f 45%, #26a69a 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: eixir-gradient-shift 6s ease infinite;
}

.gradient-heading-light {
    background: linear-gradient(135deg, #004d52 0%, #00838f 45%, #26a69a 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: eixir-gradient-shift 6s ease infinite;
}
.dark-theme .gradient-heading-light {
    background: linear-gradient(135deg, #ffffff 0%, #b2e0e3 50%, #4dd0e6 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: eixir-gradient-shift 6s ease infinite;
}

/* Brand gradient surface (used on hero / dark stats / trust bar) */
.gradient-trust-bg {
    background-image: linear-gradient(120deg, #004d52 0%, #00838f 30%, #26a69a 65%, #004d52 100%);
    background-size: 200% 200%;
    animation: eixir-gradient-shift 8s ease infinite;
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.gradient-trust-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='40' viewBox='0 0 200 40'%3E%3Cpath d='M0 20 Q25 5 50 20 T100 20 T150 20 T200 20' fill='none' stroke='%23ffffff' stroke-width='1.5' opacity='0.07'/%3E%3C/svg%3E");
    background-repeat: repeat;
    pointer-events: none;
}

/* Animated keyframes */
@keyframes eixir-gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

@keyframes eixir-pulse-soft {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.65; }
}

@keyframes eixir-breathe {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.04); opacity: 0.95; }
}

@keyframes eixir-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes eixir-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes eixir-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}

@keyframes eixir-slide-up {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes eixir-scale-in {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes eixir-fade-in-left {
    from { opacity: 0; transform: translateX(-16px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes eixir-fade-in-right {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
}

.anim-fade-in      { animation: eixir-fade-in 0.5s ease-out both; }
.anim-pulse-soft   { animation: eixir-pulse-soft 2.4s ease-in-out infinite; }
.anim-breathe      { animation: eixir-breathe 4s ease-in-out infinite; }
.anim-float        { animation: eixir-float 6s ease-in-out infinite; }
.anim-slide-up     { animation: eixir-slide-up 0.5s ease-out both; }
.anim-scale-in     { animation: eixir-scale-in 0.4s ease-out both; }
.anim-fade-in-left { animation: eixir-fade-in-left 0.4s ease-out both; }
.anim-fade-in-right{ animation: eixir-fade-in-right 0.4s ease-out both; }

.anim-stagger > * {
    animation: eixir-slide-up 0.4s ease-out both;
}
.anim-stagger > *:nth-child(1)  { animation-delay: 0.03s; }
.anim-stagger > *:nth-child(2)  { animation-delay: 0.06s; }
.anim-stagger > *:nth-child(3)  { animation-delay: 0.09s; }
.anim-stagger > *:nth-child(4)  { animation-delay: 0.12s; }
.anim-stagger > *:nth-child(5)  { animation-delay: 0.15s; }
.anim-stagger > *:nth-child(6)  { animation-delay: 0.18s; }
.anim-stagger > *:nth-child(7)  { animation-delay: 0.21s; }
.anim-stagger > *:nth-child(8)  { animation-delay: 0.24s; }
.anim-stagger > *:nth-child(9)  { animation-delay: 0.27s; }
.anim-stagger > *:nth-child(10) { animation-delay: 0.30s; }

/* Gradient animated tab indicator — applies to all SfTab instances */
.e-tab .e-tab-header .e-indicator {
    background: linear-gradient(90deg, #004d52, #00838f, #26a69a, #00838f, #004d52) !important;
    background-size: 200% 100% !important;
    animation: eixir-gradient-shift 4s ease infinite !important;
    height: 3px !important;
    border-radius: 2px !important;
}
/* Fallback: active tab bottom border for themes that don't use .e-indicator */
.e-tab .e-tab-header .e-toolbar-item.e-active .e-tab-wrap::after {
    background: linear-gradient(90deg, #004d52, #00838f, #26a69a) !important;
    background-size: 200% 100% !important;
    animation: eixir-gradient-shift 4s ease infinite !important;
    height: 3px !important;
}
/* Active tab label uses gradient text */
.e-tab .e-tab-header .e-toolbar-item.e-active .e-tab-text {
    background: linear-gradient(90deg, #004d52, #00838f, #26a69a);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700 !important;
}

/* Auth layout branded particle field — floating dots via box-shadow */
.auth-particle-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}
.auth-particle-field::before,
.auth-particle-field::after {
    content: '';
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: transparent;
    animation: particle-drift 12s linear infinite;
}
.auth-particle-field::before {
    box-shadow:
        40px 120px 0 0 rgba(77, 208, 230, 0.5),
        160px 60px 0 0 rgba(77, 208, 230, 0.6),
        280px 200px 0 0 rgba(38, 166, 154, 0.4),
        120px 320px 0 0 rgba(77, 208, 230, 0.3),
        340px 80px 0 0 rgba(38, 166, 154, 0.5),
        200px 380px 0 0 rgba(77, 208, 230, 0.4),
        60px 260px 0 0 rgba(38, 166, 154, 0.3),
        380px 160px 0 0 rgba(77, 208, 230, 0.5),
        100px 40px 0 0 rgba(38, 166, 154, 0.4),
        300px 300px 0 0 rgba(77, 208, 230, 0.3),
        180px 140px 0 0 rgba(38, 166, 154, 0.5),
        20px 340px 0 0 rgba(77, 208, 230, 0.4);
    animation-duration: 14s;
    animation-delay: -2s;
}
.auth-particle-field::after {
    width: 2px;
    height: 2px;
    box-shadow:
        80px 40px 0 0 rgba(77, 208, 230, 0.35),
        240px 180px 0 0 rgba(38, 166, 154, 0.3),
        140px 280px 0 0 rgba(77, 208, 230, 0.4),
        360px 100px 0 0 rgba(38, 166, 154, 0.25),
        40px 200px 0 0 rgba(77, 208, 230, 0.35),
        320px 360px 0 0 rgba(38, 166, 154, 0.3),
        260px 60px 0 0 rgba(77, 208, 230, 0.4),
        100px 360px 0 0 rgba(38, 166, 154, 0.25),
        200px 20px 0 0 rgba(77, 208, 230, 0.35),
        380px 240px 0 0 rgba(38, 166, 154, 0.3);
    animation-duration: 18s;
    animation-delay: -4s;
}
@keyframes particle-drift {
    0%   { transform: translateY(0) translateX(0) scale(1); opacity: 1; }
    25%  { transform: translateY(-30px) translateX(15px) scale(0.9); opacity: 0.7; }
    50%  { transform: translateY(-60px) translateX(-10px) scale(1.1); opacity: 0.85; }
    75%  { transform: translateY(-90px) translateX(20px) scale(0.95); opacity: 0.6; }
    100% { transform: translateY(-120px) translateX(0) scale(1); opacity: 1; }
}

/* Skeleton shimmer (replaces Bootstrap placeholder-glow with brand color) */
.eixir-skeleton {
    background: linear-gradient(90deg, #e6efef 0%, #f3f9f9 50%, #e6efef 100%);
    background-size: 200% 100%;
    animation: eixir-shimmer 1.6s linear infinite;
    border-radius: var(--radius-sm);
    color: transparent !important;
}

/* ---------------------------------------------------------------------------
   Dark theme overrides
   --------------------------------------------------------------------------- */
.dark-theme {
    --bg-light: #0b1f22;
    --bg-light-dim: #0f2a2e;
    --bg-light-bright: #133438;
    --ink: #e6f7f5;
    --on-surface: #e6f7f5;
    --on-surface-variant: #8aa7aa;
    --outline: #2a4a4e;
    --outline-variant: #1f3a3e;
    --border: #1f3a3e;
    --sidebar-bg: #0f2a2e;
    --sidebar-hover: rgba(0, 131, 143, 0.15);
    --sidebar-active: rgba(0, 131, 143, 0.20);
    --sidebar-text: rgba(230, 247, 245, 0.70);
    --sidebar-text-active: #ffffff;
    --sidebar-divider: #1f3a3e;
}

.dark-theme .card {
    background-color: #133438;
    color: #e6f7f5;
    border-color: #1f3a3e;
}

.dark-theme .card .text-muted,
.dark-theme .text-muted {
    color: #8aa7aa !important;
}

.dark-theme .form-control,
.dark-theme .form-select {
    background-color: #0f2a2e;
    color: #e6f7f5;
    border-color: #1f3a3e;
}

.dark-theme .table {
    color: #e6f7f5;
}

.dark-theme .table > :not(caption) > * > * {
    background-color: #133438;
    border-bottom-color: #1f3a3e;
}

.dark-theme .modal-content {
    background-color: #133438;
    color: #e6f7f5;
}

/* ── Dark mode: content areas ── */
.dark-theme .content-body {
    background-color: #0b1f22 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66ZM28 100L0 84L0 50L28 34L56 50L56 84L28 100Z' fill='none' stroke='rgba(131,191,199,0.08)' stroke-width='0.75' stroke-linejoin='miter' stroke-miterlimit='1'/%3E%3C/svg%3E") !important;
}
.dark-theme .main-content {
    background-color: #0b1f22 !important;
}

/* ── Dark mode: stat cards ── */
.dark-theme .stat-card {
    background-color: #133438 !important;
    border-color: #1f3a3e !important;
}
.dark-theme .stat-card .stat-label {
    color: #8aa7aa !important;
}
.dark-theme .stat-card .stat-value {
    color: #e6f7f5 !important;
}

/* ── Dark mode: table brand headers ── */
.dark-theme .table thead.table-light th {
    background: linear-gradient(135deg, #0f2a2e 0%, #133438 100%) !important;
    color: #8aa7aa !important;
    border-bottom-color: #1f3a3e !important;
}
.dark-theme .table tbody td {
    color: #e6f7f5 !important;
    border-bottom-color: #1f3a3e !important;
}
.dark-theme .table tbody tr:hover {
    background-color: rgba(0, 131, 143, 0.08) !important;
}

/* ── Dark mode: badges ── */
.dark-theme .badge {
    background-color: rgba(0, 131, 143, 0.25) !important;
    color: #4dd0e6 !important;
}
.dark-theme .badge-success,
.dark-theme .text-success {
    background-color: rgba(34, 197, 94, 0.20) !important;
    color: #86efac !important;
}
.dark-theme .badge-warning,
.dark-theme .text-warning {
    background-color: rgba(234, 179, 8, 0.20) !important;
    color: #fcd34d !important;
}
.dark-theme .badge-danger,
.dark-theme .text-danger {
    background-color: rgba(239, 68, 68, 0.20) !important;
    color: #fca5a5 !important;
}
.dark-theme .badge-secondary {
    background-color: rgba(156, 163, 175, 0.20) !important;
    color: #9ca3af !important;
}
.dark-theme .text-primary {
    color: #4dd0e6 !important;
}
.dark-theme .text-success {
    color: #86efac !important;
}

/* ── Dark mode: alerts ── */
.dark-theme .alert-danger {
    background-color: rgba(239, 68, 68, 0.12) !important;
    border-color: rgba(239, 68, 68, 0.25) !important;
    color: #fca5a5 !important;
}
.dark-theme .alert-success {
    background-color: rgba(34, 197, 94, 0.12) !important;
    border-color: rgba(34, 197, 94, 0.25) !important;
    color: #86efac !important;
}

/* ── Dark mode: Syncfusion components ── */
.dark-theme .e-btn {
    background-color: #133438 !important;
    border-color: #1f3a3e !important;
    color: #e6f7f5 !important;
}
.dark-theme .e-btn:hover {
    background-color: #1a4045 !important;
    border-color: #2a4a4e !important;
}
.dark-theme .e-btn.e-flat {
    background-color: transparent !important;
    border-color: transparent !important;
    color: #8aa7aa !important;
}
.dark-theme .e-btn.e-flat:hover {
    background-color: rgba(0, 131, 143, 0.12) !important;
    color: #e6f7f5 !important;
}
.dark-theme .e-input-group,
.dark-theme .e-input-group input,
.dark-theme .e-textbox {
    background-color: #0f2a2e !important;
    border-color: #1f3a3e !important;
    color: #e6f7f5 !important;
}

/* ── Dark mode: card containers ── */
.dark-theme .card.shadow-sm {
    background-color: #0f2a2e !important;
    border-color: #1f3a3e !important;
}

/* ── Dark mode: dropdown menus ── */
.dark-theme .dropdown-menu {
    background-color: #133438 !important;
    border-color: #1f3a3e !important;
}
.dark-theme .dropdown-item {
    color: #e6f7f5 !important;
}
.dark-theme .dropdown-item:hover,
.dark-theme .dropdown-item:focus {
    background-color: rgba(0, 131, 143, 0.15) !important;
    color: #ffffff !important;
}

/* ── Dark mode: status tabs / filter buttons ── */
.dark-theme .status-tabs .e-btn {
    background-color: #0f2a2e !important;
    border-color: #1f3a3e !important;
    color: #8aa7aa !important;
}
.dark-theme .status-tabs .e-btn.e-active,
.dark-theme .status-tabs .e-btn.active {
    background-color: rgba(0, 131, 143, 0.25) !important;
    color: #4dd0e6 !important;
}

/* ── Dark mode: pagination ── */
.dark-theme .pagination .page-link {
    background-color: #133438 !important;
    border-color: #1f3a3e !important;
    color: #8aa7aa !important;
}
.dark-theme .pagination .page-item.active .page-link {
    background-color: #00838f !important;
    border-color: #00838f !important;
    color: #ffffff !important;
}

/* ── Dark mode: scrollbar ── */
.dark-theme ::-webkit-scrollbar {
    background-color: #0b1f22;
}
.dark-theme ::-webkit-scrollbar-thumb {
    background-color: #2a4a4e;
    border-radius: 4px;
}

/* ---------------------------------------------------------------------------
   Accessibility — reduced motion
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .anim-fade-in,
    .anim-pulse-soft,
    .anim-breathe,
    .anim-float,
    .anim-slide-up,
    .anim-scale-in,
    .anim-fade-in-left,
    .anim-fade-in-right,
    .anim-stagger > *,
    .gradient-heading,
    .gradient-heading-light,
    .gradient-trust-bg,
    .eixir-skeleton,
    .e-tab .e-tab-header .e-indicator,
    .auth-particle-field::before,
    .auth-particle-field::after {
        animation: none !important;
    }
}

/* ---------------------------------------------------------------------------
   Brand tables — used on all list pages
   --------------------------------------------------------------------------- */
.eixir-table {
    width: 100%;
    margin: 0;
    font-size: 0.875rem;
    color: var(--ink, #0f2226);
    border-collapse: separate;
    border-spacing: 0;
}

.eixir-table thead th {
    background: #f3f9f9;
    color: var(--deep-teal, #004d52);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.85rem 1rem;
    text-align: start;
    white-space: nowrap;
    border-bottom: 1px solid var(--border, #ddeae9);
    position: sticky;
    top: 0;
    z-index: 1;
}

.eixir-table thead th.text-center { text-align: center; }
.eixir-table thead th.text-end   { text-align: end; }

.eixir-table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #eef4f4;
}

.eixir-table tbody tr {
    transition: background-color 0.15s ease;
}

.eixir-table tbody tr.clickable-row { cursor: pointer; }
.eixir-table tbody tr.clickable-row:hover { background: #e6f7f7; }
.eixir-table tbody tr:last-child td { border-bottom: none; }

.eixir-table .cell-primary {
    color: var(--deep-teal, #004d52);
    font-weight: 600;
}

.eixir-table .cell-muted { color: var(--on-surface-variant, #5b7a7d); font-size: 0.82rem; }
.eixir-table .cell-mono  { font-family: var(--font-en); font-size: 0.82rem; }

.eixir-table .row-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    justify-content: center;
}

.eixir-table .row-action-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--on-surface-variant, #5b7a7d);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.eixir-table .row-action-btn:hover {
    background: var(--primary-50, #e6f7f7);
    color: var(--primary-color, #00838f);
    border-color: var(--primary-50, #e6f7f7);
}

.eixir-table .row-action-btn.row-action-btn--danger:hover {
    background: #fdedee;
    color: #a43033;
    border-color: rgba(229, 72, 77, 0.18);
}

.eixir-table .row-action-btn.row-action-btn--warning:hover {
    background: #fef5e6;
    color: #b97410;
    border-color: rgba(245, 166, 35, 0.20);
}

.eixir-table .row-action-btn.row-action-btn--success:hover {
    background: #e6f9f3;
    color: #007a5e;
    border-color: rgba(0, 184, 148, 0.20);
}

/* Dark theme */
.dark-theme .eixir-table { color: #e6f7f5; }
.dark-theme .eixir-table thead th {
    background: #0f2a2e;
    color: #b2e0e3;
    border-bottom-color: #1f3a3e;
}
.dark-theme .eixir-table tbody td { border-bottom-color: #1f3a3e; }
.dark-theme .eixir-table tbody tr.clickable-row:hover { background: rgba(0, 131, 143, 0.15); }
.dark-theme .eixir-table .cell-primary { color: #e6f7f5; }
.dark-theme .eixir-table .cell-muted { color: #8aa7aa; }
.dark-theme .eixir-table .row-action-btn { color: #8aa7aa; }
.dark-theme .eixir-table .row-action-btn:hover { background: rgba(0, 131, 143, 0.20); color: #4dd0e6; }

/* Search bar (used on list pages) */
.eixir-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.eixir-search-input {
    flex: 1;
    min-width: 240px;
    padding: 0.55rem 0.85rem 0.55rem 2.25rem;
    background: #ffffff;
    border: 1px solid var(--border, #ddeae9);
    border-radius: 12px;
    font-size: 0.875rem;
    color: var(--ink, #0f2226);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2300838f'%3E%3Cpath fill-rule='evenodd' d='M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: start 0.75rem center;
    background-size: 1rem;
}
[dir="rtl"] .eixir-search-input {
    padding: 0.55rem 2.25rem 0.55rem 0.85rem;
    background-position: end 0.75rem center;
}
.eixir-search-input:focus {
    outline: none;
    border-color: var(--primary-color, #00838f);
    box-shadow: 0 0 0 3px rgba(0, 131, 143, 0.18);
}

.eixir-search-reset {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border, #ddeae9);
    border-radius: 10px;
    background: #ffffff;
    color: var(--on-surface-variant, #5b7a7d);
    cursor: pointer;
    transition: all 0.15s ease;
}
.eixir-search-reset:hover {
    background: #fdedee;
    color: #a43033;
    border-color: rgba(229, 72, 77, 0.18);
}

.dark-theme .eixir-search-input,
.dark-theme .eixir-search-reset {
    background-color: #133438;
    color: #e6f7f5;
    border-color: #1f3a3e;
}
.dark-theme .eixir-search-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%234dd0e6'%3E%3Cpath fill-rule='evenodd' d='M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z' clip-rule='evenodd'/%3E%3C/svg%3E");
}
.dark-theme .eixir-search-reset:hover { background: rgba(229, 72, 77, 0.20); color: #fca5a5; }

/* Pagination footer */
.eixir-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border, #ddeae9);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.eixir-pagination-info {
    font-size: 0.82rem;
    color: var(--on-surface-variant, #5b7a7d);
}

.eixir-pagination-actions {
    display: inline-flex;
    gap: 0.4rem;
}

/* ---------------------------------------------------------------------------
   Profile cards (detail page side info panel)
   --------------------------------------------------------------------------- */
.eixir-profile-card {
    background: #ffffff;
    border: 1px solid var(--border, #ddeae9);
    border-radius: var(--radius-card, 18px);
    box-shadow: var(--shadow-card, 0 2px 12px rgba(0, 77, 82, 0.06));
    padding: 1.5rem;
    overflow: hidden;
    position: relative;
}

.eixir-profile-card::before {
    content: '';
    position: absolute;
    top: 0; inset-inline-start: 0;
    width: 3px; height: 100%;
    background: linear-gradient(180deg, var(--primary-color, #00838f), var(--secondary-color, #26a69a));
    opacity: 0.8;
}

.eixir-profile-fields {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin: 1rem 0;
}

.eixir-profile-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border, #ddeae9);
    min-width: 0;
}

.eixir-profile-row:last-child { border-bottom: none; padding-bottom: 0; }
.eixir-profile-row:first-child { padding-top: 0; }

.eixir-profile-row .eixir-label {
    color: var(--on-surface-variant, #5b7a7d);
    font-weight: 500;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.eixir-profile-row .eixir-value {
    color: var(--ink, #0f2226);
    font-weight: 600;
    text-align: end;
    word-break: break-word;
    min-width: 0;
}

.eixir-profile-row .eixir-value-mono { font-family: var(--font-en); }

.dark-theme .eixir-profile-card { background: #133438; border-color: rgba(0, 131, 143, 0.20); }
.dark-theme .eixir-profile-row { border-bottom-color: rgba(0, 131, 143, 0.15); }
.dark-theme .eixir-profile-row .eixir-label { color: #8aa7aa; }
.dark-theme .eixir-profile-row .eixir-value { color: #e6f7f5; }

/* ---------------------------------------------------------------------------
   Responsive utilities — mobile-first polish
   --------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .eixir-card .card-body { padding: 1rem; }
}

@media (max-width: 767.98px) {
    .eixir-search {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    .eixir-search .e-control-wrapper,
    .eixir-search-input {
        min-width: auto;
        width: 100% !important;
    }

    .eixir-table {
        font-size: 0.82rem;
    }
    .eixir-table thead th {
        padding: 0.65rem 0.75rem;
        font-size: 0.68rem;
    }
    .eixir-table tbody td {
        padding: 0.65rem 0.75rem;
    }
    .eixir-table .row-action-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .eixir-pagination {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .eixir-pagination-actions {
        display: flex;
        justify-content: space-between;
    }

    .card .card-body { padding: 1rem; }
}

@media (max-width: 575.98px) {
    .eixir-table {
        font-size: 0.78rem;
    }
    .eixir-table thead th,
    .eixir-table tbody td {
        padding: 0.55rem 0.65rem;
    }

    .table-responsive {
        border-radius: var(--radius-sm, 10px);
        border: 1px solid var(--border, #ddeae9);
    }

    .eixir-pagination-actions {
        gap: 0.5rem;
    }

    .eixir-search-reset {
        width: 44px;
        height: 44px;
    }

    /* Dialogs should never overflow the viewport */
    .e-dlg-container .e-dialog {
        max-width: calc(100vw - 24px) !important;
    }

    .form-label { font-size: 0.8rem; }
    .form-control, .form-select { font-size: 0.875rem; }
}

/* ── Super-Admin page header banner (icon + title layout) ── */
.page-header-banner {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1rem;
}
.page-header-banner-bg {
    position: absolute;
    inset: 0;
    background: #004d52;
}
.page-header-banner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #004d52, #00838f, #26a69a, #00838f, #004d52);
    background-size: 200% 100%;
    animation: eixir-gradient-shift 4s ease infinite;
    z-index: 2;
}
.page-header-banner-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem 2rem;
}
/* Icon: large, flex-shrink 0 */
.page-header-banner-icon-area {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    color: #fff;
    font-size: 1.75rem;
}
/* Title */
.page-header-banner-title-area { flex: 1; min-width: 0; }
.page-header-banner-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* RTL: swap icon ↔ title order */
[dir="rtl"] .page-header-banner-content {
    flex-direction: row-reverse;
}

/* ── Compact search field (RTL/LTR aware) ── */
.users-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 240px;
}
.users-search-input {
    height: 34px !important;
    border-radius: 8px !important;
    background: rgba(255,255,255,0.95) !important;
    border: 1px solid rgba(255,255,255,0.4) !important;
}
.users-search-input:focus {
    background: #fff !important;
    border-color: #fff !important;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.25) !important;
}
.users-search-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #5b7a7d;
    font-size: 0.8rem;
    pointer-events: none;
    line-height: 1;
    z-index: 2;
}
/* RTL: icon on the right */
.users-search-wrapper.rtl .users-search-icon { right: 0.65rem; }
.users-search-wrapper.rtl .users-search-input { padding-left: 0.75rem !important; padding-right: 2rem !important; }
/* LTR: icon on the left */
.users-search-wrapper.ltr .users-search-icon { left: 0.65rem; }
.users-search-wrapper.ltr .users-search-input { padding-left: 2rem !important; padding-right: 0.75rem !important; }

/* ── Compact add button inside banner ── */
.users-add-btn {
    height: 34px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0 0.9rem;
    white-space: nowrap;
    background: rgba(255,255,255,0.95);
    color: #00838f;
    border: 1px solid rgba(255,255,255,0.4);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.users-add-btn:hover {
    background: #fff;
    color: #004d52;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

@media (max-width: 640px) {
    .page-header-banner-content { padding: 1rem; flex-direction: column; align-items: stretch; }
    .page-header-banner-icon { font-size: 4rem; }
    .page-header-banner-title { font-size: 1.25rem; }
    .users-search-wrapper { max-width: 100%; }
}

/* ── Modal close button flip (close-first in DOM, CSS reorders) ── */
.modal-header-flip {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ── Stat cards (used on TenantDetail, Tenants list, Dashboard) ── */
.stat-card {
    border-radius: 12px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 77, 82, 0.10);
}
.stat-card .card-body {
    padding: 1rem;
}
.stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--on-surface-variant, #5b7a7d);
    margin-bottom: 4px;
    font-weight: 600;
}
.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--ink, #0f2226);
}
.dark-theme .stat-card { background: #133438; border-color: rgba(0, 131, 143, 0.20); }
.dark-theme .stat-card:hover { box-shadow: 0 4px 16px rgba(0, 131, 143, 0.15); }
.dark-theme .stat-label { color: #8aa7aa; }
.dark-theme .stat-value { color: #e6f7f5; }

/* ── Tenant detail action bar ── */
.tenant-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.tenant-action-bar .e-btn {
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.4rem 1rem;
}
.tenant-action-bar .action-approve { background: #e6f9f3; color: #007a5e; border-color: rgba(0,184,148,0.2); }
.tenant-action-bar .action-approve:hover { background: #007a5e; color: #fff; }
.tenant-action-bar .action-reject { background: #fdedee; color: #a43033; border-color: rgba(229,72,77,0.2); }
.tenant-action-bar .action-reject:hover { background: #a43033; color: #fff; }
.tenant-action-bar .action-suspend { background: #fef5e6; color: #b97410; border-color: rgba(245,166,35,0.2); }
.tenant-action-bar .action-suspend:hover { background: #b97410; color: #fff; }
.tenant-action-bar .action-delete { background: #fdedee; color: #a43033; border-color: rgba(229,72,77,0.2); }
.tenant-action-bar .action-delete:hover { background: #a43033; color: #fff; }
.dark-theme .tenant-action-bar .action-approve { background: rgba(0,184,148,0.15); color: #4dd0e6; border-color: rgba(0,184,148,0.25); }
.dark-theme .tenant-action-bar .action-approve:hover { background: rgba(0,184,148,0.30); color: #fff; }
.dark-theme .tenant-action-bar .action-reject { background: rgba(229,72,77,0.15); color: #fca5a5; border-color: rgba(229,72,77,0.25); }
.dark-theme .tenant-action-bar .action-reject:hover { background: rgba(229,72,77,0.30); color: #fff; }
.dark-theme .tenant-action-bar .action-suspend { background: rgba(245,166,35,0.15); color: #fbbf24; border-color: rgba(245,166,35,0.25); }
.dark-theme .tenant-action-bar .action-suspend:hover { background: rgba(245,166,35,0.30); color: #fff; }
.dark-theme .tenant-action-bar .action-delete { background: rgba(229,72,77,0.15); color: #fca5a5; border-color: rgba(229,72,77,0.25); }
.dark-theme .tenant-action-bar .action-delete:hover { background: rgba(229,72,77,0.30); color: #fff; }

/* ── User detail action bar (mirrors tenant-action-bar) ── */
.user-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.user-action-bar .e-btn {
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.4rem 1rem;
}
.user-action-bar .action-approve { background: #e6f9f3; color: #007a5e; border-color: rgba(0,184,148,0.2); }
.user-action-bar .action-approve:hover { background: #007a5e; color: #fff; }
.user-action-bar .action-suspend { background: #fef5e6; color: #b97410; border-color: rgba(245,166,35,0.2); }
.user-action-bar .action-suspend:hover { background: #b97410; color: #fff; }
.user-action-bar .action-delete { background: #fdedee; color: #a43033; border-color: rgba(229,72,77,0.2); }
.user-action-bar .action-delete:hover { background: #a43033; color: #fff; }
.dark-theme .user-action-bar .action-approve { background: rgba(0,184,148,0.15); color: #4dd0e6; border-color: rgba(0,184,148,0.25); }
.dark-theme .user-action-bar .action-approve:hover { background: rgba(0,184,148,0.30); color: #fff; }
.dark-theme .user-action-bar .action-suspend { background: rgba(245,166,35,0.15); color: #fbbf24; border-color: rgba(245,166,35,0.25); }
.dark-theme .user-action-bar .action-suspend:hover { background: rgba(245,166,35,0.30); color: #fff; }
.dark-theme .user-action-bar .action-delete { background: rgba(229,72,77,0.15); color: #fca5a5; border-color: rgba(229,72,77,0.25); }
.dark-theme .user-action-bar .action-delete:hover { background: rgba(229,72,77,0.30); color: #fff; }

/* ── Tenant detail inline table (child entities under tabs) ── */
.tenant-detail-table {
    font-size: 0.875rem;
}
.tenant-detail-table th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.tenant-detail-table td {
    vertical-align: middle;
}
.dark-theme .tenant-detail-table th { color: #b2e0e3; background: #0f2a2e; }
.dark-theme .tenant-detail-table td { color: #e6f7f5; border-bottom-color: #1f3a3e; }
.dark-theme .tenant-detail-table tbody tr:hover { background: rgba(0,131,143,0.10); }
/* LTR: close button goes to the right */
[dir="ltr"] .modal-header-flip .btn-close { order: 2; }
[dir="ltr"] .modal-header-flip .modal-title { order: 1; }
/* RTL: close button stays left (first in DOM = left in RTL) */
[dir="rtl"] .modal-header-flip .btn-close { order: -1; }
[dir="rtl"] .modal-header-flip .modal-title { order: 0; }

/* ── Brand visual identity: Save/Primary buttons ── */
.btn-primary,
.e-btn.e-primary,
button.e-btn.e-primary {
    background: linear-gradient(135deg, #00838f 0%, #26a69a 100%) !important;
    border-color: #00838f !important;
    color: #fff !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(0, 131, 143, 0.3) !important;
    transition: all 0.2s ease !important;
}
.btn-primary:hover,
.e-btn.e-primary:hover,
button.e-btn.e-primary:hover {
    background: linear-gradient(135deg, #004d52 0%, #00838f 100%) !important;
    border-color: #004d52 !important;
    box-shadow: 0 4px 14px rgba(0, 131, 143, 0.4) !important;
    transform: translateY(-1px);
}

/* ── Brand visual identity: grid table headers ── */
.table thead.table-light th {
    background: linear-gradient(135deg, #f0f9f9 0%, #e6f2f2 100%) !important;
    color: #004d52 !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    letter-spacing: 0.02em !important;
    border-bottom: 2px solid rgba(0, 131, 143, 0.2) !important;
    text-transform: none;
}
.table thead.table-light th:first-child { border-radius: 8px 0 0 0 !important; }
.table thead.table-light th:last-child { border-radius: 0 8px 0 0 !important; }

/* ── Brand visual identity: card container ── */
.card.shadow-sm {
    border: 1px solid rgba(0, 131, 143, 0.08) !important;
}
.card.shadow-sm .table {
    border-collapse: separate;
    border-spacing: 0;
}
.card.shadow-sm .table tbody tr {
    transition: background 0.15s ease;
}
.card.shadow-sm .table tbody tr:hover {
    background-color: rgba(0, 131, 143, 0.03) !important;
}


