:root {
    --primary: #0057ff;
    --primary-600: #0047d6;
    --primary-700: #0036a8;
    --secondary: #0ea5e9;
    --success: #00b884;
    --success-soft: rgba(0, 184, 132, .12);
    --danger: #ef233c;
    --danger-soft: rgba(239, 35, 60, .12);
    --warning: #ff8c00;
    --warning-soft: rgba(255, 140, 0, .14);

    --bg: #eef4ff;
    --bg-soft: #f8fbff;
    --surface: #ffffff;
    --surface-2: #f7faff;
    --text: #0f172a;
    --text-soft: #334155;
    --muted: #64748b;
    --border: #d9e5f7;

    --shadow-sm: 0 4px 16px rgba(15, 23, 42, .06);
    --shadow-md: 0 14px 40px rgba(15, 23, 42, .10);
    --shadow-lg: 0 24px 70px rgba(15, 23, 42, .16);

    --sidebar-width: 292px;
    --topbar-height: 82px;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;

    --font: "Inter", "Segoe UI", Arial, sans-serif;
}

html[data-theme="dark"] {
    --bg: #0b1120;
    --bg-soft: #0f172a;
    --surface: #111827;
    --surface-2: #172033;
    --text: #f8fafc;
    --text-soft: #e2e8f0;
    --muted: #94a3b8;
    --border: #253149;

    --shadow-sm: 0 4px 16px rgba(0, 0, 0, .22);
    --shadow-md: 0 14px 40px rgba(0, 0, 0, .32);
    --shadow-lg: 0 24px 70px rgba(0, 0, 0, .45);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    background:
        radial-gradient(circle at top left, rgba(0, 87, 255, .12), transparent 28rem),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, .10), transparent 30rem),
        var(--bg);
    color: var(--text);
}

a {
    text-decoration: none;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.app-sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1040;
    background:
        linear-gradient(180deg, #0057ff 0%, #0036a8 100%);
    color: #ffffff;
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    box-shadow: 12px 0 40px rgba(0, 54, 168, .28);
}

.brand-area {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 6px 8px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
    margin-bottom: 18px;
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .96);
    display: grid;
    place-items: center;
    box-shadow: 0 12px 24px rgba(0, 0, 0, .14);
}

.brand-mark span {
    width: 18px;
    height: 30px;
    border-radius: 999px;
    background: linear-gradient(180deg, #28a8ff, #0057ff);
    display: block;
}

.brand-text strong {
    display: block;
    color: #fff;
    font-size: 1.28rem;
    font-weight: 900;
    letter-spacing: .08em;
}

.brand-text small {
    color: rgba(255, 255, 255, .74);
    text-transform: uppercase;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .10em;
}

.sidebar-section-title {
    color: rgba(255, 255, 255, .58);
    text-transform: uppercase;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .10em;
    margin: 16px 10px 8px;
}

.sidebar-nav {
    display: grid;
    gap: 7px;
}

.sidebar-link {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, .82);
    padding: 0 14px;
    border-radius: 14px;
    font-weight: 800;
    transition: .18s ease;
}

.sidebar-link i {
    width: 22px;
    text-align: center;
    font-size: 1.05rem;
}

.sidebar-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .11);
}

.sidebar-link.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .18);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 18px;
}

.system-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 18px;
    padding: 12px;
}

.system-pill strong {
    display: block;
    font-size: .86rem;
    color: #fff;
}

.system-pill small {
    color: rgba(255, 255, 255, .68);
    font-weight: 700;
}

.pulse-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #00ffae;
    box-shadow: 0 0 0 6px rgba(0, 255, 174, .14);
}

.app-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
}

.topbar {
    min-height: var(--topbar-height);
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 26px;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

html[data-theme="dark"] .topbar {
    background: rgba(17, 24, 39, .82);
}

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

.topbar-title {
    color: var(--text);
    font-weight: 900;
    font-size: 1.08rem;
}

.topbar-subtitle {
    color: var(--muted);
    font-size: .86rem;
    font-weight: 600;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn,
.theme-toggle,
.user-chip {
    height: 44px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.icon-btn {
    width: 44px;
}

.theme-toggle {
    gap: 8px;
    padding: 0 14px;
    font-weight: 800;
}

.user-chip {
    padding: 0 12px 0 6px;
    gap: 10px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    display: grid;
    place-items: center;
}

.user-info strong,
.user-info small {
    display: block;
    line-height: 1.1;
}

.user-info strong {
    color: var(--text);
    font-size: .86rem;
    font-weight: 900;
}

.user-info small {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.logout-btn {
    color: var(--danger);
}

.sidebar-toggle {
    display: none;
}

.content-area {
    padding: 26px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 22px;
}

.page-title {
    color: var(--text);
    font-size: 1.85rem;
    font-weight: 950;
    margin: 0;
    letter-spacing: -.04em;
}

.page-subtitle {
    margin-top: 6px;
    color: var(--muted);
    font-weight: 600;
}

.card,
.kpi-card,
.report-info-card,
.report-section,
.table-card,
.panel-card {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.panel-card {
    overflow: hidden;
}

.panel-header {
    padding: 16px 20px;
    color: #fff;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--primary-700));
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-body {
    padding: 20px;
}

.kpi-card {
    padding: 24px;
    text-align: center;
    border-top: 4px solid var(--primary);
}

.kpi-card span {
    color: var(--muted);
    font-weight: 900;
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.kpi-card h2,
.kpi-card .kpi-number {
    margin: 8px 0;
    color: var(--primary);
    font-size: 2.1rem;
    font-weight: 950;
    letter-spacing: -.05em;
}

.status-badges,
.report-badges {
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 7px !important;
    min-width: 96px;
}

.status-badges.center {
    justify-content: center !important;
}

.badge,
.badge-online,
.badge-offline,
.badge-warning-soft {
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    min-width: 30px;
    height: 24px;
    padding: 0 9px !important;
    border-radius: 8px !important;
    font-size: .74rem !important;
    line-height: 1 !important;
    font-weight: 950 !important;
    color: #fff !important;
    border: none !important;
}

.badge-online,
.bg-success {
    background: var(--success) !important;
}

.badge-offline,
.bg-danger {
    background: var(--danger) !important;
}

.badge-warning-soft {
    background: var(--warning) !important;
}

.table {
    color: var(--text);
    margin-bottom: 0;
}

.table thead th {
    background: linear-gradient(135deg, var(--primary), var(--primary-700)) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 900;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.table tbody td {
    color: var(--text);
    border-color: var(--border);
    vertical-align: middle;
    background: var(--surface);
}

.table tbody tr:hover td {
    background: var(--surface-2);
}

.form-control,
.form-select {
    border-radius: 14px;
    border: 1px solid var(--border);
    min-height: 48px;
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 87, 255, .14);
}

.btn {
    border-radius: 14px;
    font-weight: 900;
    min-height: 42px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-700));
    border: none;
    box-shadow: 0 12px 22px rgba(0, 87, 255, .22);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: #fff;
}

.report-info-card {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    padding: 18px;
    margin-bottom: 18px;
    border-top: 4px solid var(--success);
}

.report-info-item span {
    display: block;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.report-info-item strong {
    display: inline-flex;
    background: rgba(236, 72, 153, .10);
    color: #e6007e;
    padding: 5px 9px;
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 900;
}

.report-section {
    overflow: hidden;
    border-top: 4px solid var(--success);
}

.report-section-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-700));
    color: #fff;
    padding: 16px 20px;
    font-weight: 950;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.report-accordion {
    overflow: hidden;
}

.report-accordion-item {
    background: var(--surface);
    border-left: none;
    border-right: none;
    border-color: var(--border);
    border-radius: 0 !important;
    box-shadow: none;
}

.report-umi-button {
    display: grid !important;
    grid-template-columns: minmax(300px, 1fr) 140px 34px;
    gap: 16px;
    align-items: center !important;
    min-height: 58px;
    padding: 14px 18px;
    background: var(--surface) !important;
    color: var(--text) !important;
}

.report-umi-button::after {
    margin-left: 0 !important;
    justify-self: end;
}

.umi-title-area {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.umi-title-area strong {
    color: var(--primary);
    white-space: nowrap;
    font-weight: 950;
}

.umi-title-area span {
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.report-accordion-body {
    background: var(--surface-2);
    color: var(--text);
}

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

.umi-detail-grid div {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
}

.umi-detail-grid span {
    display: block;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 900;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.report-camera-table {
    background: var(--surface);
    color: var(--text);
    border-radius: 14px;
    overflow: hidden;
}

code {
    color: var(--primary);
    background: rgba(0, 87, 255, .08);
    padding: 3px 7px;
    border-radius: 7px;
}

/* ============================
   MODO ESCURO
   ============================ */

html[data-theme="dark"] body,
body.dark-mode {
    background:
        radial-gradient(circle at top left, rgba(0, 87, 255, .16), transparent 28rem),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, .10), transparent 30rem),
        var(--bg) !important;
    color: var(--text) !important;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .report-info-card,
html[data-theme="dark"] .report-section,
html[data-theme="dark"] .table-card,
html[data-theme="dark"] .panel-card,
html[data-theme="dark"] .accordion-item,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

html[data-theme="dark"] .table tbody td {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

html[data-theme="dark"] .table tbody tr:hover td {
    background: var(--surface-2) !important;
}

html[data-theme="dark"] .report-umi-button,
html[data-theme="dark"] .accordion-button {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

html[data-theme="dark"] .accordion-button:not(.collapsed) {
    background: #1d2940 !important;
}

html[data-theme="dark"] .accordion-button::after {
    filter: invert(1);
}

html[data-theme="dark"] .report-accordion-body {
    background: var(--bg-soft) !important;
}

html[data-theme="dark"] .umi-detail-grid div {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
    background: #0f172a !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

html[data-theme="dark"] .form-control::placeholder {
    color: #94a3b8;
}

html[data-theme="dark"] .report-info-item strong {
    background: rgba(236, 72, 153, .16);
    color: #f9a8d4;
}

html[data-theme="dark"] code {
    background: #0b1220;
    color: #93c5fd;
}

html[data-theme="dark"] .text-muted {
    color: var(--muted) !important;
}

/* Compatibilidade com tabelas antigas */
td:nth-child(4),
th:nth-child(4),
td:nth-child(5),
th:nth-child(5) {
    text-align: center;
}

td:last-child {
    text-align: center;
    white-space: nowrap;
}

/* ============================
   RESPONSIVO
   ============================ */

.mobile-overlay {
    display: none;
}

@media (max-width: 992px) {
    .app-sidebar {
        transform: translateX(-105%);
        transition: .22s ease;
    }

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

    .app-main {
        margin-left: 0;
        width: 100%;
    }

    .sidebar-toggle {
        display: inline-flex;
    }

    .mobile-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .55);
        z-index: 1035;
        opacity: 0;
        pointer-events: none;
        transition: .22s ease;
    }

    .mobile-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }

    .report-info-card {
        grid-template-columns: 1fr;
    }

    .report-umi-button {
        grid-template-columns: 1fr 110px 28px;
    }

    .umi-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .content-area {
        padding: 18px;
    }

    .topbar {
        padding: 12px 16px;
    }

    .topbar-subtitle,
    .user-info {
        display: none;
    }

    .page-header {
        flex-direction: column;
    }

    .report-umi-button {
        grid-template-columns: 1fr;
        gap: 8px;
        position: relative;
    }

    .report-umi-button::after {
        position: absolute;
        right: 18px;
    }

    .status-badges,
    .report-badges {
        justify-content: flex-start !important;
    }

    .umi-title-area {
        flex-wrap: wrap;
    }

    .umi-title-area span {
        white-space: normal;
    }
}

/* ============================
   BLOCO 2 - DASHBOARD / ANALISE
   ============================ */

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

.kpi-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    margin: 0 auto 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 12px 22px rgba(0, 87, 255, .18);
}

.kpi-blue {
    border-top-color: var(--primary);
}

.kpi-cyan {
    border-top-color: var(--secondary);
}

.kpi-warning {
    border-top-color: var(--warning);
}

.kpi-green {
    border-top-color: var(--success);
}

.kpi-warning .kpi-icon {
    background: linear-gradient(135deg, #ff8c00, #ffb703);
}

.kpi-green .kpi-icon {
    background: linear-gradient(135deg, #00b884, #00d4a0);
}

.table-title {
    display: block;
    color: var(--primary);
    font-weight: 950;
}

.table-subtitle {
    display: block;
    color: var(--muted);
    margin-top: 2px;
    font-weight: 600;
}

.dashboard-table td {
    padding: 14px 16px;
}

.mini-progress {
    width: 110px;
    height: 8px;
    background: rgba(100, 116, 139, .18);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 4px;
}

.mini-progress div {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--success), #00d4a0);
}

.empty-state {
    min-height: 240px;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 32px;
    color: var(--muted);
}

.empty-state.small {
    min-height: 180px;
}

.empty-state i {
    font-size: 2.4rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.empty-state strong {
    display: block;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 950;
}

.empty-state span {
    display: block;
    margin-top: 4px;
    font-weight: 600;
}

.os-list {
    display: grid;
}

.os-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    transition: .18s ease;
}

.os-item:hover {
    background: var(--surface-2);
}

.os-main strong {
    display: block;
    color: var(--primary);
    font-weight: 950;
}

.os-main span {
    display: block;
    color: var(--muted);
    margin-top: 2px;
    font-weight: 600;
}

.os-meta {
    display: grid;
    justify-items: end;
    align-content: center;
    gap: 5px;
}

.os-meta small {
    color: var(--muted);
    font-weight: 700;
}

.quick-actions {
    display: grid;
    gap: 12px;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    border-radius: 18px;
    transition: .18s ease;
}

.quick-action:hover {
    transform: translateY(-1px);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.quick-action i {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    display: grid;
    place-items: center;
}

.quick-action strong {
    display: block;
    font-weight: 950;
}

.quick-action span {
    color: var(--muted);
    font-size: .86rem;
    font-weight: 600;
}

.analysis-status-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 12px 16px;
    box-shadow: var(--shadow-sm);
}

.analysis-status-card strong {
    display: block;
    color: var(--text);
    font-weight: 950;
}

.analysis-status-card small {
    color: var(--muted);
    font-weight: 700;
}

.analysis-form {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 14px;
    align-items: end;
}

.analysis-select-area label {
    color: var(--text-soft);
    font-weight: 950;
    margin-bottom: 8px;
}

.analysis-button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.loading-panel {
    margin-top: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow-md);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.loading-panel strong {
    color: var(--text);
    font-weight: 950;
}

.loading-panel p {
    margin: 4px 0 0;
    color: var(--muted);
    font-weight: 600;
}

.scanner-animation {
    width: 58px;
    height: 58px;
    border-radius: 999px;
    background: rgba(0, 87, 255, .10);
    display: grid;
    place-items: center;
}

.scanner-animation span {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 4px solid rgba(0, 87, 255, .18);
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

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

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 26px 0 18px;
    padding: 20px;
    background: linear-gradient(135deg, var(--success), #00a372);
    color: #fff;
    border-radius: 22px;
    box-shadow: var(--shadow-md);
}

.result-header h2 {
    margin: 0;
    font-weight: 950;
    letter-spacing: -.04em;
}

.result-header p {
    margin: 4px 0 0;
    color: rgba(255,255,255,.78);
    font-weight: 700;
}

.result-actions {
    display: flex;
    gap: 10px;
}

.result-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.analysis-table td {
    padding: 14px 16px;
}

.row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

html[data-theme="dark"] .quick-action {
    background: var(--surface-2);
}

html[data-theme="dark"] .os-item:hover {
    background: var(--surface-2);
}

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

@media (max-width: 768px) {
    .dashboard-grid,
    .result-kpis {
        grid-template-columns: 1fr;
    }

    .analysis-form {
        grid-template-columns: 1fr;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .analysis-status-card {
        width: 100%;
    }
}

/* ============================
   BLOCO 2 - DASHBOARD / ANALISE
   ============================ */

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

.kpi-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    margin: 0 auto 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 12px 22px rgba(0, 87, 255, .18);
}

.kpi-blue {
    border-top-color: var(--primary);
}

.kpi-cyan {
    border-top-color: var(--secondary);
}

.kpi-warning {
    border-top-color: var(--warning);
}

.kpi-green {
    border-top-color: var(--success);
}

.kpi-warning .kpi-icon {
    background: linear-gradient(135deg, #ff8c00, #ffb703);
}

.kpi-green .kpi-icon {
    background: linear-gradient(135deg, #00b884, #00d4a0);
}

.table-title {
    display: block;
    color: var(--primary);
    font-weight: 950;
}

.table-subtitle {
    display: block;
    color: var(--muted);
    margin-top: 2px;
    font-weight: 600;
}

.dashboard-table td {
    padding: 14px 16px;
}

.mini-progress {
    width: 110px;
    height: 8px;
    background: rgba(100, 116, 139, .18);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 4px;
}

.mini-progress div {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--success), #00d4a0);
}

.empty-state {
    min-height: 240px;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 32px;
    color: var(--muted);
}

.empty-state.small {
    min-height: 180px;
}

.empty-state i {
    font-size: 2.4rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.empty-state strong {
    display: block;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 950;
}

.empty-state span {
    display: block;
    margin-top: 4px;
    font-weight: 600;
}

.os-list {
    display: grid;
}

.os-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    transition: .18s ease;
}

.os-item:hover {
    background: var(--surface-2);
}

.os-main strong {
    display: block;
    color: var(--primary);
    font-weight: 950;
}

.os-main span {
    display: block;
    color: var(--muted);
    margin-top: 2px;
    font-weight: 600;
}

.os-meta {
    display: grid;
    justify-items: end;
    align-content: center;
    gap: 5px;
}

.os-meta small {
    color: var(--muted);
    font-weight: 700;
}

.quick-actions {
    display: grid;
    gap: 12px;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    border-radius: 18px;
    transition: .18s ease;
}

.quick-action:hover {
    transform: translateY(-1px);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.quick-action i {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    display: grid;
    place-items: center;
}

.quick-action strong {
    display: block;
    font-weight: 950;
}

.quick-action span {
    color: var(--muted);
    font-size: .86rem;
    font-weight: 600;
}

.analysis-status-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 12px 16px;
    box-shadow: var(--shadow-sm);
}

.analysis-status-card strong {
    display: block;
    color: var(--text);
    font-weight: 950;
}

.analysis-status-card small {
    color: var(--muted);
    font-weight: 700;
}

.analysis-form {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 14px;
    align-items: end;
}

.analysis-select-area label {
    color: var(--text-soft);
    font-weight: 950;
    margin-bottom: 8px;
}

.analysis-button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.loading-panel {
    margin-top: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow-md);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.loading-panel strong {
    color: var(--text);
    font-weight: 950;
}

.loading-panel p {
    margin: 4px 0 0;
    color: var(--muted);
    font-weight: 600;
}

.scanner-animation {
    width: 58px;
    height: 58px;
    border-radius: 999px;
    background: rgba(0, 87, 255, .10);
    display: grid;
    place-items: center;
}

.scanner-animation span {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 4px solid rgba(0, 87, 255, .18);
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

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

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 26px 0 18px;
    padding: 20px;
    background: linear-gradient(135deg, var(--success), #00a372);
    color: #fff;
    border-radius: 22px;
    box-shadow: var(--shadow-md);
}

.result-header h2 {
    margin: 0;
    font-weight: 950;
    letter-spacing: -.04em;
}

.result-header p {
    margin: 4px 0 0;
    color: rgba(255,255,255,.78);
    font-weight: 700;
}

.result-actions {
    display: flex;
    gap: 10px;
}

.result-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.analysis-table td {
    padding: 14px 16px;
}

.row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

html[data-theme="dark"] .quick-action {
    background: var(--surface-2);
}

html[data-theme="dark"] .os-item:hover {
    background: var(--surface-2);
}

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

@media (max-width: 768px) {
    .dashboard-grid,
    .result-kpis {
        grid-template-columns: 1fr;
    }

    .analysis-form {
        grid-template-columns: 1fr;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .analysis-status-card {
        width: 100%;
    }
}

/* ============================
   BLOCO 3 - RELATORIOS / OS
   ============================ */

.report-filter-grid,
.os-filter-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr auto;
    gap: 14px;
    align-items: end;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.report-list-table td {
    padding: 15px 16px;
}

.status-text-online {
    color: var(--success) !important;
    font-weight: 950;
}

.status-text-offline {
    color: var(--danger) !important;
    font-weight: 950;
}

.os-kanban-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.os-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: .18s ease;
}

.os-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.os-card-header {
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.os-card-header strong {
    display: block;
    color: var(--primary);
    font-weight: 950;
    font-size: 1.05rem;
}

.os-card-header span {
    display: block;
    color: var(--muted);
    font-weight: 700;
    margin-top: 2px;
}

.os-card-body {
    padding: 18px;
}

.os-location {
    display: flex;
    gap: 8px;
    color: var(--text-soft);
    font-weight: 800;
    margin-bottom: 12px;
}

.os-location i {
    color: var(--primary);
    margin-top: 3px;
}

.os-card-body p {
    color: var(--muted);
    font-weight: 600;
    min-height: 46px;
    margin-bottom: 16px;
}

.os-counters {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.os-counters div {
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.os-counters small {
    color: var(--muted);
    font-weight: 800;
}

.os-card-footer {
    padding: 14px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.os-detail-stack {
    display: grid;
    gap: 12px;
}

.os-detail-item {
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 16px;
    padding: 14px;
}

.os-detail-item span,
.os-detail-grid span {
    display: block;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 950;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.os-detail-item strong {
    color: var(--text);
    font-weight: 950;
}

.os-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.os-detail-grid div {
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 16px;
    padding: 14px;
    text-align: center;
}

.os-detail-grid strong {
    font-size: 1.8rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.hint-list {
    display: grid;
    gap: 12px;
}

.hint-list div {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
}

.hint-list i {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--success-soft);
    color: var(--success);
    flex-shrink: 0;
}

.hint-list span {
    color: var(--text-soft);
    font-weight: 700;
}

html[data-theme="dark"] .os-card,
html[data-theme="dark"] .os-detail-item,
html[data-theme="dark"] .os-detail-grid div,
html[data-theme="dark"] .hint-list div,
html[data-theme="dark"] .os-counters div {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

html[data-theme="dark"] .os-card-header,
html[data-theme="dark"] .os-card-footer {
    background: var(--surface-2) !important;
    border-color: var(--border) !important;
}

@media (max-width: 1100px) {
    .report-filter-grid,
    .os-filter-grid {
        grid-template-columns: 1fr 1fr;
    }

    .filter-actions {
        grid-column: 1 / -1;
    }

    .os-kanban-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .report-filter-grid,
    .os-filter-grid {
        grid-template-columns: 1fr;
    }

    .filter-actions,
    .form-actions,
    .os-card-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .os-detail-grid,
    .os-counters {
        grid-template-columns: 1fr;
    }
}

/* ============================
   BLOCO 3 - RELATORIOS / OS
   ============================ */

.report-filter-grid,
.os-filter-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr auto;
    gap: 14px;
    align-items: end;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.report-list-table td {
    padding: 15px 16px;
}

.status-text-online {
    color: var(--success) !important;
    font-weight: 950;
}

.status-text-offline {
    color: var(--danger) !important;
    font-weight: 950;
}

.os-kanban-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.os-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: .18s ease;
}

.os-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.os-card-header {
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.os-card-header strong {
    display: block;
    color: var(--primary);
    font-weight: 950;
    font-size: 1.05rem;
}

.os-card-header span {
    display: block;
    color: var(--muted);
    font-weight: 700;
    margin-top: 2px;
}

.os-card-body {
    padding: 18px;
}

.os-location {
    display: flex;
    gap: 8px;
    color: var(--text-soft);
    font-weight: 800;
    margin-bottom: 12px;
}

.os-location i {
    color: var(--primary);
    margin-top: 3px;
}

.os-card-body p {
    color: var(--muted);
    font-weight: 600;
    min-height: 46px;
    margin-bottom: 16px;
}

.os-counters {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.os-counters div {
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.os-counters small {
    color: var(--muted);
    font-weight: 800;
}

.os-card-footer {
    padding: 14px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.os-detail-stack {
    display: grid;
    gap: 12px;
}

.os-detail-item {
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 16px;
    padding: 14px;
}

.os-detail-item span,
.os-detail-grid span {
    display: block;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 950;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.os-detail-item strong {
    color: var(--text);
    font-weight: 950;
}

.os-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.os-detail-grid div {
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 16px;
    padding: 14px;
    text-align: center;
}

.os-detail-grid strong {
    font-size: 1.8rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.hint-list {
    display: grid;
    gap: 12px;
}

.hint-list div {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
}

.hint-list i {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--success-soft);
    color: var(--success);
    flex-shrink: 0;
}

.hint-list span {
    color: var(--text-soft);
    font-weight: 700;
}

html[data-theme="dark"] .os-card,
html[data-theme="dark"] .os-detail-item,
html[data-theme="dark"] .os-detail-grid div,
html[data-theme="dark"] .hint-list div,
html[data-theme="dark"] .os-counters div {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

html[data-theme="dark"] .os-card-header,
html[data-theme="dark"] .os-card-footer {
    background: var(--surface-2) !important;
    border-color: var(--border) !important;
}

@media (max-width: 1100px) {
    .report-filter-grid,
    .os-filter-grid {
        grid-template-columns: 1fr 1fr;
    }

    .filter-actions {
        grid-column: 1 / -1;
    }

    .os-kanban-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .report-filter-grid,
    .os-filter-grid {
        grid-template-columns: 1fr;
    }

    .filter-actions,
    .form-actions,
    .os-card-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .os-detail-grid,
    .os-counters {
        grid-template-columns: 1fr;
    }
}
CSScat >> /root/totem-teste/static/css/dantech-design.css <<'CSS'

/* ============================
   BLOCO 3 - RELATORIOS / OS
   ============================ */

.report-filter-grid,
.os-filter-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr auto;
    gap: 14px;
    align-items: end;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.report-list-table td {
    padding: 15px 16px;
}

.status-text-online {
    color: var(--success) !important;
    font-weight: 950;
}

.status-text-offline {
    color: var(--danger) !important;
    font-weight: 950;
}

.os-kanban-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.os-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: .18s ease;
}

.os-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.os-card-header {
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.os-card-header strong {
    display: block;
    color: var(--primary);
    font-weight: 950;
    font-size: 1.05rem;
}

.os-card-header span {
    display: block;
    color: var(--muted);
    font-weight: 700;
    margin-top: 2px;
}

.os-card-body {
    padding: 18px;
}

.os-location {
    display: flex;
    gap: 8px;
    color: var(--text-soft);
    font-weight: 800;
    margin-bottom: 12px;
}

.os-location i {
    color: var(--primary);
    margin-top: 3px;
}

.os-card-body p {
    color: var(--muted);
    font-weight: 600;
    min-height: 46px;
    margin-bottom: 16px;
}

.os-counters {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.os-counters div {
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.os-counters small {
    color: var(--muted);
    font-weight: 800;
}

.os-card-footer {
    padding: 14px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.os-detail-stack {
    display: grid;
    gap: 12px;
}

.os-detail-item {
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 16px;
    padding: 14px;
}

.os-detail-item span,
.os-detail-grid span {
    display: block;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 950;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.os-detail-item strong {
    color: var(--text);
    font-weight: 950;
}

.os-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.os-detail-grid div {
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 16px;
    padding: 14px;
    text-align: center;
}

.os-detail-grid strong {
    font-size: 1.8rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.hint-list {
    display: grid;
    gap: 12px;
}

.hint-list div {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
}

.hint-list i {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--success-soft);
    color: var(--success);
    flex-shrink: 0;
}

.hint-list span {
    color: var(--text-soft);
    font-weight: 700;
}

html[data-theme="dark"] .os-card,
html[data-theme="dark"] .os-detail-item,
html[data-theme="dark"] .os-detail-grid div,
html[data-theme="dark"] .hint-list div,
html[data-theme="dark"] .os-counters div {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

html[data-theme="dark"] .os-card-header,
html[data-theme="dark"] .os-card-footer {
    background: var(--surface-2) !important;
    border-color: var(--border) !important;
}

@media (max-width: 1100px) {
    .report-filter-grid,
    .os-filter-grid {
        grid-template-columns: 1fr 1fr;
    }

    .filter-actions {
        grid-column: 1 / -1;
    }

    .os-kanban-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .report-filter-grid,
    .os-filter-grid {
        grid-template-columns: 1fr;
    }

    .filter-actions,
    .form-actions,
    .os-card-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .os-detail-grid,
    .os-counters {
        grid-template-columns: 1fr;
    }
}

/* ============================
   BLOCO 3 - RELATORIOS / OS
   ============================ */

.report-filter-grid,
.os-filter-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr auto;
    gap: 14px;
    align-items: end;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.report-list-table td {
    padding: 15px 16px;
}

.status-text-online {
    color: var(--success) !important;
    font-weight: 950;
}

.status-text-offline {
    color: var(--danger) !important;
    font-weight: 950;
}

.os-kanban-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.os-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: .18s ease;
}

.os-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.os-card-header {
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.os-card-header strong {
    display: block;
    color: var(--primary);
    font-weight: 950;
    font-size: 1.05rem;
}

.os-card-header span {
    display: block;
    color: var(--muted);
    font-weight: 700;
    margin-top: 2px;
}

.os-card-body {
    padding: 18px;
}

.os-location {
    display: flex;
    gap: 8px;
    color: var(--text-soft);
    font-weight: 800;
    margin-bottom: 12px;
}

.os-location i {
    color: var(--primary);
    margin-top: 3px;
}

.os-card-body p {
    color: var(--muted);
    font-weight: 600;
    min-height: 46px;
    margin-bottom: 16px;
}

.os-counters {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.os-counters div {
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.os-counters small {
    color: var(--muted);
    font-weight: 800;
}

.os-card-footer {
    padding: 14px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.os-detail-stack {
    display: grid;
    gap: 12px;
}

.os-detail-item {
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 16px;
    padding: 14px;
}

.os-detail-item span,
.os-detail-grid span {
    display: block;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 950;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.os-detail-item strong {
    color: var(--text);
    font-weight: 950;
}

.os-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.os-detail-grid div {
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 16px;
    padding: 14px;
    text-align: center;
}

.os-detail-grid strong {
    font-size: 1.8rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.hint-list {
    display: grid;
    gap: 12px;
}

.hint-list div {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
}

.hint-list i {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--success-soft);
    color: var(--success);
    flex-shrink: 0;
}

.hint-list span {
    color: var(--text-soft);
    font-weight: 700;
}

html[data-theme="dark"] .os-card,
html[data-theme="dark"] .os-detail-item,
html[data-theme="dark"] .os-detail-grid div,
html[data-theme="dark"] .hint-list div,
html[data-theme="dark"] .os-counters div {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

html[data-theme="dark"] .os-card-header,
html[data-theme="dark"] .os-card-footer {
    background: var(--surface-2) !important;
    border-color: var(--border) !important;
}

@media (max-width: 1100px) {
    .report-filter-grid,
    .os-filter-grid {
        grid-template-columns: 1fr 1fr;
    }

    .filter-actions {
        grid-column: 1 / -1;
    }

    .os-kanban-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .report-filter-grid,
    .os-filter-grid {
        grid-template-columns: 1fr;
    }

    .filter-actions,
    .form-actions,
    .os-card-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .os-detail-grid,
    .os-counters {
        grid-template-columns: 1fr;
    }
}

/* ============================
   BLOCO 4 - ADMIN
   ============================ */

.admin-kpis {
    margin-bottom: 22px;
}

.admin-action-grid {
    display: grid;
    gap: 14px;
}

.admin-action-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 18px;
    color: var(--text);
    transition: .18s ease;
}

.admin-action-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.admin-action-card i {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.admin-action-card strong {
    display: block;
    color: var(--text);
    font-weight: 950;
}

.admin-action-card span {
    display: block;
    color: var(--muted);
    font-weight: 600;
    margin-top: 3px;
}

.admin-action-card.danger i {
    background: linear-gradient(135deg, var(--danger), #b00020);
}

.admin-action-card.danger:hover {
    border-color: var(--danger);
}

.admin-stat-list {
    display: grid;
    gap: 14px;
}

.admin-stat-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
}

.admin-stat-list span {
    color: var(--muted);
    font-weight: 800;
}

.admin-stat-list strong {
    color: var(--primary);
    font-size: 2rem;
    font-weight: 950;
}

.admin-users-table td {
    padding: 15px 16px;
}

.badge-role-admin {
    background: linear-gradient(135deg, #7c3aed, #4c1d95) !important;
}

.badge-role-noc {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
}

.badge-role-tech {
    background: linear-gradient(135deg, #64748b, #334155) !important;
}

.role-info-list {
    display: grid;
    gap: 14px;
}

.role-info {
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 18px;
    padding: 16px;
    border-left: 5px solid var(--primary);
}

.role-info.admin {
    border-left-color: #7c3aed;
}

.role-info.noc {
    border-left-color: var(--primary);
}

.role-info.tecnico {
    border-left-color: #64748b;
}

.role-info strong {
    display: block;
    color: var(--text);
    font-weight: 950;
}

.role-info span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-weight: 600;
}

.admin-alert {
    border-radius: 16px;
    border: none;
    font-weight: 800;
}

.admin-switch {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px 16px 16px 54px;
}

.admin-switch .form-check-input {
    width: 3rem;
    height: 1.5rem;
    margin-left: -42px;
}

.admin-switch label {
    font-weight: 900;
    color: var(--text);
}

.danger-panel {
    border-color: rgba(239, 35, 60, .35);
}

.danger-header {
    background: linear-gradient(135deg, var(--danger), #b00020) !important;
}

.danger-warning-box {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--danger-soft);
    border: 1px solid rgba(239, 35, 60, .20);
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 12px;
}

.danger-warning-box i {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--danger);
    color: #fff;
    flex-shrink: 0;
}

.danger-warning-box strong {
    display: block;
    color: var(--danger);
    font-weight: 950;
}

.danger-warning-box span {
    display: block;
    color: var(--text-soft);
    font-weight: 700;
    margin-top: 3px;
}

.error-shell {
    min-height: calc(100vh - var(--topbar-height) - 52px);
    display: grid;
    place-items: center;
}

.error-card {
    width: min(620px, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    padding: 42px;
    text-align: center;
}

.error-icon {
    width: 78px;
    height: 78px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 2rem;
}

.error-card h1 {
    color: var(--text);
    font-weight: 950;
    letter-spacing: -.04em;
}

.error-card p {
    color: var(--muted);
    font-weight: 700;
    margin: 10px 0 24px;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

html[data-theme="dark"] .admin-action-card,
html[data-theme="dark"] .admin-stat-list div,
html[data-theme="dark"] .role-info,
html[data-theme="dark"] .admin-switch {
    background: var(--surface-2) !important;
    border-color: var(--border) !important;
}

html[data-theme="dark"] .danger-warning-box {
    background: rgba(239, 35, 60, .12) !important;
}

@media (max-width: 768px) {
    .admin-action-card {
        align-items: flex-start;
    }

    .error-card {
        padding: 28px;
    }

    .error-actions {
        flex-direction: column;
    }
}

/* =========================================================
   DARK MODE PRO - DANTECH TOTEM NOC
   Ajuste global de contraste, profundidade e legibilidade
   ========================================================= */

html[data-theme="dark"] {
    color-scheme: dark;

    --primary: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --secondary: #38bdf8;

    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, .15);

    --danger: #f43f5e;
    --danger-soft: rgba(244, 63, 94, .15);

    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, .15);

    --bg: #07111f;
    --bg-soft: #0b1628;
    --surface: #101b2d;
    --surface-2: #142238;
    --surface-3: #1b2c46;

    --text: #f8fafc;
    --text-soft: #dbeafe;
    --muted: #a8b4c7;
    --border: #263955;

    --shadow-sm: 0 6px 18px rgba(0, 0, 0, .35);
    --shadow-md: 0 18px 46px rgba(0, 0, 0, .42);
    --shadow-lg: 0 26px 80px rgba(0, 0, 0, .55);
}

html[data-theme="dark"] body,
body.dark-mode {
    background:
        radial-gradient(circle at 12% 8%, rgba(59, 130, 246, .18), transparent 28rem),
        radial-gradient(circle at 90% 90%, rgba(34, 197, 94, .10), transparent 30rem),
        linear-gradient(135deg, #07111f 0%, #0b1628 48%, #07111f 100%) !important;
    color: var(--text) !important;
}

/* Sidebar mais premium no escuro */
html[data-theme="dark"] .app-sidebar {
    background:
        radial-gradient(circle at top left, rgba(96, 165, 250, .18), transparent 18rem),
        linear-gradient(180deg, #0f2f6f 0%, #081a3a 100%) !important;
    box-shadow: 14px 0 44px rgba(0, 0, 0, .55);
}

html[data-theme="dark"] .sidebar-link {
    color: rgba(255,255,255,.78);
}

html[data-theme="dark"] .sidebar-link:hover {
    background: rgba(255,255,255,.10);
    color: #fff;
}

html[data-theme="dark"] .sidebar-link.active {
    background: rgba(255,255,255,.96);
    color: #0f2f6f !important;
}

/* Topbar */
html[data-theme="dark"] .topbar {
    background: rgba(10, 18, 32, .86) !important;
    border-bottom-color: var(--border) !important;
    backdrop-filter: blur(18px);
}

html[data-theme="dark"] .topbar-title,
html[data-theme="dark"] .page-title,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6 {
    color: var(--text) !important;
}

html[data-theme="dark"] .topbar-subtitle,
html[data-theme="dark"] .page-subtitle,
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] small,
html[data-theme="dark"] .table-subtitle {
    color: var(--muted) !important;
}

/* Superfícies */
html[data-theme="dark"] .card,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .panel-card,
html[data-theme="dark"] .report-info-card,
html[data-theme="dark"] .report-section,
html[data-theme="dark"] .table-card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .user-chip,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .icon-btn {
    background: linear-gradient(180deg, var(--surface) 0%, #0e1829 100%) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
    box-shadow: var(--shadow-md);
}

html[data-theme="dark"] .panel-body {
    background: transparent !important;
    color: var(--text) !important;
}

html[data-theme="dark"] .panel-header,
html[data-theme="dark"] .report-section-header,
html[data-theme="dark"] .table thead th {
    background: linear-gradient(135deg, #2563eb 0%, #1e3a8a 100%) !important;
    color: #ffffff !important;
}

/* Cards KPI */
html[data-theme="dark"] .kpi-card {
    border-top-color: rgba(96, 165, 250, .95);
}

html[data-theme="dark"] .kpi-card h2,
html[data-theme="dark"] .kpi-card .kpi-number,
html[data-theme="dark"] .table-title {
    color: #60a5fa !important;
}

html[data-theme="dark"] .kpi-card span {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .kpi-card small {
    color: var(--muted) !important;
}

/* Tabelas */
html[data-theme="dark"] .table,
html[data-theme="dark"] .report-camera-table {
    background: var(--surface) !important;
    color: var(--text) !important;
}

html[data-theme="dark"] .table tbody tr {
    background: var(--surface) !important;
}

html[data-theme="dark"] .table tbody td,
html[data-theme="dark"] .report-camera-table td {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

html[data-theme="dark"] .table tbody tr:hover td,
html[data-theme="dark"] .report-camera-table tbody tr:hover td {
    background: var(--surface-2) !important;
}

html[data-theme="dark"] .table code,
html[data-theme="dark"] code {
    background: rgba(59, 130, 246, .13) !important;
    color: #93c5fd !important;
    border: 1px solid rgba(147, 197, 253, .16);
}

/* Forms */
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] textarea.form-control {
    background: #0b1628 !important;
    color: var(--text) !important;
    border-color: #314463 !important;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus,
html[data-theme="dark"] textarea.form-control:focus {
    background: #0d1b30 !important;
    color: #fff !important;
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, .18) !important;
}

html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] textarea.form-control::placeholder {
    color: #74839a !important;
}

html[data-theme="dark"] .form-label,
html[data-theme="dark"] label {
    color: #dbeafe !important;
}

/* Select option no dark */
html[data-theme="dark"] select option {
    background: #0b1628;
    color: #f8fafc;
}

/* Accordions / Relatórios */
html[data-theme="dark"] .accordion-item,
html[data-theme="dark"] .report-accordion-item {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

html[data-theme="dark"] .accordion-button,
html[data-theme="dark"] .report-umi-button {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

html[data-theme="dark"] .accordion-button:not(.collapsed),
html[data-theme="dark"] .report-umi-button:not(.collapsed) {
    background: var(--surface-3) !important;
    color: #fff !important;
}

html[data-theme="dark"] .accordion-button::after {
    filter: invert(1) brightness(1.4);
}

html[data-theme="dark"] .report-accordion-body,
html[data-theme="dark"] .accordion-body {
    background: #0b1628 !important;
    color: var(--text) !important;
}

html[data-theme="dark"] .umi-detail-grid div,
html[data-theme="dark"] .os-detail-item,
html[data-theme="dark"] .os-detail-grid div,
html[data-theme="dark"] .hint-list div,
html[data-theme="dark"] .os-counters div,
html[data-theme="dark"] .quick-action,
html[data-theme="dark"] .admin-action-card,
html[data-theme="dark"] .role-info,
html[data-theme="dark"] .admin-stat-list div {
    background: var(--surface-2) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

html[data-theme="dark"] .umi-detail-grid span,
html[data-theme="dark"] .os-detail-item span,
html[data-theme="dark"] .os-detail-grid span,
html[data-theme="dark"] .report-info-item span {
    color: var(--muted) !important;
}

/* Textos específicos */
html[data-theme="dark"] .umi-title-area strong,
html[data-theme="dark"] .os-card-header strong,
html[data-theme="dark"] .quick-action strong,
html[data-theme="dark"] .admin-action-card strong,
html[data-theme="dark"] .role-info strong,
html[data-theme="dark"] .os-detail-item strong {
    color: #93c5fd !important;
}

html[data-theme="dark"] .umi-title-area span,
html[data-theme="dark"] .os-card-body p,
html[data-theme="dark"] .quick-action span,
html[data-theme="dark"] .admin-action-card span,
html[data-theme="dark"] .role-info span,
html[data-theme="dark"] .hint-list span {
    color: var(--muted) !important;
}

/* O.S. Cards */
html[data-theme="dark"] .os-card {
    background: linear-gradient(180deg, var(--surface) 0%, #0d1829 100%) !important;
    border-color: var(--border) !important;
    box-shadow: var(--shadow-md);
}

html[data-theme="dark"] .os-card-header,
html[data-theme="dark"] .os-card-footer {
    background: var(--surface-2) !important;
    border-color: var(--border) !important;
}

html[data-theme="dark"] .os-location {
    color: #dbeafe !important;
}

/* Info boxes */
html[data-theme="dark"] .report-info-item strong {
    background: rgba(96, 165, 250, .15) !important;
    color: #bfdbfe !important;
    border: 1px solid rgba(147, 197, 253, .18);
}

/* Badges mais vivos no escuro */
html[data-theme="dark"] .badge-online,
html[data-theme="dark"] .bg-success {
    background: #16a34a !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, .25);
}

html[data-theme="dark"] .badge-offline,
html[data-theme="dark"] .bg-danger {
    background: #e11d48 !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 1px rgba(244, 63, 94, .25);
}

html[data-theme="dark"] .badge-warning-soft,
html[data-theme="dark"] .bg-warning {
    background: #d97706 !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, .25);
}

/* Alerts */
html[data-theme="dark"] .alert-danger,
html[data-theme="dark"] .admin-alert.alert-danger {
    background: rgba(244, 63, 94, .14) !important;
    color: #fecdd3 !important;
    border: 1px solid rgba(244, 63, 94, .22) !important;
}

html[data-theme="dark"] .alert-success,
html[data-theme="dark"] .admin-alert.alert-success {
    background: rgba(34, 197, 94, .14) !important;
    color: #bbf7d0 !important;
    border: 1px solid rgba(34, 197, 94, .22) !important;
}

/* Modais */
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
    border-color: var(--border) !important;
}

html[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Botões */
html[data-theme="dark"] .btn-outline-primary {
    color: #93c5fd !important;
    border-color: #3b82f6 !important;
}

html[data-theme="dark"] .btn-outline-primary:hover {
    color: #ffffff !important;
    background: #2563eb !important;
    border-color: #2563eb !important;
}

html[data-theme="dark"] .btn-outline-danger {
    color: #fda4af !important;
    border-color: #f43f5e !important;
}

html[data-theme="dark"] .btn-outline-danger:hover {
    color: #ffffff !important;
    background: #e11d48 !important;
}

/* Login também no escuro */
html[data-theme="dark"] .login-panel {
    background: var(--surface) !important;
    color: var(--text) !important;
}

html[data-theme="dark"] .login-panel h2 {
    color: var(--text) !important;
}

html[data-theme="dark"] .login-panel p,
html[data-theme="dark"] .login-meta {
    color: var(--muted) !important;
}

html[data-theme="dark"] .login-shell {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

/* Empty state */
html[data-theme="dark"] .empty-state strong {
    color: var(--text) !important;
}

html[data-theme="dark"] .empty-state span {
    color: var(--muted) !important;
}

/* Danger boxes */
html[data-theme="dark"] .danger-warning-box {
    background: rgba(244, 63, 94, .12) !important;
    border-color: rgba(244, 63, 94, .22) !important;
}

html[data-theme="dark"] .danger-warning-box strong {
    color: #fda4af !important;
}

html[data-theme="dark"] .danger-warning-box span {
    color: var(--muted) !important;
}

/* Scrollbar dark */
html[data-theme="dark"] ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

html[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #07111f;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #263955;
    border-radius: 999px;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #3b82f6;
}

/* Seleção */
html[data-theme="dark"] ::selection {
    background: rgba(96, 165, 250, .35);
    color: #ffffff;
}


/* ============================
   LOGO DANTECH
   ============================ */

.brand-logo-wrap {
    width: 50px;
    height: 50px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.96);
    box-shadow: 0 16px 30px rgba(0,0,0,.18);
    flex-shrink: 0;
}

.brand-logo-icon {
    width: 46px;
    height: 46px;
    display: block;
}

.login-logo-full {
    width: min(280px, 100%);
    height: auto;
    display: block;
    filter: drop-shadow(0 14px 22px rgba(0,0,0,.18));
}

html[data-theme="dark"] .brand-logo-wrap {
    background: rgba(255,255,255,.98);
    box-shadow: 0 18px 34px rgba(0,0,0,.42);
}

html[data-theme="dark"] .login-logo-full {
    filter: drop-shadow(0 18px 30px rgba(0,0,0,.35));
}

@media (max-width: 900px) {
    .login-logo-full {
        width: 230px;
    }
}
.menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 8px;
    color: white;
    text-decoration: none;
    margin-bottom: 6px;
    transition: all 0.2s ease;
}

.menu-item:hover {
    background: rgba(255,255,255,0.1);
}

.menu-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-left i {
    width: 18px;
    text-align: center;
}

.menu-badge {
    background: #ff3b3b;
    color: white;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
}
