/* Base layout/tokens: assets/css/mapos-design-system.css */

.portal-body {
    background: radial-gradient(ellipse at 10% 0%, var(--mapos-primary-soft) 0%, var(--mapos-bg) 45%, var(--mapos-bg) 100%);
}

.portal-shell {
    display: block;
    max-width: 100%;
    --sidebar-w: 220px;
}

.portal-shell.has-admin-sidebar {
    display: flex;
    gap: 16px;
    align-items: stretch;
    width: 100%;
}

.portal-shell.has-admin-sidebar.admin-sidebar-collapsed {
    --sidebar-w: 74px;
}

.portal-main-content {
    width: auto;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
    flex: 1 1 0%;
}

.portal-shell.has-admin-sidebar .portal-main-content {
    flex: 1 1 0%;
    min-width: 0;
}

.portal-shell.has-admin-sidebar .admin-sidebar {
    flex: 0 0 var(--sidebar-w);
    width: var(--sidebar-w);
    max-width: var(--sidebar-w);
}

.admin-sidebar {
    width: 220px;
    max-width: 220px;
    background: linear-gradient(180deg, rgba(15, 23, 42, .96), rgba(30, 41, 59, .96));
    color: #e2e8f0;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, .24);
    padding: 12px;
    box-shadow: 0 16px 34px rgba(15, 23, 42, .28);
    transition: width .2s ease;
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 26px);
    overflow-y: auto;
}

.admin-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.admin-sidebar-nav a {
    display: block;
    color: #cbd5e1;
    text-decoration: none;
    padding: 11px 11px;
    border-radius: 10px;
    margin-bottom: 7px;
    border: 1px solid rgba(148, 163, 184, .15);
    background: rgba(255,255,255,.04);
    white-space: nowrap;
}

.admin-sidebar-nav a i {
    width: 18px;
    text-align: center;
    margin-right: 8px;
}

.admin-sidebar-nav a i.menu-money-icon {
    font-style: normal;
    font-weight: 700;
    font-family: inherit;
}

.admin-sidebar-nav a i.menu-recorr-icon {
    font-style: normal;
    font-weight: 700;
    font-family: inherit;
}

.admin-sidebar-nav a:hover {
    background: rgba(14, 165, 233, .22);
    border-color: rgba(56, 189, 248, .45);
    color: #fff;
}

.admin-sidebar-nav a.active {
    background: rgba(14, 165, 233, .32);
    border-color: rgba(56, 189, 248, .62);
    color: #fff;
    box-shadow: inset 3px 0 0 #38bdf8;
}

.admin-sidebar-nav a .nav-badge {
    float: right;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(16, 185, 129, .25);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, .45);
}

.portal-shell.admin-sidebar-collapsed .admin-sidebar-nav a .nav-badge {
    display: none;
}

.admin-sidebar-footer {
    margin-top: 12px;
    font-size: 12px;
    color: #94a3b8;
    border-top: 1px dashed rgba(148, 163, 184, .25);
    padding-top: 8px;
}

.portal-shell.admin-sidebar-collapsed .admin-sidebar {
    width: 64px;
    max-width: 64px;
}

.portal-shell.admin-sidebar-collapsed .admin-sidebar strong,
.portal-shell.admin-sidebar-collapsed .admin-sidebar-footer,
.portal-shell.admin-sidebar-collapsed .admin-sidebar-nav a span {
    display: none;
}

.portal-shell.admin-sidebar-collapsed .admin-sidebar-nav a {
    text-align: center;
    padding-left: 0;
    padding-right: 0;
}

.portal-shell.admin-sidebar-collapsed .admin-sidebar-nav a i {
    margin-right: 0;
    width: auto;
}

.portal-topbar {
    background: linear-gradient(125deg, #0f172a, #1e3a8a 55%, #0e7490);
    color: #fff;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, .22);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    gap: 10px;
}

.portal-topbar h3 {
    margin: 0;
    letter-spacing: .2px;
}

.portal-topbar-titles {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.portal-topbar-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.portal-empresa-pill,
.portal-perfil-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .22);
    color: #e2e8f0;
    max-width: 100%;
}

.portal-empresa-pill-muted {
    opacity: .85;
    font-weight: 500;
}

.portal-perfil-pill {
    background: rgba(14, 165, 233, .22);
    border-color: rgba(56, 189, 248, .35);
}

.alert {
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 14px;
    font-size: 14px;
    border: 1px solid transparent;
}

.alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

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

.theme-dark .alert-error {
    background: rgba(239, 68, 68, .12);
    border-color: rgba(248, 113, 113, .35);
    color: #fca5a5;
}

.theme-dark .alert-success {
    background: rgba(16, 185, 129, .12);
    border-color: rgba(52, 211, 153, .35);
    color: #6ee7b7;
}

.portal-nav .btn {
    border-radius: 999px;
    border: 0;
    margin-left: 4px;
    flex: 0 0 auto;
}

.portal-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    max-width: 100%;
}

.portal-clock {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .25);
    color: #e2e8f0;
    line-height: 1.2;
}

.portal-nav .btn-default {
    background: rgba(255, 255, 255, .14);
    color: #fff;
}

#toggleSidebar {
    min-width: 38px;
    font-weight: 700;
    padding: 2px 8px;
}

.theme-dark {
    background: radial-gradient(circle at 20% 0%, #0b1220 0, #0f172a 42%, #111827 100%);
    color: #e5e7eb;
}

.theme-dark .portal-card {
    background: rgba(17, 24, 39, .94);
    border-color: rgba(148, 163, 184, .38);
    color: #e5e7eb;
    box-shadow: 0 14px 28px rgba(2, 6, 23, .42);
}

.theme-dark .portal-input,
.theme-dark select,
.theme-dark textarea {
    background: #0f172a;
    border-color: #334155;
    color: #e5e7eb;
}

.theme-dark .chat-box {
    background: linear-gradient(180deg, #0f172a, #111827);
    border-color: rgba(148, 163, 184, .36);
}

.theme-dark .msg.bot {
    background: #1f2937;
    color: #e5e7eb;
}

.theme-dark .chat-hint {
    background: #111827;
    border-color: rgba(148, 163, 184, .35);
}

.theme-dark .admin-sidebar {
    background: linear-gradient(180deg, rgba(2, 6, 23, .96), rgba(15, 23, 42, .96));
    border-color: rgba(148, 163, 184, .3);
}

.theme-dark .admin-sidebar-nav a {
    border-color: rgba(148, 163, 184, .24);
    background: rgba(30, 41, 59, .45);
}

.theme-dark .admin-sidebar-nav a:hover {
    border-color: rgba(56, 189, 248, .58);
}

.theme-dark .sla-hero {
    border: 1px solid rgba(148, 163, 184, .32);
}

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

.theme-dark .table th,
.theme-dark .table td {
    border-color: rgba(148, 163, 184, .28);
}

.theme-dark .table thead th {
    background: rgba(30, 41, 59, .55);
    color: #e2e8f0;
}

.theme-dark canvas {
    filter: saturate(1.08) brightness(1.04);
}

.theme-dark .kpi small,
.theme-dark .auth-header p,
.theme-dark .chat-step,
.theme-dark .msg-status {
    color: #94a3b8;
}

.portal-card {
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(148, 163, 184, .38);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.sla-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(130deg, #0f172a, #1e3a8a);
    color: #fff;
}

.sla-hero h3 {
    margin: 0 0 4px 0;
}

.sla-hero p {
    margin: 0;
    color: #dbeafe;
}

.sla-hero-badge {
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.18);
    font-weight: 700;
    letter-spacing: .4px;
}

/* --- Páginas operacionais (Gestão de Chamados, etc.) --- */
.portal-page-hero {
    background: linear-gradient(130deg, #0f172a 0%, #1e3a8a 55%, #0e7490 100%);
    color: #fff;
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 16px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, .2);
}

.portal-page-hero-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.portal-page-hero h3 {
    margin: 0 0 6px;
    font-size: 22px;
    letter-spacing: .2px;
}

.portal-page-hero p {
    margin: 0;
    color: #dbeafe;
    font-size: 14px;
}

.portal-page-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.portal-hero-badge {
    display: inline-block;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .22);
    font-size: 13px;
    font-weight: 700;
}

.portal-hero-badge-accent {
    background: rgba(16, 185, 129, .22);
    border-color: rgba(110, 231, 183, .45);
    color: #ecfdf5;
}

.portal-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.portal-kpi-card {
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(148, 163, 184, .35);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
}

.portal-kpi-card small {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 6px;
}

.portal-kpi-card strong {
    display: block;
    font-size: 28px;
    line-height: 1.1;
    color: #0f172a;
}

.portal-kpi-sub {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: #64748b;
}

.portal-kpi-card-good strong { color: #047857; }
.portal-kpi-card-warn strong { color: #b45309; }

.portal-card-table {
    padding: 0;
    overflow: visible;
}

.portal-card-table .portal-toolbar {
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, .28);
}

.portal-toolbar-title h4 {
    margin: 0 0 4px;
    font-size: 16px;
}

.portal-toolbar-title p {
    margin: 0;
    font-size: 12px;
}

.portal-filter-form {
    margin-top: 12px;
}

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

.portal-filter-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin: 0;
}

.portal-input-compact {
    width: auto;
    min-width: 140px;
    max-width: 220px;
    height: 38px;
}

.portal-input-grow {
    flex: 1 1 220px;
    min-width: 180px;
    max-width: 420px;
    height: 38px;
}

.portal-table-wrap {
    padding: 0 18px 18px;
    overflow-x: auto;
}

.portal-table {
    margin: 0;
    font-size: 13px;
}

.portal-table thead th {
    background: #f8fafc;
    color: #334155;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .35px;
    border-bottom-width: 2px;
    white-space: nowrap;
}

.portal-table tbody tr:hover {
    background: rgba(14, 165, 233, .04);
}

.portal-table-actions {
    white-space: nowrap;
    width: 1%;
}

.portal-table-empty {
    text-align: center;
    padding: 28px 16px !important;
    color: #64748b;
}

.portal-table-empty i {
    display: block;
    font-size: 22px;
    margin-bottom: 8px;
    opacity: .65;
}

.portal-ticket-num {
    color: #1d4ed8;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
}

.status-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .2px;
    white-space: nowrap;
}

.status-open { background: #fee2e2; color: #991b1b; }
.status-progress { background: #fef3c7; color: #92400e; }
.status-wait { background: #ffedd5; color: #9a3412; }
.status-done { background: #d1fae5; color: #065f46; }
.status-default { background: #e2e8f0; color: #334155; }

.theme-dark .portal-page-hero {
    border: 1px solid rgba(148, 163, 184, .28);
}

.theme-dark .portal-kpi-card {
    background: rgba(17, 24, 39, .94);
    border-color: rgba(148, 163, 184, .32);
}

.theme-dark .portal-kpi-card strong { color: #e2e8f0; }
.theme-dark .portal-kpi-card-good strong { color: #6ee7b7; }
.theme-dark .portal-kpi-card-warn strong { color: #fcd34d; }

.theme-dark .portal-card-table .portal-toolbar {
    border-bottom-color: rgba(148, 163, 184, .24);
}

.theme-dark .portal-table thead th {
    background: rgba(30, 41, 59, .55);
    color: #cbd5e1;
}

.theme-dark .portal-table tbody tr:hover {
    background: rgba(14, 165, 233, .08);
}

.theme-dark .portal-ticket-num { color: #93c5fd; }

.theme-dark .status-open { background: rgba(239, 68, 68, .18); color: #fca5a5; }
.theme-dark .status-progress { background: rgba(245, 158, 11, .18); color: #fcd34d; }
.theme-dark .status-wait { background: rgba(249, 115, 22, .18); color: #fdba74; }
.theme-dark .status-done { background: rgba(16, 185, 129, .18); color: #6ee7b7; }

.sla-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
    width: 100%;
    align-items: stretch;
}

.sla-grid .kpi {
    min-width: 0;
    min-height: 86px;
}

.kpi small {
    display: block;
    color: #475569;
    margin-bottom: 4px;
    font-size: 11px;
}

.kpi h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.1;
}

.kpi.warn h2 { color: #b91c1c; }
.kpi.good h2 { color: #047857; }

.sla-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
    width: 100%;
}

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

.chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.donut-layout {
    display: grid;
    grid-template-columns: minmax(180px, 240px) 1fr;
    gap: 14px;
    align-items: center;
}

.donut-canvas-wrap {
    height: 220px;
}

.donut-legend {
    font-size: 12px;
    color: #334155;
}

.donut-legend-title {
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: .2px;
}

.donut-legend-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.donut-legend-table th,
.donut-legend-table td {
    border-bottom: 1px solid #e2e8f0;
    padding: 6px 8px;
    font-size: 12px;
}

.donut-legend-table thead th {
    color: #0284c7;
    font-weight: 700;
    text-align: right;
    background: #f8fafc;
}

.donut-legend-table thead th:first-child,
.donut-legend-table thead th:nth-child(2) {
    text-align: left;
}

.donut-legend-table .code {
    font-weight: 600;
    color: #0f172a;
}

.donut-legend-table .num {
    text-align: right;
    white-space: nowrap;
}

.donut-legend-table .dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.donut-legend-table tbody tr:last-child td {
    border-bottom: 0;
}

.theme-dark .donut-legend-table {
    border-color: #334155;
}

.theme-dark .donut-legend-table th,
.theme-dark .donut-legend-table td {
    border-bottom-color: #334155;
}

.theme-dark .donut-legend-table thead th {
    background: #0f172a;
    color: #38bdf8;
}

.theme-dark .donut-legend-table .code {
    color: #e2e8f0;
}

.portal-card.narrow {
    max-width: 520px;
    margin: 0 auto;
}

.auth-card {
    max-width: 760px;
    margin: 0 auto;
}

.auth-header h4 {
    margin: 0;
}

.auth-header p {
    margin: 6px 0 12px;
    color: #475569;
}

.auth-form label {
    display: block;
    margin: 10px 0 4px;
    font-weight: 600;
    color: #1e293b;
}

.portal-input {
    width: 100%;
    height: 40px;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 8px 12px;
    outline: 0;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.portal-input:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, .15);
}

.auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
}

.auth-actions {
    margin-top: 14px;
    display: flex;
    gap: 8px;
}

.btn-light {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
}

.chat-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 12px;
    align-items: start;
}

.chat-main {
    flex: 1;
    min-width: 0;
}

.chat-side {
    width: 100%;
}

.chat-hint {
    background: linear-gradient(180deg, #f8fafc, #eef2ff);
    border: 1px solid #d6e1ef;
    border-radius: 12px;
    padding: 12px;
}

.chat-hint h6 {
    margin-top: 0;
}

.chat-step {
    font-size: 12px;
    color: #475569;
    margin-bottom: 6px;
}

.chat-box {
    height: clamp(240px, 42vh, 380px);
    overflow-y: auto;
    background: linear-gradient(180deg, #f8fafc, #eef2ff);
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    padding: 14px;
}

.chat-input-row {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-input-row input {
    border-radius: 999px;
    height: 44px;
    flex: 1 1 auto;
    min-width: 0;
}

.chat-input-row .btn {
    border-radius: 999px;
    min-width: 120px;
    height: 44px;
    border: 0;
    background: linear-gradient(90deg, #0284c7, #0ea5e9);
    box-shadow: 0 8px 18px rgba(14, 165, 233, .25);
}

.portal-main-content > * {
    max-width: 100%;
}

.msg-row {
    display: flex;
    margin-bottom: 12px;
    flex-direction: column;
    align-items: flex-start;
}

.msg-row.user {
    align-items: flex-end;
}

.msg {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 14px;
    max-width: 78%;
    line-height: 1.45;
    box-shadow: 0 3px 8px rgba(15, 23, 42, .08);
    animation: msgIn .2s ease;
}

.msg.bot {
    background: #e2e8f0;
    color: #0f172a;
    border-top-left-radius: 4px;
}

.msg.user {
    background: linear-gradient(90deg, #0284c7, #0ea5e9);
    color: #fff;
    border-top-right-radius: 4px;
}

.msg-status {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: #64748b;
}

.resumo-box {
    margin-top: 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    padding: 14px;
}

.resumo-box .portal-input {
    margin-bottom: 8px;
}

.item-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 120px;
    gap: 8px;
    margin-bottom: 8px;
}

#submitLoading {
    color: #0369a1;
    font-weight: 600;
    position: relative;
    padding-left: 18px;
}

#submitLoading:before {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #0ea5e9;
    border-top-color: transparent;
    animation: spinMini .7s linear infinite;
}

.pill {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
}

.pill-critico {
    background: #fee2e2;
    color: #991b1b;
}

.pill-urgente {
    background: #ffedd5;
    color: #9a3412;
}

.pill-demandas {
    background: #dbeafe;
    color: #1e3a8a;
}

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

@keyframes spinMini {
    from { transform: rotate(0); }
    to { transform: rotate(360deg); }
}

@media (max-width: 960px) {
    .portal-shell.has-admin-sidebar {
        display: block;
        --sidebar-w: auto;
    }
    .admin-sidebar {
        width: auto;
        max-width: 100%;
        margin-bottom: 12px;
    }
    .portal-shell.admin-sidebar-collapsed .admin-sidebar {
        width: auto;
    }
    .portal-shell.admin-sidebar-collapsed .admin-sidebar strong,
    .portal-shell.admin-sidebar-collapsed .admin-sidebar-footer,
    .portal-shell.admin-sidebar-collapsed .admin-sidebar-nav a span {
        display: inline;
    }
    .sla-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sla-charts { grid-template-columns: 1fr; }
    .auth-grid {
        grid-template-columns: 1fr;
    }
    .auth-actions {
        display: block;
    }
    .auth-actions .btn {
        display: block;
        width: 100%;
        margin-bottom: 8px;
    }
    .chat-layout {
        display: block;
    }
    .chat-side {
        width: auto;
        margin-top: 12px;
    }
    .chart-wrap {
        height: 240px;
    }
    .item-row {
        grid-template-columns: 1fr;
    }
    .portal-page-hero-body {
        flex-direction: column;
        align-items: flex-start;
    }
    .portal-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .portal-filter-row .btn {
        width: 100%;
    }
}

@media (max-width: 680px) {
    .sla-grid { grid-template-columns: 1fr; }
    .donut-layout { grid-template-columns: 1fr; }
    .donut-canvas-wrap { height: 210px; }
    .chamados-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .chamados-hero-badges { width: 100%; }
}

/* --- Gestão de Chamados --- */
.chamados-hero {
    flex-wrap: wrap;
    gap: 14px;
}

.chamados-hero-text h3 {
    margin: 0 0 6px;
}

.chamados-hero-text p {
    margin: 0;
    color: #dbeafe;
    font-size: 14px;
}

.chamados-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.chamados-badge-tratados {
    background: rgba(16, 185, 129, .28) !important;
    border: 1px solid rgba(110, 231, 183, .45);
}

.chamados-badge-pend {
    background: rgba(245, 158, 11, .22) !important;
    border: 1px solid rgba(251, 191, 36, .4);
}

.chamados-kpi-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.chamados-kpi-grid .kpi small i {
    margin-right: 4px;
    opacity: .75;
}

.chamados-filtros-head h4 {
    margin: 0 0 4px;
    font-size: 16px;
    color: #0f172a;
}

.chamados-filtros-head h4 i {
    color: #0284c7;
    margin-right: 6px;
}

.chamados-filtros-head p {
    margin: 0 0 14px;
    font-size: 13px;
}

.chamados-filtros-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) 160px minmax(200px, 2fr) auto;
    gap: 12px;
    align-items: end;
}

.chamados-field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .35px;
    color: #64748b;
    margin-bottom: 4px;
}

.chamados-field .portal-input {
    height: 38px;
}

.chamados-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.chamados-table-card {
    padding: 0;
    overflow: hidden;
}

.chamados-table-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, .28);
    background: linear-gradient(180deg, #f8fafc, #fff);
}

.chamados-table-head h4 {
    margin: 0;
    font-size: 16px;
    color: #0f172a;
}

.chamados-table-head h4 i {
    color: #0284c7;
    margin-right: 6px;
}

.chamados-count-badge {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    background: #e2e8f0;
    padding: 4px 10px;
    border-radius: 999px;
}

.chamados-table-scroll {
    overflow-x: auto;
    padding: 0;
}

.chamados-table {
    margin: 0;
    font-size: 13px;
}

.chamados-table thead th {
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .35px;
    padding: 10px 12px;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.chamados-table tbody td {
    padding: 11px 12px;
    vertical-align: middle;
    border-color: #e2e8f0;
}

.chamados-table tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, .8);
}

.chamados-table tbody tr:hover {
    background: rgba(14, 165, 233, .06);
}

.chamados-num {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 3px 8px;
    border-radius: 6px;
}

.chamados-cliente {
    max-width: 200px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
}

.chamados-usuario span {
    display: block;
    font-weight: 600;
    color: #334155;
}

.chamados-usuario small {
    display: block;
    color: #64748b;
    font-size: 11px;
    margin-top: 2px;
}

.chamados-data {
    white-space: nowrap;
    font-size: 12px;
    color: #475569;
}

.chamados-col-acoes {
    white-space: nowrap;
    width: 1%;
}

.chamados-col-acoes .btn {
    margin-right: 4px;
}

.chamados-empty {
    text-align: center;
    padding: 36px 16px !important;
    color: #64748b;
}

.chamados-empty i {
    font-size: 28px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.chamados-empty p {
    margin: 0 0 4px;
    font-weight: 600;
    color: #475569;
}

.chamados-empty small {
    color: #94a3b8;
}

.theme-dark .chamados-filtros-head h4,
.theme-dark .chamados-table-head h4 {
    color: #e2e8f0;
}

.theme-dark .chamados-table-head {
    background: linear-gradient(180deg, rgba(30, 41, 59, .6), rgba(17, 24, 39, .94));
    border-bottom-color: rgba(148, 163, 184, .24);
}

.theme-dark .chamados-count-badge {
    background: rgba(51, 65, 85, .8);
    color: #cbd5e1;
}

.theme-dark .chamados-table thead th {
    background: rgba(30, 41, 59, .7);
    color: #94a3b8;
    border-bottom-color: rgba(148, 163, 184, .24);
}

.theme-dark .chamados-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, .35);
}

.theme-dark .chamados-table tbody tr:hover {
    background: rgba(14, 165, 233, .1);
}

.theme-dark .chamados-num {
    background: rgba(29, 78, 216, .2);
    border-color: rgba(96, 165, 250, .35);
    color: #93c5fd;
}

.theme-dark .chamados-cliente,
.theme-dark .chamados-usuario span {
    color: #e2e8f0;
}

@media (max-width: 1200px) {
    .chamados-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .chamados-filtros-row {
        grid-template-columns: 1fr 1fr;
    }
    .chamados-field-grow {
        grid-column: 1 / -1;
    }
    .chamados-field-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .chamados-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .chamados-filtros-row {
        grid-template-columns: 1fr;
    }
    .chamados-actions .btn {
        flex: 1 1 auto;
    }
    .sla-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .sla-export-row {
        flex-direction: column;
        align-items: stretch;
    }
    .sla-export-form {
        flex-direction: column;
        align-items: stretch;
    }
    .sla-insight-grid {
        grid-template-columns: 1fr;
    }
}

/* --- SLA Analytics --- */
.sla-page-hero {
    flex-wrap: wrap;
    gap: 14px;
}

.sla-kpi-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.sla-kpi-grid .kpi small i {
    margin-right: 4px;
    opacity: .75;
}

.sla-filtros-row {
    grid-template-columns: minmax(200px, 2fr) 180px auto;
}

.sla-export-card {
    padding-bottom: 14px;
}

.sla-export-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 4px;
}

.sla-export-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.sla-email-dest {
    min-width: 220px;
    max-width: 320px;
    height: 38px;
}

.sla-email-hint {
    display: block;
    margin-top: 8px;
    font-size: 12px;
}

.sla-smtp-details {
    margin-top: 12px;
    font-size: 12px;
    color: #64748b;
}

.sla-smtp-details summary {
    cursor: pointer;
    color: #475569;
    font-weight: 600;
}

.sla-smtp-details p {
    margin: 8px 0 0;
    line-height: 1.45;
}

.sla-panel-card {
    padding: 0;
    overflow: hidden;
}

.sla-panel-head {
    padding: 16px 18px 10px;
    border-bottom: 1px solid rgba(148, 163, 184, .22);
    background: linear-gradient(180deg, #f8fafc, #fff);
}

.sla-panel-head h4 {
    margin: 0 0 4px;
    font-size: 16px;
    color: #0f172a;
}

.sla-panel-head h4 i {
    color: #0284c7;
    margin-right: 6px;
}

.sla-panel-head p {
    margin: 0;
    font-size: 12px;
}

.sla-panel-card .donut-layout,
.sla-panel-card .chart-wrap {
    padding: 14px 18px 18px;
}

.sla-chart-resumo {
    padding: 0 18px 14px;
    color: #64748b;
}

.sla-empty-success {
    text-align: center;
    padding: 32px 20px;
    color: #047857;
}

.sla-empty-success i {
    font-size: 36px;
    margin-bottom: 10px;
    display: block;
}

.sla-empty-success p {
    margin: 0 0 4px;
    font-weight: 700;
    font-size: 16px;
    color: #065f46;
}

.sla-empty-success small {
    color: #64748b;
}

.sla-insights-body {
    padding: 14px 18px 18px;
}

.sla-insight-block {
    margin-bottom: 14px;
}

.sla-insight-block strong {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .35px;
    color: #64748b;
    margin-bottom: 4px;
}

.sla-insight-block p {
    margin: 0;
    color: #334155;
    line-height: 1.5;
    font-size: 14px;
}

.sla-insight-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sla-insight-list {
    margin: 0;
    padding-left: 18px;
    color: #334155;
    font-size: 13px;
    line-height: 1.55;
}

.sla-insight-acoes li {
    margin-bottom: 4px;
}

.theme-dark .sla-panel-head {
    background: linear-gradient(180deg, rgba(30, 41, 59, .6), rgba(17, 24, 39, .94));
    border-bottom-color: rgba(148, 163, 184, .24);
}

.theme-dark .sla-panel-head h4 {
    color: #e2e8f0;
}

.theme-dark .sla-insight-block p,
.theme-dark .sla-insight-list {
    color: #cbd5e1;
}

.theme-dark .sla-smtp-details {
    color: #94a3b8;
}

@media (max-width: 1200px) {
    .sla-kpi-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* --- WhatsApp Bot admin --- */
.wpp-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--mp-border, #e2e8f0);
    padding-bottom: 12px;
}
.wpp-tab {
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--mp-text-muted, #64748b);
    font-weight: 600;
    background: transparent;
}
.wpp-tab.active,
.wpp-tab:hover {
    background: var(--mp-primary-soft, #eff6ff);
    color: var(--mp-primary, #2563eb);
}
.wpp-qr-wrap {
    text-align: center;
    margin: 20px 0;
}
.wpp-qr-wrap img {
    max-width: 280px;
    border: 10px solid #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.wpp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}
.wpp-status-badge.wpp-status-CONECTADO { background: #dcfce7; color: #166534; }
.wpp-status-badge.wpp-status-QRCODE { background: #fef9c3; color: #854d0e; }
.wpp-status-badge.wpp-status-OFFLINE,
.wpp-status-badge.wpp-status-ERRO { background: #fee2e2; color: #991b1b; }
.wpp-status-badge.wpp-status-INICIANDO,
.wpp-status-badge.wpp-status-REINICIANDO { background: #e2e8f0; color: #334155; }
.wpp-contato-form { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--mp-border, #e2e8f0); }
.wpp-poll-indicator { font-size: 12px; margin-left: 8px; align-self: center; }
.wpp-status-hint { display: block; margin-top: 6px; font-size: 12px; }

/* --- Licenças & Softwares --- */
.lic-resumo-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; justify-content: flex-end; }
.lic-badge-warn { background: #ffedd5 !important; color: #9a3412 !important; }
.lic-badge-danger { background: #fee2e2 !important; color: #991b1b !important; }
.lic-kpi-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.lic-kpi {
    flex: 1 1 140px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 16px;
}
.lic-kpi strong { display: block; font-size: 1.25rem; color: #0f172a; }
.lic-kpi span { font-size: 12px; color: #64748b; }
.lic-kpi-warn { background: #fff7ed; border-color: #fed7aa; }
.lic-kpi-danger { background: #fef2f2; border-color: #fecaca; }
.lic-form { margin-bottom: 8px; }
.lic-divider { border: 0; border-top: 1px solid #e2e8f0; margin: 24px 0; }
.lic-table th { white-space: nowrap; }
.lic-acoes { white-space: nowrap; }
.lic-acoes .btn { margin: 2px; }
@media (max-width: 768px) {
    .lic-resumo-badges { justify-content: flex-start; }
}
