/* ============================================
   AlgeDesk - Helpdesk
   Tema Claro & Escuro | Blur
   ============================================ */

/* --- RESET & BASE --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    touch-action: pan-x pan-y;
}

/* ============================================
   PAINEL - COMPOSICAO OPERACIONAL
   Escopo isolado para nao afetar sidebar/topbar
   ============================================ */
.app-content.dashboard-reference {
    padding: .75rem;
}

.dashboard-reference-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) max(260px, calc(23.81% - 3.25px));
    gap: .75rem;
    margin-bottom: .85rem;
}

.dashboard-reference-stat {
    min-width: 0;
    min-height: 82px;
    padding: 1rem .85rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: var(--bg-card-right);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

[data-theme="dark"] .dashboard-reference-stat,
[data-theme="dark"] .dashboard-reference-card {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
}

.dashboard-reference-stat-icon {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    display: grid;
    place-items: center;
    border-radius: 50%;
}

.dashboard-reference-stat-icon svg {
    width: 27px;
    height: 27px;
}

.dashboard-reference-stat-blue .dashboard-reference-stat-icon {
    color: #1478f2;
    background: #e9f3ff;
}

.dashboard-reference-stat-orange .dashboard-reference-stat-icon {
    color: #f59e0b;
    background: #fff4df;
}

.dashboard-reference-stat-green .dashboard-reference-stat-icon {
    color: #16a34a;
    background: #e8f8ec;
}

.dashboard-reference-stat-purple .dashboard-reference-stat-icon {
    color: #7c3aed;
    background: #f1eaff;
}

[data-theme="dark"] .dashboard-reference-stat-blue .dashboard-reference-stat-icon { background: rgba(20, 120, 242, 0.16); }
[data-theme="dark"] .dashboard-reference-stat-orange .dashboard-reference-stat-icon { background: rgba(245, 158, 11, 0.16); }
[data-theme="dark"] .dashboard-reference-stat-green .dashboard-reference-stat-icon { background: rgba(22, 163, 74, 0.16); }
[data-theme="dark"] .dashboard-reference-stat-purple .dashboard-reference-stat-icon { background: rgba(124, 58, 237, 0.16); }

.dashboard-reference-stat-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.dashboard-reference-stat-label {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 650;
    white-space: nowrap;
}

.dashboard-reference-stat-copy strong {
    margin: 0.28rem 0 0.35rem;
    color: var(--text-primary);
    font-size: 1.65rem;
    font-weight: 750;
    letter-spacing: -0.04em;
}

.dashboard-reference-trend {
    color: var(--text-muted);
    font-size: 0.72rem;
    white-space: nowrap;
}

.dashboard-reference-trend b {
    font-weight: 700;
}

.dashboard-reference-trend-up,
.dashboard-reference-trend-up b {
    color: #16a34a;
}

.dashboard-reference-workspace {
    display: grid;
    grid-template-columns: minmax(0, 3.2fr) minmax(260px, 1fr);
    align-items: stretch;
    gap: .75rem;
}

.dashboard-reference-primary,
.dashboard-reference-secondary {
    min-width: 0;
    width: 100%;
    height: 100%;
    display: grid;
    gap: .75rem;
}

.dashboard-reference-primary {
    grid-template-rows: auto minmax(0, 1fr);
}

.dashboard-reference-secondary {
    grid-template-rows: auto auto minmax(0, 1fr);
}

.dashboard-reference-card {
    min-width: 0;
    background: var(--bg-card-right);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.dashboard-reference-card-title {
    min-height: 38px;
    padding: .5rem .85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--separator-color);
}

.dashboard-reference-card-title h1,
.dashboard-reference-card-title h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
}

.dashboard-reference-title-icon svg {
    width: 15px;
    height: 15px;
    color: var(--text-muted);
    flex: 0 0 15px;
}

.dashboard-reference-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.dashboard-reference-table {
    width: 100%;
    min-width: 785px;
    border-collapse: collapse;
    table-layout: auto;
    font-size: 0.78rem;
}

.dashboard-reference-table th,
.dashboard-reference-table td {
    height: 36px;
    padding: 11.4px .55rem;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--separator-color);
}

.dashboard-reference-table th {
    height: 38px;
    color: var(--text-primary);
    background: color-mix(in srgb, var(--bg-card-right) 88%, var(--bg-primary));
    font-size: 0.7rem;
    font-weight: 700;
}

.dashboard-reference-table td {
    color: var(--text-secondary);
    font-weight: 500;
}

.dashboard-reference-table tbody tr {
    cursor: pointer;
}

.dashboard-reference-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .dashboard-reference-table tbody tr:hover {
    background: #E5E8EB;
}

[data-theme="light"] .dashboard-reference-table tbody tr:hover td {
    color: #0f172a;
}

.dashboard-reference-table tbody tr:last-child td {
    border-bottom: 0;
}

.dashboard-reference-table th:nth-child(2),
.dashboard-reference-table td:nth-child(2) {
    min-width: 168px;
}

.dashboard-reference-table th:nth-child(3),
.dashboard-reference-table td:nth-child(3) {
    min-width: 124px;
}

.dashboard-reference-table th:last-child,
.dashboard-reference-table td:last-child {
    min-width: 118px;
}

.dashboard-reference-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-height: 23px;
    padding: 0.16rem 0.45rem;
    border-radius: 5px;
    font-size: 0.68rem;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
}

.dashboard-reference-badge small {
    font-size: 0.68rem;
    font-weight: 700;
}

.dashboard-reference-badge.priority-high { color: #ef4444; background: #fee9e9; }
.dashboard-reference-badge.priority-medium { color: #d97706; background: #fff1d7; }
.dashboard-reference-badge.priority-low { color: #16a34a; background: #ddf7e4; }
.dashboard-reference-badge.priority-critical { color: #9333ea; background: #f3e8ff; }
.dashboard-reference-badge.status-open { color: #1478f2; background: #e5f1ff; }
.dashboard-reference-badge.status-progress { color: #d97706; background: #fff1d7; }
.dashboard-reference-badge.status-waiting { color: #52637a; background: #edf1f5; }
.dashboard-reference-badge.status-solved { color: #168c43; background: #dff5e6; }

[data-theme="dark"] .dashboard-reference-badge.priority-high { background: rgba(239, 68, 68, 0.16); }
[data-theme="dark"] .dashboard-reference-badge.priority-critical { color: #c084fc; background: rgba(168, 85, 247, 0.18); }
[data-theme="dark"] .dashboard-reference-badge.priority-medium,
[data-theme="dark"] .dashboard-reference-badge.status-progress { background: rgba(245, 158, 11, 0.16); }
[data-theme="dark"] .dashboard-reference-badge.priority-low,
[data-theme="dark"] .dashboard-reference-badge.status-solved { background: rgba(22, 163, 74, 0.16); }
[data-theme="dark"] .dashboard-reference-badge.status-open { background: rgba(20, 120, 242, 0.16); }
[data-theme="dark"] .dashboard-reference-badge.status-waiting { color: #b7c2d0; background: rgba(148, 163, 184, 0.16); }

.dashboard-reference-person {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
}

.dashboard-reference-person i {
    width: 21px;
    height: 21px;
    display: grid;
    place-items: center;
    flex: 0 0 21px;
    border: 2px solid var(--bg-card-right);
    border-radius: 50%;
    color: #fff;
    font-size: 0.55rem;
    font-style: normal;
    font-weight: 750;
    box-shadow: 0 0 0 1px var(--border-color);
}

.dashboard-reference-person.avatar-gs i { background: #40566f; }
.dashboard-reference-person.avatar-fl i { background: #7c4e3a; }
.dashboard-reference-person.avatar-lp i { background: #546f42; }
.dashboard-reference-person.avatar-ma i { background: #6d4b78; }

.dashboard-reference-card-footer {
    min-height: 30px;
    padding: .42rem .85rem;
    display: flex;
    align-items: center;
    border-top: 1px solid var(--separator-color);
}

.dashboard-reference-card-footer a,
.dashboard-reference-categories > a {
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 650;
}

.dashboard-reference-card-footer a span,
.dashboard-reference-categories > a span {
    margin-left: 0.35rem;
    font-size: 1rem;
    vertical-align: -0.06rem;
}

.dashboard-reference-next-actions .dashboard-reference-card-title {
    min-height: 42px;
}

.dashboard-reference-next-actions,
.dashboard-reference-quick-service {
    display: flex;
    flex-direction: column;
    padding-bottom: 2px;
}

.dashboard-reference-action-row {
    min-height: 38px;
    padding: 0.36rem 0.95rem;
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr) 62px 112px 96px;
    align-items: center;
    gap: 0.55rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
    border-top: 1px solid var(--separator-color);
    flex: 1 1 0;
}

.dashboard-reference-action-row:nth-child(2) {
    border-top: 0;
}

.dashboard-reference-action-icon { width: 18px; height: 18px; flex: 0 0 18px; color: var(--text-muted); }

.dashboard-reference-action-row time {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.dashboard-reference-action-row time svg {
    width: 13px;
    height: 13px;
}

.dashboard-reference-owner {
    width: 100%;
    min-width: 0;
    padding: 0.28rem 0.38rem;
    color: var(--text-muted);
    background: color-mix(in srgb, var(--bg-primary) 70%, transparent);
    border-radius: 4px;
    text-align: center;
    white-space: nowrap;
}
[data-theme="dark"] .dashboard-reference-owner { background: rgba(255, 255, 255, .06); color: var(--text-secondary); }

.dashboard-reference-filters form {
    padding: 0.72rem 0.75rem 0.75rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem 0.65rem;
}

.dashboard-reference-filters label {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
}

.dashboard-reference-filters label:nth-child(3) {
    grid-column: 1 / 2;
}

.dashboard-reference-filters select {
    width: 100%;
    min-width: 0;
    height: 32px;
    padding: 0 1.5rem 0 0.5rem;
    color: var(--text-secondary);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 5px;
    font-size: 0.72rem;
}

.dashboard-filter-select {
    position: relative;
    min-width: 0;
}

.dashboard-filter-select.open {
    z-index: 150;
}

.dashboard-filter-select .dashboard-filter-native-select {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    border: 0;
}

.dashboard-reference-filters .dashboard-filter-select button.dashboard-filter-select-trigger {
    width: 100%;
    min-width: 0;
    height: 32px;
    grid-column: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .4rem;
    padding: 0 .5rem;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    outline: 0;
    background: var(--input-bg);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: .72rem;
    font-weight: 500;
    text-align: left;
}

.dashboard-reference-filters .dashboard-filter-select button.dashboard-filter-select-trigger:hover {
    border-color: var(--text-muted);
    background: var(--input-bg);
}

.dashboard-filter-select.open .dashboard-filter-select-trigger,
.dashboard-filter-select-trigger:focus-visible {
    border-color: var(--action-bg);
    box-shadow: 0 0 0 3px var(--action-soft);
}

.dashboard-filter-select-trigger .icon {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    color: var(--text-muted);
    transition: transform .2s;
}

.dashboard-filter-select.open .dashboard-filter-select-trigger .icon {
    transform: rotate(180deg);
}

.dashboard-filter-select-menu {
    position: absolute;
    z-index: 160;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    display: none;
    padding: .25rem;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background: #f8fafc;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .14);
}

.dashboard-filter-select.open .dashboard-filter-select-menu {
    display: block;
}

.dashboard-reference-filters .dashboard-filter-select button.dashboard-filter-select-option {
    width: 100%;
    min-height: 30px;
    grid-column: auto;
    display: flex;
    align-items: center;
    padding: .35rem .5rem;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: .72rem;
    font-weight: 500;
    text-align: left;
}

.dashboard-reference-filters .dashboard-filter-select button.dashboard-filter-select-option + button.dashboard-filter-select-option {
    margin-top: .18rem;
}

.dashboard-reference-filters .dashboard-filter-select button.dashboard-filter-select-option:hover {
    background: #e5e8eb;
    color: var(--text-primary);
}

.dashboard-reference-filters .dashboard-filter-select button.dashboard-filter-select-option.active {
    background: var(--action-soft);
    color: var(--action-bg);
}
[data-theme="dark"] .dashboard-reference-filters .dashboard-filter-select button.dashboard-filter-select-option.active {
    color: var(--action-text);
}

[data-theme="dark"] .dashboard-filter-select-menu {
    background: #1a1a1a;
    box-shadow: 0 14px 32px rgba(0, 0, 0, .32);
}

[data-theme="dark"] .dashboard-reference-filters .dashboard-filter-select button.dashboard-filter-select-option:hover {
    background: rgba(255, 255, 255, .04);
}

.dashboard-reference-filters button {
    grid-column: 1 / -1;
    height: 33px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    font-size: 0.72rem;
    cursor: pointer;
}

.dashboard-reference-filters button:hover {
    background: var(--action-soft);
}

.dashboard-reference-filters button svg {
    width: 12px;
    height: 12px;
}

.dashboard-reference-categories ul {
    margin: 0;
    padding: 0.48rem 0.75rem 0;
    list-style: none;
}

.dashboard-reference-categories li {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.75rem;
    border-bottom: 1px solid var(--separator-color);
}

.dashboard-reference-categories li b,
.dashboard-reference-quick-service a b {
    min-width: 22px;
    padding: 0.22rem 0.35rem;
    color: #1478f2;
    background: #e8f2ff;
    border-radius: 4px;
    font-size: 0.68rem;
    text-align: center;
}

[data-theme="dark"] .dashboard-reference-categories li b,
[data-theme="dark"] .dashboard-reference-quick-service a b {
    background: rgba(20, 120, 242, 0.16);
}

.dashboard-reference-categories > a {
    min-height: 40px;
    padding: 0.6rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dashboard-reference-quick-service > a {
    min-height: 43px;
    padding: 0.58rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    border-bottom: 1px solid var(--separator-color);
    flex: 1 1 0;
}

.dashboard-reference-quick-service > a:last-child {
    border-bottom: 0;
}

.dashboard-reference-categories > a:hover {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .dashboard-reference-categories > a:hover {
    color: var(--accent);
    background: #e5e8eb;
}

.dashboard-reference-categories > a > .icon {
    width: 14px;
    height: 14px;
}

.dashboard-reference-quick-service > a:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .dashboard-reference-quick-service > a:hover {
    color: #0f172a;
    background: #E5E8EB;
}

.dashboard-reference-quick-service > a > span {
    color: var(--text-muted);
    font-size: 1rem;
}

@media (max-width: 1180px) {
    .dashboard-reference-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr)) max(240px, calc(28.571% - 3.9px));
    }

    .dashboard-reference-stat {
        padding-inline: 0.8rem;
        gap: 0.7rem;
    }

    .dashboard-reference-stat-icon {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
    }

    .dashboard-reference-workspace {
        grid-template-columns: minmax(0, 2.5fr) minmax(240px, 1fr);
    }
}

@media (max-width: 1020px) {
    .dashboard-reference-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-reference-workspace {
        grid-template-columns: 1fr;
    }

    .dashboard-reference-secondary {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-rows: auto;
    }
}

@media (max-width: 900px) {
    .app-content.dashboard-reference {
        padding: 0.85rem;
    }

    .dashboard-reference-secondary {
        grid-template-columns: 1fr;
    }

    .dashboard-reference-action-row {
        grid-template-columns: 14px minmax(0, 1fr) auto;
    }

    .dashboard-reference-action-row time,
    .dashboard-reference-owner {
        display: none;
    }
}

@media (max-width: 520px) {
    .dashboard-reference-stats {
        grid-template-columns: 1fr;
    }

    .dashboard-reference-stat {
        min-height: 88px;
    }
}

/* Página Chamados — composição central baseada na referência visual */
.app-content.tickets-reference {
    padding: .75rem;
}

.tickets-reference-card {
    overflow: visible;
    background: var(--bg-card-right);
    border: 1px solid var(--separator-color);
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.05);
}

.tickets-reference-toolbar {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 0.9rem;
    border-bottom: 1px solid var(--separator-color);
}

.tickets-reference-tabs {
    align-self: stretch;
    min-width: 0;
    display: flex;
    align-items: stretch;
    gap: 0.15rem;
}

.tickets-reference-tab {
    position: relative;
    z-index: 0;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0 0.85rem;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .18s, color .18s;
}

.tickets-reference-tab::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 17px 3px;
    border-radius: 6px;
    background: transparent;
    transition: background-color .18s;
}

.tickets-reference-tab span {
    min-width: 21px;
    height: 21px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.32rem;
    border-radius: 5px;
    background: var(--accent-soft);
    color: var(--text-muted);
    font-size: 0.67rem;
    font-weight: 700;
}

.tickets-reference-tab:hover {
    background: transparent;
    color: var(--text-primary);
}

.tickets-reference-tab:hover::before {
    background: #e5e8eb;
}
.tickets-reference-tab:hover span { background: rgba(15,23,42,.1); color: var(--text-primary); }

[data-theme="dark"] .tickets-reference-tab:hover::before {
    background: rgba(255, 255, 255, .06);
}

[data-theme="dark"] .tickets-reference-tab span {
    background: rgba(255, 255, 255, .07);
    color: #9ca3af;
}

[data-theme="dark"] .tickets-reference-tab.active,
[data-theme="dark"] .tickets-reference-tab.active:hover {
    color: var(--action-text);
}

[data-theme="dark"] .tickets-reference-tab.active::before,
[data-theme="dark"] .tickets-reference-tab.active:hover::before {
    background: rgba(255, 255, 255, .08);
}

[data-theme="dark"] .tickets-reference-tab.active span {
    background: rgba(255, 255, 255, .12);
    color: var(--action-text);
}
[data-theme="dark"] .tickets-reference-tab.active::after {
    background: rgba(255, 255, 255, .5);
}

.tickets-reference-tab.active {
    background: transparent;
    color: var(--action-bg);
}

.tickets-reference-tab.active:hover {
    background: transparent;
    color: var(--action-bg);
}

.tickets-reference-tab.active::before,
.tickets-reference-tab.active:hover::before {
    background: var(--action-soft);
}

.tickets-reference-tab.active span {
    background: var(--accent-soft);
    color: var(--action-bg);
}

.tickets-reference-tab.active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--action-bg);
}

.tickets-reference-tab.active span {
    color: var(--action-bg);
}

.tickets-reference-tools {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.tickets-reference-search {
    width: 228px;
    height: 38px;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0 0.7rem;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-muted);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tickets-reference-search:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.tickets-reference-search:focus-within {
    border-color: var(--action-bg);
    box-shadow: 0 0 0 3px var(--action-soft);
    color: var(--text-primary);
}

.tickets-reference-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.7rem;
}

.tickets-reference-search input::placeholder {
    color: var(--text-muted);
}

.tickets-reference-filter,
.tickets-reference-export {
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.48rem;
    padding: 0 0.9rem;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 650;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.tickets-reference-filter:hover {
    border-color: transparent;
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

[data-theme="light"] .tickets-reference-filter:hover {
    border-color: #e5e8eb;
    background: #e5e8eb;
    color: #0f172a;
}

[data-theme="dark"] .tickets-reference-filter:hover {
    border-color: #2a2a2a;
    background: #2a2a2a;
    color: #e0e0e0;
}

.tickets-filter-control {
    position: relative;
}

.tickets-reference-filter.active {
    border-color: rgba(37, 99, 235, .28);
    background: var(--action-soft);
    color: var(--action-bg);
}

.tickets-filter-count {
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 .25rem;
    border-radius: 999px;
    background: var(--action-bg);
    color: #fff;
    font-size: 10px;
}

.tickets-filter-popover {
    position: absolute;
    z-index: 400;
    top: calc(100% + 7px);
    right: 0;
    width: 390px;
    display: none;
    padding: .75rem;
    border: 1px solid var(--input-border);
    border-radius: 9px;
    background: #f8fafc;
    box-shadow: 0 16px 38px rgba(15, 23, 42, .2);
}

.tickets-filter-control.open .tickets-filter-popover {
    display: block;
}

[data-theme="dark"] .tickets-filter-popover {
    background: #1a1a1a;
    box-shadow: 0 18px 42px rgba(0, 0, 0, .48);
}

.tickets-filter-popover > header {
    min-height: 31px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .55rem;
    color: var(--text-primary);
    font-size: 13px;
}

.tickets-filter-popover > header > button {
    width: 27px;
    height: 27px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.tickets-filter-popover > header > button:hover {
    background: #e5e8eb;
    color: var(--text-primary);
}

[data-theme="dark"] .tickets-filter-popover > header > button:hover {
    background: rgba(255, 255, 255, .05);
}

.tickets-filter-popover > header .icon {
    width: 15px;
    height: 15px;
}

.tickets-filter-group {
    padding: .55rem 0;
    border-top: 1px solid var(--separator-color);
}

.tickets-filter-group > span {
    display: block;
    margin-bottom: .45rem;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 650;
}

.tickets-filter-group > div {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.tickets-filter-group button {
    min-height: 29px;
    padding: .3rem .55rem;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    background: var(--input-bg);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
}

.tickets-filter-group button:hover {
    border-color: transparent;
    background: #e5e8eb;
    color: var(--text-primary);
}

[data-theme="dark"] .tickets-filter-group button:hover {
    background: rgba(255, 255, 255, .05);
}

.tickets-filter-group button.active {
    border-color: var(--accent-soft);
    background: var(--action-soft);
    color: var(--action-bg);
}
[data-theme="dark"] .tickets-filter-group button.active {
    color: var(--action-text);
}

.tickets-filter-popover > footer {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    padding-top: .65rem;
    border-top: 1px solid var(--separator-color);
}

.tickets-filter-popover > footer button {
    height: 33px;
    padding: 0 .7rem;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    background: var(--input-bg);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 11px;
    font-weight: 650;
    cursor: pointer;
}

.tickets-filter-popover > footer button:last-child {
    border-color: var(--action-bg);
    background: var(--action-bg);
    color: var(--action-text);
}

.tickets-filter-popover > footer button:first-child:hover {
    background: #e5e8eb;
}

[data-theme="dark"] .tickets-filter-popover > footer button:first-child:hover {
    background: rgba(255, 255, 255, .05);
}

.tickets-filter-popover > footer button:last-child:hover {
    background: var(--action-bg-hover);
}

.tickets-reference-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.tickets-reference-table {
    width: 100%;
    min-width: 1080px;
    border-collapse: collapse;
    color: var(--text-primary);
    font-size: 0.78rem;
}

.tickets-reference-table th,
.tickets-reference-table td {
    padding: 0 0.65rem;
    border-bottom: 1px solid var(--separator-color);
    text-align: left;
    white-space: nowrap;
}

.tickets-reference-table th {
    height: 38px;
    color: var(--text-primary);
    font-size: 0.7rem;
    font-weight: 700;
}

.tickets-reference-table th > svg {
    margin-left: 0.12rem;
    color: var(--text-muted);
    vertical-align: -3px;
}

.tickets-reference-table td {
    height: 43.9px;
    padding: 0 .6rem;
    font-weight: 400;
}

.tickets-reference-table tbody tr {
    cursor: pointer;
    transition: background-color 0.18s ease;
}

.tickets-reference-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .tickets-reference-table tbody tr:hover {
    background: #e5e8eb;
}

[data-theme="light"] .tickets-reference-table tbody tr:hover td {
    color: #0f172a;
}

.tickets-reference-table tbody tr:last-child td {
    border-bottom: 0;
}

.tickets-reference-check {
    width: 42px;
    padding-left: 1rem !important;
    padding-right: 0.25rem !important;
}

.tickets-reference-check input {
    width: 15px;
    height: 15px;
    display: block;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

[data-theme="dark"] .tickets-reference-check input {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 3px;
    background-color: #1a1a1a;
}

[data-theme="dark"] .tickets-reference-check input:hover {
    border-color: #60a5fa;
    background-color: rgba(37, 99, 235, 0.08);
}

[data-theme="dark"] .tickets-reference-check input:checked {
    border-color: #2563eb;
    background-color: #2563eb;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.3 6.2l2.2 2.2 5.2-5.2' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 12px;
}

[data-theme="dark"] .tickets-reference-check input:focus-visible {
    outline: 2px solid rgba(96, 165, 250, .45);
    outline-offset: 2px;
}

.tickets-reference-protocol {
    color: var(--accent);
    font-weight: 650;
}

.tickets-reference-protocol:hover {
    color: var(--text-primary);
}

.tickets-reference-client-name {
    text-transform: capitalize;
}

.tickets-reference-badge {
    min-height: 23px;
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
}

.tickets-reference-badge.high::after,
.tickets-reference-badge.medium::after,
.tickets-reference-badge.low::after {
    font-size: 0.61rem;
    font-weight: 700;
    line-height: 1;
}

.tickets-reference-badge.high::after,
.tickets-reference-badge.medium::after {
    content: "↑";
}

.tickets-reference-badge.low::after {
    content: "↓";
}

.tickets-reference-badge.high {
    background: #fee2e2;
    color: #dc2626;
}

.tickets-reference-badge.medium,
.tickets-reference-badge.progress {
    background: #fff1d6;
    color: #d97706;
}

.tickets-reference-badge.low,
.tickets-reference-badge.solved {
    background: #dcfce7;
    color: #15803d;
}

.tickets-reference-badge.open {
    background: #dbeafe;
    color: #2563eb;
}

.tickets-reference-badge.waiting {
    background: #ede9fe;
    color: #6d28d9;
}

.tickets-reference-badge.closed {
    background: #e2e8f0;
    color: #475569;
}

.tickets-reference-badge.critical {
    background: #f3e8ff;
    color: #9333ea;
}

[data-theme="dark"] .tickets-reference-badge.high {
    background: rgba(220, 38, 38, 0.16);
    color: #f87171;
}

[data-theme="dark"] .tickets-reference-badge.medium,
[data-theme="dark"] .tickets-reference-badge.progress {
    background: rgba(217, 119, 6, 0.16);
    color: #fbbf24;
}

[data-theme="dark"] .tickets-reference-badge.low,
[data-theme="dark"] .tickets-reference-badge.solved {
    background: rgba(21, 128, 61, 0.2);
    color: #4ade80;
}

[data-theme="dark"] .tickets-reference-badge.open {
    background: rgba(37, 99, 235, 0.2);
    color: #60a5fa;
}

[data-theme="dark"] .tickets-reference-badge.waiting {
    background: rgba(109, 40, 217, 0.2);
    color: #a78bfa;
}

[data-theme="dark"] .tickets-reference-badge.closed {
    background: rgba(148, 163, 184, 0.16);
    color: #cbd5e1;
}

[data-theme="dark"] .tickets-reference-badge.critical {
    background: rgba(168, 85, 247, 0.18);
    color: #c084fc;
}

.tickets-reference-person {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.tickets-reference-avatar {
    width: 23px;
    height: 23px;
    flex: 0 0 23px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-card-right);
    border-radius: 50%;
    color: #fff;
    font-size: 0.51rem;
    font-weight: 750;
    box-shadow: 0 0 0 1px var(--separator-color);
}

.avatar-gabriel { background: linear-gradient(145deg, #475569, #0f172a); }
.avatar-fernanda { background: linear-gradient(145deg, #92400e, #451a03); }
.avatar-lucas { background: linear-gradient(145deg, #0369a1, #164e63); }
.avatar-mariana { background: linear-gradient(145deg, #9f1239, #4c0519); }

.tickets-reference-actions-heading {
    text-align: center !important;
}

.tickets-reference-table td:last-child {
    text-align: center;
}

.ticket-actions-dropdown {
    position: relative;
    display: inline-flex;
}

.ticket-actions-menu {
    position: fixed;
    z-index: 500;
    min-width: 170px;
    padding: 0.35rem;
    background: var(--bg-card-right);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s, visibility 0.12s;
}

.ticket-actions-menu.open {
    opacity: 1;
    visibility: visible;
}

.ticket-actions-menu button,
.ticket-actions-menu > a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 34px;
    padding: 0.45rem 0.6rem;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.78rem;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    text-align: left;
    white-space: nowrap;
}

.ticket-actions-menu button:hover,
.ticket-actions-menu > a:hover {
    background: var(--action-soft);
    color: var(--text-primary);
}

.ticket-actions-menu button svg,
.ticket-actions-menu > a svg,
.ticket-actions-menu button > i,
.ticket-actions-menu > a > i {
    width: 16px;
    min-width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1;
}

.ticket-actions-menu > form {
    width: 100%;
    margin: 0;
}

.ticket-actions-divider {
    height: 1px;
    margin: 0.25rem 0.4rem;
    background: var(--separator-color);
}

[data-theme="dark"] .ticket-actions-menu {
    background: #1e1e1e;
    border-color: rgba(255,255,255,.1);
}

.tickets-reference-more {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.tickets-reference-more:hover {
    background: var(--action-soft);
    color: var(--text-primary);
}

.ticket-actions-menu button[data-action="close"] {
    color: #ef4444;
}

.ticket-actions-menu button[data-action="close"] svg {
    color: #ef4444;
}

.ticket-actions-menu button[data-action="close"]:hover {
    background: rgba(239,68,68,.12);
}

.tickets-reference-footer {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 1rem;
    border-top: 1px solid var(--separator-color);
    color: var(--text-muted);
    font-size: 0.7rem;
}

.tickets-reference-pagination {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.tickets-reference-pagination button {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    background: var(--input-bg);
    color: var(--text-muted);
    font-size: 0.72rem;
    cursor: pointer;
}

.tickets-reference-pagination button:hover:not(:disabled) {
    border-color: var(--text-muted);
    background: var(--action-bg-hover);
    color: var(--action-text);
}

[data-theme="light"] .tickets-reference-pagination button:hover:not(:disabled) {
    border-color: #e5e8eb;
    background: #e5e8eb;
    color: #0f172a;
}

.tickets-reference-pagination button.active,
[data-theme="light"] .tickets-reference-pagination button.active,
[data-theme="light"] .tickets-reference-pagination button.active:hover {
    border-color: var(--action-bg);
    background: var(--action-bg);
    color: var(--action-text);
}

.tickets-reference-pagination button:disabled {
    opacity: 0.45;
    cursor: default;
}

.tickets-reference-tip {
    min-height: 53px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.85rem;
    padding: 0.44rem 0.85rem;
    border: 1px solid var(--accent-soft);
    border-radius: 9px;
    background: color-mix(in srgb, var(--accent-soft) 45%, transparent);
    color: var(--accent);
    font-size: 0.71rem;
}
[data-theme="dark"] .tickets-reference-tip {
    border-color: rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .03);
}

.tickets-reference-tip-copy {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tickets-reference-tip-copy > svg {
    flex: 0 0 auto;
}

.tickets-reference-export {
    flex: 0 0 auto;
    border-color: var(--input-border);
    background: transparent;
    color: var(--text-primary);
}

.tickets-reference-export:hover {
    border-color: var(--action-border);
    background: var(--action-bg);
    color: var(--action-text);
}

.tickets-reference-table tr[hidden] {
    display: none;
}

@media (max-width: 1180px) {
    .tickets-reference-toolbar {
        align-items: stretch;
        flex-direction: column;
        padding: 0;
    }

    .tickets-reference-tabs {
        min-height: 55px;
        overflow-x: auto;
        padding: 0 0.65rem;
    }

    .tickets-reference-tools {
        padding: 0 0.9rem 0.8rem;
    }
}

@media (max-width: 900px) {
    .app-content.tickets-reference {
        padding: 0.85rem;
    }

    .tickets-reference-tools {
        flex-wrap: wrap;
    }

    .tickets-reference-search {
        width: auto;
        flex: 1 1 210px;
    }

    .tickets-reference-tip,
    .tickets-reference-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .tickets-reference-export {
        align-self: flex-end;
    }
}

/* Novo Chamado — conteúdo central baseado na referência visual */
.app-content.new-ticket-reference {
    padding: .75rem;
}

.new-ticket-reference-form {
    width: 100%;
}

.new-ticket-reference-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.72fr) minmax(300px, 0.98fr);
    gap: 1rem;
}

.new-ticket-reference-card {
    overflow: visible;
    padding: .29rem;
    background: var(--bg-card-right);
    border: 1px solid var(--separator-color);
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.04);
}

.new-ticket-reference-main-card {
    overflow: visible;
}

.new-ticket-reference-card-header {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 0 .85rem;
    border-bottom: 1px solid var(--separator-color);
    color: var(--accent);
}

.new-ticket-reference-card-header h1,
.new-ticket-reference-card-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 700;
}

.new-ticket-reference-card-body {
    padding: 1.3rem 1.2rem 1.4rem;
}

.new-ticket-reference-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.7rem 1.4rem;
}

.new-ticket-reference-field,
.new-ticket-reference-description {
    min-width: 0;
}

.new-ticket-reference-field > label,
.new-ticket-reference-description > label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.74rem;
    font-weight: 650;
}

.new-ticket-reference-field > label span,
.new-ticket-reference-description > label span {
    color: #ef4444;
}

.new-ticket-requester-readonly{height:42px;display:flex;align-items:center;gap:.65rem;padding:0 .75rem;border:1px solid var(--separator-color);border-radius:7px;background:var(--bg-subtle);color:var(--text-primary)}.new-ticket-requester-readonly>.icon{width:18px;height:18px;flex:0 0 18px;color:var(--text-muted)}.new-ticket-requester-readonly>span{min-width:0;display:flex;flex:1;flex-direction:column;gap:.08rem}.new-ticket-requester-readonly strong{overflow:hidden;font-size:.72rem;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.new-ticket-requester-readonly small{overflow:hidden;color:var(--text-muted);font-size:.6rem;text-overflow:ellipsis;white-space:nowrap}.new-ticket-requester-readonly>b{padding:.2rem .45rem;border-radius:999px;background:var(--action-soft);color:var(--text-secondary);font-size:.58rem;font-weight:700}
.new-ticket-priority-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.4rem}.priority-choice{height:38px;display:inline-flex;align-items:center;justify-content:center;gap:.42rem;padding:0 .45rem;border:1px solid var(--input-border);border-radius:6px;background:var(--input-bg);color:var(--text-secondary);font:inherit;font-size:.68rem;font-weight:600;cursor:pointer;transition:border-color .18s,background-color .18s,box-shadow .18s,color .18s,transform .18s}.priority-choice:hover{transform:translateY(-1px)}.priority-choice:active{transform:translateY(0)}.priority-choice i{width:7px;height:7px;border-radius:50%;box-shadow:0 0 0 4px color-mix(in srgb,currentColor 12%,transparent)}.priority-choice-low i{color:#22c55e;background:#22c55e}.priority-choice-medium i{color:#f59e0b;background:#f59e0b}.priority-choice-high i{color:#ef4444;background:#ef4444}.priority-choice-critical i{color:#a855f7;background:#a855f7}.priority-choice-low:hover,.priority-choice-low.selected{border-color:#22c55e;background:rgba(34,197,94,.1);color:#15803d;box-shadow:0 0 0 2px rgba(34,197,94,.1)}.priority-choice-medium:hover,.priority-choice-medium.selected{border-color:#f59e0b;background:rgba(245,158,11,.11);color:#b45309;box-shadow:0 0 0 2px rgba(245,158,11,.1)}.priority-choice-high:hover,.priority-choice-high.selected{border-color:#ef4444;background:rgba(239,68,68,.1);color:#dc2626;box-shadow:0 0 0 2px rgba(239,68,68,.1)}.priority-choice-critical:hover,.priority-choice-critical.selected{border-color:#a855f7;background:rgba(168,85,247,.1);color:#9333ea;box-shadow:0 0 0 2px rgba(168,85,247,.1)}[data-theme="dark"] .priority-choice-low:hover,[data-theme="dark"] .priority-choice-low.selected{color:#4ade80;background:rgba(34,197,94,.13)}[data-theme="dark"] .priority-choice-medium:hover,[data-theme="dark"] .priority-choice-medium.selected{color:#fbbf24;background:rgba(245,158,11,.14)}[data-theme="dark"] .priority-choice-high:hover,[data-theme="dark"] .priority-choice-high.selected{color:#f87171;background:rgba(239,68,68,.13)}[data-theme="dark"] .priority-choice-critical:hover,[data-theme="dark"] .priority-choice-critical.selected{color:#c084fc;background:rgba(168,85,247,.14)}@media(max-width:480px){.new-ticket-priority-options{grid-template-columns:repeat(2,minmax(0,1fr))}}

.new-ticket-reference-control,
.new-ticket-reference-select .new-ticket-reference-control {
    width: 100%;
    height: 38px;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0 0.75rem;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    outline: 0;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.72rem;
    font-weight: 400;
    text-align: left;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

button.new-ticket-reference-control {
    cursor: pointer;
}

.new-ticket-reference-control::placeholder {
    color: var(--text-muted);
}

.new-ticket-reference-control:hover,
.new-ticket-reference-select .new-ticket-reference-control:hover {
    border-color: var(--text-muted);
}

.new-ticket-reference-control:focus,
.new-ticket-reference-select.open .new-ticket-reference-control {
    border-color: var(--action-bg);
    box-shadow: 0 0 0 3px var(--action-soft);
}

.new-ticket-reference-control > .icon:first-child {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    color: var(--text-muted);
}

.new-ticket-reference-control > span {
    min-width: 0;
    overflow: hidden;
    flex: 1 1 auto;
    color: var(--text-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.new-ticket-reference-control .new-ticket-reference-chevron {
    width: 16px;
    height: 16px;
    margin-left: auto;
    color: var(--text-muted);
}

.new-ticket-reference-select.open .custom-select-trigger > .icon:first-child {
    transform: none;
}

.new-ticket-reference-select.open .new-ticket-reference-chevron {
    transform: rotate(180deg);
}

.new-ticket-reference-priority.priority-low .custom-select-trigger > span,
.new-ticket-reference-priority.priority-medium .custom-select-trigger > span,
.new-ticket-reference-priority.priority-high .custom-select-trigger > span,
.new-ticket-reference-priority.priority-critical .custom-select-trigger > span {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    padding: 0.18rem 0.45rem;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 650;
}

.new-ticket-reference-priority.priority-high .custom-select-trigger > span::after,
.new-ticket-reference-priority.priority-medium .custom-select-trigger > span::after,
.new-ticket-reference-priority.priority-critical .custom-select-trigger > span::after {
    content: "↑";
    font-size: 0.61rem;
}

.new-ticket-reference-priority.priority-low .custom-select-trigger > span::after {
    content: "↓";
    font-size: 0.61rem;
}

.new-ticket-reference-priority.priority-low .custom-select-trigger > span {
    background: #dcfce7;
    color: #15803d;
}

.new-ticket-reference-priority.priority-medium .custom-select-trigger > span {
    background: #fff1d6;
    color: #d97706;
}

.new-ticket-reference-priority.priority-high .custom-select-trigger > span {
    background: #fee2e2;
    color: #dc2626;
}

.new-ticket-reference-priority.priority-critical .custom-select-trigger > span {
    background: #f3e8ff;
    color: #9333ea;
}

.new-ticket-reference-priority.priority-low .custom-select-trigger > .icon:first-child { color: #15803d; }
.new-ticket-reference-priority.priority-medium .custom-select-trigger > .icon:first-child { color: #d97706; }
.new-ticket-reference-priority.priority-high .custom-select-trigger > .icon:first-child { color: #dc2626; }
.new-ticket-reference-priority.priority-critical .custom-select-trigger > .icon:first-child { color: #9333ea; }

[data-theme="dark"] .new-ticket-reference-priority.priority-low .custom-select-trigger > span {
    background: rgba(21, 128, 61, 0.2);
    color: #4ade80;
}

[data-theme="dark"] .new-ticket-reference-priority.priority-medium .custom-select-trigger > span {
    background: rgba(217, 119, 6, 0.16);
    color: #fbbf24;
}

[data-theme="dark"] .new-ticket-reference-priority.priority-high .custom-select-trigger > span {
    background: rgba(220, 38, 38, 0.16);
    color: #f87171;
}

[data-theme="dark"] .new-ticket-reference-priority.priority-critical .custom-select-trigger > span {
    background: rgba(147, 51, 234, 0.2);
    color: #c084fc;
}

[data-theme="dark"] .new-ticket-reference-priority.priority-low .custom-select-trigger > .icon:first-child { color: #4ade80; }
[data-theme="dark"] .new-ticket-reference-priority.priority-medium .custom-select-trigger > .icon:first-child { color: #fbbf24; }
[data-theme="dark"] .new-ticket-reference-priority.priority-high .custom-select-trigger > .icon:first-child { color: #f87171; }
[data-theme="dark"] .new-ticket-reference-priority.priority-critical .custom-select-trigger > .icon:first-child { color: #c084fc; }

.new-ticket-reference-priority .custom-select-option[data-value="Baixa"]:hover,
.new-ticket-reference-priority .custom-select-option[data-value="Baixa"].active {
    background: #dcfce7;
    color: #15803d;
}

.new-ticket-reference-priority .custom-select-option[data-value="Média"]:hover,
.new-ticket-reference-priority .custom-select-option[data-value="Média"].active {
    background: #fff1d6;
    color: #d97706;
}

.new-ticket-reference-priority .custom-select-option[data-value="Alta"]:hover,
.new-ticket-reference-priority .custom-select-option[data-value="Alta"].active {
    background: #fee2e2;
    color: #dc2626;
}

.new-ticket-reference-priority .custom-select-option[data-value="Crítica"]:hover,
.new-ticket-reference-priority .custom-select-option[data-value="Crítica"].active {
    background: #f3e8ff;
    color: #9333ea;
}

.new-ticket-reference-select .custom-select-option + .custom-select-option {
    margin-top: 0.22rem;
}

[data-theme="dark"] .new-ticket-reference-priority .custom-select-option[data-value="Baixa"]:hover,
[data-theme="dark"] .new-ticket-reference-priority .custom-select-option[data-value="Baixa"].active {
    background: rgba(21, 128, 61, 0.2);
    color: #4ade80;
}

[data-theme="dark"] .new-ticket-reference-priority .custom-select-option[data-value="Média"]:hover,
[data-theme="dark"] .new-ticket-reference-priority .custom-select-option[data-value="Média"].active {
    background: rgba(217, 119, 6, 0.16);
    color: #fbbf24;
}

[data-theme="dark"] .new-ticket-reference-priority .custom-select-option[data-value="Alta"]:hover,
[data-theme="dark"] .new-ticket-reference-priority .custom-select-option[data-value="Alta"].active {
    background: rgba(220, 38, 38, 0.16);
    color: #f87171;
}

[data-theme="dark"] .new-ticket-reference-priority .custom-select-option[data-value="Crítica"]:hover,
[data-theme="dark"] .new-ticket-reference-priority .custom-select-option[data-value="Crítica"].active {
    background: rgba(147, 51, 234, 0.2);
    color: #c084fc;
}

.new-ticket-reference-select .custom-select-menu {
    z-index: 80;
}

#ticketCategory ~ .custom-select-menu,
#ticketDepartment ~ .custom-select-menu {
    max-height: min(280px, calc(100vh - 190px));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: var(--text-muted) transparent;
    -webkit-overflow-scrolling: touch;
}

#ticketCategory ~ .custom-select-menu::-webkit-scrollbar,
#ticketDepartment ~ .custom-select-menu::-webkit-scrollbar {
    width: 6px;
}

#ticketCategory ~ .custom-select-menu::-webkit-scrollbar-track,
#ticketDepartment ~ .custom-select-menu::-webkit-scrollbar-track {
    background: transparent;
}

#ticketCategory ~ .custom-select-menu::-webkit-scrollbar-thumb,
#ticketDepartment ~ .custom-select-menu::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: var(--text-muted);
}

@media (max-width: 900px) {
    #ticketCategory ~ .custom-select-menu,
    #ticketDepartment ~ .custom-select-menu {
        max-height: min(240px, calc(100vh - 170px));
    }
}

.new-ticket-reference-description {
    margin-top: 1.85rem;
}

.new-ticket-reference-editor {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--input-border);
    border-radius: 7px;
    background: var(--input-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.new-ticket-reference-editor:focus-within {
    border-color: var(--action-bg);
    box-shadow: 0 0 0 3px var(--action-soft);
}

.new-ticket-reference-editor-toolbar {
    min-height: 45px;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.35rem 0.65rem;
    border-bottom: 1px solid var(--separator-color);
}

.new-ticket-reference-editor-toolbar > span {
    width: 1px;
    height: 20px;
    margin: 0 0.28rem;
    background: var(--separator-color);
}

.new-ticket-reference-editor-toolbar .rich-tool {
    width: 29px;
    height: 29px;
    min-width: 29px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.86rem;
    cursor: pointer;
}

.new-ticket-reference-editor-toolbar .rich-tool:hover,
.new-ticket-reference-editor-toolbar .rich-tool.active {
    background: var(--action-soft);
    color: var(--text-primary);
}

[data-theme="light"] .new-ticket-reference-editor-toolbar .rich-tool:hover,
[data-theme="light"] .new-ticket-reference-editor-toolbar .rich-tool.active {
    background: #e5e8eb;
}

[data-theme="dark"] .new-ticket-reference-editor-toolbar .rich-tool:hover,
[data-theme="dark"] .new-ticket-reference-editor-toolbar .rich-tool.active {
    background: #2a2a2a;
}

.new-ticket-reference-editor-surface {
    min-height: 260px;
    max-height: 360px;
    overflow-y: auto;
    padding: 0.85rem;
    outline: none;
    color: var(--text-primary);
    font-size: 0.73rem;
    line-height: 1.55;
}

.new-ticket-reference-editor-surface:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    pointer-events: none;
}

.new-ticket-reference-counter {
    position: absolute;
    right: 0.65rem;
    bottom: 0.45rem;
    color: var(--text-muted);
    font-size: 0.65rem;
}

.new-ticket-reference-counter b {
    font-weight: 500;
}

.new-ticket-reference-side {
    display: grid;
    align-content: start;
    gap: 1rem;
}

.new-ticket-reference-quick-details {
    display: grid;
    gap: 1.7rem;
    padding: 1.7rem 1.35rem;
}

.new-ticket-reference-quick-details > div {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.new-ticket-reference-quick-details > div > svg {
    flex: 0 0 auto;
    color: var(--text-muted);
}

.new-ticket-reference-quick-details p {
    display: grid;
    gap: 0.15rem;
    margin: 0;
    font-size: 0.7rem;
}

.new-ticket-reference-quick-details span {
    color: var(--text-muted);
}

.new-ticket-reference-quick-details strong {
    color: var(--text-primary);
    font-weight: 550;
}

.new-ticket-reference-tips {
    display: grid;
    gap: 1.08rem;
    margin: 0;
    padding: 1.65rem 1.35rem;
    list-style: none;
}

.new-ticket-reference-tips li {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    color: var(--text-muted);
    font-size: 0.7rem;
    line-height: 1.35;
}

.new-ticket-reference-tips svg {
    flex: 0 0 auto;
    color: #22c55e;
}

.new-ticket-reference-attachments {
    padding: 1.65rem 1.35rem;
}

.new-ticket-reference-dropzone {
    min-height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0.75rem;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--accent);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.new-ticket-reference-dropzone:hover,
.new-ticket-reference-dropzone.drag-over {
    border-color: var(--text-muted);
    background: var(--action-soft);
}

[data-theme="light"] .new-ticket-reference-dropzone:hover,
[data-theme="light"] .new-ticket-reference-dropzone.drag-over {
    background: #e5e8eb;
}

[data-theme="dark"] .new-ticket-reference-dropzone:hover,
[data-theme="dark"] .new-ticket-reference-dropzone.drag-over {
    background: #2a2a2a;
}

.new-ticket-reference-dropzone input {
    display: none;
}

.new-ticket-reference-dropzone strong {
    margin-top: 0.35rem;
    color: var(--text-primary);
    font-size: 0.72rem;
    font-weight: 650;
}

.new-ticket-reference-dropzone span {
    margin-top: 0.15rem;
    color: var(--text-primary);
    font-size: 0.66rem;
}

[data-theme="light"] .new-ticket-reference-dropzone strong,
[data-theme="light"] .new-ticket-reference-dropzone span {
    color: #000;
}

.new-ticket-reference-attachments > p {
    margin: 0.75rem 0 0;
    color: var(--text-muted);
    font-size: 0.64rem;
    line-height: 1.45;
}

.new-ticket-reference-attachments .attachment-list:not(:empty) {
    margin-top: 0.6rem;
}

.new-ticket-reference-actions {
    min-height: 57px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.76rem 0.85rem;
    border: 1px solid var(--separator-color);
    border-radius: 9px;
    background: var(--bg-card-right);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.04);
}

.new-ticket-reference-cancel,
.new-ticket-reference-submit {
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0 0.9rem;
    border-radius: 6px;
    font-size: 0.73rem;
    font-weight: 650;
    cursor: pointer;
}

.new-ticket-reference-cancel {
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text-primary);
}

.new-ticket-reference-cancel:hover {
    border-color: transparent;
    background: var(--action-soft);
    color: var(--text-primary);
}

[data-theme="light"] .new-ticket-reference-cancel:hover {
    background: #e5e8eb;
}

[data-theme="dark"] .new-ticket-reference-cancel:hover {
    background: #2a2a2a;
}

.new-ticket-reference-submit {
    border: 1px solid var(--action-border);
    background: var(--action-bg);
    color: var(--action-text);
}

.new-ticket-reference-submit:hover {
    background: var(--action-bg-hover);
    color: var(--action-text);
}

@media (max-width: 1050px) {
    .new-ticket-reference-layout {
        grid-template-columns: 1fr;
    }

    .new-ticket-reference-side {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .new-ticket-reference-attachments-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .app-content.new-ticket-reference {
        width: 100%;
        max-width: 100%;
        padding: 0.85rem;
        overflow-x: clip;
        box-sizing: border-box;
    }

    .new-ticket-reference-form,
    .new-ticket-reference-layout,
    .new-ticket-reference-card,
    .new-ticket-reference-main-card,
    .new-ticket-reference-card-body,
    .new-ticket-reference-side,
    .new-ticket-reference-description,
    .new-ticket-reference-editor,
    .new-ticket-reference-attachments-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .new-ticket-reference-card-body {
        padding: 1rem 0.85rem 1.1rem;
    }

    .new-ticket-reference-fields,
    .new-ticket-reference-side {
        grid-template-columns: 1fr;
    }

    .new-ticket-reference-attachments-card {
        grid-column: auto;
    }

    .new-ticket-reference-editor-toolbar {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        box-sizing: border-box;
    }

    .new-ticket-reference-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .new-ticket-reference-cancel,
    .new-ticket-reference-submit {
        width: 100%;
    }
}

/* Clientes — composição central baseada na referência visual */
.app-content.clients-reference {
    padding: .75rem;
}

.clients-reference-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .8rem;
    margin-bottom: .85rem;
}

.clients-reference-stat {
    min-height: 78px;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem .8rem;
    border: 1px solid var(--separator-color);
    border-radius: 11px;
    background: var(--bg-card-right);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.04);
}

.clients-reference-stat-icon {
    width: 51px;
    height: 51px;
    flex: 0 0 51px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.clients-reference-stat > div {
    min-width: 0;
}

.clients-reference-stat h2 {
    margin: 0 0 0.18rem;
    color: var(--text-primary);
    font-size: 0.7rem;
    font-weight: 650;
}

.clients-reference-stat strong {
    display: block;
    color: var(--text-primary);
    font-size: 1.45rem;
    line-height: 1.05;
}

.clients-reference-stat p {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
    font-size: 0.65rem;
    white-space: nowrap;
}

.clients-reference-stat p b {
    color: #10b981;
    font-weight: 650;
}

.stat-total .clients-reference-stat-icon { background: #eaf2ff; color: #2563eb; }
.stat-active .clients-reference-stat-icon { background: #e9f8f1; color: #059669; }
.stat-new .clients-reference-stat-icon { background: #f1eafe; color: #7c3aed; }
.stat-tickets .clients-reference-stat-icon { background: #fff4e5; color: #f59e0b; }

[data-theme="dark"] .stat-total .clients-reference-stat-icon { background: rgba(37, 99, 235, 0.16); color: #60a5fa; }
[data-theme="dark"] .stat-active .clients-reference-stat-icon { background: rgba(5, 150, 105, 0.16); color: #34d399; }
[data-theme="dark"] .stat-new .clients-reference-stat-icon { background: rgba(124, 58, 237, 0.16); color: #a78bfa; }
[data-theme="dark"] .stat-tickets .clients-reference-stat-icon { background: rgba(245, 158, 11, 0.16); color: #fbbf24; }

.clients-reference-card {
    overflow: visible;
    border: 1px solid var(--separator-color);
    border-radius: 11px;
    background: var(--bg-card-right);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.04);
    padding-bottom: 1px;
}

.clients-reference-toolbar {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .45rem .8rem;
    border-bottom: 1px solid var(--separator-color);
}

.clients-reference-toolbar h1 {
    margin: 0;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
}

.clients-reference-tools {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.clients-reference-new {
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0 0.9rem;
    border: 1px solid #000000;
    border-radius: 6px;
    background: #000000;
    color: #ffffff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
}

.clients-reference-new:hover {
    border-color: #171717;
    background: #171717;
    transform: translateY(-1px);
}

.clients-reference-new:active {
    transform: translateY(0);
}

.client-modal-card {
    width: min(680px, 100%);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

.client-modal-header {
    display: grid;
    grid-template-columns: 40px 1fr;
    align-items: center;
    gap: 0.85rem;
}

.client-modal-header h2,
.client-modal-header p {
    grid-column: 2;
}

.client-modal-header h2 { align-self: end; }
.client-modal-header p { align-self: start; }

.client-modal-icon {
    grid-row: 1 / span 2;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--action-soft);
    color: var(--text-primary);
}

.client-modal-icon .icon { width: 21px; height: 21px; }
.client-modal-card .form-group { margin-bottom: 0.9rem; }
.client-modal-card .editor-modal-actions { padding-top: 1rem; border-top: 1px solid var(--separator-color); }
.client-modal-card .btn-primary { background: #000000; border-color: #000000; color: #ffffff; }
.client-modal-card .btn-primary:hover { background: #171717; border-color: #171717; }
.client-modal-error { margin: 0 0 .75rem; color: var(--danger); font-size: 12px; }
.client-modal-card .form-control:invalid:not(:placeholder-shown) { border-color: var(--danger); }

.client-image-field {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--separator-color);
    border-radius: 9px;
    background: var(--input-bg);
}

.client-image-preview {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px dashed var(--input-border);
    border-radius: 10px;
    background: var(--bg-card-right);
    color: var(--text-muted);
}

.client-image-preview .icon { width: 24px; height: 24px; }
.client-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.client-image-field strong { display: block; color: var(--text-primary); font-size: 12px; }
.client-image-field p { margin: .15rem 0 .45rem; color: var(--text-muted); font-size: 11px; }
.client-image-actions { display: flex; align-items: center; gap: .7rem; }
.client-image-actions label,
.client-image-actions button { border: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: 11px; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 0; }
.client-image-actions button { color: var(--danger); }
.clients-reference-brand.client-brand-image { padding: 0; overflow: hidden; }
.clients-reference-brand.client-brand-image img { width: 100%; height: 100%; object-fit: cover; }

.clients-reference-search {
    width: 220px;
    height: 36px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.7rem;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-muted);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.clients-reference-search:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.clients-reference-search:focus-within {
    border-color: var(--action-bg);
    box-shadow: 0 0 0 3px var(--action-soft);
    color: var(--text-primary);
}

.clients-reference-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 12px;
}

.clients-reference-search input::placeholder {
    color: var(--text-muted);
}

.clients-reference-filter {
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0 0.85rem;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}

.clients-reference-filter:hover,
.clients-reference-filter.active {
    border-color: transparent;
    background: var(--action-soft);
    color: var(--text-primary);
}

[data-theme="light"] .clients-reference-filter:hover,
[data-theme="light"] .clients-reference-filter.active {
    background: #e5e8eb;
}

[data-theme="dark"] .clients-reference-filter:hover,
[data-theme="dark"] .clients-reference-filter.active {
    background: #2a2a2a;
    color: #e0e0e0;
}

.clients-reference-filter.active,
[data-theme="light"] .clients-reference-filter.active,
[data-theme="dark"] .clients-reference-filter.active {
    border-color: rgba(37, 99, 235, .28);
    background: var(--action-soft);
    color: var(--action-bg);
}

.clients-reference-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.clients-reference-table {
    width: 100%;
    min-width: 1080px;
    border-collapse: collapse;
    color: var(--text-primary);
    font-size: 12px;
}

.clients-reference-table th,
.clients-reference-table td {
    height: 51.6px;
    padding: 0 .55rem;
    border-bottom: 1px solid var(--separator-color);
    text-align: left;
    white-space: nowrap;
}

.clients-reference-table th {
    height: 36px;
    background: rgba(148, 163, 184, 0.045);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 700;
}

.clients-reference-table th > svg {
    margin-left: 0.12rem;
    color: var(--text-muted);
    vertical-align: -2px;
}

.clients-reference-table tbody tr {
    transition: background-color 0.18s ease;
}

.clients-reference-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .clients-reference-table tbody tr:hover {
    background: #e5e8eb;
}

[data-theme="light"] .clients-reference-table tbody tr:hover td {
    color: #0f172a;
}

.clients-reference-table tbody tr:last-child td {
    border-bottom: 0;
}

.clients-reference-table tr[hidden] {
    display: none;
}

.clients-reference-table td a {
    color: var(--text-primary);
}

.clients-reference-table td a:hover {
    color: var(--text-muted);
}

.clients-reference-logo-heading,
.clients-reference-table td:last-child {
    text-align: center;
}

.clients-reference-table td:first-child {
    width: 58px;
    padding-left: 1rem;
    text-align: center;
}

.clients-reference-table .clients-reference-logo-heading {
    padding-right: 0;
    padding-left: 0;
}

.clients-reference-table .clients-reference-logo-heading > svg {
    display: block;
    margin: 0 auto;
}

.clients-reference-brand {
    min-width: 42px;
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #2563eb;
    font-size: 1rem;
    font-weight: 800;
    line-height: 0.85;
}

.clients-reference-brand small {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.43rem;
    font-weight: 750;
}

.brand-ideal { color: #0759b9; font-size: 0.95rem; }
.brand-clinic { color: #15803d; font-size: 0.5rem; line-height: 1; }
.brand-ec { color: #8b5cf6; font-size: 1.15rem; }
.brand-store { color: #f97316; font-size: 0.58rem; line-height: 1; }
.brand-ag { color: #2563eb; }
.brand-tech { color: #0759b9; font-size: 0.72rem; line-height: 0.85; }
.brand-minas { color: #dc2626; font-size: 0.65rem; line-height: 0.9; }
.brand-hotel { color: #0f766e; font-size: 0.9rem; }
.brand-agro { color: #16a34a; font-size: 0.7rem; line-height: 0.9; }
.brand-pharma { color: #0891b2; font-size: 0.86rem; }

.clients-reference-status {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 650;
}

.clients-reference-status.active {
    background: #dcfce7;
    color: #15803d;
}

.clients-reference-status.inactive {
    background: #fff1d6;
    color: #d97706;
}

[data-theme="dark"] .clients-reference-status.active {
    background: rgba(21, 128, 61, 0.2);
    color: #4ade80;
}

[data-theme="dark"] .clients-reference-status.inactive {
    background: rgba(217, 119, 6, 0.16);
    color: #fbbf24;
}

.clients-reference-more {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.clients-reference-more:hover {
    background: var(--action-soft);
    color: var(--text-primary);
}

[data-theme="light"] .clients-reference-more:hover { background: #e5e8eb; }
[data-theme="dark"] .clients-reference-more:hover { background: #2a2a2a; }

.clients-reference-footer {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 1rem;
    border-top: 1px solid var(--separator-color);
    color: var(--text-muted);
    font-size: 12px;
}

.clients-reference-pagination {
    display: flex;
    align-items: center;
    gap: 0.42rem;
}

.clients-reference-pagination button {
    width: 29px;
    height: 29px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    background: var(--input-bg);
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
}

.clients-reference-pagination button:hover:not(:disabled) {
    border-color: var(--text-muted);
    background: var(--action-bg-hover);
    color: var(--action-text);
}

[data-theme="light"] .clients-reference-pagination button:hover:not(:disabled) {
    border-color: #e5e8eb;
    background: #e5e8eb;
    color: #0f172a;
}

.clients-reference-pagination button.active,
[data-theme="light"] .clients-reference-pagination button.active,
[data-theme="light"] .clients-reference-pagination button.active:hover {
    border-color: var(--action-bg);
    background: var(--action-bg);
    color: var(--action-text);
}

.clients-reference-pagination button:disabled {
    opacity: 0.45;
    cursor: default;
}

@media (max-width: 1050px) {
    .clients-reference-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .app-content.clients-reference {
        padding: 0.85rem;
    }

    .clients-reference-stats {
        grid-template-columns: 1fr;
    }

    .clients-reference-toolbar,
    .clients-reference-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .clients-reference-tools {
        width: 100%;
        flex-wrap: wrap;
    }

    .clients-reference-new {
        width: 100%;
    }

    .clients-reference-search {
        width: auto;
        flex: 1 1 auto;
    }
}

/* Categorias — composição central baseada na referência visual */
.app-content.categories-reference {
    padding: .75rem;
}

.categories-reference-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .8rem;
    margin-bottom: .85rem;
}

.categories-reference-stat {
    min-height: 78px;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem .8rem;
    border: 1px solid var(--separator-color);
    border-radius: 11px;
    background: var(--bg-card-right);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.04);
}

.categories-reference-stat-icon {
    width: 51px;
    height: 51px;
    flex: 0 0 51px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.categories-reference-stat h2 {
    margin: 0 0 0.18rem;
    color: var(--text-primary);
    font-size: 0.7rem;
    font-weight: 650;
}

.categories-reference-stat strong {
    display: block;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 1.42rem;
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.categories-reference-stat p {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
    font-size: 0.64rem;
    white-space: nowrap;
}

.categories-reference-stat p b { color: #10b981; font-weight: 650; }
.categories-reference-stat.stat-total .categories-reference-stat-icon { background: #eaf2ff; color: #2563eb; }
.categories-reference-stat.stat-active .categories-reference-stat-icon { background: #e9f8f1; color: #16a34a; }
.categories-reference-stat.stat-popular .categories-reference-stat-icon { background: #f1eafe; color: #7c3aed; }
.categories-reference-stat.stat-volume .categories-reference-stat-icon { background: #fff4e5; color: #f59e0b; }
[data-theme="dark"] .categories-reference-stat.stat-total .categories-reference-stat-icon { background: rgba(37, 99, 235, .16); color: #60a5fa; }
[data-theme="dark"] .categories-reference-stat.stat-active .categories-reference-stat-icon { background: rgba(22, 163, 74, .16); color: #4ade80; }
[data-theme="dark"] .categories-reference-stat.stat-popular .categories-reference-stat-icon { background: rgba(124, 58, 237, .16); color: #a78bfa; }
[data-theme="dark"] .categories-reference-stat.stat-volume .categories-reference-stat-icon { background: rgba(245, 158, 11, .16); color: #fbbf24; }

.categories-reference-workspace {
    display: grid;
    grid-template-columns: minmax(0, 3.25fr) minmax(220px, 0.9fr);
    gap: 1rem;
    align-items: start;
}

.categories-reference-card,
.categories-reference-side-card {
    overflow: hidden;
    border: 1px solid var(--separator-color);
    border-radius: 11px;
    background: var(--bg-card-right);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.04);
}

.categories-reference-toolbar {
    min-height: 55px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--separator-color);
}

.categories-reference-search {
    width: 250px;
    height: 36px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.7rem;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-muted);
    transition: border-color .2s, box-shadow .2s;
}

.categories-reference-search:hover { border-color: var(--text-muted); color: var(--text-primary); }
.categories-reference-search:focus-within { border-color: var(--action-bg); box-shadow: 0 0 0 3px var(--action-soft); color: var(--text-primary); }
.categories-reference-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text-primary); font-size: 12px; }
.categories-reference-search input::placeholder { color: var(--text-muted); }

.categories-reference-filter,
.categories-reference-new {
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: 0 .8rem;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
    cursor: pointer;
}

.categories-reference-filter { border: 1px solid var(--input-border); background: var(--input-bg); color: var(--text-primary); }
.categories-reference-filter:hover,
.categories-reference-filter.active { border-color: transparent; background: var(--action-soft); color: var(--text-primary); }
[data-theme="light"] .categories-reference-filter:hover,
[data-theme="light"] .categories-reference-filter.active { background: #e5e8eb; }
[data-theme="dark"] .categories-reference-filter:hover,
[data-theme="dark"] .categories-reference-filter.active { background: #2a2a2a; color: #e0e0e0; }
.categories-reference-new { border: 1px solid var(--action-border); background: var(--action-bg); color: var(--action-text); }
.categories-reference-new:hover { background: var(--action-bg-hover); color: var(--action-text); }

.categories-reference-table-wrap { width: 100%; overflow-x: auto; }
.categories-reference-table { width: 100%; min-width: 900px; border-collapse: collapse; color: var(--text-primary); font-size: .72rem; }
.categories-reference-table th,
.categories-reference-table td { height: 44px; padding: .3rem .6rem; border-bottom: 1px solid var(--separator-color); text-align: left; vertical-align: middle; }
.categories-reference-table th { height: 36px; background: rgba(148, 163, 184, .045); color: var(--text-primary); font-size: .67rem; font-weight: 700; white-space: nowrap; }
.categories-reference-table th:first-child,
.categories-reference-table td:first-child { padding-left: 1rem; }
.categories-reference-table th:nth-child(2),
.categories-reference-table td:nth-child(2) { width: 27%; }
.categories-reference-table td:nth-child(2) { color: var(--text-muted); line-height: 1.35; }
.categories-reference-table tbody tr { transition: background-color .18s ease; }
.categories-reference-table tbody tr:hover { background: rgba(255,255,255,.04); }
[data-theme="light"] .categories-reference-table tbody tr:hover { background: #e5e8eb; }
[data-theme="light"] .categories-reference-table tbody tr:hover td { color: #0f172a; }
.categories-reference-table tbody tr:last-child td { border-bottom: 0; }
.categories-reference-table tr[hidden] { display: none; }

.categories-reference-name { display: inline-flex; align-items: center; gap: .65rem; white-space: nowrap; }
.categories-reference-name strong { font-size: .72rem; font-weight: 650; }
.categories-reference-row-icon { width: 31px; height: 31px; flex: 0 0 31px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: #eaf2ff; color: #2563eb; }
.categories-reference-row-icon .icon { width: 16px; height: 16px; }
.categories-reference-row-icon.icon-software { background: #e8e8e8; color: #3b82f6; }
.categories-reference-row-icon.icon-network { background: #e8e8e8; color: #0284c7; }
.categories-reference-row-icon.icon-access { background: #e8e8e8; color: #171717; }
.categories-reference-row-icon.icon-printer { background: #e8e8e8; color: #4f46e5; }
.categories-reference-row-icon.icon-mail { background: #e8e8e8; color: #3b82f6; }
.categories-reference-row-icon.icon-finance { background: #e8f8f0; color: #059669; }
.categories-reference-row-icon.icon-security { background: #feecec; color: #dc2626; }
.categories-reference-row-icon.icon-infra { background: #f1eafe; color: #7c3aed; }
.categories-reference-row-icon.icon-register { background: #e9f8f1; color: #10b981; }
.categories-reference-row-icon.icon-reports { background: #fff4e5; color: #f59e0b; }
[data-theme="dark"] .categories-reference-row-icon { background: rgba(37,99,235,.16); }

.categories-reference-status { min-height: 22px; display: inline-flex; align-items: center; padding: .15rem .48rem; border-radius: 4px; font-size: .66rem; font-weight: 650; }
.categories-reference-status.active { background: #dcfce7; color: #15803d; }
.categories-reference-status.inactive { background: #fee2e2; color: #dc2626; }
[data-theme="dark"] .categories-reference-status.active { background: rgba(21,128,61,.2); color: #4ade80; }
[data-theme="dark"] .categories-reference-status.inactive { background: rgba(220,38,38,.16); color: #f87171; }

.categories-reference-more { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 5px; background: transparent; color: var(--text-muted); cursor: pointer; }
.categories-reference-more .icon { width: 18px; height: 18px; }
.categories-reference-more:hover { background: var(--action-soft); color: var(--text-primary); }
[data-theme="light"] .categories-reference-more:hover { background: #e5e8eb; }
[data-theme="dark"] .categories-reference-more:hover { background: #2a2a2a; }

.categories-reference-footer { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .65rem 1rem; border-top: 1px solid var(--separator-color); color: var(--text-muted); font-size: .68rem; }
.categories-reference-pagination { display: flex; align-items: center; gap: .4rem; }
.categories-reference-pagination button { width: 29px; height: 29px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--input-border); border-radius: 5px; background: var(--input-bg); color: var(--text-muted); font-size: .7rem; cursor: pointer; }
.categories-reference-pagination button .icon { width: 15px; height: 15px; }
.categories-reference-pagination button:hover:not(:disabled) { border-color: var(--text-muted); background: var(--action-bg-hover); color: var(--action-text); }
[data-theme="light"] .categories-reference-pagination button:hover:not(:disabled) { border-color: #e5e8eb; background: #e5e8eb; color: #0f172a; }
.categories-reference-pagination button.active,
[data-theme="light"] .categories-reference-pagination button.active,
[data-theme="light"] .categories-reference-pagination button.active:hover { border-color: var(--action-bg); background: var(--action-bg); color: var(--action-text); }
.categories-reference-pagination button:disabled { opacity: .45; cursor: default; }
.categories-reference-side { display: grid; gap: 1rem; }
.categories-reference-side-card > header { min-height: 48px; display: flex; align-items: center; gap: .6rem; padding: 0 .9rem; border-bottom: 1px solid var(--separator-color); color: var(--text-muted); }
.categories-reference-side-card > header h2 { margin: 0; color: var(--text-primary); font-size: .81rem; font-weight: 700; }
.categories-reference-summary { margin: 0; padding: .35rem .8rem; list-style: none; }
.categories-reference-summary li { min-height: 37px; display: grid; grid-template-columns: 8px minmax(0,1fr) auto; align-items: center; gap: .5rem; border-bottom: 1px solid var(--separator-color); color: var(--text-muted); font-size: .68rem; }
.categories-reference-summary li:last-child { border-bottom: 0; }
.categories-reference-summary li i { width: 5px; height: 5px; border-radius: 50%; }
.categories-reference-summary li strong { color: var(--text-primary); font-size: .68rem; font-weight: 650; }
.dot-blue { background: #2563eb; }.dot-green { background: #10b981; }.dot-red { background: #ef4444; }.dot-purple { background: #7c3aed; }.dot-blue-dark { background: #1d4ed8; }.dot-slate { background: #64748b; }
.categories-reference-practices ul { display: grid; gap: .95rem; margin: 0; padding: 1rem .9rem 1.2rem; list-style: none; }
.categories-reference-practices li { display: flex; align-items: flex-start; gap: .55rem; color: var(--text-muted); font-size: .67rem; line-height: 1.4; }
.categories-reference-practices li .icon { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 1px; color: #2563eb; }

/* Categories overview */
.categories-overview {
    display: grid;
    grid-template-columns: minmax(0, 3.15fr) minmax(245px, .95fr);
    gap: 1rem;
    align-items: start;
}

.categories-overview-main,
.categories-overview-side-card {
    border: 1px solid var(--separator-color);
    border-radius: 11px;
    background: var(--bg-card-right);
    box-shadow: 0 3px 10px rgba(15, 23, 42, .04);
}

.categories-overview-main { padding: 1.28rem .9rem; }
.categories-overview-header { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.categories-overview-header h2 { margin: 0; color: var(--text-primary); font-size: 14px; font-weight: 700; white-space: nowrap; }
.categories-overview-actions { display: flex; align-items: center; justify-content: flex-end; gap: .55rem; min-width: 0; }
.categories-overview-actions .categories-reference-search { width: 230px; }
.categories-overview-actions .icon { width: 16px; height: 16px; flex: 0 0 16px; }

.overview-status-filter {
    position: relative;
}

.overview-status-filter-menu {
    position: absolute;
    z-index: 300;
    top: calc(100% + 6px);
    right: 0;
    width: 145px;
    display: none;
    padding: .3rem;
    border: 1px solid var(--input-border);
    border-radius: 7px;
    background: #f8fafc;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .16);
}

.overview-status-filter.open .overview-status-filter-menu {
    display: grid;
    gap: .2rem;
}

[data-theme="dark"] .overview-status-filter-menu {
    background: #1a1a1a;
    box-shadow: 0 14px 32px rgba(0, 0, 0, .4);
}

.overview-status-filter-menu button {
    width: 100%;
    min-height: 32px;
    padding: .4rem .55rem;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.overview-status-filter-menu button:hover {
    background: #e5e8eb;
    color: var(--text-primary);
}

[data-theme="dark"] .overview-status-filter-menu button:hover {
    background: rgba(255, 255, 255, .04);
}

.overview-status-filter-menu button.active {
    background: var(--action-soft);
    color: var(--action-bg);
}
[data-theme="dark"] .overview-status-filter-menu button.active {
    color: var(--action-text);
}

.categories-overview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.category-overview-card {
    min-width: 0;
    padding: 2.9px;
    overflow: hidden;
    border: 1px solid var(--separator-color);
    border-radius: 9px;
    background: var(--bg-card-right);
    transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}
.category-overview-card:hover { border-color: var(--input-border); background: rgba(255, 255, 255, .035); transform: translateY(-1px); }
[data-theme="light"] .category-overview-card:hover { border-color: #d7dce3; background: #f5f6f7; }
.category-overview-card[hidden] { display: none; }

.category-overview-top { min-height: 73.5px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: start; gap: .65rem; padding: .4rem .42rem 0; box-sizing: border-box; }
.category-overview-top > div { min-width: 0; }
.category-overview-top h3 { margin: .12rem 0 .25rem; color: var(--text-primary); font-size: 14px; font-weight: 700; }
.category-overview-top p { margin: 0; color: var(--text-muted); font-size: 12px; line-height: 1.45; }
.category-overview-icon { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: #eaf2ff; color: #2563eb; }
.category-overview-icon .icon { width: 23px; height: 23px; }
.category-overview-icon.icon-software { background: #f1eafe; color: #7c3aed; }
.category-overview-icon.icon-network { background: #e7f1ff; color: #1685e5; }
.category-overview-icon.icon-access { background: #e9f8ef; color: #16a34a; }
.category-overview-icon.icon-printer { background: #fff0e8; color: #f97316; }
.category-overview-icon.icon-mail { background: #eaf2ff; color: #2563eb; }
.category-overview-icon.icon-finance { background: #e9f8ef; color: #059669; }
.category-overview-icon.icon-security { background: #feecec; color: #dc2626; }
.category-overview-icon.icon-infra { background: #f1eafe; color: #7c3aed; }
[data-theme="dark"] .category-overview-icon { background: rgba(37, 99, 235, .16); }
[data-theme="dark"] .category-overview-icon.icon-software { background: rgba(124, 58, 237, .16); color: #a78bfa; }
[data-theme="dark"] .category-overview-icon.icon-access { background: rgba(22, 163, 74, .16); color: #4ade80; }
[data-theme="dark"] .category-overview-icon.icon-printer { background: rgba(249, 115, 22, .16); color: #fb923c; }
[data-theme="dark"] .category-overview-icon.icon-finance { background: rgba(5, 150, 105, .16); color: #34d399; }
[data-theme="dark"] .category-overview-icon.icon-security { background: rgba(220, 38, 38, .16); color: #f87171; }
[data-theme="dark"] .category-overview-icon.icon-infra { background: rgba(124, 58, 237, .16); color: #a78bfa; }

.category-overview-status { padding: .24rem .45rem; border-radius: 4px; background: #dcfce7; color: #15803d; font-size: 11px; font-weight: 700; }
[data-theme="dark"] .category-overview-status { background: rgba(21, 128, 61, .2); color: #4ade80; }

.category-overview-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: .45rem 0 0; padding: .65rem 0; border-top: 1px solid var(--separator-color); border-bottom: 1px solid var(--separator-color); }
.category-overview-metrics div { min-width: 0; padding: 0 .42rem; text-align: center; border-right: 1px solid var(--separator-color); }
.category-overview-metrics div:first-child { padding-left: 0; }
.category-overview-metrics div:last-child { padding-right: 0; border-right: 0; }
.category-overview-metrics dt { overflow: hidden; color: var(--text-muted); font-size: 11px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.category-overview-metrics dd { margin: .26rem 0 0; color: var(--text-primary); font-size: 13px; font-weight: 700; white-space: nowrap; }
.category-overview-card > a { min-height: 31.5px; display: flex; align-items: center; justify-content: center; gap: .45rem; color: var(--action-bg); font-size: 12px; font-weight: 650; text-decoration: none; }
.category-overview-card > a:hover { color: var(--action-bg-hover); }
[data-theme="dark"] .category-overview-card > a { color: var(--action-text); }
[data-theme="dark"] .category-overview-card > a:hover { color: var(--action-text-soft); }
.category-overview-card > a .icon { width: 14px; height: 14px; }
.categories-overview-empty { margin: .8rem 0 0; padding: 1.5rem; text-align: center; color: var(--text-muted); font-size: .72rem; }
.categories-overview-footer { min-height: 45px; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-top: .85rem; padding-top: .75rem; border-top: 1px solid var(--separator-color); color: var(--text-muted); font-size: 12px; }
.categories-overview-pagination { display: flex; align-items: center; gap: .4rem; }
.categories-overview-pagination button { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--input-border); border-radius: 5px; background: var(--input-bg); color: var(--text-muted); font-size: 12px; cursor: pointer; transition: border-color .18s ease, background-color .18s ease, color .18s ease; }
.categories-overview-pagination button .icon { width: 15px; height: 15px; }
.categories-overview-pagination button:hover:not(:disabled) { border-color: transparent; background: var(--action-soft); color: var(--text-primary); }
[data-theme="light"] .categories-overview-pagination button:hover:not(:disabled) { background: #e5e8eb; color: #0f172a; }
.categories-overview-pagination button.active,
.categories-overview-pagination button.active:hover { border-color: var(--action-bg); background: var(--action-bg); color: var(--action-text); }
.categories-overview-pagination button:disabled { opacity: .45; cursor: default; }

.categories-overview-side { height: 100%; display: grid; grid-template-rows: minmax(0, .95fr) minmax(0, 1.05fr); gap: 1rem; align-self: stretch; }
.categories-overview-side-card { overflow: hidden; }
.categories-overview-side-card > header { min-height: 49px; display: flex; align-items: center; gap: .6rem; padding: 0 .85rem; border-bottom: 1px solid var(--separator-color); }
.categories-overview-side-card > header .icon { width: 18px; height: 18px; color: #2563eb; }
.categories-overview-side-card > header h2 { margin: 0; color: var(--text-primary); font-size: 13px; font-weight: 700; }
.categories-distribution { display: flex; flex-direction: column; }
.categories-distribution ul { flex: 1; display: grid; align-content: space-evenly; gap: .52rem; margin: 0; padding: .72rem .85rem .62rem; list-style: none; }
.categories-distribution li > div { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .24rem; color: var(--text-primary); font-size: 12px; }
.categories-distribution li strong { font-weight: 650; }
.categories-distribution li span { color: var(--text-muted); font-weight: 650; }
.categories-distribution li > i { height: 5px; display: block; overflow: hidden; border-radius: 999px; background: var(--separator-color); }
.categories-distribution li > i b { height: 100%; display: block; border-radius: inherit; background: #1769ff; }
.categories-distribution footer { min-height: 36px; display: flex; align-items: center; justify-content: space-between; padding: 0 .85rem; border-top: 1px solid var(--separator-color); color: var(--text-primary); font-size: 12px; }
.categories-overview-practices { display: flex; flex-direction: column; }
.categories-overview-practices ul { flex: 1; display: grid; align-content: space-evenly; gap: .72rem; margin: 0; padding: .85rem; list-style: none; }
.categories-overview-practices li { display: flex; align-items: flex-start; gap: .55rem; color: var(--text-muted); font-size: 12px; line-height: 1.45; }
.categories-overview-practices li .icon { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 1px; color: #1769ff; }

/* Help center reference */
.app-content.help-reference { padding: .75rem; }
.help-reference-layout { display: grid; grid-template-columns: minmax(0,3.45fr) minmax(255px,1fr); gap: 1rem; align-items: start; }
.help-reference-primary, .help-reference-side { min-width: 0; display: grid; gap: 1rem; }
.help-reference-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; }
.help-reference-stat { min-width: 0; min-height: 94px; display: flex; align-items: center; gap: .8rem; padding: 1rem .9rem; border: 1px solid var(--separator-color); border-radius: 10px; background: var(--bg-card-right); box-shadow: 0 3px 10px rgba(15,23,42,.04); }
.help-reference-stat-icon { width: 49px; height: 49px; flex: 0 0 49px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.help-reference-stat-icon .icon { width: 25px; height: 25px; }
.help-reference-stat.stat-blue .help-reference-stat-icon { background: #e8e8e8; color: #171717; }
.help-reference-stat.stat-green .help-reference-stat-icon { background: #e9f8ef; color: #16a34a; }
.help-reference-stat.stat-purple .help-reference-stat-icon { background: #f1eafe; color: #7c3aed; }
[data-theme="dark"] .help-reference-stat.stat-blue .help-reference-stat-icon { background: rgba(37,99,235,.16); color: #60a5fa; }
[data-theme="dark"] .help-reference-stat.stat-green .help-reference-stat-icon { background: rgba(22,163,74,.16); color: #4ade80; }
[data-theme="dark"] .help-reference-stat.stat-purple .help-reference-stat-icon { background: rgba(124,58,237,.16); color: #a78bfa; }
.help-reference-stat h2 { margin: 0 0 .18rem; color: var(--text-secondary); font-size: 12px; font-weight: 650; white-space: nowrap; }
.help-reference-stat strong { display: block; color: var(--text-primary); font-size: 21px; line-height: 1.05; }
.help-reference-stat p { margin: .32rem 0 0; color: var(--text-muted); font-size: 10px; white-space: nowrap; }
.help-reference-card { overflow: hidden; padding: 1.1px 0; border: 1px solid var(--separator-color); border-radius: 10px; background: var(--bg-card-right); box-shadow: 0 3px 10px rgba(15,23,42,.04); }
.help-reference-card > header { min-height: 47px; display: flex; align-items: center; gap: .55rem; padding: .58rem .8rem; border-bottom: 1px solid var(--separator-color); }
.help-reference-card > header h2 { margin: 0; color: var(--text-primary); font-size: 14px; font-weight: 700; }
.help-reference-card > header .icon { width: 17px; height: 17px; color: #607593; }
.help-reference-topics > header { justify-content: space-between; }
.help-reference-topic-search { width: 230px; height: 32px; display: flex; align-items: center; gap: .45rem; padding: 0 .65rem; border: 1px solid var(--input-border); border-radius: 6px; background: var(--input-bg); color: var(--text-muted); transition: border-color .18s, box-shadow .18s; }
.help-reference-topic-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.help-reference-topic-search .icon { width: 15px; height: 15px; flex: 0 0 15px; }
.help-reference-topic-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text-primary); font-size: 12px; }
.help-reference-topic-search input::placeholder { color: var(--text-muted); }
.help-reference-topic-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .85rem; padding: .8rem; }
.help-reference-topic { min-width: 0; min-height: 95.1px; display: grid; grid-template-columns: 43px minmax(0,1fr); align-items: start; gap: .7rem; padding: calc(.43rem - .9px) .72rem; border: 1px solid var(--separator-color); border-radius: 8px; background: var(--bg-card-right); transition: border-color .18s, background-color .18s, transform .18s; }
.help-reference-topic[hidden] { display: none; }
.help-reference-topic:hover { border-color: var(--input-border); background: rgba(255,255,255,.035); transform: translateY(-1px); }
[data-theme="light"] .help-reference-topic:hover { background: #f5f6f7; }
.help-reference-topic-icon { width: 43px; height: 43px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.help-reference-topic-icon .icon { width: 22px; height: 22px; }
.help-reference-topic-icon.blue { background: #eaf2ff; color: #2563eb; }
.help-reference-topic-icon.orange { background: #fff0e8; color: #f97316; }
.help-reference-topic-icon.green { background: #e9f8ef; color: #16a34a; }
.help-reference-topic-icon.purple { background: #f1eafe; color: #7c3aed; }
.help-reference-topic-icon.slate { background: #edf1f5; color: #64748b; }
[data-theme="dark"] .help-reference-topic-icon.blue { background: rgba(37,99,235,.16); color: #60a5fa; }
[data-theme="dark"] .help-reference-topic-icon.orange { background: rgba(249,115,22,.16); color: #fb923c; }
[data-theme="dark"] .help-reference-topic-icon.green { background: rgba(22,163,74,.16); color: #4ade80; }
[data-theme="dark"] .help-reference-topic-icon.purple { background: rgba(124,58,237,.16); color: #a78bfa; }
[data-theme="dark"] .help-reference-topic-icon.slate { background: rgba(100,116,139,.16); color: #94a3b8; }
.help-reference-topic h3 { margin: .05rem 0 .28rem; color: var(--text-primary); font-size: 14px; font-weight: 700; }
.help-reference-topic p { min-height: 30px; margin: 0 0 .38rem; color: var(--text-muted); font-size: 12px; line-height: 1.45; }
.help-reference-topic a { display: inline-flex; align-items: center; gap: .35rem; color: var(--accent); font-size: 12px; font-weight: 650; }
.help-reference-topic a:hover { color: var(--accent-hover); }
.help-reference-topic a .icon { width: 14px; height: 14px; }
.help-reference-topic-footer { min-height: 45px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .45rem .8rem; border-top: 1px solid var(--separator-color); }
.help-reference-topic-footer > span { color: var(--text-muted); font-size: 11px; }
.help-reference-topic-pagination { display: flex; align-items: center; gap: .4rem; }
.help-reference-topic-pagination button { width: 29px; height: 29px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--input-border); border-radius: 5px; background: var(--input-bg); color: var(--text-muted); font-size: 11px; cursor: pointer; transition: background-color .18s, border-color .18s, color .18s; }
.help-reference-topic-pagination button .icon { width: 15px; height: 15px; }
.help-reference-topic-pagination button:hover:not(:disabled) { border-color: transparent; background: var(--action-soft); color: var(--text-primary); }
[data-theme="light"] .help-reference-topic-pagination button:hover:not(:disabled) { background: #e5e8eb; color: #0f172a; }
.help-reference-topic-pagination button.active { border-color: var(--action-bg); background: var(--action-bg); color: var(--action-text); }
.help-reference-topic-pagination button:disabled { opacity: .45; cursor: default; }
.help-reference-featured > div { padding: 0 .8rem; }
.help-reference-featured article { min-height: 54px; display: grid; grid-template-columns: 30px minmax(260px,1fr) 86px 62px 84px; align-items: center; gap: .6rem; border-bottom: 1px solid var(--separator-color); transition: background-color .18s; }
.help-reference-featured article:hover { background: rgba(255,255,255,.04); }
[data-theme="light"] .help-reference-featured article:hover { background: #e5e8eb; }
.help-reference-featured article > span { width: 27px; height: 27px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; background: #eaf2ff; color: #2563eb; }
[data-theme="dark"] .help-reference-featured article > span { background: rgba(37,99,235,.16); color: #60a5fa; }
.help-reference-featured article > span .icon { width: 15px; height: 15px; }
.help-reference-featured article h3 { margin: 0 0 .15rem; color: var(--text-primary); font-size: 12px; font-weight: 700; }
.help-reference-featured article p { margin: 0; overflow: hidden; color: var(--text-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.help-reference-featured article b { justify-self: start; padding: .2rem .4rem; border-radius: 4px; background: var(--accent-soft); color: var(--text-muted); font-size: 11px; font-weight: 600; }
[data-theme="dark"] .help-reference-featured article b { background: rgba(37,99,235,.16); color: #93c5fd; }
.help-reference-featured article small { display: inline-flex; align-items: center; gap: .3rem; color: var(--text-muted); font-size: 11px; }
.help-reference-featured article small .icon { width: 13px; height: 13px; }
.help-reference-featured article time { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.help-reference-featured > a { min-height: 38.5px; display: flex; align-items: center; gap: .4rem; padding: 0 .8rem; color: var(--accent); font-size: 12px; font-weight: 650; text-decoration: none; }
.help-reference-featured > a:hover { background: rgba(255,255,255,.04); }
[data-theme="light"] .help-reference-featured > a:hover { background: #e5e8eb; }
.help-reference-featured > a .icon { width: 14px; height: 14px; }
.help-reference-side { grid-template-rows: auto auto; }
.help-reference-quick > div { display: grid; gap: .6rem; padding: .78rem .7rem .88rem; }
.help-reference-quick a { min-height: 72px; display: grid; grid-template-columns: 34px minmax(0,1fr) 12px; align-items: center; gap: .55rem; padding: calc(1rem - 4px) .55rem; border: 1px solid var(--separator-color); border-radius: 7px; color: var(--text-primary); transition: background-color .18s, border-color .18s; }
.help-reference-quick a:hover { border-color: var(--input-border); background: var(--action-soft); }
[data-theme="light"] .help-reference-quick a:hover { background: #e5e8eb; }
.help-reference-quick a > span { width: 31px; height: 31px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.help-reference-quick a > span .icon { width: 18px; height: 18px; }
.help-reference-quick a > span.green { background: #e9f8ef; color: #16a34a; }
.help-reference-quick a > span.blue { background: #eaf2ff; color: #2563eb; }
.help-reference-quick a > span.purple { background: #f1eafe; color: #7c3aed; }
[data-theme="dark"] .help-reference-quick a > span.green { background: rgba(22,163,74,.16); color: #4ade80; }
[data-theme="dark"] .help-reference-quick a > span.blue { background: rgba(37,99,235,.16); color: #60a5fa; }
[data-theme="dark"] .help-reference-quick a > span.purple { background: rgba(124,58,237,.16); color: #a78bfa; }
.help-reference-quick a b { min-width: 0; font-size: 12px; font-weight: 700; line-height: 1.35; }
.help-reference-quick a small { display: block; margin-top: .32rem; overflow: hidden; color: var(--text-muted); font-size: 11px; font-weight: 500; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.help-reference-quick a i { color: var(--text-muted); font-size: 16px; font-style: normal; }
.help-reference-faq > div { padding: .48rem .7rem; }
.help-reference-faq > div a { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 0 .4rem; border-bottom: 1px solid var(--separator-color); color: var(--text-secondary); font-size: 12px; transition: background-color .18s,color .18s; }
.help-reference-faq > div a:hover { background: rgba(255,255,255,.04); color: var(--text-primary); }
[data-theme="light"] .help-reference-faq > div a:hover { background: #e5e8eb; color: #0f172a; }
.help-reference-faq > div a span { color: var(--text-muted); font-size: 16px; }
.help-reference-faq > a { min-height: 44px; display: flex; align-items: center; gap: .4rem; padding: 0 .7rem; color: var(--accent); font-size: 12px; font-weight: 650; }
.help-reference-faq > a:hover { background: rgba(255,255,255,.04); }
[data-theme="light"] .help-reference-faq > a:hover { background: #e5e8eb; }
.help-reference-faq > a .icon { width: 14px; height: 14px; }
@media (max-width: 1150px) {
    .help-reference-layout { grid-template-columns: 1fr; }
    .help-reference-side { grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-rows: none; }
}
@media (max-width: 820px) {
    .help-reference-stats { grid-template-columns: 1fr; }
    .help-reference-topic-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .help-reference-featured { overflow-x: auto; }
}
@media (max-width: 620px) {
    .app-content.help-reference { padding: .85rem; }
    .help-reference-topic-grid, .help-reference-side { grid-template-columns: 1fr; }
    .help-reference-topics > header { align-items: stretch; flex-direction: column; }
    .help-reference-topic-search { width: 100%; }
}

/* Knowledge base reference */
.app-content.knowledge-reference { padding: .75rem; }
.knowledge-reference-layout { display: grid; grid-template-columns: minmax(0, 4.35fr) minmax(230px, 1fr); gap: 1rem; align-items: start; }
.knowledge-reference-primary, .knowledge-reference-side { min-width: 0; display: grid; gap: 1rem; }
.knowledge-reference-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; }
.knowledge-reference-stat { min-width: 0; min-height: 88px; display: flex; align-items: center; gap: .75rem; padding: .75rem .85rem; border: 1px solid var(--separator-color); border-radius: 10px; background: var(--bg-card-right); box-shadow: 0 3px 10px rgba(15,23,42,.04); }
.knowledge-reference-stat-icon { width: 48px; height: 48px; flex: 0 0 48px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.knowledge-reference-stat-icon .icon { width: 24px; height: 24px; }
.knowledge-reference-stat.stat-blue .knowledge-reference-stat-icon { background: #eaf2ff; color: #2563eb; }
.knowledge-reference-stat.stat-green .knowledge-reference-stat-icon { background: #e9f8ef; color: #16a34a; }
.knowledge-reference-stat.stat-orange .knowledge-reference-stat-icon { background: #fff4e5; color: #f59e0b; }
.knowledge-reference-stat.stat-purple .knowledge-reference-stat-icon { background: #f1eafe; color: #7c3aed; }
[data-theme="dark"] .knowledge-reference-stat.stat-blue .knowledge-reference-stat-icon { background: rgba(37,99,235,.16); color: #60a5fa; }
[data-theme="dark"] .knowledge-reference-stat.stat-green .knowledge-reference-stat-icon { background: rgba(22,163,74,.16); color: #4ade80; }
[data-theme="dark"] .knowledge-reference-stat.stat-orange .knowledge-reference-stat-icon { background: rgba(245,158,11,.16); color: #fbbf24; }
[data-theme="dark"] .knowledge-reference-stat.stat-purple .knowledge-reference-stat-icon { background: rgba(124,58,237,.16); color: #a78bfa; }
.knowledge-reference-stat h2 { margin: 0 0 .2rem; color: var(--text-secondary); font-size: 12px; font-weight: 650; white-space: nowrap; }
.knowledge-reference-stat strong { display: block; color: var(--text-primary); font-size: 21px; line-height: 1.05; }
.knowledge-reference-stat p { margin: .32rem 0 0; overflow: hidden; color: var(--text-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-reference-categories, .knowledge-reference-articles, .knowledge-reference-banner, .knowledge-side-card { overflow: hidden; border: 1px solid var(--separator-color); border-radius: 10px; background: var(--bg-card-right); box-shadow: 0 3px 10px rgba(15,23,42,.04); }
.knowledge-reference-categories { padding: .55rem .72rem .72rem; }
.knowledge-reference-categories > header { padding: 0 0 .25rem; }
.knowledge-reference-categories h2, .knowledge-reference-articles h2, .knowledge-side-card h2 { margin: 0; color: var(--text-primary); font-size: 14px; font-weight: 700; }
.knowledge-category-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: .72rem; padding: .45rem 0 0; }
.knowledge-category-item { min-width: 0; min-height: 55px; display: flex; align-items: center; gap: .58rem; padding: .5rem .6rem; border: 1px solid var(--separator-color); border-radius: 7px; background: var(--bg-card-right); color: var(--text-primary); text-align: left; cursor: pointer; transition: border-color .18s, background-color .18s; }
.knowledge-category-item:hover { border-color: var(--input-border); background: rgba(255, 255, 255, .035); }
[data-theme="light"] .knowledge-category-item:hover { border-color: #d7dce3; background: #f5f6f7; }
.knowledge-category-item.active { border-color: var(--accent-soft); background: var(--action-soft); color: var(--action-bg); }
.knowledge-category-item > span { width: 30px; height: 30px; flex: 0 0 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; background: color-mix(in srgb,var(--bg-primary) 75%,transparent); color: var(--text-muted); }
[data-theme="dark"] .knowledge-category-item.active { border-color: var(--accent-soft); background: var(--action-soft); color: var(--action-text); }
.knowledge-category-item .icon { width: 17px; height: 17px; }
.knowledge-category-item b { min-width: 0; color: inherit; font-size: 14px; font-weight: 650; white-space: nowrap; }
.knowledge-category-item small { display: block; margin-top: .2rem; color: var(--text-muted); font-size: 11px; font-weight: 500; }
[data-category="Todos"] > span { background: #eaf2ff; color: #2563eb; }
[data-category="Hardware"] > span { background: #f1eafe; color: #7c3aed; }
[data-category="Software"] > span { background: #f1eafe; color: #7c3aed; }
[data-category="Rede"] > span { background: #e7f1ff; color: #1685e5; }
[data-category="Acesso"] > span { background: #e9f8ef; color: #16a34a; }
[data-category="Sistema"] > span { background: #feecec; color: #dc2626; }
.category-all > span { background: #fff0e8; color: #f97316; }
[data-theme="dark"] [data-category="Todos"] > span { background: rgba(37,99,235,.16); color: #60a5fa; }
[data-theme="dark"] [data-category="Hardware"] > span { background: rgba(124,58,237,.16); color: #a78bfa; }
[data-theme="dark"] [data-category="Software"] > span { background: rgba(124,58,237,.16); color: #a78bfa; }
[data-theme="dark"] [data-category="Rede"] > span { background: rgba(22,133,229,.16); color: #60a5fa; }
[data-theme="dark"] [data-category="Acesso"] > span { background: rgba(22,163,74,.16); color: #4ade80; }
[data-theme="dark"] [data-category="Sistema"] > span { background: rgba(220,38,38,.16); color: #f87171; }
[data-theme="dark"] .category-all > span { background: rgba(249,115,22,.16); color: #fb923c; }
.knowledge-reference-articles > header { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .55rem .72rem; border-bottom: 1px solid var(--separator-color); }
.knowledge-reference-articles > header > div { display: flex; align-items: center; gap: .55rem; }
.knowledge-articles-search { width: 205px; height: 32px; display: flex; align-items: center; gap: .42rem; padding: 0 .62rem; border: 1px solid var(--input-border); border-radius: 6px; background: var(--input-bg); color: var(--text-muted); transition: border-color .18s, box-shadow .18s; }
.knowledge-articles-search:hover { border-color: var(--text-muted); color: var(--text-primary); }
.knowledge-articles-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); color: var(--text-primary); }
.knowledge-articles-search .icon { width: 15px; height: 15px; flex: 0 0 15px; }
.knowledge-articles-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text-primary); font-size: 12px; }
.knowledge-articles-search input::placeholder { color: var(--text-muted); }
.knowledge-reference-articles > header button { height: 32px; display: inline-flex; align-items: center; gap: .42rem; padding: 0 .68rem; border: 1px solid var(--input-border); border-radius: 6px; background: var(--input-bg); color: var(--text-primary); font-size: 12px; cursor: pointer; }
.knowledge-reference-articles > header button:hover { background: var(--action-soft); }
[data-theme="light"] .knowledge-reference-articles > header button:hover { background: #e5e8eb; }
.knowledge-reference-articles > header button .icon { width: 15px; height: 15px; }
.knowledge-reference-articles > header .knowledge-new-article { border-color: var(--action-border); background: var(--action-bg); color: var(--action-text); font-weight: 650; white-space: nowrap; }
.knowledge-reference-articles > header .knowledge-new-article:hover,
[data-theme="light"] .knowledge-reference-articles > header .knowledge-new-article:hover { background: var(--action-bg-hover); color: var(--action-text); }
.knowledge-reference-articles { overflow: visible; }
.knowledge-toolbar-control { position: relative; }
.knowledge-toolbar-control.open { z-index: 450; }
.knowledge-toolbar-control.open > button,
.knowledge-toolbar-control > button.active { border-color: var(--accent-soft); background: var(--action-soft); color: var(--action-bg); }
[data-theme="dark"] .knowledge-toolbar-control.open > button,
[data-theme="dark"] .knowledge-toolbar-control > button.active { color: var(--action-text); }
.knowledge-toolbar-chevron { transition: transform .18s; }
.knowledge-toolbar-control.open .knowledge-toolbar-chevron { transform: rotate(180deg); }
.knowledge-sort-menu { position: absolute; z-index: 460; top: calc(100% + 6px); right: 0; width: 175px; display: none; padding: .3rem; border: 1px solid var(--input-border); border-radius: 7px; background: #f8fafc; box-shadow: 0 12px 28px rgba(15,23,42,.16); }
.knowledge-toolbar-control.open .knowledge-sort-menu { display: grid; gap: .2rem; }
[data-theme="dark"] .knowledge-sort-menu { background: #1a1a1a; box-shadow: 0 14px 32px rgba(0,0,0,.42); }
.knowledge-reference-articles > header .knowledge-sort-menu button { width: 100%; min-height: 32px; height: auto; justify-content: flex-start; padding: .4rem .55rem; border: 0; border-radius: 5px; background: transparent; color: var(--text-secondary); font-size: 12px; text-align: left; }
.knowledge-reference-articles > header .knowledge-sort-menu button:hover { background: #e5e8eb; color: var(--text-primary); }
[data-theme="dark"] .knowledge-reference-articles > header .knowledge-sort-menu button:hover { background: rgba(255,255,255,.04); }
.knowledge-reference-articles > header .knowledge-sort-menu button.active { background: var(--action-soft); color: var(--action-bg); }
[data-theme="dark"] .knowledge-reference-articles > header .knowledge-sort-menu button.active { color: var(--action-text); }
.knowledge-filter-popover { right: 0; width: 365px; }
.knowledge-toolbar-control.open .knowledge-filter-popover { display: block; }
.knowledge-reference-articles > header .knowledge-filter-popover header button { width: 27px; height: 27px; padding: 0; border: 0; }
.knowledge-reference-articles > header .knowledge-filter-popover .tickets-filter-group button { width: auto; min-height: 29px; height: auto; padding: .3rem .55rem; }
.knowledge-reference-articles > header .knowledge-filter-popover footer button { height: 33px; }
.knowledge-article-list { width: 100%; overflow-x: auto; }
.knowledge-article-row { min-width: 820px; min-height: 52.2px; display: grid; grid-template-columns: 38px minmax(260px,1fr) 72px 58px 58px 92px 28px; align-items: center; gap: .65rem; padding: calc(.43rem - 1.75px) .72rem; border-bottom: 1px solid var(--separator-color); transition: background-color .18s; }
.knowledge-article-row:last-child { border-bottom: 0; }
.knowledge-article-row[hidden] { display: none; }
.knowledge-article-row:hover { background: rgba(255,255,255,.04); }
[data-theme="light"] .knowledge-article-row:hover { background: #e5e8eb; }
.knowledge-article-icon { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; background: #eaf2ff; color: #2563eb; }
.knowledge-article-icon.hardware { background: #e9f8ef; color: #16a34a; }
.knowledge-article-icon.software { background: #fff4e5; color: #f59e0b; }
.knowledge-article-icon.network { background: #f1eafe; color: #7c3aed; }
.knowledge-article-icon .icon { width: 18px; height: 18px; }
[data-theme="dark"] .knowledge-article-icon { background: rgba(37,99,235,.16); }
[data-theme="dark"] .knowledge-article-icon.hardware { background: rgba(22,163,74,.16); color: #4ade80; }
[data-theme="dark"] .knowledge-article-icon.software { background: rgba(245,158,11,.16); color: #fbbf24; }
[data-theme="dark"] .knowledge-article-icon.network { background: rgba(124,58,237,.16); color: #a78bfa; }
.knowledge-article-copy { min-width: 0; }
.knowledge-article-copy h3 { margin: 0 0 .22rem; overflow: hidden; color: var(--text-primary); font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-article-copy p { margin: 0; overflow: hidden; color: var(--text-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-article-category { justify-self: start; padding: .25rem .45rem; border-radius: 4px; background: #f1eafe; color: #7c3aed; font-size: 11px; font-weight: 650; }
.knowledge-article-category.hardware { background: #eaf2ff; color: #2563eb; }
.knowledge-article-category.software { background: #dcfce7; color: #15803d; }
.knowledge-article-category.network { background: #fff4e5; color: #d97706; }
[data-theme="dark"] .knowledge-article-category { background: rgba(124,58,237,.16); color: #c4b5fd; }
[data-theme="dark"] .knowledge-article-category.hardware { background: rgba(37,99,235,.16); color: #60a5fa; }
[data-theme="dark"] .knowledge-article-category.software { background: rgba(22,163,74,.16); color: #4ade80; }
[data-theme="dark"] .knowledge-article-category.network { background: rgba(245,158,11,.16); color: #fbbf24; }
.knowledge-article-meta { display: inline-flex; align-items: center; gap: .3rem; color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.knowledge-article-meta .icon { width: 14px; height: 14px; }
.knowledge-article-more { width: 27px; height: 27px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 5px; background: transparent; color: var(--text-muted); cursor: pointer; }
.knowledge-article-more:hover { background: var(--action-soft); color: var(--text-primary); }
.knowledge-article-more .icon { width: 17px; height: 17px; }
.knowledge-articles-footer { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .55rem .72rem; border-top: 1px solid var(--separator-color); color: var(--text-muted); font-size: 12px; }
.knowledge-articles-pagination { display: flex; align-items: center; gap: .4rem; }
.knowledge-articles-pagination button { width: 29px; height: 29px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--input-border); border-radius: 5px; background: var(--input-bg); color: var(--text-muted); font-size: 12px; cursor: pointer; }
.knowledge-articles-pagination button .icon { width: 15px; height: 15px; }
.knowledge-articles-pagination button:hover:not(:disabled) { border-color: transparent; background: var(--action-soft); color: var(--text-primary); }
[data-theme="light"] .knowledge-articles-pagination button:hover:not(:disabled) { background: #e5e8eb; color: #0f172a; }
.knowledge-articles-pagination button.active,
.knowledge-articles-pagination button.active:hover { border-color: var(--action-bg); background: var(--action-bg); color: var(--action-text); }
.knowledge-articles-pagination button:disabled { opacity: .45; cursor: default; }
.knowledge-reference-banner { grid-column: 1 / -1; min-height: 58px; display: grid; grid-template-columns: 25px minmax(0,1fr) auto; align-items: center; gap: .65rem; padding: .62rem .8rem; background: color-mix(in srgb,var(--accent-soft) 45%,var(--bg-card-right)); }
.knowledge-reference-banner > .icon { width: 23px; height: 23px; color: var(--accent); }
.knowledge-reference-banner div { display: flex; flex-direction: column; gap: .18rem; color: var(--text-primary); font-size: 12px; }
.knowledge-reference-banner div span { color: var(--text-muted); font-size: 11px; }
.knowledge-reference-banner > a, .knowledge-help a, .knowledge-help button, .knowledge-contribute button { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: 0 .75rem; border: 1px solid rgba(37,99,235,.3); border-radius: 5px; background: transparent; color: var(--accent); font-size: 12px; font-weight: 650; cursor: pointer; }
.knowledge-reference-banner > a:hover, .knowledge-help a:hover, .knowledge-contribute button:hover { background: var(--accent-soft); }
.knowledge-reference-banner > a .icon, .knowledge-help a .icon, .knowledge-help button .icon, .knowledge-contribute button .icon { width: 14px; height: 14px; }
.knowledge-side-card > header { padding: calc(.72rem - 1px) .8rem calc(.35rem - 1px); }
.knowledge-ranking ol { display: grid; gap: 11.80px; margin: 0; padding: calc(.55rem - 1px) .8rem calc(.65rem - 1px); list-style: none; }
.knowledge-ranking li { position: relative; display: grid; grid-template-columns: 24px minmax(0,1fr); align-items: start; gap: .55rem; cursor: pointer; }
.knowledge-ranking li::before { content: ""; position: absolute; z-index: 0; inset: -.28rem -.4rem; border-radius: 6px; background: transparent; transition: background-color .18s; }
.knowledge-ranking li:hover::before { background: #e5e8eb; }
[data-theme="dark"] .knowledge-ranking li:hover::before { background: rgba(255,255,255,.04); }
.knowledge-ranking li > * { position: relative; z-index: 1; }
.knowledge-ranking li > span { width: 23px; height: 23px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: #eaf2ff; color: #2563eb; font-size: 11px; font-weight: 700; }
[data-theme="dark"] .knowledge-ranking li > span { background: rgba(37,99,235,.16); color: #60a5fa; }
.knowledge-ranking li strong { display: block; color: var(--text-primary); font-size: 11px; line-height: 1.35; }
.knowledge-ranking li small { display: block; margin-top: .17rem; color: #16a34a; font-size: 10px; }
.knowledge-ranking > a { min-height: 36px; display: flex; align-items: center; padding: 0 .8rem; border-top: 1px solid var(--separator-color); color: var(--action-bg); font-size: 11px; font-weight: 650; }
.knowledge-ranking > a:hover { background: #e5e8eb; color: var(--action-bg); }
[data-theme="dark"] .knowledge-ranking > a:hover { background: rgba(255,255,255,.04); }
.knowledge-help, .knowledge-contribute { padding-bottom: calc(.72rem - 1px); }
.knowledge-contribute { padding-bottom: calc(.72rem + 1px); }
.knowledge-help p, .knowledge-contribute p { margin: calc(.15rem - 1px) .8rem calc(.65rem - 1px); color: var(--text-muted); font-size: 11px; line-height: 1.45; }
.knowledge-help a, .knowledge-help button, .knowledge-contribute button { width: calc(100% - 1.6rem); margin: 0 .8rem; }
.knowledge-help button { margin-top: .45rem; border-color: var(--input-border); color: #16a34a; background: transparent; }
.knowledge-help button:hover { background: rgba(22,163,74,.1); }
@media (max-width: 1180px) {
    .knowledge-reference-layout { grid-template-columns: 1fr; }
    .knowledge-reference-side { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 900px) {
    .knowledge-reference-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .knowledge-category-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (max-width: 680px) {
    .app-content.knowledge-reference { padding: .85rem; }
    .knowledge-reference-stats, .knowledge-reference-side { grid-template-columns: 1fr; }
    .knowledge-category-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .knowledge-reference-articles > header { align-items: stretch; flex-direction: column; }
    .knowledge-reference-articles > header > div { flex-wrap: wrap; }
    .knowledge-articles-search { width: 100%; }
    .knowledge-reference-banner { grid-template-columns: 25px minmax(0,1fr); }
    .knowledge-reference-banner > a { grid-column: 1 / -1; }
    .knowledge-articles-footer { align-items: flex-start; flex-direction: column; }
}

/* Departments overview */
.app-content.departments-reference { padding: .75rem; }
.departments-overview {
    display: grid;
    grid-template-columns: minmax(0, 3.15fr) minmax(245px, .95fr);
    gap: 1rem;
    align-items: stretch;
}
.departments-overview-main,
.departments-overview-side-card {
    border: 1px solid var(--separator-color);
    border-radius: 11px;
    background: var(--bg-card-right);
    box-shadow: 0 3px 10px rgba(15, 23, 42, .04);
}
.departments-overview-main { padding: 1rem .7rem; }
.departments-overview-header { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.departments-overview-header h2 { margin: 0; color: var(--text-primary); font-size: 14px; font-weight: 700; white-space: nowrap; }
.departments-overview-actions { display: flex; align-items: center; justify-content: flex-end; gap: .55rem; min-width: 0; }
.departments-overview-search { width: 230px; height: 36px; display: flex; align-items: center; gap: .5rem; padding: 0 .7rem; border: 1px solid var(--input-border); border-radius: 6px; background: var(--input-bg); color: var(--text-muted); transition: border-color .2s, box-shadow .2s; }
.departments-overview-search:hover { border-color: var(--text-muted); color: var(--text-primary); }
.departments-overview-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); color: var(--text-primary); }
.departments-overview-search .icon,
.departments-overview-filter .icon,
.departments-overview-new .icon { width: 16px; height: 16px; flex: 0 0 16px; }
.departments-overview-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text-primary); font-size: 12px; }
.departments-overview-search input::placeholder { color: var(--text-muted); }
.departments-overview-filter { height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: 0 .8rem; border: 1px solid var(--input-border); border-radius: 6px; background: var(--input-bg); color: var(--text-primary); font-size: 12px; font-weight: 650; cursor: pointer; }
.departments-overview-new { height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: 0 .8rem; border: 1px solid var(--action-border); border-radius: 6px; background: var(--action-bg); color: var(--action-text); font-size: 12px; font-weight: 650; white-space: nowrap; cursor: pointer; }
.departments-overview-new:hover { background: var(--action-bg-hover); color: var(--action-text); }
.departments-overview-filter:hover,
.departments-overview-filter.active { border-color: transparent; background: var(--action-soft); }
[data-theme="light"] .departments-overview-filter:hover,
[data-theme="light"] .departments-overview-filter.active { background: #e5e8eb; }
[data-theme="dark"] .departments-overview-filter:hover,
[data-theme="dark"] .departments-overview-filter.active { background: #2a2a2a; }

.departments-overview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.department-overview-card { min-width: 0; padding: 31.2px 10px; overflow: hidden; border: 1px solid var(--separator-color); border-radius: 9px; background: var(--bg-card-right); transition: border-color .18s ease, background-color .18s ease, transform .18s ease; }
.department-overview-card:hover { border-color: var(--input-border); background: rgba(255, 255, 255, .035); transform: translateY(-1px); }
[data-theme="light"] .department-overview-card:hover { border-color: #d7dce3; background: #f5f6f7; }
.department-overview-card[hidden] { display: none; }
.department-overview-top { min-height: 72px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: start; gap: .55rem; padding: .55rem .55rem .4rem; }
.department-overview-icon { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: #eaf2ff; color: #2563eb; }
.department-overview-icon .icon { width: 23px; height: 23px; }
.department-overview-icon.icon-finance { background: #eef3ff; color: #2563eb; }
.department-overview-icon.icon-users { background: #eaf2ff; color: #2563eb; }
[data-theme="dark"] .department-overview-icon { background: rgba(37, 99, 235, .16); }
.department-overview-identity { min-width: 0; }
.department-overview-identity h3 { margin: .1rem 0 .38rem; overflow: hidden; color: var(--text-primary); font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.department-overview-identity > span { display: flex; align-items: center; gap: .42rem; min-width: 0; }
.department-overview-identity i { width: 21px; height: 21px; flex: 0 0 21px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: #44566c; color: #fff; font-size: .47rem; font-style: normal; font-weight: 700; }
.department-overview-identity b { min-width: 0; overflow: hidden; color: var(--text-secondary); font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.department-overview-identity small { display: block; margin-top: .15rem; color: var(--text-muted); font-size: 11px; font-weight: 500; }
.department-overview-status { padding: .24rem .45rem; border-radius: 4px; background: #dcfce7; color: #15803d; font-size: 11px; font-weight: 700; }
[data-theme="dark"] .department-overview-status { background: rgba(21, 128, 61, .2); color: #4ade80; }
.department-overview-status.inactive { background: #fee2e2; color: #dc2626; }
[data-theme="dark"] .department-overview-status.inactive { background: rgba(220, 38, 38, .16); color: #f87171; }
.department-overview-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--separator-color); border-bottom: 1px solid var(--separator-color); }
.department-overview-metrics > div { min-width: 0; padding: .38rem .6rem; }
.department-overview-metrics > div:nth-child(odd) { border-right: 1px solid var(--separator-color); }
.department-overview-metrics > div:nth-child(n+3) { border-top: 1px solid var(--separator-color); }
.department-overview-metrics dt { display: grid; grid-template-columns: 15px minmax(0, 1fr); align-items: center; gap: .35rem; color: var(--text-muted); font-size: 11px; line-height: 1.2; }
.department-overview-metrics dt .icon { width: 14px; height: 14px; color: #6680a4; }
.department-overview-metrics dt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.department-overview-metrics dd { margin: .2rem 0 0 1.2rem; color: var(--text-primary); font-size: 13px; font-weight: 700; white-space: nowrap; }
.department-overview-card > a { position: relative; top: 5px; height: 34px; display: flex; align-items: center; justify-content: center; gap: .42rem; color: var(--action-bg); font-size: 12px; font-weight: 650; line-height: 1; text-decoration: none; }
.department-overview-card > a:hover { color: var(--action-bg-hover); background: transparent; }
[data-theme="dark"] .department-overview-card > a { color: var(--action-text); }
[data-theme="dark"] .department-overview-card > a:hover { color: var(--action-text-soft); }
.department-overview-card > a .icon { width: 14px; height: 14px; }
.department-modal-card .custom-select-menu { min-width: 100%; background: #f8fafc; backdrop-filter: none; -webkit-backdrop-filter: none; }
[data-theme="dark"] .department-modal-card .custom-select-menu { background: var(--bg-modal); }
.department-modal-card .custom-select-option { padding: .58rem .7rem; }
.department-modal-card .custom-select-option .icon { width: 16px; height: 16px; flex: 0 0 16px; margin-right: .45rem; color: var(--text-muted); }
.department-modal-card .department-selected-icon { width: 17px; height: 17px; flex: 0 0 17px; color: var(--text-muted); }
.department-modal-info { display: flex; align-items: flex-start; gap: .5rem; padding: .65rem .7rem; border: 1px solid var(--accent-soft); border-radius: 6px; background: var(--action-soft); color: var(--text-muted); font-size: 11px; line-height: 1.4; }
.department-modal-info .icon { width: 16px; height: 16px; flex: 0 0 16px; color: var(--action-bg); }
[data-theme="dark"] .department-modal-info { border-color: rgba(255, 255, 255, .12); }
[data-theme="dark"] .department-modal-info .icon { color: var(--action-text); }
.departments-overview-empty { margin: .8rem 0 0; padding: 1.5rem; text-align: center; color: var(--text-muted); font-size: .72rem; }
.departments-overview-footer { min-height: 45px; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-top: .85rem; padding-top: .75rem; border-top: 1px solid var(--separator-color); color: var(--text-muted); font-size: 12px; }
.departments-overview-pagination { display: flex; align-items: center; gap: .4rem; }
.departments-overview-pagination button { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--input-border); border-radius: 5px; background: var(--input-bg); color: var(--text-muted); font-size: 12px; cursor: pointer; transition: border-color .18s ease, background-color .18s ease, color .18s ease; }
.departments-overview-pagination button .icon { width: 15px; height: 15px; }
.departments-overview-pagination button:hover:not(:disabled) { border-color: transparent; background: var(--action-soft); color: var(--text-primary); }
[data-theme="light"] .departments-overview-pagination button:hover:not(:disabled) { background: #e5e8eb; color: #0f172a; }
.departments-overview-pagination button.active,
.departments-overview-pagination button.active:hover { border-color: var(--action-bg); background: var(--action-bg); color: var(--action-text); }
.departments-overview-pagination button:disabled { opacity: .45; cursor: default; }

.departments-overview-side { height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, .85fr); gap: 1rem; }
.departments-overview-side-card { overflow: hidden; display: flex; flex-direction: column; }
.departments-overview-side-card > header { min-height: 49px; display: flex; align-items: center; gap: .6rem; padding: 0 .85rem; border-bottom: 1px solid var(--separator-color); }
.departments-overview-side-card > header .icon { width: 18px; height: 18px; color: #2563eb; }
.departments-overview-side-card > header h2 { margin: 0; color: var(--text-primary); font-size: 13px; font-weight: 700; }
.departments-distribution ul { flex: 1; display: grid; align-content: space-evenly; gap: .48rem; margin: 0; padding: .68rem .85rem .55rem; list-style: none; }
.departments-distribution li > div { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .24rem; color: var(--text-primary); font-size: 12px; }
.departments-distribution li strong { font-weight: 650; }
.departments-distribution li span { color: var(--text-muted); font-weight: 650; }
.departments-distribution li > i { height: 5px; display: block; overflow: hidden; border-radius: 999px; background: var(--separator-color); }
.departments-distribution li > i b { height: 100%; display: block; border-radius: inherit; background: #1769ff; }
.departments-distribution footer { min-height: 36px; display: flex; align-items: center; justify-content: space-between; padding: 0 .85rem; border-top: 1px solid var(--separator-color); color: var(--text-primary); font-size: 12px; }
.departments-practices ul { flex: 1; display: grid; align-content: space-evenly; gap: .62rem; margin: 0; padding: .8rem .85rem; list-style: none; }
.departments-practices li { display: flex; align-items: flex-start; gap: .55rem; color: var(--text-muted); font-size: 12px; line-height: 1.45; }
.departments-practices li .icon { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 1px; color: #1769ff; }

@media (max-width: 1150px) {
    .departments-overview { grid-template-columns: 1fr; }
    .departments-overview-side { height: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; }
}
@media (max-width: 760px) {
    .app-content.departments-reference { padding: .85rem; }
    .departments-overview-main { padding: .75rem; }
    .departments-overview-header { align-items: stretch; flex-direction: column; }
    .departments-overview-actions { flex-wrap: wrap; justify-content: flex-start; }
    .departments-overview-search { width: 100%; }
    .departments-overview-grid,
    .departments-overview-side { grid-template-columns: 1fr; grid-template-rows: none; }
    .departments-overview-footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 1150px) {
    .categories-reference-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .categories-reference-workspace { grid-template-columns: 1fr; }
    .categories-reference-side { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .categories-overview { grid-template-columns: 1fr; }
    .categories-overview-side { height: auto; grid-template-columns: repeat(2, minmax(0,1fr)); grid-template-rows: none; }
}

@media (max-width: 700px) {
    .app-content.categories-reference { padding: .85rem; }
    .categories-reference-stats,
    .categories-reference-side { grid-template-columns: 1fr; }
    .categories-reference-toolbar { align-items: stretch; flex-wrap: wrap; }
    .categories-reference-search { width: 100%; }
    .categories-reference-filter,
    .categories-reference-new { flex: 1 1 auto; }
    .categories-overview-main { padding: .75rem; }
    .categories-overview-header { align-items: stretch; flex-direction: column; }
    .categories-overview-actions { flex-wrap: wrap; justify-content: flex-start; }
    .categories-overview-actions .categories-reference-search { width: 100%; }
    .categories-overview-grid,
    .categories-overview-side { grid-template-columns: 1fr; grid-template-rows: none; }
    .categories-overview-footer { align-items: flex-start; flex-direction: column; }
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, sans-serif;
    font-weight: 400;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    transition:
        background 0.4s ease,
        color 0.4s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button,
input,
select,
textarea {
    font-family: system-ui, sans-serif;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-primary);
    box-shadow: 0 0 0 1000px var(--bg-card-right) inset;
    caret-color: var(--text-primary);
    transition:
        background-color 9999s ease-out,
        color 9999s ease-out;
}

[data-theme="dark"] input:-webkit-autofill,
[data-theme="dark"] input:-webkit-autofill:hover,
[data-theme="dark"] input:-webkit-autofill:focus,
[data-theme="dark"] textarea:-webkit-autofill,
[data-theme="dark"] textarea:-webkit-autofill:hover,
[data-theme="dark"] textarea:-webkit-autofill:focus,
[data-theme="dark"] select:-webkit-autofill,
[data-theme="dark"] select:-webkit-autofill:hover,
[data-theme="dark"] select:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-primary);
    box-shadow: 0 0 0 1000px #1a1a1a inset;
    caret-color: var(--text-primary);
}

/* Mantém os campos salvos pelo navegador coerentes com o tema da tela de acesso. */
[data-theme="light"] .page-login input.input-field:-webkit-autofill,
[data-theme="light"] .page-login input.input-field:-webkit-autofill:hover,
[data-theme="light"] .page-login input.input-field:-webkit-autofill:focus,
[data-theme="light"] .page-login input.input-field:-webkit-autofill:active,
[data-theme="light"] .page-login input.input-field:autofill {
    -webkit-text-fill-color: #0f172a !important;
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    box-shadow: 0 0 0 1000px #ffffff inset !important;
    background-color: #ffffff !important;
    caret-color: #0f172a !important;
    color-scheme: light;
}

[data-theme="dark"] .page-login input.input-field:-webkit-autofill,
[data-theme="dark"] .page-login input.input-field:-webkit-autofill:hover,
[data-theme="dark"] .page-login input.input-field:-webkit-autofill:focus,
[data-theme="dark"] .page-login input.input-field:-webkit-autofill:active,
[data-theme="dark"] .page-login input.input-field:autofill {
    -webkit-text-fill-color: #f4f4f5 !important;
    -webkit-box-shadow: 0 0 0 1000px #111318 inset !important;
    box-shadow: 0 0 0 1000px #111318 inset !important;
    background-color: #111318 !important;
    caret-color: #f4f4f5 !important;
    color-scheme: dark;
}

[data-theme="dark"] .page-login input.input-field::selection {
    background: #4a4f59;
    color: #ffffff;
}

a {
    text-decoration: none;
    color: var(--text-muted);
    transition: color 0.2s;
}

a:hover {
    color: var(--text-secondary);
}

/* --- TEMA CLARO (padrão) --- */
:root,
[data-theme="light"] {
    --bg-primary: #eef2f7;
    --bg-card-left: #f8fafc;
    --bg-card-right: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #171717;
    --text-muted: #64748b;
    --accent: #171717;
    --accent-hover: #000000;
    --accent-soft: rgba(23, 23, 23, 0.08);
    --accent-glow: rgba(23, 23, 23, 0.15);
    --action-bg: #64748b;
    --action-bg-hover: #526174;
    --action-soft: rgba(15, 23, 42, 0.08);
    --action-border: #59677a;
    --action-text: #ffffff;
    --action-text-soft: #0f172a;
    --border-color: rgba(15, 23, 42, 0.1);
    --input-bg: #f8fafc;
    --input-bg-focus: #ffffff;
    --input-border: rgba(15, 23, 42, 0.14);
    --input-border-focus: var(--accent);
    --shadow-card:
        0 25px 70px rgba(0, 0, 0, 0.1), 0 10px 30px rgba(0, 0, 0, 0.06);
    --shadow-elevated: 0 8px 32px rgba(0, 0, 0, 0.06);
    --toast-bg: rgba(255, 255, 255, 0.9);
    --toast-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --badge-bg: rgba(37, 99, 235, 0.08);
    --badge-text: #1e40af;
    --badge-border: rgba(37, 99, 235, 0.15);
    --separator-color: rgba(15, 23, 42, 0.1);
    --bg-modal: #ffffff;
    --social-bg: #f8fafc;
    --social-border: rgba(15, 23, 42, 0.12);
    --social-hover: #eef2f7;
    --danger: #dc2626;
    --success: #16a34a;
    --checkbox-border: rgba(0, 0, 0, 0.2);
    --scrollbar-track: transparent;
    --scrollbar-thumb: rgba(0, 0, 0, 0.12);
    --sidebar-bg: #f8fafc;
}

/* --- TEMA ESCURO - paleta grafite AlgeDesk --- */
[data-theme="dark"] {
    --bg-primary: #090a0c;
    --bg-card-left: #111318;
    --bg-card-right: #1a1c21;
    --bg-secondary: #14161b;
    --bg-subtle: #22252b;
    --text-primary: #f4f4f5;
    --text-secondary: #a9adb5;
    --text-muted: #70757f;
    --accent: #c7c9ce;
    --accent-hover: #ffffff;
    --accent-soft: rgba(199, 201, 206, 0.11);
    --accent-glow: rgba(199, 201, 206, 0.18);
    --action-bg: #3f4856;
    --action-bg-hover: #4c5868;
    --action-soft: #292c32;
    --action-border: #596779;
    --action-text: #ffffff;
    --action-text-soft: #e2e3e6;
    --border-color: #30333a;
    --input-bg: #111318;
    --input-bg-focus: #0e1014;
    --input-border: #343840;
    --input-border-focus: var(--accent);
    --shadow-card:
        0 1px 0 rgba(255, 255, 255, 0.035), 0 8px 28px rgba(0, 0, 0, 0.34);
    --shadow-elevated:
        0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 42px rgba(0, 0, 0, 0.48);
    --toast-bg: #22252b;
    --toast-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    --badge-bg: #292c32;
    --badge-text: #d4d6da;
    --badge-border: #3a3e46;
    --separator-color: #2b2e34;
    --bg-modal: #1a1c21;
    --social-bg: #1b1e24;
    --social-border: #2d3138;
    --social-hover: #292c32;
    --danger: #ef4444;
    --success: #22c55e;
    --checkbox-border: #50555f;
    --scrollbar-track: transparent;
    --scrollbar-thumb: rgba(255, 255, 255, 0.1);
    --sidebar-bg: #111318;
}

[data-theme="dark"] .sidebar-link {
    color: #fff;
}

[data-theme="dark"] .sidebar-link:hover,
[data-theme="dark"] .sidebar-link.active {
    color: #e0e0e0;
}

[data-theme="dark"] .sidebar-link:hover {
    background: #1b1e24;
    color: #f4f4f5;
}

[data-theme="dark"] .sidebar-link.active {
    background: #292c32;
    color: #ffffff;
}

[data-theme="dark"] .sidebar-link:hover .icon,
[data-theme="dark"] .sidebar-link.active .icon {
    color: #fff;
}

[data-theme="dark"] .sidebar-toggle-btn .icon {
    color: #fff;
}

[data-theme="dark"] .sidebar-link.active::before {
    background: #fff;
}

[data-theme="dark"] .sidebar-section-title {
    color: #999;
}

[data-theme="dark"] .sidebar-subtitle {
    color: #999;
}

[data-theme="dark"] .topbar-date {
    color: #afafaf;
}

[data-theme="dark"] .page-header-breadcrumb a:hover {
    color: #fff;
}

[data-theme="dark"] .sidebar-toggle-btn:hover {
    background: #1b1e24;
    color: #fff;
}

[data-theme="dark"] .sidebar-toggle-btn::after {
    background: #2a2a2a;
    color: #f9fafb;
}

[data-theme="dark"] .sidebar-toggle-btn::before {
    background: #2a2a2a;
}

[data-theme="dark"] .app-sidebar.collapsed .sidebar-user-trigger::after {
    background: #2a2a2a;
    color: #f9fafb;
}

[data-theme="dark"] .app-sidebar.collapsed .sidebar-user-trigger::before {
    background: #2a2a2a;
}

[data-theme="dark"] .topbar-btn {
    color: #fff;
}

[data-theme="dark"] .theme-toggle {
    color: #fff;
}

[data-theme="dark"] .topbar-btn:hover,
[data-theme="dark"] .theme-toggle:hover {
    background: #2a2a2a;
    color: #fff;
}

[data-theme="dark"] .sidebar-link .badge-count {
    background: #1a1a1a;
    color: #fff;
}

/* --- SCROLLBAR --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* --- TOGGLE TEMA --- */
.theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition:
        background 0.2s,
        color 0.2s;
    color: var(--text-secondary);
}

.theme-toggle .icon {
    width: 20px;
    height: 20px;
}

.theme-toggle:hover {
    color: var(--action-text-soft);
    background: var(--action-soft);
}

[data-theme="light"] .theme-toggle:hover {
    color: #0f172a;
    background: #E5E8EB;
}

[data-theme="light"] .sidebar-link:hover,
[data-theme="light"] .sidebar-link.active {
    background: #E5E8EB;
}

[data-theme="light"] .sidebar-user-link:hover {
    background: #E5E8EB;
}

[data-theme="light"] .sidebar-user-trigger:hover,
[data-theme="light"] .sidebar-user-menu.open .sidebar-user-trigger,
[data-theme="light"] .sidebar-user-action:hover,
[data-theme="light"] .topbar-user-trigger:hover,
[data-theme="light"] .topbar-user-menu.open .topbar-user-trigger {
    background: #E5E8EB;
}

[data-theme="light"] .topbar-user-action:hover {
    background: #E5E8EB;
    color: var(--text-primary);
}

.theme-toggle:active {
    transform: none;
}

/* --- CONTAINER --- */
/* --- CONTAINER --- */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

/* --- CARD PRINCIPAL --- */
.main-card {
    display: flex;
    background: var(--bg-card-right);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    min-height: 580px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    transition: all 0.4s ease;
    position: relative;
}

/* --- PAINEL DA MARCA (ESQUERDA) --- */
.brand-panel {
    flex: 0 0 38%;
    background: var(--sidebar-bg);
    border-radius: 24px 0 0 24px;
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    border-right: 1px solid var(--border-color);
    transition: background 0.4s ease;
}

/* Círculos decorativos com blur */
.brand-panel::before {
    display: none;
}

.brand-panel::after {
    display: none;
}

.brand-content {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* --- LOGO --- */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    text-decoration: none;
}

.brand-logo:hover,
.brand-logo:focus,
.brand-logo:hover .logo-text,
.brand-logo:focus .logo-text,
.brand-logo:hover .logo-highlight,
.brand-logo:focus .logo-highlight {
    text-decoration: none;
}

.logo-icon {
    position: relative;
    width: 66px;
    height: 66px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-icon svg,
.logo-icon img {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
    object-fit: contain;
}

.logo-text {
    display: inline-flex;
    align-items: center;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1;
}

.logo-highlight {
    color: var(--accent);
    font-size: 1em;
    margin-left: 0;
    line-height: 1;
}

.logo-pro {
    color: #afafaf;
    font-size: 1em;
    margin-left: 0.18em;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    text-underline-offset: 0.06em;
}

.brand-logo .logo-text:hover .logo-pro {
    text-decoration: underline;
}

[data-theme="light"] .logo-highlight {
    color: var(--accent);
}

[data-theme="light"] .logo-text {
    color: #0f172a;
}

[data-theme="dark"] .logo-text {
    color: #ffffff;
}

[data-theme="light"] .logo-pro {
    color: #64748b;
}

/* --- TÍTULO --- */
.brand-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

/* --- DESCRIÇÃO --- */
.brand-description {
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* --- TECH STACK --- */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
}

.tech-badge {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid transparent;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: all 0.2s;
}

.tech-badge:hover {
    background: var(--accent-soft);
    color: var(--accent);
    transform: translateY(-1px);
}

[data-theme="dark"] .tech-badge,
[data-theme="dark"] .tech-badge:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e0e0e0;
}

[data-theme="dark"] .tech-badge:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* --- CONTATO --- */
.brand-contact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.contact-item i {
    width: 16px;
    font-size: 0.85rem;
    color: var(--accent);
    text-align: center;
}

.contact-item:hover {
    color: var(--text-primary);
}

/* --- SOCIAL --- */
.brand-social {
    display: flex;
    gap: 0.6rem;
}

.social-link {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--social-bg);
    border: 1px solid var(--social-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1rem;
    transition: all 0.25s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: none;
}

[data-theme="light"] .social-link:hover {
    background: #e2e8f0;
    border-color: transparent;
    color: #0f172a;
}

[data-theme="dark"] .social-link {
    background: rgba(255, 255, 255, 0.06);
    border-color: transparent;
}

[data-theme="dark"] .social-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: transparent;
}

/* --- FOOTER DA MARCA --- */
.brand-footer {
    position: relative;
    z-index: 1;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--separator-color);
}

.page-login {
    flex-direction: column;
    gap: 1rem;
}

.system-footer {
    width: 100%;
    margin-top: auto;
    padding: 0.9rem 1.5rem 1rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: var(--text-muted);
    border-top: 1px solid var(--separator-color);
    font-size: 0.75rem;
    line-height: 1.35;
    text-align: left;
    position: relative;
}

.system-footer::before {
    content: none;
}
.legal-footer-bar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 2rem;
    right: 2rem;
    border-top: 1px solid var(--separator-color);
}

.page-login > .system-footer {
    max-width: 1100px;
    margin-top: 0;
    padding-bottom: 0;
    border-top: 0;
}

.page-login .system-footer::before {
    content: none;
}

.page-legal .legal-footer-bar::before {
    content: none;
}

.legal-footer-bar {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    line-height: 1.35;
    position: relative;
}

.footer-system-link {
    color: var(--text-muted);
    font-weight: 650;
    text-decoration: none;
}

.footer-system-link:hover,
.footer-system-link:focus {
    color: var(--text-secondary);
    text-decoration: underline;
}

.footer-company-link {
    color: var(--text-muted);
    font-weight: 650;
    text-decoration: none;
}

.footer-company-link:hover,
.footer-company-link:focus {
    color: var(--text-secondary);
    text-decoration: underline;
}

.footer-version {
    margin-left: 0.35rem;
    color: var(--text-muted);
    font-size: 0.9em;
    opacity: 0.78;
}

/* --- PAINEL DO FORMULÁRIO (DIREITA) --- */
.form-panel {
    flex: 1;
    background: var(--bg-card-right);
    border-radius: 0 24px 24px 0;
    padding: 2.5rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: background 0.4s ease;
}

[data-theme="dark"] .main-card,
[data-theme="dark"] .form-panel {
    background: #040404;
}

.form-container {
    width: 100%;
    max-width: 415px;
    min-height: 490px;
}

/* --- TABS --- */
.form-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: var(--input-bg);
    padding: 0.35rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 0.7rem 1rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tab-btn i {
    font-size: 0.9rem;
}

.tab-btn .icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: block;
    transform: translateY(1px);
}

.tab-btn.active {
    background: #000000;
    color: #fff;
    box-shadow: none;
}

[data-theme="dark"] .tab-btn {
    color: #ffffff;
}

.tab-btn:not(.active):hover {
    color: var(--text-primary);
    background: var(--social-hover);
    border-color: transparent;
}

[data-theme="dark"] .tab-btn:not(.active):hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border-color: transparent;
}

[data-theme="light"] .main-card,
[data-theme="light"] .form-panel,
[data-theme="light"] .modal-card {
    background: #ffffff;
}

[data-theme="light"] .brand-panel {
    background: #f8fafc;
}

[data-theme="light"] .brand-title,
[data-theme="light"] .logo-text,
[data-theme="light"] .modal-header h2 {
    color: #0f172a;
}

[data-theme="light"] .brand-description,
[data-theme="light"] .contact-item,
[data-theme="light"] .input-group label,
[data-theme="light"] .checkbox-label,
[data-theme="light"] .checkbox-text,
[data-theme="light"] .form-switch,
[data-theme="light"] .modal-header p,
[data-theme="light"] .brand-footer {
    color: #171717;
}

[data-theme="light"] .logo-highlight {
    color: var(--accent);
}

[data-theme="light"] .logo-pro {
    color: #64748b;
}

[data-theme="light"] .form-tabs,
[data-theme="light"] .input-field,
[data-theme="light"] .modal-close,
[data-theme="light"] .legal-panel-back {
    background: #f8fafc;
}

[data-theme="light"] .form-tabs {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .tab-btn {
    color: #171717;
}

[data-theme="light"] .tab-btn.active {
    border-color: #59677a;
    background: #64748b;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.24);
}

[data-theme="light"] .tab-btn:not(.active):hover {
    background: #e2e8f0;
    color: #0f172a;
}

[data-theme="light"] .input-field {
    border-color: rgba(15, 23, 42, 0.14);
    color: #0f172a;
}

[data-theme="light"] .input-field:focus {
    border-color: rgba(15, 23, 42, 0.42);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .input-field::placeholder {
    color: #64748b;
}

[data-theme="light"] .input-icon-wrap .input-icon,
[data-theme="light"] .password-toggle {
    color: #64748b;
}

[data-theme="light"] .input-icon-wrap:hover .input-icon,
[data-theme="light"] .password-toggle:hover,
[data-theme="light"] .input-icon-wrap:focus-within .input-icon {
    color: #171717;
}

[data-theme="light"] .btn-submit,
[data-theme="light"] .modal-icon {
    background: var(--action-bg);
    border-color: var(--action-border);
    color: var(--action-text);
}

[data-theme="light"] .btn-submit:hover {
    background: var(--action-bg-hover);
    border-color: var(--action-border);
}

[data-theme="light"] .forgot-link,
[data-theme="light"] .form-switch a,
[data-theme="light"] .checkbox-text .terms-link,
[data-theme="light"] .modal-footer a {
    color: #0f172a;
}

[data-theme="light"] .forgot-link:hover,
[data-theme="light"] .form-switch a:hover,
[data-theme="light"] .checkbox-text .terms-link:hover,
[data-theme="light"] .modal-footer a:hover {
    color: #0f172a;
}

[data-theme="light"] .social-link,
[data-theme="light"] .btn-social,
[data-theme="light"] .btn-google,
[data-theme="light"] .btn-github {
    background: #eef2f7;
    border-color: transparent;
    color: #171717;
}

[data-theme="light"] .social-link:hover,
[data-theme="light"] .btn-social:hover,
[data-theme="light"] .btn-google:hover,
[data-theme="light"] .btn-github:hover {
    background: #e2e8f0;
    border-color: transparent;
    color: #0f172a;
}

[data-theme="light"] .tech-badge {
    background: #eef2f7;
    color: #334155;
    border-color: transparent;
}

[data-theme="light"] .tech-badge:hover {
    background: #e2e8f0;
    color: #334155;
    border-color: transparent;
}

[data-theme="light"] .topbar-search {
    background: #f8fafc;
}

[data-theme="light"] .topbar-search::after {
    background: #f8fafc;
}

[data-theme="light"] .topbar-search:focus-within {
    border-color: rgba(15, 23, 42, 0.42);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .topbar-search:focus-within::before {
    animation: none;
    opacity: 0;
}

[data-theme="light"] .topbar-search:hover .icon,
[data-theme="light"] .topbar-search:hover .kbd-hint {
    color: #171717;
}

[data-theme="light"] .topbar-search:focus-within .icon,
[data-theme="light"] .topbar-search:focus-within .kbd-hint {
    color: #171717;
}

[data-theme="light"] .help-search-box {
    background: #f8fafc;
}

[data-theme="light"] .help-search-box:focus-within {
    border-color: rgba(15, 23, 42, 0.42);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .help-search-box:hover .icon,
[data-theme="light"] .help-search-box:hover .kbd-hint {
    color: #171717;
}

[data-theme="light"] .help-search-box:focus-within .icon,
[data-theme="light"] .help-search-box:focus-within .kbd-hint {
    color: #171717;
}

[data-theme="light"] .filter-bar .search-input {
    background: #f8fafc;
}

[data-theme="light"] .filter-bar .search-input:focus-within {
    border-color: rgba(15, 23, 42, 0.42);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .filter-bar .search-input:hover .icon {
    color: #171717;
}

[data-theme="light"] .filter-bar .search-input:focus-within .icon {
    color: #171717;
}

[data-theme="light"] .kbd-hint {
    background: rgba(0, 0, 0, 0.06);
    color: #64748b;
}

[data-theme="light"] .sidebar-toggle-btn {
    color: #64748b;
}

[data-theme="light"] .sidebar-toggle-btn:hover {
    background: #E5E8EB;
    color: #0f172a;
}

[data-theme="light"] .sidebar-toggle-btn .icon {
    color: #171717;
}

[data-theme="light"] .app-sidebar .icon,
[data-theme="light"] .app-topbar .icon,
[data-theme="light"] .topbar-search .icon,
[data-theme="light"] .ai-help-search-icon,
[data-theme="light"] .filter-bar .search-input .icon,
[data-theme="light"] .help-search-box .icon,
[data-theme="light"] .input-icon,
[data-theme="light"] .password-toggle {
    color: #171717;
}

[data-theme="light"] svg.icon,
[data-theme="light"] .icon svg {
    stroke: currentColor;
    stroke-width: 2;
    opacity: 1;
    filter: none;
    shape-rendering: geometricPrecision;
    vector-effect: non-scaling-stroke;
}

[data-theme="light"] .btn-google svg.icon,
[data-theme="light"] .btn-github svg.icon {
    stroke: none;
}

[data-theme="light"] .sidebar-toggle-btn::after,
[data-theme="light"] .app-sidebar.collapsed .sidebar-link::after,
[data-theme="light"] .app-sidebar.collapsed .sidebar-user-trigger::after {
    background: #2a2a2a;
    color: #f9fafb;
    border: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .sidebar-toggle-btn::before,
[data-theme="light"] .app-sidebar.collapsed .sidebar-link::before,
[data-theme="light"] .app-sidebar.collapsed .sidebar-user-trigger::before {
    background: #2a2a2a;
    border: 0;
}

[data-theme="light"] .topbar-btn {
    color: #64748b;
}

[data-theme="light"] .topbar-btn:hover {
    background: #E5E8EB;
    color: #0f172a;
}

[data-theme="light"] .theme-toggle {
    color: #64748b;
}

[data-theme="light"] .theme-toggle:hover {
    background: #E5E8EB;
    color: #0f172a;
}

/* --- FORMULÁRIOS --- */
.form-content {
    display: none;
    animation: fadeSlideIn 0.35s ease;
}

.form-content.active {
    display: block;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- INPUT GROUP --- */
.input-group {
    margin-bottom: 1.2rem;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.input-group label i {
    font-size: 0.75rem;
    color: var(--accent);
    width: 14px;
}

/* --- HEROICONS BASE --- */
.icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.icon.lg {
    width: 24px;
    height: 24px;
}

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

.icon.spin {
    animation: spin 1s linear infinite;
}

/* --- INPUT ICON WRAPPER --- */
.input-icon-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
}

.input-icon-wrap .input-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    z-index: 2;
    width: 18px;
    height: 18px;
    transition: color 0.25s ease;
}

.input-icon-wrap:focus-within .input-icon {
    color: var(--text-secondary);
}

[data-theme="dark"] .input-icon-wrap:focus-within .input-icon {
    color: #aaa;
}

.input-icon-wrap .input-field {
    padding-left: 2.6rem;
}

.input-icon-wrap .password-wrapper {
    width: 100%;
}

.input-icon-wrap .password-wrapper .input-field {
    padding-left: 2.6rem;
}

#regSobrenomeError,
#regPhoneError {
    display: none;
}

#regSobrenomeError.visible,
#regPhoneError.visible {
    display: block;
}

.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--input-border);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.25s ease;
}

.input-field::placeholder {
    color: var(--text-muted);
}

.input-field:focus {
    border-color: var(--accent);
    background: var(--input-bg);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.input-field.error {
    border-color: #ef4444;
}

.input-field.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Errors */
.input-error {
    display: none;
    font-size: 0.75rem;
    color: #ef4444;
    margin-top: 0.25rem;
}

.input-error.visible {
    display: block;
}

/* Password wrapper */
.password-wrapper {
    position: relative;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.password-toggle .icon {
    width: 17px;
    height: 17px;
}

.password-toggle:hover {
    background: var(--accent-soft);
    color: var(--text-primary);
}

/* Password strength */
.password-strength {
    display: none;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.password-strength.visible {
    display: flex;
}

.strength-bar {
    flex: 1;
    height: 4px;
    border-radius: 4px;
    background: var(--separator-color);
    overflow: hidden;
}

.strength-bar-fill {
    height: 100%;
    border-radius: 4px;
    width: 0;
    transition: width 0.3s, background 0.3s;
}

.strength-text {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* --- FORM OPTIONS --- */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.checkbox-label input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 2px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.checkbox-label input:checked + .checkbox-custom {
    background: #171717;
    border-color: #171717;
}

.checkbox-icon {
    width: 12px;
    height: 12px;
    stroke: #fff;
    stroke-width: 3;
    opacity: 0;
    transition: opacity 0.15s;
}

.checkbox-label input:checked + .checkbox-custom .checkbox-icon {
    opacity: 1;
}

.checkbox-text {
    font-size: 0.8rem;
    line-height: 1.35;
}

.checkbox-text a {
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
}

.checkbox-text a:hover {
    text-decoration: underline;
}

.forgot-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* Input row */
.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* --- BUTTON SUBMIT --- */
.btn-submit {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1.5px solid var(--action-border);
    background: var(--action-bg);
    color: var(--action-text);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    position: relative;
    overflow: hidden;
}

.btn-submit:hover {
    background: var(--action-bg-hover);
    border-color: var(--action-border);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Ações principais do acesso no modo claro: azul-aço da identidade. */
#btnLogin,
[data-theme="light"] #btnLogin,
#btnRegister:not(:disabled),
[data-theme="light"] #btnRegister:not(:disabled) {
    background: #64748b;
    border-color: #59677a;
    color: #ffffff;
    box-shadow: 0 7px 18px rgba(100, 116, 139, 0.24);
}

#btnLogin:hover,
[data-theme="light"] #btnLogin:hover,
#btnRegister:not(:disabled):hover,
[data-theme="light"] #btnRegister:not(:disabled):hover {
    background: #526174;
    border-color: #495768;
    box-shadow: 0 9px 22px rgba(82, 97, 116, 0.30);
}

/* Login escuro: hierarquia monocromática alinhada às páginas internas. */
[data-theme="dark"] body.page-login {
    background: #090a0c;
}

[data-theme="dark"] .page-login .main-card {
    background: #17191d;
    border-color: #30333a;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.52);
}

[data-theme="dark"] .page-login .brand-panel {
    background: #111318;
    border-right-color: #2b2e34;
}

[data-theme="dark"] .page-login .form-panel {
    background: #1a1c21;
}

[data-theme="dark"] .page-login .form-tabs {
    background: #111318;
    border-color: #30333a;
}

[data-theme="dark"] .page-login .tab-btn {
    color: #a9adb5;
}

[data-theme="dark"] .page-login .tab-btn.active {
    background: #292c32;
    border-color: #3a3e46;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.24);
}

[data-theme="dark"] .page-login .input-field {
    background: #111318;
    border-color: #343840;
    color: #f4f4f5;
}

[data-theme="dark"] .page-login .input-field::placeholder {
    color: #70757f;
}

[data-theme="dark"] .page-login .input-field:hover {
    border-color: #4a4f59;
}

[data-theme="dark"] .page-login .input-field:focus {
    background: #0e1014;
    border-color: #8b919b;
    box-shadow: 0 0 0 3px rgba(148, 154, 166, 0.14);
}

[data-theme="dark"] .page-login #btnLogin,
[data-theme="dark"] .page-login #btnRegister:not(:disabled) {
    background: #343840;
    border-color: #50555f;
    color: #ffffff;
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .page-login #btnLogin:hover,
[data-theme="dark"] .page-login #btnRegister:not(:disabled):hover {
    background: #414650;
    border-color: #666c77;
    color: #ffffff;
    box-shadow: 0 9px 22px rgba(0, 0, 0, 0.36);
}

[data-theme="dark"] .page-login .tech-badge,
[data-theme="dark"] .page-login .social-link {
    background: #1b1e24;
    border-color: #2d3138;
}

[data-theme="dark"] .page-login .theme-toggle {
    background: #22252b;
    color: #c7c9ce;
}

[data-theme="dark"] .page-login .forgot-link,
[data-theme="dark"] .page-login .form-switch a {
    color: #e2e3e6;
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled:not(.loading) {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-submit.loading .btn-content {
    display: none;
}

.btn-submit .btn-content {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-submit .btn-content .icon,
.btn-submit .btn-loading .icon {
    width: 18px;
    height: 18px;
}

.btn-submit .btn-loading {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.btn-submit.loading .btn-loading {
    display: inline-flex;
}

.btn-submit.loading {
    pointer-events: none;
    opacity: 0.85;
}

/* --- DIVIDER --- */
.form-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.15rem 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.form-divider::before,
.form-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--separator-color);
}

/* --- SOCIAL LOGIN --- */
.social-login {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.btn-social {
    flex: 1;
    max-width: 160px;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    border: 1.5px solid var(--social-border);
    background: var(--social-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.btn-social:hover {
    background: var(--social-hover);
    border-color: rgba(15, 23, 42, 0.22);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: none;
}

.btn-google {
    background: var(--social-bg);
    border-color: var(--social-border);
    color: var(--text-secondary);
}

.btn-google:hover {
    background: var(--social-hover);
    border-color: rgba(15, 23, 42, 0.22);
    color: var(--text-primary);
    box-shadow: none;
}

.btn-github {
    background: var(--social-bg);
    border-color: var(--social-border);
    color: var(--text-secondary);
}

.btn-github:hover {
    background: var(--social-hover);
    border-color: rgba(15, 23, 42, 0.22);
    color: var(--text-primary);
    box-shadow: none;
}

[data-theme="dark"] .btn-google {
    background: var(--social-bg);
    border-color: var(--social-border);
    color: var(--text-secondary);
}

[data-theme="dark"] .btn-google:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.28);
    color: #ffffff;
}

[data-theme="dark"] .btn-github {
    background: var(--social-bg);
    border-color: var(--social-border);
    color: var(--text-secondary);
}

[data-theme="dark"] .btn-github:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.28);
    color: #ffffff;
}

/* --- SWITCH TEXT --- */
.form-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 1.25rem;
    margin-bottom: 0.25rem;
}

.form-switch a {
    font-weight: 600;
    cursor: pointer;
    color: var(--text-primary);
    text-decoration: none;
}

.form-switch a:hover {
    text-decoration: underline;
}

/* ============================================
   PAINÉIS LEGAIS (TERMOS / PRIVACIDADE)
   ============================================ */

.legal-panel {
    display: none;
    animation: fadeSlideIn 0.35s ease;
    width: 100%;
    max-width: 400px;
}

.legal-panel.active {
    display: flex;
    flex-direction: column;
}

.legal-panel-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--separator-color);
}

.legal-panel-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.legal-panel-back {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.legal-panel-back:hover {
    background: var(--social-hover);
    color: var(--text-primary);
    border-color: rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .legal-panel-back:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.legal-panel-back:hover .icon {
    color: var(--text-primary);
}

.legal-panel-body {
    overflow-y: auto;
    padding-right: 0.25rem;
    max-height: 420px;
}

.legal-panel-body .legal-date {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.legal-panel-body p {
    font-size: 0.82rem;
    line-height: 1.75;
    color: var(--text-secondary);
    margin-bottom: 0.85rem;
}

.legal-panel-body h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.legal-panel-body ul {
    margin: 0.5rem 0 1rem 1.25rem;
}

.legal-panel-body ul li {
    font-size: 0.82rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.legal-panel-body ul li::marker {
    color: var(--text-secondary);
}

.legal-panel-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* --- TOAST --- */
.toast {
    position: fixed;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: var(--toast-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.45rem 0.65rem 0.45rem 0.85rem;
    box-shadow: var(--toast-shadow);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    color: var(--text-primary);
    font-weight: 500;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2000;
    pointer-events: none;
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-close {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.toast-close:hover {
    background: var(--accent-soft);
    color: var(--text-primary);
}

.toast-close .icon {
    width: 14px;
    height: 14px;
}

.toast.success .toast-icon {
    background: rgba(22, 163, 74, 0.12);
    color: var(--success);
}

.toast.error .toast-icon {
    background: rgba(220, 38, 38, 0.12);
    color: var(--danger);
}

.toast .toast-icon .icon {
    width: 14px;
    height: 14px;
}

/* Os formatos compactos são exclusivos do mobile. */
.toast-mobile-badge,
.toast-mobile-expanded {
    display: none;
}

/* ============================================
   MODAL (ESQUECEU A SENHA)
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s ease;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: var(--bg-card-right);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    max-width: 440px;
    width: 100%;
    position: relative;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    transform: translateY(20px) scale(0.96);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .modal-card {
    background: #1a1c21;
    border-color: #3a3e46;
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.58);
}

[data-theme="dark"] .page-login .modal-overlay {
    background: rgba(4, 5, 7, 0.76);
}

[data-theme="dark"] .page-login .modal-close {
    background: #111318;
    border-color: #343840;
}

[data-theme="dark"] .page-login .modal-icon {
    background: #292c32;
    color: #e2e3e6;
}

[data-theme="dark"] .page-login .modal-card .btn-submit {
    background: #343840;
    border-color: #50555f;
    color: #ffffff;
}

[data-theme="dark"] .page-login .modal-card .btn-submit:hover {
    background: #414650;
    border-color: #666c77;
}

.modal-overlay.visible .modal-card {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--social-hover);
    color: var(--text-primary);
}

.modal-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.modal-icon svg {
    width: 27px;
    height: 27px;
}

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.45rem;
}

.modal-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal-card .input-group {
    margin-bottom: 1.25rem;
}

.modal-card .btn-submit {
    width: 100%;
}

.modal-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--separator-color);
}

.modal-footer a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.modal-footer a .icon {
    transition: transform 0.2s;
}

.modal-footer a:hover .icon {
    transform: translate(-3px, 1px);
}

.modal-footer a:hover {
    color: var(--text-primary);
}
/* ============================================
   PÁGINAS LEGAIS (TERMOS / POLÍTICA)
   ============================================ */

.page-legal {
    min-height: 100vh;
    display: block;
    padding: 0;
}

.page-legal .theme-toggle {
    position: fixed;
}

.legal-header {
    background: var(--bg-card-left);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.4s ease;
}

.legal-header .brand-logo {
    margin-bottom: 0;
}

.legal-header .brand-logo .logo-icon {
    width: 68px;
    height: 68px;
}

.legal-header .brand-logo .logo-text {
    font-size: 1.2rem;
}

.legal-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.legal-back:hover {
    background: var(--social-hover);
    color: #ffffff;
    border-color: #ffffff;
}

.legal-back:hover .icon,
.legal-panel-back:hover .icon {
    color: #ffffff;
}

[data-theme="light"] .legal-back:hover {
    color: var(--text-primary);
    border-color: rgba(15, 23, 42, 0.22);
}

[data-theme="light"] .legal-back:hover .icon,
[data-theme="light"] .legal-panel-back:hover .icon {
    color: var(--text-primary);
}

.legal-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
}

.legal-card {
    background: var(--bg-card-right);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-card);
    transition: background 0.4s ease;
}

.legal-card h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.legal-card .legal-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    display: block;
}

.legal-card h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.legal-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.legal-card p {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.legal-card ul {
    margin: 0.75rem 0 1.25rem 1.5rem;
}

.legal-card ul li {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.legal-card ul li::marker {
    color: var(--text-secondary);
}

.legal-card strong {
    color: var(--text-primary);
    font-weight: 600;
}

.legal-card .legal-highlight {
    background: var(--accent-soft);
    border-left: 3px solid var(--accent);
    padding: 1rem 1.25rem;
    border-radius: 0 10px 10px 0;
    margin: 1.25rem 0;
}

.legal-card .legal-highlight p {
    margin-bottom: 0;
    font-size: 0.85rem;
}

.legal-footer-bar {
    text-align: center;
    padding: 1.5rem 2rem;
    border-top: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-card-left);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ============================================
   PÁGINA HOME
   ============================================ */

.page-home {
    display: block;
    padding: 0;
    min-height: 100vh;
}

.page-home .theme-toggle {
    position: static;
}

/* --- HEADER --- */
.home-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-card-right);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.4s ease;
}

.home-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.home-header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.home-header-left .brand-logo {
    margin-bottom: 0;
}

.home-header-left .logo-icon {
    width: 68px;
    height: 68px;
}

.home-header-left .logo-text {
    font-size: 1.2rem;
}

.home-nav {
    display: flex;
    gap: 0.25rem;
}

.home-nav-link {
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
    text-decoration: none;
}

.home-nav-link:hover {
    color: var(--text-primary);
    background: var(--accent-soft);
}

.home-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.home-btn-login {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-radius: 10px;
    border: 1px solid var(--action-border);
    background: var(--action-bg);
    color: var(--action-text);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
}

.home-btn-login:hover {
    background: var(--action-bg-hover);
    border-color: var(--action-border);
    transform: translateY(-1px);
    box-shadow: none;
    color: var(--action-text);
}

.text-accent {
    color: var(--accent);
}

/* --- HERO --- */
.home-hero {
    position: relative;
    overflow: hidden;
    padding: 6rem 2rem 5rem;
}

.home-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.home-hero-bg::before {
    content: "";
    position: absolute;
    top: -120px;
    right: -80px;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: var(--accent-soft);
    filter: blur(100px);
    -webkit-filter: blur(100px);
}

.home-hero-bg::after {
    content: "";
    position: absolute;
    bottom: -100px;
    left: -60px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: var(--accent-glow);
    filter: blur(80px);
    -webkit-filter: blur(80px);
    opacity: 0.5;
}

.home-hero-content {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.home-hero-text {
    max-width: 720px;
}

.home-hero-text h1 {
    font-size: 3rem;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}

.home-hero-description {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 560px;
}

.home-hero-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.home-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    border-radius: 10px;
    border: 1.5px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
}

.home-btn-outline:hover {
    border-color: var(--action-border);
    color: var(--action-text-soft);
    background: var(--action-soft);
}

/* --- BADGE --- */
.home-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    border-radius: 20px;
    background: var(--badge-bg);
    color: var(--badge-text);
    border: 1px solid var(--badge-border);
    margin-bottom: 1rem;
}

/* --- SECTION --- */
.home-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5rem 2rem;
}

.home-section-alt {
    max-width: 100%;
    padding: 5rem 2rem;
    background: var(--bg-card-left);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.home-section-alt .home-section-header {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.home-section-alt .home-tech-grid {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.home-section-header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 3rem;
}

.home-section-header h2 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.home-section-header p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* --- CARDS --- */
.home-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.home-card {
    background: var(--bg-card-right);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.home-card:hover {
    border-color: var(--badge-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    transform: translateY(-3px);
}

[data-theme="dark"] .home-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.home-card-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.home-card-icon svg {
    width: 100%;
    height: 100%;
}

.home-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.home-card p {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* --- TECH GRID --- */
.home-tech-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

/* --- CONTACT CARDS --- */
.home-contact-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    max-width: 600px;
    margin: 0 auto;
}

.home-contact-card {
    background: var(--bg-card-right);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
}

.home-contact-card:hover {
    border-color: var(--badge-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    transform: translateY(-3px);
}

[data-theme="dark"] .home-contact-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.home-contact-card .home-card-icon {
    margin: 0 auto 1rem;
}

.home-contact-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.home-contact-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* --- FOOTER --- */
.home-footer {
    border-top: 1px solid var(--border-color);
    background: var(--bg-card-left);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.4s ease;
}

.home-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
}

.home-footer-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 280px;
}

.home-footer-links h4,
.home-footer-contact h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.home-footer-links a,
.home-footer-contact p {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 0.4rem;
    transition: color 0.2s;
}

.home-footer-links a:hover {
    color: var(--accent);
}

.home-footer-bar {
    text-align: center;
    padding: 1.25rem 2rem;
    border-top: 1px solid var(--separator-color);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- RESPONSIVO HOME --- */
@media (max-width: 968px) {
    .home-hero-text h1 {
        font-size: 2.2rem;
    }

    .home-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .home-footer-inner {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .home-nav {
        display: none;
    }

    .home-hero {
        padding: 4rem 1.5rem 3rem;
    }

    .home-hero-text h1 {
        font-size: 1.8rem;
    }

    .home-hero-description {
        font-size: 0.95rem;
    }
}

@media (max-width: 600px) {
    .home-header-inner {
        padding: 0.6rem 1rem;
    }

    .home-header-left .logo-icon {
        width: 48px;
        height: 48px;
    }

    .home-header-left .logo-icon svg {
        width: 100%;
        height: 100%;
    }

    .home-header-left .logo-text {
        font-size: 1rem;
    }

    .home-hero {
        padding: 3rem 1.25rem 2.5rem;
    }

    .home-hero-text h1 {
        font-size: 1.5rem;
    }

    .home-hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .home-hero-actions .btn-submit,
    .home-hero-actions .home-btn-outline {
        justify-content: center;
        text-align: center;
    }

    .home-section {
        padding: 3rem 1.25rem;
    }

    .home-section-alt {
        padding: 3rem 1.25rem;
    }

    .home-section-header h2 {
        font-size: 1.4rem;
    }

    .home-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .home-contact-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .home-footer-inner {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 2rem 1.25rem;
    }
}

@media (max-width: 380px) {
    .home-hero-text h1 {
        font-size: 1.3rem;
    }
}

/* --- RESPONSIVO --- */

/* Tablets e telas médias */
@media (max-width: 968px) {
    body {
        padding: 0.75rem;
    }

    .main-card {
        flex-direction: column;
        min-height: auto;
        border-radius: 20px;
    }

    .brand-panel {
        flex: none;
        border-radius: 20px 20px 0 0;
        padding: 2rem 1.5rem;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .brand-panel::before {
        top: -60px;
        right: -60px;
        width: 160px;
        height: 160px;
    }

    .brand-panel::after {
        bottom: -40px;
        left: -40px;
        width: 120px;
        height: 120px;
    }

    .brand-footer {
        display: none;
    }

    .form-panel {
        border-radius: 0 0 20px 20px;
        padding: 2rem 1.5rem;
    }

    .legal-header {
        padding: 0.75rem 1.5rem;
    }

    .legal-container {
        padding: 1.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: calc(100vh - 66px);
    }

    .legal-card {
        padding: 2rem;
        height: 480px;
        overflow-y: auto;
        width: 100%;
    }
}

.mobile-brand {
    display: none;
}

@media (max-width: 600px) {
    body {
        padding: 0.75rem;
        align-items: center;
        overflow-y: auto;
    }

    .mobile-brand {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        position: absolute;
        top: 0.75rem;
        left: 0.75rem;
        z-index: 10;
    }

    .mobile-brand .brand-logo {
        margin: 0;
        gap: 0.7rem;
    }

    .mobile-brand .logo-icon {
        width: 54px;
        height: 54px;
    }

    .mobile-brand .logo-icon svg {
        width: 100%;
        height: 100%;
    }

    .mobile-brand .logo-text {
        font-size: 1.4rem;
    }

    .main-card {
        min-height: auto;
        border-radius: 20px;
    }

    .brand-panel {
        display: none;
    }

    .form-panel {
        border-radius: 20px;
        padding: 2.5rem 1.5rem;
        justify-content: center;
    }

    .form-container {
        max-width: 100%;
        display: flex;
        flex-direction: column;
    }

    .form-content.active {
        flex: 1;
        display: block;
    }

    .form-content#formLogin.active {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .form-tabs {
        gap: 0.25rem;
        padding: 0.25rem;
    }

    .tab-btn {
        padding: 0.65rem 0.75rem;
        font-size: 0.8rem;
    }

    .tab-btn .icon {
        width: 16px;
        height: 16px;
    }

    .input-row {
        flex-direction: column;
        gap: 0;
    }

    .input-row-inline {
        flex-direction: row;
        gap: 0.75rem;
    }

    .form-options {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .btn-submit {
        padding: 0.85rem;
        font-size: 0.9rem;
    }

    .btn-social {
        padding: 0.7rem 0.75rem;
        font-size: 0.8rem;
    }

    .theme-toggle {
        width: 36px;
        height: 36px;
        top: 0.75rem;
        right: 0.75rem;
    }

    .form-panel {
        padding-top: 4.5rem;
    }

    .theme-toggle .icon {
        width: 18px;
        height: 18px;
    }

    .legal-header {
        padding: 0.75rem 1rem;
    }

    .legal-header .brand-logo .logo-icon {
        width: 50px;
        height: 50px;
    }

    .legal-header .brand-logo .logo-text {
        font-size: 1rem;
    }

    .legal-back {
        padding: 0.4rem 0.75rem;
        font-size: 0.78rem;
    }

    .legal-container {
        padding: 0.75rem;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: calc(100vh - 58px);
    }

    .legal-card {
        padding: 1.5rem;
        border-radius: 20px;
        height: 460px;
        overflow-y: auto;
        width: 100%;
    }

    .legal-card h1 {
        font-size: 1.3rem;
    }

    .legal-card h2 {
        font-size: 1rem;
        margin-top: 1.25rem;
    }

    .legal-card p,
    .legal-card ul li {
        font-size: 0.82rem;
    }

    .legal-panel {
        flex: 1;
        overflow: hidden;
    }

    .legal-panel-body {
        flex: 1;
        overflow-y: auto;
    }

    .toast {
        display: none;
    }

    .toast-message {
        min-width: 0;
        max-width: min(280px, calc(100vw - 6.5rem));
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .social-login {
        gap: 0.5rem;
    }
}

@media (max-width: 380px) {
    body {
        padding: 0.5rem;
        overflow-y: auto;
    }

    .form-panel {
        padding: 2rem 1rem;
        padding-top: 4rem;
    }

    .theme-toggle {
        width: 32px;
        height: 32px;
        top: 0.5rem;
        right: 0.5rem;
    }

    .tab-btn {
        padding: 0.55rem 0.6rem;
        font-size: 0.75rem;
    }

    .tab-btn .icon {
        width: 14px;
        height: 14px;
    }

    .legal-header {
        padding: 0.5rem 0.75rem;
    }

    .legal-header .brand-logo .logo-icon {
        width: 44px;
        height: 44px;
    }

    .legal-header .brand-logo .logo-text {
        font-size: 0.9rem;
    }

    .legal-back {
        padding: 0.3rem 0.6rem;
        font-size: 0.72rem;
    }

    .legal-container {
        padding: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: calc(100vh - 50px);
    }

    .legal-card {
        padding: 1.25rem;
        height: 400px;
        overflow-y: auto;
    }

    .legal-card h1 {
        font-size: 1.1rem;
    }

    .mobile-brand .logo-icon {
        width: 46px;
        height: 46px;
    }

    .mobile-brand .logo-text {
        font-size: 1.2rem;
    }

    .mobile-brand {
        top: 0.5rem;
        left: 0.5rem;
    }
}

/* ============================================
   SISTEMA INTERNO - LAYOUT
   ============================================ */

.page-internal {
    padding: 0;
    align-items: stretch;
    display: block;
    min-height: 100vh;
    background: var(--bg-primary);
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* --- SIDEBAR --- */
.app-sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: width 0.3s ease;
}

.app-sidebar.collapsed {
    width: 60px;
    cursor: default;
}

.app-sidebar.collapsed.empty-hover {
    cursor: ew-resize;
}

.app-sidebar *,
.app-sidebar *::before,
.app-sidebar *::after {
    transition: none !important;
}

.app-sidebar.collapsed .sidebar-header {
    padding: 0.85rem 0 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ew-resize;
    position: relative;
    z-index: 2;
    border-bottom-color: transparent;
}

.app-sidebar.collapsed .sidebar-header .brand-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateY(-2px);
}

.app-sidebar.collapsed .sidebar-header::after,
html.sidebar-state-collapsed .app-sidebar .sidebar-header::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 1px;
    background: var(--border-color);
    transform: translateY(1px);
    z-index: 3;
    pointer-events: none;
}

.app-sidebar.collapsed .sidebar-toggle-btn {
    display: flex;
    padding: 7px;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.app-sidebar.collapsed .sidebar-header:hover .sidebar-toggle-btn {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.app-sidebar.collapsed.empty-hover .sidebar-header .sidebar-toggle-btn {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.app-sidebar.collapsed .sidebar-header:hover .brand-logo {
    visibility: hidden;
}

.app-sidebar.collapsed.empty-hover .sidebar-header .brand-logo {
    visibility: hidden;
}

.app-sidebar:not(.collapsed) .sidebar-header .logo-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
}

.app-sidebar:not(.collapsed) .sidebar-header .logo-icon img,
.app-sidebar:not(.collapsed) .sidebar-header .logo-icon svg {
    width: 42px;
    height: 42px;
    max-width: 42px;
    max-height: 42px;
    object-fit: contain;
}

.app-sidebar.collapsed .sidebar-header .logo-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-sidebar.collapsed .sidebar-header .logo-icon img {
    max-width: 44px;
    max-height: 44px;
    object-fit: contain;
}

.app-sidebar.collapsed .sidebar-header .logo-icon svg {
    width: 44px;
    height: 44px;
}

.logo-icon img {
    display: block;
    max-width: 100%;
    height: 100%;
    object-fit: contain;
}

.app-sidebar.collapsed .sidebar-header .sidebar-brand-text {
    display: none;
}

.app-sidebar.collapsed .sidebar-nav {
    padding: 0.75rem 0.5rem;
    overflow: visible;
}

.app-sidebar.collapsed .sidebar-section-title {
    display: none;
}

.app-sidebar.collapsed .sidebar-link {
    position: relative;
    font-size: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: auto;
    padding: 0.6rem 0.75rem;
    margin: 0;
    border-radius: 8px;
    gap: 0;
}

.app-sidebar.text-hidden .sidebar-link {
    font-size: 0;
}

.app-sidebar.text-hidden .sidebar-link > *:not(.icon):not(.badge-count),
.app-sidebar.text-hidden .sidebar-section-title,
.app-sidebar.text-hidden .sidebar-brand-text,
.app-sidebar.text-hidden .sidebar-user-info,
.app-sidebar.text-hidden .sidebar-user-summary,
.app-sidebar.text-hidden .sidebar-user-chevron,
.app-sidebar.text-hidden .sidebar-user-dropdown,
.app-sidebar.text-hidden .sidebar-logout,
.app-sidebar.text-hidden .sidebar-copyright {
    display: none;
}

.app-sidebar.collapsed .sidebar-link .icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.app-sidebar.collapsed .sidebar-link .badge-count {
    display: inline-flex;
    position: absolute;
    top: 0.18rem;
    right: 0.18rem;
    min-width: 15px;
    height: 15px;
    align-items: center;
    justify-content: center;
    margin-left: 0;
    padding: 0 0.25rem;
    font-size: 0.58rem;
    line-height: 1;
}

.app-sidebar.collapsed .sidebar-link::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 22px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card-right);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: none;
    font-family: system-ui, sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 200;
}

.app-sidebar.collapsed .sidebar-link::before {
    content: "";
    position: absolute;
    left: calc(100% + 18px);
    top: 50%;
    width: 10px;
    height: 10px;
    background: var(--bg-card-right);
    transform: translateY(-50%) rotate(45deg);
    pointer-events: none;
    opacity: 0;
    transition: none;
    z-index: 199;
}

.app-sidebar.collapsed .sidebar-link:hover::after {
    opacity: 1;
}

.app-sidebar.collapsed .sidebar-link:hover::before {
    opacity: 1;
}

[data-theme="dark"] .app-sidebar.collapsed .sidebar-link::after {
    background: #2a2a2a;
    color: #f9fafb;
}

[data-theme="dark"] .app-sidebar.collapsed .sidebar-link::before {
    background: #2a2a2a;
}

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

.app-sidebar.collapsed .sidebar-link.active:hover::before {
    display: block;
}

.app-sidebar.collapsed .sidebar-footer {
    padding: 0.75rem 0.5rem;
    justify-content: center;
    border-top: 0;
}

.app-sidebar.collapsed .sidebar-user-info,
.app-sidebar.collapsed .sidebar-user-summary,
.app-sidebar.collapsed .sidebar-user-chevron,
.app-sidebar.collapsed .sidebar-user-dropdown,
.app-sidebar.collapsed .sidebar-logout {
    display: none;
}

.app-sidebar.collapsed .sidebar-user {
    justify-content: flex-start;
}

.app-sidebar.collapsed .sidebar-user-menu,
html.sidebar-state-collapsed .app-sidebar .sidebar-user-menu {
    width: 100%;
    margin-inline: 0;
}

.app-sidebar.collapsed .sidebar-avatar {
    width: 30px;
    height: 30px;
    font-size: 0.78rem;
    border-radius: 50%;
    cursor: pointer;
}

.app-sidebar.collapsed .sidebar-user-trigger {
    justify-content: center;
    padding: 0.45rem;
}

.app-sidebar.collapsed .sidebar-user-trigger::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 22px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card-right);
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 400;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    white-space: pre-line;
    line-height: 1.35;
    text-align: left;
    pointer-events: none;
    opacity: 0;
    transition: none;
    font-family: system-ui, sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 200;
}

.app-sidebar.collapsed .sidebar-user-trigger::before {
    content: "";
    position: absolute;
    left: calc(100% + 18px);
    top: 50%;
    width: 10px;
    height: 10px;
    background: var(--bg-card-right);
    transform: translateY(-50%) rotate(45deg);
    pointer-events: none;
    opacity: 0;
    transition: none;
    z-index: 199;
}

.app-sidebar.collapsed .sidebar-user-trigger:hover::after,
.app-sidebar.collapsed .sidebar-user-trigger:hover::before {
    opacity: 1;
}

.app-sidebar.collapsed ~ .app-main {
    margin-left: 60px;
}

html.sidebar-state-collapsed .app-sidebar {
    width: 60px;
    cursor: default;
}

html.sidebar-state-collapsed .app-sidebar.empty-hover {
    cursor: ew-resize;
}

html.sidebar-state-collapsed .app-sidebar .sidebar-header {
    padding: 0.85rem 0 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ew-resize;
    position: relative;
    z-index: 2;
    border-bottom-color: transparent;
}

html.sidebar-state-collapsed .app-sidebar .sidebar-header .brand-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateY(-2px);
}

html.sidebar-state-collapsed .app-sidebar .sidebar-toggle-btn {
    display: flex;
    padding: 7px;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

html.sidebar-state-collapsed
    .app-sidebar
    .sidebar-header:hover
    .sidebar-toggle-btn {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

html.sidebar-state-collapsed
    .app-sidebar.empty-hover
    .sidebar-header
    .sidebar-toggle-btn {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

html.sidebar-state-collapsed .app-sidebar .sidebar-header:hover .brand-logo {
    visibility: hidden;
}

html.sidebar-state-collapsed
    .app-sidebar.empty-hover
    .sidebar-header
    .brand-logo {
    visibility: hidden;
}

html.sidebar-state-collapsed .app-sidebar .sidebar-header .logo-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

html.sidebar-state-collapsed .app-sidebar .sidebar-header .logo-icon img {
    max-width: 44px;
    max-height: 44px;
    object-fit: contain;
}

html.sidebar-state-collapsed .app-sidebar .sidebar-header .logo-icon svg {
    width: 44px;
    height: 44px;
}

html.sidebar-state-collapsed .app-sidebar .sidebar-header .sidebar-brand-text,
html.sidebar-state-collapsed .app-sidebar .sidebar-section-title,
html.sidebar-state-collapsed
    .app-sidebar
    .sidebar-link
    > *:not(.icon):not(.badge-count),
html.sidebar-state-collapsed .app-sidebar .sidebar-user-info,
html.sidebar-state-collapsed .app-sidebar .sidebar-user-summary,
html.sidebar-state-collapsed .app-sidebar .sidebar-user-chevron,
html.sidebar-state-collapsed .app-sidebar .sidebar-user-dropdown,
html.sidebar-state-collapsed .app-sidebar .sidebar-logout,
html.sidebar-state-collapsed .app-sidebar .sidebar-copyright {
    display: none;
}

html.sidebar-state-collapsed .app-sidebar .sidebar-footer {
    padding: 0.75rem 0.5rem;
    justify-content: center;
    border-top: 0;
}

html.sidebar-state-collapsed .app-sidebar .sidebar-user-trigger {
    justify-content: center;
    padding: 0.45rem;
}

html.sidebar-state-collapsed .app-sidebar .sidebar-nav {
    padding: 0.75rem 0.5rem;
}

html.sidebar-state-collapsed .app-sidebar .sidebar-link {
    position: relative;
    font-size: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: auto;
    padding: 0.6rem 0.75rem;
    margin: 0;
    border-radius: 8px;
    gap: 0;
}

html.sidebar-state-collapsed .app-sidebar .sidebar-link .icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

html.sidebar-state-collapsed .app-sidebar .sidebar-link.active::before {
    display: none;
}

html.sidebar-state-collapsed .app-sidebar .sidebar-link.active:hover::before {
    display: block;
}

html.sidebar-state-collapsed .app-sidebar .sidebar-link .badge-count {
    display: inline-flex;
    position: absolute;
    top: 0.18rem;
    right: 0.18rem;
    min-width: 15px;
    height: 15px;
    align-items: center;
    justify-content: center;
    margin-left: 0;
    padding: 0 0.25rem;
    font-size: 0.58rem;
    line-height: 1;
}

html.sidebar-state-collapsed .app-sidebar ~ .app-main {
    margin-left: 60px;
}

.sidebar-header {
    padding: 0.85rem 1.25rem;
    min-height: 69px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-sidebar:not(.collapsed) .sidebar-header {
    padding: 0.85rem 0.85rem 0.85rem 1.1rem;
}

.app-sidebar:not(.collapsed) .sidebar-header .brand-logo {
    gap: 0.25rem;
}

.app-sidebar:not(.collapsed) .sidebar-header .logo-text {
    font-size: 20px;
}

.app-sidebar:not(.collapsed) .sidebar-toggle-btn {
    margin-left: auto;
    margin-right: -0.35rem;
}

.sidebar-header .brand-logo {
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.55rem;
    flex: 1;
    min-width: 0;
    flex-wrap: nowrap;
    overflow: hidden;
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    cursor: ew-resize;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem;
    border-radius: 8px;
    transition:
        background 0.2s,
        color 0.2s;
    flex-shrink: 0;
    position: relative;
}

.sidebar-toggle-btn:hover {
    background: var(--action-soft);
    color: var(--action-text-soft);
}

.sidebar-toggle-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 22px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--text-primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 400;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: none;
    font-family: system-ui, sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 200;
}

.sidebar-toggle-btn::before {
    content: "";
    position: absolute;
    left: calc(100% + 18px);
    top: 50%;
    width: 10px;
    height: 10px;
    background: var(--text-primary);
    transform: translateY(-50%) rotate(45deg);
    pointer-events: none;
    opacity: 0;
    transition: none;
    z-index: 199;
}

.sidebar-toggle-btn:hover::after,
.sidebar-toggle-btn:hover::before {
    opacity: 1;
}

.app-sidebar:not(.collapsed) .sidebar-toggle-btn::after {
    top: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%);
}

.app-sidebar:not(.collapsed) .sidebar-toggle-btn::before {
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
}

.sidebar-toggle-btn .icon {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.1rem;
    min-width: 0;
}

.sidebar-header .logo-text {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1;
    transform: translateY(-2px);
    white-space: nowrap;
    flex-wrap: nowrap;
}

.sidebar-header .logo-highlight {
    color: var(--accent);
    font-size: 1em;
    margin-left: 0;
    line-height: 1;
}

[data-theme="dark"] .sidebar-header .logo-highlight {
    color: var(--accent);
}

.sidebar-header .logo-pro {
    color: #afafaf;
    font-size: 1em;
    margin-left: 0.18em;
    font-weight: 700;
    line-height: 1;
}

[data-theme="light"] .sidebar-header .logo-pro {
    color: #8a8a8a;
}

.sidebar-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sidebar-section-title {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 0.75rem 0.75rem 0.35rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    width: 100%;
    text-align: left;
}

.sidebar-search-link {
    appearance: none;
}

.sidebar-link:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
    font-weight: 600;
}

.sidebar-link:hover .icon,
.sidebar-link.active .icon {
    color: var(--text-secondary);
}

.sidebar-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    width: 3px;
    height: 24px;
    background: var(--text-secondary);
    border-radius: 0 3px 3px 0;
}

.sidebar-link .icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-link .ti.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
}

.sidebar-collapse-icon,
.sidebar-expand-icon {
    display: none;
}

.app-sidebar:not(.collapsed) .sidebar-toggle-btn .sidebar-collapse-icon {
    display: block;
}

.app-sidebar.collapsed .sidebar-toggle-btn .sidebar-expand-icon {
    display: block;
}

html.sidebar-state-collapsed
    .app-sidebar
    .sidebar-toggle-btn
    .sidebar-collapse-icon {
    display: none;
}

html.sidebar-state-collapsed
    .app-sidebar
    .sidebar-toggle-btn
    .sidebar-expand-icon {
    display: block;
}

@media (max-width: 900px) {
    .app-sidebar:not(.open) .sidebar-toggle-btn .sidebar-expand-icon {
        display: block;
    }
    .app-sidebar.open .sidebar-toggle-btn .sidebar-collapse-icon {
        display: block;
    }
    .app-sidebar.open .sidebar-toggle-btn .sidebar-expand-icon {
        display: none;
    }
}

.sidebar-link .badge-count {
    margin-left: auto;
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
}

.sidebar-link .sidebar-new-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 18px;
    padding: 0 0.45rem;
    background: #171717;
    color: #ffffff;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
    text-transform: uppercase;
}

[data-theme="dark"] .sidebar-link .sidebar-new-badge {
    background: #f5f5f5;
    color: #111111;
}

.app-sidebar.collapsed .sidebar-link .sidebar-new-badge,
html.sidebar-state-collapsed .app-sidebar .sidebar-link .sidebar-new-badge {
    width: 8px;
    min-width: 8px;
    min-height: 8px;
    height: 8px;
    padding: 0;
    border-radius: 50%;
    color: transparent;
    font-size: 0;
}

.sidebar-footer {
    margin: 0;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sidebar-user-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: inherit;
    flex: 1;
    min-width: 0;
    border-radius: 8px;
    padding: 0.2rem 0.3rem;
    transition: background 0.2s;
}

.sidebar-user-link:hover {
    background: var(--accent-soft);
}

[data-theme="dark"] .sidebar-user-link:hover {
    background: #2a2a2a;
}

.sidebar-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #9d9d9d;
    border: 0;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.86rem;
    font-weight: 600;
    flex-shrink: 0;
    box-sizing: border-box;
    opacity: 1;
}

[data-theme="dark"] .sidebar-avatar {
    background-color: #9d9d9d;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
}

.sidebar-user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.sidebar-logout {
    color: var(--danger);
    transition: color 0.2s;
    display: flex;
    padding: 0.3rem;
    border-radius: 6px;
}

.sidebar-logout .icon {
    color: currentColor;
    stroke: currentColor;
}

[data-theme="dark"] .sidebar-logout,
[data-theme="dark"] .sidebar-logout .icon {
    color: var(--danger) !important;
    stroke: currentColor !important;
}

.sidebar-logout:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}

[data-theme="dark"] .sidebar-logout:hover {
    color: var(--danger) !important;
    background: rgba(239, 68, 68, 0.12);
}

.sidebar-user-menu {
    position: relative;
    width: calc(100% + 0.25rem);
    margin-inline: -0.125rem;
}

.sidebar-user-trigger {
    width: 100%;
    min-height: 42px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.85rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    font-family: inherit;
    position: relative;
}

[data-theme="dark"] .sidebar-user-trigger {
    background: transparent;
}

.sidebar-user-trigger:hover,
.sidebar-user-menu.open .sidebar-user-trigger {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
    box-shadow: none;
}

[data-theme="dark"] .sidebar-user-trigger:hover,
[data-theme="dark"] .sidebar-user-menu.open .sidebar-user-trigger {
    background: #2a2a2a;
    color: #e0e0e0;
    box-shadow: none;
}

.sidebar-user-summary {
    min-width: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.05rem;
    line-height: 1.1;
}

.sidebar-user-chevron {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s ease !important;
}

.sidebar-user-menu.open .sidebar-user-chevron {
    transform: rotate(180deg);
}

.sidebar-user-dropdown {
    position: absolute;
    left: -0.15rem;
    bottom: calc(100% + 0.55rem);
    width: calc(100% + 0.3rem);
    padding: 0.45rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-elevated);
    display: none;
    z-index: 2200;
}

[data-theme="dark"] .sidebar-user-dropdown {
    background: rgba(26, 26, 26, 0.64);
}

.sidebar-user-menu.open .sidebar-user-dropdown {
    display: block;
}

.app-sidebar.collapsed .sidebar-user-menu.open .sidebar-user-dropdown,
.app-sidebar.text-hidden .sidebar-user-menu.open .sidebar-user-dropdown,
html.sidebar-state-collapsed
    .app-sidebar
    .sidebar-user-menu.open
    .sidebar-user-dropdown {
    display: block;
    width: 227px;
    left: 0;
    transform: none;
}

.sidebar-user-dropdown-head {
    padding: 0.65rem 0.65rem 0.55rem;
    border-bottom: 1px solid var(--separator-color);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: default;
}

.sidebar-user-dropdown-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #9d9d9d;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 600;
    flex-shrink: 0;
}

[data-theme="dark"] .sidebar-user-dropdown-avatar {
    background-color: #9d9d9d;
}

/* Interações visíveis no dropdown de notificações. */
.notification-item {
    cursor: pointer;
}

[data-theme="light"] .notification-item:hover,
[data-theme="light"] .notification-item:focus-visible {
    background: #eef1f5;
    color: #0f172a;
    outline: none;
}

[data-theme="dark"] .notification-item:hover,
[data-theme="dark"] .notification-item:focus-visible {
    background: #292c32;
    color: #ffffff;
    outline: none;
}

[data-theme="light"] .notification-footer:hover,
[data-theme="light"] .notification-footer:focus-visible,
[data-theme="light"] .notification-mark-read:hover,
[data-theme="light"] .notification-mark-read:focus-visible {
    background: #eef1f5;
    border-color: #c5cad3;
    color: #25282e;
    outline: none;
}

[data-theme="dark"] .notification-footer:hover,
[data-theme="dark"] .notification-footer:focus-visible,
[data-theme="dark"] .notification-mark-read:hover,
[data-theme="dark"] .notification-mark-read:focus-visible {
    background: #292c32;
    border-color: #50555f;
    color: #ffffff;
    outline: none;
}

.sidebar-user-dropdown-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.sidebar-user-dropdown-name {
    font-size: 0.86rem;
    font-weight: 600;
    color: #0f172a;
}

[data-theme="dark"] .sidebar-user-dropdown-name {
    color: #ffffff;
}

.sidebar-user-dropdown-email,
.sidebar-user-dropdown-info {
    font-size: 0.72rem;
    color: var(--text-muted);
    cursor: default;
}

.sidebar-user-dropdown-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-dropdown-info {
    padding: 0.6rem 0.65rem;
    border-bottom: 1px solid var(--separator-color);
    display: grid;
    gap: 0.2rem;
}

.sidebar-user-dropdown-info strong {
    font-weight: 700;
    color: var(--text-muted);
}

.sidebar-user-dropdown-info em {
    font-style: normal;
    color: var(--text-primary);
}

.sidebar-user-action {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.sidebar-user-action .icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.sidebar-user-action:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

[data-theme="dark"] .sidebar-user-action:hover {
    background: #2a2a2a;
    color: #fff;
}

.sidebar-user-logout {
    color: var(--danger);
}

.sidebar-user-logout .icon {
    color: currentColor;
    stroke: currentColor;
}

.sidebar-user-logout:hover {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

[data-theme="dark"] .sidebar-user-logout,
[data-theme="dark"] .sidebar-user-logout .icon,
[data-theme="dark"] .sidebar-user-logout:hover,
[data-theme="dark"] .sidebar-user-logout:hover .icon {
    color: var(--danger) !important;
    stroke: currentColor !important;
}

.sidebar-copyright {
    margin: 0;
    padding: 0.75rem 0 0.85rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.68rem;
    line-height: 1.35;
    color: var(--text-muted);
    text-align: center;
}

.app-sidebar.collapsed .sidebar-copyright {
    display: none;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

/* --- TOPBAR --- */
.app-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.5rem;
    padding-bottom: calc(0.85rem + 1px);
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 69px;
    transition:
        background 0.3s ease,
        box-shadow 0.3s ease;
}

.app-topbar > * {
    align-self: center;
    position: relative;
    top: 0.5px;
}

.app-topbar.scrolled {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .app-topbar.scrolled {
    background: rgba(26, 26, 26, 0.5);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.topbar-toggle {
    display: flex;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.topbar-toggle:hover {
    background: var(--action-soft);
    color: var(--action-text-soft);
}

.topbar-toggle .icon {
    width: 24px;
    height: 24px;
}

@keyframes rotateRing {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.topbar-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    max-width: 520px;
    background: var(--bg-card-right);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    position: relative;
    z-index: 250;
    overflow: visible;
    isolation: auto;
    transition:
        border-color 0.2s,
        background 0.2s;
}

[data-theme="dark"] .topbar-search {
    background: #1a1a1a;
}

.topbar-search::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 180%;
    aspect-ratio: 1 / 1;
    transform: translate(-50%, -50%) rotate(0deg);
    transform-origin: center center;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        rgba(0,0,0,0.01) 0deg,
        rgba(0,0,0,0.03) 15deg,
        rgba(0,0,0,0.08) 35deg,
        rgba(0,0,0,0.18) 65deg,
        rgba(0,0,0,0.40) 95deg,
        rgba(0,0,0,0.60) 125deg,
        rgba(0,0,0,0.75) 150deg,
        rgba(0,0,0,0.60) 180deg,
        rgba(60,60,60,0.40) 210deg,
        rgba(80,80,80,0.25) 240deg,
        rgba(0,0,0,0.12) 275deg,
        rgba(0,0,0,0.06) 310deg,
        rgba(0,0,0,0.03) 340deg,
        rgba(0,0,0,0.01) 360deg
    );
    animation: none;
    z-index: 0;
    pointer-events: none;
}

[data-theme="dark"] .topbar-search::before {
    background: conic-gradient(
        from 0deg,
        rgba(255,255,255,0.01) 0deg,
        rgba(255,255,255,0.03) 15deg,
        rgba(255,255,255,0.08) 35deg,
        rgba(255,255,255,0.18) 65deg,
        rgba(255,255,255,0.40) 95deg,
        rgba(255,255,255,0.75) 125deg,
        rgba(255,255,255,0.95) 150deg,
        rgba(255,255,255,0.82) 180deg,
        rgba(230,230,230,0.58) 210deg,
        rgba(210,210,210,0.34) 240deg,
        rgba(255,255,255,0.16) 275deg,
        rgba(255,255,255,0.07) 310deg,
        rgba(255,255,255,0.03) 340deg,
        rgba(255,255,255,0.01) 360deg
    );
}

.topbar-search::before,
.topbar-search::after {
    content: none !important;
    display: none !important;
    animation: none !important;
}

.topbar-search::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 7px;
    background: var(--bg-card-right);
    z-index: 1;
    pointer-events: none;
}

[data-theme="dark"] .topbar-search::after {
    background: #1a1a1a;
}

.topbar-search > * {
    position: relative;
    z-index: 2;
}

.topbar-search:focus-within {
    border-color: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.topbar-search:focus-within::before,
.topbar-search:focus-within::after {
    animation: none;
    opacity: 0;
}

[data-theme="dark"] .topbar-search:focus-within {
    border-color: #aaa;
    background: #1a1a1a;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .topbar-search:focus-within::before,
[data-theme="dark"] .topbar-search:focus-within::after {
    animation: none;
    opacity: 0;
}

[data-theme="dark"] .topbar-search:focus-within .icon,
[data-theme="dark"] .topbar-search:focus-within .kbd-hint {
    color: #aaa;
}

[data-theme="dark"] .topbar-search:hover .icon,
[data-theme="dark"] .topbar-search:hover .kbd-hint {
    color: rgba(255, 255, 255, 0.75);
}

.topbar-search .icon {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.topbar-search.ai-help-search {
    position: relative;
    z-index: 30;
    max-width: 430px;
    overflow: visible;
    border: 1px solid var(--border-color);
    background: var(--bg-card-right);
    box-shadow: none;
    transition:
        border-color 0.2s,
        background 0.2s,
        box-shadow 0.2s;
}

.topbar-search.ai-help-search::before {
    display: none;
}

.topbar-search.ai-help-search::after {
    display: none;
}

.topbar-search.ai-help-search:hover,
.topbar-search.ai-help-search.open {
    border-color: rgba(15, 23, 42, 0.22);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] .topbar-search.ai-help-search {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

[data-theme="dark"] .topbar-search.ai-help-search:hover,
[data-theme="dark"] .topbar-search.ai-help-search.open {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.topbar-search.ai-help-search:focus-within {
    border-color: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .topbar-search.ai-help-search:focus-within {
    border-color: #aaa;
    background: #1a1a1a;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.topbar-search.ai-help-search .ai-help-search-icon {
    color: var(--text-secondary);
}

[data-theme="dark"] .topbar-search.ai-help-search .ai-help-search-icon {
    color: rgba(255, 255, 255, 0.72);
}

.topbar-search.ai-help-search .kbd-hint {
    color: var(--text-primary);
    background: var(--action-soft);
    border: 1px solid var(--action-border);
    font-weight: 700;
}

[data-theme="dark"] .topbar-search.ai-help-search .kbd-hint {
    color: #e0e0e0;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

.ai-help-beta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--action-soft);
    color: var(--text-secondary);
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
}

.ai-help-beta {
    height: 18px;
    padding: 0 0.4rem;
    margin-left: 0.35rem;
    vertical-align: middle;
}

[data-theme="dark"] .ai-help-beta {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: #cfcfcf;
}

.ai-help-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.6rem);
    z-index: 3200;
    display: none;
    padding: 0.45rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow-elevated);
}

.ai-help-dropdown::before {
    display: none;
}

.topbar-search.ai-help-search.open .ai-help-dropdown {
    display: block;
}

[data-theme="dark"] .ai-help-dropdown {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.12);
}

.ai-help-dropdown-head {
    display: grid;
    gap: 0.18rem;
    padding: 0.85rem 0.9rem 0.65rem;
    border-bottom: 1px solid var(--separator-color);
}

.ai-help-dropdown-head strong {
    color: var(--text-primary);
    font-size: 0.88rem;
    line-height: 1.25;
}

.ai-help-dropdown-head small {
    color: var(--text-muted);
    font-size: 0.74rem;
    line-height: 1.35;
}

.ai-help-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.7rem;
}

.ai-help-suggestions button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    min-height: 32px;
    padding: 0.34rem 0.58rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.72);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
}

[data-theme="dark"] .ai-help-suggestions button {
    background: rgba(255, 255, 255, 0.06);
}

.ai-help-suggestions button span {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 0.42rem;
    border-radius: 999px;
    background: var(--action-soft);
    color: var(--text-primary);
    font-size: 0.66rem;
    font-weight: 800;
}

.ai-help-suggestions button:hover {
    background: rgba(255, 255, 255, 0.48);
    border-color: var(--text-muted);
    color: var(--text-primary);
}

[data-theme="dark"] .ai-help-suggestions button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.ai-help-inline-question {
    margin: 0.75rem 0.75rem 0;
    padding: 0.65rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
}

.kbd-hint {
    margin-left: auto;
    font-size: 0.65rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.08);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: inherit;
    line-height: 1.4;
    opacity: 1;
}

.topbar-input {
    border: none;
    background: none;
    outline: none;
    font-family: inherit;
    font-size: 0.82rem;
    color: var(--text-primary);
    width: 100%;
}

.topbar-input::placeholder {
    color: var(--text-secondary);
    opacity: 1;
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.topbar-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
}

.topbar-breadcrumb a:hover {
    color: #ffffff;
}

.topbar-breadcrumb .sep {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-left: auto;
    position: relative;
}

.topbar-new-ticket {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    height: 34px;
    padding: 0 0.9rem;
    margin-right: 1.5rem;
    border: 1px solid var(--action-border);
    border-radius: 8px;
    background: var(--action-bg);
    color: var(--action-text);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.topbar-new-ticket:hover {
    background: var(--action-bg-hover);
    border-color: var(--action-border);
    color: var(--action-text);
}

.topbar-new-ticket .icon {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
    transform-origin: center;
}

.topbar-new-ticket:hover .icon {
    transform: scale(1.14);
}

[data-theme="light"] .topbar-new-ticket .icon,
[data-theme="dark"] .topbar-new-ticket .icon {
    color: inherit;
}

.topbar-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
}
.mobile-spotlight-trigger { display: none; }

.topbar-btn .icon {
    width: 20px;
    height: 20px;
}

.topbar-btn:hover {
    background: var(--action-soft);
    color: var(--action-text-soft);
}

.topbar-badge {
    position: absolute;
    top: 1px;
    right: 1px;
    min-width: 22px;
    height: 22px;
    padding: 1px 5px 0;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    border: 2px solid var(--bg-primary);
    font-family: Arial, sans-serif;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    text-align: center;
    text-indent: 0;
    box-sizing: border-box;
    z-index: 2;
    transform: translate(32%, -30%);
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.28);
}

[data-theme="dark"] .topbar-badge {
    border-color: #111318;
}

.notification-button.has-unread .icon {
    color: inherit;
    animation: notification-bell-attention 4.2s ease-in-out infinite;
    transform-origin: 50% 15%;
}

.notification-button.has-unread {
    background: transparent;
    color: var(--text-secondary);
}

.notification-button.has-unread:hover {
    background: var(--action-soft);
    color: var(--action-text-soft);
}

[data-theme="dark"] .notification-button,
[data-theme="dark"] .notification-button.has-unread,
[data-theme="dark"] .notification-button:hover,
[data-theme="dark"] .notification-button.has-unread:hover {
    color: #ffffff;
}

@keyframes notification-bell-attention {
    0%, 84%, 100% { transform: rotate(0) scale(1); }
    88% { transform: rotate(14deg) scale(1.08); }
    92% { transform: rotate(-12deg) scale(1.1); }
    96% { transform: rotate(7deg) scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
    .notification-button.has-unread .icon { animation: none; }
}

.notification-center {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: var(--notification-panel-right, 0);
    width: min(390px, calc(100vw - 2rem));
    padding: 0.45rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow-elevated);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.2s ease;
    z-index: 2600;
    overflow: visible;
}

.notification-center::before {
    content: "";
    position: absolute;
    top: -6px;
    right: var(--notification-arrow-right, 1.25rem);
    width: 12px;
    height: 12px;
    border-top: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
    background: #ffffff;
    transform: rotate(45deg);
    pointer-events: none;
    z-index: 1;
}

.notification-center::after {
    display: none;
}

.notification-head,
.notification-list,
.notification-footer {
    position: relative;
    z-index: 1;
}

[data-theme="dark"] .notification-center {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .notification-center::before {
    border-color: rgba(255, 255, 255, 0.12);
    background: #1a1a1a;
}

.topbar-actions.notifications-open .notification-center {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.notification-head strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.92rem;
}

.notification-head span {
    display: block;
    margin-top: 0.15rem;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.notification-mark-read {
    padding: 0.35rem 0.55rem;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    background: rgba(248, 250, 252, 0.72);
    color: var(--text-secondary);
    cursor: pointer;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    transition:
        background 0.16s ease,
        border-color 0.16s ease,
        color 0.16s ease;
}

[data-theme="dark"] .notification-mark-read {
    background: rgba(255, 255, 255, 0.06);
}

.notification-mark-read:hover {
    background: var(--action-soft);
    border-color: var(--action-border);
    color: var(--action-text-soft);
}

.notification-list {
    max-height: 360px;
    overflow-y: auto;
    padding: 0.35rem;
}

.notification-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.7rem;
    align-items: flex-start;
    padding: 0.75rem;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    transition:
        background 0.16s ease,
        color 0.16s ease;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.56);
    color: var(--text-primary);
}

[data-theme="dark"] .notification-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.notification-item.unread {
    color: var(--text-primary);
}

.notification-dot {
    width: 8px;
    height: 8px;
    margin-top: 0.42rem;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: transparent;
    flex-shrink: 0;
}

.notification-item.unread .notification-dot {
    background: var(--danger);
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.notification-body {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.18rem;
}

.notification-type {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.notification-body strong {
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-body span:last-child {
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.35;
}

.notification-time {
    color: var(--text-muted);
    font-size: 0.7rem;
    white-space: nowrap;
}

.notification-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition:
        background 0.16s ease,
        color 0.16s ease;
}

.notification-footer:hover {
    background: var(--action-soft);
    color: var(--text-primary);
}

@media (max-width: 640px) {
    .notification-center {
        right: -0.5rem;
        width: min(360px, calc(100vw - 1rem));
    }

    .topbar-new-ticket {
        display: none;
    }
}

.topbar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background-color: #9d9d9d;
    border: 0;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 0.35rem;
    box-sizing: border-box;
    opacity: 1;
}

[data-theme="dark"] .topbar-avatar {
    background-color: #9d9d9d;
}

.topbar-user-menu {
    position: relative;
    margin-left: 0.35rem;
}

.topbar-user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 38px;
    padding: 0.25rem 0.45rem 0.25rem 0.25rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card-right);
    color: var(--text-primary);
    cursor: pointer;
    font-family: inherit;
}

[data-theme="dark"] .topbar-user-trigger {
    background: #1a1a1a;
}

.topbar-user-trigger:hover,
.topbar-user-menu.open .topbar-user-trigger {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.topbar-user-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.05rem;
    line-height: 1.1;
}

.topbar-user-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: #ffffff;
}

.topbar-user-role {
    font-size: 0.66rem;
    color: var(--text-muted);
}

.topbar-user-chevron {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

.topbar-user-dropdown {
    position: absolute;
    top: calc(100% + 0.55rem);
    right: 0;
    width: 250px;
    padding: 0.45rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-elevated);
    display: none;
    z-index: 2200;
}

[data-theme="dark"] .topbar-user-dropdown {
    background: rgba(26, 26, 26, 0.64);
}

.topbar-user-menu.open .topbar-user-dropdown {
    display: block;
}

.topbar-user-dropdown-head {
    padding: 0.65rem 0.65rem 0.55rem;
    border-bottom: 1px solid var(--separator-color);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.topbar-user-dropdown-name {
    font-size: 0.86rem;
    font-weight: 600;
    color: #0f172a;
}

[data-theme="dark"] .topbar-user-dropdown-name {
    color: #ffffff;
}

.topbar-user-dropdown-email,
.topbar-user-dropdown-info {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.topbar-user-dropdown-info {
    padding: 0.6rem 0.65rem;
    border-bottom: 1px solid var(--separator-color);
    display: grid;
    gap: 0.2rem;
}

.topbar-user-action {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.58rem 0.65rem;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.topbar-user-action .icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.topbar-user-action:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

[data-theme="dark"] .topbar-user-action:hover {
    background: #2a2a2a;
    color: #ffffff;
}

.topbar-user-logout {
    color: var(--danger);
}

.topbar-user-logout .icon {
    color: currentColor;
    stroke: currentColor;
}

.topbar-user-logout:hover {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

[data-theme="dark"] .topbar-user-logout,
[data-theme="dark"] .topbar-user-logout .icon,
[data-theme="dark"] .topbar-user-logout:hover,
[data-theme="dark"] .topbar-user-logout:hover .icon {
    color: var(--danger) !important;
    stroke: currentColor !important;
}

.topbar-user-logout:hover {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
}

.topbar-user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1.25rem 0 0;
}

.topbar-mobile-brand,
.sidebar-mobile-welcome {
    display: none;
}

.topbar-period-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    line-height: 1;
}

.topbar-period-icon .topbar-afternoon-icon {
    width: 24px;
    height: 24px;
    color: #f59e0b;
}

.topbar-info-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.topbar-greeting {
    font-size: 1.1rem;
    color: #afafaf;
    font-weight: 500;
    white-space: nowrap;
}

[data-theme="light"] .topbar-greeting {
    color: #171717;
}

.topbar-greeting strong {
    font-weight: 600;
    color: #ffffff;
}

[data-theme="light"] .topbar-greeting strong {
    color: #0f172a;
}

.topbar-date {
    font-size: 0.85rem;
    color: #afafaf;
    font-weight: 400;
    white-space: nowrap;
}

[data-theme="light"] .topbar-date {
    color: #64748b;
}

/* --- AVATAR DROPDOWN --- */
.avatar-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.avatar-dropdown .topbar-avatar {
    cursor: pointer;
    margin-left: 0.35rem;
}

.avatar-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    padding: 0.45rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-elevated);
    min-width: 260px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.2s ease;
    z-index: 200;
    cursor: default;
}

[data-theme="dark"] .avatar-dropdown-menu {
    background: rgba(26, 26, 26, 0.64);
}

.avatar-dropdown-menu {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-elevated);
}

[data-theme="dark"] .avatar-dropdown-menu {
    background: rgba(26, 26, 26, 0.64);
}

.avatar-dropdown.open .avatar-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 0.65rem 0.65rem 0.55rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 1px solid var(--separator-color);
}

.dropdown-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #9d9d9d;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 600;
    flex-shrink: 0;
}

.dropdown-header-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.dropdown-user-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.dropdown-header .dropdown-user-name {
    color: #171717;
}

[data-theme="dark"] .dropdown-header .dropdown-user-name {
    color: #ffffff;
}

.dropdown-user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background: var(--separator-color);
    margin: 0;
    display: none;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    width: 100%;
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    border-radius: 7px;
    transition:
        background 0.15s,
        color 0.15s;
}

.dropdown-item:first-of-type {
    border-radius: 7px;
}

.dropdown-item:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

.dropdown-item .icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.dropdown-item-logout {
    color: var(--danger);
    border-radius: 7px;
}

.dropdown-item-logout .icon {
    color: currentColor;
    stroke: currentColor;
}

.dropdown-item-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

[data-theme="dark"] .dropdown-item-logout,
[data-theme="dark"] .dropdown-item-logout .icon,
[data-theme="dark"] .dropdown-item-logout:hover,
[data-theme="dark"] .dropdown-item-logout:hover .icon {
    color: var(--danger) !important;
    stroke: currentColor !important;
}

[data-theme="dark"] .dropdown-item:hover {
    background: #1a1a1a;
    color: #fff;
}

[data-theme="dark"] .dropdown-item-logout:hover {
    background: rgba(239, 68, 68, 0.15);
}

[data-theme="dark"] a.sidebar-logout,
[data-theme="dark"] a.sidebar-logout svg,
[data-theme="dark"] .sidebar-user-logout,
[data-theme="dark"] .sidebar-user-logout svg,
[data-theme="dark"] .topbar-user-logout,
[data-theme="dark"] .topbar-user-logout svg,
[data-theme="dark"] .dropdown-item-logout,
[data-theme="dark"] .dropdown-item-logout svg {
    color: #ef4444 !important;
    stroke: #ef4444 !important;
}

/* --- SEARCH SPOTLIGHT --- */
.search-results-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 0.55rem);
    left: 0;
    z-index: 500;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    background: var(--bg-card-right);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-elevated);
}

.topbar-search.search-open .search-results-dropdown {
    display: block;
}

[data-theme="dark"] .search-results-dropdown {
    background: rgba(17, 19, 24, 0.38);
    border-color: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.spotlight-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 22vh 1rem 1rem;
    background: rgba(15, 23, 42, 0.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.16s ease,
        visibility 0.16s ease;
}

.spotlight-overlay.visible {
    opacity: 1;
    visibility: visible;
}

body.sidebar-spotlight-open {
    overflow: hidden;
}

.spotlight-panel {
    width: min(680px, 100%);
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-elevated);
}

[data-theme="dark"] .spotlight-panel {
    background: rgba(17, 19, 24, 0.38);
    border-color: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.spotlight-search {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.spotlight-search .icon {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.spotlight-search input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.spotlight-search input::placeholder {
    color: var(--text-muted);
}

.spotlight-close {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0.72rem;
    width: 34px;
    height: 28px;
    transition:
        background 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease;
}

.spotlight-close:hover {
    background: var(--action-soft);
    border-color: var(--action-border);
    color: var(--action-text-soft);
}

.spotlight-close-hover {
    display: none;
}

.spotlight-close:hover .spotlight-close-idle {
    display: none;
}

.spotlight-close:hover .spotlight-close-hover {
    display: inline-flex;
}

.spotlight-close-hover .icon {
    width: 15px;
    height: 15px;
}

.spotlight-results {
    max-height: min(56vh, 430px);
    overflow-y: auto;
    padding: 0.45rem;
}

/* --- AI HELP POPUP --- */
.ai-help-overlay {
    position: fixed;
    inset: 0;
    z-index: 3100;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 18vh 1rem 1rem;
    background: rgba(15, 23, 42, 0.26);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.16s ease,
        visibility 0.16s ease;
}

.ai-help-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.ai-help-panel {
    width: min(620px, 100%);
    overflow: hidden;
    border: 1px solid rgba(37, 99, 235, 0.22);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-elevated);
}

[data-theme="dark"] .ai-help-panel {
    background: rgba(26, 26, 26, 0.9);
    border-color: rgba(147, 197, 253, 0.18);
}

.ai-help-panel-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid var(--separator-color);
}

.ai-help-avatar {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 8px;
    color: #2563eb;
    background: rgba(37, 99, 235, 0.1);
}

[data-theme="dark"] .ai-help-avatar {
    color: #bfdbfe;
    background: rgba(96, 165, 250, 0.13);
}

.ai-help-avatar .icon {
    width: 20px;
    height: 20px;
}

.ai-help-eyebrow {
    display: block;
    margin-bottom: 0.12rem;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ai-help-panel h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.25;
}

.ai-help-close {
    width: 32px;
    height: 32px;
    margin-left: auto;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    background: var(--input-bg);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ai-help-close:hover {
    background: var(--action-soft);
    color: var(--action-text-soft);
}

.ai-help-close .icon {
    width: 16px;
    height: 16px;
}

.ai-help-question {
    margin: 1rem 1rem 0;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.45;
}

.ai-help-answer {
    padding: 1rem;
}

.ai-help-answer h3 {
    margin: 0 0 0.55rem;
    color: var(--text-primary);
    font-size: 1.05rem;
    line-height: 1.3;
}

.ai-help-answer p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.ai-help-steps {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.9rem;
}

.ai-help-steps span {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    color: var(--text-primary);
    font-size: 0.82rem;
    line-height: 1.45;
}

.ai-help-steps span::before {
    content: "";
    width: 7px;
    height: 7px;
    margin-top: 0.42rem;
    border-radius: 50%;
    background: #171717;
    flex-shrink: 0;
}

[data-theme="dark"] .ai-help-steps span::before {
    background: #cccccc;
}

.ai-help-action {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 1rem;
    padding: 0.62rem 0.78rem;
    border-radius: 8px;
    background: #0f172a;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}

.ai-help-action:hover {
    color: #ffffff;
    background: #1e293b;
}

[data-theme="dark"] .ai-help-action {
    background: #f8fafc;
    color: #0f172a;
}

[data-theme="dark"] .ai-help-action:hover {
    color: #0f172a;
    background: #e2e8f0;
}

.ai-help-action .icon {
    width: 16px;
    height: 16px;
}

.spotlight-section-label {
    padding: 0.5rem 0.65rem 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.spotlight-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
    align-items: center;
    width: 100%;
    padding: 0.72rem 0.75rem;
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
}

.spotlight-item:hover,
.spotlight-item.active {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .spotlight-item:hover,
[data-theme="dark"] .spotlight-item.active {
    background: rgba(255, 255, 255, 0.08);
}

.spotlight-ticket-id {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.spotlight-ticket-main {
    min-width: 0;
}

.spotlight-ticket-title {
    display: block;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotlight-ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.spotlight-ticket-status {
    justify-self: end;
    font-size: 0.72rem;
}

.spotlight-empty {
    padding: 1.4rem 1rem;
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.85rem;
}

[data-theme="dark"] a.sidebar-logout:hover,
[data-theme="dark"] .sidebar-user-logout:hover,
[data-theme="dark"] .topbar-user-logout:hover,
[data-theme="dark"] .dropdown-item-logout:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
}

[data-theme="dark"] a.sidebar-logout:hover svg,
[data-theme="dark"] .sidebar-user-logout:hover svg,
[data-theme="dark"] .topbar-user-logout:hover svg,
[data-theme="dark"] .dropdown-item-logout:hover svg {
    background: transparent !important;
    color: #ef4444 !important;
    stroke: #ef4444 !important;
}

[data-theme="light"] a.sidebar-logout,
[data-theme="light"] a.sidebar-logout svg,
[data-theme="light"] .sidebar-user-logout,
[data-theme="light"] .sidebar-user-logout svg,
[data-theme="light"] .topbar-user-logout,
[data-theme="light"] .topbar-user-logout svg,
[data-theme="light"] .dropdown-item-logout,
[data-theme="light"] .dropdown-item-logout svg {
    color: #ef4444 !important;
    stroke: #ef4444 !important;
}

[data-theme="light"] a.sidebar-logout:hover,
[data-theme="light"] .sidebar-user-logout:hover,
[data-theme="light"] .topbar-user-logout:hover,
[data-theme="light"] .dropdown-item-logout:hover {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #ef4444 !important;
}

[data-theme="light"] a.sidebar-logout:hover svg,
[data-theme="light"] .sidebar-user-logout:hover svg,
[data-theme="light"] .topbar-user-logout:hover svg,
[data-theme="light"] .dropdown-item-logout:hover svg {
    background: transparent !important;
    color: #ef4444 !important;
    stroke: #ef4444 !important;
}

/* --- MAIN CONTENT --- */
.app-main {
    flex: 1;
    min-width: 0;
    margin-left: 250px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.app-content {
    padding: 2.35rem 1.5rem 1.5rem;
    flex: 1;
}

/* --- PAGE HEADER --- */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 0 0 0.5rem;
    border-bottom: 1px solid var(--separator-color);
    flex-wrap: wrap;
}

.page-header-left h1 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.page-header-left p {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.page-header-right {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding-top: 2.45rem;
}

.page-header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.page-header-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.page-header-breadcrumb a:hover {
    color: var(--accent);
}

.page-header-breadcrumb .sep {
    color: var(--border-color);
}

.page-header-breadcrumb span:last-child {
    color: var(--text-secondary);
}

.page-header-center {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
    margin-left: auto;
    padding-right: 1rem;
}

.welcome-greeting {
    font-size: 0.88rem;
    color: var(--text-primary);
    font-weight: 500;
}

.welcome-greeting strong {
    font-weight: 600;
    color: var(--accent);
}

.header-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1;
}

.btn .icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--action-bg);
    border: 1px solid var(--action-border);
    color: var(--action-text);
    box-shadow: none;
}

.btn-primary:hover {
    background: var(--action-bg-hover);
    border-color: var(--action-border);
    box-shadow: none;
}

.page-header-right .btn {
    margin-top: 0;
    background: var(--action-bg);
    border: 1px solid var(--action-border);
    color: var(--action-text);
    box-shadow: none;
}

.page-header-right .btn .icon {
    transition: transform 0.2s ease;
    transform-origin: center;
}

.page-header-right .btn:hover {
    background: var(--action-bg-hover);
    border-color: var(--action-border);
    color: var(--action-text);
    box-shadow: none;
}

.page-header-right .btn:hover .icon {
    transform: scale(1.14);
}

.btn-outline {
    background: none;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--action-soft);
    border-color: var(--action-border);
    color: var(--action-text-soft);
}

.btn-ghost {
    background: none;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--action-soft);
    color: var(--action-text-soft);
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.78rem;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

/* --- STATS CARDS --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .85rem;
    margin-bottom: 1.3rem;
}

.stat-card {
    min-height: 106px;
    background: var(--bg-card-right);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 3.8rem .9rem 1rem;
    position: relative;
    overflow: hidden;
    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease;
}

[data-theme="light"] .stat-card {
    border-color: rgba(15, 23, 42, 0.09);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.stat-card:hover {
    border-color: rgba(15, 23, 42, 0.16);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

[data-theme="dark"] .stat-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.stat-info,
.stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    min-width: 0;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 650;
    line-height: 1.25;
}

.stat-value,
.stat-content strong {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.stat-value-sm {
    font-size: 1.2rem;
}

.stat-icon,
.stat-icon-box {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.25s ease;
}

.stat-icon svg,
.stat-icon-box svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.15;
}



.stat-icon-blue {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent);
}

.stat-icon-amber {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.stat-icon-orange {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.stat-icon-purple {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.stat-icon-green {
    background: rgba(22, 163, 74, 0.1);
    color: var(--success);
}

.stat-icon-red {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stat-change {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1.2;
    margin-top: 0.55rem;
    padding: 0.22rem 0.48rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.055);
    color: var(--text-muted);
}

[data-theme="dark"] .stat-change {
    background: rgba(255, 255, 255, 0.06);
}

.stat-up {
    color: var(--success);
    background: rgba(22, 163, 74, 0.1);
}
.stat-down {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* --- CONTENT CARDS --- */
.content-card {
    background: var(--bg-card-right);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: visible;
    transition: box-shadow 0.25s ease;
}

.content-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    gap: 0.75rem;
    flex-wrap: wrap;
}

.content-card-header h2 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.content-card-body {
    padding: 1rem 1.25rem;
    border-radius: 0 0 12px 12px;
    overflow: visible;
}

.content-card-body[style*="padding:0"] {
    overflow: hidden;
}

.card-link {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
}

.card-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* --- DASHBOARD GRID --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 1rem;
}

.dashboard-grid .content-card-table {
    grid-column: 1 / -1;
}

/* --- TABLES --- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.data-table thead th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--separator-color);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid var(--separator-color);
    color: var(--text-secondary);
    vertical-align: middle;
}

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

.data-table tbody tr:hover {
    background: var(--accent-soft);
}

[data-theme="light"] .data-table tbody tr:hover {
    background: #E5E8EB;
}

[data-theme="light"] .data-table tbody tr:hover td,
[data-theme="light"] .data-table tbody tr:hover .cell-subject a,
[data-theme="light"] .data-table tbody tr:hover .cell-subject a:hover,
[data-theme="light"] .data-table tbody tr:hover .category-name strong,
[data-theme="light"] .data-table tbody tr:hover .category-name span:not(.category-dot) {
    color: #0f172a;
}

[data-theme="dark"] .data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.data-table tbody tr.clickable {
    cursor: pointer;
}

.cell-id {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

.cell-subject {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 180px;
}

.cell-subject a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
}

.cell-subject a:hover {
    color: #ffffff;
}

.cell-sub-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.cell-date {
    white-space: nowrap;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.cell-user {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cell-avatar {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* --- BADGES / TAGS --- */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.tag-open {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}
.tag-progress {
    background: var(--accent-soft);
    color: var(--accent);
}
.tag-done {
    background: rgba(22, 163, 74, 0.1);
    color: var(--success);
}
.tag-cancel {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}
.tag-high {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}
.tag-medium {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}
.tag-low {
    background: rgba(22, 163, 74, 0.1);
    color: var(--success);
}
.tag-custom {
    background: var(--accent-soft);
    color: var(--accent);
}

/* --- STATUS BAR --- */
.status-summary {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.status-count {
    margin-left: auto;
    font-weight: 600;
    color: var(--text-primary);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot-open {
    background: #f59e0b;
}
.status-dot-progress {
    background: var(--accent);
}
.status-dot-done {
    background: var(--success);
}
.status-dot-cancel {
    background: var(--danger);
}

.status-bar-group {
    display: flex;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.status-bar-fill {
    transition: width 0.5s ease;
}
.sbar-open {
    background: #f59e0b;
}
.sbar-progress {
    background: var(--accent);
}
.sbar-done {
    background: var(--success);
}
.sbar-cancel {
    background: var(--danger);
}

.status-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.3rem;
    vertical-align: middle;
}

/* --- PRIORITY BARS --- */
.priority-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.priority-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.priority-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.priority-label {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 5px;
}

.priority-label-high {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}
.priority-label-medium {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}
.priority-label-low {
    background: rgba(22, 163, 74, 0.1);
    color: var(--success);
}

.priority-count {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.priority-track {
    width: 100%;
    height: 6px;
    background: var(--input-bg);
    border-radius: 3px;
    overflow: hidden;
}

.priority-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.pfill-high {
    background: #ef4444;
}
.pfill-medium {
    background: #f59e0b;
}
.pfill-low {
    background: var(--success);
}

/* --- QUICK ACTIONS --- */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
}

.quick-action:hover {
    background: var(--action-soft);
    border-color: var(--text-muted);
    color: var(--action-text-soft);
}

[data-theme="dark"] .quick-action:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.quick-action .icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* --- CHARTS (CSS) --- */
.chart-monthly {
    display: flex;
    align-items: flex-end;
    gap: 0.4rem;
    height: 110px;
    padding-top: 0.5rem;
}

.chart-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar-fill {
    width: 100%;
    max-width: 28px;
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.5s ease;
    background: var(--accent);
}

.chart-bar-fill.alt {
    background: var(--accent-soft);
}

.chart-bar-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- FORMS --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.form-label .required {
    color: var(--danger);
    margin-left: 0.15rem;
}

.form-control {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.42);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    transition: all 0.2s;
    outline: none;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.form-control:hover {
    border-color: var(--border-color);
    background: rgba(255, 255, 255, 0.55);
}

.form-control:focus {
    border-color: var(--border-color);
    box-shadow: var(--shadow-elevated);
    background: rgba(255, 255, 255, 0.62);
}

[data-theme="dark"] .form-control {
    border-color: var(--border-color);
    background: rgba(26, 26, 26, 0.42);
    color: var(--text-primary);
}

[data-theme="dark"] .form-control:hover {
    border-color: var(--border-color);
    background: rgba(26, 26, 26, 0.55);
}

[data-theme="dark"] .form-control:focus {
    border-color: var(--border-color);
    background: rgba(26, 26, 26, 0.62);
    box-shadow: var(--shadow-elevated);
}

.form-control::placeholder {
    color: var(--text-secondary);
    opacity: 1;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.25rem;
}

select.form-control option {
    background: var(--bg-card-right);
    color: var(--text-primary);
}

[data-theme="dark"] select.form-control option {
    background: #1a1a1a;
    color: #e0e0e0;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.ticket-description-simple {
    min-height: 220px;
    line-height: 1.6;
}

.rich-editor-surface {
    width: 100%;
    padding: 0.75rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    overflow-y: auto;
}

.rich-editor-surface:empty::before {
    content: attr(data-placeholder);
    color: var(--text-secondary);
    pointer-events: none;
}

.rich-editor-surface a {
    color: var(--accent);
    text-decoration: underline;
}

.rich-editor-surface img {
    max-width: 100%;
    border-radius: 8px;
    display: block;
    margin: 0.5rem 0;
}

.rich-text-editor {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.42);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

[data-theme="dark"] .rich-text-editor {
    background: rgba(26, 26, 26, 0.42);
}

.rich-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-wrap: wrap;
    padding: 0.4rem;
    border-bottom: 1px solid var(--separator-color);
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .rich-editor-toolbar {
    background: rgba(255, 255, 255, 0.04);
}

.rich-tool {
    min-width: 30px;
    height: 30px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0 0.45rem;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.rich-tool:hover,
.rich-tool.active {
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .rich-tool:hover,
[data-theme="dark"] .rich-tool.active {
    background: rgba(255, 255, 255, 0.1);
}

.rich-tool .icon {
    width: 17px;
    height: 17px;
}

.rich-tool[data-format="clear"] span {
    font-size: 0.65rem;
    transform: translate(-2px, 5px);
}

.rich-italic {
    font-style: italic;
}

.rich-underline {
    text-decoration: underline;
}

.rich-select {
    height: 30px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.82rem;
    padding: 0 1.4rem 0 0.5rem;
    cursor: pointer;
}

.rich-select:hover {
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .rich-select:hover {
    background: rgba(255, 255, 255, 0.1);
}

.rich-separator {
    width: 1px;
    height: 24px;
    margin: 0 0.25rem;
    background: var(--separator-color);
}

.rich-text-editor .ticket-description-simple {
    border: 0;
    border-radius: 0;
    background: transparent;
}

.rich-text-editor .ticket-description-simple:hover,
.rich-text-editor .ticket-description-simple:focus {
    background: transparent;
    box-shadow: none;
}

.editor-modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s ease;
}

.editor-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.editor-modal-card {
    width: min(460px, 100%);
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-card-right);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    padding: 2.5rem 2rem;
    transform: translateY(20px) scale(0.96);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .editor-modal-card {
    background: var(--bg-modal);
    border-color: #3a3e46;
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.58);
}

.editor-modal-overlay.visible .editor-modal-card {
    transform: translateY(0) scale(1);
}

.editor-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--input-bg);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.editor-modal-close:hover {
    background: var(--social-hover);
    color: var(--text-primary);
}

[data-theme="dark"] .editor-modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.editor-modal-close .icon {
    width: 18px;
    height: 18px;
}

.editor-modal-header {
    padding-right: 2.25rem;
    margin-bottom: 1rem;
}

.editor-modal-header h2 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.editor-modal-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.editor-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    padding-top: 0.25rem;
}

.category-modal-card {
    width: min(560px, 100%);
}

.category-modal-card .editor-modal-header {
    display: grid;
    grid-template-columns: 40px 1fr;
    align-items: center;
    gap: 0.85rem;
    padding-right: 2.25rem;
    margin-bottom: 1.25rem;
}

.category-modal-card .editor-modal-header h2,
.category-modal-card .editor-modal-header p {
    grid-column: 2;
}

.category-modal-card .editor-modal-header h2 {
    align-self: end;
}

.category-modal-card .editor-modal-header p {
    align-self: start;
}

.category-modal-icon {
    grid-row: 1 / span 2;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: var(--accent-soft);
    color: var(--accent);
}

.category-modal-icon .icon {
    width: 20px;
    height: 20px;
}

.category-modal-card .form-group {
    margin-bottom: 1rem;
}

.category-modal-card .form-control.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.category-modal-card .editor-modal-actions {
    margin-top: 0.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--separator-color);
}

.category-modal-card .custom-select-menu { min-width: 100%; background: #f8fafc; backdrop-filter: none; -webkit-backdrop-filter: none; }
[data-theme="dark"] .category-modal-card .custom-select-menu { background: var(--bg-modal); }
.category-modal-card .custom-select-option { padding: .58rem .7rem; }
.category-modal-card .custom-select-option .icon { width: 16px; height: 16px; flex: 0 0 16px; margin-right: .45rem; color: var(--text-muted); }
.category-modal-card .category-selected-icon { width: 17px; height: 17px; flex: 0 0 17px; color: var(--text-muted); }
.category-modal-info { display: flex; align-items: flex-start; gap: .5rem; margin-bottom: 1rem; padding: .65rem .7rem; border: 1px solid var(--accent-soft); border-radius: 6px; background: var(--action-soft); color: var(--text-muted); font-size: 11px; line-height: 1.4; }
.category-modal-info .icon { width: 16px; height: 16px; flex: 0 0 16px; color: var(--action-bg); }
[data-theme="dark"] .category-modal-info { border-color: rgba(255, 255, 255, .12); }
[data-theme="dark"] .category-modal-info .icon { color: var(--action-text); }

.modal-color-picker {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: 0 .55rem;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background: var(--input-bg);
    transition: border-color .18s, box-shadow .18s;
}
.modal-color-picker:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.modal-color-picker > button {
    position: relative;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 50%;
    background: var(--picker-color);
    cursor: pointer;
    transition: transform .18s, box-shadow .18s;
}

.modal-color-picker > button:hover {
    transform: scale(1.12);
}

.modal-color-picker > button.active {
    border-color: var(--input-bg-focus);
    box-shadow: 0 0 0 2px var(--picker-color);
}
[data-theme="dark"] .modal-color-picker:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.modal-color-custom {
    position: relative;
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    overflow: hidden;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background: color-mix(in srgb, var(--picker-color, #171717) 30%, var(--input-bg));
    color: var(--picker-color, #171717);
    cursor: pointer;
    transition: border-color .18s, box-shadow .18s;
}
.modal-color-custom:hover { border-color: var(--text-muted); }

.modal-color-custom.active {
    border-color: var(--picker-color, #171717);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--picker-color, #171717) 24%, transparent);
}

.modal-color-custom input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.modal-color-custom .icon {
    width: 15px;
    height: 15px;
    pointer-events: none;
}
[data-theme="dark"] .modal-color-custom { background: color-mix(in srgb, var(--picker-color, #d4d4d4) 30%, #1a1a1a); color: var(--action-text); }

.article-modal-card {
    width: min(680px, 100%);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding: 1.45rem 1.6rem;
}

.article-modal-card .editor-modal-header {
    margin-bottom: 1rem;
}
.article-modal-card .form-group { margin-bottom: .75rem; }
.article-modal-card .custom-select-menu { min-width: 100%; background: #f8fafc; backdrop-filter: none; -webkit-backdrop-filter: none; }
[data-theme="dark"] .article-modal-card .custom-select-menu { background: var(--bg-modal); }
.article-modal-card .custom-select-option { padding: .58rem .7rem; }
.article-content-field { min-height: 92px; resize: vertical; }
.article-modal-card .tabler-icon-picker-popover { top: auto; bottom: calc(100% + 6px); }
.article-modal-card .editor-modal-actions { margin-top: .15rem; padding-top: .8rem; border-top: 1px solid var(--separator-color); }
.article-modal-card .editor-modal-actions .icon { width: 15px; height: 15px; }
.knowledge-article-icon > .ti { font-size: 19px; }

.tabler-icon-picker {
    position: relative;
    min-width: 0;
}

.tabler-icon-picker.open {
    z-index: 2600;
}

.tabler-icon-picker-trigger {
    width: 100%;
    height: 38px;
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: 0 .75rem;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    outline: 0;
    background: var(--input-bg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: .72rem;
    text-align: left;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
}

.tabler-icon-picker-trigger:hover {
    border-color: var(--text-muted);
}

.tabler-icon-picker.open .tabler-icon-picker-trigger,
.tabler-icon-picker-trigger:focus-visible {
    border-color: var(--action-bg);
    box-shadow: 0 0 0 3px var(--action-soft);
}

.tabler-icon-picker-trigger > i {
    width: 18px;
    flex: 0 0 18px;
    color: var(--action-bg);
    font-size: 18px;
    text-align: center;
}

.tabler-icon-picker-trigger > span {
    min-width: 0;
    overflow: hidden;
    flex: 1 1 auto;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tabler-icon-picker-trigger > .icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    color: var(--text-muted);
    transition: transform .2s;
}

.tabler-icon-picker.open .tabler-icon-picker-trigger > .icon {
    transform: rotate(180deg);
}

.tabler-icon-picker-popover {
    position: absolute;
    z-index: 2700;
    top: calc(100% + 6px);
    left: 0;
    width: min(430px, calc(100vw - 3rem));
    display: none;
    padding: .65rem;
    border: 1px solid var(--input-border);
    border-radius: 9px;
    background: #f8fafc;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .2);
}

.tabler-icon-picker.open .tabler-icon-picker-popover {
    display: block;
}

[data-theme="dark"] .tabler-icon-picker-popover {
    background: #1a1a1a;
    box-shadow: 0 20px 46px rgba(0, 0, 0, .5);
}

.tabler-icon-picker-search {
    height: 36px;
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: 0 .65rem;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-muted);
}

.tabler-icon-picker-search:focus-within {
    border-color: var(--action-bg);
    box-shadow: 0 0 0 3px var(--action-soft);
}

.tabler-icon-picker-search .icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}

.tabler-icon-picker-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    font-size: 12px;
}

.tabler-icon-picker-grid {
    height: 284px;
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    align-content: start;
    gap: .3rem;
    margin-top: .6rem;
    overflow: hidden;
}

.tabler-icon-picker-option {
    min-width: 0;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

.tabler-icon-picker-option i {
    font-size: 20px;
}

.tabler-icon-picker-option span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.tabler-icon-picker-option:hover {
    background: #e5e8eb;
    color: var(--text-primary);
}

[data-theme="dark"] .tabler-icon-picker-option:hover {
    background: rgba(255, 255, 255, .06);
}

.tabler-icon-picker-option.active {
    border-color: rgba(37, 99, 235, .3);
    background: var(--action-soft);
    color: var(--action-bg);
}

.tabler-icon-picker-popover > footer {
    min-height: 34px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: .7rem;
    margin-top: .45rem;
    padding-top: .45rem;
    border-top: 1px solid var(--separator-color);
    color: var(--text-muted);
    font-size: 10px;
}

.tabler-icon-picker-popover > footer > div {
    display: flex;
    gap: .35rem;
}

.tabler-icon-picker-popover > footer button {
    width: 29px;
    height: 29px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    background: var(--input-bg);
    color: var(--text-secondary);
    cursor: pointer;
}

.tabler-icon-picker-popover > footer button:hover:not(:disabled) {
    background: #e5e8eb;
}

[data-theme="dark"] .tabler-icon-picker-popover > footer button:hover:not(:disabled) {
    background: rgba(255, 255, 255, .06);
}

.tabler-icon-picker-popover > footer button:disabled {
    opacity: .4;
    cursor: default;
}

.tabler-icon-picker-popover > footer .icon {
    width: 15px;
    height: 15px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding-top: 1rem;
    border-top: 1px solid var(--separator-color);
    margin-top: 0.5rem;
}

.ticket-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 1.25rem;
    align-items: start;
}

.ticket-form-main,
.ticket-form-side {
    min-width: 0;
}

.ticket-form-side {
    display: grid;
    gap: 1rem;
}

.side-panel {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.42);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

[data-theme="dark"] .side-panel {
    background: rgba(26, 26, 26, 0.42);
}

.side-panel h3 {
    margin: 0 0 0.85rem;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ticket-editor {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.42);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

[data-theme="dark"] .ticket-editor {
    background: rgba(26, 26, 26, 0.42);
}

.editor-toolbar,
.editor-templates {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    padding: 0.45rem;
    border-bottom: 1px solid var(--separator-color);
}

.editor-templates {
    border-top: 1px solid var(--separator-color);
    border-bottom: 0;
}

.editor-tool,
.template-chip {
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.45rem 0.6rem;
    cursor: pointer;
}

.editor-tool:hover,
.template-chip:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

[data-theme="dark"] .editor-tool:hover,
[data-theme="dark"] .template-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.ticket-description {
    min-height: 220px;
    border: 0;
    border-radius: 0;
    background: transparent;
    resize: vertical;
}

.ticket-description:hover,
.ticket-description:focus {
    background: transparent;
    box-shadow: none;
}

.attachment-dropzone {
    min-height: 132px;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.42);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 1.2rem;
    color: var(--text-secondary);
    text-align: center;
    cursor: pointer;
}

[data-theme="dark"] .attachment-dropzone {
    background: rgba(26, 26, 26, 0.42);
}

.attachment-dropzone:hover,
.attachment-dropzone.drag-over {
    border-color: var(--text-muted);
    background: rgba(255, 255, 255, 0.55);
}

[data-theme="dark"] .attachment-dropzone:hover,
[data-theme="dark"] .attachment-dropzone.drag-over {
    background: rgba(26, 26, 26, 0.55);
}

.attachment-dropzone input {
    display: none;
}

.attachment-dropzone-compact {
    min-height: 118px;
}

.attachment-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

[data-theme="dark"] .attachment-icon {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.attachment-icon .icon {
    width: 18px;
    height: 18px;
}

.attachment-main {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-primary);
}

.attachment-sub {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.attachment-list {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.6rem;
}

.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.attachment-item strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
    font-weight: 600;
}

.ticket-tags {
    display: grid;
    gap: 0.55rem;
}

.ticket-tags label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
}

.category-table .btn {
    white-space: nowrap;
}

.category-name {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.category-name strong {
    display: block;
    font-size: 0.84rem;
    color: var(--text-primary);
}

.category-name span:not(.category-dot) {
    display: block;
    color: var(--text-muted);
    font-size: 0.72rem;
    margin-top: 0.12rem;
}

.category-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.category-dot-infra {
    background: #a0a0a0;
}

.category-dot-access {
    background: #22c55e;
}

.category-dot-mail {
    background: #a78bfa;
}

.category-dot-security {
    background: #ef4444;
}

.category-dot-finance {
    background: #f59e0b;
}

.category-dot-hardware { background: #06b6d4; }
.category-dot-software { background: #8b5cf6; }
.category-dot-network { background: #3b82f6; }
.category-dot-register { background: #14b8a6; }
.category-dot-reports { background: #ec4899; }
.category-dot-phone { background: #64748b; }

.tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
}

.tag-success {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
}

.tag-warning {
    background: rgba(245, 158, 11, 0.14);
    color: #f59e0b;
}

.tag-muted {
    background: rgba(148, 163, 184, 0.14);
    color: var(--text-muted);
}

/* --- FILTER BAR --- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.filter-bar .form-control {
    width: auto;
    min-width: 150px;
}

.custom-select {
    position: relative;
    min-width: 150px;
    width: 100%;
    z-index: 20;
}

.custom-select.open {
    z-index: 2400;
}

.custom-select-trigger {
    width: 100%;
    min-width: 150px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.7);
    text-align: left;
    cursor: pointer;
}

.custom-select-trigger:hover {
    background: rgba(255, 255, 255, 0.82);
}

[data-theme="dark"] .custom-select-trigger {
    background: rgba(26, 26, 26, 0.64);
}

[data-theme="dark"] .custom-select-trigger:hover {
    background: rgba(26, 26, 26, 0.72);
}

.filter-bar .custom-select-trigger {
    width: 100%;
}

.custom-select-trigger .icon {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s ease !important;
}

.custom-select.open .custom-select-trigger .icon {
    transform: rotate(180deg);
}

.custom-select-menu {
    position: absolute;
    top: calc(100% + 0.6rem);
    left: 0;
    width: 100%;
    min-width: 190px;
    padding: 0.45rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-elevated);
    display: none;
    z-index: 2400;
}

[data-theme="dark"] .custom-select-menu {
    background: rgba(26, 26, 26, 0.64);
}

.custom-select.open .custom-select-menu {
    display: block;
}

.custom-select-option {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0.75rem 0.85rem;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.custom-select-option:hover,
.custom-select-option.active {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

[data-theme="dark"] .custom-select-option:hover,
[data-theme="dark"] .custom-select-option.active {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.filter-bar .search-input {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    min-width: 200px;
}

.filter-bar .search-input:focus-within {
    border-color: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .filter-bar .search-input:focus-within {
    border-color: #aaa;
    background: var(--input-bg-focus);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.filter-bar .search-input input {
    border: none;
    background: none;
    outline: none;
    font-family: inherit;
    font-size: 0.82rem;
    color: var(--text-primary);
    width: 100%;
}

.filter-bar .search-input input::placeholder {
    color: var(--text-secondary);
    opacity: 1;
}

.filter-bar .search-input .icon {
    width: 15px;
    height: 15px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

[data-theme="dark"] .filter-bar .search-input:focus-within .icon {
    color: #aaa;
}

[data-theme="dark"] .filter-bar .search-input:hover .icon {
    color: rgba(255, 255, 255, 0.75);
}

.filter-tabs {
    display: flex;
    gap: 0.15rem;
    background: var(--input-bg);
    border-radius: 8px;
    padding: 0.2rem;
}

.filter-tab {
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.filter-tab:hover {
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--bg-card-right);
    color: var(--action-text-soft);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* --- TICKET DETAIL --- */
.ticket-detail-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.ticket-detail-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.ticket-detail-meta .tag {
    font-size: 0.78rem;
}

.ticket-desc {
    background: var(--input-bg);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.timeline-item {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 0;
    position: relative;
}

.timeline-item:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 13px;
    top: 44px;
    bottom: 0;
    width: 2px;
    background: var(--separator-color);
}

.timeline-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: #fff;
    margin-top: 0.1rem;
}

.timeline-dot.agent {
    background: var(--accent);
}
.timeline-dot.client {
    background: #f59e0b;
}
.timeline-dot.system {
    background: var(--text-muted);
}

.timeline-content {
    flex: 1;
    min-width: 0;
}

.timeline-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
}

.timeline-author {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-role {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--accent-soft);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.timeline-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: auto;
}

.timeline-text {
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.timeline-text p {
    margin-bottom: 0.4rem;
}

.reply-box {
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
    margin-top: 0.5rem;
}

.reply-box h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

/* --- CLIENT CARDS --- */
.client-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.client-card {
    background: var(--bg-card-right);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.2s;
}

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

.client-card-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.client-avatar-lg {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    flex-shrink: 0;
}

.client-info h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.client-info span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.client-details {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.client-details span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.client-details .icon {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.client-tickets {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.6rem;
    border-top: 1px solid var(--separator-color);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.client-tickets strong {
    color: var(--text-primary);
}

/* --- KNOWLEDGE BASE --- */
.kb-category {
    margin-bottom: 2rem;
}

.kb-category-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kb-category-title .icon {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

.kb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.kb-card {
    background: var(--bg-card-right);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    text-decoration: none;
    transition: all 0.2s;
    display: block;
}

.kb-card:hover {
    border-color: var(--text-muted);
    box-shadow: var(--shadow-elevated);
}

.kb-card h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.kb-card p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.kb-card-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.6rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* --- HELP PAGE --- */
.help-hero {
    margin-bottom: 1rem;
}

.help-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: 1rem;
    align-items: center;
}

.help-eyebrow {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.help-hero h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.45rem;
}

.help-hero p,
.help-muted {
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.help-search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card-right);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    transition:
        border-color 0.2s,
        background 0.2s;
}

.help-search-box:focus-within {
    border-color: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .help-search-box:focus-within {
    border-color: #aaa;
    background: #1a1a1a;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .help-search-box:focus-within .icon,
[data-theme="dark"] .help-search-box:focus-within .kbd-hint {
    color: #aaa;
}

[data-theme="dark"] .help-search-box:hover .icon,
[data-theme="dark"] .help-search-box:hover .kbd-hint {
    color: rgba(255, 255, 255, 0.75);
}

.help-search-box .icon {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.help-search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.help-search-box input::placeholder {
    color: var(--text-secondary);
}

.help-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.help-card {
    display: block;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-card-right);
    color: var(--text-secondary);
    text-decoration: none;
}

.help-card:hover {
    border-color: var(--text-muted);
    box-shadow: var(--shadow-elevated);
}

.help-card .icon {
    width: 22px;
    height: 22px;
    color: var(--text-secondary);
    margin-bottom: 0.65rem;
}

.help-card h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.help-card p {
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.help-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 1rem;
    align-items: start;
}

.help-main,
.help-aside {
    display: grid;
    gap: 1rem;
}

.help-section {
    scroll-margin-top: 90px;
}

.help-steps {
    margin-left: 1.25rem;
    display: grid;
    gap: 0.65rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.6;
}

.help-steps strong,
.help-topic-list h3 {
    color: var(--text-primary);
}

.help-topic-list {
    display: grid;
    gap: 0.75rem;
}

.help-topic-list article {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--separator-color);
}

.help-topic-list article:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.help-topic-list h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.help-topic-list p,
.help-faq p {
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.help-table {
    display: grid;
    gap: 0.5rem;
}

.help-table div {
    display: grid;
    grid-template-columns: 90px 80px minmax(0, 1fr);
    gap: 0.75rem;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--separator-color);
}

.help-table div:last-child {
    border-bottom: 0;
}

.help-table span,
.help-table strong {
    color: var(--text-primary);
    font-size: 0.82rem;
}

.help-table em {
    font-style: normal;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

.help-faq {
    display: grid;
    gap: 0.5rem;
}

.help-faq details {
    border-bottom: 1px solid var(--separator-color);
    padding-bottom: 0.65rem;
}

.help-faq summary {
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 700;
}

.help-faq p {
    margin-top: 0.45rem;
}

.help-status {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.45rem;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.help-status span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--success);
}

.help-contact-list,
.help-shortcuts {
    display: grid;
    gap: 0.55rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.help-contact-list a {
    color: var(--text-secondary);
}

.help-contact-list a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.help-shortcuts span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.help-shortcuts kbd {
    min-width: 22px;
    padding: 0.12rem 0.35rem;
    border-radius: 5px;
    background: var(--social-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.68rem;
    text-align: center;
}

@media (max-width: 900px) {
    .help-hero-grid,
    .help-layout {
        grid-template-columns: 1fr;
    }

    .help-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .help-grid,
    .help-table div {
        grid-template-columns: 1fr;
    }
}

/* --- EMPTY STATE --- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
}

.empty-state .icon {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    opacity: 0.4;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.empty-state p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* --- PAGINATION --- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 1rem 0;
}

.page-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: none;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-family: inherit;
}

.page-btn .icon {
    width: 16px;
    height: 16px;
}

.page-arrow {
    background: var(--bg-card-right);
    color: var(--text-muted);
}

.page-arrow:not(:disabled):hover .icon {
    transform: translateX(1px);
}

.page-arrow:first-child:not(:disabled):hover .icon {
    transform: translateX(-1px);
}

.page-arrow .icon {
    transition: transform 0.2s ease;
}

.page-btn:not(:disabled):hover {
    border-color: var(--text-muted);
    color: #ffffff;
}

[data-theme="light"] .page-btn:not(:disabled):hover {
    background: #E5E8EB;
    border-color: #E5E8EB;
    color: #0f172a;
}

.page-btn.active {
    background: var(--action-bg);
    border-color: var(--action-bg);
    color: var(--action-text);
}

[data-theme="light"] .page-btn.active,
[data-theme="light"] .page-btn.active:hover {
    background: #171717;
    border-color: #171717;
    color: #ffffff;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .ticket-form-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar .search-input {
        min-width: 0;
    }

    .filter-bar .form-control {
        width: 100%;
    }

    .filter-tabs {
        overflow-x: auto;
        width: 100%;
    }
}

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

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

    .sidebar-overlay.visible {
        display: block;
    }

    .app-main {
        margin-left: 0;
    }

    .topbar-toggle {
        display: flex;
    }

    .topbar-breadcrumb {
        display: none;
    }

    .page-header {
        flex-direction: column;
    }

    .page-header-right {
        width: 100%;
        padding-top: 0;
    }

    .app-content {
        padding: 1rem;
    }

    .client-grid {
        grid-template-columns: 1fr;
    }

    .kb-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody tr {
        display: block;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--separator-color);
    }

    .data-table tbody td {
        display: flex;
        align-items: center;
        padding: 0.3rem 0.75rem;
        border: none;
    }

    .data-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.7rem;
        color: var(--text-muted);
        width: 80px;
        flex-shrink: 0;
        text-transform: uppercase;
    }

    .topbar-search {
        max-width: none;
    }

    .ticket-detail-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 900px) {
    .topbar-actions { z-index: 120; }
    .topbar-actions .avatar-dropdown { display: flex; align-items: center; }
    .topbar-actions .topbar-avatar {
        display: grid;
        width: 34px;
        height: 34px;
        margin-left: 0;
        place-items: center;
        border: 1px solid var(--border-color);
        border-radius: 50%;
        background: var(--action-bg);
        color: var(--text-primary);
        font-size: .72rem;
        font-weight: 800;
    }
    .topbar-actions .topbar-avatar:hover,
    .topbar-actions .avatar-dropdown.open .topbar-avatar {
        border-color: var(--accent);
        background: var(--action-soft);
    }
    .topbar-avatar-menu {
        position: fixed;
        right: auto;
        width: min(300px, calc(100vw - 1rem));
        min-width: 0;
        z-index: 10000;
        overflow: visible;
        background: rgba(255, 255, 255, .94);
        backdrop-filter: blur(20px) saturate(145%);
        -webkit-backdrop-filter: blur(20px) saturate(145%);
    }
    .topbar-avatar-menu.portal-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    .topbar-avatar-menu::before {
        position: absolute;
        top: -7px;
        left: var(--avatar-arrow-left, calc(100% - 24px));
        width: 13px;
        height: 13px;
        content: "";
        border-top: 1px solid var(--border-color);
        border-left: 1px solid var(--border-color);
        background: rgba(255, 255, 255, .94);
        transform: rotate(45deg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    [data-theme="dark"] .topbar-avatar-menu {
        background: rgba(26, 28, 33, .94);
        backdrop-filter: blur(20px) saturate(145%);
        -webkit-backdrop-filter: blur(20px) saturate(145%);
    }
    [data-theme="dark"] .topbar-avatar-menu::before {
        background: rgba(26, 28, 33, .94);
    }
    .topbar-avatar-menu .topbar-online-status { color: #16a34a; font-weight: 700; }
}

@media (min-width: 901px) {
    .topbar-actions .avatar-dropdown,
    .topbar-avatar-menu { display: none !important; }
}

/* ============================================
   SETTINGS / CONFIGURAÇÕES
   ============================================ */

.page-header-settings {
    padding-bottom: 0.5rem;
}

.settings-tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--input-bg);
    border-radius: 10px;
    padding: 0.3rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.settings-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.9rem;
    border-radius: 7px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.settings-tab:hover {
    background: var(--action-soft);
    color: var(--action-bg);
}

.settings-tab.active {
    background: var(--action-soft);
    color: var(--action-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    font-weight: 600;
}

.settings-tab .icon {
    width: 16px;
    height: 16px;
    color: currentColor;
}

[data-theme="dark"] .settings-tab:hover,
[data-theme="dark"] .settings-tab.active {
    color: var(--action-text);
}

.settings-panel {
    display: none;
    animation: fadeSlideIn 0.3s ease;
}

.settings-panel.active {
    display: block;
}

.settings-card {
    background: var(--bg-card-right);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.settings-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-card-header h2 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.settings-card-header p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

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

.card-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

/* --- TOGGLE --- */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--separator-color);
}

.toggle-row:last-child {
    border-bottom: none;
}

.toggle-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.toggle-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.toggle-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--input-border);
    border-radius: 22px;
    transition: 0.3s;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--action-bg);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(18px);
}

/* --- ACCOUNT PAGE --- */
.account-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.account-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* --- PROFILE HEADER --- */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-card-right);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.profile-header-avatar {
    position: relative;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
}

.profile-avatar-initials {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
}

.profile-avatar-edit {
    position: absolute;
    bottom: 0;
    right: -2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #000;
    border: 2px solid var(--bg-card-right);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
}

.profile-avatar-edit:hover {
    background: #222;
}

.profile-avatar-edit .icon {
    width: 12px;
    height: 12px;
}

.profile-header-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
}

.profile-header-info h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.profile-header-role {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 500;
}

.profile-header-email {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.profile-header-stats {
    display: flex;
    gap: 1.5rem;
}

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

.profile-stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

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

/* --- SETTINGS SECTIONS --- */
.settings-section {
    background: var(--bg-card-right);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.settings-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--separator-color);
}

.settings-section-header .icon {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.settings-section-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.settings-section-header p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0.1rem 0 0;
}

.settings-section-body {
    padding: 1.25rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.form-actions {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--separator-color);
}

.form-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- SESSIONS --- */
.session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
}

.session-item + .session-item {
    border-top: 1px solid var(--separator-color);
}

.session-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.session-icon {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.session-name {
    display: block;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.session-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.session-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 5px;
}

.session-current {
    background: rgba(22, 163, 74, 0.12);
    color: #22c55e;
}

.session-action {
    font-size: 0.78rem;
    color: var(--danger);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.session-action:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* --- PREFERENCE ROWS --- */
.preference-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    gap: 1rem;
}

.preference-row + .preference-row {
    border-top: 1px solid var(--separator-color);
}

.preference-row > span {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.preference-desc {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* --- DANGER ZONE --- */
.settings-section-danger {
    border-color: rgba(239, 68, 68, 0.25);
}

.settings-section-danger .settings-section-header .icon {
    color: var(--danger);
}

.danger-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
}

.danger-item + .danger-item {
    border-top: 1px solid var(--separator-color);
}

.danger-title {
    display: block;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.danger-desc {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
    padding: 0.28rem 1rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-danger-outline:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .account-grid {
        grid-template-columns: 1fr;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-header-info {
        align-items: center;
    }

    .profile-header-stats {
        width: 100%;
        justify-content: center;
    }
}

/* Contraste e alinhamento final do menu de Administração. */
.topbar-context-trigger .icon,
.topbar-context-menu-icon .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transform: translateY(1px);
}

.topbar-context-menu-main small,
.topbar-context-menu-section {
    color: #334155;
}

.topbar-context-menu-info,
.topbar-context-menu-info strong {
    color: #334155;
}

.topbar-context-menu-info em,
.topbar-avatar-menu .sidebar-user-action {
    color: #1e293b !important;
}

[data-theme="dark"] .topbar-context-menu-main small,
[data-theme="dark"] .topbar-context-menu-section,
[data-theme="dark"] .topbar-context-menu-info,
[data-theme="dark"] .topbar-context-menu-info strong {
    color: #cbd5e1;
}

[data-theme="dark"] .topbar-context-menu-info em,
[data-theme="dark"] .topbar-avatar-menu .sidebar-user-action {
    color: #f1f5f9 !important;
}

/* Sair mantém a indicação de ação destrutiva no menu do cabeçalho. */
.topbar-avatar-menu .sidebar-user-logout,
.topbar-avatar-menu .sidebar-user-logout .icon {
    color: #ef4444 !important;
    stroke: currentColor !important;
}

.topbar-avatar-menu .sidebar-user-logout:hover,
.topbar-avatar-menu .sidebar-user-logout:focus-visible {
    background: rgba(239, 68, 68, .28) !important;
    background-color: rgba(239, 68, 68, .28) !important;
    background-image: none !important;
    color: #ef4444 !important;
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, .32) !important;
    outline: none;
}

[data-theme="dark"] .topbar-avatar-menu .sidebar-user-logout:hover,
[data-theme="dark"] .topbar-avatar-menu .sidebar-user-logout:focus-visible {
    background: rgba(239, 68, 68, .32) !important;
    background-color: rgba(239, 68, 68, .32) !important;
    background-image: none !important;
    color: #f87171 !important;
    box-shadow: inset 0 0 0 1px rgba(248, 113, 113, .38) !important;
}

/* O hover vermelho cobre a linha inteira do formulário, como na sidebar. */
.topbar-avatar-menu form:hover > .sidebar-user-logout,
.topbar-avatar-menu form:focus-within > .sidebar-user-logout,
.topbar-avatar-menu form:hover > .sidebar-user-logout:hover,
.topbar-avatar-menu form:focus-within > .sidebar-user-logout:focus-visible {
    background: rgba(239, 68, 68, .28) !important;
    background-color: rgba(239, 68, 68, .28) !important;
    background-image: none !important;
    color: #ef4444 !important;
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, .32) !important;
}

[data-theme="dark"] .topbar-avatar-menu form:hover > .sidebar-user-logout,
[data-theme="dark"] .topbar-avatar-menu form:focus-within > .sidebar-user-logout,
[data-theme="dark"] .topbar-avatar-menu form:hover > .sidebar-user-logout:hover,
[data-theme="dark"] .topbar-avatar-menu form:focus-within > .sidebar-user-logout:focus-visible {
    background: rgba(239, 68, 68, .32) !important;
    background-color: rgba(239, 68, 68, .32) !important;
    background-image: none !important;
    color: #f87171 !important;
    box-shadow: inset 0 0 0 1px rgba(248, 113, 113, .38) !important;
}

/* Inclui foco e toque para o vermelho também funcionar em telas móveis. */
.topbar-avatar-menu .sidebar-user-logout:focus,
.topbar-avatar-menu .sidebar-user-logout:active,
.topbar-avatar-menu form:active > .sidebar-user-logout {
    background: rgba(239, 68, 68, .28) !important;
    background-color: rgba(239, 68, 68, .28) !important;
    background-image: none !important;
    color: #ef4444 !important;
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, .32) !important;
}

[data-theme="dark"] .topbar-avatar-menu .sidebar-user-logout:focus,
[data-theme="dark"] .topbar-avatar-menu .sidebar-user-logout:active,
[data-theme="dark"] .topbar-avatar-menu form:active > .sidebar-user-logout {
    background: rgba(239, 68, 68, .32) !important;
    background-color: rgba(239, 68, 68, .32) !important;
    background-image: none !important;
    color: #f87171 !important;
    box-shadow: inset 0 0 0 1px rgba(248, 113, 113, .38) !important;
}

/* Fundo do hover mais evidente sobre o vidro, sem virar uma faixa opaca. */
.topbar-avatar-menu .sidebar-user-logout:hover,
.topbar-avatar-menu .sidebar-user-logout:focus-visible {
    background-color: rgba(239, 68, 68, .26) !important;
    background-image: none !important;
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, .28) !important;
}

[data-theme="dark"] .topbar-avatar-menu .sidebar-user-logout:hover,
[data-theme="dark"] .topbar-avatar-menu .sidebar-user-logout:focus-visible {
    background-color: rgba(239, 68, 68, .30) !important;
    box-shadow: inset 0 0 0 1px rgba(248, 113, 113, .34) !important;
}

/* --- LOGO UPLOAD --- */
.logo-upload {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.logo-preview {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.logo-upload-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.logo-upload-hint {
    width: 100%;
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* --- CHECKBOX GROUP --- */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* --- TEMPLATES --- */
.template-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.template-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--separator-color);
}

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

.template-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.template-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.template-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- SLA --- */
.sla-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.sla-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: box-shadow 0.2s;
}

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

.sla-priority {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    display: inline-block;
    align-self: flex-start;
}

.sla-high {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}
.sla-medium {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}
.sla-low {
    background: rgba(22, 163, 74, 0.1);
    color: var(--success);
}

.sla-times {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sla-time-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
}

.sla-label {
    color: var(--text-muted);
}

.sla-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* --- BACKUP --- */
.backup-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.backup-history {
    margin-top: 1rem;
}

/* --- PROGRESS SPINNER --- */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* --- UTILITY --- */
.text-center {
    text-align: center;
}
.text-right {
    text-align: right;
}
.mt-0 {
    margin-top: 0;
}
.mt-1 {
    margin-top: 0.5rem;
}
.mt-2 {
    margin-top: 1rem;
}
.mt-3 {
    margin-top: 1.5rem;
}
.mb-0 {
    margin-bottom: 0;
}
.mb-1 {
    margin-bottom: 0.5rem;
}
.mb-2 {
    margin-bottom: 1rem;
}
.mb-3 {
    margin-bottom: 1.5rem;
}
.flex {
    display: flex;
}
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}
.gap-1 {
    gap: 0.5rem;
}
.gap-2 {
    gap: 1rem;
}
.w-full {
    width: 100%;
}

/* --- CHAT IA --- */
.ai-chat-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1rem;
    align-items: stretch;
}

.ai-chat-panel,
.ai-chat-context {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.ai-chat-panel {
    min-height: calc(100vh - 230px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-chat-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--border-color);
}

.ai-chat-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.ai-chat-mark {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--action-soft);
    color: var(--text-primary);
    border: 1px solid var(--action-border);
    flex-shrink: 0;
}

.ai-chat-mark .icon {
    width: 20px;
    height: 20px;
}

.ai-chat-title h2 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.ai-chat-title p {
    margin: 0.15rem 0 0;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.ai-chat-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    justify-self: end;
    margin-top: 0;
    width: auto;
    height: 14px;
    min-height: 14px;
    padding: 0 0.24rem;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    box-sizing: border-box;
    color: var(--text-secondary);
    font-size: 0.64rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.ai-chat-status::before {
    display: none;
}

.ai-chat-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem;
    overflow-y: auto;
}

.ai-chat-message {
    max-width: 78%;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card-right);
    color: var(--text-primary);
}

.ai-chat-message p {
    margin: 0;
    color: inherit;
    line-height: 1.5;
}

.ai-chat-message small {
    display: block;
    margin-top: 0.45rem;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.ai-chat-message.user {
    align-self: flex-end;
    background: var(--text-primary);
    color: var(--bg-card);
    border-color: var(--text-primary);
}

[data-theme="light"] .ai-chat-message.user {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
    border-color: transparent;
}

.ai-chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 1rem 1rem;
}

.ai-chat-suggestions button {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-card-right);
    color: var(--text-secondary);
    padding: 0.45rem 0.7rem;
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-chat-suggestions button:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.ai-chat-composer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card-right);
}

.ai-chat-composer input {
    flex: 1;
    min-width: 0;
    height: 42px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0 0.9rem;
    font: inherit;
    outline: none;
}

.ai-chat-composer input:focus {
    border-color: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .ai-chat-composer input:focus {
    border-color: #aaa;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.ai-chat-composer button {
    height: 42px;
    min-width: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--text-primary);
    border-radius: 8px;
    background: var(--text-primary);
    color: var(--bg-card);
    cursor: pointer;
}

[data-theme="light"] .ai-chat-composer button {
    background: #171717;
    color: #ffffff;
    border-color: #171717;
}

[data-theme="light"] .ai-chat-composer button:hover {
    background: #111111;
    color: #ffffff;
    border-color: #111111;
}

.ai-chat-composer button .icon {
    width: 18px;
    height: 18px;
}

.ai-chat-context {
    padding: 1rem;
}

.ai-chat-context h3 {
    margin: 0 0 0.75rem;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.ai-chat-context-list {
    display: grid;
    gap: 0.65rem;
}

.ai-chat-context-item {
    display: block;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    background: var(--bg-card-right);
}

.ai-chat-context-item span {
    display: block;
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-bottom: 0.2rem;
}

.ai-chat-context-item strong {
    font-size: 0.84rem;
}

[data-theme="dark"] .ai-chat-message.user,
[data-theme="dark"] .ai-chat-composer button {
    background: #f5f5f5;
    color: #111111;
    border-color: #f5f5f5;
}

@media (max-width: 1024px) {
    .ai-chat-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .ai-chat-header {
        align-items: stretch;
        flex-direction: column;
    }

    .ai-chat-composer {
        align-items: center;
        flex-direction: row;
    }

    .ai-chat-composer input {
        width: 100%;
        flex: 1 1 auto;
    }

    .ai-chat-composer button {
        flex: 0 0 42px;
    }

    .ai-chat-message {
        max-width: 92%;
    }

    .ai-chat-status {
        width: max-content;
        height: 14px;
        min-height: 14px;
        padding-top: 0;
        padding-bottom: 0;
        line-height: 1;
    }
}

/* --- MOBILE INTERNAL RESPONSIVENESS ONLY --- */
.mobile-sidebar-toggle {
    display: none;
}

@media (max-width: 900px) {
    html,
    body.page-internal {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .page-internal .app-layout {
        display: flex;
        min-height: 100vh;
        width: 100%;
        min-width: 0;
    }

    .mobile-sidebar-toggle {
        width: 36px;
        height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        color: var(--text-primary);
        cursor: pointer;
        padding: 0;
    }

    .mobile-sidebar-toggle .icon {
        width: 24px;
        height: 24px;
    }

    .mobile-sidebar-toggle:hover,
    .mobile-sidebar-toggle:focus,
    .mobile-sidebar-toggle:focus-visible {
        background: transparent;
        box-shadow: none;
        outline: none;
    }

    .app-sidebar,
    html.sidebar-state-collapsed .app-sidebar,
    .app-sidebar.collapsed {
        width: min(82vw, 290px);
        max-width: 290px;
        border-right: 1px solid rgba(255, 255, 255, 0.38);
        background: rgba(246, 248, 252, 0.58);
        backdrop-filter: blur(18px) saturate(180%) contrast(105%);
        -webkit-backdrop-filter: blur(18px) saturate(180%) contrast(105%);
        transform: translateX(-100%);
        transition: transform 0.24s ease;
        box-shadow: none;
    }

    [data-theme="dark"] .app-sidebar,
    [data-theme="dark"] html.sidebar-state-collapsed .app-sidebar,
    [data-theme="dark"] .app-sidebar.collapsed {
        border-right-color: rgba(255, 255, 255, 0.1);
        background: rgba(24, 26, 31, 0.55);
    }

    .app-sidebar.open {
        transform: translateX(0);
        box-shadow: none;
    }

    .app-sidebar.open .sidebar-header {
        justify-content: flex-start;
    }

    .app-sidebar.open .sidebar-header .brand-logo {
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0.55rem;
    }

    .app-sidebar.open .sidebar-header .logo-icon,
    .app-sidebar.open:not(.collapsed) .sidebar-header .logo-icon,
    html.sidebar-state-collapsed .app-sidebar.open .sidebar-header .logo-icon {
        width: 42px;
        height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 42px;
    }

    .app-sidebar.open .sidebar-header .logo-icon img,
    html.sidebar-state-collapsed
        .app-sidebar.open
        .sidebar-header
        .logo-icon
        img {
        width: 42px;
        height: 42px;
        max-width: 42px;
        max-height: 42px;
        object-fit: contain;
    }

    .app-sidebar.open .sidebar-header .sidebar-brand-text {
        display: none;
    }

    .app-sidebar.open .sidebar-header .sidebar-mobile-welcome {
        display: flex;
        min-width: 0;
        flex-direction: column;
        gap: 0.18rem;
        line-height: 1.25;
    }

    .sidebar-mobile-greeting {
        overflow: hidden;
        color: var(--text-primary);
        font-size: 0.82rem;
        font-weight: 500;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sidebar-mobile-greeting strong {
        font-weight: 700;
    }

    .sidebar-mobile-date {
        overflow: hidden;
        color: var(--text-muted);
        font-size: 0.64rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .app-sidebar.open .sidebar-toggle-btn {
        margin-left: auto;
    }

    .app-sidebar:not(.open) .sidebar-toggle-btn,
    .app-sidebar:not(.open) .sidebar-toggle-btn::before,
    .app-sidebar:not(.open) .sidebar-toggle-btn::after,
    .app-sidebar:not(.open) .sidebar-link::before,
    .app-sidebar:not(.open) .sidebar-link::after,
    .app-sidebar:not(.open) .sidebar-user-trigger::before,
    .app-sidebar:not(.open) .sidebar-user-trigger::after {
        display: none;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .app-sidebar:not(.open) {
        overflow: hidden;
    }

    .app-sidebar.open .sidebar-brand-text,
    .app-sidebar.open .sidebar-section-title,
    .app-sidebar.open .sidebar-user-info,
    .app-sidebar.open .sidebar-copyright {
        display: block;
    }

    .app-sidebar.open .sidebar-link > *:not(.icon):not(.badge-count),
    .app-sidebar.open .sidebar-user-chevron,
    .app-sidebar.open .sidebar-logout {
        display: inline-flex;
    }

    .app-sidebar.open .sidebar-user-summary {
        display: flex;
    }

    .app-sidebar.open .sidebar-user-dropdown {
        display: none;
    }

    .app-sidebar.open .sidebar-user-menu.open .sidebar-user-dropdown {
        display: block;
        left: 0;
        right: auto;
        width: 100%;
    }

    .app-sidebar.open .sidebar-link {
        font-size: 0.85rem;
        gap: 0.65rem;
        justify-content: flex-start;
    }

    .app-sidebar.open .sidebar-link .badge-count {
        display: inline-flex;
        position: static;
        min-width: 0;
        height: auto;
        margin-left: auto;
        padding: 0.1rem 0.45rem;
        font-size: 0.7rem;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 90;
        background: rgba(0, 0, 0, 0.18);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }

    .sidebar-overlay.visible {
        display: block;
    }

    .app-main,
    .app-sidebar.collapsed ~ .app-main,
    html.sidebar-state-collapsed .app-sidebar ~ .app-main {
        width: 100%;
        min-width: 0;
        margin-left: 0;
        padding-top: var(--mobile-topbar-height, 116px);
        padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    }

    .app-topbar {
        position: fixed;
        z-index: 85;
        top: 0;
        right: 0;
        left: 0;
        width: 100%;
        box-sizing: border-box;
        min-height: 60px;
        gap: 0.6rem;
        padding: 0.65rem 0.75rem;
        flex-wrap: wrap;
        align-items: center;
        box-shadow: none;
    }

    .app-topbar.scrolled {
        box-shadow: none;
    }

    .topbar-user-info {
        display: none;
    }

    .topbar-mobile-brand {
        display: inline-flex;
        align-items: center;
        min-width: 0;
        margin-right: auto;
        color: var(--text-primary);
        font-size: 1rem;
        font-weight: 750;
        letter-spacing: -0.025em;
        line-height: 1;
        text-decoration: none;
        white-space: nowrap;
    }

    .topbar-mobile-brand img {
        width: 38px;
        height: 38px;
        margin-right: 0.35rem;
        object-fit: contain;
    }

    .topbar-mobile-brand > span > span {
        color: var(--accent);
    }

    .topbar-mobile-brand b {
        margin-left: 0.12rem;
        color: var(--text-muted);
        font-weight: 700;
    }

    .topbar-info-text {
        min-width: 0;
    }

    .topbar-greeting,
    .topbar-date {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar-actions {
        gap: 0.35rem;
        margin-left: 0;
    }

    .topbar-btn,
    .topbar-avatar,
    .topbar-user-trigger {
        flex: 0 0 auto;
    }

    .topbar-search {
        display: none;
        order: 10;
        flex: 1 0 100%;
        max-width: none;
        width: 100%;
        box-shadow: none;
    }

    .topbar-search:hover,
    .topbar-search:focus-within,
    .topbar-search.ai-help-search:hover,
    .topbar-search.ai-help-search.open,
    .topbar-search.ai-help-search:focus-within,
    [data-theme="dark"] .topbar-search:hover,
    [data-theme="dark"] .topbar-search:focus-within,
    [data-theme="dark"] .topbar-search.ai-help-search:hover,
    [data-theme="dark"] .topbar-search.ai-help-search.open,
    [data-theme="dark"] .topbar-search.ai-help-search:focus-within {
        box-shadow: none;
    }

    .ai-help-dropdown {
        box-shadow: none;
    }

    .app-content {
        width: 100%;
        min-width: 0;
        padding: 1rem;
        overflow-x: hidden;
    }

    .page-header {
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .page-header-left,
    .page-header-right,
    .page-header-center {
        width: 100%;
        min-width: 0;
        margin-left: 0;
        padding-right: 0;
        align-items: flex-start;
    }

    .page-header-left h1 {
        font-size: 1.18rem;
        line-height: 1.25;
    }

    .page-header-left p {
        line-height: 1.45;
    }

    .page-header-right {
        gap: 0.5rem;
    }

    .page-header-right .btn,
    .form-actions .btn,
    .backup-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
        min-width: min(100%, 140px);
    }

    .stats-grid,
    .dashboard-grid,
    .quick-actions,
    .ticket-form-grid,
    .account-grid,
    .sla-grid,
    .help-hero-grid,
    .help-layout,
    .help-grid,
    .client-grid,
    .kb-grid,
    .ai-chat-layout {
        grid-template-columns: 1fr;
    }

    .stat-card,
    .content-card,
    .client-card,
    .kb-card,
    .settings-section,
    .settings-card,
    .side-panel {
        min-width: 0;
    }

    .content-card-header,
    .settings-card-header,
    .settings-section-header,
    .profile-header,
    .card-header-row,
    .danger-item,
    .preference-row,
    .toggle-row,
    .template-item,
    .session-item,
    .client-tickets,
    .form-actions,
    .backup-actions {
        flex-wrap: wrap;
    }

    .content-card-body,
    .settings-card-body,
    .settings-section-body {
        max-width: 100%;
    }

    .content-card-body[style*="padding:0"],
    .content-card-table,
    .table-responsive,
    .backup-history {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table,
    .help-table {
        min-width: 640px;
    }

    .filter-bar,
    .form-row,
    .form-actions,
    .logo-upload,
    .editor-modal-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .form-row {
        display: grid;
        grid-template-columns: 1fr;
    }

    .form-group,
    .form-control,
    .custom-select,
    .custom-select-trigger,
    .custom-select-menu,
    .filter-bar .search-input,
    .filter-bar .form-control,
    .settings-tabs,
    .modal-card,
    .editor-modal-card,
    .ai-chat-context {
        width: 100%;
        min-width: 0;
    }

    .filter-tabs,
    .settings-tabs,
    .editor-toolbar,
    .editor-templates,
    .ai-chat-suggestions {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .filter-tab,
    .settings-tab,
    .editor-tool,
    .template-chip,
    .ai-chat-suggestions button {
        flex: 0 0 auto;
    }

    .ticket-description,
    .ticket-description-simple {
        min-height: 170px;
    }

    .notification-center,
    .avatar-dropdown-menu,
    .topbar-user-dropdown,
    .sidebar-user-dropdown {
        width: min(360px, calc(100vw - 1rem));
        max-width: calc(100vw - 1rem);
    }

    .avatar-dropdown-menu,
    .topbar-user-dropdown,
    .sidebar-user-dropdown {
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-color: rgba(15, 23, 42, 0.12);
        box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14);
    }

    [data-theme="dark"] .avatar-dropdown-menu,
    [data-theme="dark"] .topbar-user-dropdown,
    [data-theme="dark"] .sidebar-user-dropdown {
        background: rgba(26, 26, 26, 0.92);
        border-color: rgba(255, 255, 255, 0.14);
        box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34);
    }

    .notification-center {
        right: -0.25rem;
    }

    .ai-help-dropdown {
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
        min-width: 100%;
        box-sizing: border-box;
    }

    .help-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .help-table div {
        min-width: 520px;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .ticket-detail-meta,
    .timeline-head,
    .priority-info,
    .status-legend,
    .client-card-top,
    .kb-card-footer {
        flex-wrap: wrap;
    }

    .timeline-item {
        gap: 0.6rem;
    }

    .timeline-time {
        width: 100%;
        margin-left: 0;
    }

    .editor-modal-overlay,
    .modal-overlay {
        padding: 0.75rem;
    }

    .editor-modal-card,
    .modal-card {
        max-height: calc(100vh - 1.5rem);
        overflow-y: auto;
    }

    .spotlight-modal,
    .spotlight-panel {
        width: min(680px, calc(100vw - 1rem));
        max-width: calc(100vw - 1rem);
    }

    .ai-chat-panel {
        min-height: min(680px, calc(100vh - 210px));
    }
}

@media (max-width: 480px) {
    .app-topbar {
        padding-inline: 0.6rem;
    }

    .topbar-period-icon {
        display: none;
    }

    .topbar-greeting {
        font-size: 0.82rem;
    }

    .topbar-date {
        font-size: 0.7rem;
    }

    .app-content {
        padding: 0.85rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .content-card-header,
    .content-card-body,
    .settings-card-header,
    .settings-card-body,
    .settings-section-header,
    .settings-section-body {
        padding-inline: 0.9rem;
    }

    .data-table thead {
        display: table-header-group;
    }

    .data-table tbody tr {
        display: table-row;
        padding: 0;
        border-bottom: 0;
    }

    .data-table tbody td {
        display: table-cell;
        padding: 0.65rem 0.75rem;
        border-bottom: 1px solid var(--separator-color);
    }

    .data-table tbody td::before {
        display: none;
    }

    .btn,
    .page-header-right .btn {
        width: 100%;
    }

    .ai-chat-message {
        max-width: 100%;
    }
}

/* Estrutura interna usando a mesma hierarquia grafite do acesso. */
[data-theme="dark"] .app-sidebar,
[data-theme="dark"] html.sidebar-state-collapsed .app-sidebar,
[data-theme="dark"] .app-sidebar.collapsed,
[data-theme="dark"] .app-topbar,
[data-theme="dark"] .app-topbar.scrolled {
    background: #111318;
}

[data-theme="dark"] .page-internal .app-content {
    background: #090a0c;
}

/* Superfícies flutuantes e interativas do tema grafite. */
[data-theme="dark"] .topbar-search,
[data-theme="dark"] .topbar-search.ai-help-search,
[data-theme="dark"] .topbar-user-trigger,
[data-theme="dark"] .custom-select-trigger {
    background: #111318;
    border-color: #343840;
}

[data-theme="dark"] .topbar-search:hover,
[data-theme="dark"] .topbar-search.ai-help-search:hover,
[data-theme="dark"] .topbar-search.ai-help-search.open,
[data-theme="dark"] .topbar-user-trigger:hover,
[data-theme="dark"] .topbar-user-menu.open .topbar-user-trigger,
[data-theme="dark"] .custom-select-trigger:hover,
[data-theme="dark"] .custom-select.open .custom-select-trigger {
    background: #17191e;
    border-color: #50555f;
}

[data-theme="dark"] .topbar-search:focus-within,
[data-theme="dark"] .topbar-search.ai-help-search:focus-within {
    background: #0e1014;
    border-color: #8b919b;
    box-shadow: 0 0 0 3px rgba(148, 154, 166, 0.14);
}

[data-theme="dark"] .sidebar-user-dropdown,
[data-theme="dark"] .topbar-user-dropdown,
[data-theme="dark"] .avatar-dropdown-menu,
[data-theme="dark"] .custom-select-menu,
[data-theme="dark"] .ai-help-dropdown,
[data-theme="dark"] .tickets-filter-popover,
[data-theme="dark"] .knowledge-sort-menu,
[data-theme="dark"] .tabler-icon-picker-popover,
[data-theme="dark"] .notification-center {
    background: #1a1c21;
    border-color: #3a3e46;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.48);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

[data-theme="dark"] .notification-center::before {
    background: #1a1c21;
    border-color: #3a3e46;
}

[data-theme="dark"] .sidebar-user-trigger:hover,
[data-theme="dark"] .sidebar-user-menu.open .sidebar-user-trigger,
[data-theme="dark"] .topbar-user-action:hover,
[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .custom-select-option:hover,
[data-theme="dark"] .custom-select-option.active,
[data-theme="dark"] .spotlight-item:hover,
[data-theme="dark"] .spotlight-item.active,
[data-theme="dark"] .topbar-btn:hover,
[data-theme="dark"] .topbar-toggle:hover,
[data-theme="dark"] .theme-toggle:hover {
    background: #292c32;
    color: #ffffff;
}

[data-theme="dark"] .sidebar-user-trigger:hover,
[data-theme="dark"] .sidebar-user-trigger:focus-visible {
    background: #1b1e24;
    color: #f4f4f5;
}

[data-theme="dark"] .sidebar-user-menu.open .sidebar-user-trigger {
    background: #292c32;
    color: #ffffff;
}

[data-theme="dark"] .sidebar-user-dropdown {
    background: #1a1c21;
    border-color: #3a3e46;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .sidebar-user-dropdown-head {
    background: #17191e;
    border-bottom-color: #30333a;
    border-radius: 7px 7px 0 0;
}

[data-theme="dark"] .sidebar-user-dropdown-info {
    border-bottom-color: #30333a;
}

[data-theme="dark"] .sidebar-user-action {
    color: #a9adb5;
}

[data-theme="dark"] .sidebar-user-action:hover,
[data-theme="dark"] .sidebar-user-action:focus-visible {
    background: #292c32;
    color: #ffffff;
    outline: none;
}

[data-theme="dark"] .sidebar-user-action:not(.sidebar-user-logout):hover .icon {
    color: #ffffff;
}

[data-theme="dark"] .spotlight-overlay {
    background: rgba(4, 5, 7, 0.76);
}

[data-theme="dark"] .spotlight-panel {
    background: rgba(17, 19, 24, 0.38);
    border-color: #3a3e46;
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

[data-theme="dark"] .spotlight-search {
    background: transparent;
    border-bottom-color: #30333a;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

[data-theme="dark"] .spotlight-results {
    background: transparent;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

[data-theme="dark"] .spotlight-close {
    background: #22252b;
    border-color: #3a3e46;
}

[data-theme="dark"] .spotlight-close:hover {
    background: #343840;
    border-color: #50555f;
}

[data-theme="dark"] .ai-help-panel {
    background: #1a1c21;
    border-color: #3a3e46;
}

[data-theme="dark"] .ai-help-question,
[data-theme="dark"] .ai-help-close {
    background: #111318;
    border-color: #343840;
}

[data-theme="dark"] .ai-help-action {
    background: #3f4856;
    color: #ffffff;
}

[data-theme="dark"] .ai-help-action:hover {
    background: #4c5868;
    color: #ffffff;
}

/* Cadastro de clientes alinhado ao tema grafite. */
[data-theme="dark"] .clients-reference-new,
[data-theme="dark"] .client-modal-card .btn-primary {
    background: #3f4856;
    border-color: #596779;
    color: #ffffff;
}

[data-theme="dark"] .clients-reference-new:hover,
[data-theme="dark"] .client-modal-card .btn-primary:hover {
    background: #4c5868;
    border-color: #68778a;
}

[data-theme="dark"] .client-modal-card .form-control {
    background: #111318;
    border-color: #343840;
    color: #f4f4f5;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

[data-theme="dark"] .client-modal-card .form-control:hover {
    background: #111318;
    border-color: #4a4f59;
}

[data-theme="dark"] .client-modal-card .form-control:focus {
    background: #0e1014;
    border-color: #8b919b;
    box-shadow: 0 0 0 3px rgba(148, 154, 166, 0.14);
}

[data-theme="dark"] .client-modal-card select.form-control {
    color-scheme: dark;
}

[data-theme="dark"] .client-image-field,
[data-theme="dark"] .client-image-preview {
    background: #111318;
    border-color: #343840;
}

/* Categorias e departamentos alinhados ao tema grafite. */
[data-theme="dark"] .categories-reference-new,
[data-theme="dark"] .departments-overview-new,
[data-theme="dark"] .category-modal-card .btn-primary,
[data-theme="dark"] .department-modal-card .btn-primary {
    background: #3f4856;
    border-color: #596779;
    color: #ffffff;
}

[data-theme="dark"] .categories-reference-new:hover,
[data-theme="dark"] .departments-overview-new:hover,
[data-theme="dark"] .category-modal-card .btn-primary:hover,
[data-theme="dark"] .department-modal-card .btn-primary:hover {
    background: #4c5868;
    border-color: #68778a;
    color: #ffffff;
}

[data-theme="dark"] .category-modal-card .form-control,
[data-theme="dark"] .department-modal-card .form-control,
[data-theme="dark"] .category-modal-card .custom-select-trigger,
[data-theme="dark"] .department-modal-card .custom-select-trigger,
[data-theme="dark"] .category-modal-card .modal-color-picker,
[data-theme="dark"] .department-modal-card .modal-color-picker {
    background: #111318;
    border-color: #343840;
    color: #f4f4f5;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

[data-theme="dark"] .category-modal-card .form-control:hover,
[data-theme="dark"] .department-modal-card .form-control:hover,
[data-theme="dark"] .category-modal-card .custom-select-trigger:hover,
[data-theme="dark"] .department-modal-card .custom-select-trigger:hover,
[data-theme="dark"] .category-modal-card .modal-color-picker:hover,
[data-theme="dark"] .department-modal-card .modal-color-picker:hover {
    background: #111318;
    border-color: #4a4f59;
}

[data-theme="dark"] .category-modal-card .form-control:focus,
[data-theme="dark"] .department-modal-card .form-control:focus,
[data-theme="dark"] .category-modal-card .custom-select.open .custom-select-trigger,
[data-theme="dark"] .department-modal-card .custom-select.open .custom-select-trigger,
[data-theme="dark"] .category-modal-card .modal-color-picker:focus-within,
[data-theme="dark"] .department-modal-card .modal-color-picker:focus-within {
    background: #0e1014;
    border-color: #8b919b;
    box-shadow: 0 0 0 3px rgba(148, 154, 166, 0.14);
}

[data-theme="dark"] .category-modal-card .custom-select-menu,
[data-theme="dark"] .department-modal-card .custom-select-menu {
    background: #1a1c21;
    border-color: #3a3e46;
}

[data-theme="dark"] .category-modal-info,
[data-theme="dark"] .department-modal-info {
    background: #22252b;
    border-color: #3a3e46;
}

[data-theme="dark"] .category-modal-card .modal-color-custom,
[data-theme="dark"] .department-modal-card .modal-color-custom {
    background: #22252b;
    border-color: #3a3e46;
}

/* Tooltips da navegação lateral. */
[data-theme="dark"] .sidebar-toggle-btn::after,
[data-theme="dark"] .app-sidebar.collapsed .sidebar-link::after,
[data-theme="dark"] .app-sidebar.collapsed .sidebar-user-trigger::after {
    background: #1a1c21;
    border: 1px solid #3a3e46;
    color: #f4f4f5;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.48);
    font-size: 0.72rem;
    font-weight: 550;
    line-height: 1.4;
    z-index: 4001;
}

[data-theme="dark"] .sidebar-toggle-btn::before,
[data-theme="dark"] .app-sidebar.collapsed .sidebar-link::before,
[data-theme="dark"] .app-sidebar.collapsed .sidebar-user-trigger::before {
    background: #1a1c21;
    border-left: 1px solid #3a3e46;
    border-bottom: 1px solid #3a3e46;
    z-index: 4000;
}

[data-theme="dark"] .app-sidebar.collapsed .sidebar-user-trigger::after {
    min-width: 170px;
    color: #d9dbe0;
}

[data-theme="light"] .sidebar-toggle-btn::after,
[data-theme="light"] .app-sidebar.collapsed .sidebar-link::after,
[data-theme="light"] .app-sidebar.collapsed .sidebar-user-trigger::after {
    background: #1a1c21;
    border: 1px solid #3a3e46;
    color: #f4f4f5;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.48);
    font-size: 0.72rem;
    font-weight: 550;
    line-height: 1.4;
    z-index: 4001;
}

[data-theme="light"] .sidebar-toggle-btn::before,
[data-theme="light"] .app-sidebar.collapsed .sidebar-link::before,
[data-theme="light"] .app-sidebar.collapsed .sidebar-user-trigger::before {
    background: #1a1c21;
    border-left: 1px solid #3a3e46;
    border-bottom: 1px solid #3a3e46;
    z-index: 4000;
}

[data-theme="light"] .app-sidebar.collapsed .sidebar-user-trigger::after {
    min-width: 170px;
    color: #d9dbe0;
}

/* Ações principais do acesso no tema claro em azul-aço. */
[data-theme="light"] .page-login #btnLogin,
[data-theme="light"] .page-login #btnRegister:not(:disabled),
[data-theme="light"] .page-login .modal-card .btn-submit {
    background: #64748b;
    border-color: #59677a;
    color: #ffffff;
    box-shadow: 0 7px 18px rgba(100, 116, 139, 0.24);
}

[data-theme="light"] .page-login #btnLogin:hover,
[data-theme="light"] .page-login #btnRegister:not(:disabled):hover,
[data-theme="light"] .page-login .modal-card .btn-submit:hover {
    background: #526174;
    border-color: #495768;
    color: #ffffff;
    box-shadow: 0 9px 22px rgba(82, 97, 116, 0.30);
}

/* Exceções de ações principais no sistema claro. */
[data-theme="light"] .clients-reference-new,
[data-theme="light"] .client-modal-card .btn-primary {
    background: #64748b;
    border-color: #59677a;
    color: #ffffff;
}

[data-theme="light"] .clients-reference-new:hover,
[data-theme="light"] .client-modal-card .btn-primary:hover {
    background: #526174;
    border-color: #495768;
    color: #ffffff;
}

[data-theme="light"] .page-login .tab-btn.active {
    background: #64748b;
    border-color: #59677a;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.24);
}

[data-theme="light"] .page-login .tab-btn.active:hover {
    background: #526174;
    border-color: #495768;
    color: #ffffff;
}

/* Avatares neutros alinhados à paleta grafite. */
[data-theme="light"] .sidebar-avatar,
[data-theme="light"] .topbar-avatar,
[data-theme="light"] .dropdown-avatar,
[data-theme="light"] .sidebar-user-dropdown-avatar {
    background: #d9dde5;
    border: 1px solid #c5cad3;
    color: #25282e;
}

[data-theme="dark"] .sidebar-avatar,
[data-theme="dark"] .topbar-avatar,
[data-theme="dark"] .dropdown-avatar,
[data-theme="dark"] .sidebar-user-dropdown-avatar {
    background: #343840;
    border: 1px solid #50555f;
    color: #ffffff;
}


/* Prioridade final dos hovers do dropdown de notificações. */
[data-theme="light"] .notification-item:hover,
[data-theme="light"] .notification-item:focus-visible,
[data-theme="light"] .notification-footer:hover,
[data-theme="light"] .notification-footer:focus-visible {
    background: #eef1f5;
    color: #25282e;
}

[data-theme="dark"] .notification-item:hover,
[data-theme="dark"] .notification-item:focus-visible,
[data-theme="dark"] .notification-footer:hover,
[data-theme="dark"] .notification-footer:focus-visible {
    background: #292c32;
    color: #ffffff;
}

/* Linha inferior do cabeçalho 1px abaixo, apenas no sidebar encolhido */
.app-sidebar.collapsed .sidebar-header,
html.sidebar-state-collapsed .app-sidebar .sidebar-header {
    border-bottom-color: transparent;
    box-shadow: 0 1px 0 var(--border-color);
}

.app-sidebar.collapsed .sidebar-header::after,
html.sidebar-state-collapsed .app-sidebar .sidebar-header::after {
    display: none;
}
/* Formulários de saída protegidos por CSRF preservam a aparência original dos links. */
.sidebar-footer > form,.sidebar-user-dropdown > form,.avatar-dropdown-menu > form{display:contents}
button.sidebar-logout,button.dropdown-item,button.sidebar-user-action{font:inherit;text-align:left;border:0;cursor:pointer;width:100%}

/* Atalho visual para o futuro chat ao vivo. */
.floating-chat-widget {
    position: fixed;
    right: 1.25rem;
    bottom: 2.35rem;
    z-index: 90;
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 10px;
    width: 52px;
}
.floating-chat-panel {
    position: fixed;
    right: 1.25rem;
    bottom: calc(2.35rem + 62px);
    margin-top: -10px;
    z-index: 89;
    display: flex;
    flex-direction: column;
    width: min(360px, calc(100vw - 24px));
    height: 430px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, .34);
    border-radius: 20px;
    background: transparent;
    color: var(--text-primary);
    box-shadow: 0 20px 52px rgba(15, 23, 42, .12), inset 0 1px 0 rgba(255, 255, 255, .46), inset 0 -1px 0 rgba(255, 255, 255, .08);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px) scale(.97);
    transform-origin: bottom right;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.floating-chat-panel.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}
.floating-chat-panel-header,
.floating-chat-panel-composer {
    flex: 0 0 auto;
    padding: 14px 16px;
}
.floating-chat-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}
.floating-chat-panel-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.floating-chat-panel-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 13px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 20px;
}
.floating-chat-panel-identity > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.floating-chat-panel-identity strong { font-size: 13px; font-weight: 700; }
.floating-chat-panel-identity small { color: var(--text-secondary); font-size: 11px; }
.floating-chat-panel-identity small i { color: #22c55e; font-size: 8px; }
.floating-chat-panel-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font: inherit;
}
.floating-chat-panel-close:hover { background: var(--accent-soft); color: var(--text-primary); }
.floating-chat-panel-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    padding: 16px;
    overflow-y: auto;
}
.floating-chat-message {
    max-width: 88%;
    padding: 11px 13px;
    border-radius: 14px 14px 14px 5px;
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--text-primary);
    font-size: 12px;
    line-height: 1.45;
}
.floating-chat-message strong { color: var(--text-primary); }
.floating-chat-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 2px;
}
.floating-chat-quick-actions button {
    border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
    border-radius: 999px;
    padding: 7px 10px;
    background: transparent;
    color: var(--accent);
    cursor: default;
    font: inherit;
    font-size: 11px;
}
.floating-chat-preview-note {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: auto;
    padding: 9px 10px;
    border: 1px dashed var(--border-color);
    border-radius: 11px;
    color: #1f2937;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
}
.floating-chat-preview-note i { color: var(--accent); font-size: 15px; }
.floating-chat-panel-composer { border-top: 1px solid var(--border-color); }
.floating-chat-composer-field {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 5px 4px 11px;
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-radius: 12px;
    background: transparent;
}
.floating-chat-composer-field input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    font-size: 11px;
}
.floating-chat-composer-field input::placeholder { color: #475569; opacity: 1; font-weight: 500; }
.floating-chat-composer-field input:disabled { opacity: 1; }
.floating-chat-composer-field button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent);
    font: inherit;
}
.floating-chat-composer-field button:disabled { opacity: 1; }
.floating-chat-panel-composer > small {
    display: block;
    margin-top: 7px;
    color: #334155;
    font-size: 11px;
    font-weight: 500;
    text-align: center;
}
.floating-chat-panel-composer > small i { margin-right: 3px; }
.floating-chat-button {
    position: relative;
    z-index: 1;
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(15, 23, 42, .34);
    border-radius: 50%;
    background: transparent;
    color: #111827;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 20px 52px rgba(15, 23, 42, .12), inset 0 1px 0 rgba(255, 255, 255, .46), inset 0 -1px 0 rgba(255, 255, 255, .08);
    font: inherit;
    cursor: pointer;
    transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.floating-chat-button .icon { width: 24px; height: 24px; }
.floating-chat-hint {
    position: relative;
    right: auto;
    bottom: auto;
    z-index: 1;
    display: block;
    width: 136px;
    max-width: none;
    overflow: visible;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #111827;
    font-size: 15px;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    animation: none;
    transform: translateX(-18px);
}
.floating-chat-hint > span {
    display: block;
    width: 100%;
    overflow: visible;
    padding: 0;
    white-space: nowrap;
    text-align: left;
    clip-path: inset(0 100% 0 0);
    animation: floating-chat-hint-type 5.5s steps(17, end) .2s infinite;
}
.floating-chat-widget:has(.floating-chat-button[aria-expanded="true"]) .floating-chat-hint {
    visibility: hidden;
    opacity: 0;
    animation: none;
}
@keyframes floating-chat-hint-type {
    0%, 10% { clip-path: inset(0 100% 0 0); }
    34%, 64% { clip-path: inset(0 0 0 0); }
    90%, 100% { clip-path: inset(0 100% 0 0); }
}
.floating-chat-button:hover,
.floating-chat-button:focus-visible {
    background: rgba(226, 232, 240, .48);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 4px 12px rgba(15, 23, 42, .08);
    transform: translateY(-2px);
}
.floating-chat-button:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 3px; }
[data-theme="dark"] .floating-chat-button {
    border-color: rgba(255, 255, 255, .48);
    background: transparent;
    color: #ffffff;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .30), 0 0 0 1px rgba(255, 255, 255, .08), inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -1px 0 rgba(255, 255, 255, .06);
}
[data-theme="dark"] .floating-chat-button .icon { filter: drop-shadow(0 0 3px rgba(255, 255, 255, .58)); stroke-width: 2.25; }
[data-theme="dark"] .floating-chat-hint { color: #ffffff; text-shadow: 0 0 4px rgba(255, 255, 255, .32); }
[data-theme="dark"] .floating-chat-button:hover,
[data-theme="dark"] .floating-chat-button:focus-visible { background: rgba(255, 255, 255, .12); }
[data-theme="dark"] .floating-chat-panel {
    border-color: rgba(255, 255, 255, .48);
    background: transparent;
    color: #ffffff;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .30), 0 0 0 1px rgba(255, 255, 255, .08), inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -1px 0 rgba(255, 255, 255, .06);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
[data-theme="dark"] .floating-chat-panel-header,
[data-theme="dark"] .floating-chat-panel-composer { border-color: rgba(255, 255, 255, .2); }
[data-theme="dark"] .floating-chat-message { background: color-mix(in srgb, var(--accent) 18%, transparent); }
[data-theme="dark"] .floating-chat-preview-note,
[data-theme="dark"] .floating-chat-panel-composer > small { color: #f8fafc; }
[data-theme="dark"] .floating-chat-composer-field input::placeholder { color: #e5e7eb; }
[data-theme="dark"] .floating-chat-panel-close { color: var(--text-secondary); }
[data-theme="dark"] .floating-chat-panel-close:hover { background: var(--accent-soft); color: var(--text-primary); }
body.page-login .floating-chat-widget { display: none; }
body.page-login .floating-chat-panel { display: none; }

/* Navegação rápida flutuante: exclusiva das telas internas no celular. */
.mobile-bottom-nav {
    display: none;
}

.mobile-bottom-account-menu {
    display: none;
}

@media (max-width: 900px) {
    .floating-chat-button {
        width: 50px;
        height: 50px;
    }

    .floating-chat-widget {
        right: .75rem;
        bottom: calc(76px + env(safe-area-inset-bottom, 0px));
        width: 50px;
    }

    .floating-chat-button { touch-action: none; user-select: none; }
    .floating-chat-hint { display: none; }
    .floating-chat-panel {
        width: calc(100vw - 16px);
        max-width: none;
        height: min(410px, calc(100dvh - 120px));
    }

    body.page-internal {
        padding-bottom: 0;
    }

    .mobile-bottom-nav {
        position: fixed;
        z-index: 86;
        bottom: 0;
        left: 0;
        right: 0;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: center;
        min-height: 70px;
        padding: 7px 8px;
        border: none;
        border-radius: 0;
        border-top: 1px solid var(--border-color);
        gap: 4px;
        isolation: isolate;
        overflow: hidden;
        background: rgba(255, 255, 255, 0.38);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.1);
    }

.mobile-bottom-nav::before {
        display: none;
    }

    /* Mobile Toast Badge - flutuante na lateral direita */
    .toast-mobile-badge {
        position: fixed;
        z-index: 2000;
        right: 8px;
        top: 115px;
        transform: translateX(120%);
        width: 44px;
        height: 44px;
        border-radius: 10px;
        background: var(--toast-bg);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid var(--border-color);
        box-shadow: var(--toast-shadow);
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        pointer-events: none;
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .toast-mobile-badge.visible {
        opacity: 1;
        transform: translateX(0);
        pointer-events: auto;
    }

    .toast-mobile-badge .toast-icon {
        width: 24px;
        height: 24px;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .toast-mobile-badge .toast-icon .icon {
        width: 18px;
        height: 18px;
    }

    .toast-mobile-badge .toast-message {
        display: none;
    }

    .toast-mobile-badge .toast-icon {
        width: 24px;
        height: 24px;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .toast-mobile-badge .toast-icon .icon {
        width: 18px;
        height: 18px;
    }

    .toast-mobile-badge.success .toast-icon {
        background: rgba(22, 163, 74, 0.12);
        color: var(--success);
    }

    .toast-mobile-badge.error .toast-icon {
        background: rgba(220, 38, 38, 0.12);
        color: var(--danger);
    }

    .toast-mobile-badge.info .toast-icon {
        background: rgba(37, 99, 235, 0.12);
        color: var(--action-bg);
    }

    /* Toast expandido ao clicar no badge */
    .toast-mobile-expanded {
        position: fixed;
        z-index: 2001;
        right: 8px;
        top: 115px;
        transform: translateX(120%);
        width: min(340px, calc(100vw - 32px));
        background: var(--toast-bg);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        padding: 0.45rem 1rem;
        box-shadow: var(--toast-shadow);
        display: flex;
        align-items: center;
        gap: 0.75rem;
        font-size: 0.875rem;
        color: var(--text-primary);
        font-weight: 500;
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .toast-mobile-expanded.visible {
        opacity: 1;
        transform: translateX(0);
        pointer-events: auto;
    }

    .toast-mobile-expanded .toast-icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .toast-mobile-expanded .toast-icon .icon {
        width: 20px;
        height: 20px;
    }

    .toast-mobile-expanded .toast-message {
        flex: 1;
        min-width: 0;
        text-align: center;
        line-height: 1.4;
    }

    .toast-mobile-expanded .toast-close {
        width: 28px;
        height: 28px;
        border-radius: 6px;
        border: none;
        background: transparent;
        color: var(--text-muted);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        transition: all 0.2s;
        margin-top: 0px;
    }

    .toast-mobile-expanded .toast-close:hover {
        background: var(--accent-soft);
        color: var(--text-primary);
    }

    .toast-mobile-expanded.success .toast-icon {
        background: rgba(22, 163, 74, 0.12);
        color: var(--success);
    }

    .toast-mobile-expanded.error .toast-icon {
        background: rgba(220, 38, 38, 0.12);
        color: var(--danger);
    }

    .toast-mobile-expanded .toast-icon .icon {
        width: 18px;
        height: 18px;
    }

    [data-theme="dark"] .toast-mobile-expanded {
        background: var(--toast-bg);
        border-color: var(--border-color);
    }

    .mobile-bottom-nav > * {
        position: relative;
        z-index: 1;
    }

    .mobile-bottom-nav-item {
        position: relative;
        min-width: 0;
        height: 56px;
        padding: 5px 2px 4px;
        border: 0;
        border-radius: 17px;
        background: transparent;
        color: var(--text-muted);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        font: inherit;
        font-size: 0.64rem;
        font-weight: 650;
        line-height: 1;
        text-decoration: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: color 0.18s ease, transform 0.18s ease;
    }

    .mobile-bottom-nav-item::before {
        position: absolute;
        z-index: 0;
        inset: 1px 1px;
        border-radius: 14px;
        background: transparent;
        content: "";
        transition: background-color 0.18s ease;
    }

    .mobile-bottom-nav-item > span {
        position: relative;
        z-index: 1;
    }

    .mobile-bottom-nav-item:active {
        transform: scale(0.96);
    }

    .mobile-bottom-nav-item:hover,
    .mobile-bottom-nav-item:focus-visible,
    .mobile-bottom-nav-item.active {
        background: rgba(216, 222, 230, 0.82);
        color: var(--text-primary);
    }

    .mobile-bottom-nav-item:hover .icon,
    .mobile-bottom-nav-item:focus-visible .icon,
    .mobile-bottom-nav-item.active .icon {
        color: var(--text-secondary);
    }

    .mobile-bottom-nav-item:focus-visible {
        outline: none;
    }

    .mobile-bottom-nav-icon {
        position: relative;
        display: inline-flex;
        width: 27px;
        height: 27px;
        align-items: center;
        justify-content: center;
    }

    .mobile-bottom-nav-item:hover::before,
    .mobile-bottom-nav-item:focus-visible::before,
    .mobile-bottom-nav-item.active::before {
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .mobile-bottom-nav-ticket b {
        position: absolute;
        top: -3px;
        right: -8px;
        display: inline-flex;
        min-width: 17px;
        height: 17px;
        padding: 0 4px;
        align-items: center;
        justify-content: center;
        border: 2px solid rgba(255, 255, 255, 0.95);
        border-radius: 999px;
        background: var(--accent);
        color: #fff;
        font-size: 0.56rem;
        font-weight: 800;
        line-height: 1;
    }

    .mobile-bottom-nav-avatar {
        display: inline-flex;
        width: 34px;
        height: 34px;
        align-items: center;
        justify-content: center;
        border: 2px solid transparent;
        border-radius: 50%;
        background: var(--avatar-bg, rgba(37, 99, 235, 0.13));
        color: var(--avatar-color, var(--accent));
        font-size: 0.78rem;
        font-weight: 750;
        line-height: 1;
    }

    .mobile-bottom-nav-account.active .mobile-bottom-nav-avatar {
        border-color: var(--accent);
    }

    .mobile-bottom-nav-account::before{background:transparent!important}.mobile-bottom-nav-account-wrap.open .mobile-bottom-nav-avatar{border-color:var(--accent)}

    .mobile-bottom-nav-account-wrap{position:relative;min-width:0;height:56px}.mobile-bottom-nav-account-wrap>.mobile-bottom-nav-item{width:100%}
    .mobile-bottom-account-menu{position:fixed;z-index:120;display:block;width:min(230px,calc(100vw - 28px));padding:7px;border:1px solid rgba(255,255,255,.52);border-radius:16px;background-color:rgba(246,248,252,.58);box-shadow:0 16px 38px rgba(15,23,42,.18),inset 0 1px 0 rgba(255,255,255,.46);backdrop-filter:blur(16px) saturate(180%) contrast(105%);-webkit-backdrop-filter:blur(16px) saturate(180%) contrast(105%);opacity:0;visibility:hidden;pointer-events:none;transform:translateY(7px) scale(.98);transform-origin:bottom right;transition:opacity .16s ease,visibility .16s ease,transform .16s ease}
    .mobile-bottom-account-menu.open{opacity:1;visibility:visible;pointer-events:auto;transform:translateY(0) scale(1)}
    .mobile-bottom-account-head{display:flex;align-items:center;gap:9px;padding:8px 9px 10px;border-bottom:1px solid var(--separator-color)}
    .mobile-bottom-account-avatar{display:inline-flex;width:34px;height:34px;flex:0 0 34px;align-items:center;justify-content:center;border-radius:50%;background:var(--avatar-bg,rgba(37,99,235,.13));color:var(--avatar-color,var(--accent));font-size:.74rem;font-weight:750}
    .mobile-bottom-account-head>span:last-child{display:flex;min-width:0;flex-direction:column;gap:2px}.mobile-bottom-account-head strong,.mobile-bottom-account-head small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mobile-bottom-account-head strong{color:var(--text-primary);font-size:.72rem}.mobile-bottom-account-head small{color:var(--text-muted);font-size:.6rem}
    .mobile-bottom-account-info{display:grid;gap:5px;margin:0 4px;padding:9px 6px;border-bottom:1px solid var(--separator-color)}.mobile-bottom-account-info span{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--text-muted);font-size:.58rem}.mobile-bottom-account-info strong{font-weight:650}.mobile-bottom-account-info em{overflow:hidden;color:var(--text-secondary);font-style:normal;text-overflow:ellipsis;white-space:nowrap}.mobile-bottom-account-info span:first-child em{color:#16a34a}
    .mobile-bottom-account-menu>a,.mobile-bottom-account-menu>button,.mobile-bottom-account-menu form button{display:flex;width:100%;height:38px;padding:0 10px;border:0;border-radius:9px;align-items:center;gap:9px;background:transparent;color:var(--text-secondary);font:inherit;font-size:.7rem;font-weight:650;text-align:left;text-decoration:none;cursor:pointer}.mobile-bottom-account-menu>a:hover,.mobile-bottom-account-menu>a:focus-visible,.mobile-bottom-account-menu>button:hover,.mobile-bottom-account-menu>button:focus-visible,.mobile-bottom-account-menu form button:hover,.mobile-bottom-account-menu form button:focus-visible{background:rgba(37,99,235,.09);color:var(--accent);outline:none}.mobile-bottom-account-menu form{margin:0}.mobile-bottom-account-menu form button{color:#dc2626}

    [data-theme="dark"] .mobile-bottom-nav {
        background: rgba(24, 26, 31, 0.55);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
        border-top-color: var(--border-color);
    }

    [data-theme="dark"] .mobile-bottom-nav::before {
        display: none;
    }

    [data-theme="dark"] .mobile-bottom-nav-item {
        color: #fff;
    }

    [data-theme="dark"] .mobile-bottom-nav-item:hover,
    [data-theme="dark"] .mobile-bottom-nav-item:focus-visible {
        background: #1b1e24;
        color: #f4f4f5;
    }

    [data-theme="dark"] .mobile-bottom-nav-item.active {
        background: #292c32;
        color: #ffffff;
    }

    [data-theme="dark"] .mobile-bottom-nav-item:hover .icon,
    [data-theme="dark"] .mobile-bottom-nav-item:focus-visible .icon,
    [data-theme="dark"] .mobile-bottom-nav-item.active .icon {
        color: #fff;
    }

    [data-theme="dark"] .mobile-bottom-nav-icon .icon {
        stroke: currentColor;
    }

    [data-theme="dark"] .mobile-bottom-nav-item:hover::before,
    [data-theme="dark"] .mobile-bottom-nav-item:focus-visible::before,
    [data-theme="dark"] .mobile-bottom-nav-item.active::before {
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    [data-theme="dark"] .mobile-bottom-account-menu{border-color:rgba(255,255,255,.12);background-color:rgba(24,26,31,.55);box-shadow:0 18px 42px rgba(0,0,0,.44),inset 0 1px 0 rgba(255,255,255,.08)}
    [data-theme="dark"] .mobile-bottom-account-menu>a:hover,[data-theme="dark"] .mobile-bottom-account-menu>a:focus-visible,[data-theme="dark"] .mobile-bottom-account-menu>button:hover,[data-theme="dark"] .mobile-bottom-account-menu>button:focus-visible,[data-theme="dark"] .mobile-bottom-account-menu form button:hover,[data-theme="dark"] .mobile-bottom-account-menu form button:focus-visible{background:rgba(96,165,250,.13)}

    

    [data-theme="dark"] .mobile-bottom-nav-ticket b {
        border-color: rgba(29, 31, 36, 0.96);
    }

    @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
        .mobile-bottom-account-menu{background-color:#fff}
        [data-theme="dark"] .mobile-bottom-account-menu{background-color:#1d1f24}
    }

    .page-internal .app-topbar,
    .page-internal .app-topbar.scrolled {
        background-color: rgba(246, 248, 252, 0.58);
        backdrop-filter: blur(18px) saturate(180%) contrast(105%);
        -webkit-backdrop-filter: blur(18px) saturate(180%) contrast(105%);
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.46), 0 8px 22px rgba(15, 23, 42, 0.06);
    }

    [data-theme="dark"] .page-internal .app-topbar,
    [data-theme="dark"] .page-internal .app-topbar.scrolled {
        background-color: rgba(24, 26, 31, 0.55);
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 22px rgba(0, 0, 0, 0.18);
    }

    @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
        .page-internal .app-topbar,.page-internal .app-topbar.scrolled{background-color:#fff}
        [data-theme="dark"] .page-internal .app-topbar,[data-theme="dark"] .page-internal .app-topbar.scrolled{background-color:#111318}
        .mobile-bottom-nav{background-color:var(--bg-card-right)}
        [data-theme="dark"] .mobile-bottom-nav{background-color:var(--bg-card-right)}
    }

    .system-footer {
        margin-bottom: 12px;
        flex-direction: column;
        gap: 0.25rem;
        text-align: center;
        padding: 0.75rem 1rem 0.5rem;
    }

    .system-footer span {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 360px) {
    .mobile-bottom-nav {
        padding-inline: 4px;
    }

    .mobile-bottom-nav-item {
        font-size: 0.59rem;
    }
}

/* Superfícies mobile limpas; o cabeçalho desfoca somente após rolar. */
@media (max-width: 900px) {
    .page-internal .app-topbar {
        background: #fff;
        background-image: none;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: none;
    }

    .page-internal .app-topbar.scrolled {
        background: rgba(255, 255, 255, 0.38);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    }

    .app-sidebar,
    html.sidebar-state-collapsed .app-sidebar,
    .app-sidebar.collapsed {
        border-color: var(--border-color);
        background: #fff;
        background-image: none;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: none;
    }

    .mobile-bottom-account-menu {
        background: rgba(255, 255, 255, 0.86);
        background-image: none;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
    }

    [data-theme="dark"] .page-internal .app-topbar {
        background: #111318;
        background-image: none;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: none;
    }

    [data-theme="dark"] .page-internal .app-topbar.scrolled {
        background: rgba(17, 19, 24, 0.38);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
    }

    [data-theme="dark"] .app-sidebar,
    [data-theme="dark"] html.sidebar-state-collapsed .app-sidebar,
    [data-theme="dark"] .app-sidebar.collapsed {
        border-color: var(--border-color);
        background: #111318;
        background-image: none;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: none;
    }

    [data-theme="dark"] .mobile-bottom-account-menu {
        background: rgba(29, 31, 36, 0.86);
        background-image: none;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 16px 38px rgba(0, 0, 0, 0.38);
    }

    .app-sidebar,
    html.sidebar-state-collapsed .app-sidebar,
    .app-sidebar.collapsed,
    .mobile-bottom-account-menu {
        background: rgba(255, 255, 255, 0.38);
        background-image: none;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    [data-theme="dark"] .app-sidebar,
    [data-theme="dark"] html.sidebar-state-collapsed .app-sidebar,
    [data-theme="dark"] .app-sidebar.collapsed,
    [data-theme="dark"] .mobile-bottom-account-menu {
        background: rgba(17, 19, 24, 0.38);
        background-image: none;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .sidebar-overlay {
        left: min(82vw, 290px);
        background: rgba(0, 0, 0, 0.80);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        opacity: 0;
        transition: opacity 0.16s ease;
    }

    .sidebar-overlay.visible {
        opacity: 1;
        transition-delay: 0s;
    }

    .mobile-bottom-nav-item:hover::before,
    .mobile-bottom-nav-item:focus-visible::before,
    .mobile-bottom-nav-item.active::before {
        background: rgba(229, 232, 235, 0.48);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    [data-theme="dark"] .mobile-bottom-nav-item:hover::before,
    [data-theme="dark"] .mobile-bottom-nav-item:focus-visible::before,
    [data-theme="dark"] .mobile-bottom-nav-item.active::before {
        background: rgba(41, 44, 50, 0.48);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    [data-theme="light"] .app-sidebar.open .sidebar-link:hover,
    [data-theme="light"] .app-sidebar.open .sidebar-link.active {
        background: rgba(229, 232, 235, 0.48);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    [data-theme="dark"] .app-sidebar.open .sidebar-link:hover {
        background: rgba(27, 30, 36, 0.5);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    [data-theme="dark"] .app-sidebar.open .sidebar-link.active {
        background: rgba(41, 44, 50, 0.5);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .page-internal .app-topbar.scrolled .topbar-search,
    .page-internal .app-topbar.scrolled .topbar-search:hover,
    .page-internal .app-topbar.scrolled .topbar-search:focus-within {
        border-color: rgba(15, 23, 42, 0.14);
        background: rgba(255, 255, 255, 0.32);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: none;
    }

    [data-theme="dark"] .page-internal .app-topbar.scrolled .topbar-search,
    [data-theme="dark"] .page-internal .app-topbar.scrolled .topbar-search:hover,
    [data-theme="dark"] .page-internal .app-topbar.scrolled .topbar-search:focus-within {
        border-color: rgba(255, 255, 255, 0.12);
        background: rgba(17, 19, 24, 0.32);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: none;
    }

    .page-internal .app-topbar.scrolled,
    .app-sidebar,
    html.sidebar-state-collapsed .app-sidebar,
    .app-sidebar.collapsed,
    .mobile-bottom-account-menu,
    .mobile-bottom-nav-item:hover::before,
    .mobile-bottom-nav-item:focus-visible::before,
    .mobile-bottom-nav-item.active::before,
    .app-sidebar.open .sidebar-link:hover,
    .app-sidebar.open .sidebar-link.active,
    .page-internal .app-topbar.scrolled .topbar-search,
    .page-internal .app-topbar.scrolled .topbar-search:hover,
    .page-internal .app-topbar.scrolled .topbar-search:focus-within {
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .search-results-dropdown,
    .spotlight-panel {
        border-color: rgba(15, 23, 42, 0.14);
        background: rgba(255, 255, 255, 0.38);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
    }

    [data-theme="dark"] .search-results-dropdown,
    [data-theme="dark"] .spotlight-panel {
        border-color: rgba(255, 255, 255, 0.12);
        background: rgba(17, 19, 24, 0.38);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 16px 38px rgba(0, 0, 0, 0.38);
    }

    .spotlight-overlay,
    [data-theme="dark"] .spotlight-overlay {
        background: rgba(15, 23, 42, 0.12);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .app-sidebar,
    html.sidebar-state-collapsed .app-sidebar,
    .app-sidebar.collapsed {
        height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
    }

    .app-sidebar .sidebar-header {
        flex: 0 0 auto;
    }

    .app-sidebar .sidebar-nav {
        min-height: 0;
        flex: 1 1 auto;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .app-sidebar .sidebar-footer {
        position: relative;
        z-index: 3;
        flex: 0 0 auto;
        margin-top: auto;
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
        background: transparent;
    }

    .mobile-bottom-account-menu .mobile-bottom-account-head {
        background: transparent;
        background-image: none;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: none;
    }

    .mobile-bottom-account-menu {
        isolation: isolate;
        background: transparent;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .mobile-bottom-account-menu::before {
        position: absolute;
        z-index: -1;
        inset: 0;
        border-radius: inherit;
        background: rgba(255, 255, 255, 0.38);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        content: "";
        pointer-events: none;
    }

    [data-theme="dark"] .mobile-bottom-account-menu {
        background: transparent;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    [data-theme="dark"] .mobile-bottom-account-menu::before {
        background: rgba(17, 19, 24, 0.38);
    }

    .page-internal .app-topbar.scrolled,
    .app-sidebar,
    html.sidebar-state-collapsed .app-sidebar,
    .app-sidebar.collapsed,
    .mobile-bottom-account-menu::before,
    .mobile-bottom-nav-item:hover::before,
    .mobile-bottom-nav-item:focus-visible::before,
    .mobile-bottom-nav-item.active::before,
    .app-sidebar.open .sidebar-link:hover,
    .app-sidebar.open .sidebar-link.active,
    .page-internal .app-topbar.scrolled .topbar-search,
    .page-internal .app-topbar.scrolled .topbar-search:hover,
    .page-internal .app-topbar.scrolled .topbar-search:focus-within,
    .search-results-dropdown,
    .spotlight-panel,
    .sidebar-user-dropdown {
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .sidebar-user-dropdown,
    [data-theme="light"] .sidebar-user-dropdown {
        border-color: rgba(15, 23, 42, 0.14);
        background: rgba(255, 255, 255, 0.38);
        background-image: none;
        box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
    }

    [data-theme="dark"] .sidebar-user-dropdown {
        border-color: rgba(255, 255, 255, 0.12);
        background: rgba(17, 19, 24, 0.38);
        background-image: none;
        box-shadow: 0 16px 38px rgba(0, 0, 0, 0.38);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .sidebar-user-dropdown-head,
    [data-theme="dark"] .sidebar-user-dropdown-head,
    .sidebar-user-dropdown-main,
    .sidebar-user-dropdown-info {
        background: transparent;
        background-image: none;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: none;
    }
}
[data-theme="dark"] button.sidebar-logout,[data-theme="dark"] button.sidebar-logout svg{color:#ef4444}
.auth-register-context{display:flex;flex-direction:column;gap:3px;margin:0 0 14px;padding:10px 12px;border:1px solid var(--separator-color);border-radius:8px;background:var(--bg-subtle)}.auth-register-context strong{color:var(--text-primary);font-size:11px}.auth-register-context span{color:var(--text-muted);font-size:9px;line-height:1.5}#registerForm input[readonly]{cursor:not-allowed;opacity:.78}

/* Valor único e definitivo para todos os desfoques da navegação mobile. */
@media (max-width: 900px) {
    .page-internal .app-topbar.scrolled,
    .app-sidebar,
    html.sidebar-state-collapsed .app-sidebar,
    .app-sidebar.collapsed,
    .mobile-bottom-account-menu::before,
    .mobile-bottom-nav-item:hover::before,
    .mobile-bottom-nav-item:focus-visible::before,
    .mobile-bottom-nav-item.active::before,
    .app-sidebar.open .sidebar-link:hover,
    .app-sidebar.open .sidebar-link.active,
    .page-internal .app-topbar.scrolled .topbar-search,
    .page-internal .app-topbar.scrolled .topbar-search:hover,
    .page-internal .app-topbar.scrolled .topbar-search:focus-within,
    .search-results-dropdown,
    .spotlight-panel,
    .sidebar-user-dropdown {
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .sidebar-user-dropdown,
    [data-theme="light"] .sidebar-user-dropdown {
        background: rgba(255, 255, 255, 0.68);
    }

    [data-theme="dark"] .sidebar-user-dropdown {
        background: rgba(17, 19, 24, 0.68);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .mobile-bottom-account-menu::before {
        background: rgba(255, 255, 255, 0.68);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    [data-theme="dark"] .mobile-bottom-account-menu::before {
        background: rgba(17, 19, 24, 0.68);
    }

    .sidebar-user-dropdown-head,
    [data-theme="dark"] .sidebar-user-dropdown-head,
    .sidebar-user-dropdown-main,
    .sidebar-user-dropdown-info {
        background: transparent;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

}

/* Vidro consistente em desktop e mobile. Os dropdowns ficam no body para
   desfocar o conteúdo real atrás deles, sem conflito de composição. */
.sidebar-user-dropdown.sidebar-user-dropdown-portal {
    position: fixed;
    z-index: 3200;
    display: none;
    max-height: min(420px, calc(100dvh - 32px));
    overflow-y: auto;
    border-color: rgba(15, 23, 42, 0.16);
    background: rgba(246, 248, 252, 0.52);
    background-image: none;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.42);
    backdrop-filter: blur(20px) saturate(145%);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
}

.sidebar-user-dropdown.sidebar-user-dropdown-portal.open {
    display: block;
}

[data-theme="dark"] .sidebar-user-dropdown.sidebar-user-dropdown-portal {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(17, 19, 24, 0.52);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px) saturate(145%);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
}

.sidebar-user-dropdown-portal .sidebar-user-dropdown-head,
.sidebar-user-dropdown-portal .sidebar-user-dropdown-main,
.sidebar-user-dropdown-portal .sidebar-user-dropdown-info {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.search-results-dropdown.search-results-dropdown-portal {
    position: fixed;
    z-index: 3200;
    display: none;
    max-width: calc(100vw - 16px);
    border-color: rgba(15, 23, 42, 0.16);
    background: rgba(246, 248, 252, 0.38);
    background-image: none;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.42);
    backdrop-filter: blur(20px) saturate(145%);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
}

.search-results-dropdown.search-results-dropdown-portal.open {
    display: block;
}

[data-theme="dark"] .search-results-dropdown.search-results-dropdown-portal {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(17, 19, 24, 0.38);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px) saturate(145%);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
}

.spotlight-overlay,
[data-theme="dark"] .spotlight-overlay {
    overflow: hidden;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.spotlight-panel,
[data-theme="dark"] .spotlight-panel {
    background: rgba(246, 248, 252, 0.38);
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.80), 0 24px 72px rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(20px) saturate(145%);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
}

[data-theme="dark"] .spotlight-panel {
    background: rgba(17, 19, 24, 0.38);
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.80), 0 24px 72px rgba(0, 0, 0, 0.52);
}

/* Os elementos internos não podem ter fundo sólido, pois encobrem o vidro
   da superfície principal do dropdown e do Spotlight. */
.search-results-dropdown-portal .spotlight-results,
.spotlight-panel .spotlight-search,
.spotlight-panel .spotlight-results {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    backdrop-filter: blur(20px) saturate(145%);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
}

[data-theme="dark"] .search-results-dropdown-portal .spotlight-results,
[data-theme="dark"] .spotlight-panel .spotlight-search,
[data-theme="dark"] .spotlight-panel .spotlight-results {
    background: transparent !important;
    background-color: transparent !important;
    backdrop-filter: blur(20px) saturate(145%);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
}

@media (min-width: 901px) {
    .page-internal .app-topbar,
    .app-sidebar {
        background: rgba(246, 248, 252, 0.72);
        backdrop-filter: blur(20px) saturate(135%);
        -webkit-backdrop-filter: blur(20px) saturate(135%);
    }

    [data-theme="dark"] .page-internal .app-topbar,
    [data-theme="dark"] .app-sidebar {
        background: rgba(17, 19, 24, 0.72);
        backdrop-filter: blur(20px) saturate(135%);
        -webkit-backdrop-filter: blur(20px) saturate(135%);
    }

    .page-internal .topbar-search {
        background: rgba(246, 248, 252, 0.58);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    [data-theme="dark"] .page-internal .topbar-search {
        background: rgba(17, 19, 24, 0.58);
    }

    .app-sidebar .sidebar-link:hover,
    .app-sidebar .sidebar-link.active {
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
}

/* Vidro da Central de Notificações, alinhado aos demais dropdowns. */
.notification-center,
[data-theme="light"] .notification-center {
    border-color: rgba(15, 23, 42, 0.16);
    background: rgba(246, 248, 252, 0.62);
    background-image: none;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.42);
    backdrop-filter: blur(20px) saturate(145%);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
}

[data-theme="dark"] .notification-center {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(17, 19, 24, 0.88);
    background-image: none;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px) saturate(145%);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
}

.notification-center::before,
[data-theme="light"] .notification-center::before {
    border-color: rgba(15, 23, 42, 0.16);
    background: rgba(246, 248, 252, 0.94);
}

[data-theme="dark"] .notification-center::before {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(17, 19, 24, 0.94);
}

.notification-center .notification-head,
.notification-center .notification-list,
.notification-center .notification-footer {
    background: transparent;
    background-image: none;
}

/* O portal remove o painel do contexto de blur do cabeçalho. Assim o vidro
   desfoca o conteúdo real que está atrás da Central de Notificações. */
.notification-center.notification-center-portal {
    position: fixed;
    right: auto;
    z-index: 3300;
    background: rgba(246, 248, 252, 0.68);
    backdrop-filter: blur(20px) saturate(145%);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
}

[data-theme="dark"] .notification-center.notification-center-portal {
    background: rgba(17, 19, 24, 0.68);
    backdrop-filter: blur(20px) saturate(145%);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
}

.notification-center.notification-center-portal::before {
    right: auto;
    left: var(--notification-arrow-left, 1.25rem);
}

.notification-center.notification-center-portal.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Hover compacto do acesso ao histórico de chamados. */
.notification-center .notification-footer,
[data-theme="light"] .notification-center .notification-footer,
[data-theme="dark"] .notification-center .notification-footer,
.notification-center .notification-footer:hover,
.notification-center .notification-footer:focus-visible {
    background: transparent;
}

.notification-footer > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.55rem;
    border-radius: 6px;
    transition: background-color 0.16s ease, color 0.16s ease;
}

[data-theme="light"] .notification-footer:hover > span,
[data-theme="light"] .notification-footer:focus-visible > span {
    background: #eef1f5;
    color: #25282e;
}

[data-theme="dark"] .notification-footer:hover > span,
[data-theme="dark"] .notification-footer:focus-visible > span {
    background: #292c32;
    color: #ffffff;
}

/* A página Chamados responde à largura útil ao lado da sidebar, não apenas
   à largura total da janela. Isso impede a grade e a tabela de alargarem a página. */
.app-content.tickets-reference {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.tickets-reference > .dashboard-reference-stats {
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}

.tickets-reference-card,
.tickets-reference-toolbar,
.tickets-reference-tabs,
.tickets-reference-tools,
.tickets-reference-table-wrap,
.tickets-reference-tip {
    min-width: 0;
    max-width: 100%;
}

.tickets-reference-tabs {
    overflow-x: auto;
    scrollbar-width: thin;
}

.tickets-reference-table-wrap {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}

/* Categorias e Departamentos respondem à largura útil do conteúdo. */
.app-content.categories-reference,
.app-content.departments-reference {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    container-type: inline-size;
}

.categories-reference-stats,
.departments-reference .stats-grid {
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}

.categories-reference-stat,
.departments-reference .stat-card,
.categories-reference-stat > div,
.departments-reference .stat-content,
.categories-overview,
.categories-overview-main,
.categories-overview-side,
.departments-overview,
.departments-overview-main,
.departments-overview-side,
.categories-overview-grid,
.departments-overview-grid {
    min-width: 0;
    max-width: 100%;
}

.categories-overview-grid,
.departments-overview-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}

.categories-overview-header,
.departments-overview-header,
.categories-overview-actions,
.departments-overview-actions {
    min-width: 0;
}

@container (max-width: 900px) {
    .categories-reference-stats,
    .departments-reference .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .categories-overview,
    .departments-overview {
        grid-template-columns: minmax(0, 1fr);
    }

    .categories-overview-side,
    .departments-overview-side {
        height: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: none;
    }

    .categories-overview-header,
    .departments-overview-header {
        align-items: stretch;
        flex-direction: column;
    }

    .categories-overview-actions,
    .departments-overview-actions {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .categories-overview-actions .categories-reference-search,
    .departments-overview-search {
        width: auto;
        min-width: 180px;
        flex: 1 1 230px;
    }

    .categories-overview-grid,
    .departments-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@container (max-width: 560px) {
    .categories-reference-stats,
    .departments-reference .stats-grid,
    .categories-overview-grid,
    .departments-overview-grid,
    .categories-overview-side,
    .departments-overview-side {
        grid-template-columns: minmax(0, 1fr);
    }

    .categories-overview-actions .categories-reference-search,
    .departments-overview-search {
        width: 100%;
        flex-basis: 100%;
    }
}

/* O painel responde ao espaço real restante ao lado da sidebar. Em zoom,
   tablet e janelas intermediárias, a largura da viewport não representa a
   largura disponível para os cards. */
.app-content.dashboard-reference {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    container-type: inline-size;
}

.dashboard-reference-stats,
.dashboard-reference-workspace,
.dashboard-reference-stat,
.dashboard-reference-stat-copy,
.dashboard-reference-primary,
.dashboard-reference-secondary {
    min-width: 0;
    max-width: 100%;
}

.dashboard-reference-stat-copy {
    overflow: hidden;
}

.dashboard-reference-stat-label,
.dashboard-reference-trend {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

@container (max-width: 1050px) {
    .dashboard-reference-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-reference-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-reference-secondary {
        height: auto;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-rows: none;
    }
}

@container (max-width: 690px) {
    .dashboard-reference-secondary {
        grid-template-columns: minmax(0, 1fr);
    }
}

@container (max-width: 470px) {
    .dashboard-reference-stats {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Estado atual da conta no menu do usuário. */
.sidebar-user-dropdown-info > span:first-child em,
.mobile-bottom-account-info > span:first-child em {
    color: #16a34a;
    font-weight: 700;
}

[data-theme="dark"] .sidebar-user-dropdown-info > span:first-child em,
[data-theme="dark"] .mobile-bottom-account-info > span:first-child em {
    color: #4ade80;
}

/* Recuperação de senha com o mesmo vidro e recorte escuro do Spotlight. */
#forgotModal.modal-overlay,
[data-theme="dark"] .page-login #forgotModal.modal-overlay {
    overflow: hidden;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: none;
}

#forgotModal.modal-overlay.visible,
[data-theme="dark"] .page-login #forgotModal.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#forgotModal .modal-card {
    border-color: rgba(255, 255, 255, 0.58);
    background: rgba(226, 231, 239, 0.30);
    background-image: none;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.80), 0 24px 72px rgba(15, 23, 42, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(30px) saturate(130%);
    -webkit-backdrop-filter: blur(30px) saturate(130%);
    transform: none;
    transition: none;
}

#forgotModal.modal-overlay.visible .modal-card {
    transform: none;
}

[data-theme="dark"] .page-login #forgotModal .modal-card {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(17, 19, 24, 0.38);
    background-image: none;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.80), 0 24px 72px rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(20px) saturate(145%);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
}

#forgotModal .input-icon-wrap,
#forgotModal .input-field {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(30px) saturate(130%);
    -webkit-backdrop-filter: blur(30px) saturate(130%);
}

#forgotModal .input-icon-wrap {
    border-radius: 10px;
    overflow: hidden;
}

#forgotModal .input-icon-wrap .input-field {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

[data-theme="dark"] .page-login #forgotModal .input-icon-wrap {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(17, 19, 24, 0.42);
    backdrop-filter: blur(20px) saturate(145%);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
}

#forgotModal .btn-submit {
    border: 1px solid rgba(15, 23, 42, 0.20);
    background: rgba(37, 40, 46, 0.60);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(30px) saturate(130%);
    -webkit-backdrop-filter: blur(30px) saturate(130%);
}

[data-theme="light"] .page-login #forgotModal .modal-close {
    border-color: rgba(15, 23, 42, 0.14);
    background: rgba(255, 255, 255, 0.20);
    backdrop-filter: blur(30px) saturate(130%);
    -webkit-backdrop-filter: blur(30px) saturate(130%);
}

[data-theme="dark"] .page-login #forgotModal .btn-submit {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(52, 56, 64, 0.62);
    color: #fff;
    backdrop-filter: blur(20px) saturate(145%);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
}

[data-theme="dark"] .page-login #forgotModal .btn-submit:hover {
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(65, 70, 80, 0.72);
}

/* No tema claro, o modal compartilha a mesma cor de ação da tela de acesso. */
[data-theme="light"] .page-login #forgotModal .modal-icon {
    border: 1px solid rgba(255, 255, 255, 0.32);
    background: rgba(100, 116, 139, 0.88);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(100, 116, 139, 0.24);
    backdrop-filter: blur(30px) saturate(130%);
    -webkit-backdrop-filter: blur(30px) saturate(130%);
}

[data-theme="light"] .page-login #forgotModal .btn-submit {
    border-color: rgba(89, 103, 122, 0.82);
    background: rgba(100, 116, 139, 0.82);
    color: #ffffff;
    box-shadow: 0 8px 22px rgba(100, 116, 139, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.20);
}

[data-theme="light"] .page-login #forgotModal .btn-submit:hover {
    border-color: rgba(73, 87, 104, 0.90);
    background: rgba(82, 97, 116, 0.90);
    box-shadow: 0 10px 26px rgba(82, 97, 116, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

/* Solicitar acesso desativado preserva a identidade sem parecer clicável. */
[data-theme="light"] .page-login #btnRegister:disabled:not(.loading) {
    border-color: #64748b;
    background: #64748b;
    color: #ffffff;
    opacity: 0.52;
    box-shadow: none;
}

/* Teste da cor do "Pro" também nas ações do modo escuro. */
[data-theme="dark"] .page-login .tab-btn.active,
[data-theme="dark"] .page-login #btnLogin,
[data-theme="dark"] .page-login #btnRegister:not(:disabled) {
    border-color: #596779;
    background: #3f4856;
    color: #f8fafc;
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.30);
}

[data-theme="dark"] .page-login .tab-btn.active:hover,
[data-theme="dark"] .page-login #btnLogin:hover,
[data-theme="dark"] .page-login #btnRegister:not(:disabled):hover {
    border-color: #68778a;
    background: #4c5868;
    color: #ffffff;
    box-shadow: 0 9px 22px rgba(0, 0, 0, 0.36);
}

[data-theme="dark"] .page-login #forgotModal .modal-icon {
    border: 1px solid rgba(89, 103, 121, 0.62);
    background: rgba(63, 72, 86, 0.88);
    color: #f8fafc;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(20px) saturate(145%);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
}

[data-theme="dark"] .page-login #forgotModal .btn-submit {
    border-color: rgba(89, 103, 121, 0.88);
    background: rgba(63, 72, 86, 0.84);
    color: #f8fafc;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .page-login #forgotModal .btn-submit:hover {
    border-color: rgba(104, 119, 138, 0.94);
    background: rgba(76, 88, 104, 0.92);
    color: #ffffff;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .page-login #btnRegister:disabled:not(.loading) {
    border-color: #596779;
    background: #3f4856;
    color: #f8fafc;
    opacity: 0.45;
    box-shadow: none;
}

/* Sidebar claro: altera somente o fundo do hover e do item ativo. */
[data-theme="light"] .app-sidebar .sidebar-link:hover {
    background: #e7ebf0;
}

[data-theme="light"] .app-sidebar .sidebar-link.active {
    background: #d8dee6;
}

@media (max-width: 768px) {
    [data-theme="light"] .app-sidebar.open .sidebar-link:hover {
        background: rgba(231, 235, 240, 0.78);
    }

    [data-theme="light"] .app-sidebar.open .sidebar-link.active {
        background: rgba(216, 222, 230, 0.82);
    }
}

/* Central de notificações: atendimento e atualizações em áreas separadas. */
.notification-tabs {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin: 7px 7px 1px;
    padding: 4px;
    border: 1px solid var(--separator-color);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.04);
}

[data-theme="dark"] .notification-tabs {
    background: rgba(255, 255, 255, 0.045);
}

.notification-tabs button {
    min-width: 0;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}

.notification-tabs button:hover {
    color: var(--text-primary);
    background: rgba(100, 116, 139, 0.09);
}

.notification-tabs button.active {
    color: var(--text-primary);
    background: var(--bg-card-right);
    box-shadow: 0 2px 7px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] .notification-tabs button.active {
    background: rgba(255, 255, 255, 0.09);
}

.notification-tabs button b {
    min-width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    padding: 1px 4px 0;
    border: 0;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    box-sizing: border-box;
}

.notification-center [hidden] {
    display: none !important;
}

.notification-empty {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    padding: 20px;
    color: var(--text-muted);
    text-align: center;
}

.notification-empty i {
    margin-bottom: 4px;
    font-size: 27px;
}

.notification-empty strong {
    color: var(--text-primary);
    font-size: 11px;
}

.notification-empty span {
    font-size: 9px;
}

.notification-update {
    grid-template-columns: 34px minmax(0, 1fr) auto;
}

.notification-update-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--action-soft);
    color: var(--action-bg);
    font-size: 16px;
}

.notification-update.unread .notification-update-icon {
    background: var(--action-bg);
    color: var(--action-text);
}

/* Popup reaparece até o usuário optar explicitamente por não exibi-lo novamente. */
body.release-popup-open {
    overflow: hidden;
}

.release-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 5200;
    display: grid;
    place-items: center;
    padding: 18px;
    overflow: hidden;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.release-popup-overlay.open {
    opacity: 1;
    visibility: visible;
}

.release-popup {
    position: relative;
    width: min(680px, calc(100vw - 28px));
    max-height: calc(100vh - 36px);
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.25);
    border-radius: 28px;
    background: transparent;
    box-shadow: 0 20px 52px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.46), inset 0 -1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    will-change: transform, backdrop-filter;
    isolation: isolate;
    transform: translateY(10px) scale(0.985);
    transition: transform 0.18s ease;
}

[data-theme="dark"] .release-popup {
    border-color: rgba(255, 255, 255, 0.08);
    background: transparent;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1px 0 rgba(255, 255, 255, 0.03);
}

.release-popup-overlay.open .release-popup {
    transform: translateY(0) scale(1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.release-popup-close {
    position: absolute;
    top: 13px;
    right: 13px;
    z-index: 2;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid var(--separator-color);
    border-color: rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.24);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-primary);
    cursor: pointer;
}

.release-popup-drag {
    position: absolute;
    top: 13px;
    right: 52px;
    z-index: 3;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(15, 23, 42, 0.16);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.24);
    color: var(--text-primary);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: grab;
    touch-action: none;
    user-select: none;
}

[data-theme="dark"] .release-popup-drag {
    border-color: rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.10);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.release-popup-drag:hover {
    background: var(--action-soft);
    color: var(--text-primary);
}

.release-popup-drag:active,
.release-popup.is-dragging .release-popup-drag {
    cursor: grabbing;
}

.release-popup.is-dragging {
    transform: none !important;
    transition: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.release-popup-overlay.open .release-popup.is-dragging {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

[data-theme="dark"] .release-popup-close {
    border-color: rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.10);
}

.release-popup-close:hover {
    background: var(--action-soft);
    color: var(--text-primary);
}

.release-popup-visual {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    padding: 32px 20px;
    border-right: 1px solid rgba(15, 23, 42, 0.12);
    background: transparent;
    color: var(--text-primary);
    text-align: center;
}

.release-popup-visual > span {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    margin-bottom: 6px;
    border-radius: 20px;
    background: var(--action-bg);
    color: var(--action-text);
    font-size: 34px;
    box-shadow: 0 12px 30px color-mix(in srgb, var(--action-bg) 30%, transparent);
}

.release-popup-visual small {
    color: var(--text-secondary);
    font-size: 9px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.release-popup-visual strong {
    font-size: 13px;
}

.release-popup-visual-info {
    display: grid;
    gap: 6px;
    margin-top: 8px;
}

.release-popup-visual-info span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--text-primary);
    font-size: 9px;
    line-height: 1.25;
}

.release-popup-visual-info i {
    color: var(--text-primary);
    opacity: 1;
    font-size: 13px;
    font-weight: 700;
    filter: none;
}

.release-popup-content {
    min-width: 0;
    overflow-y: auto;
    padding: 34px 38px 30px 30px;
}

.release-popup-date {
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.release-popup-content h2 {
    margin: 7px 0 6px;
    color: var(--text-primary);
    font-size: 21px;
    line-height: 1.2;
}

.release-popup-content > p {
    margin: 0;
    color: var(--text-primary);
    font-size: 11.5px;
    line-height: 1.55;
}

.release-popup-content ul {
    display: grid;
    gap: 8px;
    margin: 16px 0 0;
    padding: 14px 0 0;
    border-top: 1px solid rgba(15, 23, 42, 0.14);
    list-style: none;
}

.release-popup-content li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--text-primary);
    font-size: 11.5px;
    line-height: 1.5;
}

.release-popup-content li i {
    margin-top: 1px;
    color: #10b981;
    font-size: 14px;
}

.release-popup-preference {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 16px;
    padding: 11px 12px;
    border: 1px solid var(--separator-color);
    border-radius: 8px;
    background: rgba(100, 116, 139, 0.07);
    cursor: pointer;
}

.release-popup-preference input {
    appearance: none;
    -webkit-appearance: none;
    width: 17px;
    height: 17px;
    display: grid;
    place-items: center;
    flex: 0 0 17px;
    margin: 0;
    border: 1px solid var(--checkbox-border);
    border-radius: 4px;
    background: var(--input-bg);
    color: #fff;
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.release-popup-preference input::before {
    content: "";
    width: 8px;
    height: 4px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-1px) rotate(-45deg) scale(0);
    transition: transform .14s ease;
}

.release-popup-preference input:checked {
    border-color: var(--action-border);
    background: var(--action-bg);
}

.release-popup-preference input:checked::before {
    transform: translateY(-1px) rotate(-45deg) scale(1);
}

.release-popup-preference input:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--action-soft);
}

[data-theme="dark"] .release-popup-preference input {
    border-color: #626b78;
    background: #15181d;
}

[data-theme="dark"] .release-popup-preference input:checked {
    border-color: #8290a3;
    background: #64748b;
}

.release-popup-preference > span {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.release-popup-preference strong {
    color: var(--text-primary);
    font-size: 10px;
}

.release-popup-preference small {
    color: var(--text-muted);
    font-size: 9px;
    line-height: 1.4;
}

.release-popup-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

.release-popup-actions button,
.release-popup-actions a {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 12px;
    border-radius: 7px;
    font: inherit;
    font-size: 10px;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
    background-image: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.release-popup-dismiss {
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(246, 248, 252, 0.16);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.42);
    color: var(--text-primary);
}

[data-theme="dark"] .release-popup-dismiss {
    border-color: rgba(255, 255, 255, 0.10);
    background: rgba(17, 19, 24, 0.16);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.release-popup-dismiss:hover {
    background: var(--action-soft);
    color: var(--text-primary);
}

.release-popup-dismiss:focus,
.release-popup-dismiss:focus-visible {
    outline: none;
    outline-offset: 0;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

[data-theme="dark"] .release-popup-dismiss:focus,
[data-theme="dark"] .release-popup-dismiss:focus-visible {
    outline: none;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.release-popup-details {
    border: 1px solid rgba(15, 23, 42, 0.16);
    background: rgba(246, 248, 252, 0.38);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.42);
    color: var(--text-primary);
}

[data-theme="dark"] .release-popup-details {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(17, 19, 24, 0.38);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .release-popup-visual {
    border-right-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .release-popup-content ul {
    border-top-color: rgba(255, 255, 255, 0.10);
}

.release-popup-details:hover {
    background: var(--action-soft);
    color: var(--text-primary);
}

@media (max-width: 600px) {
    .release-popup {
        grid-template-columns: 1fr;
    }

    .release-popup-visual {
        min-height: 130px;
        padding: 22px 55px 17px 20px;
        border-right: 0;
        border-bottom: 1px solid var(--separator-color);
    }

    .release-popup-visual > span {
        width: 50px;
        height: 50px;
        margin: 0;
        border-radius: 14px;
        font-size: 25px;
    }

    .release-popup-content {
        padding: 22px 18px 18px;
    }

    .release-popup-content h2 {
        font-size: 18px;
    }

    .release-popup-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .release-popup-actions button,
    .release-popup-actions a {
        width: 100%;
    }
}

/* Vidro definitivo do menu de conta no cabeçalho mobile. */
@media (max-width: 900px) {
    .app-topbar .topbar-actions { gap: .35rem; }
    .app-topbar .mobile-spotlight-trigger { display: flex; }
    .app-topbar #fullscreenToggle { display: none !important; }

    [data-theme="light"] .topbar-avatar-menu.avatar-dropdown-menu,
    .topbar-avatar-menu.avatar-dropdown-menu {
        border-color: rgba(15, 23, 42, .16) !important;
        background: rgba(246, 248, 252, .68) !important;
        background-image: none !important;
        box-shadow: 0 18px 42px rgba(15, 23, 42, .24), inset 0 1px 0 rgba(255, 255, 255, .30) !important;
        backdrop-filter: blur(20px) saturate(145%) !important;
        -webkit-backdrop-filter: blur(20px) saturate(145%) !important;
    }

    [data-theme="dark"] .topbar-avatar-menu.avatar-dropdown-menu {
        border-color: rgba(255, 255, 255, .12) !important;
        background: rgba(17, 19, 24, .68) !important;
        background-image: none !important;
        box-shadow: 0 18px 42px rgba(0, 0, 0, .46), inset 0 1px 0 rgba(255, 255, 255, .07) !important;
        backdrop-filter: blur(20px) saturate(145%) !important;
        -webkit-backdrop-filter: blur(20px) saturate(145%) !important;
    }

    [data-theme="light"] .topbar-avatar-menu::before,
    .topbar-avatar-menu::before { background: rgba(246, 248, 252, .68) !important; }
    [data-theme="dark"] .topbar-avatar-menu::before { background: rgba(17, 19, 24, .68) !important; }
}

@media (max-width: 360px) {
    .app-topbar .topbar-actions { gap: .2rem; }
}

/* O aviso de atualização cabe integralmente no celular e rola apenas por dentro. */
@media (max-width: 600px) {
    .release-popup-overlay { place-items: center; padding: 10px; overflow: hidden; }
    .release-popup {
        width: 100%;
        max-height: calc(100dvh - 20px);
        grid-template-rows: auto minmax(0, 1fr);
        border-radius: 13px;
    }
    .release-popup-drag { display: none !important; }
    .release-popup-close { top: 10px; right: 10px; }
    .release-popup-visual { min-height: 96px; gap: 3px; padding: 12px 50px 10px 16px; }
    .release-popup-visual > span { width: 40px; height: 40px; margin: 0; border-radius: 11px; font-size: 21px; }
    .release-popup-visual-info { display: none; }
    .release-popup-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 15px 14px 14px; }
    .release-popup-content h2 { margin-top: 5px; font-size: 17px; }
    .release-popup-content > p,
    .release-popup-content li { font-size: 10.5px; }
    .release-popup-content ul { gap: 6px; margin-top: 11px; padding-top: 10px; }
    .release-popup-preference { margin-top: 12px; padding: 9px 10px; }
    .release-popup-actions { gap: 6px; margin-top: 12px; }
}

/* Metas de SLA exibidas diretamente nas opções de prioridade. */
.priority-choice { position: relative; }
.priority-sla-tooltip {
    position: absolute;
    z-index: 80;
    left: 50%;
    bottom: calc(100% + 9px);
    width: max-content;
    max-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border: 1px solid var(--separator-color);
    border-radius: 7px;
    background: var(--bg-card-right);
    color: var(--text-primary);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 4px);
    transition: opacity .14s, transform .14s, visibility .14s;
    text-align: left;
}
.priority-sla-tooltip::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    width: 8px;
    height: 8px;
    border-right: 1px solid var(--separator-color);
    border-bottom: 1px solid var(--separator-color);
    background: var(--bg-card-right);
    transform: translate(-50%, -4px) rotate(45deg);
}
.priority-sla-tooltip strong { font-size: .66rem; }
.priority-sla-tooltip small { color: var(--text-muted); font-size: .6rem; font-weight: 500; white-space: nowrap; }
.priority-choice:hover .priority-sla-tooltip,
.priority-choice:focus-visible .priority-sla-tooltip { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
@media (max-width: 700px) {
    .priority-choice:first-of-type .priority-sla-tooltip { left: 0; transform: translate(0, 4px); }
    .priority-choice:first-of-type:hover .priority-sla-tooltip,
    .priority-choice:first-of-type:focus-visible .priority-sla-tooltip { transform: translate(0, 0); }
    .priority-choice:first-of-type .priority-sla-tooltip::after { left: 22px; }
    .priority-choice:last-of-type .priority-sla-tooltip { right: 0; left: auto; transform: translate(0, 4px); }
    .priority-choice:last-of-type:hover .priority-sla-tooltip,
    .priority-choice:last-of-type:focus-visible .priority-sla-tooltip { transform: translate(0, 0); }
    .priority-choice:last-of-type .priority-sla-tooltip::after { right: 18px; left: auto; }
}

/* Contraste final do tooltip após as regras estruturais. */
.new-ticket-priority-options .priority-sla-tooltip {
    border-color: rgba(15, 23, 42, .16);
    background: rgba(246, 248, 252, .38);
    background-image: none;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .22), inset 0 1px 0 rgba(255, 255, 255, .42);
    backdrop-filter: blur(20px) saturate(145%);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
}
.new-ticket-priority-options .priority-sla-tooltip::after { border-color: rgba(15, 23, 42, .16); background: rgba(246, 248, 252, .72); }
.new-ticket-priority-options .priority-sla-tooltip strong { font-size: .71rem; }
.new-ticket-priority-options .priority-sla-tooltip small { font-size: .64rem; }
[data-theme="dark"] .new-ticket-priority-options .priority-sla-tooltip { border-color: rgba(255, 255, 255, .14); background: rgba(17, 19, 24, .38); box-shadow: 0 18px 42px rgba(0, 0, 0, .46), inset 0 1px 0 rgba(255, 255, 255, .08); color: #f4f6fa; }
[data-theme="dark"] .new-ticket-priority-options .priority-sla-tooltip::after { border-color: rgba(255, 255, 255, .14); background: rgba(17, 19, 24, .72); }
[data-theme="dark"] .new-ticket-priority-options .priority-sla-tooltip small { color: #cbd5e1; }

/* Dropdown do usuário da sidebar alinhado ao vidro do Spotlight e do popup. */
.sidebar-user-dropdown,
.sidebar-user-dropdown.sidebar-user-dropdown-portal {
    border-radius: 28px;
    border-color: rgba(15, 23, 42, .25);
    background: transparent;
    background-image: none;
    box-shadow: 0 20px 52px rgba(15, 23, 42, .12), inset 0 1px 0 rgba(255, 255, 255, .46), inset 0 -1px 0 rgba(255, 255, 255, .08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

[data-theme="dark"] .sidebar-user-dropdown,
[data-theme="dark"] .sidebar-user-dropdown.sidebar-user-dropdown-portal {
    border-radius: 28px;
    border-color: rgba(255, 255, 255, .08);
    background: transparent;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .30), inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 -1px 0 rgba(255, 255, 255, .03);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.sidebar-user-dropdown-head,
.sidebar-user-dropdown-info,
.sidebar-user-dropdown-main {
    background: transparent;
    background-image: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.sidebar-user-menu.open .sidebar-user-dropdown,
.sidebar-user-dropdown.sidebar-user-dropdown-portal.open {
    display: grid;
    gap: 8px;
}

.sidebar-user-dropdown .sidebar-user-action,
.sidebar-user-dropdown form .sidebar-user-action {
    border-radius: 12px;
    background: transparent;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background-color .16s ease, color .16s ease;
}

.sidebar-user-dropdown .sidebar-user-action:hover,
.sidebar-user-dropdown .sidebar-user-action:focus-visible {
    border-radius: 12px;
    background: rgba(246, 248, 252, .10);
    color: #0f172a;
    outline: none;
}

[data-theme="dark"] .sidebar-user-dropdown .sidebar-user-action:hover,
[data-theme="dark"] .sidebar-user-dropdown .sidebar-user-action:focus-visible {
    border-radius: 12px;
    background: rgba(255, 255, 255, .07);
    color: #f8fafc;
    outline: none;
}

/* Contraste final para o hover claro e para os dados da conta. */
.spotlight-item,
.spotlight-item:hover,
.spotlight-item.active {
    border: 1px solid transparent;
}

.spotlight-item:hover,
.spotlight-item.active {
    border-color: rgba(15, 23, 42, .10);
    background: rgba(246, 248, 252, .30);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42), 0 4px 12px rgba(15, 23, 42, .06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.sidebar-user-dropdown-name {
    color: #0f172a !important;
    font-weight: 600;
}

.sidebar-user-dropdown-email {
    color: #334155 !important;
}

.sidebar-user-dropdown-info {
    color: #1e293b;
}

.sidebar-user-dropdown-info strong {
    color: #334155;
}

.sidebar-user-dropdown-info em {
    color: #0f172a;
    font-weight: 400;
}

.sidebar-user-dropdown .sidebar-user-action {
    color: #1e293b;
    font-weight: 500;
}

[data-theme="dark"] .spotlight-item:hover,
[data-theme="dark"] .spotlight-item.active {
    border-color: rgba(255, 255, 255, .10);
    background: rgba(255, 255, 255, .10);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 0 4px 12px rgba(0, 0, 0, .16);
}

/* Botões do dropdown mantêm o mesmo tamanho e peso dos links. */
.sidebar-user-dropdown button.sidebar-user-action {
    font-family: inherit;
    font-size: .8rem;
    font-weight: 500;
    line-height: normal;
}

[data-theme="dark"] .sidebar-user-dropdown-name {
    color: #f8fafc !important;
}

[data-theme="dark"] .sidebar-user-dropdown-email,
[data-theme="dark"] .sidebar-user-dropdown-info,
[data-theme="dark"] .sidebar-user-dropdown-info strong {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .sidebar-user-dropdown-info em,
[data-theme="dark"] .sidebar-user-dropdown .sidebar-user-action {
    color: #f8fafc;
}

/* Menus da sidebar com o mesmo vidro e hover do Spotlight, sem alterar dimensões. */
.app-sidebar .sidebar-link {
    border: 1px solid transparent;
    border-radius: 12px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.app-sidebar .sidebar-link:hover {
    border-color: rgba(15, 23, 42, .14);
    border-radius: 12px;
    background: rgba(226, 232, 240, .48);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 4px 12px rgba(15, 23, 42, .08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

[data-theme="dark"] .app-sidebar .sidebar-link:hover {
    border-color: rgba(255, 255, 255, .10);
    border-radius: 12px;
    background: rgba(255, 255, 255, .07);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 0 4px 12px rgba(0, 0, 0, .16);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Spotlight com o mesmo vidro translúcido do popup de atualizações. */
.spotlight-overlay,
[data-theme="dark"] .spotlight-overlay {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.spotlight-panel {
    border-color: rgba(15, 23, 42, .25);
    background: transparent;
    box-shadow: 0 20px 52px rgba(15, 23, 42, .12), inset 0 1px 0 rgba(255, 255, 255, .46), inset 0 -1px 0 rgba(255, 255, 255, .08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

[data-theme="dark"] .spotlight-panel {
    border-color: rgba(255, 255, 255, .08);
    background: transparent;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .30), inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 -1px 0 rgba(255, 255, 255, .03);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.spotlight-panel .spotlight-search,
.spotlight-panel .spotlight-results {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* Superfície e resultados do Spotlight com leitura forte e hover em vidro. */
.search-results-dropdown.search-results-dropdown-portal,
.spotlight-panel {
    border-radius: 28px;
    border-color: rgba(15, 23, 42, .25);
    background: transparent;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

[data-theme="dark"] .search-results-dropdown.search-results-dropdown-portal,
[data-theme="dark"] .spotlight-panel {
    border-radius: 28px;
    border-color: rgba(255, 255, 255, .08);
    background: transparent;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.spotlight-item,
.spotlight-item:hover,
.spotlight-item.active {
    color: #0f172a;
    transition: background-color .16s ease, color .16s ease, backdrop-filter .16s ease;
}

.spotlight-item:hover,
.spotlight-item.active {
    background: rgba(246, 248, 252, .10);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.spotlight-section-label,
.spotlight-ticket-id,
.spotlight-ticket-meta {
    color: #334155;
}

.spotlight-ticket-title {
    color: #0f172a;
}

.spotlight-results {
    display: grid;
    gap: 8px;
    padding: .75rem;
}

.spotlight-item,
.spotlight-item:hover,
.spotlight-item.active {
    border-radius: 12px;
}

[data-theme="dark"] .spotlight-item,
[data-theme="dark"] .spotlight-item:hover,
[data-theme="dark"] .spotlight-item.active {
    color: #f8fafc;
}

[data-theme="dark"] .spotlight-item:hover,
[data-theme="dark"] .spotlight-item.active {
    background: rgba(255, 255, 255, .07);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

[data-theme="dark"] .spotlight-section-label,
[data-theme="dark"] .spotlight-ticket-id,
[data-theme="dark"] .spotlight-ticket-meta {
    color: #cbd5e1;
}

[data-theme="dark"] .spotlight-ticket-title {
    color: #f8fafc;
}

/* Regra final: o hover claro precisa ser perceptível sem perder o vidro. */
.spotlight-item:hover,
.spotlight-item.active {
    border-color: rgba(15, 23, 42, .14);
    background: rgba(226, 232, 240, .48);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 4px 12px rgba(15, 23, 42, .08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Compatibilidade com versões antigas do script: active não ganha destaque. */
.spotlight-item.active:not(:hover) {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

[data-theme="dark"] .spotlight-item.active:not(:hover) {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

/* O hover do usuário replica integralmente o hover do Spotlight. */
.sidebar-user-dropdown .sidebar-user-action {
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.sidebar-user-dropdown .sidebar-user-action:hover,
.sidebar-user-dropdown .sidebar-user-action:focus-visible {
    border-color: rgba(15, 23, 42, .14);
    border-radius: 12px;
    background: rgba(226, 232, 240, .48);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 4px 12px rgba(15, 23, 42, .08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

[data-theme="dark"] .sidebar-user-dropdown .sidebar-user-action:hover,
[data-theme="dark"] .sidebar-user-dropdown .sidebar-user-action:focus-visible {
    border-color: rgba(255, 255, 255, .10);
    border-radius: 12px;
    background: rgba(255, 255, 255, .07);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 0 4px 12px rgba(0, 0, 0, .16);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Estado ativo da sidebar com a mesma superfície do Spotlight. */
.app-sidebar .sidebar-link.active {
    border: 1px solid rgba(15, 23, 42, .14);
    border-radius: 12px;
    background: rgba(226, 232, 240, .48);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 4px 12px rgba(15, 23, 42, .08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* No fundo escuro, um pouco mais de presença mantém o vidro legível. */
[data-theme="dark"] .app-sidebar .sidebar-link:hover,
[data-theme="dark"] .app-sidebar .sidebar-link.active,
[data-theme="dark"] .spotlight-item:hover {
    border-color: rgba(255, 255, 255, .10);
    border-radius: 12px;
    background: rgba(255, 255, 255, .12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 0 4px 12px rgba(0, 0, 0, .16);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* No drawer mobile, remove o fundo antigo dos estados hover e ativo. */
@media (max-width: 900px) {
    .app-sidebar.open .sidebar-link,
    [data-theme="light"] .app-sidebar.open .sidebar-link {
        border: 1px solid transparent;
        border-radius: 12px;
        background: transparent !important;
        background-color: transparent !important;
        background-image: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .app-sidebar.open .sidebar-link:hover,
    .app-sidebar.open .sidebar-link.active,
    [data-theme="light"] .app-sidebar.open .sidebar-link:hover,
    [data-theme="light"] .app-sidebar.open .sidebar-link.active {
        border-color: rgba(15, 23, 42, .14);
        border-radius: 12px;
        background: rgba(226, 232, 240, .48) !important;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 4px 12px rgba(15, 23, 42, .08) !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
    }

    [data-theme="dark"] .app-sidebar.open .sidebar-link:hover,
    [data-theme="dark"] .app-sidebar.open .sidebar-link.active {
        border-color: rgba(255, 255, 255, .10);
        border-radius: 12px;
        background: rgba(255, 255, 255, .12) !important;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 0 4px 12px rgba(0, 0, 0, .16) !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
    }
}

/* Regra final: exatamente o vidro transparente solicitado para o mobile escuro. */
@media (max-width: 900px) {
    [data-theme="dark"] .app-sidebar,
    [data-theme="dark"] html.sidebar-state-collapsed .app-sidebar,
    [data-theme="dark"] .app-sidebar.collapsed,
    [data-theme="dark"] .mobile-bottom-account-menu {
        background: rgba(0, 0, 0, 0.4) !important;
        background-image: none !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
    }
}

/* Hover da conta na sidebar com a mesma superfície translúcida do Spotlight. */
.app-sidebar .sidebar-user-link:hover,
.app-sidebar .sidebar-user-trigger:hover,
.app-sidebar .sidebar-user-link:focus-visible,
.app-sidebar .sidebar-user-trigger:focus-visible {
    border: 1px solid rgba(15, 23, 42, .14) !important;
    border-radius: 12px !important;
    background: rgba(226, 232, 240, .48) !important;
    background-image: none !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 4px 12px rgba(15, 23, 42, .08) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

[data-theme="dark"] .app-sidebar .sidebar-user-link:hover,
[data-theme="dark"] .app-sidebar .sidebar-user-trigger:hover,
[data-theme="dark"] .app-sidebar .sidebar-user-link:focus-visible,
[data-theme="dark"] .app-sidebar .sidebar-user-trigger:focus-visible {
    border-color: rgba(255, 255, 255, .10) !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, .12) !important;
    background-image: none !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 0 4px 12px rgba(0, 0, 0, .16) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

/* Pequeno ajuste vertical do dropdown do usuário no cabeçalho mobile. */
@media (max-width: 900px) {
    .topbar-avatar-menu.portal-open {
        transform: translateY(-6px) !important;
    }
}

/* No tema claro, o painel mobile também usa somente transparência e blur de 8px. */
@media (max-width: 900px) {
    [data-theme="light"] .app-sidebar,
    [data-theme="light"] html.sidebar-state-collapsed .app-sidebar,
    [data-theme="light"] .app-sidebar.collapsed,
    [data-theme="light"] .mobile-bottom-account-menu {
        background: transparent !important;
        background-image: none !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
    }
}

/* Cabeçalho mobile e desktop no mesmo vidro transparente do rodapé. */
.app-topbar,
.page-internal .app-topbar,
.page-internal .app-topbar.scrolled {
    background: transparent !important;
    background-image: none !important;
    border-bottom-color: rgba(15, 23, 42, .14) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

.topbar-btn,
.topbar-search {
    border-radius: 12px !important;
    background: transparent !important;
    background-image: none !important;
}

.topbar-btn:hover,
.topbar-btn:focus-visible,
.topbar-search:hover,
.topbar-search:focus-within {
    border-color: rgba(15, 23, 42, .14) !important;
    border-radius: 12px !important;
    background: rgba(226, 232, 240, .48) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 4px 12px rgba(15, 23, 42, .08) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

[data-theme="dark"] .app-topbar,
[data-theme="dark"] .page-internal .app-topbar,
[data-theme="dark"] .page-internal .app-topbar.scrolled {
    border-bottom-color: rgba(255, 255, 255, .10) !important;
}

[data-theme="dark"] .topbar-btn:hover,
[data-theme="dark"] .topbar-btn:focus-visible,
[data-theme="dark"] .topbar-search:hover,
[data-theme="dark"] .topbar-search:focus-within {
    border-color: rgba(255, 255, 255, .10) !important;
    background: rgba(255, 255, 255, .12) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 0 4px 12px rgba(0, 0, 0, .16) !important;
}

/* Barra do rodapé mobile no mesmo padrão translúcido dos demais menus. */
@media (max-width: 900px) {
    .mobile-bottom-nav {
        background: transparent !important;
        background-image: none !important;
        border-top-color: rgba(15, 23, 42, .14) !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
    }

    .mobile-bottom-nav-item,
    .mobile-bottom-nav-item:hover,
    .mobile-bottom-nav-item:focus-visible,
    .mobile-bottom-nav-item.active {
        border: 1px solid transparent !important;
        border-radius: 17px !important;
        background: transparent !important;
        background-image: none !important;
        box-shadow: none !important;
    }

    .mobile-bottom-nav-item:hover,
    .mobile-bottom-nav-item:focus-visible,
    .mobile-bottom-nav-item.active {
        border-color: rgba(15, 23, 42, .14) !important;
        background: rgba(226, 232, 240, .48) !important;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 4px 12px rgba(15, 23, 42, .08) !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
    }

    .mobile-bottom-nav-item::before,
    .mobile-bottom-nav-item:hover::before,
    .mobile-bottom-nav-item:focus-visible::before,
    .mobile-bottom-nav-item.active::before {
        background: transparent !important;
        background-image: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    [data-theme="dark"] .mobile-bottom-nav {
        border-top-color: rgba(255, 255, 255, .10) !important;
    }

    [data-theme="dark"] .mobile-bottom-nav-item:hover,
    [data-theme="dark"] .mobile-bottom-nav-item:focus-visible,
    [data-theme="dark"] .mobile-bottom-nav-item.active {
        border-color: rgba(255, 255, 255, .10) !important;
        background: rgba(255, 255, 255, .12) !important;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 0 4px 12px rgba(0, 0, 0, .16) !important;
    }
}

/* Hover do controle de expandir/recolher a sidebar no mesmo padrão de vidro. */
.sidebar-toggle-btn,
.mobile-sidebar-toggle {
    box-sizing: border-box !important;
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

.sidebar-toggle-btn:hover,
.sidebar-toggle-btn:focus-visible,
.mobile-sidebar-toggle:hover,
.mobile-sidebar-toggle:focus-visible {
    border-color: rgba(15, 23, 42, .14) !important;
    border-radius: 12px !important;
    background: rgba(226, 232, 240, .48) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 4px 12px rgba(15, 23, 42, .08) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    outline: none !important;
}

[data-theme="dark"] .sidebar-toggle-btn:hover,
[data-theme="dark"] .sidebar-toggle-btn:focus-visible,
[data-theme="dark"] .mobile-sidebar-toggle:hover,
[data-theme="dark"] .mobile-sidebar-toggle:focus-visible {
    border-color: rgba(255, 255, 255, .10) !important;
    background: rgba(255, 255, 255, .12) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 0 4px 12px rgba(0, 0, 0, .16) !important;
}

/* Mais área interna nos botões do cabeçalho, sem aumentar a altura do cabeçalho. */
.topbar-btn {
    box-sizing: border-box !important;
    width: 36px !important;
    height: 36px !important;
    padding: .5rem !important;
}

/* Ajuste final: mais distância e área interna sem aumentar a altura do cabeçalho. */
.app-topbar .topbar-actions {
    gap: .95rem !important;
}

.topbar-btn {
    box-sizing: border-box !important;
    width: 38px !important;
    height: 38px !important;
    padding: .55rem !important;
}

@media (max-width: 900px) {
    .app-topbar .topbar-actions {
        gap: .7rem !important;
    }
}

@media (max-width: 360px) {
    .app-topbar .topbar-actions {
        gap: .45rem !important;
    }
}

/* Hover do cabeçalho no claro com a mesma presença visual da sidebar. */
.topbar-btn {
    border: 1px solid transparent !important;
    width: 40px !important;
    height: 40px !important;
    padding: .6rem !important;
}

[data-theme="light"] .topbar-btn:hover,
[data-theme="light"] .topbar-btn:focus-visible {
    border-color: rgba(15, 23, 42, .14) !important;
    border-radius: 12px !important;
    background: rgba(226, 232, 240, .48) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 4px 12px rgba(15, 23, 42, .08) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

/* O controle de tema do cabeçalho e do menu de Administração mantém o mesmo desenho nos dois modos. */
.app-topbar [data-theme-toggle] .icon,
.app-topbar [data-theme-icon] {
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2 !important;
}

[data-theme="light"] .app-topbar [data-theme-toggle] {
    color: #334155 !important;
}

[data-theme="dark"] .app-topbar [data-theme-toggle] {
    color: #e2e8f0 !important;
}

/* Central de notificações no mesmo padrão translúcido do Spotlight, sem seta. */
.notification-center,
.notification-center.notification-center-portal {
    border-radius: 28px !important;
    border-color: rgba(15, 23, 42, .25) !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: 0 20px 52px rgba(15, 23, 42, .12), inset 0 1px 0 rgba(255, 255, 255, .46), inset 0 -1px 0 rgba(255, 255, 255, .08) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

.notification-center::before,
.notification-center::after,
.notification-center.notification-center-portal::before,
.notification-center.notification-center-portal::after {
    display: none !important;
    content: none !important;
}

.notification-center .notification-item {
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    background: transparent !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.notification-center .notification-item:hover,
.notification-center .notification-item:focus-visible {
    border-color: rgba(15, 23, 42, .14) !important;
    border-radius: 12px !important;
    background: rgba(226, 232, 240, .48) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 4px 12px rgba(15, 23, 42, .08) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    outline: none !important;
}

[data-theme="dark"] .notification-center,
[data-theme="dark"] .notification-center.notification-center-portal {
    border-color: rgba(255, 255, 255, .08) !important;
    background: transparent !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .30), inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 -1px 0 rgba(255, 255, 255, .03) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

[data-theme="dark"] .notification-center .notification-item:hover,
[data-theme="dark"] .notification-center .notification-item:focus-visible {
    border-color: rgba(255, 255, 255, .10) !important;
    background: rgba(255, 255, 255, .07) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 0 4px 12px rgba(0, 0, 0, .16) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

/* Contraste final dos textos da Central de Notificações no modo escuro. */
[data-theme="dark"] .notification-center .notification-head strong,
[data-theme="dark"] .notification-center .notification-body strong,
[data-theme="dark"] .notification-center .notification-footer {
    color: #f8fafc !important;
}

[data-theme="dark"] .notification-center .notification-head span,
[data-theme="dark"] .notification-center .notification-type,
[data-theme="dark"] .notification-center .notification-time {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .notification-center .notification-item,
[data-theme="dark"] .notification-center .notification-body span:last-child {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .notification-center .notification-mark-read {
    border-color: rgba(255, 255, 255, .18) !important;
    color: #e2e8f0 !important;
}

/* Ação "Ver todos os chamados" com hover translúcido e área interna maior. */
.notification-center .notification-footer {
    box-sizing: border-box !important;
    padding: .85rem 1.1rem !important;
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    background: transparent !important;
}

.notification-center .notification-footer:hover,
.notification-center .notification-footer:focus-visible {
    border-color: rgba(15, 23, 42, .14) !important;
    border-radius: 12px !important;
    background: rgba(226, 232, 240, .48) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 4px 12px rgba(15, 23, 42, .08) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    color: #0f172a !important;
    outline: none !important;
}

[data-theme="dark"] .notification-center .notification-footer:hover,
[data-theme="dark"] .notification-center .notification-footer:focus-visible {
    border-color: rgba(255, 255, 255, .10) !important;
    background: rgba(255, 255, 255, .07) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 0 4px 12px rgba(0, 0, 0, .16) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    color: #f8fafc !important;
}

/* O hover fica somente ao redor do texto, sem uma segunda camada no rodapé. */
.notification-center .notification-footer,
.notification-center .notification-footer:hover,
.notification-center .notification-footer:focus,
[data-theme="light"] .notification-center .notification-footer,
[data-theme="light"] .notification-center .notification-footer:hover,
[data-theme="light"] .notification-center .notification-footer:focus,
[data-theme="light"] .notification-center .notification-footer:focus-visible,
[data-theme="dark"] .notification-center .notification-footer,
[data-theme="dark"] .notification-center .notification-footer:hover,
[data-theme="dark"] .notification-center .notification-footer:focus,
[data-theme="dark"] .notification-center .notification-footer:focus-visible {
    padding: .75rem 1rem !important;
    border: 0 !important;
    border-top: 1px solid var(--border-color) !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
}

.notification-center .notification-footer > span {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: .55rem .8rem !important;
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    background: transparent !important;
    transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.notification-center .notification-footer:hover > span,
.notification-center .notification-footer:focus-visible > span {
    border-color: rgba(15, 23, 42, .14) !important;
    border-radius: 12px !important;
    background: rgba(226, 232, 240, .48) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 4px 12px rgba(15, 23, 42, .08) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

[data-theme="dark"] .notification-center .notification-footer:hover > span,
[data-theme="dark"] .notification-center .notification-footer:focus-visible > span {
    border-color: rgba(255, 255, 255, .10) !important;
    background: rgba(255, 255, 255, .07) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 0 4px 12px rgba(0, 0, 0, .16) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

/* Contraste das abas, indicadores e ícones da Central de Notificações. */
.notification-tabs button:not(.active) {
    color: #334155 !important;
}

.notification-tabs button:not(.active):hover,
.notification-tabs button:not(.active):focus-visible {
    color: #0f172a !important;
}

.notification-tabs button b {
    min-width: 21px !important;
    height: 21px !important;
    border: 1px solid rgba(255, 255, 255, .72) !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .18) !important;
}

.notification-dot {
    width: 9px !important;
    height: 9px !important;
    border-color: rgba(15, 23, 42, .32) !important;
}

.notification-item.unread .notification-dot {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .18), 0 1px 4px rgba(239, 68, 68, .24) !important;
}

.notification-update-icon {
    border: 1px solid rgba(37, 99, 235, .20) !important;
    background: rgba(37, 99, 235, .14) !important;
    color: #1d4ed8 !important;
}

.notification-update.unread .notification-update-icon {
    border-color: rgba(37, 99, 235, .34) !important;
    background: rgba(37, 99, 235, .22) !important;
    color: #1e40af !important;
}

[data-theme="dark"] .notification-tabs button:not(.active) {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .notification-tabs button:not(.active):hover,
[data-theme="dark"] .notification-tabs button:not(.active):focus-visible {
    color: #ffffff !important;
}

[data-theme="dark"] .notification-tabs button b {
    border-color: rgba(255, 255, 255, .42) !important;
    box-shadow: 0 1px 5px rgba(0, 0, 0, .42) !important;
}

[data-theme="dark"] .notification-dot {
    border-color: rgba(255, 255, 255, .42) !important;
}

[data-theme="dark"] .notification-update-icon {
    border-color: rgba(147, 197, 253, .26) !important;
    background: rgba(96, 165, 250, .18) !important;
    color: #bfdbfe !important;
}

[data-theme="dark"] .notification-update.unread .notification-update-icon {
    border-color: rgba(147, 197, 253, .42) !important;
    background: rgba(96, 165, 250, .26) !important;
    color: #dbeafe !important;
}

/* Ícones de atualizações sem azul: paleta neutra do sistema. */
.notification-update-icon {
    border-color: rgba(100, 116, 139, .24) !important;
    background: rgba(100, 116, 139, .16) !important;
    color: #475569 !important;
}

.notification-update.unread .notification-update-icon {
    border-color: rgba(100, 116, 139, .38) !important;
    background: rgba(100, 116, 139, .24) !important;
    color: #334155 !important;
}

[data-theme="dark"] .notification-update-icon {
    border-color: rgba(148, 163, 184, .26) !important;
    background: rgba(148, 163, 184, .16) !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .notification-update.unread .notification-update-icon {
    border-color: rgba(148, 163, 184, .42) !important;
    background: rgba(148, 163, 184, .24) !important;
    color: #f8fafc !important;
}

/* Busca e Spotlight organizados no mobile, sem herdar a grade de desktop. */
@media (max-width: 900px) {
    .search-results-dropdown.search-results-dropdown-portal {
        left: 1rem !important;
        right: 1rem !important;
        width: auto !important;
        max-width: none !important;
        max-height: min(60dvh, 560px) !important;
        overflow: hidden !important;
    }

    .search-results-dropdown.search-results-dropdown-portal .spotlight-results {
        max-height: min(60dvh, 560px) !important;
        overflow-y: auto !important;
        padding: .65rem !important;
    }

    .spotlight-overlay {
        align-items: flex-start !important;
        padding: 1rem !important;
        overflow: hidden !important;
    }

    .spotlight-overlay .spotlight-panel {
        width: 100% !important;
        max-width: 680px !important;
        max-height: calc(100dvh - 2rem) !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .spotlight-overlay .spotlight-panel .spotlight-search {
        flex: 0 0 auto !important;
    }

    .spotlight-overlay .spotlight-panel .spotlight-results {
        min-height: 0 !important;
        max-height: none !important;
        flex: 1 1 auto !important;
        overflow-y: auto !important;
    }

    .search-results-dropdown-portal .spotlight-item,
    .spotlight-panel .spotlight-item {
        grid-template-columns: minmax(0, 1fr) auto !important;
        grid-template-areas:
            "id status"
            "main status" !important;
        align-items: start !important;
        gap: .4rem .65rem !important;
        padding: .7rem .65rem !important;
    }

    .search-results-dropdown-portal .spotlight-ticket-id,
    .spotlight-panel .spotlight-ticket-id {
        grid-area: id !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .search-results-dropdown-portal .spotlight-ticket-main,
    .spotlight-panel .spotlight-ticket-main {
        grid-area: main !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .search-results-dropdown-portal .spotlight-ticket-status,
    .spotlight-panel .spotlight-ticket-status {
        grid-area: status !important;
        align-self: center !important;
        white-space: nowrap !important;
    }

    .search-results-dropdown-portal .spotlight-ticket-meta,
    .spotlight-panel .spotlight-ticket-meta {
        gap: .3rem .55rem !important;
        line-height: 1.35 !important;
    }
}

/* Ajuste definitivo: no celular os resultados seguem o fluxo da leitura. */
@media (max-width: 900px) {
    .spotlight-overlay {
        align-items: flex-start !important;
        padding: 0 !important;
    }

    .spotlight-overlay .spotlight-panel {
        width: 100vw !important;
        max-width: 100vw !important;
        max-height: 100dvh !important;
        border-top-left-radius: 0 !important;
        border-top-right-radius: 0 !important;
        border-bottom-left-radius: 28px !important;
        border-bottom-right-radius: 28px !important;
    }

    .search-results-dropdown-portal .spotlight-item,
    .spotlight-panel .spotlight-item {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: flex-start !important;
        gap: .35rem .55rem !important;
        padding: .7rem .65rem !important;
    }

    .search-results-dropdown-portal .spotlight-ticket-id,
    .spotlight-panel .spotlight-ticket-id {
        order: 1 !important;
        flex: 1 1 100% !important;
        width: 100% !important;
    }

    .search-results-dropdown-portal .spotlight-ticket-main,
    .spotlight-panel .spotlight-ticket-main {
        order: 2 !important;
        flex: 1 1 calc(100% - 86px) !important;
        width: auto !important;
    }

    .search-results-dropdown-portal .spotlight-ticket-status,
    .spotlight-panel .spotlight-ticket-status {
        order: 3 !important;
        flex: 0 0 auto !important;
        align-self: center !important;
        margin-left: auto !important;
    }

    .search-results-dropdown-portal .spotlight-ticket-title,
    .spotlight-panel .spotlight-ticket-title {
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .search-results-dropdown-portal .spotlight-ticket-meta,
    .spotlight-panel .spotlight-ticket-meta {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: .25rem .55rem !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    /* Separação visual entre chamados, sem criar um segundo hover. */
    .search-results-dropdown-portal .spotlight-item:not(:last-child),
    .spotlight-panel .spotlight-item:not(:last-child) {
        border-bottom: 1px solid rgba(15, 23, 42, .14) !important;
    }

    [data-theme="dark"] .search-results-dropdown-portal .spotlight-item:not(:last-child),
    [data-theme="dark"] .spotlight-panel .spotlight-item:not(:last-child) {
        border-bottom-color: rgba(255, 255, 255, .14) !important;
    }
}

/* Avatares com a mesma base neutra da sidebar em todos os pontos de acesso. */
[data-theme="light"] .topbar-avatar,
[data-theme="light"] .mobile-bottom-nav-avatar,
[data-theme="light"] .mobile-bottom-account-avatar,
[data-theme="light"] .sidebar-user-dropdown-avatar {
    background: #d9dde5 !important;
    color: #25282e !important;
}

[data-theme="dark"] .topbar-avatar,
[data-theme="dark"] .mobile-bottom-nav-avatar,
[data-theme="dark"] .mobile-bottom-account-avatar,
[data-theme="dark"] .sidebar-user-dropdown-avatar {
    background: #343840 !important;
    color: #ffffff !important;
}

.sidebar-avatar img,
.sidebar-user-dropdown-avatar img,
.mobile-bottom-nav-avatar img,
.mobile-bottom-account-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: inherit;
    object-fit: cover;
}

/* O avatar do dropdown deve permanecer um círculo, mesmo quando o menu é
   movido para o body como portal no mobile. */
.sidebar-user-dropdown .sidebar-user-dropdown-avatar,
.sidebar-user-dropdown-portal .sidebar-user-dropdown-avatar {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    max-width: 30px !important;
    max-height: 30px !important;
    flex: 0 0 30px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    position: relative !important;
    border-radius: 50% !important;
}

.sidebar-user-dropdown .sidebar-user-dropdown-avatar > img,
.sidebar-user-dropdown-portal .sidebar-user-dropdown-avatar > img {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    flex: 0 0 100% !important;
    display: block !important;
    object-fit: cover !important;
    border-radius: inherit !important;
}

@media (max-width: 900px) {
    .app-sidebar .sidebar-avatar {
        width: 34px !important;
        height: 34px !important;
    }
}

/* Contexto da empresa/plataforma no cabeçalho, sem repetir o avatar da sidebar. */
.topbar-context-trigger {
    width: auto !important;
    min-width: 34px !important;
    height: 34px !important;
    padding: 0 .55rem !important;
    gap: .42rem;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    background: transparent !important;
    color: var(--text-primary) !important;
    font-family: inherit;
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
}

.topbar-context-trigger:hover,
.topbar-context-trigger:focus-visible,
.avatar-dropdown.open .topbar-context-trigger {
    border-color: rgba(15, 23, 42, .14) !important;
    background: rgba(226, 232, 240, .48) !important;
    color: #0f172a !important;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 4px 12px rgba(15, 23, 42, .08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

[data-theme="dark"] .topbar-context-trigger:hover,
[data-theme="dark"] .topbar-context-trigger:focus-visible,
[data-theme="dark"] .avatar-dropdown.open .topbar-context-trigger {
    border-color: rgba(255, 255, 255, .10) !important;
    background: rgba(255, 255, 255, .10) !important;
    color: #f8fafc !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 0 4px 12px rgba(0, 0, 0, .16);
}

.topbar-context-trigger .icon {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
}

.topbar-context-chevron {
    width: 14px !important;
    height: 14px !important;
}

.topbar-context-menu-head {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .7rem .7rem .6rem;
    border-bottom: 1px solid var(--separator-color);
}

.topbar-context-menu-icon {
    display: inline-flex;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    align-items: center;
    justify-content: center;
    border: 1px solid #c5cad3;
    border-radius: 50%;
    background: #d9dde5;
    color: #25282e;
}

.topbar-context-menu-icon .icon {
    width: 17px;
    height: 17px;
}

.topbar-context-menu-main {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: .2rem;
}

.topbar-context-menu-main strong {
    overflow: hidden;
    color: #0f172a;
    font-size: .82rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-context-menu-main small {
    overflow: hidden;
    color: #475569;
    font-size: .66rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-context-menu-info {
    display: grid;
    gap: .2rem;
    padding: .55rem .7rem;
    border-bottom: 1px solid var(--separator-color);
    color: var(--text-muted);
    font-size: .66rem;
}

.topbar-context-menu-info span {
    display: flex;
    justify-content: space-between;
    gap: .7rem;
}

.topbar-context-menu-info strong { font-weight: 650; }
.topbar-context-menu-info em {
    overflow: hidden;
    color: var(--text-primary);
    font-style: normal;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-context-menu-section {
    padding: .55rem .7rem .25rem;
    color: var(--text-muted);
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.topbar-context-menu-divider {
    height: 1px;
    margin: .2rem .35rem;
    background: var(--separator-color);
}

[data-theme="dark"] .topbar-context-menu-icon {
    border-color: #50555f;
    background: #343840;
    color: #ffffff;
}

[data-theme="dark"] .topbar-context-menu-main strong { color: #f8fafc; }
[data-theme="dark"] .topbar-context-menu-main small { color: #cbd5e1; }

/* O cabeçalho compacto usa somente o ícone, sem avatar ou texto duplicado. */
@media (max-width: 900px) {
    .topbar-context-trigger {
        width: 34px !important;
        padding: 0 !important;
        place-content: center;
    }

    .topbar-context-label,
    .topbar-context-chevron {
        display: none !important;
    }
}

/* O menu de contexto não precisa de seta decorativa. */
.topbar-avatar-menu::before {
    display: none !important;
}

/* O mesmo menu também fica disponível no cabeçalho desktop. */
@media (min-width: 901px) {
    .topbar-actions .avatar-dropdown {
        display: flex !important;
        align-items: center;
    }

    .topbar-avatar-menu {
        display: block !important;
        pointer-events: none;
    }

    .topbar-avatar-menu.portal-open {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto;
        transform: translateY(0) !important;
    }
}

/* Prioridade final: o botão Sair permanece vermelho antes e durante o hover (fundo reforçado). */
[data-theme="light"] .topbar-avatar-menu .sidebar-user-logout,
[data-theme="light"] .topbar-avatar-menu .sidebar-user-logout .icon {
    color: #ef4444 !important;
    stroke: currentColor !important;
}

[data-theme="dark"] .topbar-avatar-menu .sidebar-user-logout,
[data-theme="dark"] .topbar-avatar-menu .sidebar-user-logout .icon {
    color: #f87171 !important;
    stroke: currentColor !important;
}

.topbar-avatar-menu .sidebar-user-logout:hover,
.topbar-avatar-menu .sidebar-user-logout:focus-visible {
    background: rgba(239, 68, 68, .28) !important;
    background-color: rgba(239, 68, 68, .28) !important;
    background-image: none !important;
    color: #ef4444 !important;
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, .32) !important;
    outline: none;
}

[data-theme="dark"] .topbar-avatar-menu .sidebar-user-logout:hover,
[data-theme="dark"] .topbar-avatar-menu .sidebar-user-logout:focus-visible {
    background: rgba(239, 68, 68, .32) !important;
    background-color: rgba(239, 68, 68, .32) !important;
    background-image: none !important;
    color: #f87171 !important;
    box-shadow: inset 0 0 0 1px rgba(248, 113, 113, .38) !important;
}

/* Regra final: todos os tooltips usam o mesmo vidro do Spotlight. */
.app-sidebar.collapsed .sidebar-link::after,
.app-sidebar.collapsed .sidebar-user-trigger::after,
.sidebar-toggle-btn::after,
.priority-sla-tooltip {
    background: rgba(255, 255, 255, .18) !important;
    background-color: rgba(255, 255, 255, .18) !important;
    background-image: none !important;
    border: 1px solid rgba(15, 23, 42, .16) !important;
    border-radius: 12px !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .22), inset 0 1px 0 rgba(255, 255, 255, .42) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    backdrop-filter: blur(8px) !important;
}

.app-sidebar.collapsed .sidebar-link::after,
.app-sidebar.collapsed .sidebar-user-trigger::after,
.sidebar-toggle-btn::after,
.priority-sla-tooltip {
    color: var(--text-primary) !important;
}

.priority-sla-tooltip small { color: var(--text-muted) !important; }

.app-sidebar.collapsed .sidebar-link::before,
.app-sidebar.collapsed .sidebar-user-trigger::before,
.sidebar-toggle-btn::before,
.priority-sla-tooltip::after {
    display: none !important;
}

[data-theme="dark"] .app-sidebar.collapsed .sidebar-link::after,
[data-theme="dark"] .app-sidebar.collapsed .sidebar-user-trigger::after,
[data-theme="dark"] .sidebar-toggle-btn::after,
[data-theme="dark"] .priority-sla-tooltip {
    background: rgba(17, 19, 24, .40) !important;
    background-color: rgba(17, 19, 24, .40) !important;
    background-image: none !important;
    border-color: rgba(255, 255, 255, .14) !important;
    color: #f4f6fa !important;
    box-shadow: 0 18px 42px rgba(0, 0, 0, .46), inset 0 1px 0 rgba(255, 255, 255, .08) !important;
    border-radius: 12px !important;
    -webkit-backdrop-filter: blur(8px) !important;
    backdrop-filter: blur(8px) !important;
}

[data-theme="dark"] .app-sidebar.collapsed .sidebar-link::before,
[data-theme="dark"] .app-sidebar.collapsed .sidebar-user-trigger::before,
[data-theme="dark"] .sidebar-toggle-btn::before,
[data-theme="dark"] .priority-sla-tooltip::after {
    display: none !important;
}

[data-theme="dark"] .priority-sla-tooltip small { color: #cbd5e1 !important; }

/* Tooltip próprio: elemento real para garantir vidro e blur em todos os navegadores. */
.system-tooltip {
    position: fixed;
    z-index: 12000;
    max-width: min(260px, calc(100vw - 16px));
    padding: 7px 11px;
    border: 1px solid rgba(15, 23, 42, .20);
    border-radius: 10px;
    background: rgba(246, 248, 252, .58);
    background-image: none;
    color: #0f172a;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .24), inset 0 1px 0 rgba(255, 255, 255, .62);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    font-family: system-ui, sans-serif;
    font-size: .72rem;
    font-weight: 550;
    line-height: 1.35;
    white-space: pre-line;
    overflow-wrap: anywhere;
    opacity: 0;
    pointer-events: none;
    transform: translateY(3px);
    transition: opacity .12s ease, transform .12s ease;
}

.system-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.system-tooltip[hidden] { display: none !important; }

[data-theme="dark"] .system-tooltip {
    border-color: rgba(255, 255, 255, .14);
    background: rgba(17, 19, 24, .62);
    background-image: none;
    color: #f8fafc;
    box-shadow: 0 16px 38px rgba(0, 0, 0, .50), inset 0 1px 0 rgba(255, 255, 255, .10);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

/* Os tooltips antigos por pseudo-elemento não devem aparecer vazios após a migração. */
.app-sidebar.collapsed .sidebar-link:not([data-tooltip])::after,
.app-sidebar.collapsed .sidebar-link:not([data-tooltip])::before,
.app-sidebar.collapsed .sidebar-user-trigger:not([data-tooltip])::after,
.app-sidebar.collapsed .sidebar-user-trigger:not([data-tooltip])::before,
.sidebar-toggle-btn:not([data-tooltip])::after,
.sidebar-toggle-btn:not([data-tooltip])::before {
    display: none !important;
}

/* No desktop, somente a coluna principal rola. Isso impede componentes
   flutuantes de criarem área vazia no documento depois do rodapé. */
@media (min-width: 901px) {
    html,
    body.page-internal {
        width: 100%;
        height: 100%;
        min-height: 100%;
        overflow: hidden;
    }

    .page-internal .app-layout {
        width: 100%;
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
    }

    .page-internal .app-main {
        height: 100%;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior-y: contain;
    }

    .page-internal .app-content {
        flex: 1 0 auto;
    }

    .page-internal .system-footer {
        flex: 0 0 auto;
    }
}

/* A distribuição precisa acomodar todos os itens antes do total; a divisão
   em frações fazia o cartão lateral cortar sua última linha. */
.categories-overview-side {
    height: auto;
    align-self: start;
    grid-template-rows: auto auto;
}

.categories-overview,
.departments-overview {
    width: 100%;
    align-items: start;
}

.categories-overview-main,
.departments-overview-main {
    height: auto;
    min-height: 0;
}

.departments-overview-side {
    height: auto;
    align-self: start;
    grid-template-rows: auto auto;
}

.categories-distribution {
    min-height: max-content;
}

.categories-distribution ul {
    flex: 0 0 auto;
}

/* No mobile, o overlay escurece o conteúdo atrás do menu nos dois temas. */
@media (max-width: 900px) {
    .page-internal .sidebar-overlay,
    .page-internal .sidebar-overlay.visible {
        background: rgba(0, 0, 0, .4) !important;
        backdrop-filter: blur(2px) !important;
        -webkit-backdrop-filter: blur(2px) !important;
    }
}
/* Floating mobile navigation: expand only the selected destination. */
@media (max-width: 900px) {
    body.page-internal .mobile-bottom-nav {
        display: flex;
        justify-content: space-between;
        left: max(10px, env(safe-area-inset-left));
        right: max(10px, env(safe-area-inset-right));
        bottom: env(safe-area-inset-bottom, 0px);
        width: auto;
        min-height: 62px;
        padding: 6px;
        gap: 2px;
        border: 1px solid var(--border-color);
        border-radius: 32px;
    }
    body.page-internal .mobile-bottom-nav .mobile-bottom-nav-item {
        flex: 0 0 auto;
        width: auto;
        min-width: 44px;
        height: 48px;
        padding: 0 6px;
        flex-direction: row;
        gap: 0;
        font-weight: 500;
        border-radius: 26px !important;
        transition: color .18s ease;
    }
    body.page-internal .mobile-bottom-nav .mobile-bottom-nav-item.active {
        flex: 0 0 auto;
    }
    body.page-internal .mobile-bottom-nav-item > span:last-child {
        max-width: 0;
        opacity: 0;
        overflow: hidden;
        white-space: nowrap;
        font-size: 11px;
        transition: max-width .22s ease, opacity .18s ease, margin .22s ease;
    }
    body.page-internal .mobile-bottom-nav-item.active > span:last-child {
        max-width: 90px;
        opacity: 1;
        margin-left: 5px;
        font-weight: 500;
    }
    body.page-internal .mobile-bottom-nav-icon,
    body.page-internal .mobile-bottom-nav-avatar {
        flex-shrink: 0;
    }
    body.page-internal .mobile-bottom-nav-icon,
    body.page-internal .mobile-bottom-nav-icon .icon {
        width: 28px;
        height: 28px;
        stroke-width: 1.6 !important;
    }
    body.page-internal .mobile-bottom-nav-avatar {
        width: 32px;
        height: 32px;
    }
    [data-theme="light"] body.page-internal .mobile-bottom-nav-item,
    [data-theme="light"] body.page-internal .mobile-bottom-nav-item > span:last-child {
        color: #000 !important;
    }
    body.page-internal .app-main { padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
    body.page-internal .mobile-bottom-nav-item,
    body.page-internal .mobile-bottom-nav-item > span { transition: none !important; }
}

/* O Spotlight é uma janela central; a sombra não deve expandir a superfície até as bordas. */
.spotlight-panel,
[data-theme="dark"] .spotlight-panel {
    box-shadow: 0 24px 72px rgba(15, 23, 42, .28);
}

@media (max-width: 900px) {
    .spotlight-overlay {
        align-items: center !important;
        padding: 16px !important;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .spotlight-overlay .spotlight-panel {
        width: min(440px, calc(100vw - 32px)) !important;
        max-width: 440px !important;
        max-height: calc(100dvh - 32px) !important;
        border-radius: 18px !important;
        box-shadow: 0 24px 72px rgba(15, 23, 42, .28) !important;
    }

    .spotlight-overlay .spotlight-panel .spotlight-results {
        max-height: min(48dvh, 360px) !important;
        flex: 0 1 auto !important;
        overflow-y: auto !important;
    }

    [data-theme="dark"] .spotlight-overlay {
        background: transparent !important;
    }

    [data-theme="dark"] .spotlight-overlay .spotlight-panel {
        box-shadow: 0 24px 72px rgba(0, 0, 0, .52) !important;
    }
}

/* Mantém a marca e os controles do cabeçalho na mesma linha no celular. */
@media (max-width: 900px) {
    .app-topbar { flex-wrap: nowrap; }
    .topbar-mobile-brand {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
    }
    .topbar-mobile-brand > span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .app-topbar .topbar-actions { flex: 0 0 auto; }
}

@media (max-width: 900px) {
    .app-topbar .topbar-actions { gap: .3rem !important; }
}

/* No mobile, todos os controles de ícone do cabeçalho usam a mesma caixa.
   Isso mantém a distância visual uniforme, inclusive entre a lupa e Administração. */
@media (max-width: 900px) {
    .app-topbar .topbar-actions > .topbar-btn,
    .app-topbar .topbar-actions > .avatar-dropdown,
    .app-topbar .topbar-actions > .avatar-dropdown .topbar-context-trigger {
        width: 40px !important;
        min-width: 40px !important;
        height: 40px !important;
        min-height: 40px !important;
        flex: 0 0 40px !important;
        box-sizing: border-box !important;
    }

    .app-topbar .topbar-actions > .topbar-btn {
        padding: 0 !important;
        align-items: center;
        justify-content: center;
    }

    .app-topbar .topbar-actions > .avatar-dropdown {
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 !important;
    }

    .app-topbar .topbar-actions > .avatar-dropdown .topbar-context-trigger {
        margin: 0 !important;
        padding: 0 !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* No mobile, o tema continua disponível no menu de Administração; o botão não fica duplicado no cabeçalho. */
@media (max-width: 900px) {
    .app-topbar #themeToggle {
        display: none !important;
    }
}

/* Compensação visual da lupa: o desenho do ícone ocupa menos área percebida que o botão Administração. */
@media (max-width: 900px) {
    .app-topbar .mobile-spotlight-trigger {
        margin-right: .2rem !important;
    }

    .system-tooltip {
        display: none !important;
    }
}

/* Evita que o descendente do “g” seja cortado pela linha compacta da marca mobile. */
@media (max-width: 900px) {
    .app-topbar .topbar-mobile-brand > span {
        display: inline-block;
        line-height: 1.2;
        padding-bottom: .08em;
    }
}
