﻿/* Ficheiro: ballot.css
   Descrição: Estilos unificados para Frontend (Candidatura) e Backend (Admin)
   Projeto: Lisboa 2027
   Versão: Compact Footer Update
*/

:root {
    /* --- PALETA DE CORES (Shared) --- */
    --brand-primary: #50C878; /* Emerald Green */
    --brand-primary-dark: #3da35b;
    --brand-red: #E31837; /* Brand Red for Actions */
    --brand-red-dark: #b91c1c;
    --brand-black: #111111;
    --brand-dark-grey: #1F2937;
    /* --- UI COLORS (Light Mode Default) --- */
    --bg-body: #F8F9FA;
    --surface-card: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --table-hover-bg: #f8f9fa;
    --input-bg: #ffffff;
    /* --- DIMENSÕES & FORMA --- */
    --radius-md: 4px;
    --radius-lg: 8px;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
    --header-height: 70px;
}

/* ==========================================================================
   1. BASE & TYPOGRAPHY
   ========================================================================== */
body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, .brand-font {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

    a:hover {
        color: var(--brand-primary);
    }

/* ==========================================================================
   2. COMPONENTES PARTILHADOS (Buttons, Inputs, Utilities)
   ========================================================================== */

.hidden-card {
    display: none !important;
}

/* Botões */
.btn-primary-custom {
    background-color: var(--brand-primary);
    color: white;
    border: none;
    font-weight: 700;
    text-transform: uppercase;
    font-style: italic;
    transition: all 0.2s;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
}

    .btn-primary-custom:hover {
        background-color: var(--brand-primary-dark);
        color: white;
        transform: translateY(-1px);
    }

.btn-outline-custom {
    border: 2px dashed var(--border-color);
    color: var(--text-muted);
    background: transparent;
    padding: 1rem;
    border-radius: var(--radius-lg);
    width: 100%;
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.3s;
}

    .btn-outline-custom:hover {
        border-color: var(--brand-primary);
        color: var(--brand-primary);
        background-color: rgba(80, 200, 120, 0.05);
    }

/* Loading Overlay Global */
#lotteryOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    backdrop-filter: blur(5px);
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top: 4px solid var(--brand-primary);
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Inputs Standard */
.form-control, .form-select {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

    .form-control:focus, .form-select:focus {
        border-color: var(--brand-primary);
        box-shadow: 0 0 0 0.25rem rgba(80, 200, 120, 0.25);
        background-color: var(--input-bg);
        color: var(--text-main);
    }

.form-label {
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

/* SuperHalfs Box Específica */
.superhalfs-box {
    background-color: var(--bg-body);
    border-left: 3px solid var(--text-muted);
    padding: 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.superhalfs-word {
    color: #E79B27 !important;
    font-weight: 800;
}

.passport-error-msg {
    color: #dc3545;
    font-size: 0.75rem;
    font-weight: 600;
    display: none;
    margin-top: 4px;
}

.is-invalid-passport {
    border-color: #dc3545 !important;
}

/* Flags e Utilitários */
.fi {
    border-radius: 2px;
    box-shadow: 0 0 1px rgba(0,0,0,0.2);
}

.lang-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 85px;
    justify-content: center;
}

/* ==========================================================================
   3. FRONTEND (Candidatura.aspx, Sucesso.aspx, Resultados.aspx)
   ========================================================================== */

/* Header Público */
.top-bar {
    background-color: var(--surface-card);
    border-bottom: 3px solid var(--brand-primary);
    padding: 1rem 0;
    transition: background-color 0.3s;
}

.brand-logo {
    font-size: 1.5rem;
    color: var(--brand-black);
    font-weight: 900;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-strip {
    background-color: var(--brand-black);
    color: white;
    padding: 10px 0;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

    .info-strip i {
        color: var(--brand-primary);
        margin-right: 8px;
    }

/* Public header readability in light mode */
body.page-candidatura.theme-light .info-strip,
body.page-resultados.theme-light .info-strip {
    background: linear-gradient(180deg, #eef3f9 0%, #e6edf6 100%);
    color: #223149;
    border-bottom: 1px solid #d2dceb;
}

body.page-candidatura.theme-light .info-strip i,
body.page-resultados.theme-light .info-strip i {
    color: #22a06b;
}

/* Public pages layout rhythm */
.public-shell-topgap {
    padding-top: 2.65rem !important;
}

.public-hero-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(251,253,255,0.98) 100%);
    border: 1px solid rgba(186, 199, 218, 0.48);
    border-radius: 26px;
    box-shadow: 0 18px 38px rgba(12, 26, 51, 0.12);
    padding: clamp(1.4rem, 3vw, 2.2rem) clamp(1.25rem, 3.2vw, 2.75rem);
    margin-top: 0;
    margin-bottom: 1.65rem !important;
}

.ballot-hero-banner-wrap {
    width: 100%;
}

.ballot-hero-banner {
    display: block;
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    border-radius: 18px;
    object-fit: cover;
    box-shadow: 0 14px 32px rgba(12, 26, 51, 0.1);
}

.ballot-hero-actions {
    display: flex;
    justify-content: center;
}

.ballot-hero-more-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 46px;
    padding: 0.7rem 1.35rem;
    border-radius: 999px;
    border: 1px solid rgba(34, 160, 107, 0.2);
    background: linear-gradient(180deg, #f1fff7 0%, #e5f8ee 100%);
    color: #136946;
    font-size: 0.92rem;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(17, 125, 84, 0.14);
}

.ballot-hero-more-link:hover {
    color: #0a7e56;
    border-color: rgba(10, 126, 86, 0.28);
    background: linear-gradient(180deg, #eefff6 0%, #dbf4e7 100%);
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(17, 125, 84, 0.18);
}

.ballot-hero-more-link::after {
    content: "\f061";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.78rem;
}

body.theme-dim .public-hero-card {
    background: linear-gradient(180deg, rgba(45,57,76,0.94) 0%, rgba(40,52,69,0.98) 100%);
    border-color: rgba(141, 158, 182, 0.34);
    box-shadow: 0 16px 36px rgba(8, 15, 28, 0.28);
}

body.theme-dark .public-hero-card {
    background: linear-gradient(180deg, rgba(39,50,67,0.95) 0%, rgba(33,44,60,0.99) 100%);
    border-color: rgba(132, 148, 171, 0.3);
    box-shadow: 0 18px 42px rgba(3, 10, 20, 0.36);
}

body.theme-dim .public-hero-card h1,
body.theme-dark .public-hero-card h1 {
    color: #f4f7fc;
}

body.theme-dim .public-hero-card .lead,
body.theme-dark .public-hero-card .lead {
    color: #c9d4e6 !important;
}

body.theme-dim .public-hero-card .d-inline-block,
body.theme-dark .public-hero-card .d-inline-block {
    background-color: rgba(16, 23, 34, 0.85) !important;
}

.ballot-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(34, 160, 107, 0.35);
    background: linear-gradient(180deg, #f1fff7 0%, #e7f8ef 100%);
    color: #136946;
    box-shadow: 0 10px 24px rgba(17, 125, 84, 0.14);
}

.ballot-status-pill small {
    display: block;
    font-size: 0.83rem !important;
    letter-spacing: 0.02em;
}

.ballot-status-pill .fa-clock {
    color: #e11d48 !important;
}

body.theme-dim .ballot-status-pill,
body.theme-dark .ballot-status-pill {
    background: linear-gradient(180deg, rgba(20, 68, 50, 0.42) 0%, rgba(17, 54, 42, 0.55) 100%);
    border-color: rgba(61, 190, 131, 0.48);
    color: #b8f1d4;
    box-shadow: 0 12px 26px rgba(4, 18, 12, 0.42);
}

body.theme-dim .ballot-hero-more-link,
body.theme-dark .ballot-hero-more-link {
    color: #b8f1d4;
    border-color: rgba(61, 190, 131, 0.3);
    background: linear-gradient(180deg, rgba(20, 68, 50, 0.42) 0%, rgba(17, 54, 42, 0.55) 100%);
    box-shadow: 0 12px 26px rgba(4, 18, 12, 0.42);
}

.public-hero-card-results {
    margin-bottom: 2.15rem !important;
}

@media (max-width: 767.98px) {
    .public-shell-topgap {
        padding-top: 1.35rem !important;
    }

    .public-hero-card {
        border-radius: 18px;
        padding: 1.05rem 1rem;
        margin-bottom: 1.15rem !important;
    }

    .ballot-hero-banner {
        border-radius: 14px;
    }

    .ballot-hero-more-link {
        width: 100%;
        max-width: 260px;
    }
}

/* Footer Público */
.footer-clean {
    border-top: 1px solid var(--border-color);
    background-color: var(--brand-black);
    color: white;
    padding: 1.5rem 0; /* Reduced from 3rem */
    margin-top: 2rem; /* Reduced from 4rem */
}

    .footer-clean a {
        color: #ccc;
        transition: color 0.2s;
    }

        .footer-clean a:hover {
            color: var(--brand-primary);
        }

/* Cartões de Participante (Formulário) */
.participant-card {
    background-color: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    position: relative;
    transition: box-shadow 0.3s ease, opacity 0.3s ease, transform 0.3s ease, background-color 0.3s;
}

    .participant-card:hover {
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    }

.card-accent-strip {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
}

.accent-leader {
    background-color: var(--brand-primary);
}

.accent-member {
    background-color: var(--text-muted);
}

.badge-leader {
    background-color: var(--brand-primary);
    color: white;
}

.card-header-custom {
    padding: 1.5rem 1.5rem 0.5rem 2rem;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body-custom {
    padding: 1.5rem 1.5rem 2rem 2rem;
}

body.page-candidatura .participant-card {
    border-radius: 14px;
    border-color: #c7d2e2;
    box-shadow: 0 12px 28px rgba(15, 31, 57, 0.08);
}

body.page-candidatura .participant-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(12, 26, 48, 0.12);
}

body.page-candidatura .participant-title {
    color: #10213d !important;
    letter-spacing: 0.01em;
}

body.page-candidatura .badge-leader {
    border-radius: 8px !important;
    padding: 0.42rem 0.85rem !important;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

body.page-candidatura .card-header-custom {
    padding-bottom: 0.9rem;
    border-bottom: 1px solid #e8edf5;
}

body.page-candidatura .card-body-custom {
    padding-top: 1.2rem;
}

body.page-candidatura .card-body-custom .form-label {
    color: #516784;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
}

body.page-candidatura .card-body-custom .form-control,
body.page-candidatura .card-body-custom .form-select {
    border-color: #c4cfde;
    border-radius: 10px;
    min-height: 50px;
    font-size: 1.02rem;
}

body.page-candidatura .card-body-custom .form-control:focus,
body.page-candidatura .card-body-custom .form-select:focus {
    border-color: #4dc98d;
    box-shadow: 0 0 0 3px rgba(77, 201, 141, 0.18);
}

body.page-candidatura .superhalfs-box {
    background: linear-gradient(180deg, #f7fafd 0%, #f2f6fb 100%);
    border: 1px solid #d8e1ee;
    border-left: 4px solid #7f91ab;
}

body.page-candidatura .superhalfs-heading {
    align-items: flex-start !important;
}

body.page-candidatura .superhalfs-help-text {
    color: #5f6f85;
    font-size: 0.82rem;
    line-height: 1.45;
}

body.page-candidatura.theme-dim .participant-card,
body.page-candidatura.theme-dark .participant-card {
    border-color: rgba(137, 154, 177, 0.42);
    box-shadow: 0 18px 36px rgba(3, 11, 22, 0.36);
}

body.page-candidatura.theme-dim .participant-title,
body.page-candidatura.theme-dark .participant-title {
    color: #eef4ff !important;
}

body.page-candidatura.theme-dim .card-header-custom,
body.page-candidatura.theme-dark .card-header-custom {
    border-bottom-color: rgba(132, 147, 170, 0.24);
}

body.page-candidatura.theme-dim .card-body-custom .form-label,
body.page-candidatura.theme-dark .card-body-custom .form-label {
    color: #aac0db;
}

body.page-candidatura.theme-dim .card-body-custom .form-control,
body.page-candidatura.theme-dim .card-body-custom .form-select,
body.page-candidatura.theme-dark .card-body-custom .form-control,
body.page-candidatura.theme-dark .card-body-custom .form-select {
    border-color: rgba(123, 140, 164, 0.45);
    background-color: rgba(20, 29, 42, 0.6);
    color: #edf3ff;
}

body.page-candidatura.theme-dim .superhalfs-box,
body.page-candidatura.theme-dark .superhalfs-box {
    background: linear-gradient(180deg, rgba(32,44,60,0.78) 0%, rgba(25,36,50,0.86) 100%);
    border-color: rgba(114, 132, 156, 0.45);
    border-left-color: #90a3bf;
}

body.page-candidatura.theme-dim .superhalfs-help-text,
body.page-candidatura.theme-dark .superhalfs-help-text {
    color: #b6c4d9;
}

/* Sucesso & Resultados */
.friendly-id-box {
    background-color: #f0fdf4;
    border: 2px dashed var(--brand-primary);
    color: #15803d;
    padding: 1.5rem;
    border-radius: 8px;
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 2px;
    margin: 2rem 0;
    font-family: 'Teko', sans-serif;
    text-align: center;
}

.success-icon {
    font-size: 4rem;
    color: var(--brand-primary);
    margin-bottom: 1rem;
    animation: popIn 0.5s ease-out;
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    80% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Resultados.aspx Specifics */
.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.result-card {
    background-color: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 3rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.5s ease-out;
}

.status-header {
    padding: 2rem;
    text-align: center;
}

.status-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.status-success {
    background-color: #ECFDF5;
    color: #065F46;
    border-bottom: 4px solid #10B981;
}

.status-fail {
    background-color: #FEF2F2;
    color: #991B1B;
    border-bottom: 4px solid #EF4444;
}

.status-pending {
    background-color: #FFFBEB;
    color: #92400E;
    border-bottom: 4px solid #F59E0B;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   4. BACKOFFICE (Admin Layout)
   ========================================================================== */

/* Login */
.login-wrapper {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f4f7fb 0%, #dde5ef 100%);
    padding: 1.5rem;
}

.login-card {
    background: var(--surface-card);
    width: 100%;
    max-width: 400px;
    padding: 3rem;
    border-radius: 8px;
    text-align: center;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft, 0 18px 50px rgba(15, 23, 42, 0.16));
}

body.theme-dim .login-wrapper {
    background: linear-gradient(135deg, #1e2633 0%, #2a3442 100%);
}

body.theme-dark .login-wrapper {
    background: linear-gradient(135deg, #0f1720 0%, #1f2937 100%);
}

body.theme-dim .login-card,
body.theme-dark .login-card {
    background: var(--surface-card);
    color: var(--text-main);
    border-color: var(--border-color);
}

body.theme-light .login-card .form-label,
body.theme-dim .login-card .form-label,
body.theme-dark .login-card .form-label {
    color: var(--text-muted) !important;
}

body.theme-light .login-card .form-control,
body.theme-dim .login-card .form-control,
body.theme-dark .login-card .form-control {
    background-color: var(--input-bg);
    border-color: var(--border-color);
    color: var(--text-main);
}

body.theme-light .login-card .form-control::placeholder,
body.theme-dim .login-card .form-control::placeholder,
body.theme-dark .login-card .form-control::placeholder {
    color: var(--text-muted);
}

body.theme-light .login-card h3,
body.theme-dim .login-card h3,
body.theme-dark .login-card h3 {
    color: var(--text-main);
}

body.theme-light .login-card .text-muted,
body.theme-dim .login-card .text-muted,
body.theme-dark .login-card .text-muted {
    color: var(--text-muted) !important;
}

/* Sidebar Navigation */
.wrapper-admin {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: #000000; /* Pure Black for Premium look */
    color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid #1a1a1a;
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    font-weight: 800;
    font-style: italic;
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    white-space: nowrap;
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
}

.sidebar-menu {
    padding: 1rem 0;
    list-style: none;
    margin: 0;
}

    .sidebar-menu li {
        width: 100%;
    }

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.9rem 1.5rem;
    color: #9CA3AF;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    border-left: 4px solid transparent;
    width: 100%;
    cursor: pointer;
}

    .sidebar-link:hover {
        color: #fff;
        background-color: rgba(255,255,255,0.05);
    }

    .sidebar-link.active {
        color: #fff;
        background-color: rgba(255,255,255,0.08);
        border-left-color: var(--brand-primary);
    }

    .sidebar-link i {
        width: 25px;
        margin-right: 12px;
        text-align: center;
        font-size: 1.1rem;
        flex-shrink: 0;
    }

.link-text {
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    background-color: var(--bg-body);
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
}

.top-header {
    height: var(--header-height);
    background-color: var(--surface-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 900;
    transition: background-color 0.3s;
}

/* Dashboard Cards (KPIs) */
.kpi-card {
    background: var(--surface-card);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    height: 100%;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

    .kpi-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    }

.kpi-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.kpi-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 5px;
}

.kpi-status-note {
    margin-top: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-muted);
}

.dashboard-kpi-value--good {
    color: #15803d;
}

.dashboard-kpi-value--warning {
    color: #c2410c;
}

.dashboard-kpi-value--neutral {
    color: var(--text-main);
}

.dashboard-progress-bar--good {
    background: linear-gradient(90deg, #16a34a 0%, #4ade80 100%);
}

.dashboard-progress-bar--warning {
    background: linear-gradient(90deg, #f97316 0%, #fb923c 100%);
}

.dashboard-progress-bar--neutral {
    background: linear-gradient(90deg, #64748b 0%, #94a3b8 100%);
}

.kpi-icon {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2.5rem;
    opacity: 0.08;
    color: var(--text-main);
}

.progress-thin {
    height: 6px;
    border-radius: 3px;
    background-color: var(--border-color);
    margin-top: 10px;
}

.dashboard-first-fold {
    align-items: stretch;
}

.dashboard-overview-card {
    background: linear-gradient(180deg, var(--surface-card) 0%, var(--surface-muted) 100%);
    border-radius: 16px !important;
}

.dashboard-overview-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.dashboard-section-kicker {
    margin-bottom: 0.35rem;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.dashboard-overview-copy,
.dashboard-chart-copy,
.dashboard-section-copy {
    min-width: 0;
}

.dashboard-overview-note,
.dashboard-chart-note,
.dashboard-section-note {
    margin-top: 0.45rem;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.dashboard-scope-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.dashboard-scope-chip {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    min-width: 170px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.82);
}

.dashboard-scope-chip-label {
    font-size: 0.69rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.dashboard-scope-chip-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.35;
}

.dashboard-scope-chip--event {
    background: rgba(80, 200, 120, 0.1);
    border-color: rgba(80, 200, 120, 0.18);
}

.dashboard-scope-chip--lottery {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.18);
}

.dashboard-focus-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-focus-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 132px;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 14px 24px rgba(15, 23, 42, 0.06);
}

.dashboard-focus-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.dashboard-focus-value {
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text-main);
}

.dashboard-focus-note {
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.dashboard-focus-card--success {
    background: rgba(80, 200, 120, 0.12);
    border-color: rgba(80, 200, 120, 0.22);
}

.dashboard-focus-card--warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.22);
}

.dashboard-focus-card--accent,
.dashboard-focus-card--published,
.dashboard-focus-card--scheduled,
.dashboard-focus-card--ready {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
}

.dashboard-focus-card--draft,
.dashboard-focus-card--neutral {
    background: rgba(226, 232, 240, 0.78);
}

.dashboard-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 18px;
}

.dashboard-head-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
}

.dashboard-refresh-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dashboard-refresh-pill {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    background: rgba(255, 255, 255, 0.82);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.dashboard-refresh-note {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
}

.dashboard-refresh-btn {
    min-height: 38px;
    border-radius: 10px !important;
    font-weight: 700 !important;
}

.dashboard-chart-card {
    border-radius: 16px !important;
}

.dashboard-chart-top {
    gap: 16px;
}

/* Admin Tables */
.table-custom {
    color: var(--text-main);
}

    .table-custom th {
        font-size: 0.75rem;
        text-transform: uppercase;
        background-color: var(--bg-body);
        color: var(--text-muted);
        padding: 1rem;
        font-weight: 700;
        border-bottom: 1px solid var(--border-color);
    }

    .table-custom td {
        padding: 1rem;
        vertical-align: middle;
        font-size: 0.9rem;
        border-bottom: 1px solid var(--border-color);
    }

.table-hover tbody tr:hover {
    background-color: var(--table-hover-bg);
}

/* Status Badges */
.badge-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    min-width: 90px;
    text-align: center;
}

.bg-pending {
    background-color: #FFF7ED;
    color: #9A3412;
    border: 1px solid #FFEDD5;
}

.bg-selected {
    background-color: #ECFDF5;
    color: #065F46;
    border: 1px solid #D1FAE5;
}

.bg-rejected {
    background-color: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FEE2E2;
}

.bg-banned {
    background-color: #450a0a;
    color: #fecaca;
    border: 1px solid #7f1d1d;
}

.bg-success {
    background-color: #166534;
    color: #fff;
}

/* Collapsed Sidebar Logic */
body.collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

body.collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

body.collapsed .brand-text, body.collapsed .sidebar-link .link-text, body.collapsed .menu-section-label {
    display: none !important;
    opacity: 0;
}

body.collapsed .sidebar-brand {
    justify-content: center;
    padding: 0;
}

body.collapsed .brand-container {
    display: none;
}

body.collapsed .sidebar-link {
    justify-content: center;
    padding: 1rem 0;
}

    body.collapsed .sidebar-link i {
        margin-right: 0;
        font-size: 1.3rem;
    }

    body.collapsed .sidebar-link .badge {
        position: absolute;
        top: 6px;
        right: 18px;
        margin-left: 0;
        padding: 0.3em 0.5em;
        font-size: 0.6rem;
        border-radius: 50%;
    }

/* Inbox/Chat */
.ticket-list {
    height: 600px;
    overflow-y: auto;
}

.ticket-item {
    cursor: pointer;
    transition: background 0.2s;
    border-left: 3px solid transparent;
    text-decoration: none;
    display: block;
    color: inherit;
    border-bottom: 1px solid var(--border-color);
}

    .ticket-item:hover {
        background-color: var(--table-hover-bg);
    }

    .ticket-item.active {
        background-color: var(--bg-body);
        border-left-color: var(--brand-primary);
    }

/* ESTADO FECHADO/ARQUIVADO */
.ticket-closed {
    opacity: 0.7;
    filter: grayscale(80%);
}

    .ticket-closed .badge {
        background-color: #9CA3AF !important;
    }

.chat-area {
    height: 450px;
    overflow-y: auto;
    background-color: var(--bg-body);
    padding: 20px;
}

.chat-input-area {
    background-color: var(--surface-card);
    border-top: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 0 0 8px 8px;
}

.msg-bubble {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    position: relative;
    clear: both;
}

.msg-user {
    background-color: var(--surface-card);
    border: 1px solid var(--border-color);
    float: left;
    border-bottom-left-radius: 0;
    color: var(--text-main);
}

.msg-admin {
    background-color: #0d6efd;
    color: white;
    float: right;
    border-bottom-right-radius: 0;
}

.ticket-badge {
    font-size: 0.8rem;
    padding: 0.5em 0.8em;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* --- LOTTERY PREMIUM WIDGET --- */
/* Estilos Específicos para o Motor de Sorteio (Dashboard) */
.lottery-premium-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%); /* Slate/Dark Gradient */
    color: white;
    border: 1px solid #334155;
    position: relative;
}

.lottery-slot-box {
    background-color: #e2e8f0; /* Light Gray */
    color: #0f172a;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.btn-lottery-action {
    background-color: var( --brand-primary);
    border: none;
    color: white;
    font-weight: 800;
    text-transform: uppercase;
    font-style: italic;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

    .btn-lottery-action:hover {
        background-color: var( --brand-primary-dark);
        transform: translateY(-2px);
        box-shadow: 0 10px 15px -3px rgba(220, 38, 38, 0.4);
        color: white;
    }

.lottery-check-list li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
}

    .lottery-check-list li i {
        color: var(--brand-primary);
        margin-right: 10px;
    }

/* ==========================================================================
   5. DARK MODE (TRUE BLACK / CARBON / NEUTRAL)
   ========================================================================== */
body.dark-mode {
    /* Paleta Neutra (Carvão e Preto) */
    --bg-body: #0a0a0a; /* Fundo principal quase preto */
    --surface-card: #141414; /* Cards ligeiramente mais claros */
    --text-main: #e5e5e5; /* Branco suave para leitura */
    --text-muted: #a3a3a3; /* Cinza médio */
    --border-color: #262626; /* Bordas muito subtis */
    --table-hover-bg: #1f1f1f; /* Hover subtil */
    --input-bg: #141414;
}

    /* Overrides Específicos para Componentes em Dark Mode */

    /* 1. Sidebar e Logos */
    body.dark-mode .sidebar {
        background-color: #000000; /* Sidebar Pure Black */
        border-right: 1px solid #1a1a1a;
    }

    body.dark-mode .brand-logo {
        color: #ffffff;
    }

    body.dark-mode .info-strip {
        background-color: #1a1a1a;
    }

    /* 2. Bootstrap Utility Overrides (Crucial para Backoffice.aspx) */
    /* Força backgrounds brancos/claros a ficarem escuros sem alterar HTML */
    body.dark-mode .bg-white,
    body.dark-mode .bg-light {
        background-color: var(--surface-card) !important;
        color: var(--text-main) !important;
        border-color: var(--border-color) !important;
    }

    body.dark-mode .border-bottom,
    body.dark-mode .border-top,
    body.dark-mode .border-end,
    body.dark-mode .border {
        border-color: var(--border-color) !important;
    }

    body.dark-mode .text-dark {
        color: #e5e5e5 !important;
    }

    body.dark-mode .text-muted {
        color: #888 !important;
    }

    /* 3. Cards & Containers */
    body.dark-mode .card {
        background-color: var(--surface-card);
        border-color: var(--border-color);
        color: var(--text-main);
    }

    /* O Cartão Premium do Sorteio deve manter o seu look específico mesmo em Dark Mode */
    body.dark-mode .lottery-premium-card {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
        border-color: #334155 !important;
    }

    body.dark-mode .lottery-slot-box {
        background-color: #e2e8f0 !important;
        color: #0f172a !important;
    }

    /* 4. Tabelas */
    body.dark-mode .table {
        color: var(--text-main);
        border-color: var(--border-color);
    }

    body.dark-mode .table-hover tbody tr:hover {
        background-color: var(--table-hover-bg);
        color: #fff;
    }

    body.dark-mode .table thead th {
        background-color: #000000; /* Header tabela mais escuro */
        color: #d1d5db;
        border-bottom: 1px solid #333;
    }

    /* 5. Inputs & Forms */
    body.dark-mode .form-control,
    body.dark-mode .form-select {
        background-color: #1a1a1a;
        border-color: #333;
        color: #fff;
    }

        body.dark-mode .form-control:focus,
        body.dark-mode .form-select:focus {
            background-color: #000000;
            border-color: var(--brand-primary);
            color: #fff;
        }

        body.dark-mode .form-control::placeholder {
            color: #666;
        }

    body.dark-mode .input-group-text {
        background-color: #262626;
        border-color: #333;
        color: #ccc;
    }

    /* 6. Dropdowns */
    body.dark-mode .dropdown-menu {
        background-color: #1a1a1a;
        border: 1px solid #333;
    }

    body.dark-mode .dropdown-item {
        color: #e5e5e5;
    }

        body.dark-mode .dropdown-item:hover {
            background-color: #333;
            color: #fff;
        }

    /* 7. Modais */
    body.dark-mode .modal-content {
        background-color: #141414;
        border: 1px solid #333;
        color: #e5e5e5;
    }

    body.dark-mode .modal-header,
    body.dark-mode .modal-footer {
        border-color: #262626;
        background-color: #0f0f0f;
    }

    body.dark-mode .btn-close {
        filter: invert(1) grayscale(100%) brightness(200%);
    }

    /* 8. Botões */
    body.dark-mode .btn-outline-dark {
        color: #e5e5e5;
        border-color: #555;
    }

        body.dark-mode .btn-outline-dark:hover {
            background-color: #e5e5e5;
            color: #000;
        }

    body.dark-mode .btn-light {
        background-color: #262626;
        color: #fff;
        border-color: #333;
    }

        body.dark-mode .btn-light:hover {
            background-color: #333;
        }

    /* 9. Chat Specifics */
    body.dark-mode .msg-user {
        background-color: #262626;
        border-color: #333;
        color: #e5e5e5;
    }

    body.dark-mode .chat-area {
        background-color: #050505;
    }

    /* 10. Outros */
    body.dark-mode .accordion-item {
        background-color: #141414;
        border-color: #333;
    }

    body.dark-mode .accordion-button {
        background-color: #1f1f1f;
        color: #fff;
    }

        body.dark-mode .accordion-button:not(.collapsed) {
            background-color: #262626;
            color: var(--brand-primary);
        }

    body.dark-mode .superhalfs-box {
        background-color: #1a1a1a;
        border-left-color: var(--brand-primary);
    }

        body.dark-mode .superhalfs-box label,
        body.dark-mode .superhalfs-box i {
            color: #a3a3a3 !important;
        }

/* ==========================================================================
   6. BACKOFFICE PREMIUM THEMES (Light / Dim / Dark)
   ========================================================================== */
/* ------------------------------------------------------------------
           PREMIUM THEMES (Light / Dim / Dark) - Backoffice only
           ------------------------------------------------------------------ */
        body.theme-light {
            --bg-body: #f3f5f8;
            --surface-card: #ffffff;
            --surface-muted: #f7f9fc;
            --text-main: #101828;
            --text-muted: #667085;
            --border-color: #d9e1ea;
            --table-hover-bg: #eef3f8;
            --input-bg: #ffffff;
            --brand-black: #eaf1f8;
            --sidebar-bg: var(--bg-body);
            --sidebar-border: #d7e0ea;
            --sidebar-border-soft: rgba(116, 136, 164, 0.2);
            --sidebar-text: #13233a;
            --sidebar-link: rgba(19, 35, 58, 0.82);
            --sidebar-link-hover-text: #0d1b2f;
            --sidebar-active-text: #167f4f;
            --sidebar-header: rgba(84, 104, 132, 0.88);
            --sidebar-meta: rgba(92, 113, 140, 0.84);
            --sidebar-toggle: #5f7596;
            --sidebar-toggle-hover: #1d2f4a;
            --sidebar-submenu-bg: rgba(236, 242, 249, 0.92);
            --sidebar-footer-bg: rgba(234, 240, 247, 0.94);
            --sidebar-footer-border: rgba(145, 163, 188, 0.38);
            --sidebar-user-name: #142743;
            --sidebar-user-email: rgba(47, 69, 95, 0.78);
            --sidebar-user-role: rgba(58, 80, 108, 0.76);
            --sidebar-signature: rgba(82, 103, 130, 0.62);
            --sidebar-hover: rgba(66, 97, 132, 0.09);
            --sidebar-active-bg: rgba(80, 200, 120, 0.16);
            --header-bg: rgba(255,255,255,0.92);
            --shadow-soft: 0 2px 10px rgba(15, 23, 42, 0.06);
            --shadow-hard: 0 10px 28px rgba(15, 23, 42, 0.12);
            --inbox-top: #f9fbfe;
            --inbox-bottom: #f1f5f9;
            --ticket-active-top: #ffffff;
            --ticket-active-bottom: #f2fdf7;
            --msg-user-bg: #ffffff;
            --msg-user-border: #d8e0ea;
            --composer-bg-top: #ffffff;
            --composer-bg-bottom: #f7fafd;
        }
        body.theme-dim {
            --bg-body: #252b36;
            --surface-card: #2d3442;
            --surface-muted: #313a4a;
            --text-main: #e7edf6;
            --text-muted: #aab6c8;
            --border-color: #434e62;
            --table-hover-bg: #394558;
            --input-bg: #2a3140;
            --brand-black: #1a202b;
            --sidebar-bg: linear-gradient(180deg, #1a202b 0%, #171d27 100%);
            --sidebar-border: #303b4d;
            --sidebar-border-soft: rgba(255,255,255,0.09);
            --sidebar-text: #ecf2fa;
            --sidebar-link: rgba(231,239,251,0.78);
            --sidebar-link-hover-text: #f7fbff;
            --sidebar-active-text: #7ce5a4;
            --sidebar-header: rgba(183,196,218,0.62);
            --sidebar-meta: rgba(198,210,229,0.62);
            --sidebar-toggle: #b5c2d7;
            --sidebar-toggle-hover: #ffffff;
            --sidebar-submenu-bg: rgba(7, 12, 19, 0.42);
            --sidebar-footer-bg: rgba(9, 13, 20, 0.46);
            --sidebar-footer-border: rgba(255,255,255,0.12);
            --sidebar-user-name: #f2f7ff;
            --sidebar-user-email: rgba(211,223,241,0.78);
            --sidebar-user-role: rgba(196,210,232,0.74);
            --sidebar-signature: rgba(176,194,221,0.45);
            --sidebar-hover: rgba(255,255,255,0.08);
            --sidebar-active-bg: rgba(80, 200, 120, 0.16);
            --header-bg: rgba(42, 50, 63, 0.9);
            --shadow-soft: 0 2px 10px rgba(5, 10, 18, 0.26);
            --shadow-hard: 0 14px 30px rgba(3, 8, 16, 0.35);
            --inbox-top: #2a3140;
            --inbox-bottom: #252c3a;
            --ticket-active-top: #303a49;
            --ticket-active-bottom: #273d35;
            --msg-user-bg: #2f3746;
            --msg-user-border: #4a566b;
            --composer-bg-top: #2f3746;
            --composer-bg-bottom: #29303f;
        }
        body.theme-dark {
            --bg-body: #1c222c;
            --surface-card: #232b36;
            --surface-muted: #27303d;
            --text-main: #edf2fa;
            --text-muted: #b1bdcf;
            --border-color: #3a4658;
            --table-hover-bg: #2f3948;
            --input-bg: #222a36;
            --brand-black: #141a23;
            --sidebar-bg: linear-gradient(180deg, #141a23 0%, #111722 100%);
            --sidebar-border: #2b3648;
            --sidebar-border-soft: rgba(255,255,255,0.1);
            --sidebar-text: #f1f6ff;
            --sidebar-link: rgba(236,244,255,0.76);
            --sidebar-link-hover-text: #ffffff;
            --sidebar-active-text: #8af0b3;
            --sidebar-header: rgba(196,211,236,0.56);
            --sidebar-meta: rgba(198,212,234,0.62);
            --sidebar-toggle: #c4d0e6;
            --sidebar-toggle-hover: #ffffff;
            --sidebar-submenu-bg: rgba(7, 12, 20, 0.5);
            --sidebar-footer-bg: rgba(6, 10, 17, 0.52);
            --sidebar-footer-border: rgba(255,255,255,0.14);
            --sidebar-user-name: #f9fcff;
            --sidebar-user-email: rgba(216,227,244,0.78);
            --sidebar-user-role: rgba(200,214,237,0.74);
            --sidebar-signature: rgba(188,205,231,0.42);
            --sidebar-hover: rgba(255,255,255,0.09);
            --sidebar-active-bg: rgba(80, 200, 120, 0.2);
            --header-bg: rgba(30, 38, 49, 0.92);
            --shadow-soft: 0 2px 12px rgba(3, 8, 16, 0.32);
            --shadow-hard: 0 16px 34px rgba(2, 6, 14, 0.42);
            --inbox-top: #252d39;
            --inbox-bottom: #202732;
            --ticket-active-top: #293445;
            --ticket-active-bottom: #233a33;
            --msg-user-bg: #2b3443;
            --msg-user-border: #425068;
            --composer-bg-top: #293241;
            --composer-bg-bottom: #242c39;
        }

        body.theme-light,
        body.theme-dim,
        body.theme-dark {
            background-color: var(--bg-body);
            color: var(--text-main);
        }

        body.theme-light .wrapper-admin,
        body.theme-dim .wrapper-admin,
        body.theme-dark .wrapper-admin {
            background: var(--bg-body);
        }

        body.theme-light .main-content,
        body.theme-dim .main-content,
        body.theme-dark .main-content {
            background: var(--bg-body);
        }

        body.theme-light .top-header,
        body.theme-dim .top-header,
        body.theme-dark .top-header {
            background: var(--header-bg);
            border-bottom-color: var(--border-color);
            backdrop-filter: blur(10px);
        }

        body.theme-light .sidebar,
        body.theme-dim .sidebar,
        body.theme-dark .sidebar {
            background: var(--sidebar-bg);
            border-right: 1px solid var(--sidebar-border);
        }
        body.theme-light .sidebar {
            box-shadow: 2px 0 12px rgba(15, 23, 42, 0.07);
        }
        body.theme-light .sidebar-link:hover,
        body.theme-dim .sidebar-link:hover,
        body.theme-dark .sidebar-link:hover {
            background-color: var(--sidebar-hover);
        }
        body.theme-light .sidebar-link.active,
        body.theme-dim .sidebar-link.active,
        body.theme-dark .sidebar-link.active {
            background-color: var(--sidebar-active-bg);
        }
        body.theme-light .sidebar-footer,
        body.theme-dim .sidebar-footer,
        body.theme-dark .sidebar-footer {
            border-top-color: var(--sidebar-footer-border);
            background: var(--sidebar-footer-bg);
        }

        body.theme-light .card,
        body.theme-dim .card,
        body.theme-dark .card,
        body.theme-light .kpi-card,
        body.theme-dim .kpi-card,
        body.theme-dark .kpi-card,
        body.theme-light .chat-shell,
        body.theme-dim .chat-shell,
        body.theme-dark .chat-shell {
            background: var(--surface-card) !important;
            border-color: var(--border-color) !important;
            color: var(--text-main);
            box-shadow: var(--shadow-soft);
        }

        body.theme-light .card-header,
        body.theme-dim .card-header,
        body.theme-dark .card-header,
        body.theme-light .card-footer,
        body.theme-dim .card-footer,
        body.theme-dark .card-footer {
            background: var(--surface-muted) !important;
            border-color: var(--border-color) !important;
            color: var(--text-main);
        }

        body.theme-light .bg-white,
        body.theme-dim .bg-white,
        body.theme-dark .bg-white,
        body.theme-light .bg-light,
        body.theme-dim .bg-light,
        body.theme-dark .bg-light {
            background-color: var(--surface-card) !important;
            color: var(--text-main) !important;
            border-color: var(--border-color) !important;
        }

        body.theme-light .text-muted,
        body.theme-dim .text-muted,
        body.theme-dark .text-muted,
        body.theme-light .form-text,
        body.theme-dim .form-text,
        body.theme-dark .form-text {
            color: var(--text-muted) !important;
        }

        body.theme-light .form-control,
        body.theme-dim .form-control,
        body.theme-dark .form-control,
        body.theme-light .form-select,
        body.theme-dim .form-select,
        body.theme-dark .form-select,
        body.theme-light .input-group-text,
        body.theme-dim .input-group-text,
        body.theme-dark .input-group-text {
            background-color: var(--input-bg);
            border-color: var(--border-color);
            color: var(--text-main);
        }
        body.theme-light .form-control::placeholder,
        body.theme-dim .form-control::placeholder,
        body.theme-dark .form-control::placeholder {
            color: var(--text-muted);
        }
        body.theme-light .form-control:focus,
        body.theme-dim .form-control:focus,
        body.theme-dark .form-control:focus,
        body.theme-light .form-select:focus,
        body.theme-dim .form-select:focus,
        body.theme-dark .form-select:focus {
            border-color: #63d295;
            box-shadow: 0 0 0 0.22rem rgba(80, 200, 120, 0.25);
        }

        body.theme-light .btn,
        body.theme-dim .btn,
        body.theme-dark .btn {
            transition: all .18s ease;
        }
        body.theme-light .btn:hover,
        body.theme-dim .btn:hover,
        body.theme-dark .btn:hover {
            transform: translateY(-1px);
        }
        body.theme-light .btn:focus-visible,
        body.theme-dim .btn:focus-visible,
        body.theme-dark .btn:focus-visible {
            outline: 2px solid rgba(80, 200, 120, 0.85);
            outline-offset: 1px;
        }
        body.theme-light .sidebar-footer .btn-outline-light {
            color: #1e3552;
            border-color: #9db0c8;
            background: rgba(255, 255, 255, 0.62);
            font-weight: 700;
        }
        body.theme-light .sidebar-footer .btn-outline-light:hover {
            color: #0f2843;
            border-color: #7f97b5;
            background: rgba(255, 255, 255, 0.9);
        }
        body.theme-light .sidebar-footer .btn-outline-light i {
            color: #2f4d70;
        }
        body.theme-dim .btn-outline-primary,
        body.theme-dark .btn-outline-primary,
        body.theme-dim .btn-outline-secondary,
        body.theme-dark .btn-outline-secondary,
        body.theme-dim .btn-outline-danger,
        body.theme-dark .btn-outline-danger,
        body.theme-dim .btn-outline-success,
        body.theme-dark .btn-outline-success {
            background-color: transparent;
            border-color: var(--border-color);
            color: var(--text-main);
        }
        body.theme-dim .btn-outline-dark,
        body.theme-dark .btn-outline-dark {
            color: #cfd9e8;
            border-color: #5a6781;
            background: rgba(255, 255, 255, 0.03);
        }
        body.theme-dim .btn-outline-dark:hover,
        body.theme-dark .btn-outline-dark:hover {
            color: #f7fbff;
            border-color: #7f90af;
            background: rgba(255, 255, 255, 0.08);
        }
        body.theme-dim .btn-outline-dark.active,
        body.theme-dark .btn-outline-dark.active,
        body.theme-dim .btn-outline-dark:active,
        body.theme-dark .btn-outline-dark:active {
            color: #f8fbff;
            border-color: #86b4ff;
            background: linear-gradient(180deg, #3a4e70 0%, #30425f 100%);
        }

        body.theme-light .event-selector,
        body.theme-dim .event-selector,
        body.theme-dark .event-selector,
        body.theme-light .context-pill,
        body.theme-dim .context-pill,
        body.theme-dark .context-pill,
        body.theme-light .theme-toggle-btn,
        body.theme-dim .theme-toggle-btn,
        body.theme-dark .theme-toggle-btn {
            background: var(--surface-muted);
            border-color: var(--border-color);
            color: var(--text-main);
        }
        body.theme-light .theme-toggle-btn:hover,
        body.theme-dim .theme-toggle-btn:hover,
        body.theme-dark .theme-toggle-btn:hover {
            border-color: #8ec7aa;
            box-shadow: 0 6px 14px rgba(16, 185, 129, 0.16);
        }
        body.theme-light .theme-toggle-btn i,
        body.theme-dim .theme-toggle-btn i,
        body.theme-dark .theme-toggle-btn i {
            color: inherit;
            transition: color .2s ease, text-shadow .2s ease;
        }
        body.theme-light .theme-toggle-btn {
            background: linear-gradient(180deg, #ffffff 0%, #f1f5fa 100%);
            border-color: #d5dee9;
            color: #0f172a;
        }
        body.theme-dim .theme-toggle-btn {
            background: linear-gradient(180deg, #3a4558 0%, #323d50 100%);
            border-color: #56647b;
            color: #eef3fc;
        }
        body.theme-dark .theme-toggle-btn {
            background: linear-gradient(180deg, #323d51 0%, #273244 100%);
            border-color: #5f7090;
            color: #f7fbff;
            box-shadow: 0 8px 18px rgba(7, 12, 22, 0.45);
        }
        body.theme-dark .theme-toggle-btn i {
            color: #f8fbff;
            text-shadow: 0 0 8px rgba(187, 211, 255, 0.48);
        }

        body.theme-light .table,
        body.theme-dim .table,
        body.theme-dark .table {
            --bs-table-bg: var(--surface-card);
            --bs-table-color: var(--text-main);
            --bs-table-border-color: var(--border-color);
            --bs-table-striped-bg: var(--surface-muted);
            --bs-table-striped-color: var(--text-main);
            --bs-table-hover-bg: var(--table-hover-bg);
            --bs-table-hover-color: var(--text-main);
            color: var(--text-main);
            border-color: var(--border-color);
        }
        body.theme-light .table-custom th,
        body.theme-dim .table-custom th,
        body.theme-dark .table-custom th {
            background: var(--surface-muted) !important;
            color: var(--text-muted) !important;
            border-bottom-color: var(--border-color) !important;
        }
        body.theme-light .table-custom td,
        body.theme-dim .table-custom td,
        body.theme-dark .table-custom td {
            background: var(--surface-card) !important;
            color: var(--text-main) !important;
            border-bottom-color: var(--border-color) !important;
        }
        body.theme-light .table-responsive,
        body.theme-dim .table-responsive,
        body.theme-dark .table-responsive {
            background: var(--surface-card);
        }

        body.theme-light .dropdown-menu,
        body.theme-dim .dropdown-menu,
        body.theme-dark .dropdown-menu,
        body.theme-light .modal-content,
        body.theme-dim .modal-content,
        body.theme-dark .modal-content {
            background: var(--surface-card);
            border-color: var(--border-color);
            color: var(--text-main);
            box-shadow: var(--shadow-hard);
        }
        body.theme-light .dropdown-item,
        body.theme-dim .dropdown-item,
        body.theme-dark .dropdown-item {
            color: var(--text-main);
        }
        body.theme-light .dropdown-item:hover,
        body.theme-dim .dropdown-item:hover,
        body.theme-dark .dropdown-item:hover {
            background: var(--surface-muted);
            color: var(--text-main);
        }
        body.theme-light .modal-header,
        body.theme-dim .modal-header,
        body.theme-dark .modal-header,
        body.theme-light .modal-footer,
        body.theme-dim .modal-footer,
        body.theme-dark .modal-footer {
            background: var(--surface-muted);
            border-color: var(--border-color);
            color: var(--text-main);
        }

        body.theme-light .ticket-list,
        body.theme-dim .ticket-list,
        body.theme-dark .ticket-list {
            background: linear-gradient(180deg, var(--inbox-top) 0%, var(--inbox-bottom) 100%);
        }
        body.theme-light .ticket-item,
        body.theme-dim .ticket-item,
        body.theme-dark .ticket-item {
            background: var(--surface-card);
            border-color: var(--border-color);
            color: var(--text-main);
            box-shadow: var(--shadow-soft);
        }
        body.theme-light .ticket-item:hover,
        body.theme-dim .ticket-item:hover,
        body.theme-dark .ticket-item:hover {
            border-color: #66d29a;
            box-shadow: var(--shadow-hard);
        }
        body.theme-light .ticket-item.active,
        body.theme-dim .ticket-item.active,
        body.theme-dark .ticket-item.active {
            background: linear-gradient(180deg, var(--ticket-active-top) 0%, var(--ticket-active-bottom) 100%);
            border-color: #34d399;
            box-shadow: 0 0 0 2px rgba(16,185,129,.24), var(--shadow-hard);
        }
        body.theme-light .ticket-divider,
        body.theme-dim .ticket-divider,
        body.theme-dark .ticket-divider {
            background: var(--border-color);
        }
        body.theme-light .ticket-contact,
        body.theme-dim .ticket-contact,
        body.theme-dark .ticket-contact,
        body.theme-light .ticket-meta,
        body.theme-dim .ticket-meta,
        body.theme-dark .ticket-meta,
        body.theme-light .ticket-owner,
        body.theme-dim .ticket-owner,
        body.theme-dark .ticket-owner {
            color: var(--text-muted);
        }

        body.theme-light .chat-topbar,
        body.theme-dim .chat-topbar,
        body.theme-dark .chat-topbar {
            background: linear-gradient(180deg, var(--surface-card) 0%, var(--surface-muted) 100%);
            border-bottom-color: var(--border-color);
        }
        body.theme-light .chat-area,
        body.theme-dim .chat-area,
        body.theme-dark .chat-area {
            background: linear-gradient(180deg, var(--surface-muted) 0%, var(--bg-body) 100%);
        }
        body.theme-light .msg-user,
        body.theme-dim .msg-user,
        body.theme-dark .msg-user {
            background: var(--msg-user-bg);
            border-color: var(--msg-user-border);
            color: var(--text-main);
        }
        body.theme-dim .msg-user .msg-meta,
        body.theme-dark .msg-user .msg-meta {
            color: var(--text-muted);
        }
        body.theme-light .chat-composer,
        body.theme-dim .chat-composer,
        body.theme-dark .chat-composer {
            background: linear-gradient(180deg, var(--composer-bg-top) 0%, var(--composer-bg-bottom) 100%);
            border-top-color: var(--border-color);
        }
        body.theme-light .inbox-progress-card,
        body.theme-dim .inbox-progress-card,
        body.theme-dark .inbox-progress-card {
            background: var(--surface-card);
            border-color: var(--border-color);
            color: var(--text-main);
        }

        body.theme-dim .msg-admin .read-receipt.read-sent,
        body.theme-dark .msg-admin .read-receipt.read-sent {
            color: #eef4ff;
            background: rgba(255, 255, 255, 0.18);
            border-color: rgba(255, 255, 255, 0.35);
        }
        body.theme-dim .msg-admin .read-receipt.read-seen,
        body.theme-dark .msg-admin .read-receipt.read-seen {
            color: #dcfce7;
            background: rgba(34, 197, 94, 0.24);
            border-color: rgba(167, 243, 208, 0.78);
        }

        body.theme-dim .search-highlight,
        body.theme-dark .search-highlight {
            background-color: #6b4f1d;
            color: #fff2cc;
        }


/* ==========================================================================
   7. BACKOFFICE PAGE STYLES (migrated from Backoffice.aspx)
   ========================================================================== */
/* BACKOFFICE_INLINE_CSS_START */
/* --- ESTILOS GERAIS --- */
        .inbox-shell { min-height: 620px; height: calc(100vh - 165px); }
        .inbox-col { min-height: 0; overflow: hidden; }
        .inbox-list-panel { height: 100%; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
        .inbox-filters { flex: 0 0 auto; }
        .inbox-collapse-trigger {
            border: 1px solid var(--border-color, #dbe3ee);
            background: linear-gradient(180deg, var(--surface-card, #ffffff) 0%, var(--surface-muted, #f7f9fc) 100%);
            color: var(--text-main, #0f172a);
            border-radius: 10px;
            padding: 8px 10px;
            font-weight: 800;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            font-size: 0.82rem;
            box-shadow: var(--shadow-soft, 0 2px 8px rgba(15,23,42,0.08));
            transition: all .2s ease;
        }
        .inbox-collapse-trigger:hover {
            border-color: #50C878;
            color: #1f9d66;
            box-shadow: 0 6px 14px rgba(80, 200, 120, 0.24);
        }
        .inbox-collapse-trigger:focus {
            outline: none;
            box-shadow: 0 0 0 0.2rem rgba(80, 200, 120, 0.28);
        }
        .inbox-collapse-trigger .inbox-chevron {
            transition: transform .2s ease;
        }
        .inbox-collapse-trigger[aria-expanded="true"] .inbox-chevron {
            transform: rotate(180deg);
        }
        .ticket-list { min-height: 0; overflow-y: auto; overflow-x: hidden; background: linear-gradient(180deg, #f9fbfd 0%, #f4f7fa 100%); padding: 8px 8px 14px 8px; flex: 1 1 auto; }
        .ticket-list::-webkit-scrollbar,
        .chat-area::-webkit-scrollbar { width: 9px; height: 9px; }
        .ticket-list::-webkit-scrollbar-thumb,
        .chat-area::-webkit-scrollbar-thumb { background: rgba(120, 136, 158, 0.45); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
        .ticket-list::-webkit-scrollbar-track,
        .chat-area::-webkit-scrollbar-track { background: transparent; }
        .ticket-item { position: relative; cursor: pointer; transition: all 0.2s ease; text-decoration: none; display: block; color: inherit; border: 1px solid #e9eef3; border-radius: 12px; background: #fff; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(14, 30, 37, 0.04); }
        .ticket-item:hover { transform: translateY(-1px); border-color: #cfe0d8; box-shadow: 0 8px 16px rgba(14, 30, 37, 0.08); }
        .ticket-item.active { border-color: #34d399; box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.26), 0 12px 24px rgba(16, 185, 129, 0.18); background: linear-gradient(180deg, #ffffff 0%, #f3fff8 100%); }
        .ticket-item.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(180deg, #22c55e 0%, #10b981 100%); border-radius: 12px 0 0 12px; }
.ticket-item.active .ticket-subject { color: #0f5132; }
.ticket-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.ticket-item-title-block {
    min-width: 0;
    flex: 1 1 auto;
}
.ticket-item.ticket-closed {
            opacity: 1;
            background: linear-gradient(180deg, var(--ticket-closed-top, #f4f6f8) 0%, var(--ticket-closed-bottom, #edf1f5) 100%);
            border-color: var(--ticket-closed-border, #cfd7e1);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 8px 16px rgba(15, 23, 42, 0.08);
        }
        .ticket-item.ticket-closed:hover {
            border-color: var(--ticket-closed-hover-border, #b9c5d3);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 10px 18px rgba(15, 23, 42, 0.12);
            transform: translateY(-1px);
        }
        .ticket-item.ticket-closed.active {
            border-color: var(--ticket-closed-active-border, #8da5be);
            box-shadow: 0 0 0 2px var(--ticket-closed-ring, rgba(148, 163, 184, 0.34)), 0 12px 22px rgba(15, 23, 42, 0.15);
            background: linear-gradient(180deg, var(--ticket-closed-active-top, #eef3f8) 0%, var(--ticket-closed-active-bottom, #e7edf4) 100%);
        }
        .ticket-item.ticket-closed.active::before {
            background: linear-gradient(180deg, var(--ticket-closed-accent-top, #9aa9bb) 0%, var(--ticket-closed-accent-bottom, #74859a) 100%);
        }
        .ticket-item.ticket-closed .ticket-subject {
            color: var(--ticket-closed-subject, #334155) !important;
            text-shadow: none;
            font-weight: 700;
        }
        .ticket-item.ticket-closed .ticket-contact,
        .ticket-item.ticket-closed .ticket-meta,
        .ticket-item.ticket-closed .ticket-owner {
            color: var(--ticket-closed-meta, #54657d) !important;
        }
        .ticket-meta { font-size: 0.72rem; color: #6c757d; letter-spacing: 0.1px; }
        .ticket-subject { font-size: 0.94rem; line-height: 1.25rem; color: #10243c; text-shadow: 0 1px 0 rgba(255,255,255,0.35); }
.ticket-contact { font-size: 0.82rem; color: #41506a; }
.ticket-divider { height: 1px; background: #eef2f6; margin: 8px 0; }
.ticket-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.ticket-item-meta-cluster {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}
.ticket-item-sla {
    flex: 0 0 auto;
}
.ticket-chip { font-size: 0.67rem; border-radius: 999px; padding: 3px 8px; font-weight: 700; letter-spacing: 0.02em; }
        .ticket-ref {
            font-size: 0.67rem;
            border-radius: 999px;
            padding: 3px 9px;
            font-weight: 800;
            letter-spacing: 0.03em;
            border: 1px solid var(--ticket-ref-border, #aeb9c9);
            background: var(--ticket-ref-bg, #dde5ef);
            color: var(--ticket-ref-text, #1f2d42);
            display: inline-flex;
            align-items: center;
        }
        .ticket-pill {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 22px;
            border-radius: 999px;
            padding: 2px 10px;
            font-size: 0.69rem;
            font-weight: 800;
            letter-spacing: 0.02em;
            border: 1px solid transparent;
            white-space: nowrap;
        }
        .ticket-pill--priority-critical { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
        .ticket-pill--priority-high { background: #fef3c7; color: #92400e; border-color: #fde68a; }
        .ticket-pill--priority-normal { background: #dcfce7; color: #166534; border-color: #86efac; }
        .ticket-pill--priority-low { background: #e2e8f0; color: #334155; border-color: #cbd5e1; }
        .ticket-pill--state-critical { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
        .ticket-pill--state-new { background: #ffedd5; color: #9a3412; border-color: #fed7aa; }
        .ticket-pill--state-attention { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
        .ticket-pill--state-followup { background: #ecfeff; color: #0f766e; border-color: #99f6e4; }
        .ticket-pill--state-closed { background: #e2e8f0; color: #334155; border-color: #cbd5e1; }
        .ticket-item.ticket-closed .ticket-pill--state-closed {
            background: var(--ticket-closed-pill-bg, #d8e0ea);
            color: var(--ticket-closed-pill-text, #31445f);
            border-color: var(--ticket-closed-pill-border, #bcc8d8);
        }
        .ticket-owner { font-size: 0.7rem; color: #4f6078; }
.chat-panel-wrap { height: 100%; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.chat-shell { background: #fff; border: 1px solid #e8edf2; border-radius: 14px; overflow: hidden; box-shadow: 0 6px 16px rgba(17,24,39,0.05); height: 100%; min-height: 0; display: flex; flex-direction: column; }
.chat-topbar { background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%); border-bottom: 1px solid #edf2f7; padding-bottom: 14px !important; }
.chat-ticket-topline { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #64748b; margin-bottom: 8px; }
.chat-ticket-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.chat-ticket-head { min-width: 0; flex: 1 1 auto; }
.chat-ticket-subject { font-size: 1.2rem; line-height: 1.22; font-weight: 800; color: #0f172a; letter-spacing: -0.01em; max-width: 760px; }
.chat-ticket-contact-line { margin-top: 8px; font-size: 0.9rem; color: #52627a; }
.chat-ticket-controls { display: flex; flex-direction: column; align-items: stretch; gap: 8px; flex: 0 0 auto; min-width: 256px; }
.chat-ticket-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chat-ticket-tools .form-select { min-width: 138px; border-radius: 10px; min-height: 40px; border-color: #d7e0ea; font-size: 0.95rem; }
.chat-ticket-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.chat-ticket-actions .btn { min-height: 36px; border-radius: 10px; font-weight: 700; padding-inline: 12px; font-size: 0.96rem; }
.chat-area { flex: 1 1 auto; min-height: 0; overflow-y: auto; background: linear-gradient(180deg, #f8fbff 0%, #f4f7fb 38%, #f2f4f7 100%); padding: 20px 20px 28px 20px; }
.msg-thread-row { display: flex; width: 100%; margin-bottom: 14px; }
.msg-thread-row--admin { justify-content: flex-end; }
.msg-thread-row--user { justify-content: flex-start; }
.msg-thread-stack { display: flex; align-items: flex-end; gap: 10px; max-width: 86%; }
.msg-thread-stack--admin { flex-direction: row-reverse; }
.msg-thread-marker { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 34px; font-size: 0.88rem; box-shadow: 0 6px 14px rgba(15, 23, 42, 0.1); }
.msg-thread-marker--user { background: linear-gradient(180deg, #d9fbe7 0%, #bef3d1 100%); color: #0f5132; }
.msg-thread-marker--admin { background: linear-gradient(180deg, #eef4ff 0%, #dbeafe 100%); color: #1d4ed8; }
.msg-bubble { max-width: 100%; padding: 13px 15px; border-radius: 16px; position: relative; margin-bottom: 0; clear: both; }
.msg-user { background: linear-gradient(140deg, var(--brand-primary), var(--brand-primary-dark)); color: #ffffff; border: 1px solid var(--brand-primary-dark); border-bottom-left-radius: 6px; box-shadow: 0 10px 18px rgba(80, 200, 120, 0.2); }
.msg-admin { background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%); color: var(--text-main, #1f2937); border: 1px solid #dbe4ee; border-bottom-right-radius: 6px; box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08); }
.msg-author { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 9px; border-radius: 999px; font-weight: 800; font-size: 0.72rem; margin-bottom: 8px; letter-spacing: 0.02em; opacity: 0.98; }
.msg-user .msg-author { background: rgba(255, 255, 255, 0.16); color: #ffffff; }
.msg-admin .msg-author { background: #e9f1ff; color: #1d4ed8; }
.msg-text { font-size: 0.98rem; line-height: 1.52; letter-spacing: 0.01em; }
.msg-meta { margin-top: 10px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; font-size: 0.73rem; font-weight: 700; }
.msg-time { opacity: 0.95; }
.msg-user .msg-meta { color: rgba(255, 255, 255, 0.95); }
.msg-admin .msg-meta { color: #64748b; }
        .read-receipt { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 8px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.01em; line-height: 1.2; }
        .msg-admin .read-receipt.read-sent { color: #1f6feb; background: rgba(31, 111, 235, 0.08); border: 1px solid rgba(31, 111, 235, 0.18); }
        .msg-admin .read-receipt.read-seen { color: #0f5132; background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.28); }
.chat-composer { background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%); border-top: 1px solid #edf2f7; position: sticky; bottom: 0; z-index: 6; margin-top: auto; }
.chat-composer-shell { display: flex; flex-direction: column; gap: 10px; }
.chat-composer-heading { display: flex; flex-direction: column; gap: 2px; }
.chat-composer-title { font-size: 0.74rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #475569; }
.chat-composer-copy { font-size: 0.78rem; color: #64748b; line-height: 1.3; }
.chat-composer-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: stretch; }
.chat-composer .form-control { border: 1px solid #dbe4ee; border-radius: 12px; min-height: 48px; padding: 11px 14px; line-height: 1.45; resize: none; overflow-y: hidden; }
.chat-composer .form-control:focus { box-shadow: 0 0 0 0.2rem rgba(31,111,235,0.18); border-color: #86b7fe; }
.chat-composer .btn { border-radius: 12px; font-weight: 800; min-width: 148px; }
.chat-composer-send { align-self: stretch; padding-inline: 18px; background: linear-gradient(180deg, #516379 0%, #3f5167 100%); border-color: #44566c; box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12); color: #ffffff; }
.chat-composer-send:hover,
.chat-composer-send:focus { background: linear-gradient(180deg, #5c6f86 0%, #495c72 100%); border-color: #4c6077; color: #ffffff; }
.chat-composer-send--icon { min-width: 84px !important; width: 84px; font-size: 1.2rem; letter-spacing: 0; padding-inline: 0; display: inline-flex; align-items: center; justify-content: center; }
.chat-composer-toggle { margin-top: 10px; }
        .no-ticket-state {
            width: min(640px, 92%);
            border: 1px dashed var(--border-color, #d8e2ef);
            border-radius: 16px;
            background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(246,250,255,0.8) 100%);
            padding: 26px 24px;
            box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
        }
        .no-ticket-state .icon-wrap {
            width: 66px;
            height: 66px;
            margin: 0 auto 14px auto;
            border-radius: 50%;
            display: grid;
            place-items: center;
            color: #4f46e5;
            background: radial-gradient(circle at 30% 30%, #ffffff 0%, #e8efff 100%);
            border: 1px solid #dbe6ff;
        }
        .no-ticket-state ul { margin: 0; padding-left: 1rem; text-align: left; }
        .no-ticket-state li { margin-bottom: 4px; }
        .inbox-progress-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.22); display: flex; align-items: center; justify-content: center; z-index: 9998; backdrop-filter: blur(1px); }
        .inbox-progress-card { background: #ffffff; border: 1px solid #e5e7eb; border-radius: 14px; min-width: 180px; padding: 14px 16px; box-shadow: 0 14px 28px rgba(15, 23, 42, 0.15); display: flex; align-items: center; gap: 10px; font-weight: 700; color: #1f2937; }
        .sidebar-link { position: relative; }
        body.collapsed .sidebar-link .badge { position: absolute; top: 5px; right: 6px; margin-left: 0 !important; transform: scale(0.9); }
        .lottery-progress {
            background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(15,23,42,0.12) 100%);
            border: 1px solid var(--border-color, #3a4658);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), inset 0 -1px 0 rgba(15,23,42,0.16);
            border-radius: 999px;
            overflow: hidden;
        }
        .lottery-progress .progress-bar {
            background: linear-gradient(90deg, #10b981 0%, #34d399 55%, #6ee7b7 100%) !important;
            color: #083222;
            font-weight: 800;
            letter-spacing: 0.02em;
            text-shadow: none;
            transition: width .35s ease;
        }
        .grid-pager td { padding: 0.5rem; }
        .grid-pager a, .grid-pager span { padding: 5px 10px; border: 1px solid #ddd; background: #fff; text-decoration: none; color: #333; margin: 0 2px; border-radius: 4px; display: inline-block; }
        .grid-pager span { background: #333; color: #fff; border-color: #333; }
        .grid-pager a:hover { background-color: #eee; }
        .fi { border-radius: 2px; box-shadow: 0 0 2px rgba(0,0,0,0.2); }
        .swal2-popup { font-family: 'Montserrat', sans-serif; font-size: 0.9rem; }
        .member-list { background-color: #f8f9fa; border-left: 3px solid #50C878; margin-top: 10px; padding: 10px; border-radius: 0 4px 4px 0; font-size: 0.85rem; }
        .member-row { padding: 5px 0; border-bottom: 1px solid #e9ecef; display: flex; align-items: center; justify-content: space-between; }
        .member-row:last-child { border-bottom: none; }
        .toggle-btn { text-decoration: none; font-weight: bold; color: #50C878; margin-right: 8px; font-size: 1.1rem; line-height: 1; display: inline-block; width: 15px; }
        .toggle-btn:hover { color: #3da35b; }
        .search-highlight { background-color: #fff3cd; border-radius: 2px; padding: 2px; }
        .algo-card { overflow: hidden; }
        .algo-toolbar { padding-bottom: 10px; border-bottom: 1px dashed var(--border-color); }
        .algo-section {
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 14px 16px;
            background: var(--surface-card);
        }
        .algo-publish-panel {
            border: 1px solid var(--border-color);
            border-radius: 14px;
            padding: 16px;
            background: linear-gradient(180deg, var(--surface-card) 0%, var(--surface-muted) 100%);
            box-shadow: var(--shadow-soft);
        }
        .reports-toolbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            flex-wrap: wrap;
        }
        .report-kpi-card {
            border: 1px solid var(--border-color);
            border-radius: 14px;
            background: linear-gradient(180deg, var(--surface-card) 0%, var(--surface-muted) 100%);
            padding: 16px 18px;
            box-shadow: var(--shadow-soft);
            height: 100%;
        }
        .report-kpi-label {
            font-size: 0.76rem;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: var(--text-muted);
            font-weight: 700;
        }
        .report-kpi-value {
            margin-top: 6px;
            font-size: 1.7rem;
            font-weight: 800;
            line-height: 1.05;
            color: var(--text-main);
        }
        .report-kpi-meta {
            margin-top: 6px;
            font-size: 0.78rem;
            color: var(--text-muted);
        }
        .report-chart-wrap {
            position: relative;
            height: 300px;
        }
        .report-summary-table .table th,
        .report-summary-table .table td {
            vertical-align: middle;
        }
        .report-pill {
            display: inline-flex;
            align-items: center;
            border-radius: 999px;
            padding: 4px 10px;
            font-size: 0.72rem;
            font-weight: 700;
            letter-spacing: 0.03em;
            border: 1px solid var(--border-color);
            background: var(--surface-muted);
            color: var(--text-main);
        }
        #lotteryOverlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 9999; display: none; flex-direction: column; align-items: center; justify-content: center; color: white; backdrop-filter: blur(5px); }
        .loader-spinner { width: 60px; height: 60px; border: 6px solid #f3f3f3; border-top: 6px solid #50C878; border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 20px; }
        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
        /* Garante que o UpdatePanel (div) ocupa a largura total para não quebrar o layout da sidebar */
        #upInboxBadge { width: 100%; }
        
        /* SIDEBAR REFATORADA */
        .sidebar { display: flex; flex-direction: column; height: 100vh; position: fixed; left: 0; top: 0; width: var(--sidebar-width); background: var(--sidebar-bg, var(--brand-black)); color: var(--sidebar-text, #ffffff); transition: width 0.3s ease; z-index: 1000; overflow: hidden; border-right: 1px solid var(--sidebar-border, rgba(255,255,255,0.12)); box-shadow: 10px 0 30px rgba(5, 10, 18, 0.28); }
        .sidebar-brand { padding: 20px; font-family: 'Teko', sans-serif; font-size: 1.5rem; border-bottom: 1px solid var(--sidebar-border-soft, rgba(255,255,255,0.1)); display: flex; justify-content: flex-start; align-items: center; height: var(--header-height); }
        .brand-container { display: flex; align-items: center; gap: 8px; }
        .brand-stack { display: flex; flex-direction: column; line-height: 1; }
        .brand-stack .brand-text { font-weight: 700; letter-spacing: 0.2px; }
        .brand-dashboard-icon {
            font-size: 1.05rem;
            color: var(--sidebar-icon, #dd8a14);
            margin-right: 8px;
            opacity: 0.92;
        }
        .brand-stack .brand-primary {
            display: block;
            font-weight: 800;
            letter-spacing: 0.02em;
            line-height: 1;
        }
        .brand-stack .brand-sub {
            display: block;
            margin-top: 3px;
            font-size: 0.72em;
            font-weight: 700;
            letter-spacing: 0.06em;
            opacity: 0.9;
            line-height: 1;
        }
        .brand-meta { font-family: 'Montserrat', sans-serif; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sidebar-meta, rgba(255,255,255,0.56)); margin-top: 4px; }
        .sidebar-menu { list-style: none; padding: 0; margin: 0; overflow-y: auto; flex-grow: 1; }
        .sidebar-menu li { width: 100%; }
        .sidebar-link { display: flex; align-items: center; padding: 12px 20px; color: var(--sidebar-link, rgba(255,255,255,0.76)); text-decoration: none; transition: all 0.2s; border-left: 3px solid transparent; font-size: 0.9rem; cursor: pointer; width: 100%; }
        .sidebar-link:hover { background-color: var(--sidebar-hover, rgba(255,255,255,0.05)); color: var(--sidebar-link-hover-text, #ffffff); }
        .sidebar-link.active { background-color: var(--sidebar-active-bg, rgba(80, 200, 120, 0.15)); color: var(--sidebar-active-text, var(--brand-primary)); border-left-color: var(--brand-primary); font-weight: 600; box-shadow: inset 0 0 0 1px rgba(80,200,120,0.2); }
        .sidebar-link i { width: 25px; text-align: center; margin-right: 10px; font-size: 1rem; color: var(--sidebar-icon, currentColor); transition: color .2s ease, transform .2s ease; }
        .sidebar-link:hover i { color: var(--sidebar-icon-hover, var(--sidebar-icon, currentColor)); transform: translateY(-1px); }
        .sidebar-link.active i { color: var(--sidebar-icon-active, var(--sidebar-active-text, var(--brand-primary))); }
        .link-text { white-space: nowrap; opacity: 1; transition: opacity 0.3s; }
        
        .menu-header { padding: 20px 20px 5px 20px; font-size: 0.7rem; font-weight: bold; color: var(--sidebar-header, rgba(255,255,255,0.46)); text-transform: uppercase; letter-spacing: 1px; }
        
        /* Submenu */
        .sidebar-submenu { background-color: var(--sidebar-submenu-bg, rgba(0,0,0,0.2)); border-top: 1px solid var(--sidebar-border-soft, rgba(255,255,255,0.08)); border-bottom: 1px solid var(--sidebar-border-soft, rgba(255,255,255,0.08)); }
        .sidebar-submenu .sidebar-link { padding-left: 55px; font-size: 0.85rem; }
        .sidebar-link[aria-expanded="true"] .fa-chevron-down { transform: rotate(180deg); }
        .dropdown-icon { margin-left: auto; font-size: 0.7rem; transition: transform 0.3s; }

        /* Footer com Perfil */
        .sidebar-footer { padding: 15px; border-top: 1px solid var(--sidebar-footer-border, rgba(255,255,255,0.12)); background: var(--sidebar-footer-bg, rgba(0,0,0,0.3)); margin-top: auto; }
        .user-profile { display: flex; align-items: center; overflow: hidden; }
        .user-avatar { width: 35px; height: 35px; background-color: var(--brand-primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; color: white; margin-right: 10px; flex-shrink: 0; }
        .user-info { flex-grow: 1; overflow: hidden; }
        .user-name { font-size: 0.85rem; font-weight: bold; color: var(--sidebar-user-name, #ffffff); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .user-email { font-size: 0.75rem; color: var(--sidebar-user-email, rgba(255,255,255,0.62)); overflow: hidden; text-overflow: ellipsis; }
        .user-role { font-size: 0.7rem; color: var(--sidebar-user-role, rgba(255,255,255,0.72)); }
        .sidebar-signature { margin-top: 10px; text-align: center; font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sidebar-signature, rgba(255,255,255,0.34)); user-select: none; }
        .sidebar-edge-toggle {
            position: absolute;
            top: 84px;
            right: -13px;
            width: 26px;
            height: 72px;
            border-radius: 12px;
            border: 1px solid var(--sidebar-border, rgba(255,255,255,0.2));
            background: var(--surface-card, #fff);
            color: var(--sidebar-toggle, #5f7596);
            box-shadow: 0 8px 18px rgba(15, 23, 42, 0.15);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 1010;
            transition: all .2s ease;
        }
        .sidebar-edge-toggle:hover {
            color: var(--sidebar-toggle-hover, #1d2f4a);
            border-color: #8ec7aa;
            transform: translateX(1px);
        }

        /* Toggle iPhone para configurações (asp:CheckBox) */
        .ballot-switch {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            margin-bottom: 0.25rem;
        }
        .ballot-switch .ballot-switch-input {
            display: inline-flex;
            margin: 0;
            padding: 0;
            line-height: 1;
        }
        .ballot-switch .ballot-switch-input input[type="checkbox"] {
            -webkit-appearance: none;
            appearance: none;
            width: 42px;
            height: 24px;
            border-radius: 999px;
            border: 1px solid #bfc7d2;
            background: linear-gradient(180deg, #e5e7eb 0%, #d1d5db 100%);
            position: relative;
            cursor: pointer;
            transition: all 0.2s ease;
            margin: 0;
        }
        .ballot-switch .ballot-switch-input input[type="checkbox"]::after {
            content: "";
            position: absolute;
            top: 2px;
            left: 2px;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: #ffffff;
            box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28);
            transition: transform 0.2s ease;
        }
        .ballot-switch .ballot-switch-input input[type="checkbox"]:focus {
            outline: none;
            box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.18);
            border-color: #72c59f;
        }
        .ballot-switch .ballot-switch-input input[type="checkbox"]:checked {
            border-color: #1f9d66;
            background: linear-gradient(180deg, #25b374 0%, #1f9d66 100%);
        }
        .ballot-switch .ballot-switch-input input[type="checkbox"]:checked::after {
            transform: translateX(18px);
        }
        .ballot-switch .form-check-label {
            margin: 0;
            line-height: 1.35;
            cursor: pointer;
        }
        .ballot-switch .form-text {
            flex-basis: 100%;
            margin-left: 52px;
            margin-top: 2px;
        }
        
        /* Collapsed State Override */
        body.collapsed .sidebar { width: var(--sidebar-collapsed-width); }
        body.collapsed .link-text, body.collapsed .menu-header, body.collapsed .brand-stack, body.collapsed .user-info, body.collapsed .dropdown-icon { display: none; }
        body.collapsed .sidebar-brand { justify-content: center; }
        body.collapsed .brand-container { display: flex !important; justify-content: center; width: 100%; }
        body.collapsed .brand-dashboard-icon { margin-right: 0; font-size: 1.25rem; opacity: 1; }
        body.collapsed .sidebar-link { justify-content: center; padding: 15px 0; }
        body.collapsed .sidebar-link i { margin-right: 0; }
        body.collapsed .sidebar-submenu .sidebar-link { padding-left: 0; }
        body.collapsed .sidebar-signature { display: none; }
        body.collapsed .sidebar-edge-toggle { right: -12px; }

        .theme-toggle-btn {
            width: 36px;
            height: 36px;
            border-radius: 10px;
            border: 1px solid #dbe2ea;
            background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
            color: #0f172a;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }
        .theme-toggle-btn:hover {
            border-color: #a7b6c8;
            transform: translateY(-1px);
        }
        .event-selector {
            min-width: 290px;
            max-width: 430px;
        }
        .context-pill {
            display: inline-flex;
            align-items: center;
            padding: 4px 10px;
            border-radius: 999px;
            border: 1px solid #d7dee8;
            background: #f8fafc;
            color: #334155;
            font-size: 0.74rem;
            font-weight: 700;
            letter-spacing: 0.02em;
            max-width: 460px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .context-pill.context-event { min-width: 290px; }
        .context-pill.context-ballot { min-width: 250px; }
        @media (max-width: 992px) {
            .event-selector {
                min-width: 170px;
                max-width: 220px;
            }
            .context-pill {
                display: none;
            }
        }

        body.dark-mode .theme-toggle-btn {
            border-color: #374151;
            background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
            color: #f8fafc;
        }
        body.dark-mode .event-selector {
            background-color: #1a1c1f;
            border-color: #3a3f47;
            color: #f3f4f6;
        }
        body.dark-mode .context-pill {
            border-color: #374151;
            background: #1a1c1f;
            color: #e5e7eb;
        }
        body.dark-mode .ticket-list { background: linear-gradient(180deg, #0f0f10 0%, #141415 100%); }
        body.dark-mode .ticket-item { background: #141415; border-color: #2b2d30; color: #f0f3f7; box-shadow: 0 2px 8px rgba(0,0,0,0.35); }
        body.dark-mode .ticket-item:hover { border-color: #3a3d42; box-shadow: 0 8px 16px rgba(0,0,0,0.45); }
        body.dark-mode .ticket-item.active { border-color: #22c55e; background: linear-gradient(180deg, #1a1b1c 0%, #141b16 100%); box-shadow: 0 0 0 2px rgba(34,197,94,0.22), 0 12px 24px rgba(0,0,0,0.45); }
        body.dark-mode .ticket-item.active .ticket-subject { color: #d1fae5; }
        body.dark-mode .ticket-subject { color: #f3f4f6; }
        body.dark-mode .ticket-contact { color: #c2c8d0; }
        body.dark-mode .ticket-meta,
        body.dark-mode .ticket-owner { color: #b7bec8; }
        body.dark-mode .ticket-divider { background: #2a2d31; }
        body.dark-mode .chat-shell { background: #121315; border-color: #2a2d31; box-shadow: 0 6px 16px rgba(0,0,0,0.35); }
        body.dark-mode .chat-topbar { background: linear-gradient(180deg, #141518 0%, #111214 100%); border-bottom-color: #2a2d31; }
        body.dark-mode .chat-area { background: radial-gradient(circle at top right, #1a1b1f 0%, #141518 45%, #111214 100%); }
        body.dark-mode .msg-user { background-color: #1a1c1f; border-color: #343840; color: #f3f4f6; box-shadow: 0 4px 10px rgba(0,0,0,0.35); }
        body.dark-mode .msg-user .msg-meta { color: #b3bcc8; }
        body.dark-mode .chat-composer { background: linear-gradient(180deg, #141518 0%, #111214 100%); border-top-color: #2a2d31; }
        body.dark-mode .chat-composer .form-control { border-color: #3a3f47; background: #1a1c1f; color: #f3f4f6; }
        body.dark-mode .chat-composer .form-control::placeholder { color: #b3bcc8; }
        body.dark-mode .inbox-progress-card { background: #1a1c1f; border-color: #3a3f47; color: #f3f4f6; }
        body.dark-mode .member-list { background-color: #1a1c1f; border-left-color: #10b981; }
        body.dark-mode .member-row { border-bottom-color: #2a2d31; }
        body.dark-mode .text-muted { color: #aeb6c2 !important; }
        body.dark-mode .form-text { color: #9ca6b3 !important; }
        body.dark-mode .table {
            --bs-table-bg: #151618;
            --bs-table-color: #f1f5f9;
            --bs-table-border-color: #2a2d31;
            --bs-table-striped-bg: #1b1d20;
            --bs-table-striped-color: #f1f5f9;
            --bs-table-hover-bg: #22262b;
            --bs-table-hover-color: #ffffff;
            color: #f1f5f9;
            border-color: #2a2d31;
        }
        body.dark-mode .table-custom th { background-color: #101113; color: #c7d0db; border-bottom-color: #2a2d31; }
        body.dark-mode .table-custom td { background-color: #151618; color: #eef2f7; border-bottom-color: #2a2d31; }
        body.dark-mode .table-responsive { background: #151618; }
        body.dark-mode .badge.bg-dark-subtle.text-dark.border {
            background-color: #2a2d31 !important;
            color: #e5e7eb !important;
            border-color: #3a3f47 !important;
        }
        body.dark-mode .btn-outline-primary,
        body.dark-mode .btn-outline-secondary,
        body.dark-mode .btn-outline-danger,
        body.dark-mode .btn-outline-success {
            background-color: #141518;
        }
        body.dark-mode .search-highlight { background-color: #713f12; color: #fef3c7; }

        

/* ------------------------------------------------------------------
           PREMIUM THEMES (Light / Dim / Dark) - Backoffice only
           ------------------------------------------------------------------ */
        body.theme-light {
            --bg-body: #f3f5f8;
            --surface-card: #ffffff;
            --surface-muted: #f7f9fc;
            --text-main: #101828;
            --text-muted: #667085;
            --border-color: #d9e1ea;
            --table-hover-bg: #eef3f8;
            --input-bg: #ffffff;
            --brand-black: #eaf1f8;
            --sidebar-bg: var(--bg-body);
            --sidebar-border: #d7e0ea;
            --sidebar-border-soft: rgba(116, 136, 164, 0.2);
            --sidebar-text: #13233a;
            --sidebar-link: rgba(19, 35, 58, 0.82);
            --sidebar-link-hover-text: #0d1b2f;
            --sidebar-active-text: #167f4f;
            --sidebar-header: rgba(84, 104, 132, 0.88);
            --sidebar-meta: rgba(92, 113, 140, 0.84);
            --sidebar-toggle: #5f7596;
            --sidebar-toggle-hover: #1d2f4a;
            --sidebar-submenu-bg: rgba(236, 242, 249, 0.92);
            --sidebar-footer-bg: rgba(234, 240, 247, 0.94);
            --sidebar-footer-border: rgba(145, 163, 188, 0.38);
            --sidebar-user-name: #142743;
            --sidebar-user-email: rgba(47, 69, 95, 0.78);
            --sidebar-user-role: rgba(58, 80, 108, 0.76);
            --sidebar-signature: rgba(82, 103, 130, 0.62);
            --sidebar-hover: rgba(66, 97, 132, 0.09);
            --sidebar-active-bg: rgba(80, 200, 120, 0.16);
            --sidebar-icon: #dd8a14;
            --sidebar-icon-hover: #c87400;
            --sidebar-icon-active: #ab5f00;
            --header-bg: rgba(255,255,255,0.92);
            --shadow-soft: 0 2px 10px rgba(15, 23, 42, 0.06);
            --shadow-hard: 0 10px 28px rgba(15, 23, 42, 0.12);
            --inbox-top: #f9fbfe;
            --inbox-bottom: #f1f5f9;
            --ticket-active-top: #ffffff;
            --ticket-active-bottom: #f2fdf7;
            --ticket-closed-top: #f3f6f9;
            --ticket-closed-bottom: #e9eef4;
            --ticket-closed-border: #cfd9e6;
            --ticket-closed-hover-border: #b9c7d8;
            --ticket-closed-active-border: #8ea4bc;
            --ticket-closed-ring: rgba(148, 163, 184, 0.34);
            --ticket-closed-active-top: #edf3f9;
            --ticket-closed-active-bottom: #e6edf5;
            --ticket-closed-accent-top: #97a8bc;
            --ticket-closed-accent-bottom: #75879d;
            --ticket-closed-subject: #334155;
            --ticket-closed-meta: #54657d;
            --ticket-closed-pill-bg: #dbe3ee;
            --ticket-closed-pill-text: #334a67;
            --ticket-closed-pill-border: #becbdd;
            --ticket-ref-bg: #dde6f0;
            --ticket-ref-border: #b6c4d5;
            --ticket-ref-text: #20344d;
            --msg-user-bg: #ffffff;
            --msg-user-border: #d8e0ea;
            --composer-bg-top: #ffffff;
            --composer-bg-bottom: #f7fafd;
        }
        body.theme-dim {
            --bg-body: #252b36;
            --surface-card: #2d3442;
            --surface-muted: #313a4a;
            --text-main: #e7edf6;
            --text-muted: #aab6c8;
            --border-color: #434e62;
            --table-hover-bg: #394558;
            --input-bg: #2a3140;
            --brand-black: #1a202b;
            --sidebar-bg: linear-gradient(180deg, #1a202b 0%, #171d27 100%);
            --sidebar-border: #303b4d;
            --sidebar-border-soft: rgba(255,255,255,0.09);
            --sidebar-text: #ecf2fa;
            --sidebar-link: rgba(231,239,251,0.78);
            --sidebar-link-hover-text: #f7fbff;
            --sidebar-active-text: #7ce5a4;
            --sidebar-header: rgba(183,196,218,0.62);
            --sidebar-meta: rgba(198,210,229,0.62);
            --sidebar-toggle: #b5c2d7;
            --sidebar-toggle-hover: #ffffff;
            --sidebar-submenu-bg: rgba(7, 12, 19, 0.42);
            --sidebar-footer-bg: rgba(9, 13, 20, 0.46);
            --sidebar-footer-border: rgba(255,255,255,0.12);
            --sidebar-user-name: #f2f7ff;
            --sidebar-user-email: rgba(211,223,241,0.78);
            --sidebar-user-role: rgba(196,210,232,0.74);
            --sidebar-signature: rgba(176,194,221,0.45);
            --sidebar-hover: rgba(255,255,255,0.08);
            --sidebar-active-bg: rgba(80, 200, 120, 0.16);
            --sidebar-icon: #f7b84a;
            --sidebar-icon-hover: #ffd082;
            --sidebar-icon-active: #ffe2a8;
            --header-bg: rgba(42, 50, 63, 0.9);
            --shadow-soft: 0 2px 10px rgba(5, 10, 18, 0.26);
            --shadow-hard: 0 14px 30px rgba(3, 8, 16, 0.35);
            --inbox-top: #2a3140;
            --inbox-bottom: #252c3a;
            --ticket-active-top: #303a49;
            --ticket-active-bottom: #273d35;
            --ticket-closed-top: #38455a;
            --ticket-closed-bottom: #313e52;
            --ticket-closed-border: #6e7d96;
            --ticket-closed-hover-border: #8294ad;
            --ticket-closed-active-border: #93a9c2;
            --ticket-closed-ring: rgba(172, 191, 214, 0.28);
            --ticket-closed-active-top: #415168;
            --ticket-closed-active-bottom: #39495f;
            --ticket-closed-accent-top: #a7b7cc;
            --ticket-closed-accent-bottom: #8297b2;
            --ticket-closed-subject: #f0f6ff;
            --ticket-closed-meta: #d3deef;
            --ticket-closed-pill-bg: #d7e2f3;
            --ticket-closed-pill-text: #1e344f;
            --ticket-closed-pill-border: #b2c2da;
            --ticket-ref-bg: rgba(222, 233, 247, 0.92);
            --ticket-ref-border: rgba(191, 205, 224, 0.96);
            --ticket-ref-text: #1e334d;
            --msg-user-bg: #2f3746;
            --msg-user-border: #4a566b;
            --composer-bg-top: #2f3746;
            --composer-bg-bottom: #29303f;
        }
        body.theme-dark {
            --bg-body: #1c222c;
            --surface-card: #232b36;
            --surface-muted: #27303d;
            --text-main: #edf2fa;
            --text-muted: #b1bdcf;
            --border-color: #3a4658;
            --table-hover-bg: #2f3948;
            --input-bg: #222a36;
            --brand-black: #141a23;
            --sidebar-bg: linear-gradient(180deg, #141a23 0%, #111722 100%);
            --sidebar-border: #2b3648;
            --sidebar-border-soft: rgba(255,255,255,0.1);
            --sidebar-text: #f1f6ff;
            --sidebar-link: rgba(236,244,255,0.76);
            --sidebar-link-hover-text: #ffffff;
            --sidebar-active-text: #8af0b3;
            --sidebar-header: rgba(196,211,236,0.56);
            --sidebar-meta: rgba(198,212,234,0.62);
            --sidebar-toggle: #c4d0e6;
            --sidebar-toggle-hover: #ffffff;
            --sidebar-submenu-bg: rgba(7, 12, 20, 0.5);
            --sidebar-footer-bg: rgba(6, 10, 17, 0.52);
            --sidebar-footer-border: rgba(255,255,255,0.14);
            --sidebar-user-name: #f9fcff;
            --sidebar-user-email: rgba(216,227,244,0.78);
            --sidebar-user-role: rgba(200,214,237,0.74);
            --sidebar-signature: rgba(188,205,231,0.42);
            --sidebar-hover: rgba(255,255,255,0.09);
            --sidebar-active-bg: rgba(80, 200, 120, 0.2);
            --sidebar-icon: #ffbf52;
            --sidebar-icon-hover: #ffd889;
            --sidebar-icon-active: #ffe8b8;
            --header-bg: rgba(30, 38, 49, 0.92);
            --shadow-soft: 0 2px 12px rgba(3, 8, 16, 0.32);
            --shadow-hard: 0 16px 34px rgba(2, 6, 14, 0.42);
            --inbox-top: #252d39;
            --inbox-bottom: #202732;
            --ticket-active-top: #293445;
            --ticket-active-bottom: #233a33;
            --ticket-closed-top: #364459;
            --ticket-closed-bottom: #303d51;
            --ticket-closed-border: #6c7f9c;
            --ticket-closed-hover-border: #8398b5;
            --ticket-closed-active-border: #94abca;
            --ticket-closed-ring: rgba(173, 193, 216, 0.3);
            --ticket-closed-active-top: #3d4d63;
            --ticket-closed-active-bottom: #36455a;
            --ticket-closed-accent-top: #a9bad0;
            --ticket-closed-accent-bottom: #899fbc;
            --ticket-closed-subject: #f4f8ff;
            --ticket-closed-meta: #d6e1f2;
            --ticket-closed-pill-bg: #dbe7f8;
            --ticket-closed-pill-text: #1d314a;
            --ticket-closed-pill-border: #b8cae2;
            --ticket-ref-bg: rgba(229, 238, 250, 0.94);
            --ticket-ref-border: rgba(196, 210, 230, 0.96);
            --ticket-ref-text: #203650;
            --msg-user-bg: #2b3443;
            --msg-user-border: #425068;
            --composer-bg-top: #293241;
            --composer-bg-bottom: #242c39;
        }

        body.theme-light,
        body.theme-dim,
        body.theme-dark {
            background-color: var(--bg-body);
            color: var(--text-main);
        }

        body.theme-light .wrapper-admin,
        body.theme-dim .wrapper-admin,
        body.theme-dark .wrapper-admin {
            background: var(--bg-body);
        }

        body.theme-light .main-content,
        body.theme-dim .main-content,
        body.theme-dark .main-content {
            background: var(--bg-body);
        }

        body.theme-light .top-header,
        body.theme-dim .top-header,
        body.theme-dark .top-header {
            background: var(--header-bg);
            border-bottom-color: var(--border-color);
            backdrop-filter: blur(10px);
        }
        .top-header > h5 {
            font-size: 1.29rem;
            letter-spacing: -0.02em;
            line-height: 1.08;
        }
        @media (max-width: 1200px) {
            .top-header > h5 {
                font-size: 1.1rem;
            }
        }

        body.theme-light .sidebar,
        body.theme-dim .sidebar,
        body.theme-dark .sidebar {
            background: var(--sidebar-bg);
            border-right: 1px solid var(--sidebar-border);
        }
        body.theme-light .sidebar {
            box-shadow: 2px 0 12px rgba(15, 23, 42, 0.07);
        }
        body.theme-light .sidebar-link:hover,
        body.theme-dim .sidebar-link:hover,
        body.theme-dark .sidebar-link:hover {
            background-color: var(--sidebar-hover);
        }
        body.theme-light .sidebar-link.active,
        body.theme-dim .sidebar-link.active,
        body.theme-dark .sidebar-link.active {
            background-color: var(--sidebar-active-bg);
        }
        body.theme-light .sidebar-footer,
        body.theme-dim .sidebar-footer,
        body.theme-dark .sidebar-footer {
            border-top-color: var(--sidebar-footer-border);
            background: var(--sidebar-footer-bg);
        }

        body.theme-light .card,
        body.theme-dim .card,
        body.theme-dark .card,
        body.theme-light .kpi-card,
        body.theme-dim .kpi-card,
        body.theme-dark .kpi-card,
        body.theme-light .chat-shell,
        body.theme-dim .chat-shell,
        body.theme-dark .chat-shell {
            background: var(--surface-card) !important;
            border-color: var(--border-color) !important;
            color: var(--text-main);
            box-shadow: var(--shadow-soft);
        }

        body.theme-light .card-header,
        body.theme-dim .card-header,
        body.theme-dark .card-header,
        body.theme-light .card-footer,
        body.theme-dim .card-footer,
        body.theme-dark .card-footer {
            background: var(--surface-muted) !important;
            border-color: var(--border-color) !important;
            color: var(--text-main);
        }

        body.theme-light .bg-white,
        body.theme-dim .bg-white,
        body.theme-dark .bg-white,
        body.theme-light .bg-light,
        body.theme-dim .bg-light,
        body.theme-dark .bg-light {
            background-color: var(--surface-card) !important;
            color: var(--text-main) !important;
            border-color: var(--border-color) !important;
        }

        body.theme-light .text-muted,
        body.theme-dim .text-muted,
        body.theme-dark .text-muted,
        body.theme-light .form-text,
        body.theme-dim .form-text,
        body.theme-dark .form-text {
            color: var(--text-muted) !important;
        }

        body.theme-light .form-control,
        body.theme-dim .form-control,
        body.theme-dark .form-control,
        body.theme-light .form-select,
        body.theme-dim .form-select,
        body.theme-dark .form-select,
        body.theme-light .input-group-text,
        body.theme-dim .input-group-text,
        body.theme-dark .input-group-text {
            background-color: var(--input-bg);
            border-color: var(--border-color);
            color: var(--text-main);
        }
        body.theme-light .form-control::placeholder,
        body.theme-dim .form-control::placeholder,
        body.theme-dark .form-control::placeholder {
            color: var(--text-muted);
        }
        body.theme-light .form-control:focus,
        body.theme-dim .form-control:focus,
        body.theme-dark .form-control:focus,
        body.theme-light .form-select:focus,
        body.theme-dim .form-select:focus,
        body.theme-dark .form-select:focus {
            border-color: #63d295;
            box-shadow: 0 0 0 0.22rem rgba(80, 200, 120, 0.25);
        }

        body.theme-light .btn,
        body.theme-dim .btn,
        body.theme-dark .btn {
            transition: all .18s ease;
        }
        body.theme-light .btn:hover,
        body.theme-dim .btn:hover,
        body.theme-dark .btn:hover {
            transform: translateY(-1px);
        }
        body.theme-light .btn:focus-visible,
        body.theme-dim .btn:focus-visible,
        body.theme-dark .btn:focus-visible {
            outline: 2px solid rgba(80, 200, 120, 0.85);
            outline-offset: 1px;
        }
        body.theme-light .sidebar-footer .btn-outline-light {
            color: #1e3552;
            border-color: #9db0c8;
            background: rgba(255, 255, 255, 0.62);
            font-weight: 700;
        }
        body.theme-light .sidebar-footer .btn-outline-light:hover {
            color: #0f2843;
            border-color: #7f97b5;
            background: rgba(255, 255, 255, 0.9);
        }
        body.theme-light .sidebar-footer .btn-outline-light i {
            color: #2f4d70;
        }
        body.theme-dim .btn-outline-primary,
        body.theme-dark .btn-outline-primary,
        body.theme-dim .btn-outline-secondary,
        body.theme-dark .btn-outline-secondary,
        body.theme-dim .btn-outline-danger,
        body.theme-dark .btn-outline-danger,
        body.theme-dim .btn-outline-success,
        body.theme-dark .btn-outline-success {
            background-color: transparent;
            border-color: var(--border-color);
            color: var(--text-main);
        }
        body.theme-dim .btn-outline-dark,
        body.theme-dark .btn-outline-dark {
            color: #cfd9e8;
            border-color: #5a6781;
            background: rgba(255, 255, 255, 0.03);
        }
        body.theme-dim .btn-outline-dark:hover,
        body.theme-dark .btn-outline-dark:hover {
            color: #f7fbff;
            border-color: #7f90af;
            background: rgba(255, 255, 255, 0.08);
        }
        body.theme-dim .btn-outline-dark.active,
        body.theme-dark .btn-outline-dark.active,
        body.theme-dim .btn-outline-dark:active,
        body.theme-dark .btn-outline-dark:active {
            color: #f8fbff;
            border-color: #86b4ff;
            background: linear-gradient(180deg, #3a4e70 0%, #30425f 100%);
        }

        body.theme-light .event-selector,
        body.theme-dim .event-selector,
        body.theme-dark .event-selector,
        body.theme-light .context-pill,
        body.theme-dim .context-pill,
        body.theme-dark .context-pill,
        body.theme-light .theme-toggle-btn,
        body.theme-dim .theme-toggle-btn,
        body.theme-dark .theme-toggle-btn {
            background: var(--surface-muted);
            border-color: var(--border-color);
            color: var(--text-main);
        }
        body.theme-light .theme-toggle-btn:hover,
        body.theme-dim .theme-toggle-btn:hover,
        body.theme-dark .theme-toggle-btn:hover {
            border-color: #8ec7aa;
            box-shadow: 0 6px 14px rgba(16, 185, 129, 0.16);
        }
        body.theme-light .theme-toggle-btn i,
        body.theme-dim .theme-toggle-btn i,
        body.theme-dark .theme-toggle-btn i {
            color: inherit;
            transition: color .2s ease, text-shadow .2s ease;
        }
        body.theme-light .theme-toggle-btn {
            background: linear-gradient(180deg, #ffffff 0%, #f1f5fa 100%);
            border-color: #d5dee9;
            color: #0f172a;
        }
        body.theme-dim .theme-toggle-btn {
            background: linear-gradient(180deg, #3a4558 0%, #323d50 100%);
            border-color: #56647b;
            color: #eef3fc;
        }
        body.theme-dark .theme-toggle-btn {
            background: linear-gradient(180deg, #323d51 0%, #273244 100%);
            border-color: #5f7090;
            color: #f7fbff;
            box-shadow: 0 8px 18px rgba(7, 12, 22, 0.45);
        }
        body.theme-dark .theme-toggle-btn i {
            color: #f8fbff;
            text-shadow: 0 0 8px rgba(187, 211, 255, 0.48);
        }

        body.theme-light .table,
        body.theme-dim .table,
        body.theme-dark .table {
            --bs-table-bg: var(--surface-card);
            --bs-table-color: var(--text-main);
            --bs-table-border-color: var(--border-color);
            --bs-table-striped-bg: var(--surface-muted);
            --bs-table-striped-color: var(--text-main);
            --bs-table-hover-bg: var(--table-hover-bg);
            --bs-table-hover-color: var(--text-main);
            color: var(--text-main);
            border-color: var(--border-color);
        }
        body.theme-light .table-custom th,
        body.theme-dim .table-custom th,
        body.theme-dark .table-custom th {
            background: var(--surface-muted) !important;
            color: var(--text-muted) !important;
            border-bottom-color: var(--border-color) !important;
        }
        body.theme-light .table-custom td,
        body.theme-dim .table-custom td,
        body.theme-dark .table-custom td {
            background: var(--surface-card) !important;
            color: var(--text-main) !important;
            border-bottom-color: var(--border-color) !important;
        }
        body.theme-light .table-responsive,
        body.theme-dim .table-responsive,
        body.theme-dark .table-responsive {
            background: var(--surface-card);
        }

        body.theme-light .dropdown-menu,
        body.theme-dim .dropdown-menu,
        body.theme-dark .dropdown-menu,
        body.theme-light .modal-content,
        body.theme-dim .modal-content,
        body.theme-dark .modal-content {
            background: var(--surface-card);
            border-color: var(--border-color);
            color: var(--text-main);
            box-shadow: var(--shadow-hard);
        }
        body.theme-light .dropdown-item,
        body.theme-dim .dropdown-item,
        body.theme-dark .dropdown-item {
            color: var(--text-main);
        }
        body.theme-light .dropdown-item:hover,
        body.theme-dim .dropdown-item:hover,
        body.theme-dark .dropdown-item:hover {
            background: var(--surface-muted);
            color: var(--text-main);
        }
        body.theme-light .modal-header,
        body.theme-dim .modal-header,
        body.theme-dark .modal-header,
        body.theme-light .modal-footer,
        body.theme-dim .modal-footer,
        body.theme-dark .modal-footer {
            background: var(--surface-muted);
            border-color: var(--border-color);
            color: var(--text-main);
        }

        body.theme-light .ticket-list,
        body.theme-dim .ticket-list,
        body.theme-dark .ticket-list {
            background: linear-gradient(180deg, var(--inbox-top) 0%, var(--inbox-bottom) 100%);
        }
        body.theme-light .ticket-item,
        body.theme-dim .ticket-item,
        body.theme-dark .ticket-item {
            background: var(--surface-card);
            border-color: var(--border-color);
            color: var(--text-main);
            box-shadow: var(--shadow-soft);
        }
        body.theme-light .ticket-item .ticket-subject,
        body.theme-dim .ticket-item .ticket-subject,
        body.theme-dark .ticket-item .ticket-subject {
            color: var(--text-main);
            text-shadow: none;
        }
        body.theme-dim .ticket-item:not(.active),
        body.theme-dark .ticket-item:not(.active) {
            background: linear-gradient(180deg, rgba(45, 56, 73, 0.96) 0%, rgba(41, 51, 66, 0.95) 100%);
            border-color: #5e6d84;
            box-shadow: 0 8px 18px rgba(5, 11, 20, 0.24);
        }
        body.theme-dim .ticket-item:not(.active) .ticket-subject,
        body.theme-dark .ticket-item:not(.active) .ticket-subject {
            color: #eaf1ff;
            text-shadow: none;
            font-weight: 700;
        }
        body.theme-dim .ticket-item:not(.active) .ticket-contact,
        body.theme-dark .ticket-item:not(.active) .ticket-contact {
            color: #d2dced;
        }
        body.theme-dim .ticket-item:not(.active) .ticket-meta,
        body.theme-dark .ticket-item:not(.active) .ticket-meta,
        body.theme-dim .ticket-item:not(.active) .ticket-owner,
        body.theme-dark .ticket-item:not(.active) .ticket-owner {
            color: #c2cfe3;
        }
        body.theme-dim .ticket-item:not(.active) .badge.bg-dark-subtle.text-dark.border,
        body.theme-dark .ticket-item:not(.active) .badge.bg-dark-subtle.text-dark.border {
            background: rgba(235, 242, 255, 0.92) !important;
            border-color: rgba(176, 191, 215, 0.9) !important;
            color: #15263d !important;
        }
        body.theme-light .ticket-pill--priority-critical,
        body.theme-dim .ticket-pill--priority-critical,
        body.theme-dark .ticket-pill--priority-critical,
        body.theme-light .ticket-pill--state-critical,
        body.theme-dim .ticket-pill--state-critical,
        body.theme-dark .ticket-pill--state-critical {
            background: #fecaca;
            color: #7f1d1d;
            border-color: #fca5a5;
        }
        body.theme-light .ticket-pill--priority-high,
        body.theme-dim .ticket-pill--priority-high,
        body.theme-dark .ticket-pill--priority-high {
            background: #fde68a;
            color: #7c2d12;
            border-color: #facc15;
        }
        body.theme-light .ticket-pill--priority-normal,
        body.theme-dim .ticket-pill--priority-normal,
        body.theme-dark .ticket-pill--priority-normal {
            background: #bbf7d0;
            color: #14532d;
            border-color: #4ade80;
        }
        body.theme-light .ticket-pill--priority-low,
        body.theme-dim .ticket-pill--priority-low,
        body.theme-dark .ticket-pill--priority-low {
            background: #dbe4ef;
            color: #334155;
            border-color: #b8c6d8;
        }
        body.theme-light .ticket-pill--state-new,
        body.theme-dim .ticket-pill--state-new,
        body.theme-dark .ticket-pill--state-new {
            background: #fed7aa;
            color: #9a3412;
            border-color: #fdba74;
        }
        body.theme-light .ticket-pill--state-attention,
        body.theme-dim .ticket-pill--state-attention,
        body.theme-dark .ticket-pill--state-attention {
            background: #bfdbfe;
            color: #1e3a8a;
            border-color: #93c5fd;
        }
        body.theme-light .ticket-pill--state-followup,
        body.theme-dim .ticket-pill--state-followup,
        body.theme-dark .ticket-pill--state-followup {
            background: #ccfbf1;
            color: #115e59;
            border-color: #5eead4;
        }
        body.theme-light .ticket-pill--state-closed,
        body.theme-dim .ticket-pill--state-closed,
        body.theme-dark .ticket-pill--state-closed {
            background: var(--ticket-closed-pill-bg);
            color: var(--ticket-closed-pill-text);
            border-color: var(--ticket-closed-pill-border);
        }
        body.theme-light .ticket-item.ticket-closed,
        body.theme-dim .ticket-item.ticket-closed,
        body.theme-dark .ticket-item.ticket-closed {
            background: linear-gradient(180deg, var(--ticket-closed-top) 0%, var(--ticket-closed-bottom) 100%);
            border-color: var(--ticket-closed-border);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 10px 18px rgba(15, 23, 42, 0.14);
        }
        body.theme-light .ticket-item.ticket-closed .ticket-subject,
        body.theme-dim .ticket-item.ticket-closed .ticket-subject,
        body.theme-dark .ticket-item.ticket-closed .ticket-subject {
            color: var(--ticket-closed-subject) !important;
            text-shadow: none;
            font-weight: 700;
        }
        body.theme-light .ticket-item.ticket-closed .ticket-contact,
        body.theme-dim .ticket-item.ticket-closed .ticket-contact,
        body.theme-dark .ticket-item.ticket-closed .ticket-contact,
        body.theme-light .ticket-item.ticket-closed .ticket-meta,
        body.theme-dim .ticket-item.ticket-closed .ticket-meta,
        body.theme-dark .ticket-item.ticket-closed .ticket-meta,
        body.theme-light .ticket-item.ticket-closed .ticket-owner,
        body.theme-dim .ticket-item.ticket-closed .ticket-owner,
        body.theme-dark .ticket-item.ticket-closed .ticket-owner {
            color: var(--ticket-closed-meta) !important;
        }
        body.theme-light .ticket-item.ticket-closed .ticket-divider,
        body.theme-dim .ticket-item.ticket-closed .ticket-divider,
        body.theme-dark .ticket-item.ticket-closed .ticket-divider {
            background: var(--ticket-closed-border);
        }
        body.theme-light .ticket-item:hover,
        body.theme-dim .ticket-item:hover,
        body.theme-dark .ticket-item:hover {
            border-color: #66d29a;
            box-shadow: var(--shadow-hard);
        }
        body.theme-light .ticket-item.active,
        body.theme-dim .ticket-item.active,
        body.theme-dark .ticket-item.active {
            background: linear-gradient(180deg, var(--ticket-active-top) 0%, var(--ticket-active-bottom) 100%);
            border-color: #34d399;
            box-shadow: 0 0 0 2px rgba(16,185,129,.24), var(--shadow-hard);
        }
        body.theme-light .ticket-item.ticket-closed.active,
        body.theme-dim .ticket-item.ticket-closed.active,
        body.theme-dark .ticket-item.ticket-closed.active {
            background: linear-gradient(180deg, var(--ticket-closed-active-top) 0%, var(--ticket-closed-active-bottom) 100%);
            border-color: var(--ticket-closed-active-border);
            box-shadow: 0 0 0 2px var(--ticket-closed-ring), var(--shadow-hard);
        }
        body.theme-light .ticket-item.ticket-closed.active::before,
        body.theme-dim .ticket-item.ticket-closed.active::before,
        body.theme-dark .ticket-item.ticket-closed.active::before {
            background: linear-gradient(180deg, var(--ticket-closed-accent-top) 0%, var(--ticket-closed-accent-bottom) 100%);
        }
        body.theme-dim .ticket-item.active .ticket-subject,
        body.theme-dark .ticket-item.active .ticket-subject {
            color: #d6fbe8;
        }
        body.theme-dim .ticket-item.active .ticket-contact,
        body.theme-dark .ticket-item.active .ticket-contact,
        body.theme-dim .ticket-item.active .ticket-owner,
        body.theme-dark .ticket-item.active .ticket-owner {
            color: #d3def0;
        }
        body.theme-light .ticket-divider,
        body.theme-dim .ticket-divider,
        body.theme-dark .ticket-divider {
            background: var(--border-color);
        }
        body.theme-light .ticket-contact,
        body.theme-dim .ticket-contact,
        body.theme-dark .ticket-contact,
        body.theme-light .ticket-meta,
        body.theme-dim .ticket-meta,
        body.theme-dark .ticket-meta,
        body.theme-light .ticket-owner,
        body.theme-dim .ticket-owner,
        body.theme-dark .ticket-owner {
            color: var(--text-muted);
        }

        body.theme-light .chat-topbar,
        body.theme-dim .chat-topbar,
        body.theme-dark .chat-topbar {
            background: linear-gradient(180deg, var(--surface-card) 0%, var(--surface-muted) 100%);
            border-bottom-color: var(--border-color);
        }
        body.theme-light .chat-area,
        body.theme-dim .chat-area,
        body.theme-dark .chat-area {
            background: linear-gradient(180deg, var(--surface-muted) 0%, var(--bg-body) 100%);
        }
        body.theme-light .msg-user,
        body.theme-dim .msg-user,
        body.theme-dark .msg-user {
            background: var(--msg-user-bg);
            border-color: var(--msg-user-border);
            color: var(--text-main);
        }
        body.theme-dim .msg-user .msg-meta,
        body.theme-dark .msg-user .msg-meta {
            color: var(--text-muted);
        }
        body.theme-light .chat-composer,
        body.theme-dim .chat-composer,
        body.theme-dark .chat-composer {
            background: linear-gradient(180deg, var(--composer-bg-top) 0%, var(--composer-bg-bottom) 100%);
            border-top-color: var(--border-color);
        }
        body.theme-light .inbox-progress-card,
        body.theme-dim .inbox-progress-card,
        body.theme-dark .inbox-progress-card {
            background: var(--surface-card);
            border-color: var(--border-color);
            color: var(--text-main);
        }
        body.theme-dim .no-ticket-state,
        body.theme-dark .no-ticket-state {
            background: linear-gradient(180deg, rgba(40, 50, 65, 0.92) 0%, rgba(33, 41, 54, 0.9) 100%);
            border-color: var(--border-color);
            box-shadow: var(--shadow-hard);
        }
        body.theme-dim .no-ticket-state .icon-wrap,
        body.theme-dark .no-ticket-state .icon-wrap {
            background: radial-gradient(circle at 30% 30%, #32435f 0%, #273448 100%);
            border-color: #495c79;
            color: #8fb3ff;
        }
        body.theme-dim .ticket-list::-webkit-scrollbar-thumb,
        body.theme-dark .ticket-list::-webkit-scrollbar-thumb,
        body.theme-dim .chat-area::-webkit-scrollbar-thumb,
        body.theme-dark .chat-area::-webkit-scrollbar-thumb {
            background: rgba(159, 176, 204, 0.35);
            border-color: transparent;
        }
        body.theme-dim .member-list,
        body.theme-dark .member-list {
            background: var(--surface-muted);
            border-left-color: #34d399;
            color: var(--text-main);
            box-shadow: inset 0 0 0 1px rgba(101, 116, 145, 0.28);
        }
        body.theme-dim .member-row,
        body.theme-dark .member-row {
            border-bottom-color: var(--border-color);
        }
        body.theme-dim .member-list .text-muted,
        body.theme-dark .member-list .text-muted {
            color: #b9c6db !important;
        }
        body.theme-dim .member-row .btn-light,
        body.theme-dark .member-row .btn-light {
            background: #2f3848;
            color: #e3ebf9;
            border-color: #566683;
        }
        body.theme-dim .member-row .btn-light:hover,
        body.theme-dark .member-row .btn-light:hover {
            background: #3a4558;
            color: #ffffff;
        }
        body.theme-dim .algo-section,
        body.theme-dark .algo-section {
            background: var(--surface-muted);
            border-color: var(--border-color);
        }
        body.theme-dim .algo-publish-panel,
        body.theme-dark .algo-publish-panel {
            background: linear-gradient(180deg, #2b3342 0%, #273040 100%);
            border-color: var(--border-color);
            box-shadow: 0 12px 24px rgba(3, 8, 16, 0.3);
        }

        body.theme-dim .msg-admin .read-receipt.read-sent,
        body.theme-dark .msg-admin .read-receipt.read-sent {
            color: #eef4ff;
            background: rgba(255, 255, 255, 0.18);
            border-color: rgba(255, 255, 255, 0.35);
        }
        body.theme-dim .msg-admin .read-receipt.read-seen,
        body.theme-dark .msg-admin .read-receipt.read-seen {
            color: #dcfce7;
            background: rgba(34, 197, 94, 0.24);
            border-color: rgba(167, 243, 208, 0.78);
        }

        body.theme-dim .search-highlight,
        body.theme-dark .search-highlight {
            background-color: #6b4f1d;
            color: #fff2cc;
        }
/* BACKOFFICE_INLINE_CSS_END */


/* BALLOT_PAGE_INLINE_MIGRATION_START */

/* AcessoNegado.aspx */
body.page-acesso-negado {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-body);
}
body.page-acesso-negado .error-card {
    max-width: 550px;
    padding: 3rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: var(--surface-card);
    text-align: center;
}
body.page-acesso-negado .icon-lock-container {
    width: 80px;
    height: 80px;
    background-color: #fef2f2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
}
body.page-acesso-negado .icon-lock {
    font-size: 2.5rem;
    color: #dc2626;
}
body.page-acesso-negado.dark-mode .icon-lock-container {
    background-color: rgba(220, 38, 38, 0.2);
}

/* Candidatura.aspx */
body.page-candidatura .passport-error-msg {
    color: #dc3545;
    font-size: 0.75rem;
    font-weight: 600;
    display: none;
    margin-top: 4px;
}
body.page-candidatura .is-invalid-passport {
    border-color: #dc3545 !important;
}
body.page-candidatura .fi {
    border-radius: 2px;
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.2);
}
body.page-candidatura .lang-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 85px;
    justify-content: center;
}
body.page-candidatura .validation-error {
    font-size: 0.75rem;
    color: #dc3545;
    font-weight: 600;
    display: block;
    margin-top: 2px;
}
@keyframes ballot-pulse-success {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.7); }
    70% { transform: scale(1.3); box-shadow: 0 0 0 10px rgba(25, 135, 84, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(25, 135, 84, 0); }
}
body.page-candidatura .pulse-success {
    animation: ballot-pulse-success 0.8s ease-out;
    border-color: #198754 !important;
    background-color: #198754 !important;
}
body.page-candidatura .custom-check:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(100%);
}
body.page-candidatura .term-icon-reg,
body.page-candidatura .term-icon-priv {
    transition: all 0.3s ease;
}
body.page-candidatura .terms-link {
    text-decoration: none;
    font-weight: 600;
}
body.page-candidatura .terms-link:hover {
    text-decoration: underline;
}
@keyframes ballot-bounce-down {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}
body.page-candidatura .scroll-helper-icon {
    animation: ballot-bounce-down 1.5s infinite;
}
body.page-candidatura .scroll-helper-text {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
body.page-candidatura .terms-consent-invalid {
    border: 1px solid rgba(220, 53, 69, 0.35);
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(220, 53, 69, 0.04);
}
body.page-candidatura #addBtnContainer {
    margin-top: 0.35rem;
    margin-bottom: 1.15rem !important;
}
body.page-candidatura #addBtnContainer .btn-outline-custom {
    border: 1px dashed #b9c8db;
    border-radius: 14px;
    min-height: 70px;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: #4f6788;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(245, 250, 255, 0.72) 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}
body.page-candidatura #addBtnContainer .btn-outline-custom i {
    margin-right: 0 !important;
}
body.page-candidatura #addBtnContainer .btn-outline-custom:hover {
    border-color: #7fd89c;
    color: #1b2f4b;
    background: linear-gradient(180deg, rgba(233, 252, 240, 0.95) 0%, rgba(224, 248, 232, 0.95) 100%);
    transform: translateY(-1px);
}
body.page-candidatura #addBtnContainer .btn-outline-custom.is-disabled,
body.page-candidatura #addBtnContainer .btn-outline-custom:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: saturate(0.7);
    transform: none !important;
}
body.page-candidatura .consent-submit-card {
    border: 1px solid var(--border-color) !important;
    border-radius: 18px;
    padding: 16px 16px 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(249, 252, 255, 0.93) 100%) !important;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
}
body.page-candidatura #termsConsentBlock {
    margin-bottom: 12px !important;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(248, 251, 255, 0.82);
    gap: 8px;
    flex-wrap: wrap;
}
body.page-candidatura #termsConsentText {
    font-size: 1.06rem;
    line-height: 1.45;
    color: #4a5c76;
}
body.page-candidatura #termsConsentBlock .custom-check {
    width: 1.18rem;
    height: 1.18rem;
    margin-top: 0.12rem;
    margin-left: 0 !important;
    position: relative;
    flex: 0 0 auto;
    align-self: flex-start;
    border-radius: 0.38rem;
    border-color: #b6c4d8;
}
body.page-candidatura #termsConsentBlock .custom-check:checked {
    background-color: #50c878;
    border-color: #39b163;
}
body.page-candidatura #termsConsentBlock .terms-link {
    color: #203453;
    font-weight: 800;
}
body.page-candidatura #termsConsentBlock .terms-link:hover {
    color: #1f7a48;
    text-decoration: none;
}
body.page-candidatura .submit-cta-wrap {
    margin-top: 2px;
}
body.page-candidatura .btn-submit-final {
    min-width: min(100%, 430px);
    min-height: 58px;
    border-radius: 12px;
    font-size: clamp(1.28rem, 2.4vw, 1.95rem);
    font-weight: 900;
    letter-spacing: 0.02em;
    box-shadow: 0 16px 28px rgba(35, 178, 100, 0.33) !important;
}
body.page-candidatura .btn-submit-final:hover {
    box-shadow: 0 20px 30px rgba(28, 161, 88, 0.36) !important;
}
body.page-candidatura .ballot-doc-dialog {
    max-width: min(1100px, calc(100vw - 1.2rem));
}
body.page-candidatura .ballot-doc-content {
    border: 1px solid rgba(191, 202, 219, 0.92);
    border-radius: 22px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(247, 251, 255, 0.99) 100%);
    box-shadow: 0 24px 52px rgba(15, 23, 42, 0.18);
    max-height: calc(100dvh - 1.2rem);
}
body.page-candidatura .ballot-doc-header {
    padding: 1rem 1.15rem 0.95rem;
    background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%) !important;
    border-bottom: 1px solid #e6edf6;
}
body.page-candidatura .ballot-doc-header .modal-title {
    color: #10213d !important;
    font-size: 1.08rem;
    letter-spacing: 0.03em;
}
body.page-candidatura .ballot-doc-body {
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(80, 200, 120, 0.07) 0%, rgba(80, 200, 120, 0) 28%),
        linear-gradient(180deg, rgba(251, 253, 255, 0.98) 0%, rgba(246, 250, 255, 0.98) 100%);
}
body.page-candidatura .ballot-doc-scroll {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100dvh - 11.5rem);
    min-height: min(62dvh, 640px);
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
    scroll-behavior: smooth;
}
body.page-candidatura .ballot-doc-shell {
    min-height: 100%;
    border: 1px solid rgba(209, 219, 232, 0.9);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
body.page-candidatura .ballot-doc-loading,
body.page-candidatura .ballot-doc-fallback {
    min-height: min(48dvh, 420px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    padding: 1.5rem;
    text-align: center;
}
body.page-candidatura .ballot-doc-loading {
    color: #4f6788;
    font-weight: 700;
}
body.page-candidatura .ballot-doc-loading i,
body.page-candidatura .ballot-doc-fallback-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #eef6ff 0%, #e3eefb 100%);
    border: 1px solid #cfdeef;
    color: #23446a;
    font-size: 1.2rem;
}
body.page-candidatura .ballot-doc-fallback h6 {
    margin: 0;
    color: #10213d;
    font-weight: 800;
}
body.page-candidatura .ballot-doc-fallback p {
    margin: 0;
    color: #5b6f8d;
    max-width: 42rem;
}
body.page-candidatura .ballot-doc-footer {
    padding: 0.85rem 1rem calc(0.95rem + env(safe-area-inset-bottom));
    gap: 0.85rem;
    background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%) !important;
    border-top: 1px solid #e6edf6;
}
body.page-candidatura .ballot-doc-footer-actions {
    gap: 0.85rem;
}
body.page-candidatura .ballot-doc-shell .doc-wrap {
    max-width: none;
    margin: 0;
    padding: 1.15rem 1.15rem 1.3rem;
}
body.page-candidatura .ballot-doc-shell .doc-title {
    border-bottom: 2px solid #e7edf5;
    padding-bottom: 0.9rem;
    margin-bottom: 0.9rem;
}
body.page-candidatura .ballot-doc-shell .doc-title h1 {
    font-size: clamp(1.45rem, 1.1rem + 1vw, 2rem);
    margin: 0;
    color: #10213d;
}
body.page-candidatura .ballot-doc-shell .doc-title .subtitle,
body.page-candidatura .ballot-doc-shell .pill {
    color: #637992;
}
body.page-candidatura .ballot-doc-shell .section {
    padding: 0.8rem 0;
    border-bottom: 1px solid #edf2f8;
}
body.page-candidatura .ballot-doc-shell .section:last-child {
    border-bottom: 0;
}
body.page-candidatura .ballot-doc-shell .section h2 {
    margin: 0 0 0.45rem;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #203453;
}
body.page-candidatura .ballot-doc-shell .section p,
body.page-candidatura .ballot-doc-shell .section li {
    color: #24364f;
    font-size: 0.96rem;
    line-height: 1.62;
}
body.page-candidatura .ballot-doc-shell .section ul,
body.page-candidatura .ballot-doc-shell .section ol {
    margin-bottom: 0;
    padding-left: 1.1rem;
}
body.page-candidatura .ballot-doc-end-marker {
    display: block;
    width: 100%;
    height: 1px;
}
body.page-candidatura.theme-dark #addBtnContainer .btn-outline-custom {
    border-color: #50617a;
    color: #bed0ea;
    background: linear-gradient(180deg, rgba(39, 52, 70, 0.84) 0%, rgba(34, 47, 64, 0.88) 100%);
    box-shadow: inset 0 0 0 1px rgba(99, 120, 148, 0.28);
}
body.page-candidatura.theme-dark #addBtnContainer .btn-outline-custom:hover {
    border-color: #66d28a;
    color: #ecf5ff;
    background: linear-gradient(180deg, rgba(49, 68, 91, 0.92) 0%, rgba(41, 58, 80, 0.94) 100%);
}
body.page-candidatura.theme-dark .consent-submit-card {
    border-color: #4f6179 !important;
    background: linear-gradient(180deg, rgba(35, 46, 62, 0.92) 0%, rgba(30, 40, 55, 0.94) 100%) !important;
    box-shadow: 0 18px 34px rgba(2, 8, 20, 0.42);
}
body.page-candidatura.theme-dark #termsConsentBlock {
    border-color: #4d5f78;
    background: rgba(34, 46, 62, 0.8);
}
body.page-candidatura.theme-dark #termsConsentText {
    color: #c7d6ea;
}
body.page-candidatura.theme-dark #termsConsentBlock .custom-check {
    border-color: #7186a4;
    background-color: #27384f;
}
body.page-candidatura.theme-dark #termsConsentBlock .terms-link {
    color: #eef5ff;
}
body.page-candidatura.theme-dark #termsConsentBlock .terms-link:hover {
    color: #7ee2a3;
}
body.page-candidatura.theme-dark .ballot-doc-content,
body.page-candidatura.theme-dim .ballot-doc-content {
    border-color: #50617a;
    background: linear-gradient(180deg, rgba(39, 50, 67, 0.98) 0%, rgba(31, 42, 57, 0.99) 100%);
    box-shadow: 0 28px 56px rgba(2, 8, 20, 0.5);
}
body.page-candidatura.theme-dark .ballot-doc-header,
body.page-candidatura.theme-dim .ballot-doc-header,
body.page-candidatura.theme-dark .ballot-doc-footer,
body.page-candidatura.theme-dim .ballot-doc-footer {
    background: linear-gradient(180deg, rgba(42, 54, 73, 0.98) 0%, rgba(36, 47, 65, 0.98) 100%) !important;
    border-color: rgba(129, 147, 172, 0.24);
}
body.page-candidatura.theme-dark .ballot-doc-header .modal-title,
body.page-candidatura.theme-dim .ballot-doc-header .modal-title {
    color: #eef4ff !important;
}
body.page-candidatura.theme-dark .ballot-doc-body,
body.page-candidatura.theme-dim .ballot-doc-body {
    background:
        radial-gradient(circle at top right, rgba(80, 200, 120, 0.12) 0%, rgba(80, 200, 120, 0) 30%),
        linear-gradient(180deg, rgba(33, 44, 60, 0.98) 0%, rgba(29, 39, 54, 0.99) 100%);
}
body.page-candidatura.theme-dark .ballot-doc-shell,
body.page-candidatura.theme-dim .ballot-doc-shell {
    border-color: rgba(120, 140, 166, 0.36);
    background: linear-gradient(180deg, rgba(25, 35, 49, 0.96) 0%, rgba(20, 29, 41, 0.98) 100%);
    box-shadow: inset 0 1px 0 rgba(120, 140, 166, 0.08);
}
body.page-candidatura.theme-dark .ballot-doc-loading,
body.page-candidatura.theme-dim .ballot-doc-loading,
body.page-candidatura.theme-dark .ballot-doc-fallback h6,
body.page-candidatura.theme-dim .ballot-doc-fallback h6,
body.page-candidatura.theme-dark .ballot-doc-shell .doc-title h1,
body.page-candidatura.theme-dim .ballot-doc-shell .doc-title h1,
body.page-candidatura.theme-dark .ballot-doc-shell .section h2,
body.page-candidatura.theme-dim .ballot-doc-shell .section h2,
body.page-candidatura.theme-dark .ballot-doc-shell .section p,
body.page-candidatura.theme-dim .ballot-doc-shell .section p,
body.page-candidatura.theme-dark .ballot-doc-shell .section li,
body.page-candidatura.theme-dim .ballot-doc-shell .section li {
    color: #e8f1ff;
}
body.page-candidatura.theme-dark .ballot-doc-fallback p,
body.page-candidatura.theme-dim .ballot-doc-fallback p,
body.page-candidatura.theme-dark .ballot-doc-shell .doc-title .subtitle,
body.page-candidatura.theme-dim .ballot-doc-shell .doc-title .subtitle,
body.page-candidatura.theme-dark .ballot-doc-shell .pill,
body.page-candidatura.theme-dim .ballot-doc-shell .pill {
    color: #b9c9de;
}
body.page-candidatura.theme-dark .ballot-doc-loading i,
body.page-candidatura.theme-dim .ballot-doc-loading i,
body.page-candidatura.theme-dark .ballot-doc-fallback-icon,
body.page-candidatura.theme-dim .ballot-doc-fallback-icon {
    background: linear-gradient(180deg, rgba(44, 69, 101, 0.95) 0%, rgba(36, 58, 87, 0.95) 100%);
    border-color: rgba(97, 126, 164, 0.75);
    color: #dce9fb;
}
body.page-candidatura.theme-dark .ballot-doc-shell .doc-title,
body.page-candidatura.theme-dim .ballot-doc-shell .doc-title,
body.page-candidatura.theme-dark .ballot-doc-shell .section,
body.page-candidatura.theme-dim .ballot-doc-shell .section {
    border-color: rgba(120, 140, 166, 0.22);
}
@media (max-width: 767.98px) {
    body.page-candidatura #addBtnContainer .btn-outline-custom {
        min-height: 58px;
        font-size: 1.55rem;
    }
    body.page-candidatura .consent-submit-card {
        border-radius: 14px;
        padding: 12px 10px 10px;
    }
    body.page-candidatura #termsConsentBlock {
        display: flex;
        justify-content: flex-start !important;
        align-items: flex-start !important;
        padding: 12px 12px;
        gap: 10px;
    }
    body.page-candidatura #termsConsentBlock .custom-check {
        width: 1.24rem;
        height: 1.24rem;
        margin-top: 0.18rem;
    }
    body.page-candidatura #termsConsentText {
        display: inline-block;
        width: calc(100% - 1.8rem);
    }
    body.page-candidatura #termsConsentText {
        font-size: 1rem;
        line-height: 1.48;
    }
    body.page-candidatura .btn-submit-final {
        width: 100%;
        min-width: 100%;
        min-height: 50px;
        font-size: 1.1rem;
    }
    body.page-candidatura .ballot-doc-dialog {
        margin: 0.35rem;
        max-width: none;
    }
    body.page-candidatura .ballot-doc-content {
        border-radius: 18px;
        max-height: calc(100dvh - 0.7rem);
    }
    body.page-candidatura .ballot-doc-header {
        padding: 0.9rem 0.95rem 0.8rem;
    }
    body.page-candidatura .ballot-doc-header .modal-title {
        font-size: 0.98rem;
        line-height: 1.05;
    }
    body.page-candidatura .ballot-doc-scroll {
        max-height: calc(100dvh - 10.8rem);
        min-height: calc(100dvh - 12.3rem);
        padding: 0.75rem 0.75rem calc(0.9rem + env(safe-area-inset-bottom));
    }
    body.page-candidatura .ballot-doc-shell .doc-wrap {
        padding: 0.95rem 0.9rem 1.05rem;
    }
    body.page-candidatura .ballot-doc-shell .section p,
    body.page-candidatura .ballot-doc-shell .section li {
        font-size: 0.92rem;
        line-height: 1.56;
    }
    body.page-candidatura .ballot-doc-footer {
        padding: 0.7rem 0.75rem calc(0.8rem + env(safe-area-inset-bottom));
        align-items: stretch !important;
        flex-direction: column;
    }
    body.page-candidatura .ballot-doc-footer > .btn,
    body.page-candidatura .ballot-doc-footer-actions {
        width: 100%;
    }
    body.page-candidatura .ballot-doc-footer-actions {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.6rem;
    }
    body.page-candidatura .ballot-doc-footer-actions .scroll-helper-text {
        margin-right: 0 !important;
        text-align: left;
    }
    body.page-candidatura .ballot-doc-footer-actions .btn {
        width: 100%;
        min-height: 48px;
    }
}
body.page-candidatura .ballot-feedback-host {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 2055;
    width: min(92vw, 420px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

body.page-candidatura .ballot-contact-dialog,
body.page-gestao .ballot-contact-dialog {
    max-width: 640px;
}

body.page-candidatura .ballot-confirm-dialog {
    max-width: 560px;
}

body.page-candidatura .ballot-confirm-content {
    border: 1px solid rgba(191, 202, 219, 0.9);
    border-radius: 22px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(246, 250, 255, 0.99) 100%);
    box-shadow: 0 24px 52px rgba(15, 23, 42, 0.18);
}

body.page-candidatura .ballot-confirm-header {
    padding: 1rem 1.2rem 0.35rem;
    background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%) !important;
}

body.page-candidatura .ballot-confirm-header .modal-title {
    color: #10213d;
}

body.page-candidatura .ballot-confirm-body {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.25rem 0.9rem;
}

body.page-candidatura .ballot-confirm-icon {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #23446a;
    background: linear-gradient(180deg, #eef6ff 0%, #e4f0fb 100%);
    border: 1px solid #ccdef1;
}

body.page-candidatura .ballot-confirm-message {
    color: #23344f;
    font-size: 1rem;
    line-height: 1.55;
    font-weight: 600;
}

body.page-candidatura .ballot-confirm-footer {
    padding: 0.4rem 1.25rem 1.2rem;
    gap: 0.75rem;
}

body.page-candidatura .ballot-confirm-accept {
    border-color: #182537;
    background: linear-gradient(180deg, #243247 0%, #182537 100%);
    box-shadow: 0 12px 24px rgba(16, 27, 45, 0.18);
}

body.page-candidatura .ballot-confirm-accept:hover {
    background: linear-gradient(180deg, #30415a 0%, #223146 100%);
    border-color: #223146;
}

body.page-candidatura.theme-dark .ballot-confirm-content,
body.page-candidatura.theme-dim .ballot-confirm-content {
    border-color: rgba(74, 92, 118, 0.88);
    background: linear-gradient(180deg, rgba(31, 41, 56, 0.98) 0%, rgba(26, 34, 48, 0.98) 100%);
    box-shadow: 0 24px 58px rgba(3, 10, 22, 0.42);
}

body.page-candidatura.theme-dark .ballot-confirm-header,
body.page-candidatura.theme-dim .ballot-confirm-header {
    background: linear-gradient(180deg, rgba(36, 47, 65, 0.98) 0%, rgba(29, 39, 54, 0.98) 100%) !important;
}

body.page-candidatura.theme-dark .ballot-confirm-header .modal-title,
body.page-candidatura.theme-dim .ballot-confirm-header .modal-title,
body.page-candidatura.theme-dark .ballot-confirm-message,
body.page-candidatura.theme-dim .ballot-confirm-message {
    color: #eef4ff;
}

body.page-candidatura.theme-dark .ballot-confirm-header .text-muted,
body.page-candidatura.theme-dim .ballot-confirm-header .text-muted {
    color: #9fb0c9 !important;
}

body.page-candidatura.theme-dark .ballot-confirm-icon,
body.page-candidatura.theme-dim .ballot-confirm-icon {
    color: #dce9fb;
    background: linear-gradient(180deg, rgba(44, 69, 101, 0.95) 0%, rgba(36, 58, 87, 0.95) 100%);
    border-color: rgba(97, 126, 164, 0.75);
}

body.page-candidatura .ballot-contact-content,
body.page-gestao .ballot-contact-content {
    border: 1px solid rgba(191, 202, 219, 0.9);
    border-radius: 22px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 251, 255, 0.98) 100%);
    box-shadow: 0 24px 52px rgba(15, 23, 42, 0.18);
}

body.page-candidatura .ballot-contact-header,
body.page-gestao .ballot-contact-header {
    padding: 1rem 1.2rem 0.95rem;
    background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%) !important;
    border-bottom: 1px solid #e6edf6;
}

body.page-candidatura .ballot-contact-header .modal-title,
body.page-gestao .ballot-contact-header .modal-title {
    color: #10213d !important;
    font-size: 1.08rem;
    letter-spacing: 0.03em;
}

body.page-candidatura .ballot-contact-body,
body.page-gestao .ballot-contact-body {
    padding: 1.2rem !important;
    background:
        radial-gradient(circle at top right, rgba(80, 200, 120, 0.08) 0%, rgba(80, 200, 120, 0) 32%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 252, 255, 0.98) 100%);
}

body.page-candidatura .ballot-contact-intro,
body.page-gestao .ballot-contact-intro {
    font-size: 0.98rem;
    line-height: 1.55;
    color: #5b6f8d !important;
    margin-bottom: 1rem !important;
}

body.page-candidatura .ballot-contact-validation,
body.page-gestao .ballot-contact-validation {
    border-radius: 12px;
    border: 1px solid #f3b7bf !important;
    background: linear-gradient(180deg, #fff1f3 0%, #ffe6ea 100%) !important;
    color: #a11f3d;
    padding: 0.8rem 0.9rem !important;
}

body.page-gestao .ballot-contact-summary {
    border-radius: 14px;
    border: 1px solid #d8e1ee !important;
    background: linear-gradient(180deg, #f8fbff 0%, #eff5fb 100%) !important;
    color: #35506f;
    padding: 0.85rem 0.95rem;
}

body.page-candidatura .ballot-contact-body .form-label,
body.page-gestao .ballot-contact-body .form-label {
    color: #5a7090 !important;
    letter-spacing: 0.05em;
    font-size: 0.72rem;
    margin-bottom: 0.45rem;
}

body.page-candidatura .ballot-contact-body .form-control,
body.page-candidatura .ballot-contact-body .form-select,
body.page-gestao .ballot-contact-body .form-control,
body.page-gestao .ballot-contact-body .form-select {
    min-height: 50px;
    border-radius: 12px;
    border-color: #c4cfde;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body.page-candidatura .ballot-contact-body textarea.form-control,
body.page-gestao .ballot-contact-body textarea.form-control {
    min-height: 140px;
    resize: vertical;
}

body.page-candidatura .ballot-contact-body .form-control:focus,
body.page-candidatura .ballot-contact-body .form-select:focus,
body.page-gestao .ballot-contact-body .form-control:focus,
body.page-gestao .ballot-contact-body .form-select:focus {
    border-color: #50c878;
    box-shadow: 0 0 0 4px rgba(80, 200, 120, 0.16);
}

body.page-candidatura .ballot-contact-body .btn-dark,
body.page-gestao .ballot-contact-body .btn-dark {
    min-height: 52px;
    border-radius: 14px;
    border: 1px solid #1d2734;
    background: linear-gradient(180deg, #1f2835 0%, #161d28 100%);
    box-shadow: 0 16px 28px rgba(10, 18, 31, 0.24);
    letter-spacing: 0.04em;
}

body.page-candidatura .ballot-contact-body .btn-dark:hover,
body.page-gestao .ballot-contact-body .btn-dark:hover {
    background: linear-gradient(180deg, #273344 0%, #1e2835 100%);
}

body.page-candidatura.theme-dark .ballot-contact-content,
body.page-gestao.theme-dark .ballot-contact-content {
    border-color: #50617a;
    background: linear-gradient(180deg, rgba(39, 50, 67, 0.97) 0%, rgba(31, 42, 57, 0.98) 100%);
    box-shadow: 0 28px 56px rgba(2, 8, 20, 0.5);
}

body.page-candidatura.theme-dark .ballot-contact-header,
body.page-gestao.theme-dark .ballot-contact-header {
    background: linear-gradient(180deg, rgba(42, 54, 73, 0.98) 0%, rgba(36, 47, 65, 0.98) 100%) !important;
    border-bottom-color: rgba(129, 147, 172, 0.24);
}

body.page-candidatura.theme-dark .ballot-contact-header .modal-title,
body.page-gestao.theme-dark .ballot-contact-header .modal-title {
    color: #eef4ff !important;
}

body.page-candidatura.theme-dark .ballot-contact-body,
body.page-gestao.theme-dark .ballot-contact-body {
    background:
        radial-gradient(circle at top right, rgba(80, 200, 120, 0.12) 0%, rgba(80, 200, 120, 0) 30%),
        linear-gradient(180deg, rgba(33, 44, 60, 0.98) 0%, rgba(29, 39, 54, 0.99) 100%);
}

body.page-candidatura.theme-dark .ballot-contact-intro,
body.page-gestao.theme-dark .ballot-contact-intro {
    color: #b9c9de !important;
}

body.page-candidatura.theme-dark .ballot-contact-validation,
body.page-gestao.theme-dark .ballot-contact-validation {
    border-color: rgba(214, 98, 120, 0.55) !important;
    background: linear-gradient(180deg, rgba(91, 28, 41, 0.58) 0%, rgba(74, 20, 33, 0.62) 100%) !important;
    color: #ffd5de;
}

body.page-gestao.theme-dark .ballot-contact-summary {
    border-color: rgba(120, 140, 166, 0.34) !important;
    background: linear-gradient(180deg, rgba(42, 55, 74, 0.82) 0%, rgba(35, 47, 64, 0.88) 100%) !important;
    color: #dce8f8;
}

body.page-candidatura.theme-dark .ballot-contact-body .form-label,
body.page-gestao.theme-dark .ballot-contact-body .form-label {
    color: #abc0dc !important;
}

body.page-candidatura.theme-dark .ballot-contact-body .form-control,
body.page-candidatura.theme-dark .ballot-contact-body .form-select,
body.page-gestao.theme-dark .ballot-contact-body .form-control,
body.page-gestao.theme-dark .ballot-contact-body .form-select {
    border-color: #617898;
    background: rgba(18, 27, 39, 0.72);
    color: #eef5ff;
}

body.page-candidatura.theme-dark .ballot-contact-body .btn-dark,
body.page-gestao.theme-dark .ballot-contact-body .btn-dark {
    border-color: #607896;
    background: linear-gradient(180deg, #334258 0%, #293649 100%);
}

@media (max-width: 767.98px) {
    body.page-candidatura .ballot-contact-dialog,
    body.page-gestao .ballot-contact-dialog {
        margin: 0.65rem;
        max-width: none;
    }

    body.page-candidatura .ballot-contact-content,
    body.page-gestao .ballot-contact-content {
        border-radius: 18px;
    }

    body.page-candidatura .ballot-contact-header,
    body.page-gestao .ballot-contact-header {
        padding: 0.9rem 0.95rem 0.85rem;
    }

    body.page-candidatura .ballot-contact-body,
    body.page-gestao .ballot-contact-body {
        padding: 1rem 0.95rem !important;
    }

    body.page-candidatura .ballot-contact-body .btn-dark,
    body.page-gestao .ballot-contact-body .btn-dark {
        min-height: 50px;
    }
}
body.page-candidatura .ballot-feedback-toast {
    pointer-events: auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: start;
    border-radius: 12px;
    padding: 12px 12px;
    border: 1px solid #d9e3ef;
    background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.16);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .18s ease, transform .18s ease;
}
body.page-candidatura .ballot-feedback-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}
body.page-candidatura .ballot-feedback-toast.is-hiding {
    opacity: 0;
    transform: translateY(-6px);
}
body.page-candidatura .ballot-feedback-toast .feedback-icon {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}
body.page-candidatura .ballot-feedback-toast .feedback-content {
    min-width: 0;
}
body.page-candidatura .ballot-feedback-toast .feedback-title {
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 2px;
}
body.page-candidatura .ballot-feedback-toast .feedback-text {
    font-size: 0.92rem;
    line-height: 1.35;
    color: #334155;
}
body.page-candidatura .ballot-feedback-toast .feedback-close {
    border: 0;
    background: transparent;
    color: #64748b;
    padding: 2px;
    border-radius: 6px;
    width: 24px;
    height: 24px;
}
body.page-candidatura .ballot-feedback-toast .feedback-close:hover {
    background: rgba(100, 116, 139, 0.15);
    color: #1e293b;
}
body.page-candidatura .ballot-feedback-success {
    border-color: #b8ebcb;
    background: linear-gradient(180deg, #f4fff8 0%, #ecfdf3 100%);
}
body.page-candidatura .ballot-feedback-success .feedback-icon {
    background: #dcfce7;
    color: #15803d;
}
body.page-candidatura .ballot-feedback-success .feedback-title {
    color: #166534;
}
body.page-candidatura .ballot-feedback-error {
    border-color: #fecaca;
    background: linear-gradient(180deg, #fff7f7 0%, #fef2f2 100%);
}
body.page-candidatura .ballot-feedback-error .feedback-icon {
    background: #fee2e2;
    color: #b91c1c;
}
body.page-candidatura .ballot-feedback-error .feedback-title {
    color: #b91c1c;
}
body.page-candidatura.dark-mode .ballot-feedback-toast,
body.page-candidatura .dark-mode .ballot-feedback-toast {
    border-color: #4a5b73;
    background: linear-gradient(180deg, #293548 0%, #243043 100%);
    box-shadow: 0 16px 30px rgba(2, 8, 20, 0.48);
}
body.page-candidatura.dark-mode .ballot-feedback-toast .feedback-text,
body.page-candidatura .dark-mode .ballot-feedback-toast .feedback-text {
    color: #d9e4f4;
}
body.page-candidatura.dark-mode .ballot-feedback-toast .feedback-close,
body.page-candidatura .dark-mode .ballot-feedback-toast .feedback-close {
    color: #bfd0e8;
}
body.page-candidatura.dark-mode .ballot-feedback-toast .feedback-close:hover,
body.page-candidatura .dark-mode .ballot-feedback-toast .feedback-close:hover {
    background: rgba(191, 208, 232, 0.18);
    color: #ffffff;
}
body.page-candidatura.dark-mode .ballot-feedback-success .feedback-title,
body.page-candidatura .dark-mode .ballot-feedback-success .feedback-title {
    color: #86efac;
}
body.page-candidatura.dark-mode .ballot-feedback-success .feedback-icon,
body.page-candidatura .dark-mode .ballot-feedback-success .feedback-icon {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}
body.page-candidatura.dark-mode .ballot-feedback-error .feedback-title,
body.page-candidatura .dark-mode .ballot-feedback-error .feedback-title {
    color: #fca5a5;
}
body.page-candidatura.dark-mode .ballot-feedback-error .feedback-icon,
body.page-candidatura .dark-mode .ballot-feedback-error .feedback-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}
@media (max-width: 576px) {
    body.page-candidatura .ballot-feedback-host {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }
}

/* Gestao.aspx */
body.page-gestao {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
body.page-gestao .readonly-field {
    background-color: var(--bg-body);
    cursor: not-allowed;
    border-style: dashed;
}
body.page-gestao .status-badge-large {
    font-size: 1.1rem;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 800;
}
body.page-gestao .fi {
    border-radius: 2px;
}
body.page-gestao #printableReceipt {
    display: none;
}
body.page-gestao .receipt-header {
    border-bottom: 4px solid var(--brand-primary);
    padding-bottom: 20px;
    margin-bottom: 30px;
}
body.page-gestao .receipt-logo {
    max-height: 60px;
    margin-bottom: 10px;
    background-color: #111 !important;
    padding: 10px;
    border-radius: 4px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
body.page-gestao .receipt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}
body.page-gestao .receipt-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: #666;
    text-transform: uppercase;
}
body.page-gestao .receipt-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #000;
}
body.page-gestao .group-context-box {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-left: 5px solid #666;
    padding: 15px;
    margin-bottom: 30px;
    border-radius: 4px;
}
body.page-gestao .watermark {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 6rem;
    opacity: 0.05;
    font-weight: 900;
    color: #000;
    z-index: -1;
    white-space: nowrap;
}
body.page-gestao .timeline-visual {
    margin-top: 40px;
    border-top: 1px dashed #ccc;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #666;
}
@media print {
    body.page-gestao * { visibility: hidden; }
    body.page-gestao #printableReceipt,
    body.page-gestao #printableReceipt * { visibility: visible; }
    body.page-gestao #printableReceipt {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 40px;
        background: white !important;
        color: black !important;
        font-family: 'Montserrat', sans-serif;
    }
    body.page-gestao .no-print { display: none !important; }
    body.page-gestao .participant-card {
        break-inside: avoid;
        border: 1px solid #eee !important;
        margin-bottom: 20px;
    }
}

/* Resultados.aspx */
body.page-resultados .search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}
body.page-resultados .search-input-group {
    position: relative;
}
body.page-resultados .btn-search-custom {
    position: absolute;
    right: 8px;
    top: 8px;
    height: 44px;
    z-index: 10;
    border-radius: 4px;
}
body.page-resultados .status-header {
    padding: 2rem;
    text-align: center;
    border-radius: 8px 8px 0 0;
}
body.page-resultados .status-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}
body.page-resultados .btn-action {
    width: 100%;
    padding: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 1rem;
    border-radius: 4px;
}
body.page-resultados .lang-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 85px;
    justify-content: center;
}
body.page-resultados .fi {
    border-radius: 2px;
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.2);
}

/* SetPassword.aspx */
body.page-set-password {
    background-color: #f8f9fa;
    font-family: 'Montserrat', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
}
body.page-set-password .auth-card {
    background: white;
    border-radius: 8px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}
body.page-set-password .btn-primary-custom {
    background-color: #50c878;
    border-color: #50c878;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 0;
    font-weight: 700;
    transition: all 0.2s ease;
}
body.page-set-password .btn-primary-custom:hover {
    background-color: #3da35b;
    border-color: #3da35b;
    transform: translateY(-1px);
}
body.page-set-password .form-control:focus {
    border-color: #50c878;
    box-shadow: 0 0 0 0.25rem rgba(80, 200, 120, 0.25);
}
body.page-set-password .brand-icon {
    color: #50c878;
    margin-bottom: 1rem;
}

/* Sucesso.aspx */
body.page-sucesso .fi {
    border-radius: 2px;
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.2);
}
body.page-sucesso .lang-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 85px;
    justify-content: center;
}

/* Suporte.aspx */
body.page-suporte {
    background-color: var(--bg-body) !important;
}
body.page-suporte .fi {
    border-radius: 2px;
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.2);
}
body.page-suporte .lang-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 85px;
    justify-content: center;
}
body.page-suporte .support-page {
    min-height: calc(100dvh - 72px);
    padding-top: 18px;
    padding-bottom: 20px;
}
body.page-suporte .support-page-title {
    color: var(--text-main);
    font-weight: 800;
    letter-spacing: 0.25px;
    margin-bottom: 14px;
}
body.page-suporte .support-ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}
body.page-suporte .support-ticket-subject {
    color: var(--text-main);
    line-height: 1.15;
    margin: 0;
    font-weight: 800;
}
body.page-suporte .ticket-badge {
    font-size: 0.78rem;
    padding: 0.42rem 0.75rem;
    border-radius: 999px;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.35px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}
body.page-suporte .chat-container {
    background-color: var(--surface-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    height: calc(100dvh - 265px);
    min-height: 500px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
body.page-suporte .chat-top {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.08), rgba(148, 163, 184, 0.03));
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.92rem;
}
body.page-suporte .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
    background-color: var(--bg-body);
    scroll-behavior: smooth;
}
body.page-suporte .msg-row {
    width: 100%;
    display: flex;
    margin-bottom: 10px;
}
body.page-suporte .msg-row-support { justify-content: flex-start; }
body.page-suporte .msg-row-me { justify-content: flex-end; }
body.page-suporte .msg-bubble {
    max-width: 88%;
    border-radius: 16px;
    padding: 11px 12px 10px;
    font-size: 0.97rem;
    line-height: 1.42;
    position: relative;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
}
body.page-suporte .msg-support {
    background: var(--surface-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 6px;
}
body.page-suporte .msg-me {
    background: linear-gradient(140deg, var(--brand-primary), var(--brand-primary-dark));
    color: #fff;
    border: 1px solid var(--brand-primary-dark);
    border-bottom-right-radius: 6px;
}
body.page-suporte .msg-author {
    display: block;
    font-weight: 700;
    font-size: 0.78rem;
    margin-bottom: 4px;
    opacity: 0.95;
}
body.page-suporte .msg-meta {
    display: block;
    margin-top: 6px;
    text-align: right;
    font-size: 0.74rem;
    opacity: 0.88;
}
body.page-suporte .chat-input {
    border-top: 1px solid var(--border-color);
    background-color: var(--surface-card);
    padding: 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    position: sticky;
    bottom: 0;
    z-index: 4;
}
body.page-suporte .chat-composer {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
body.page-suporte .chat-input .form-control {
    border-radius: 12px !important;
    border: 1px solid var(--border-color) !important;
    background-color: var(--input-bg) !important;
    color: var(--text-main) !important;
    font-size: 0.95rem;
    min-height: 48px;
    max-height: 180px;
    resize: none;
    box-shadow: none !important;
    padding: 10px 12px;
}
body.page-suporte .chat-input .btn {
    border-radius: 12px !important;
    min-height: 48px;
    min-width: 104px;
    font-weight: 800;
    letter-spacing: 0.35px;
    white-space: nowrap;
    box-shadow: none !important;
}
body.page-suporte .chat-hint {
    margin-top: 6px;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: right;
}
body.page-suporte .back-link {
    margin-top: 12px;
}
@media (max-width: 991.98px) {
    body.page-suporte .chat-container {
        height: calc(100dvh - 245px);
        min-height: 500px;
    }
}
@media (max-width: 767.98px) {
    body.page-suporte .top-bar .container { padding-top: 8px; padding-bottom: 8px; }
    body.page-suporte .brand-logo { font-size: 1.15rem; letter-spacing: 0.2px; }
    body.page-suporte .lang-toggle-btn { min-width: 72px; }
    body.page-suporte .support-page { padding-top: 10px; padding-bottom: 6px; }
    body.page-suporte .support-page-title {
        font-size: 1.18rem;
        text-align: left !important;
        margin-bottom: 8px;
        letter-spacing: 0.15px;
    }
    body.page-suporte .support-ticket-header {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        margin-bottom: 6px;
    }
    body.page-suporte .support-ticket-subject {
        font-size: 0.92rem;
        line-height: 1.15;
        margin-top: 0;
    }
    body.page-suporte .ticket-badge {
        align-self: flex-start;
        font-size: 0.66rem;
        padding: 0.3rem 0.58rem;
    }
    body.page-suporte .support-ticket-header .badge.bg-dark {
        font-size: 0.7rem;
        padding: 0.28rem 0.48rem;
        margin-bottom: 0.35rem !important;
    }
    body.page-suporte .chat-container {
        height: calc(100dvh - 198px);
        min-height: 420px;
        border-radius: 14px;
    }
    body.page-suporte .chat-top { padding: 10px 12px; font-size: 0.84rem; }
    body.page-suporte .chat-messages { padding: 10px 8px 8px; }
    body.page-suporte .msg-bubble {
        max-width: 92%;
        font-size: 0.98rem;
        padding: 10px 10px 9px;
    }
    body.page-suporte .msg-author { font-size: 0.76rem; }
    body.page-suporte .msg-meta { font-size: 0.72rem; }
    body.page-suporte .chat-composer { gap: 6px; }
    body.page-suporte .chat-input .form-control { min-height: 46px; font-size: 0.94rem; }
    body.page-suporte .chat-input .btn { min-width: 92px; min-height: 46px; padding: 0 14px; }
    body.page-suporte .chat-hint { font-size: 0.68rem; }
    body.page-suporte .back-link { margin-top: 8px; margin-bottom: 4px; text-align: left !important; }
    body.page-suporte .footer-clean { display: none; }
}

/* BALLOT_PAGE_INLINE_MIGRATION_END */

/* BACKOFFICE_PREMIUM_RESTORE_START */
body.theme-light {
    --header-bg: rgba(245, 249, 253, 0.96);
    --sidebar-bg: linear-gradient(180deg, #f5f9fd 0%, #edf3fa 100%);
    --sidebar-border: #d6e0eb;
    --sidebar-hover: rgba(48, 77, 114, 0.08);
    --sidebar-active-bg: linear-gradient(90deg, rgba(80, 200, 120, 0.22) 0%, rgba(80, 200, 120, 0.08) 100%);
    --sidebar-link: #20344f;
    --sidebar-link-hover-text: #12243b;
    --sidebar-active-text: #147f4f;
    --sidebar-header: #5a708e;
    --sidebar-meta: #6f87a8;
    --sidebar-footer-bg: rgba(236, 244, 252, 0.96);
    --sidebar-footer-border: rgba(127, 152, 182, 0.42);
    --sidebar-icon: #dc8a1a;
    --sidebar-icon-active: #0f8b51;
    --shadow-soft: 0 8px 18px rgba(15, 23, 42, 0.06);
    --shadow-hard: 0 16px 34px rgba(15, 23, 42, 0.12);
}

body.theme-dim {
    --header-bg: rgba(41, 50, 65, 0.92);
    --sidebar-bg: linear-gradient(180deg, #1c2532 0%, #18212c 100%);
    --sidebar-border: #334155;
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active-bg: linear-gradient(90deg, rgba(80, 200, 120, 0.2) 0%, rgba(80, 200, 120, 0.08) 100%);
    --sidebar-link: #d9e6f8;
    --sidebar-link-hover-text: #f8fbff;
    --sidebar-active-text: #89eeb4;
    --sidebar-header: rgba(193, 210, 233, 0.66);
    --sidebar-meta: rgba(178, 197, 224, 0.74);
    --sidebar-footer-bg: rgba(11, 16, 25, 0.52);
    --sidebar-footer-border: rgba(255, 255, 255, 0.14);
    --sidebar-icon: #ffb347;
    --sidebar-icon-active: #8af0b3;
    --shadow-soft: 0 10px 22px rgba(4, 8, 16, 0.28);
    --shadow-hard: 0 18px 36px rgba(4, 8, 16, 0.38);
}

body.theme-dark {
    --header-bg: rgba(33, 42, 56, 0.94);
    --sidebar-bg: linear-gradient(180deg, #161f2c 0%, #121a24 100%);
    --sidebar-border: #2f3d52;
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    --sidebar-active-bg: linear-gradient(90deg, rgba(80, 200, 120, 0.24) 0%, rgba(80, 200, 120, 0.1) 100%);
    --sidebar-link: #deebfd;
    --sidebar-link-hover-text: #ffffff;
    --sidebar-active-text: #95f4be;
    --sidebar-header: rgba(191, 209, 236, 0.66);
    --sidebar-meta: rgba(184, 204, 232, 0.76);
    --sidebar-footer-bg: rgba(8, 12, 18, 0.58);
    --sidebar-footer-border: rgba(255, 255, 255, 0.16);
    --sidebar-icon: #ffbe5c;
    --sidebar-icon-active: #95f4be;
    --shadow-soft: 0 12px 24px rgba(2, 6, 12, 0.36);
    --shadow-hard: 0 20px 40px rgba(2, 6, 12, 0.48);
}

body.theme-light .wrapper-admin,
body.theme-dim .wrapper-admin,
body.theme-dark .wrapper-admin {
    background: var(--bg-body);
}

body.theme-light .sidebar,
body.theme-dim .sidebar,
body.theme-dark .sidebar {
    background: var(--sidebar-bg) !important;
    border-right: 1px solid var(--sidebar-border) !important;
    box-shadow: 10px 0 28px rgba(8, 12, 20, 0.22);
}

.sidebar-brand {
    height: 78px;
    padding: 0 22px;
    align-items: center;
    border-bottom: 1px solid var(--sidebar-border-soft, rgba(255, 255, 255, 0.12));
}

.brand-container {
    gap: 10px;
    width: 100%;
}

.brand-stack .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 0.95;
}

.brand-stack .brand-primary {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    font-style: italic;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.brand-stack .brand-sub {
    font-family: 'Montserrat', sans-serif;
    margin-top: 4px;
    font-size: 0.94rem;
    font-style: italic;
    letter-spacing: 0.04em;
}

.brand-meta {
    margin-top: 5px;
    font-size: 0.66rem;
}

.brand-dashboard-icon {
    font-size: 1.05rem;
    margin-right: 6px;
    color: var(--sidebar-icon, #ffb347);
}

.sidebar-edge-toggle {
    position: absolute !important;
    top: 90px !important;
    right: -12px !important;
    width: 24px !important;
    height: 64px !important;
    border-radius: 10px !important;
    border: 1px solid var(--sidebar-border) !important;
    background: var(--surface-card) !important;
    color: var(--sidebar-toggle, #64748b) !important;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.2) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1011 !important;
}

.sidebar-edge-toggle:hover {
    color: var(--sidebar-toggle-hover, #1e3a5f) !important;
    border-color: #7ecaa3 !important;
}

.sidebar-menu {
    padding-top: 10px;
}

.sidebar-link {
    padding: 13px 20px;
    border-left-width: 4px;
}

.sidebar-link i {
    color: var(--sidebar-icon, #ffb347);
}

.sidebar-link.active {
    background: var(--sidebar-active-bg) !important;
    color: var(--sidebar-active-text) !important;
    border-left-color: #50c878 !important;
    box-shadow: inset 0 0 0 1px rgba(80, 200, 120, 0.24);
}

.sidebar-link.active i {
    color: var(--sidebar-icon-active, #8af0b3) !important;
}

.sidebar-link .inbox-sidebar-badge {
    margin-left: auto;
    min-width: 1.6rem;
    height: 1.6rem;
    padding: 0 0.42rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 6px 14px rgba(220, 53, 69, 0.28);
}

.menu-header {
    padding-top: 18px;
    color: var(--sidebar-header) !important;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--sidebar-footer-border) !important;
    background: var(--sidebar-footer-bg) !important;
}

.sidebar-menu {
    overflow-x: visible;
}

.menu-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 2px;
    padding: 14px 20px 6px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.menu-header::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: var(--sidebar-border-soft, rgba(255, 255, 255, 0.12));
}

.sidebar-link,
.sidebar-action-link {
    position: relative;
}

.sidebar-link {
    min-height: 48px;
    margin: 2px 10px 2px 0;
    padding: 13px 18px 13px 16px;
    border-left-width: 4px;
    border-radius: 0 14px 14px 0;
}

.sidebar-link::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 10px;
    bottom: 10px;
    width: 4px;
    border-radius: 999px;
    background: var(--brand-primary);
    opacity: 0;
    transform: scaleY(0.55);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.sidebar-link.active::before,
.sidebar-link:focus-visible::before {
    opacity: 1;
    transform: scaleY(1);
}

.sidebar-link:focus-visible,
.sidebar-action-link:focus-visible,
.sidebar-edge-toggle:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(80, 200, 120, 0.16),
        0 0 0 1px rgba(35, 60, 92, 0.18),
        var(--shadow-soft);
}

.sidebar-link--has-submenu[aria-expanded="true"] {
    background-color: var(--sidebar-hover, rgba(255, 255, 255, 0.06));
}

.submenu-cue {
    display: none;
}

.sidebar-footer .user-profile {
    padding: 2px 0;
}

.sidebar-action-link {
    min-height: 42px;
    border-radius: 12px;
}

body.collapsed .sidebar {
    overflow: visible;
}

body.collapsed .sidebar-link,
body.collapsed .sidebar-action-link {
    justify-content: center;
}

body.collapsed .sidebar-link {
    margin: 3px 10px 3px 8px;
    padding: 12px 0;
    border-radius: 14px;
}

body.collapsed .sidebar-link::before {
    display: none;
}

body.collapsed .sidebar-link i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    transition: background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

body.collapsed .sidebar-link.active i {
    background: rgba(80, 200, 120, 0.16);
    box-shadow: inset 0 0 0 1px rgba(80, 200, 120, 0.24);
}

body.collapsed .sidebar-link::after,
body.collapsed .sidebar-action-link::after {
    content: attr(data-nav-label);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(-6px);
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--surface-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
    white-space: nowrap;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 1025;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

body.collapsed .sidebar-link:hover::after,
body.collapsed .sidebar-link:focus-visible::after,
body.collapsed .sidebar-action-link:hover::after,
body.collapsed .sidebar-action-link:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

body.collapsed .sidebar-item--submenu {
    position: relative;
}

body.collapsed .sidebar-link--has-submenu .submenu-cue {
    display: block;
    position: absolute;
    right: 17px;
    top: 13px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--sidebar-icon-active, var(--sidebar-active-text));
    box-shadow: 0 0 0 3px rgba(80, 200, 120, 0.14);
}

body.collapsed .sidebar-link--has-submenu[aria-expanded="true"] .submenu-cue {
    background: var(--sidebar-active-text);
    box-shadow: 0 0 0 4px rgba(80, 200, 120, 0.18);
}

body.collapsed .sidebar-item--submenu .sidebar-submenu,
body.collapsed .sidebar-item--submenu .sidebar-submenu.show {
    display: none !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

body.collapsed .sidebar-item--submenu .sidebar-submenu .sidebar-menu {
    padding: 0;
    overflow: visible;
}

body.collapsed .sidebar-item--submenu .sidebar-submenu .sidebar-link {
    justify-content: flex-start;
    margin: 0;
    padding: 10px 14px 10px 16px;
    border-radius: 12px;
}

body.collapsed .sidebar-item--submenu .sidebar-submenu .sidebar-link i {
    width: 22px;
    height: 22px;
    margin-right: 10px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body.collapsed .sidebar-item--submenu .sidebar-submenu .link-text {
    display: inline !important;
    opacity: 1 !important;
}

body.collapsed .sidebar-item--submenu .sidebar-submenu .sidebar-link::after {
    display: none;
}

body.collapsed .sidebar-footer {
    padding: 12px 10px;
}

body.collapsed .sidebar-footer .user-profile {
    justify-content: center;
}

body.collapsed .sidebar-footer .user-avatar {
    margin-right: 0;
}

body.collapsed .sidebar-action-link {
    justify-content: center !important;
    padding-inline: 0;
}

body.collapsed .sidebar-action-link i {
    margin-right: 0 !important;
}

@media (min-width: 1100px) and (max-width: 1360px) {
    .sidebar {
        width: 244px;
    }

    .main-content {
        margin-left: 244px;
        width: calc(100% - 244px);
    }

    .sidebar-brand {
        padding-inline: 18px;
    }

    .sidebar-link {
        padding-left: 15px;
        padding-right: 16px;
    }

    body.collapsed .sidebar {
        width: 76px;
    }

    body.collapsed .main-content {
        margin-left: 76px;
        width: calc(100% - 76px);
    }
}

body.theme-light .sidebar-footer .btn-outline-light {
    color: #16314d;
    border-color: #95abc5;
    background: rgba(255, 255, 255, 0.9);
    font-weight: 700;
}

body.theme-light .sidebar-footer .btn-outline-light:hover {
    color: #10243a;
    border-color: #7590af;
    background: #ffffff;
}

.top-header {
    min-height: 76px;
    height: auto;
    padding: 10px 22px;
    gap: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color) !important;
    background: var(--header-bg) !important;
}

.top-header-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

.top-header-title {
    flex: 0 0 auto;
    margin: 0;
    font-size: 1.48rem;
    letter-spacing: -0.02em;
    line-height: 1.05;
}

.top-header-context {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.top-header-tools {
    flex: 0 0 auto;
    min-width: 280px;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: nowrap;
}

.event-selector-wrap {
    min-width: 0;
    flex: 1 1 auto;
}

.context-pill {
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important;
    padding: 8px 14px !important;
    border-radius: 999px !important;
    border: 1px solid var(--border-color) !important;
    background: var(--surface-muted) !important;
    color: var(--text-main) !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    max-width: 390px;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.context-pill.context-event {
    min-width: 220px;
}

.context-pill.context-ballot {
    min-width: 190px;
}

.event-selector {
    min-width: 300px !important;
    max-width: 520px !important;
    height: 42px;
    border-radius: 10px;
    font-size: 0.96rem;
}

.theme-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

body.theme-light .card,
body.theme-dim .card,
body.theme-dark .card,
body.theme-light .kpi-card,
body.theme-dim .kpi-card,
body.theme-dark .kpi-card {
    border: 1px solid var(--border-color) !important;
    border-radius: 14px !important;
    box-shadow: var(--shadow-soft) !important;
}

body.theme-light .table-custom th,
body.theme-dim .table-custom th,
body.theme-dark .table-custom th {
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

body.theme-light .table-custom td,
body.theme-dim .table-custom td,
body.theme-dark .table-custom td {
    font-size: 0.96rem;
}

body.theme-light .candidates-table td.candidate-main-cell,
body.theme-dim .candidates-table td.candidate-main-cell,
body.theme-dark .candidates-table td.candidate-main-cell {
    background: var(--surface-card) !important;
}

body.theme-light .member-list,
body.theme-dim .member-list,
body.theme-dark .member-list {
    border-left-width: 4px;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(126, 169, 219, 0.18);
}

body.theme-light .member-row .btn-light,
body.theme-dim .member-row .btn-light,
body.theme-dark .member-row .btn-light {
    border-color: var(--border-color);
    background: var(--surface-muted);
    color: var(--text-main);
}

body.theme-light .ticket-item.ticket-closed,
body.theme-dim .ticket-item.ticket-closed,
body.theme-dark .ticket-item.ticket-closed {
    opacity: 1;
    filter: none;
}

body.theme-light .lottery-progress,
body.theme-dim .lottery-progress,
body.theme-dark .lottery-progress {
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.2) 0%, rgba(71, 85, 105, 0.24) 100%) !important;
    border-color: var(--border-color) !important;
}

body.theme-dim .btn-group .btn-outline-dark,
body.theme-dark .btn-group .btn-outline-dark {
    color: #dce7f9;
    border-color: #5a6d8a;
    background: rgba(255, 255, 255, 0.03);
}

body.theme-dim .btn-group .btn-outline-dark.active,
body.theme-dark .btn-group .btn-outline-dark.active {
    color: #ffffff;
    background: linear-gradient(180deg, #3f5578 0%, #334866 100%);
    border-color: #8cb5ff;
}

@media (max-width: 1400px) {
    .top-header-title {
        font-size: 1.24rem;
    }
    .context-pill.context-event {
        min-width: 190px;
    }
    .context-pill.context-ballot {
        min-width: 170px;
    }
    .event-selector {
        min-width: 240px !important;
    }
}

@media (max-width: 992px) {
    .top-header {
        flex-wrap: wrap;
        row-gap: 8px;
    }
    .top-header-main {
        width: 100%;
    }
    .top-header-tools {
        width: 100%;
        justify-content: flex-start;
        min-width: 0;
    }
    .context-pill {
        display: none !important;
    }
    .event-selector {
        min-width: 220px !important;
        max-width: 100% !important;
        flex: 1 1 auto;
    }
    .sidebar-edge-toggle {
        top: 74px !important;
    }
}

/* BACKOFFICE_PREMIUM_RESTORE_END */

/* BACKOFFICE_LOTTERY_SECTION_REFRESH_START */
.lottery-hero {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px 16px;
    background: linear-gradient(180deg, var(--surface-card) 0%, var(--surface-muted) 100%);
    box-shadow: var(--shadow-soft);
}

.lottery-hero-label {
    margin-bottom: 6px;
    letter-spacing: 0.04em;
}

.lottery-ballot-select {
    height: 46px;
    border-radius: 10px;
    font-weight: 700;
}

.lottery-hero-note {
    min-height: 46px;
    display: flex;
    align-items: center;
    border-radius: 10px;
    border: 1px dashed var(--border-color);
    padding: 0 12px;
    color: var(--text-muted);
    font-size: 0.88rem;
    background: rgba(148, 163, 184, 0.07);
}

.lottery-metric-card {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px 12px 14px;
    background: var(--surface-card);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.lottery-metric-card::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    opacity: 0.85;
}

.lottery-metric-card .metric-title {
    display: block;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.lottery-metric-card .metric-value {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-main);
}

.lottery-metric-card .metric-icon {
    position: absolute;
    right: 12px;
    top: 12px;
    font-size: 1.05rem;
    opacity: 0.5;
}

.lottery-metric-card.metric-total::after { background: linear-gradient(90deg, #64748b, #94a3b8); }
.lottery-metric-card.metric-filled::after { background: linear-gradient(90deg, #16a34a, #34d399); }
.lottery-metric-card.metric-available::after { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.lottery-metric-card.metric-pending::after { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.lottery-metric-card.metric-filled .metric-value,
.lottery-metric-card.metric-filled .metric-icon {
    color: #16a34a;
}

.lottery-metric-card.metric-available .metric-icon {
    color: #2563eb;
}

.lottery-metric-card.metric-pending .metric-value,
.lottery-metric-card.metric-pending .metric-icon {
    color: #f59e0b;
}

.lottery-fill-wrap {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 12px 12px;
    background: var(--surface-card);
    box-shadow: var(--shadow-soft);
}

.lottery-fill-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.lottery-fill-value {
    color: #10b981;
    font-weight: 800;
}

.lottery-progress {
    height: 10px !important;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.18) 0%, rgba(71, 85, 105, 0.22) 100%) !important;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06);
}

.lottery-progress .progress-bar {
    background: linear-gradient(90deg, #10b981 0%, #34d399 55%, #6ee7b7 100%) !important;
    color: transparent !important;
    text-shadow: none !important;
}

.lottery-action-card,
.lottery-batch-card {
    border-radius: 14px !important;
    overflow: hidden;
}

.lottery-action-header,
.lottery-batch-header {
    background: linear-gradient(180deg, var(--surface-muted) 0%, var(--surface-card) 100%) !important;
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
}

body.theme-dim .lottery-hero-note,
body.theme-dark .lottery-hero-note {
    background: rgba(148, 163, 184, 0.08);
}

body.theme-dim .lottery-metric-card.metric-pending .metric-value,
body.theme-dark .lottery-metric-card.metric-pending .metric-value {
    color: #fbbf24;
}

body.theme-dim .lottery-fill-value,
body.theme-dark .lottery-fill-value {
    color: #5eead4;
}

@media (max-width: 992px) {
    .lottery-hero-note {
        min-height: 40px;
        font-size: 0.82rem;
    }
    .lottery-metric-card .metric-value {
        font-size: 1.9rem;
    }
}
/* BACKOFFICE_LOTTERY_SECTION_REFRESH_END */

/* BACKOFFICE_CONFIG_REPORTS_REFRESH_START */
.algo-premium-card {
    border-radius: 16px !important;
    overflow: hidden;
}

.algo-header {
    background: linear-gradient(180deg, var(--surface-muted) 0%, var(--surface-card) 100%) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.algo-body {
    background: var(--surface-card);
}

.algo-toolbar {
    margin-bottom: 14px !important;
}

.algo-toolbar-note {
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text-muted);
    font-size: 0.86rem;
    background: rgba(148, 163, 184, 0.07);
}

.algo-model-note {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 14px;
    background: linear-gradient(180deg, var(--surface-card) 0%, var(--surface-muted) 100%);
    box-shadow: var(--shadow-soft);
    min-height: 46px;
}

.algo-model-note-title {
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-main);
    margin-bottom: 4px;
}

.algo-model-note-copy {
    font-size: 0.86rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.config-section-head {
    margin-bottom: 12px;
}

.config-workspace {
    display: flex;
    flex-direction: column;
}

.config-card--refined {
    overflow: hidden;
}

.config-operational-shell {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.config-operational-bar {
    padding: 18px 20px;
}

.config-operational-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.config-operational-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
}

.config-operational-inline-note {
    display: inline-flex;
    align-items: center;
    max-width: 420px;
    padding: 9px 12px;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.16);
    background: rgba(59, 130, 246, 0.05);
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.4;
}

.config-operational-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 14px;
    align-items: stretch;
}

.config-operational-grid--refined {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.92fr);
    align-items: start;
}

.config-operational-field {
    min-width: 0;
}

.config-operational-field .form-text {
    margin-top: 8px;
    margin-bottom: 0;
}

.config-inline-help {
    margin-top: 8px;
    font-size: 0.84rem;
    line-height: 1.4;
    color: var(--text-muted);
}

.config-operational-guide {
    border-radius: 14px;
    border: 1px dashed rgba(59, 130, 246, 0.24);
    background: rgba(59, 130, 246, 0.06);
    padding: 14px 15px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
}

.config-operational-guide-title {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-main);
}

.config-operational-guide-copy {
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.config-operational-snapshot {
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.42);
    padding: 12px 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.config-operational-snapshot-label {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.config-section-head--compact {
    margin-bottom: 10px;
}

.config-section-head--inline {
    margin-bottom: 14px;
}

.config-section-kicker {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.config-section-copy {
    font-size: 0.84rem;
    line-height: 1.4;
    color: var(--text-muted);
}

.config-panel {
    padding: 18px 20px;
}

.config-field-card {
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.46);
    padding: 14px 15px;
    min-height: 100%;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.config-field-card .form-text {
    margin-bottom: 0;
}

.config-field-block-head {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 10px;
}

.config-field-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
}

.config-field-copy {
    font-size: 0.8rem;
    line-height: 1.35;
    color: var(--text-muted);
}

.config-pool-profile-card {
    margin-bottom: 10px;
}

.config-pool-profile {
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: linear-gradient(180deg, var(--surface-muted) 0%, var(--surface-card) 100%);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.config-pool-profile-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.config-pool-profile-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
}

.config-pool-profile-total {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
}

.config-pool-profile-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.config-pool-metric {
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.68);
    padding: 11px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.config-pool-metric-label {
    font-size: 0.73rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.config-pool-metric-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
}

.config-pool-metric-pct {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
}

.config-switch-card {
    margin-top: 2px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.config-switch-card .ballot-switch-input {
    margin-top: 4px;
    flex-shrink: 0;
}

.config-switch-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.config-switch-copy .form-text {
    margin-top: 0;
}

.algo-surface {
    border-radius: 12px !important;
    border: 1px solid var(--border-color) !important;
    background: linear-gradient(180deg, var(--surface-card) 0%, var(--surface-muted) 100%) !important;
    box-shadow: var(--shadow-soft);
}

.algo-divider {
    border-top-color: var(--border-color);
    opacity: 0.55;
}

.algo-target-grid .input-group {
    border-radius: 10px;
    overflow: hidden;
}

.algo-publish-panel-premium {
    border-radius: 14px !important;
    border: 1px solid var(--border-color) !important;
    background: linear-gradient(180deg, var(--surface-muted) 0%, var(--surface-card) 100%) !important;
}

.algo-state-box {
    background: rgba(148, 163, 184, 0.08) !important;
    border-color: var(--border-color) !important;
}

.algo-publish-actions .btn {
    border-radius: 10px;
    font-weight: 700;
}

.config-publish-panel {
    padding: 18px;
}

.config-main-panel,
.config-targets-panel {
    overflow: hidden;
}

.config-command-panel {
    position: sticky;
    top: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
}

.config-command-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.config-command-divider {
    height: 1px;
    background: var(--border-color);
    opacity: 0.8;
}

.config-state-card {
    padding: 14px 15px !important;
    border-radius: 14px !important;
    margin-bottom: 0;
}

.config-state-label {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.config-publish-state {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.config-publish-state-badge {
    display: inline-flex;
    align-items: center;
    width: max-content;
    max-width: 100%;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.config-publish-state-meta {
    font-weight: 700;
    color: var(--text-main);
}

.config-publish-state-note {
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.config-publish-state--published .config-publish-state-badge {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(22, 163, 74, 0.28);
    color: #166534;
}

.config-publish-state--scheduled .config-publish-state-badge {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(217, 119, 6, 0.3);
    color: #92400e;
}

.config-publish-state--ready .config-publish-state-badge {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(37, 99, 235, 0.28);
    color: #1d4ed8;
}

.config-publish-state--draft .config-publish-state-badge {
    background: rgba(100, 116, 139, 0.12);
    border-color: rgba(100, 116, 139, 0.24);
    color: #475569;
}

.config-publish-btn {
    min-height: 40px;
    font-weight: 800;
}

.config-sensitive-note {
    border-radius: 12px;
    border: 1px solid rgba(245, 158, 11, 0.22);
    background: rgba(245, 158, 11, 0.08);
    color: var(--text-main);
    padding: 12px 13px;
    font-size: 0.82rem;
    line-height: 1.4;
    margin-bottom: 2px;
}

.config-save-row {
    min-height: 52px;
    margin-top: 22px !important;
}

.config-save-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.config-save-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
}

.config-save-note {
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--text-muted);
    max-width: 520px;
}

.config-save-btn {
    min-height: 44px;
    min-width: 220px;
    font-weight: 800;
}

.algo-save-row {
    border-top-color: var(--border-color) !important;
}

.config-summary-strip {
    margin-top: 14px;
}

.report-overview-card,
.report-export-card,
.report-chart-card,
.report-table-card {
    border-radius: 16px !important;
    overflow: hidden;
}

.report-overview-header {
    background: linear-gradient(180deg, var(--surface-card) 0%, var(--surface-muted) 100%) !important;
}

.report-kpi-card {
    position: relative;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: linear-gradient(180deg, var(--surface-card) 0%, var(--surface-muted) 100%);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.report-kpi-card::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
}

.report-kpi-total::after { background: linear-gradient(90deg, #64748b, #94a3b8); }
.report-kpi-eligible::after { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }
.report-kpi-selected::after { background: linear-gradient(90deg, #16a34a, #34d399); }
.report-kpi-waitlist::after { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.report-kpi-icon {
    position: absolute;
    right: 14px;
    top: 12px;
    font-size: 1.05rem;
    opacity: 0.5;
}

.report-export-header {
    background: linear-gradient(180deg, var(--surface-muted) 0%, var(--surface-card) 100%) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.report-export-body {
    background: var(--surface-card);
}

.report-chart-card .card-header,
.report-table-card .card-header {
    background: linear-gradient(180deg, var(--surface-muted) 0%, var(--surface-card) 100%) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.report-table-card .table-responsive {
    border-top: 1px solid var(--border-color);
}

body.theme-dim .algo-toolbar-note,
body.theme-dark .algo-toolbar-note,
body.theme-dim .algo-state-box,
body.theme-dark .algo-state-box {
    background: rgba(148, 163, 184, 0.12) !important;
}

body.theme-dim .report-kpi-icon,
body.theme-dark .report-kpi-icon {
    opacity: 0.62;
}

@media (max-width: 992px) {
    .report-kpi-icon {
        top: 10px;
        right: 10px;
        font-size: 0.95rem;
    }
}
/* BACKOFFICE_CONFIG_REPORTS_REFRESH_END */

/* BACKOFFICE_LOTTERY_READABILITY_FIX_START */
body.theme-light .lottery-premium-card {
    background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%) !important;
    border-color: #d8e2ee !important;
    color: #0f172a !important;
}

body.theme-light .lottery-premium-card .lottery-slot-box {
    background: #e9eff7 !important;
    border: 1px solid #d4deea;
    color: #0f172a !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.lottery-card-caption {
    display: block;
    line-height: 1.45;
}

.dashboard-section-kicker--inverse {
    color: rgba(255, 255, 255, 0.74);
}

.dashboard-lottery-meta {
    border-top: 1px dashed rgba(148, 163, 184, 0.28);
    padding-top: 0.75rem;
}

.dashboard-lottery-action-note {
    line-height: 1.4;
}

body.theme-light .lottery-premium-card .lottery-check-list li {
    color: #4b5f7b !important;
}

body.theme-light .lottery-premium-card .lottery-check-list li i {
    color: #22c55e !important;
}

body.theme-light .lottery-premium-card .opacity-75,
body.theme-light .lottery-premium-card .opacity-50 {
    color: #64748b !important;
    opacity: 1 !important;
}

body.theme-dim .lottery-premium-card .lottery-check-list li,
body.theme-dark .lottery-premium-card .lottery-check-list li {
    color: #d7e3f7 !important;
}

body.theme-dim .lottery-premium-card .lottery-slot-box,
body.theme-dark .lottery-premium-card .lottery-slot-box {
    border-color: var(--border-color);
    color: #eaf2ff !important;
}

body.theme-dim .dashboard-overview-card,
body.theme-dark .dashboard-overview-card {
    background: linear-gradient(180deg, rgba(45, 55, 70, 0.94) 0%, rgba(39, 48, 61, 0.96) 100%);
}

body.theme-dim .dashboard-refresh-pill,
body.theme-dark .dashboard-refresh-pill {
    background: rgba(28, 37, 51, 0.86);
    border-color: rgba(129, 140, 158, 0.24);
    color: #dce7f6;
}

body.theme-dim .dashboard-refresh-note,
body.theme-dark .dashboard-refresh-note {
    color: #c9d5e7;
}

body.theme-dim .dashboard-refresh-btn,
body.theme-dark .dashboard-refresh-btn {
    color: #eef4ff !important;
    border-color: rgba(129, 140, 158, 0.34) !important;
    background: rgba(255, 255, 255, 0.03) !important;
}

body.theme-dim .dashboard-refresh-btn:hover,
body.theme-dark .dashboard-refresh-btn:hover {
    color: #ffffff !important;
    border-color: rgba(80, 200, 120, 0.34) !important;
    background: rgba(80, 200, 120, 0.1) !important;
}

body.theme-dim .dashboard-scope-chip,
body.theme-dark .dashboard-scope-chip,
body.theme-dim .dashboard-focus-card,
body.theme-dark .dashboard-focus-card {
    background: rgba(28, 37, 51, 0.86);
    border-color: rgba(129, 140, 158, 0.24);
    box-shadow: none;
}

body.theme-dim .dashboard-scope-chip--event,
body.theme-dark .dashboard-scope-chip--event {
    background: rgba(80, 200, 120, 0.16);
}

body.theme-dim .dashboard-scope-chip--lottery,
body.theme-dark .dashboard-scope-chip--lottery,
body.theme-dim .dashboard-focus-card--accent,
body.theme-dark .dashboard-focus-card--accent,
body.theme-dim .dashboard-focus-card--published,
body.theme-dark .dashboard-focus-card--published,
body.theme-dim .dashboard-focus-card--scheduled,
body.theme-dark .dashboard-focus-card--scheduled,
body.theme-dim .dashboard-focus-card--ready,
body.theme-dark .dashboard-focus-card--ready {
    background: rgba(59, 130, 246, 0.16);
}

body.theme-dim .dashboard-focus-card--warning,
body.theme-dark .dashboard-focus-card--warning {
    background: rgba(245, 158, 11, 0.18);
}

body.theme-dim .dashboard-focus-card--success,
body.theme-dark .dashboard-focus-card--success {
    background: rgba(80, 200, 120, 0.18);
}

body.theme-dim .dashboard-scope-chip-label,
body.theme-dark .dashboard-scope-chip-label,
body.theme-dim .dashboard-focus-label,
body.theme-dark .dashboard-focus-label,
body.theme-dim .dashboard-overview-note,
body.theme-dark .dashboard-overview-note,
body.theme-dim .dashboard-chart-note,
body.theme-dark .dashboard-chart-note,
body.theme-dim .dashboard-section-note,
body.theme-dark .dashboard-section-note,
body.theme-dim .kpi-status-note,
body.theme-dark .kpi-status-note {
    color: #c9d5e7;
}

body.theme-dim .dashboard-scope-chip-value,
body.theme-dark .dashboard-scope-chip-value,
body.theme-dim .dashboard-focus-value,
body.theme-dark .dashboard-focus-value {
    color: #f3f7fd;
}

@media (max-width: 1199.98px) {
    .dashboard-overview-top,
    .dashboard-section-head,
    .dashboard-chart-top {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-scope-strip {
        justify-content: flex-start;
    }

    .dashboard-head-tools {
        justify-content: flex-start;
    }
}

@media (max-width: 991.98px) {
    .dashboard-focus-grid {
        grid-template-columns: 1fr;
    }
}
/* BACKOFFICE_LOTTERY_READABILITY_FIX_END */

/* BACKOFFICE_CANDIDATES_PREMIUM_REFRESH_START */
.candidates-card {
    border-radius: 16px !important;
    overflow: visible;
}

.candidates-card > .card-body {
    overflow: visible;
}

.candidates-header {
    background: linear-gradient(180deg, var(--surface-muted) 0%, var(--surface-card) 100%) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.candidates-header .input-group.input-group-sm[style*="width: auto"] {
    width: auto !important;
}

.candidates-header .input-group-text {
    font-weight: 600;
    border-color: var(--border-color);
    background: var(--surface-muted);
    color: var(--text-muted);
}

.candidates-header .form-select,
.candidates-header .form-control {
    border-radius: 10px;
}

.candidates-header .input-group .btn.btn-dark {
    border-radius: 0 10px 10px 0;
}

.candidates-table {
    border-top: 1px solid var(--border-color);
    overflow: visible;
}

.candidates-table tbody tr {
    transition: background-color .15s ease, box-shadow .15s ease;
    position: relative;
    z-index: 1;
}

.candidates-table tbody tr::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--border-color);
    pointer-events: none;
}

.candidates-table tbody tr.candidate-row-dropdown-open {
    z-index: 40;
}

.candidates-table tbody tr:hover,
.candidates-table tbody tr:focus-within {
    box-shadow: inset 0 0 0 1px rgba(80, 200, 120, 0.2);
}

.candidates-table tbody tr > td {
    transition: background-color .15s ease, box-shadow .15s ease;
    border-bottom: 0;
}

.candidates-table tbody tr:hover > td,
.candidates-table tbody tr:focus-within > td,
.candidates-table tbody tr.candidate-row-dropdown-open > td {
    background-color: var(--table-hover-bg);
}

.candidates-table tbody tr:hover > td.candidate-main-cell,
.candidates-table tbody tr:focus-within > td.candidate-main-cell,
.candidates-table tbody tr.candidate-row-dropdown-open > td.candidate-main-cell {
    background-color: var(--table-hover-bg) !important;
}

.candidates-table td,
.candidates-table th {
    vertical-align: middle;
    overflow: visible;
}

.candidates-table .dropdown .btn {
    border-radius: 10px;
    font-weight: 600;
}

.candidates-table .dropdown {
    position: relative;
}

.candidate-actions-dropdown {
    position: relative;
}

.candidates-table .dropdown-menu {
    z-index: 2000;
    border-radius: 12px;
    padding: 8px;
    min-width: 250px;
    box-shadow: 0 18px 32px rgba(8, 16, 28, 0.28);
}

.candidate-actions-menu {
    min-width: 270px;
    max-width: min(320px, calc(100vw - 24px));
}

.candidate-actions-menu--floating {
    position: fixed;
    inset: auto auto auto auto;
    margin: 0;
    z-index: 2500;
    display: block;
}

.candidate-actions-menu .dropdown-item {
    border-radius: 8px;
    font-weight: 500;
}

.candidate-actions-menu .dropdown-item.action-item-current {
    background: transparent;
}

.candidate-actions-menu .dropdown-item.action-item-status {
    background: rgba(148, 163, 184, 0.06);
}

.candidate-actions-menu .dropdown-item.action-item-critical {
    background: rgba(239, 68, 68, 0.06);
}

.candidate-actions-section {
    padding: 0.25rem 0.75rem 0.35rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.candidate-actions-section-danger {
    color: #b91c1c;
}

.candidates-table .dropdown-item {
    border-radius: 8px;
    font-weight: 500;
}

.candidates-table .dropdown-item.action-item-current {
    background: transparent;
}

.candidates-table .dropdown-item.action-item-status {
    background: rgba(148, 163, 184, 0.06);
}

.candidates-table .dropdown-item.action-item-critical {
    background: rgba(239, 68, 68, 0.06);
}

.member-list {
    border-radius: 14px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    background: linear-gradient(180deg, var(--surface-card) 0%, var(--surface-muted) 100%);
    margin-top: 8px;
    padding: 8px 12px 6px;
    width: 100%;
    max-width: none;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.member-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.member-list-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.member-list-count {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-muted);
}

.member-row {
    padding: 7px 0;
    border-bottom: 1px solid var(--border-color);
}

.member-row:last-child {
    border-bottom: 0;
    padding-bottom: 1px;
}

.member-row-main {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
}

.member-identity {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.member-role-icon {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(100, 116, 139, 0.12);
    color: #64748b;
    flex: 0 0 auto;
}

.member-role-icon--leader {
    background: rgba(234, 179, 8, 0.16);
    color: #a16207;
}

.member-copy {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.member-name-line {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    line-height: 1.3;
}

.member-name {
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.92rem;
}

.member-role-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.member-role-badge--leader {
    background: rgba(234, 179, 8, 0.14);
    border: 1px solid rgba(217, 119, 6, 0.28);
    color: #92400e;
}

.member-email {
    display: inline-block;
    margin-top: 1px;
    font-size: 0.78rem;
    line-height: 1.25;
    word-break: break-word;
}

.member-side {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-left: auto;
    flex: 1 1 auto;
    width: auto;
    min-width: 180px;
    align-self: flex-start;
}

.member-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    padding: 0;
    border-radius: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    flex: 0 0 auto;
}

.member-flag .fi {
    font-size: 1.05rem;
    line-height: 1;
}

.member-row--leader {
    position: relative;
}

.member-row--leader::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
}

.member-row.search-highlight {
    background: rgba(253, 230, 138, 0.22);
    border-radius: 10px;
    padding: 8px 8px;
}

.member-row .btn.btn-light {
    border-radius: 8px;
    min-width: 32px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
}

.member-actions-toggle {
    min-width: 0;
    font-weight: 700;
    gap: 7px;
    white-space: nowrap;
    justify-content: center;
}

.member-actions-dropdown {
    flex: 0 0 auto;
    margin-left: 0;
}

.member-actions-dropdown .dropdown-menu {
    min-width: 240px;
}

.member-actions-toggle span {
    display: inline-flex;
    align-items: center;
}

.toggle-btn {
    color: #16a34a;
}

.toggle-btn:hover {
    color: #15803d;
}

.badge-status {
    border-radius: 999px;
    min-width: 118px;
    letter-spacing: .02em;
}

.candidates-footer {
    border-top: 1px solid var(--border-color) !important;
    background: linear-gradient(180deg, var(--surface-card) 0%, var(--surface-muted) 100%) !important;
}

body.theme-light .candidates-header,
body.theme-light .candidates-footer {
    background: linear-gradient(180deg, #f9fbff 0%, #f2f6fc 100%) !important;
}

body.theme-light .candidates-table .dropdown .btn.btn-light {
    background: #f8fbff;
    border-color: #d6e2ef;
    color: #1f3654;
}

body.theme-light .candidates-table .dropdown .btn.btn-light:hover {
    background: #eef4fb;
    border-color: #bfd0e2;
}

body.theme-dim .candidates-table .dropdown .btn.btn-light,
body.theme-dark .candidates-table .dropdown .btn.btn-light {
    background: var(--surface-muted);
    border-color: var(--border-color);
    color: var(--text-main);
}

body.theme-dim .member-list,
body.theme-dark .member-list {
    background: linear-gradient(180deg, rgba(47, 57, 72, 0.95) 0%, rgba(40, 49, 63, 0.95) 100%);
}

body.theme-dim .member-flag,
body.theme-dark .member-flag {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

body.theme-dim .candidate-actions-section,
body.theme-dark .candidate-actions-section {
    color: #aebcd2;
}

body.theme-dim .candidate-actions-section-danger,
body.theme-dark .candidate-actions-section-danger {
    color: #fca5a5;
}

body.theme-dim .candidates-table .dropdown-menu,
body.theme-dark .candidates-table .dropdown-menu,
body.theme-dim .candidate-actions-menu,
body.theme-dark .candidate-actions-menu {
    background: linear-gradient(180deg, rgba(52, 63, 80, 0.98) 0%, rgba(43, 53, 68, 0.99) 100%);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 34px rgba(2, 8, 20, 0.42);
}

body.theme-dim .candidate-actions-menu .dropdown-item,
body.theme-dark .candidate-actions-menu .dropdown-item {
    color: var(--text-main);
}

body.theme-dim .candidate-actions-menu .dropdown-item:hover,
body.theme-dark .candidate-actions-menu .dropdown-item:hover {
    background-color: rgba(148, 163, 184, 0.16);
}

body.theme-dim .candidate-actions-menu .dropdown-divider,
body.theme-dark .candidate-actions-menu .dropdown-divider {
    border-top-color: rgba(148, 163, 184, 0.16);
}

body.theme-dim .member-row,
body.theme-dark .member-row {
    border-bottom-color: rgba(136, 152, 176, 0.2);
}

body.theme-dim .member-list-count,
body.theme-dark .member-list-count {
    color: #c8d5e8;
}

body.theme-dim .config-field-card,
body.theme-dark .config-field-card {
    background: rgba(15, 23, 42, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body.theme-dim .config-operational-inline-note,
body.theme-dark .config-operational-inline-note,
body.theme-dim .config-operational-snapshot,
body.theme-dark .config-operational-snapshot {
    background: rgba(15, 23, 42, 0.22);
    border-color: rgba(148, 163, 184, 0.22);
}

body.theme-dim .config-operational-guide,
body.theme-dark .config-operational-guide {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(96, 165, 250, 0.22);
}

body.theme-dim .config-pool-profile,
body.theme-dark .config-pool-profile {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.18) 0%, rgba(15, 23, 42, 0.08) 100%) !important;
}

body.theme-dim .config-pool-metric,
body.theme-dark .config-pool-metric {
    background: rgba(15, 23, 42, 0.36);
    border-color: rgba(148, 163, 184, 0.18);
}

body.theme-dim .config-sensitive-note,
body.theme-dark .config-sensitive-note {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.24);
}

body.theme-dim .config-summary-chip,
body.theme-dark .config-summary-chip {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.24) 0%, rgba(15, 23, 42, 0.1) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.theme-dim .config-command-divider,
body.theme-dark .config-command-divider {
    background: rgba(131, 148, 171, 0.28);
}

body.theme-dim .config-publish-state--published .config-publish-state-badge,
body.theme-dark .config-publish-state--published .config-publish-state-badge {
    background: rgba(34, 197, 94, 0.14);
    color: #8ef0b4;
}

body.theme-dim .config-publish-state--scheduled .config-publish-state-badge,
body.theme-dark .config-publish-state--scheduled .config-publish-state-badge {
    background: rgba(245, 158, 11, 0.16);
    color: #ffd089;
}

body.theme-dim .config-publish-state--ready .config-publish-state-badge,
body.theme-dark .config-publish-state--ready .config-publish-state-badge {
    background: rgba(59, 130, 246, 0.16);
    color: #9bc2ff;
}

body.theme-dim .config-publish-state--draft .config-publish-state-badge,
body.theme-dark .config-publish-state--draft .config-publish-state-badge {
    background: rgba(100, 116, 139, 0.18);
    color: #c5cfdd;
}

body.theme-dim .member-role-icon,
body.theme-dark .member-role-icon {
    background: rgba(148, 163, 184, 0.16);
    color: #d8e1ef;
}

body.theme-dim .member-role-icon--leader,
body.theme-dark .member-role-icon--leader {
    background: rgba(250, 204, 21, 0.18);
    color: #fcd34d;
}

body.theme-dim .member-role-badge--leader,
body.theme-dark .member-role-badge--leader {
    background: rgba(250, 204, 21, 0.14);
    border-color: rgba(250, 204, 21, 0.28);
    color: #fde68a;
}

body.theme-dim .member-row.search-highlight,
body.theme-dark .member-row.search-highlight {
    background: rgba(120, 53, 15, 0.34);
}

body.theme-dim .member-row .btn.btn-light,
body.theme-dark .member-row .btn.btn-light {
    background: rgba(43, 53, 68, 0.92);
    border-color: rgba(131, 148, 171, 0.4);
    color: #e7eefb;
}

body.theme-dim .candidates-summary-primary,
body.theme-dark .candidates-summary-primary,
body.theme-dim .candidates-summary-pill,
body.theme-dark .candidates-summary-pill {
    background: rgba(30, 41, 59, 0.78);
    border-color: rgba(148, 163, 184, 0.24);
    color: #e7eefb;
}

body.theme-dim .candidates-summary-pill--accent,
body.theme-dark .candidates-summary-pill--accent {
    background: rgba(16, 185, 129, 0.18);
    color: #bbf7d0;
}

body.theme-dim .candidates-summary-pill--warning,
body.theme-dark .candidates-summary-pill--warning {
    background: rgba(180, 83, 9, 0.28);
    color: #fde68a;
}

body.theme-dim .candidates-summary-pill--search,
body.theme-dark .candidates-summary-pill--search {
    background: rgba(37, 99, 235, 0.28);
    color: #dbeafe;
}

body.theme-dim .candidate-ref,
body.theme-dark .candidate-ref {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.28);
    color: #e7eefb;
}

body.theme-dim .candidate-inline-meta,
body.theme-dark .candidate-inline-meta,
body.theme-dim .candidate-status-note,
body.theme-dark .candidate-status-note,
body.theme-dim .candidates-toolbar-note,
body.theme-dark .candidates-toolbar-note,
body.theme-dim .candidates-control-help,
body.theme-dark .candidates-control-help {
    color: #c8d5e8;
}

body.theme-dim .candidates-table tbody tr.candidate-row--expanded,
body.theme-dark .candidates-table tbody tr.candidate-row--expanded {
    background: linear-gradient(180deg, rgba(51, 65, 85, 0.28) 0%, rgba(30, 41, 59, 0.16) 100%);
}

.candidates-table tbody tr:hover .member-list,
.candidates-table tbody tr:focus-within .member-list,
.candidates-table tbody tr.candidate-row-dropdown-open .member-list {
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.96) 0%, rgba(236, 243, 251, 0.98) 100%);
    border-color: rgba(80, 200, 120, 0.32);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

body.theme-dim .candidates-table tbody tr:hover .member-list,
body.theme-dark .candidates-table tbody tr:hover .member-list,
body.theme-dim .candidates-table tbody tr:focus-within .member-list,
body.theme-dark .candidates-table tbody tr:focus-within .member-list,
body.theme-dim .candidates-table tbody tr.candidate-row-dropdown-open .member-list,
body.theme-dark .candidates-table tbody tr.candidate-row-dropdown-open .member-list {
    background: linear-gradient(180deg, rgba(56, 69, 88, 0.98) 0%, rgba(45, 56, 72, 0.98) 100%);
    border-color: rgba(80, 200, 120, 0.28);
    box-shadow: 0 18px 32px rgba(2, 8, 20, 0.24);
}

@media (max-width: 992px) {
    .candidates-toolbar-intro {
        gap: 12px;
    }

    .candidates-toolbar-secondary {
        align-items: stretch;
    }

    .candidates-header .row > [class*="col-"] {
        margin-bottom: 8px;
    }
    .candidates-header .input-group.input-group-sm[style*="width: auto"] {
        width: 100% !important;
    }

    .member-list {
        max-width: none;
    }

    .member-row-main {
        gap: 8px;
    }

    .member-side {
        min-width: 168px;
        gap: 8px;
    }

    .candidates-table th:nth-child(2),
    .candidates-table td:nth-child(2) {
        display: none;
    }
}

@media (max-width: 1200px) {
    .candidates-table th:nth-child(3),
    .candidates-table td:nth-child(3) {
        min-width: 150px;
    }

    .candidate-actions-inline {
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .candidate-status-inline {
        gap: 8px;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .candidates-summary-strip {
        gap: 6px;
    }

    .candidate-inline-meta > span {
        white-space: normal;
    }

    .member-row-main {
        display: grid;
        grid-template-columns: 1fr;
        align-items: flex-start;
    }

    .member-side {
        width: auto;
        min-width: 0;
        flex-basis: auto;
        justify-content: flex-start;
        padding-left: 32px;
    }
}
/* BACKOFFICE_CANDIDATES_PREMIUM_REFRESH_END */

/* BACKOFFICE_B1_OPERATIONAL_UX_START */
.view-summary-text {
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.view-feedback-host {
    padding: 14px 18px 0;
}

#feedbackCandidates.view-feedback-host,
#feedbackInbox.view-feedback-host,
#feedbackLogs.view-feedback-host,
#feedbackConfig.view-feedback-host {
    padding: 10px 14px 0;
}

.view-feedback {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border-radius: 14px;
    border: 1px solid transparent;
    padding: 12px 14px;
    box-shadow: var(--shadow-soft);
    opacity: 1;
    transform: translateY(0);
    transition: opacity .28s ease, transform .28s ease;
}

.view-feedback--closing {
    opacity: 0;
    transform: translateY(-6px);
}

.view-feedback-body {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.view-feedback-icon {
    flex: 0 0 auto;
    margin-top: 2px;
}

.view-feedback-message {
    min-width: 0;
    line-height: 1.45;
    font-weight: 600;
}

.view-feedback-close {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: inherit;
    opacity: 0.68;
    padding: 0;
    width: 26px;
    height: 26px;
    border-radius: 999px;
}

.view-feedback-close:hover {
    opacity: 1;
    background: rgba(15, 23, 42, 0.08);
}

.view-feedback--success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.view-feedback--warning {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #92400e;
}

.view-feedback--error {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.view-feedback--info {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.view-feedback-host--timed .view-feedback {
    border-radius: 14px;
    padding: 9px 12px;
}

.view-feedback-host--timed .view-feedback-message {
    font-weight: 700;
    font-size: 0.9rem;
}

.config-summary-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.config-summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    max-width: 100%;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: linear-gradient(180deg, var(--surface-card) 0%, var(--surface-muted) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.config-summary-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.config-summary-value {
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--text-main);
}

.config-summary-chip--published {
    border-color: rgba(34, 197, 94, 0.25);
}

.config-summary-chip--scheduled {
    border-color: rgba(245, 158, 11, 0.26);
}

.config-summary-chip--ready {
    border-color: rgba(59, 130, 246, 0.26);
}

.config-summary-chip--url-missing {
    border-color: rgba(100, 116, 139, 0.24);
}

.config-summary-chip--url-ready {
    border-color: rgba(14, 165, 233, 0.24);
}

.candidates-toolbar-footer {
    flex-wrap: wrap;
    gap: 10px;
}

.candidates-toolbar-actions {
    min-height: 34px;
}

.candidates-toolbar-shell {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.candidates-toolbar-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.candidates-toolbar-copy {
    min-width: 0;
    flex: 1 1 420px;
}

.candidates-toolbar-note {
    margin-top: 6px;
    max-width: 760px;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.candidates-toolbar-grid {
    margin-top: 0;
}

.candidates-control-block,
.candidates-control-inline {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.candidates-control-label {
    font-size: 0.69rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.candidates-control-help {
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--text-muted);
}

.candidates-toolbar-secondary {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 10px;
    min-height: 100%;
}

.candidates-toolbar-secondary .candidates-page-size-control {
    margin-left: 0;
    width: 100% !important;
}

.candidates-reset-btn {
    justify-content: center;
}

.candidates-summary-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.candidates-summary-primary,
.candidates-summary-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    border-radius: 999px;
    padding: 6px 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.82);
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.candidates-summary-primary {
    background: rgba(15, 23, 42, 0.06);
    border-color: rgba(148, 163, 184, 0.18);
}

.candidates-summary-pill--accent {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.2);
    color: #0f766e;
}

.candidates-summary-pill--warning {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.22);
    color: #b45309;
}

.candidates-summary-pill--muted,
.candidates-summary-pill--subtle {
    color: var(--text-muted);
}

.candidates-summary-pill--search {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.18);
    color: #1d4ed8;
}

.candidates-page-size-control {
    margin-left: auto;
}

.candidates-table-scroll {
    overflow-x: auto;
    overflow-y: visible;
}

.candidates-table-wrap {
    overflow: visible;
    position: relative;
    isolation: isolate;
}

.candidates-table-wrap.dropdown-open-active {
    z-index: 20;
}

.candidate-primary-name {
    font-weight: 700;
    color: var(--text-main);
}

.candidate-record {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.candidate-topline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.candidate-ref {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 2px 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.24);
    color: #1e293b;
}

.candidate-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.candidate-inline-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.candidate-inline-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.candidate-inline-meta > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.candidate-inline-meta--email {
    max-width: 100%;
}

.candidate-group-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: rgba(17, 24, 39, 0.06);
    border: 1px solid rgba(100, 116, 139, 0.2);
    color: var(--text-muted);
}

.candidate-group-toggle {
    display: inline-flex;
    align-items: center;
    margin-top: 2px;
    font-size: 0.78rem;
    font-weight: 700;
}

.candidate-main-cell {
    position: relative;
}

.candidate-main-cell::after {
    content: none;
}

.candidate-record,
.member-list {
    position: relative;
    z-index: 1;
}

.candidate-actions-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: flex-end;
    min-width: max-content;
}

.candidate-primary-action {
    white-space: nowrap;
    min-height: 35px;
    padding: 0.34rem 0.78rem;
    font-weight: 700;
}

.candidate-more-actions {
    font-weight: 700;
    min-height: 35px;
    padding: 0.34rem 0.72rem;
}

.candidate-actions-cell {
    white-space: nowrap;
}

.candidate-status-cell,
.candidate-actions-cell {
    vertical-align: middle !important;
}

.candidate-col-birth,
.candidate-col-pax {
    white-space: nowrap;
}

.candidate-col-email {
    min-width: 220px;
    word-break: break-word;
}

.candidate-status-stack {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0;
    min-height: 35px;
}

.candidate-status-inline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.candidate-status-note {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

.candidate-nation-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.candidate-menu-edit-duplicate {
    display: none !important;
}

.candidates-table th:nth-child(1) {
    min-width: 360px;
}

.candidates-table th:nth-child(4),
.candidates-table td:nth-child(4) {
    min-width: 152px;
}

.candidates-table th:last-child,
.candidates-table td:last-child {
    width: 1%;
    white-space: nowrap;
}

.candidates-table tbody tr.candidate-row--pending td:first-child,
.candidates-table tbody tr.candidate-row--selected td:first-child,
.candidates-table tbody tr.candidate-row--rejected td:first-child,
.candidates-table tbody tr.candidate-row--banned td:first-child {
    box-shadow: inset 3px 0 0 transparent;
}

.candidates-table tbody tr.candidate-row--pending td:first-child {
    box-shadow: inset 3px 0 0 rgba(245, 158, 11, 0.75);
}

.candidates-table tbody tr.candidate-row--selected td:first-child {
    box-shadow: inset 3px 0 0 rgba(34, 197, 94, 0.85);
}

.candidates-table tbody tr.candidate-row--rejected td:first-child {
    box-shadow: inset 3px 0 0 rgba(239, 68, 68, 0.78);
}

.candidates-table tbody tr.candidate-row--banned td:first-child {
    box-shadow: inset 3px 0 0 rgba(217, 119, 6, 0.82);
}

.candidates-table tbody tr.candidate-row--expanded {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.015) 0%, rgba(148, 163, 184, 0.04) 100%);
}

.inbox-list-col {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(241, 245, 249, 0.12) 100%);
}

.inbox-detail-col {
    padding-left: 14px !important;
}

.inbox-filters .view-summary-text,
.viewLogs .view-summary-text,
#viewLogs .view-summary-text {
    margin-bottom: 12px;
}

.inbox-filter-section {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: linear-gradient(180deg, var(--surface-card) 0%, var(--surface-muted) 100%);
    box-shadow: var(--shadow-soft);
}

.inbox-filter-section-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.inbox-advanced-block {
    box-shadow: var(--shadow-soft);
}

.inbox-filter-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.inbox-toolbar-action,
.inbox-filter-actions .btn {
    white-space: nowrap;
}

.chat-ticket-context {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.chat-ticket-topline {
    margin-bottom: 10px;
}

.chat-ticket-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.chat-ticket-head {
    min-width: 0;
    flex: 1 1 auto;
}

.chat-ticket-subject {
    margin: 0;
}

.chat-ticket-contact-line {
    min-width: 0;
}

.chat-ticket-controls {
    min-width: 0;
    width: min(100%, 268px);
    gap: 6px;
    align-self: flex-start;
}

.chat-ticket-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
}

.chat-ticket-tools .form-select {
    min-width: 0;
    width: 100%;
    min-height: 36px;
    border-radius: 10px;
    padding-block: 0.38rem;
    font-size: 0.92rem;
}

.chat-ticket-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    justify-content: stretch;
}

.chat-ticket-actions .btn {
    min-height: 38px;
    padding-inline: 10px;
    font-size: 0.9rem;
    border-radius: 10px;
    white-space: normal;
}

.chat-context-chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 4px 11px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    border: 1px solid var(--border-color);
    background: var(--surface-muted);
    color: var(--text-muted);
}

.chat-context-chip--ref {
    color: var(--text-main);
}

.chat-context-chip--state {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.18);
    color: #1d4ed8;
}

.chat-context-chip--owner {
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.2);
}

.msg-thread-row {
    display: flex;
    width: 100%;
    margin-bottom: 14px;
}

.msg-thread-row--admin {
    justify-content: flex-end;
}

.msg-thread-row--user {
    justify-content: flex-start;
}

.msg-thread-stack {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    max-width: 86%;
}

.msg-thread-stack--admin {
    flex-direction: row-reverse;
}

.msg-thread-marker {
    flex: 0 0 34px;
}

.chat-composer-shell {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-composer-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-composer-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.chat-composer-copy {
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--text-muted);
}

.chat-composer-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: stretch;
}

.chat-composer-send {
    min-width: 124px;
}

.chat-composer-toggle {
    margin-top: 12px;
}

.logs-table th,
.logs-table td {
    vertical-align: top;
}

.logs-card {
    overflow: hidden;
}

.logs-header {
    background: linear-gradient(180deg, var(--surface-card) 0%, var(--surface-muted) 100%) !important;
}

.logs-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.logs-header-copy {
    min-width: 0;
}

.logs-section-kicker {
    margin-bottom: 0.35rem;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.logs-header-note {
    margin-bottom: 8px;
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.logs-summary-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.logs-summary-primary,
.logs-summary-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.78);
    color: var(--text-main);
    font-size: 0.83rem;
    font-weight: 700;
    line-height: 1.2;
}

.logs-summary-primary {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(244, 248, 253, 0.96) 100%);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.logs-summary-pill--accent {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.18);
    color: #1d4ed8;
}

.logs-summary-pill--warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.2);
    color: #b45309;
}

.logs-summary-pill--muted {
    background: rgba(148, 163, 184, 0.12);
    color: #475569;
}

.logs-summary-pill--search {
    background: rgba(80, 200, 120, 0.12);
    border-color: rgba(80, 200, 120, 0.22);
    color: #157347;
}

.logs-summary-pill--subtle {
    background: rgba(226, 232, 240, 0.72);
    color: #475569;
}

.logs-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.logs-toolbar-btn {
    white-space: nowrap;
    border-radius: 10px;
    font-weight: 700;
}

.logs-toolbar-btn--reset[disabled] {
    opacity: 0.52;
}

.logs-toolbar-btn--export {
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.logs-filter-grid .form-label {
    font-size: 0.72rem;
    font-weight: 800 !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.logs-filter-grid .form-control,
.logs-filter-grid .form-select,
.logs-filter-grid .btn {
    min-height: 38px;
}

.logs-filter-apply {
    min-width: 108px;
    font-weight: 700;
}

.logs-table thead th {
    padding-top: 14px;
    padding-bottom: 14px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom-color: rgba(148, 163, 184, 0.22);
}

.logs-table tbody td {
    padding-top: 15px;
    padding-bottom: 15px;
    border-bottom-color: rgba(148, 163, 184, 0.18);
}

.logs-table tbody tr:hover {
    background: rgba(15, 23, 42, 0.02);
}

.logs-col-event {
    min-width: 230px;
}

.logs-col-admin {
    min-width: 170px;
}

.logs-col-moment {
    min-width: 122px;
}

.logs-col-target {
    min-width: 220px;
}

.logs-col-details {
    min-width: 260px;
}

.logs-col-origin {
    min-width: 132px;
}

.log-action-stack,
.log-target-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.log-action-label {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    min-height: 24px;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.71rem;
    font-weight: 800;
    border: 1px solid transparent;
}

.log-action-main {
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.35;
    color: var(--text-main);
}

.log-action-label--neutral {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #334155;
}

.log-action-label--operation {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.log-action-label--lottery {
    background: #ede9fe;
    border-color: #c4b5fd;
    color: #6d28d9;
}

.log-action-label--support {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.log-action-label--export {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

.log-action-label--identity {
    background: #fce7f3;
    border-color: #f9a8d4;
    color: #9d174d;
}

.log-action-label--danger {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.log-action-code,
.log-target-code,
.log-ip-code {
    font-family: ui-monospace, SFMono-Regular, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.76rem;
    line-height: 1.4;
    color: var(--text-muted);
    word-break: break-word;
}

.log-target-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-main);
}

.log-admin-stack,
.log-moment-stack {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.log-admin-name,
.log-moment-time {
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text-main);
}

.log-admin-meta,
.log-moment-date {
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.log-details-preview {
    display: inline-block;
    max-width: 320px;
    line-height: 1.45;
    color: var(--text-main);
}

.log-empty {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.logs-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 42px 18px;
    text-align: center;
}

.logs-empty-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.08);
    color: #2563eb;
    font-size: 1.1rem;
}

.logs-empty-title {
    font-size: 0.96rem;
    font-weight: 800;
    color: var(--text-main);
}

.logs-empty-copy {
    max-width: 420px;
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.logs-footer-bar {
    background: linear-gradient(180deg, var(--surface-muted) 0%, var(--surface-card) 100%) !important;
}

@media (max-width: 991.98px) {
    .logs-header-top {
        flex-direction: column;
        align-items: stretch;
    }

    .logs-toolbar-actions {
        justify-content: flex-start;
    }

    .logs-summary-strip {
        margin-top: 10px;
    }

    .config-save-row {
        align-items: stretch !important;
    }

    .config-save-btn {
        width: 100%;
    }

    .config-operational-grid {
        grid-template-columns: 1fr;
    }

    .config-operational-topline,
    .config-pool-profile-head {
        flex-direction: column;
        align-items: stretch;
    }

    .config-pool-profile-metrics {
        grid-template-columns: 1fr;
    }

    .config-panel,
    .config-operational-bar {
        padding: 16px;
    }

    .config-command-panel {
        position: static;
    }

    .manual-email-context-row {
        flex-direction: column;
        gap: 2px;
    }

    .manual-email-context-value {
        text-align: left;
    }
}

@media (max-width: 1279.98px) {
    .top-header {
        padding: 0 1.25rem;
    }

    .top-header-tools {
        min-width: 240px;
    }

    .candidate-col-email {
        min-width: 190px;
    }

    .config-summary-strip {
        gap: 8px;
    }

    .config-operational-grid--refined {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1199.98px) {
    .inbox-detail-col {
        padding-left: 0 !important;
        padding-top: 14px;
    }

    .chat-ticket-tools {
        justify-content: flex-start;
    }

    .chat-ticket-header {
        flex-direction: column;
    }

    .chat-ticket-controls {
        width: 100%;
        min-width: 0;
    }

    .chat-ticket-actions {
        justify-content: flex-start;
    }

    .logs-table .log-details-preview {
        max-width: 260px;
    }

    .logs-table .log-action-main,
    .logs-table .log-admin-name,
    .logs-table .log-moment-time {
        font-size: 0.9rem;
    }
}

@media (max-width: 991.98px) {
    .candidate-actions-inline {
        justify-content: flex-start;
    }

    .candidate-primary-action,
    .candidate-more-actions {
        width: 100%;
        justify-content: center;
    }

    .candidate-col-email {
        min-width: 170px;
    }

    .chat-ticket-context {
        margin-top: 10px;
    }

    .chat-composer-input {
        grid-template-columns: 1fr;
    }

    .chat-composer-send {
        width: 100%;
    }

    .ticket-item-header,
    .ticket-item-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

body.theme-dim .view-feedback--success,
body.theme-dark .view-feedback--success {
    background: rgba(34, 197, 94, 0.16);
    border-color: rgba(74, 222, 128, 0.36);
    color: #d1fae5;
}

body.theme-dim .view-feedback--warning,
body.theme-dark .view-feedback--warning {
    background: rgba(250, 204, 21, 0.16);
    border-color: rgba(250, 204, 21, 0.32);
    color: #fde68a;
}

body.theme-dim .view-feedback--error,
body.theme-dark .view-feedback--error {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(248, 113, 113, 0.34);
    color: #fecaca;
}

body.theme-dim .view-feedback--info,
body.theme-dark .view-feedback--info {
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(96, 165, 250, 0.34);
    color: #dbeafe;
}

body.theme-dim .candidate-group-chip,
body.theme-dark .candidate-group-chip,
body.theme-dim .chat-context-chip,
body.theme-dark .chat-context-chip {
    background: rgba(148, 163, 184, 0.14);
    border-color: rgba(148, 163, 184, 0.3);
    color: #d5dfef;
}

body.theme-dim .chat-context-chip--state,
body.theme-dark .chat-context-chip--state {
    background: rgba(96, 165, 250, 0.18);
    border-color: rgba(96, 165, 250, 0.34);
    color: #dbeafe;
}

body.theme-dim .chat-ticket-topline,
body.theme-dark .chat-ticket-topline,
body.theme-dim .chat-composer-title,
body.theme-dark .chat-composer-title,
body.theme-dim .chat-composer-copy,
body.theme-dark .chat-composer-copy,
body.theme-dim .chat-ticket-contact-line,
body.theme-dark .chat-ticket-contact-line {
    color: #cdd8e8;
}

body.theme-dim .chat-ticket-subject,
body.theme-dark .chat-ticket-subject {
    color: #f3f7fd;
}

body.theme-dim .msg-thread-marker--admin,
body.theme-dark .msg-thread-marker--admin {
    background: linear-gradient(180deg, #31435f 0%, #273650 100%);
    color: #c7dcff;
}

body.theme-dim .msg-thread-marker--user,
body.theme-dark .msg-thread-marker--user {
    background: linear-gradient(180deg, #23473a 0%, #1c3a30 100%);
    color: #baf0d0;
}

body.theme-dim .inbox-filter-section,
body.theme-dark .inbox-filter-section,
body.theme-dim .inbox-advanced-block,
body.theme-dark .inbox-advanced-block {
    background: linear-gradient(180deg, rgba(45, 55, 70, 0.95) 0%, rgba(38, 47, 61, 0.96) 100%);
    border-color: var(--border-color);
}

body.theme-dim .log-action-label--neutral,
body.theme-dark .log-action-label--neutral {
    background: rgba(148, 163, 184, 0.18);
    border-color: rgba(148, 163, 184, 0.3);
    color: #e5edf9;
}

body.theme-dim .logs-summary-primary,
body.theme-dark .logs-summary-primary,
body.theme-dim .logs-summary-pill,
body.theme-dark .logs-summary-pill {
    background: rgba(28, 37, 51, 0.88);
    border-color: rgba(129, 140, 158, 0.24);
    color: #e6eefb;
    box-shadow: none;
}

body.theme-dim .logs-summary-pill--muted,
body.theme-dark .logs-summary-pill--muted,
body.theme-dim .logs-summary-pill--subtle,
body.theme-dark .logs-summary-pill--subtle {
    color: #cad6e7;
}

body.theme-dim .logs-summary-pill--accent,
body.theme-dark .logs-summary-pill--accent {
    background: rgba(59, 130, 246, 0.16);
    color: #dbeafe;
}

body.theme-dim .logs-summary-pill--warning,
body.theme-dark .logs-summary-pill--warning {
    background: rgba(245, 158, 11, 0.18);
    color: #fde68a;
}

body.theme-dim .logs-summary-pill--search,
body.theme-dark .logs-summary-pill--search {
    background: rgba(80, 200, 120, 0.18);
    color: #d5f8e2;
}

body.theme-dim .log-action-code,
body.theme-dark .log-action-code,
body.theme-dim .log-target-code,
body.theme-dark .log-target-code,
body.theme-dim .log-ip-code,
body.theme-dark .log-ip-code,
body.theme-dim .log-details-preview,
body.theme-dark .log-details-preview {
    color: #d8e2f3;
}

body.theme-dim .log-action-main,
body.theme-dark .log-action-main,
body.theme-dim .log-admin-name,
body.theme-dark .log-admin-name,
body.theme-dim .log-moment-time,
body.theme-dark .log-moment-time,
body.theme-dim .log-target-label,
body.theme-dark .log-target-label,
body.theme-dim .logs-empty-title,
body.theme-dark .logs-empty-title {
    color: #f1f6ff;
}

body.theme-dim .log-admin-meta,
body.theme-dark .log-admin-meta,
body.theme-dim .log-moment-date,
body.theme-dark .log-moment-date,
body.theme-dim .logs-empty-copy,
body.theme-dark .logs-empty-copy,
body.theme-dim .logs-filter-grid .form-label,
body.theme-dark .logs-filter-grid .form-label {
    color: #c8d3e5;
}

body.theme-dim .logs-empty-icon,
body.theme-dark .logs-empty-icon {
    background: rgba(59, 130, 246, 0.16);
    color: #dbeafe;
}
/* BACKOFFICE_B1_OPERATIONAL_UX_END */

/* BACKOFFICE_USERS_PREMIUM_REFRESH_START */
.users-card {
    border-radius: 16px !important;
    overflow: hidden;
}

.edit-modal-header {
    align-items: flex-start;
}

.modal-title-wrap {
    min-width: 0;
}

.edit-modal-subtitle {
    margin-top: 0.25rem;
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.edit-context-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 1rem;
    background: linear-gradient(180deg, var(--surface-muted) 0%, var(--surface-card) 100%);
    box-shadow: var(--shadow-soft);
}

.edit-context-kicker {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.edit-context-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.25;
}

.edit-context-meta {
    margin-top: 0.2rem;
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.modal-footer-soft {
    gap: 10px;
}

.modal-cancel-btn,
.modal-primary-btn {
    min-height: 40px;
    border-radius: 10px;
    font-weight: 700;
}

.manual-email-context-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 1rem;
    background: linear-gradient(180deg, var(--surface-card) 0%, var(--surface-muted) 100%);
    box-shadow: var(--shadow-soft);
}

.manual-email-context-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    font-size: 0.88rem;
    line-height: 1.45;
}

.manual-email-context-row + .manual-email-context-row {
    margin-top: 6px;
}

.manual-email-context-label {
    flex: 0 0 auto;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.72rem;
}

.manual-email-context-value {
    min-width: 0;
    text-align: right;
    color: var(--text-main);
    word-break: break-word;
}

.users-header {
    background: linear-gradient(180deg, var(--surface-muted) 0%, var(--surface-card) 100%) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.users-add-btn {
    border-radius: 10px;
    font-weight: 700;
}

.users-table {
    border-top: 1px solid var(--border-color);
}

.users-table tbody tr {
    transition: background-color .15s ease, box-shadow .15s ease;
}

.users-table tbody tr:hover {
    box-shadow: inset 0 0 0 1px rgba(80, 200, 120, 0.2);
}

.users-table td,
.users-table th {
    vertical-align: middle;
}

.users-avatar-cell {
    border: 1px solid var(--border-color);
    background: linear-gradient(180deg, var(--surface-card) 0%, var(--surface-muted) 100%) !important;
}

.users-table .form-select.form-select-sm[style*="min-width: 220px"] {
    border-radius: 10px;
    font-weight: 600;
}

.users-table .btn {
    border-radius: 9px;
    font-weight: 600;
}

body.theme-light .users-header {
    background: linear-gradient(180deg, #f9fbff 0%, #f2f6fc 100%) !important;
}

body.theme-light .users-table .btn-outline-secondary {
    border-color: #c6d4e3;
    color: #2b466a;
}

body.theme-light .users-table .btn-outline-secondary:hover {
    background: #ecf3fb;
    border-color: #9db2cb;
    color: #163251;
}

body.theme-dim .users-avatar-cell,
body.theme-dark .users-avatar-cell {
    background: linear-gradient(180deg, rgba(54, 66, 85, 0.95) 0%, rgba(44, 55, 71, 0.95) 100%) !important;
}
/* BACKOFFICE_USERS_PREMIUM_REFRESH_END */

/* INBOX_SPRINT_HARDENING_START
   Ajustes finais de UX: legibilidade de tickets fechados, estados consistentes
   e scroll independente entre lista de tickets e conversa. */

#viewInbox {
    height: calc(100vh - 154px);
    overflow: hidden;
}

#viewInbox > .inbox-shell {
    height: 100%;
    min-height: 640px;
    overflow: hidden;
    align-items: stretch;
}

#viewInbox .inbox-col,
#viewInbox .inbox-list-panel,
#viewInbox .inbox-list-shell,
#viewInbox .chat-panel-wrap,
#viewInbox .chat-detail-shell,
#viewInbox .chat-shell,
#viewInbox .ticket-list,
#viewInbox .chat-area {
    min-height: 0;
}

#viewInbox .inbox-col,
#viewInbox .inbox-list-panel,
#viewInbox .inbox-list-shell,
#viewInbox .chat-panel-wrap,
#viewInbox .chat-detail-shell,
#viewInbox .chat-shell {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 100%;
}

#viewInbox .inbox-list-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

#viewInbox .chat-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

#viewInbox .ticket-list {
    height: auto !important;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

#viewInbox .chat-area {
    height: auto !important;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding-bottom: 24px;
}

#viewInbox .chat-composer {
    position: relative;
    z-index: 12;
    margin-top: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.24);
    background: inherit;
}

#viewInbox .ticket-item.ticket-closed {
    opacity: 1 !important;
    filter: none !important;
    -webkit-filter: none !important;
}

#viewInbox .ticket-item.ticket-closed .ticket-pill,
#viewInbox .ticket-item.ticket-closed .ticket-ref,
#viewInbox .ticket-item.ticket-closed .ticket-owner,
#viewInbox .ticket-item.ticket-closed .ticket-meta,
#viewInbox .ticket-item.ticket-closed .ticket-contact,
#viewInbox .ticket-item.ticket-closed .ticket-subject {
    filter: none !important;
    -webkit-filter: none !important;
}

body.theme-light #viewInbox .ticket-item.ticket-closed {
    background: linear-gradient(180deg, #f2f6fb 0%, #e9eff6 100%);
    border-color: #c8d4e2;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.38), 0 10px 18px rgba(15, 23, 42, 0.12);
}

body.theme-light #viewInbox .ticket-item.ticket-closed .ticket-subject {
    color: #24364f !important;
}

body.theme-light #viewInbox .ticket-item.ticket-closed .ticket-contact,
body.theme-light #viewInbox .ticket-item.ticket-closed .ticket-meta,
body.theme-light #viewInbox .ticket-item.ticket-closed .ticket-owner {
    color: #445b79 !important;
}

body.theme-dim #viewInbox .ticket-item.ticket-closed,
body.theme-dark #viewInbox .ticket-item.ticket-closed {
    background: linear-gradient(180deg, #47586f 0%, #3e4f66 100%);
    border-color: #91a6c2;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 12px 22px rgba(2, 8, 18, 0.34);
}

body.theme-dim #viewInbox .ticket-item.ticket-closed .ticket-subject,
body.theme-dark #viewInbox .ticket-item.ticket-closed .ticket-subject {
    color: #f7fbff !important;
}

body.theme-dim #viewInbox .ticket-item.ticket-closed .ticket-contact,
body.theme-dark #viewInbox .ticket-item.ticket-closed .ticket-contact,
body.theme-dim #viewInbox .ticket-item.ticket-closed .ticket-meta,
body.theme-dark #viewInbox .ticket-item.ticket-closed .ticket-meta,
body.theme-dim #viewInbox .ticket-item.ticket-closed .ticket-owner,
body.theme-dark #viewInbox .ticket-item.ticket-closed .ticket-owner {
    color: #dde8f8 !important;
}

body.theme-dim #viewInbox .ticket-item.ticket-closed .ticket-pill--state-closed,
body.theme-dark #viewInbox .ticket-item.ticket-closed .ticket-pill--state-closed {
    background: #ecf3ff;
    color: #1f3551;
    border-color: #c9d8ef;
}

body.theme-dim #viewInbox .ticket-item.ticket-closed .ticket-pill--priority-normal,
body.theme-dark #viewInbox .ticket-item.ticket-closed .ticket-pill--priority-normal {
    background: #d7fbe7;
    color: #0f5132;
    border-color: #9de7c1;
}

body.theme-dim #viewInbox .ticket-item.ticket-closed .ticket-pill--priority-low,
body.theme-dark #viewInbox .ticket-item.ticket-closed .ticket-pill--priority-low {
    background: #e5edf8;
    color: #2d4362;
    border-color: #c4d2e6;
}

body.theme-dim #viewInbox .ticket-item.ticket-closed .ticket-divider,
body.theme-dark #viewInbox .ticket-item.ticket-closed .ticket-divider {
    background: rgba(214, 226, 244, 0.42);
}

body.theme-light #viewInbox .ticket-item .ticket-subject.fw-bold {
    color: #0f5132;
}

#viewInbox .msg-user {
    background: linear-gradient(140deg, var(--brand-primary), var(--brand-primary-dark)) !important;
    color: #ffffff !important;
    border: 1px solid var(--brand-primary-dark) !important;
    box-shadow: 0 10px 22px rgba(80, 200, 120, 0.24) !important;
}

#viewInbox .msg-user .msg-author,
#viewInbox .msg-user .msg-text,
#viewInbox .msg-user .msg-meta,
#viewInbox .msg-user .msg-time {
    color: #ffffff !important;
}

body.theme-dim #viewInbox .msg-user,
body.theme-dark #viewInbox .msg-user {
    background: linear-gradient(140deg, #3f6753 0%, #325343 100%) !important;
    border-color: #557767 !important;
    color: #f4fbf6 !important;
    box-shadow: 0 8px 16px rgba(2, 8, 20, 0.22) !important;
}

body.theme-dim #viewInbox .msg-user .msg-author,
body.theme-dark #viewInbox .msg-user .msg-author {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #f4fbf6 !important;
}

body.theme-dim #viewInbox .msg-user .msg-text,
body.theme-dark #viewInbox .msg-user .msg-text,
body.theme-dim #viewInbox .msg-user .msg-meta,
body.theme-dark #viewInbox .msg-user .msg-meta,
body.theme-dim #viewInbox .msg-user .msg-time,
body.theme-dark #viewInbox .msg-user .msg-time {
    color: #f4fbf6 !important;
}

body.theme-dim #viewInbox .msg-admin,
body.theme-dark #viewInbox .msg-admin {
    background: linear-gradient(180deg, #2c384b 0%, #263345 100%) !important;
    border-color: #53627a !important;
    color: #eef4ff !important;
    box-shadow: 0 10px 22px rgba(2, 8, 20, 0.28) !important;
}

body.theme-dim #viewInbox .msg-admin .msg-author,
body.theme-dark #viewInbox .msg-admin .msg-author,
body.theme-dim #viewInbox .msg-admin .msg-text,
body.theme-dark #viewInbox .msg-admin .msg-text,
body.theme-dim #viewInbox .msg-admin .msg-meta,
body.theme-dark #viewInbox .msg-admin .msg-meta,
body.theme-dim #viewInbox .msg-admin .msg-time,
body.theme-dark #viewInbox .msg-admin .msg-time {
    color: #eef4ff !important;
}

body.theme-dim #viewInbox .ticket-item .ticket-subject.fw-bold,
body.theme-dark #viewInbox .ticket-item .ticket-subject.fw-bold {
    color: #ecf7ff;
}

body.theme-dim #viewInbox .chat-composer-send,
body.theme-dark #viewInbox .chat-composer-send {
    background: linear-gradient(180deg, #607186 0%, #4a5a6f 100%) !important;
    border-color: #6c7c92 !important;
    box-shadow: 0 8px 16px rgba(2, 8, 20, 0.24) !important;
}

body.theme-dim #viewInbox .chat-composer-send:hover,
body.theme-dark #viewInbox .chat-composer-send:hover,
body.theme-dim #viewInbox .chat-composer-send:focus,
body.theme-dark #viewInbox .chat-composer-send:focus {
    background: linear-gradient(180deg, #6b7d93 0%, #566780 100%) !important;
    border-color: #74869d !important;
}

body.theme-light #viewInbox .no-ticket-state {
    background: linear-gradient(180deg, #ffffff 0%, #f2f7ff 100%);
    border-color: #d3deec;
}

body.theme-dim #viewInbox .no-ticket-state,
body.theme-dark #viewInbox .no-ticket-state {
    background: linear-gradient(180deg, #2e3b4f 0%, #253244 100%);
    border-color: #556985;
}

body.theme-dim #viewInbox .no-ticket-state h6,
body.theme-dark #viewInbox .no-ticket-state h6 {
    color: #f0f6ff;
}

body.theme-dim #viewInbox .no-ticket-state p,
body.theme-dark #viewInbox .no-ticket-state p,
body.theme-dim #viewInbox .no-ticket-state li,
body.theme-dark #viewInbox .no-ticket-state li {
    color: #d2def0 !important;
}

@media (max-width: 1399.98px) and (min-width: 992px) {
    #viewInbox .chat-ticket-header {
        gap: 14px;
    }

    #viewInbox .chat-ticket-controls {
        width: min(100%, 244px);
    }

    #viewInbox .chat-ticket-tools {
        gap: 6px;
    }

    #viewInbox .chat-ticket-tools .form-select {
        min-width: 0;
    }

    #viewInbox .chat-composer-input {
        grid-template-columns: minmax(0, 1fr) 152px;
    }

    #viewInbox .chat-area {
        padding-inline: 16px;
    }

    #viewInbox > .inbox-shell {
        flex-wrap: nowrap;
    }

    #viewInbox .inbox-list-col {
        flex: 0 0 340px;
        max-width: 340px;
    }

    #viewInbox .inbox-detail-col {
        flex: 1 1 0;
        max-width: calc(100% - 340px);
        padding-top: 0;
    }
}

@media (max-width: 1199.98px) and (min-width: 992px) {
    #viewInbox .chat-ticket-actions .btn {
        font-size: 0.86rem;
        padding-inline: 8px;
    }
}

@media (max-width: 991.98px) {
    #viewInbox > .inbox-shell {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    #viewInbox .inbox-col,
    #viewInbox .inbox-list-panel,
    #viewInbox .chat-panel-wrap,
    #viewInbox .chat-shell {
        height: auto;
        overflow: visible;
    }

    #viewInbox .ticket-list,
    #viewInbox .chat-area {
        max-height: 56vh;
    }
}

.inbox-filters-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 0;
}

.inbox-filters-heading {
    min-width: 0;
    flex: 1 1 auto;
}

.inbox-filters-eyebrow {
    margin-bottom: 8px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.inbox-toolbar-actions {
    flex: 0 0 auto;
}

#inboxFiltersCollapse {
    margin-top: 12px;
}

.inbox-view-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    margin-bottom: 12px;
}

.inbox-summary-primary {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(15, 23, 42, 0.07);
    color: var(--text-main);
}

.inbox-summary-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.72);
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.inbox-summary-pill--accent {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.24);
    color: #0f766e;
}

.inbox-summary-pill--muted {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.16);
    color: #1d4ed8;
}

.inbox-summary-pill--search {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.22);
    color: #9a3412;
}

.inbox-highlight-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.inbox-highlight-card {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.9) 100%);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.07);
}

.inbox-highlight-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.inbox-highlight-card--accent {
    border-color: rgba(16, 185, 129, 0.24);
    background: linear-gradient(180deg, rgba(236, 253, 245, 0.96) 0%, rgba(220, 252, 231, 0.92) 100%);
}

.inbox-highlight-card--warning {
    border-color: rgba(245, 158, 11, 0.28);
    background: linear-gradient(180deg, rgba(255, 247, 237, 0.96) 0%, rgba(255, 237, 213, 0.92) 100%);
}

.inbox-highlight-label {
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.inbox-highlight-value {
    font-size: 1.1rem;
    line-height: 1;
    font-weight: 800;
    color: var(--text-main);
    flex: 0 0 auto;
    text-align: right;
}

.inbox-highlight-note {
    font-size: 0.72rem;
    line-height: 1.25;
    color: var(--text-muted);
}

.inbox-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.inbox-filter-field {
    min-width: 0;
}

.inbox-filter-field--search {
    grid-column: 1 / -1;
}

.inbox-filter-label {
    display: inline-flex;
    margin-bottom: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
}

.inbox-search-group .input-group-text,
.inbox-search-group .form-control,
.inbox-search-group .btn,
.inbox-filter-grid .form-select,
.inbox-advanced-block .form-control,
.inbox-advanced-block .btn {
    min-height: 40px;
    border-radius: 11px;
}

.ticket-subject-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.ticket-unread-dot {
    flex: 0 0 10px;
    width: 10px;
    height: 10px;
    margin-top: 6px;
    border-radius: 999px;
    background: linear-gradient(180deg, #fb923c 0%, #f97316 100%);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.16);
}

.ticket-item-aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex: 0 0 auto;
    margin-left: 12px;
}

.ticket-item-status {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
}

.ticket-item-signal-cluster {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ticket-item-footer {
    align-items: center;
}

.ticket-item.active .ticket-unread-dot {
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.18);
}

.chat-ticket-controls {
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.94) 0%, rgba(241, 245, 249, 0.92) 100%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.chat-ticket-controls-title {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.chat-ticket-action-note {
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--text-muted);
}

.chat-ticket-close-action {
    color: var(--text-main);
}

.chat-composer-send {
    min-width: 170px;
    padding-inline: 20px;
}

.chat-composer-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-composer-toggle .form-check-input {
    margin-top: 0;
}

#viewInbox .chat-topbar {
    padding: 0.95rem 1rem !important;
}

#viewInbox .chat-ticket-topline {
    margin-bottom: 6px;
}

#viewInbox .chat-ticket-header {
    gap: 12px;
}

#viewInbox .chat-ticket-contact-line {
    margin-top: 4px;
}

#viewInbox .chat-ticket-context-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
}

#viewInbox .chat-ticket-header-tools {
    display: inline-flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 10px;
    flex: 0 0 auto;
}

#viewInbox .chat-thread-sort-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 210px;
}

#viewInbox .chat-thread-sort-label {
    margin: 0;
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

#viewInbox .chat-thread-sort-select {
    min-height: 36px;
    border-radius: 12px;
    padding-inline-end: 2rem;
    font-size: 0.82rem;
    font-weight: 700;
}

#viewInbox .chat-ticket-options-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 36px;
    padding-inline: 12px;
    border-radius: 12px;
    white-space: nowrap;
    flex: 0 0 auto;
}

#viewInbox .chat-ticket-options-chevron {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

#viewInbox .chat-ticket-options-toggle[aria-expanded="true"] .chat-ticket-options-chevron {
    transform: rotate(180deg);
}

#viewInbox .chat-ticket-options-collapse {
    margin-top: 10px;
}

#viewInbox .chat-ticket-controls {
    width: 100%;
    max-width: 420px;
    padding: 10px 12px;
    gap: 8px;
}

#viewInbox .chat-ticket-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#viewInbox .chat-ticket-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#viewInbox .chat-ticket-actions .btn {
    min-height: 36px;
}

#viewInbox .chat-ticket-save-action {
    position: relative;
}

#viewInbox .chat-ticket-save-action::before {
    content: "\f0c7";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 8px;
}

#viewInbox .chat-ticket-action-note {
    margin-top: -2px;
}

#viewInbox .chat-area {
    padding-top: 14px;
}

#viewInbox .chat-composer {
    padding-top: 0.9rem !important;
    padding-bottom: 0.9rem !important;
}

#viewInbox .chat-composer-heading {
    gap: 3px;
}

#viewInbox .chat-composer-copy strong {
    color: var(--text-main);
}

.inbox-progress-overlay {
    position: fixed;
    inset: auto 18px 18px auto;
    background: transparent;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    z-index: 9998;
    pointer-events: none;
}

.inbox-progress-card {
    min-width: 190px;
    padding: 12px 14px;
    border-radius: 14px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.16);
}

body.theme-dim #viewInbox .inbox-summary-primary,
body.theme-dark #viewInbox .inbox-summary-primary {
    background: rgba(203, 213, 225, 0.12);
    color: #eef4ff;
}

body.theme-dim #viewInbox .inbox-summary-pill,
body.theme-dark #viewInbox .inbox-summary-pill {
    background: rgba(30, 41, 59, 0.74);
    border-color: rgba(148, 163, 184, 0.28);
    color: #dbe7f5;
}

body.theme-dim #viewInbox .inbox-summary-pill--accent,
body.theme-dark #viewInbox .inbox-summary-pill--accent {
    background: rgba(16, 185, 129, 0.18);
    color: #bbf7d0;
}

body.theme-dim #viewInbox .inbox-summary-pill--muted,
body.theme-dark #viewInbox .inbox-summary-pill--muted {
    background: rgba(59, 130, 246, 0.18);
    color: #dbeafe;
}

body.theme-dim #viewInbox .inbox-summary-pill--search,
body.theme-dark #viewInbox .inbox-summary-pill--search {
    background: rgba(245, 158, 11, 0.18);
    color: #fde68a;
}

body.theme-dim #viewInbox .inbox-highlight-card,
body.theme-dark #viewInbox .inbox-highlight-card {
    border-color: rgba(148, 163, 184, 0.24);
    background: linear-gradient(180deg, rgba(37, 47, 63, 0.96) 0%, rgba(31, 41, 55, 0.94) 100%);
    box-shadow: 0 14px 24px rgba(2, 8, 20, 0.22);
}

body.theme-dim #viewInbox .inbox-highlight-card--accent,
body.theme-dark #viewInbox .inbox-highlight-card--accent {
    background: linear-gradient(180deg, rgba(26, 71, 56, 0.98) 0%, rgba(21, 60, 47, 0.96) 100%);
    border-color: rgba(52, 211, 153, 0.28);
}

body.theme-dim #viewInbox .inbox-highlight-card--warning,
body.theme-dark #viewInbox .inbox-highlight-card--warning {
    background: linear-gradient(180deg, rgba(98, 58, 18, 0.96) 0%, rgba(78, 45, 13, 0.94) 100%);
    border-color: rgba(251, 191, 36, 0.28);
}

body.theme-dim #viewInbox .inbox-highlight-value,
body.theme-dark #viewInbox .inbox-highlight-value {
    color: #f8fbff;
}

body.theme-dim #viewInbox .chat-thread-sort-select,
body.theme-dark #viewInbox .chat-thread-sort-select {
    background: rgba(20, 29, 43, 0.9);
    border-color: rgba(122, 137, 160, 0.34);
    color: #eef4ff;
}

body.theme-dim #viewInbox .ticket-unread-dot,
body.theme-dark #viewInbox .ticket-unread-dot {
    box-shadow: 0 0 0 4px rgba(251, 146, 60, 0.18);
}

body.theme-dim #viewInbox .chat-ticket-controls,
body.theme-dark #viewInbox .chat-ticket-controls {
    background: linear-gradient(180deg, rgba(35, 45, 60, 0.96) 0%, rgba(29, 38, 52, 0.94) 100%);
    border-color: rgba(122, 137, 160, 0.28);
    box-shadow: 0 14px 26px rgba(2, 8, 20, 0.22);
}

body.theme-dim #viewInbox .chat-ticket-close-action,
body.theme-dark #viewInbox .chat-ticket-close-action {
    color: #eef4ff;
}

body.theme-dim #viewInbox .msg-admin .msg-author,
body.theme-dark #viewInbox .msg-admin .msg-author {
    background: rgba(191, 219, 254, 0.16) !important;
    border: 1px solid rgba(147, 197, 253, 0.26);
    color: #dbeafe !important;
}

body.theme-dim #viewInbox .msg-admin .msg-meta,
body.theme-dark #viewInbox .msg-admin .msg-meta,
body.theme-dim #viewInbox .msg-admin .msg-time,
body.theme-dark #viewInbox .msg-admin .msg-time {
    color: #e2e8f0 !important;
}

body.theme-dim #viewInbox .chat-ticket-options-toggle,
body.theme-dark #viewInbox .chat-ticket-options-toggle {
    background: rgba(36, 48, 66, 0.78);
    border-color: rgba(122, 137, 160, 0.34);
    color: #eef4ff;
}

body.theme-dim #viewInbox .chat-ticket-options-toggle:hover,
body.theme-dark #viewInbox .chat-ticket-options-toggle:hover,
body.theme-dim #viewInbox .chat-ticket-options-toggle:focus-visible,
body.theme-dark #viewInbox .chat-ticket-options-toggle:focus-visible {
    background: rgba(45, 59, 80, 0.92);
    border-color: rgba(148, 163, 184, 0.46);
    color: #f8fbff;
}

body.theme-dim #viewInbox .chat-composer-copy strong,
body.theme-dark #viewInbox .chat-composer-copy strong,
body.theme-dim #viewInbox .ticket-item.active .ticket-contact,
body.theme-dark #viewInbox .ticket-item.active .ticket-contact,
body.theme-dim #viewInbox .ticket-item.active .ticket-owner,
body.theme-dark #viewInbox .ticket-item.active .ticket-owner {
    color: #f8fbff;
}

@media (max-width: 1399.98px) and (min-width: 992px) {
    .inbox-highlight-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1199.98px) {
    .inbox-filter-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    #viewInbox .chat-ticket-context-row {
        flex-direction: column;
        align-items: stretch;
    }

    #viewInbox .chat-ticket-header-tools {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    #viewInbox .chat-thread-sort-wrap {
        min-width: 0;
        width: 100%;
    }

    #viewInbox .chat-ticket-options-toggle {
        width: 100%;
    }
}

@media (max-width: 991.98px) {
    .inbox-filters-header {
        flex-direction: column;
        align-items: stretch;
    }

    .inbox-highlight-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    #viewInbox .chat-ticket-tools,
    #viewInbox .chat-ticket-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .ticket-item-header,
    .ticket-item-footer {
        align-items: flex-start;
    }

    .ticket-item-aside {
        margin-left: 0;
        width: 100%;
        align-items: flex-start;
    }

    .ticket-item-signal-cluster {
        justify-content: flex-start;
    }

    .chat-composer-send {
        min-width: 100%;
    }
}

/* INBOX_SPRINT_HARDENING_END */

/* SUPORTE_PREMIUM_RESTORE_START */
body.page-suporte {
    font-family: "Montserrat", sans-serif;
}

body.page-suporte.theme-light {
    background:
        radial-gradient(1200px 420px at 6% -10%, rgba(80, 200, 120, 0.1) 0%, rgba(80, 200, 120, 0) 56%),
        linear-gradient(180deg, #f5f8fc 0%, #eef3f8 100%);
}

body.page-suporte.theme-dark {
    background:
        radial-gradient(1200px 520px at 8% -14%, rgba(80, 200, 120, 0.18) 0%, rgba(80, 200, 120, 0) 62%),
        linear-gradient(180deg, #1b2431 0%, #151d28 100%);
}

body.page-suporte .top-bar {
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
}

body.page-suporte .support-page {
    max-width: 1100px;
    margin: 0 auto;
}

body.page-suporte .support-shell-card {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.12);
    padding: 18px 18px 14px;
}

body.page-suporte.theme-dark .support-shell-card {
    box-shadow: 0 20px 44px rgba(2, 8, 20, 0.42);
}

body.page-suporte .support-page-title {
    margin-bottom: 12px;
    font-size: clamp(1.28rem, 2.2vw, 1.95rem);
    line-height: 1.05;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

body.page-suporte .support-ticket-header {
    padding: 8px 0 12px;
    border-bottom: 1px solid rgba(128, 146, 170, 0.2);
}

body.page-suporte .support-ref-badge {
    border-radius: 999px !important;
    letter-spacing: 0.03em;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.38rem 0.65rem;
}

body.page-suporte .support-ticket-subject {
    margin-top: 2px;
    font-size: clamp(0.92rem, 1.6vw, 1.38rem);
    text-transform: uppercase;
    letter-spacing: 0.01em;
}

body.page-suporte .ticket-badge {
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
}

body.page-suporte .chat-container {
    margin-top: 12px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(247, 251, 255, 0.92) 100%);
}

body.page-suporte.theme-dark .chat-container {
    background: linear-gradient(180deg, rgba(37, 47, 62, 0.94) 0%, rgba(30, 40, 55, 0.94) 100%);
    border-color: #46566e;
}

body.page-suporte .chat-top {
    display: flex;
    align-items: center;
    font-size: 0.87rem;
    letter-spacing: 0.01em;
}

body.page-suporte .chat-messages {
    background:
        radial-gradient(circle at 90% 2%, rgba(80, 200, 120, 0.1) 0%, rgba(80, 200, 120, 0) 44%),
        linear-gradient(180deg, rgba(245, 249, 255, 0.68) 0%, rgba(241, 246, 252, 0.68) 100%);
}

body.page-suporte.theme-dark .chat-messages {
    background:
        radial-gradient(circle at 90% 2%, rgba(80, 200, 120, 0.14) 0%, rgba(80, 200, 120, 0) 44%),
        linear-gradient(180deg, rgba(28, 37, 50, 0.7) 0%, rgba(24, 32, 44, 0.72) 100%);
}

body.page-suporte .msg-bubble {
    border-radius: 16px;
}

body.page-suporte .msg-support {
    background: linear-gradient(180deg, #ffffff 0%, #f5f8fd 100%);
}

body.page-suporte.theme-dark .msg-support {
    background: linear-gradient(180deg, #2c384b 0%, #263345 100%);
    border-color: #53627a;
    color: #eef4ff;
}

body.page-suporte .msg-me {
    box-shadow: 0 12px 24px rgba(22, 95, 210, 0.28);
}

body.page-suporte.theme-dark .msg-me {
    box-shadow: 0 14px 26px rgba(16, 94, 201, 0.36);
}

body.page-suporte .chat-input {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 251, 255, 0.98) 100%);
}

body.page-suporte.theme-dark .chat-input {
    background: linear-gradient(180deg, rgba(36, 46, 60, 0.98) 0%, rgba(31, 40, 54, 0.98) 100%);
    border-top-color: #4c5d75;
}

body.page-suporte .chat-input .form-control {
    border-radius: 12px !important;
    font-size: 0.96rem;
}

body.page-suporte .chat-input .btn {
    border-radius: 12px !important;
}

body.page-suporte .back-link {
    margin-top: 10px;
}

body.page-suporte .back-link a {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    opacity: 0.9;
}

body.page-suporte .back-link a:hover {
    opacity: 1;
    color: var(--brand-primary) !important;
}

@media (max-width: 767.98px) {
    body.page-suporte .support-page {
        padding-top: 8px !important;
        padding-left: 8px;
        padding-right: 8px;
    }

    body.page-suporte .support-shell-card {
        border-radius: 14px;
        padding: 10px 10px 8px;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.15);
    }

    body.page-suporte .support-page-title {
        font-size: 1.05rem !important;
        margin-bottom: 7px !important;
        text-align: left !important;
    }

    body.page-suporte .support-ticket-subject {
        font-size: 0.94rem !important;
        line-height: 1.18;
        margin-bottom: 0;
    }

    body.page-suporte .ticket-badge {
        font-size: 0.63rem !important;
        padding: 0.28rem 0.56rem !important;
    }

    body.page-suporte .chat-container {
        height: calc(100dvh - 210px) !important;
        min-height: 410px !important;
        margin-top: 8px;
    }

    body.page-suporte .chat-top {
        font-size: 0.79rem !important;
        padding: 9px 10px !important;
    }

    body.page-suporte .chat-messages {
        padding: 9px 7px 7px !important;
    }

    body.page-suporte .msg-bubble {
        max-width: 94% !important;
        font-size: 0.95rem !important;
        padding: 9px 9px 8px !important;
    }

    body.page-suporte .msg-author {
        font-size: 0.73rem !important;
    }

    body.page-suporte .msg-meta {
        font-size: 0.69rem !important;
    }

    body.page-suporte .chat-input {
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom)) !important;
    }

    body.page-suporte .chat-composer {
        gap: 6px !important;
    }

    body.page-suporte .chat-input .form-control {
        min-height: 44px !important;
        max-height: 132px !important;
        font-size: 0.92rem !important;
        padding: 8px 10px !important;
    }

    body.page-suporte .chat-input .btn {
        min-height: 44px !important;
        min-width: 86px !important;
        padding: 0 12px !important;
        font-size: 0.96rem !important;
    }

    body.page-suporte .chat-hint {
        display: none;
    }

    body.page-suporte .back-link {
        margin-top: 7px !important;
        margin-bottom: 1px !important;
        text-align: left !important;
    }
}
/* SUPORTE_PREMIUM_RESTORE_END */

/* PUBLIC_THEME_UNIFICATION_START */
body.page-candidatura,
body.page-gestao,
body.page-resultados,
body.page-suporte {
    font-family: "Montserrat", sans-serif;
}

body.page-candidatura.theme-light,
body.page-gestao.theme-light,
body.page-resultados.theme-light,
body.page-suporte.theme-light {
    background:
        radial-gradient(1180px 430px at 8% -14%, rgba(80, 200, 120, 0.11) 0%, rgba(80, 200, 120, 0) 60%),
        linear-gradient(180deg, #f4f8fd 0%, #edf3fa 100%);
}

body.page-candidatura.theme-dark,
body.page-gestao.theme-dark,
body.page-resultados.theme-dark,
body.page-suporte.theme-dark {
    background:
        radial-gradient(1200px 520px at 8% -14%, rgba(80, 200, 120, 0.17) 0%, rgba(80, 200, 120, 0) 62%),
        linear-gradient(180deg, #1b2431 0%, #151d28 100%);
}

body.page-candidatura .top-bar,
body.page-gestao .top-bar,
body.page-resultados .top-bar,
body.page-suporte .top-bar {
    padding: 0.92rem 0;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(247, 251, 255, 0.96) 100%);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

body.page-candidatura.theme-dark .top-bar,
body.page-gestao.theme-dark .top-bar,
body.page-resultados.theme-dark .top-bar,
body.page-suporte.theme-dark .top-bar {
    background: linear-gradient(180deg, rgba(32, 43, 59, 0.94) 0%, rgba(28, 38, 52, 0.94) 100%);
    border-bottom-color: #3e4d63;
    box-shadow: 0 10px 24px rgba(2, 8, 20, 0.38);
}

body.page-candidatura .brand-logo,
body.page-gestao .brand-logo,
body.page-resultados .brand-logo,
body.page-suporte .brand-logo {
    color: #0f172a;
}

body.page-candidatura.theme-dark .brand-logo,
body.page-gestao.theme-dark .brand-logo,
body.page-resultados.theme-dark .brand-logo,
body.page-suporte.theme-dark .brand-logo {
    color: #eef4ff;
}

body.page-candidatura .lang-toggle-btn,
body.page-gestao .lang-toggle-btn,
body.page-resultados .lang-toggle-btn,
body.page-suporte .lang-toggle-btn {
    border-radius: 12px !important;
    border-color: #d7dfeb !important;
    color: #1f2937 !important;
    background: rgba(255, 255, 255, 0.85) !important;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

body.page-candidatura.theme-dark .lang-toggle-btn,
body.page-gestao.theme-dark .lang-toggle-btn,
body.page-resultados.theme-dark .lang-toggle-btn,
body.page-suporte.theme-dark .lang-toggle-btn {
    border-color: #4f6078 !important;
    color: #e8eef8 !important;
    background: rgba(38, 50, 68, 0.9) !important;
    box-shadow: 0 8px 20px rgba(2, 8, 20, 0.34);
}

body.page-candidatura .top-bar .btn-link,
body.page-gestao .top-bar .btn-link,
body.page-resultados .top-bar .btn-link,
body.page-suporte .top-bar .btn-link {
    color: #1f2937 !important;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid #d7dfeb;
    border-radius: 12px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

body.page-candidatura .top-bar .btn-link:hover,
body.page-gestao .top-bar .btn-link:hover,
body.page-resultados .top-bar .btn-link:hover,
body.page-suporte .top-bar .btn-link:hover {
    color: #0f172a !important;
    border-color: #50c878;
}

body.page-candidatura.theme-dark .top-bar .btn-link,
body.page-gestao.theme-dark .top-bar .btn-link,
body.page-resultados.theme-dark .top-bar .btn-link,
body.page-suporte.theme-dark .top-bar .btn-link {
    color: #e8eef8 !important;
    background: rgba(38, 50, 68, 0.9);
    border-color: #4f6078;
    box-shadow: 0 9px 22px rgba(2, 8, 20, 0.36);
}

body.page-candidatura .public-shell,
body.page-gestao .public-shell,
body.page-resultados .public-shell,
body.page-suporte .support-page {
    max-width: 1120px;
}

body.page-candidatura .public-shell-candidatura,
body.page-gestao .public-shell,
body.page-resultados .public-shell {
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 18px 18px 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(248, 252, 255, 0.92) 100%);
    box-shadow: 0 20px 42px rgba(15, 23, 42, 0.1);
}

body.page-gestao .gestao-hero-card {
    margin-bottom: 1.1rem !important;
    padding-top: 1.15rem;
    padding-bottom: 1.15rem;
}

body.page-gestao .gestao-hero-card h2 {
    color: #12233f;
    letter-spacing: 0.01em;
}

body.page-gestao .btn-gestao-receipt {
    min-height: 46px;
    border-radius: 11px;
    border: 1px solid #344056;
    background: linear-gradient(180deg, #1f2734 0%, #171f2b 100%);
    box-shadow: 0 12px 22px rgba(8, 16, 28, 0.2);
}

body.page-gestao .btn-gestao-receipt:hover {
    background: linear-gradient(180deg, #273245 0%, #1f2938 100%);
    transform: translateY(-1px);
}

body.page-gestao .participant-card {
    border: 1px solid #c8d3e4 !important;
    border-radius: 14px;
    box-shadow: 0 14px 30px rgba(12, 26, 51, 0.1) !important;
    overflow: hidden;
}

body.page-gestao .participant-card .card-header-custom {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(246, 250, 255, 0.98) 100%) !important;
    border-bottom: 1px solid #e4ebf5 !important;
    padding: 1rem 1.2rem !important;
}

body.page-gestao .participant-card .card-header-custom h6 {
    color: #12233f;
    font-size: 0.99rem;
    letter-spacing: 0.02em;
}

body.page-gestao .participant-card .card-body {
    padding: 1.2rem 1.2rem 1.3rem !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(249, 252, 255, 0.97) 100%);
}

body.page-gestao .participant-card .form-label {
    color: #546b8b;
    letter-spacing: 0.05em;
    font-size: 0.72rem;
}

body.page-gestao .participant-card .form-control,
body.page-gestao .participant-card .form-select {
    min-height: 48px;
    border-radius: 10px;
    border-color: #c1cddd;
}

body.page-gestao .participant-card .form-control:focus,
body.page-gestao .participant-card .form-select:focus {
    border-color: #49c786;
    box-shadow: 0 0 0 3px rgba(73, 199, 134, 0.18);
}

body.page-gestao #pnlStatusMsg.alert,
body.page-gestao #pnlSuccess.alert {
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

body.page-gestao #pnlStatusMsg.alert {
    background: linear-gradient(180deg, #fff8e9 0%, #fff4d8 100%);
    color: #8a5a00;
    border: 1px solid #f2d491 !important;
}

body.page-gestao #pnlSuccess.alert {
    background: linear-gradient(180deg, #edfbf3 0%, #e2f7eb 100%);
    color: #146b43;
    border: 1px solid #a8e2bf !important;
}

body.page-gestao .d-flex.flex-wrap.justify-content-between.align-items-center.mt-5.border-top.pt-4 {
    border-top-color: #d9e3f1 !important;
    padding-top: 1.1rem !important;
    margin-top: 2rem !important;
}

body.page-gestao.theme-dark .gestao-hero-card h2 {
    color: #f2f6fd;
}

body.page-gestao.theme-dark .btn-gestao-receipt {
    border-color: #596f8e;
    background: linear-gradient(180deg, #2f3c51 0%, #263245 100%);
    box-shadow: 0 14px 24px rgba(2, 8, 20, 0.42);
}

body.page-gestao.theme-dark .participant-card {
    border-color: #50627c !important;
    box-shadow: 0 20px 36px rgba(2, 8, 20, 0.42) !important;
}

body.page-gestao.theme-dark .participant-card .card-header-custom {
    background: linear-gradient(180deg, rgba(45, 58, 78, 0.93) 0%, rgba(37, 49, 67, 0.96) 100%) !important;
    border-bottom-color: rgba(128, 147, 173, 0.28) !important;
}

body.page-gestao.theme-dark .participant-card .card-header-custom h6 {
    color: #edf3fe;
}

body.page-gestao.theme-dark .participant-card .card-body {
    background: linear-gradient(180deg, rgba(35, 47, 64, 0.92) 0%, rgba(30, 41, 56, 0.95) 100%);
}

body.page-gestao.theme-dark .participant-card .form-label {
    color: #aec2de;
}

body.page-gestao.theme-dark .participant-card .form-control,
body.page-gestao.theme-dark .participant-card .form-select {
    border-color: #617897;
    background-color: rgba(20, 29, 42, 0.62);
    color: #eef4ff;
}

body.page-gestao.theme-dark #pnlStatusMsg.alert {
    background: linear-gradient(180deg, rgba(96, 73, 26, 0.42) 0%, rgba(78, 57, 18, 0.5) 100%);
    color: #ffdca2;
    border-color: rgba(193, 144, 42, 0.5) !important;
}

body.page-gestao.theme-dark #pnlSuccess.alert {
    background: linear-gradient(180deg, rgba(22, 88, 58, 0.45) 0%, rgba(16, 74, 48, 0.52) 100%);
    color: #b8efd0;
    border-color: rgba(68, 164, 112, 0.54) !important;
}

body.page-gestao.theme-dark .d-flex.flex-wrap.justify-content-between.align-items-center.mt-5.border-top.pt-4 {
    border-top-color: rgba(128, 145, 169, 0.3) !important;
}

@media (max-width: 767.98px) {
    body.page-gestao .gestao-hero-card {
        gap: 0.8rem !important;
        padding: 0.95rem 0.9rem;
    }

    body.page-gestao .gestao-hero-card h2 {
        font-size: 1.32rem;
    }

    body.page-gestao .btn-gestao-receipt {
        width: 100%;
    }

    body.page-gestao .participant-card .card-header-custom {
        padding: 0.88rem 0.85rem !important;
    }

    body.page-gestao .participant-card .card-body {
        padding: 0.95rem 0.85rem 1rem !important;
    }
}

body.page-candidatura.theme-dark .public-shell-candidatura,
body.page-gestao.theme-dark .public-shell,
body.page-resultados.theme-dark .public-shell {
    border-color: #495a71;
    background: linear-gradient(180deg, rgba(38, 49, 65, 0.92) 0%, rgba(31, 41, 56, 0.94) 100%);
    box-shadow: 0 24px 44px rgba(2, 8, 20, 0.4);
}

body.page-resultados .result-card {
    border: 1px solid var(--border-color);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12) !important;
}

body.page-resultados.theme-dark .result-card {
    border-color: #4e5f78;
    box-shadow: 0 18px 36px rgba(2, 8, 20, 0.38) !important;
}

body.page-resultados.theme-dark .result-card .bg-white,
body.page-resultados.theme-dark .result-card .status-header {
    background-color: #273447 !important;
    color: #e8effa !important;
}

body.page-candidatura .footer-clean,
body.page-gestao .footer-clean,
body.page-resultados .footer-clean,
body.page-suporte .footer-clean {
    background: linear-gradient(180deg, #0f1724 0%, #0b121d 100%);
    border-top: 1px solid #253247;
    color: #dbe7f7;
}

body.page-candidatura .footer-clean p,
body.page-gestao .footer-clean p,
body.page-resultados .footer-clean p,
body.page-suporte .footer-clean p {
    color: #c8d6ea !important;
}

body.page-candidatura .footer-clean a,
body.page-gestao .footer-clean a,
body.page-resultados .footer-clean a,
body.page-suporte .footer-clean a {
    color: #f2f6fc !important;
}

body.page-candidatura .footer-clean a:hover,
body.page-gestao .footer-clean a:hover,
body.page-resultados .footer-clean a:hover,
body.page-suporte .footer-clean a:hover {
    color: #50c878 !important;
}

@media (max-width: 767.98px) {
    body.page-candidatura .public-shell-candidatura,
    body.page-gestao .public-shell,
    body.page-resultados .public-shell {
        border-radius: 14px;
        padding: 12px 10px 10px;
    }
}
/* PUBLIC_THEME_UNIFICATION_END */

/* BACKOFFICE_SHELL_SIDEBAR_LOT2_START */
.sidebar {
    padding-bottom: 12px;
}

.sidebar-menu {
    flex: 1 1 auto;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--sidebar-border) transparent;
    padding: 12px 0 20px;
}

.sidebar-edge-toggle {
    top: 84px !important;
    right: -10px !important;
    width: 20px !important;
    height: 46px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(120, 145, 176, 0.34) !important;
    background: linear-gradient(180deg, rgba(249, 252, 255, 0.96) 0%, rgba(237, 244, 251, 0.98) 100%) !important;
    color: var(--sidebar-toggle, #5f738f) !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12) !important;
}

.sidebar-edge-toggle i {
    font-size: 0.76rem;
}

body.theme-dim .sidebar-edge-toggle,
body.theme-dark .sidebar-edge-toggle {
    border-color: rgba(255, 255, 255, 0.1) !important;
    background: linear-gradient(180deg, rgba(18, 24, 34, 0.98) 0%, rgba(10, 14, 21, 0.98) 100%) !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.24) !important;
}

.sidebar-edge-toggle:hover {
    color: var(--sidebar-toggle-hover, #1e3a5f) !important;
    border-color: rgba(80, 200, 120, 0.38) !important;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18) !important;
}

.sidebar-edge-toggle:focus {
    outline: none !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12) !important;
}

.sidebar-edge-toggle:focus-visible {
    outline: 2px solid rgba(80, 200, 120, 0.52) !important;
    outline-offset: 2px;
    box-shadow:
        0 0 0 4px rgba(80, 200, 120, 0.14),
        0 10px 22px rgba(15, 23, 42, 0.18) !important;
}

.sidebar-link,
.sidebar-action-link {
    color: var(--sidebar-link) !important;
}

.sidebar-link .link-text,
.sidebar-action-link .link-text {
    min-width: 0;
    line-height: 1.22;
}

.sidebar-link:hover,
.sidebar-action-link:hover,
.sidebar-link:focus,
.sidebar-link:focus-visible,
.sidebar-action-link:focus,
.sidebar-action-link:focus-visible,
.sidebar-item--submenu:has(.sidebar-submenu.show) > .sidebar-link--has-submenu,
.sidebar-item--submenu:has(.sidebar-submenu .sidebar-link.active) > .sidebar-link--has-submenu,
.sidebar-link--has-submenu.is-group-active {
    background: var(--sidebar-hover) !important;
    color: var(--sidebar-link-hover-text) !important;
}

.sidebar-link:focus,
.sidebar-link:focus-visible,
.sidebar-action-link:focus,
.sidebar-action-link:focus-visible {
    outline: 2px solid rgba(80, 200, 120, 0.72) !important;
    outline-offset: 2px;
    box-shadow:
        0 0 0 4px rgba(80, 200, 120, 0.18),
        0 18px 30px rgba(15, 23, 42, 0.14) !important;
}

.sidebar-link.active,
.sidebar-link[aria-current="page"] {
    background: var(--sidebar-active-bg) !important;
    color: var(--sidebar-active-text) !important;
    border-left-color: #50c878 !important;
    box-shadow: inset 0 0 0 1px rgba(80, 200, 120, 0.24);
}

.sidebar-link i,
.sidebar-action-link i {
    color: var(--sidebar-icon, #ffb347);
}

.sidebar-link.active i,
.sidebar-link[aria-current="page"] i {
    color: var(--sidebar-icon-active, #8af0b3) !important;
}

.sidebar-link--has-submenu {
    padding-right: 18px;
}

.dropdown-icon {
    margin-left: auto;
    font-size: 0.74rem;
    color: var(--sidebar-meta);
    opacity: 0.88;
    transition: transform 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.sidebar-link--has-submenu[aria-expanded="true"] .dropdown-icon,
.sidebar-link--has-submenu.is-group-active .dropdown-icon,
.sidebar-item--submenu:has(.sidebar-submenu.show) > .sidebar-link--has-submenu .dropdown-icon,
.sidebar-item--submenu:has(.sidebar-submenu .sidebar-link.active) > .sidebar-link--has-submenu .dropdown-icon {
    color: var(--sidebar-active-text);
    opacity: 1;
    transform: rotate(180deg);
}

.submenu-cue {
    display: block;
    width: 8px;
    height: 8px;
    margin-left: auto;
    margin-right: 10px;
    border-radius: 999px;
    background: rgba(80, 200, 120, 0.18);
    box-shadow: 0 0 0 3px rgba(80, 200, 120, 0.08);
    opacity: 0;
    transform: scale(0.75);
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-link--has-submenu[aria-expanded="true"] .submenu-cue,
.sidebar-link--has-submenu.is-group-active .submenu-cue,
.sidebar-item--submenu:has(.sidebar-submenu.show) > .sidebar-link--has-submenu .submenu-cue,
.sidebar-item--submenu:has(.sidebar-submenu .sidebar-link.active) > .sidebar-link--has-submenu .submenu-cue {
    opacity: 1;
    transform: scale(1);
    background: var(--sidebar-active-text);
    box-shadow: 0 0 0 4px rgba(80, 200, 120, 0.18);
}

.sidebar-submenu {
    margin: 6px 14px 12px 18px;
    padding: 10px 0 12px;
    border: 1px solid var(--sidebar-border-soft, rgba(255, 255, 255, 0.08));
    border-radius: 18px;
    background: var(--sidebar-submenu-bg, rgba(0, 0, 0, 0.2));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.sidebar-submenu .sidebar-menu {
    padding: 0 0 2px;
    overflow: hidden;
}

.sidebar-submenu .sidebar-link {
    min-height: 44px;
    margin: 2px 8px;
    padding: 10px 14px 10px 18px;
    border-radius: 12px;
    border-left-width: 0;
}

.sidebar-submenu .sidebar-link::before {
    left: 8px;
    top: 9px;
    bottom: 9px;
    width: 3px;
}

.sidebar-submenu .sidebar-link.active,
.sidebar-submenu .sidebar-link[aria-current="page"] {
    background: rgba(80, 200, 120, 0.14) !important;
}

.menu-header {
    margin: 14px 0 4px;
    padding: 14px 20px 8px;
}

.sidebar-footer {
    padding: 14px 14px 16px;
}

.sidebar-footer .user-profile {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px !important;
    padding: 12px;
    border: 1px solid var(--sidebar-footer-border);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.user-avatar {
    width: 40px;
    height: 40px;
    margin-right: 0;
    box-shadow: 0 10px 18px rgba(80, 200, 120, 0.22);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.user-name {
    color: var(--sidebar-user-name);
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email,
.user-role {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    color: var(--sidebar-user-email);
    font-size: 0.74rem;
}

.user-role {
    color: var(--sidebar-user-role);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.sidebar-action-link {
    min-height: 46px;
    gap: 10px;
    padding: 10px 14px !important;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.03);
    font-weight: 700;
}

body.theme-light .sidebar-action-link {
    background: rgba(255, 255, 255, 0.84);
    border-color: rgba(149, 171, 197, 0.5);
    color: #16314d !important;
}

body.theme-dim .sidebar-action-link,
body.theme-dark .sidebar-action-link {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--sidebar-link-hover-text) !important;
}

.sidebar-action-link:hover {
    background: var(--sidebar-hover) !important;
    color: var(--sidebar-link-hover-text) !important;
    border-color: rgba(80, 200, 120, 0.24) !important;
}

.main-content {
    min-width: 0;
}

.top-header {
    gap: 14px;
}

.top-header-main {
    min-width: 0;
}

.top-header-tools {
    flex: 0 1 440px;
    min-width: 0;
}

.event-selector-wrap {
    flex: 1 1 320px;
    max-width: 520px;
}

.main-shell-body {
    padding: 1.5rem !important;
}

body.collapsed .menu-header {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 16px;
    margin: 10px 0 8px;
    padding: 0;
    font-size: 0;
    color: transparent !important;
    background: none;
    overflow: hidden;
}

body.collapsed .menu-header::before {
    content: "";
    width: 18px;
    height: 3px;
    border-radius: 999px;
    background: var(--sidebar-border-soft, rgba(255, 255, 255, 0.12));
    opacity: 0.92;
}

body.collapsed .menu-header::after {
    display: none;
}

body.collapsed .sidebar-brand {
    height: 76px;
    padding: 10px 0 8px;
}

body.collapsed .brand-container {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
}

body.collapsed .brand-dashboard-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-right: 0;
    font-size: 1.04rem;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 179, 71, 0.16) 0%, rgba(255, 179, 71, 0.06) 100%);
    box-shadow:
        inset 0 0 0 1px rgba(255, 179, 71, 0.18),
        0 10px 18px rgba(15, 23, 42, 0.08);
}

body.collapsed .sidebar-link,
body.collapsed .sidebar-action-link {
    width: 56px;
    min-width: 56px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 18px;
}

body.collapsed .sidebar-link {
    min-height: 56px;
    margin-top: 4px;
    margin-bottom: 4px;
    padding: 0 !important;
    border-left-width: 0;
    justify-content: center;
    background: transparent !important;
}

body.collapsed .sidebar-link i,
body.collapsed .sidebar-action-link i {
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 1.12rem;
}

body.collapsed .sidebar-link .badge {
    top: 8px;
    right: 8px;
    min-width: 1.12rem;
    height: 1.12rem;
    padding: 0 0.18rem;
    font-size: 0.58rem;
    transform: none;
    box-shadow: 0 6px 10px rgba(220, 53, 69, 0.2);
}

body.collapsed .sidebar-link.active,
body.collapsed .sidebar-link[aria-current="page"],
body.collapsed .sidebar-link--has-submenu.is-group-active,
body.collapsed .sidebar-item--submenu:has(.sidebar-submenu .sidebar-link.active) > .sidebar-link--has-submenu {
    background: linear-gradient(180deg, rgba(80, 200, 120, 0.24) 0%, rgba(80, 200, 120, 0.12) 100%) !important;
    box-shadow:
        inset 0 0 0 1px rgba(80, 200, 120, 0.34),
        0 12px 22px rgba(18, 40, 66, 0.12);
}

body.collapsed .sidebar-link.active::before,
body.collapsed .sidebar-link[aria-current="page"]::before,
body.collapsed .sidebar-link--has-submenu.is-group-active::before,
body.collapsed .sidebar-item--submenu:has(.sidebar-submenu .sidebar-link.active) > .sidebar-link--has-submenu::before {
    display: block;
    left: 8px;
    top: 12px;
    bottom: 12px;
    width: 3px;
    opacity: 1;
    transform: scaleY(1);
    background: linear-gradient(180deg, #8af0b3 0%, #50c878 100%);
}

body.collapsed .sidebar-link.active i,
body.collapsed .sidebar-link[aria-current="page"] i,
body.collapsed .sidebar-link--has-submenu.is-group-active i,
body.collapsed .sidebar-item--submenu:has(.sidebar-submenu .sidebar-link.active) > .sidebar-link--has-submenu i {
    color: var(--sidebar-active-text) !important;
}

body.collapsed .sidebar-link--has-submenu .dropdown-icon {
    display: block !important;
    position: absolute;
    right: 10px;
    bottom: 9px;
    margin: 0;
    font-size: 0.52rem;
    color: var(--sidebar-meta);
    opacity: 0.76;
    transform: none !important;
}

body.collapsed .sidebar-link--has-submenu .submenu-cue {
    right: 10px;
    top: 10px;
    margin: 0;
    width: 6px;
    height: 6px;
    opacity: 0;
    box-shadow: none;
}

body.collapsed .sidebar-link--has-submenu[aria-expanded="true"] .dropdown-icon,
body.collapsed .sidebar-link--has-submenu.is-group-active .dropdown-icon,
body.collapsed .sidebar-item--submenu:has(.sidebar-submenu .sidebar-link.active) > .sidebar-link--has-submenu .dropdown-icon {
    color: var(--sidebar-active-text);
    opacity: 1;
}

body.collapsed .sidebar-link--has-submenu[aria-expanded="true"] .submenu-cue,
body.collapsed .sidebar-link--has-submenu.is-group-active .submenu-cue,
body.collapsed .sidebar-item--submenu:has(.sidebar-submenu .sidebar-link.active) > .sidebar-link--has-submenu .submenu-cue {
    opacity: 1;
    box-shadow: 0 0 0 3px rgba(80, 200, 120, 0.16);
}

body.collapsed .sidebar-footer {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 10px 0 14px;
}

body.collapsed .sidebar-footer .user-profile {
    width: 58px;
    min-height: 58px;
    margin-bottom: 0 !important;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    border: 1px solid var(--sidebar-footer-border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
    box-shadow: none;
}

body.collapsed .sidebar-footer .user-avatar {
    width: 44px;
    height: 44px;
    box-shadow: 0 10px 18px rgba(80, 200, 120, 0.16);
}

body.collapsed .sidebar-action-link {
    width: 56px;
    min-height: 50px;
    padding-inline: 0 !important;
    border-radius: 18px;
}

body.collapsed .sidebar-action-link i {
    margin-right: 0 !important;
}

body.collapsed .sidebar-edge-toggle {
    right: -8px !important;
    width: 18px !important;
    height: 42px !important;
}

@media (max-width: 1399.98px) and (min-width: 1200px) {
    .sidebar {
        width: 232px;
    }

    .main-content {
        margin-left: 232px;
        width: calc(100% - 232px);
    }

    body.collapsed .sidebar {
        width: 74px;
    }

    body.collapsed .main-content {
        margin-left: 74px;
        width: calc(100% - 74px);
    }

    .sidebar-brand {
        padding-inline: 18px;
    }

    .brand-stack .brand-primary {
        font-size: 1.78rem;
    }

    .top-header {
        padding-inline: 18px;
    }

    .context-pill.context-event {
        min-width: 180px;
        max-width: 280px;
    }

    .context-pill.context-ballot {
        min-width: 160px;
        max-width: 250px;
    }

    .event-selector {
        min-width: 230px !important;
    }

    .main-shell-body {
        padding: 1.25rem !important;
    }

    body.collapsed .sidebar-link,
    body.collapsed .sidebar-action-link {
        width: 52px;
        min-width: 52px;
    }
}

@media (max-width: 1199.98px) and (min-width: 992px) {
    .sidebar {
        width: 212px;
    }

    .main-content {
        margin-left: 212px;
        width: calc(100% - 212px);
    }

    body.collapsed .sidebar {
        width: 72px;
    }

    body.collapsed .main-content {
        margin-left: 72px;
        width: calc(100% - 72px);
    }

    .sidebar-brand {
        height: 72px;
        padding-inline: 16px;
    }

    .brand-stack .brand-primary {
        font-size: 1.58rem;
    }

    .brand-stack .brand-sub {
        font-size: 0.86rem;
    }

    .sidebar-link {
        min-height: 46px;
        margin-right: 8px;
        padding-left: 14px;
        padding-right: 14px;
    }

    .sidebar-link .link-text {
        font-size: 0.84rem;
    }

    .sidebar-submenu {
        margin-inline: 12px 10px;
    }

    .top-header {
        padding: 12px 16px;
        row-gap: 10px;
    }

    .top-header-main {
        flex: 1 1 100%;
    }

    .top-header-tools {
        flex: 1 1 100%;
        justify-content: flex-start;
    }

    .event-selector-wrap {
        flex: 1 1 280px;
        max-width: 440px;
    }

    .context-pill.context-event,
    .context-pill.context-ballot {
        min-width: 0;
        max-width: 240px;
    }

    .main-shell-body {
        padding: 1rem !important;
    }

    body.collapsed .sidebar-link,
    body.collapsed .sidebar-action-link {
        width: 50px;
        min-width: 50px;
        min-height: 50px;
    }

    body.collapsed .sidebar-brand {
        height: 70px;
    }
}
/* BACKOFFICE_SHELL_SIDEBAR_LOT2_END */
