:root {
    --bg: #e8ecf3;
    --panel: #ffffff;
    --primary: #1a3d6e;
    --primary-hover: #245a9e;
    --sidebar: #0d2847;
    --sidebar-mid: #123556;
    --sidebar-text: rgba(255, 255, 255, 0.88);
    --sidebar-text-muted: rgba(255, 255, 255, 0.62);
    --text: #0d2847;
    --muted: #64748b;
    --border: #e2e8f0;
    --sidebar-width: 250px;
    --sidebar-width-collapsed: 72px;
    --scrollbar-size: 12px;
    --scrollbar-thumb: #94a3b8;
    --scrollbar-thumb-hover: #64748b;
    --scrollbar-track: #e8ecf3;
}

* {
    box-sizing: border-box;
    scrollbar-width: auto;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* Barras de rolagem globais (área clara e containers) */
html {
    height: 100%;
    scrollbar-width: auto;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
    width: var(--scrollbar-size);
    height: var(--scrollbar-size);
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
*::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
    border: 2px solid transparent;
    background-clip: padding-box;
}

html::-webkit-scrollbar-button,
body::-webkit-scrollbar-button,
*::-webkit-scrollbar-button {
    width: 0;
    height: 0;
    display: none;
}

html::-webkit-scrollbar-corner,
body::-webkit-scrollbar-corner,
*::-webkit-scrollbar-corner {
    background: var(--scrollbar-track);
}

body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
}

/* Título + botão (i) de dicas */
.page-title-row,
.atend-dash-hero-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.page-title-row h1 {
    margin: 0;
}

.page-tips-btn {
    appearance: none;
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.page-tips-btn:hover,
.page-tips-btn[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.22);
    border-color: #fff;
}

.page-tips-btn:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

.page-tips-btn--light {
    border-color: rgba(13, 40, 71, 0.35);
    background: rgba(13, 40, 71, 0.06);
    color: #0d2847;
}

.page-tips-btn--light:hover,
.page-tips-btn--light[aria-expanded="true"] {
    background: rgba(13, 40, 71, 0.12);
    border-color: #0d2847;
}

.page-tips-btn-label {
    display: block;
    transform: translateY(-0.5px);
}

.page-tips-panel {
    position: fixed;
    z-index: 1200;
    width: min(320px, calc(100vw - 24px));
    background: #fff;
    color: #0d2847;
    border: 1px solid #d6dde8;
    border-radius: 10px;
    box-shadow: 0 14px 32px rgba(13, 40, 71, 0.2);
    padding: 12px 14px;
}

.page-tips-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.page-tips-panel-head strong {
    font-size: 13px;
    font-weight: 700;
    color: #0d2847;
}

.page-tips-close {
    appearance: none;
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}

.page-tips-close:hover {
    color: #0d2847;
}

.page-tips-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.page-tips-list li {
    font-size: 12.5px;
    line-height: 1.45;
    color: #334155;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--panel);
    border-radius: 14px;
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(20, 32, 66, 0.08);
}

.login-card h1 {
    margin: 0 0 8px;
}

.login-card p {
    margin: 0 0 20px;
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 10px;
}

.login-form input {
    border: 1px solid var(--border);
    border-radius: 8px;
    height: 40px;
    padding: 0 12px;
}

.login-form button {
    margin-top: 6px;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    height: 42px;
    cursor: pointer;
}

.alert-error {
    background: #ffe4e4;
    border: 1px solid #ffb9b9;
    color: #8d1f1f;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 14px;
}

.app-layout {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    transition: grid-template-columns 0.2s ease;
}

html.sidebar-collapsed .app-layout {
    grid-template-columns: var(--sidebar-width-collapsed) minmax(0, 1fr);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(13, 40, 71, 0.45);
    z-index: 45;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

.sidebar-backdrop[hidden] {
    display: none !important;
}

.sidebar {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    height: 100dvh;
    width: var(--sidebar-width);
    overflow-x: hidden;
    overflow-y: hidden;
    background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-mid) 100%);
    color: var(--sidebar-text);
    padding: 14px 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 40;
    transition: width 0.2s ease, padding 0.2s ease;
}

/* Barra do menu (o scroll real é .sidebar-nav-main, não o aside) */
.sidebar,
.sidebar-nav-main {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 197, 255, 0.45) rgba(0, 0, 0, 0.22);
}

.sidebar::-webkit-scrollbar,
.sidebar-nav-main::-webkit-scrollbar {
    width: 8px;
    height: 0;
}

.sidebar::-webkit-scrollbar:horizontal,
.sidebar-nav-main::-webkit-scrollbar:horizontal {
    display: none;
    height: 0;
}

.sidebar::-webkit-scrollbar-track,
.sidebar-nav-main::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.22);
    border-radius: 999px;
    margin: 6px 0;
}

.sidebar::-webkit-scrollbar-thumb,
.sidebar-nav-main::-webkit-scrollbar-thumb {
    background: rgba(148, 197, 255, 0.4);
    border: 2px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.sidebar-nav-main::-webkit-scrollbar-thumb:hover {
    background: rgba(191, 219, 254, 0.65);
    border: 2px solid transparent;
    background-clip: padding-box;
}

.sidebar::-webkit-scrollbar-button,
.sidebar-nav-main::-webkit-scrollbar-button {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}

.sidebar::-webkit-scrollbar-corner,
.sidebar-nav-main::-webkit-scrollbar-corner {
    background: transparent;
}

html.sidebar-collapsed .sidebar {
    width: var(--sidebar-width-collapsed);
    padding: 12px 6px;
    overflow-x: hidden;
}

.sidebar-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 4px 6px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 4px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
}

.sidebar-brand-mark {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: block;
}

.sidebar-brand-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #fff;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-toggle {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 0 0 auto;
    width: auto;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: var(--sidebar-text);
    border-radius: 8px;
    padding: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.22);
}

.sidebar-toggle-icon {
    flex: 0 0 auto;
    display: block;
}

/* Na mesma linha do nome: só o ícone (aria-label cobre o texto) */
.sidebar-toggle-label {
    display: none;
}

.sidebar-nav-main {
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 2px;
    overscroll-behavior-x: none;
}

.sidebar-nav-group + .sidebar-nav-group {
    margin-top: 14px;
}

.sidebar-nav-group--top {
    margin-bottom: 4px;
}

.sidebar-nav-group--top + .sidebar-nav-group {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-nav-group-label {
    margin: 0 0 4px;
    padding: 0 12px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.42);
}

html.sidebar-collapsed .sidebar-nav-group-label {
    display: none;
}

.sidebar-nav-group ul {
    margin-top: 4px;
}

.sidebar-nav-bottom {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-nav-bottom ul {
    margin-top: 8px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
}

.sidebar li + li {
    margin-top: 4px;
}

.sidebar a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--sidebar-text-muted);
    background: transparent;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    min-width: 0;
}

.sidebar-icon {
    flex: 0 0 auto;
    display: block;
}

.sidebar-link-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--sidebar-text);
}

.sidebar a.active {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-weight: 650;
}

/* Estado recolhido: só ícones + tooltip */
html.sidebar-collapsed .sidebar-brand-title,
html.sidebar-collapsed .sidebar-toggle-label,
html.sidebar-collapsed .sidebar-link-label {
    display: none;
}

html.sidebar-collapsed .sidebar-header {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 0 12px;
}

html.sidebar-collapsed .sidebar-brand {
    display: flex;
    justify-content: center;
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
}

html.sidebar-collapsed .sidebar-brand-mark {
    width: 32px;
    height: 32px;
}

html.sidebar-collapsed .sidebar-toggle {
    justify-content: center;
    padding: 8px;
    margin: 0;
}

html.sidebar-collapsed .sidebar-nav-main {
    overflow-x: hidden;
}

html.sidebar-collapsed .sidebar a {
    justify-content: center;
    padding: 11px 6px;
    max-width: 100%;
}

html.sidebar-collapsed .sidebar a::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: #0d2847;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(13, 40, 71, 0.28);
    opacity: 0;
    pointer-events: none;
    z-index: 80;
    transition: opacity 0.12s ease;
}

html.sidebar-collapsed .sidebar a:hover::after,
html.sidebar-collapsed .sidebar a:focus-visible::after {
    opacity: 1;
}

.main-content {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.topbar {
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-start {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.topbar-menu-btn {
    display: none;
    appearance: none;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--primary);
    border-radius: 8px;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
}

.topbar-menu-btn:hover {
    background: #f1f5f9;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.topbar-logout {
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 13px;
}

.topbar-logout:hover {
    text-decoration: underline;
}

/* Perfil no topo (hero escuro / topbar clara) */
.hero-user-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    border-radius: 10px;
    padding: 8px 12px;
    min-width: 0;
    max-width: min(240px, 42vw);
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.hero-user-icon {
    flex: 0 0 auto;
    display: block;
}

.hero-user-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.hero-user-name {
    font-size: 13px;
    font-weight: 650;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hero-user-caption {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hero-user-link--hero {
    color: rgba(255, 255, 255, 0.88);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
}

.hero-user-link--hero .hero-user-name {
    color: #fff;
}

.hero-user-link--hero .hero-user-caption {
    color: rgba(255, 255, 255, 0.58);
}

.hero-user-link--hero:hover,
.hero-user-link--hero.is-active {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.hero-user-link--hero:hover .hero-user-caption,
.hero-user-link--hero.is-active .hero-user-caption {
    color: rgba(255, 255, 255, 0.72);
}

.hero-user-link--topbar {
    color: var(--text);
    background: #f1f5f9;
    border-color: var(--border);
}

.hero-user-link--topbar .hero-user-name {
    color: var(--text);
}

.hero-user-link--topbar .hero-user-caption {
    color: var(--muted);
}

.hero-user-link--topbar:hover,
.hero-user-link--topbar.is-active {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.hero-user-name--plain {
    font-size: 13px;
    color: var(--muted);
}

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

.topbar-main {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px 20px;
}

.topbar-subnav {
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(31, 76, 207, 0.25);
    background: rgba(31, 76, 207, 0.06);
}

.topbar-subnav:hover {
    background: rgba(31, 76, 207, 0.12);
}

.topbar-subnav--current {
    color: var(--text);
    font-weight: 600;
    border-color: var(--border);
    background: #eef1f7;
    cursor: default;
}

.topbar-subnav--current:hover {
    background: #eef1f7;
}

.content-area {
    padding: clamp(12px, 2vw, 24px);
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
}

.content-area.atend-dash-pbi,
.content-area.vendas-dash-corp {
    padding: 0;
    overflow-x: hidden;
}

.content-area h1 {
    margin-top: 0;
}

.kpi-section {
    margin: 20px 0 8px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.kpi-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

@media (max-width: 900px) {
    .kpi-row {
        grid-template-columns: 1fr;
    }
}

.kpi-box {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 4px 14px rgba(20, 32, 66, 0.06);
}

.kpi-box-title {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    line-height: 1.35;
}

.kpi-value-outer {
    margin: 12px 0 0;
}

.kpi-value-box {
    box-sizing: border-box;
    margin: 0;
    padding: 14px 16px;
    border: 2px solid #c5d0eb;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f4f6fc 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 2px 8px rgba(31, 76, 207, 0.07);
}

.kpi-value-content {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3.1rem;
    margin: 0;
    padding: 8px 10px;
}

.kpi-value-text {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.2;
    text-align: center;
    word-break: break-word;
}

.kpi-box-note {
    margin: 8px 0 0;
    font-size: 11px;
    color: var(--muted);
}

.cards {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

.card h3 {
    margin-top: 0;
}

/* Cards de resumo — página Vendas */
.sales-summary-cards {
    align-items: stretch;
}

.sales-summary-card {
    position: relative;
    padding: 18px 18px 18px 20px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(20, 32, 66, 0.07);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fc 100%);
}

.sales-summary-card-title {
    display: block;
    width: 100%;
    margin: 0 0 8px;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.01em;
    line-height: 1.35;
    text-align: center;
}

.sales-summary-card-note {
    margin: 12px 0 0;
    min-height: 1.25em;
    font-size: 12px;
    line-height: 1.35;
}

.sales-summary-card .sales-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 14px;
}

.sales-summary-card .sales-metric-mini {
    border-radius: 10px;
    padding: 12px 8px;
    background: #e4e9f2;
    border: 1px solid #cdd5e4;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        0 1px 2px rgba(20, 32, 66, 0.06);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sales-summary-card .sales-metric-mini:hover {
    border-color: #b8c4db;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 2px 8px rgba(20, 32, 66, 0.08);
}

.sales-summary-card .sales-metric-mini-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-align: center;
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}

.sales-summary-card .sales-metric-mini-value {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    line-height: 1.25;
    word-break: break-word;
}

@media (max-width: 520px) {
    .sales-summary-card .sales-metric-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-chart-card {
    margin-top: 20px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    padding: 16px 18px 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fc 100%);
    box-shadow: 0 4px 18px rgba(20, 32, 66, 0.06);
}

.dashboard-chart-subtitle {
    margin: 0 0 14px;
    font-size: 12px;
    line-height: 1.4;
}

.dashboard-chart-wrap {
    position: relative;
    height: 440px;
    width: 100%;
}

.dashboard-chart-empty {
    margin: 12px 0 0;
    font-size: 13px;
}

.dashboard-sala-section {
    margin-top: 24px;
}

.dashboard-sala-section h2 {
    margin: 0 0 14px;
    font-size: 1.05rem;
    font-weight: 700;
}

.dashboard-sala-rows {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 0;
}

.dashboard-sala-row {
    display: grid;
    grid-template-columns: minmax(280px, 380px) 1fr;
    gap: 14px;
    align-items: stretch;
}

.dashboard-ponto-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    background: var(--panel);
    box-shadow: 0 4px 18px rgba(20, 32, 66, 0.06);
    box-sizing: border-box;
}

.dashboard-ponto-card-title {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.dashboard-ponto-empty {
    margin: 0;
    font-size: 12px;
}

.dashboard-ponto-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 220px;
    overflow-y: auto;
}

.dashboard-ponto-item {
    border: 1px solid #dde3ef;
    border-radius: 10px;
    padding: 10px;
    background: #f4f6fb;
}

.dashboard-ponto-item-name {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    word-break: break-word;
}

.dashboard-ponto-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
}

.dashboard-ponto-metric-grid .sales-metric-mini {
    padding: 6px 4px;
}

.dashboard-ponto-metric-grid .sales-metric-mini-value {
    font-size: 0.9rem;
}

/* Dashboard atendimentos: cards REALIZADO / ORÇADO / EFICIÊNCIA / PROJETADO */
#atendSummaryCards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 100%;
    margin-top: 16px;
}

#atendSummaryCards .sales-summary-card {
    width: 100%;
    min-width: 0;
    max-width: none;
}

#atendSummaryCards .sales-summary-card-title {
    margin-bottom: 10px;
}

#atendSummaryCards .atend-summary-kpi-value {
    margin: 0;
    text-align: center;
}

.dashboard-sala-metric-grid .sales-metric-mini {
    min-width: 0;
}

.dashboard-sala-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 0;
    width: 100%;
}

.dashboard-sala-card .sales-metric-mini {
    padding: 8px 6px;
    border-radius: 10px;
    background: #e4e9f2;
    border: 1px solid #cdd5e4;
}

.dashboard-sala-card .sales-metric-mini-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
    text-align: center;
    margin-bottom: 6px;
    line-height: 1.2;
}

.dashboard-sala-card .sales-metric-mini-value {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
}

@media (max-width: 768px) {
    #atendSummaryCards {
        grid-template-columns: 1fr;
        width: 100%;
    }

    #atendSummaryCards .sales-summary-card {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 520px) {
    #atendSummaryCards .atend-summary-kpi-value {
        font-size: 0.9rem;
    }

    .dashboard-sala-metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .dashboard-sala-card .sales-metric-mini {
        padding: 8px 4px;
    }

    .dashboard-sala-card .sales-metric-mini-label {
        font-size: 9px;
        margin-bottom: 4px;
    }

    #atendSummaryCards .sales-metric-mini-value,
    .dashboard-sala-card .sales-metric-mini-value {
        font-size: 0.9rem;
    }
}

.dashboard-sala-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    background: var(--panel);
    box-shadow: 0 4px 18px rgba(20, 32, 66, 0.06);
    box-sizing: border-box;
}

@media (max-width: 900px) {
    .dashboard-sala-row {
        grid-template-columns: 1fr;
    }
}

.dashboard-sala-card-title {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
    word-break: break-word;
}

.dashboard-sala-card-value {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--primary, #1f4ccf);
    line-height: 1.2;
}

.dashboard-sala-card-label {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: var(--muted);
}

.muted {
    color: var(--muted);
}

.table-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
}

.table-toolbar select,
.table-toolbar button,
.table-toolbar input {
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 10px;
    background: #fff;
}

.table-toolbar button {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    cursor: pointer;
}

.table-toolbar .button-link {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    text-decoration: none;
}

.column-picker {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    min-width: 320px;
}

.column-picker summary {
    cursor: pointer;
    font-weight: 600;
}

.column-picker-search-wrap {
    margin: 10px 0 4px;
}

.column-picker-search {
    width: 100%;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 10px;
    background: #fff;
}

.column-picker-actions {
    display: flex;
    gap: 8px;
    margin: 10px 0;
}

.column-picker-actions button {
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f7f9ff;
    color: var(--text);
    padding: 0 10px;
    cursor: pointer;
}

.column-picker-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 6px 10px;
    max-height: 220px;
    overflow: auto;
    padding-right: 4px;
}

.column-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.table-wrap {
    overflow: auto;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    max-height: calc(100vh - 260px);
}

.listing-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.listing-data-table th,
.listing-data-table td {
    border-bottom: 1px solid var(--border);
    padding: 8px 10px;
    white-space: nowrap;
    text-align: left;
}

.listing-data-table td.text-right {
    text-align: right;
}

.listing-data-table td.text-center {
    text-align: center;
}

.listing-data-table th {
    position: sticky;
    top: 0;
    background: #eef2fb;
    z-index: 2;
}

.listing-data-table th.sortable {
    cursor: grab;
    user-select: none;
}

.listing-data-table th.sortable.active {
    background: #dde7ff;
}

.listing-data-table th.sortable.dragging {
    opacity: 0.6;
}

.listing-data-table .summary-row td {
    background: #f4f7ff;
    border-top: 2px solid #cfd9f7;
    font-weight: 600;
    position: sticky;
    bottom: 0;
    z-index: 3;
}

.charts-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.chart-card {
    height: 380px;
    overflow: hidden;
}

.chart-card--product {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chart-card--product .chart-scroll-wrap {
    flex: 1;
    min-height: 0;
}

.chart-card h3 {
    margin: 0 0 12px;
    text-align: center;
    flex-shrink: 0;
}

.chart-card > canvas {
    width: 100% !important;
    height: 300px !important;
}

.chart-scroll-wrap {
    overflow-y: scroll;
    overflow-x: hidden;
    padding-right: 4px;
    box-sizing: border-box;
    scrollbar-gutter: stable;
}

.chart-scroll-inner {
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

.chart-scroll-inner canvas {
    display: block;
    width: 100%;
}

@media (max-width: 1100px) {
    .kpi-row {
        grid-template-columns: 1fr;
    }

    .atend-dash-pbi .atend-dash-kpis,
    .vendas-dash-corp .atend-dash-kpis,
    .vendas-charts-grid,
    .atend-dash-trend,
    .atend-dash-pair-full {
        padding-left: 14px;
        padding-right: 14px;
    }

    .vendas-dash-tabs {
        padding-left: 14px;
        padding-right: 14px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 900px) {
    .app-layout {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    html.sidebar-collapsed .app-layout {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .sidebar-backdrop {
        display: block;
    }

    .sidebar-backdrop[hidden] {
        display: none !important;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        height: 100dvh;
        width: min(280px, 86vw) !important;
        padding: 14px 10px !important;
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        z-index: 50;
        box-shadow: 8px 0 28px rgba(13, 40, 71, 0.28);
    }

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

    /* No mobile o drawer mostra rótulos completos */
    html.sidebar-collapsed .sidebar-brand-title,
    html.sidebar-collapsed .sidebar-link-label {
        display: initial;
    }

    html.sidebar-collapsed .sidebar-header {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
        padding: 4px 6px 12px;
    }

    html.sidebar-collapsed .sidebar-brand {
        display: flex;
        justify-content: flex-start;
        flex: 1 1 auto;
        width: auto;
    }

    html.sidebar-collapsed .sidebar-brand-mark {
        width: 28px;
        height: 28px;
    }

    html.sidebar-collapsed .sidebar-toggle,
    html.sidebar-collapsed .sidebar a {
        justify-content: flex-start;
    }

    html.sidebar-collapsed .sidebar-toggle {
        justify-content: center;
        padding: 7px;
        margin: 0;
    }

    html.sidebar-collapsed .sidebar a::after {
        display: none;
    }

    .topbar-menu-btn {
        display: inline-flex;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 10px 12px;
    }

    .topbar > div:first-child {
        font-size: 13px;
    }

    .dashboard-diario-body {
        padding: 12px 14px 20px;
    }
}

@media (max-width: 640px) {
    .hero-user-caption {
        display: none;
    }

    .vendas-dash-tab {
        padding: 10px 12px;
        font-size: 12px;
    }
}
