/* Reset */

* {
    box-sizing: border-box;
}

:root {
    --color-black: #000000;
    --color-white: #ffffff;
    --color-grey: #9b9da0;
    --color-gold: #c19140;
    --color-dark-2: #111111;
    --color-border: #1a1a1a;
    --app-bg: #f5f6fa;
    --app-surface: #ffffff;
    --app-surface-muted: #f8f9fa;
    --app-text: #212529;
    --app-text-muted: #6c757d;
    --app-border: #dee2e6;
    --app-table-hover: #9b9da0;
}

body {
    margin: 0;
    font-family: system-ui, sans-serif;
    background: var(--app-bg);
    color: var(--app-text);
}

html[data-argus-theme="dark"] {
    --app-bg: #101217;
    --app-surface: #181b22;
    --app-surface-muted: #20242d;
    --app-text: #e6e8ee;
    --app-text-muted: #a5adba;
    --app-border: #343a46;
    --app-table-hover: #2a2f3a;
    --color-black: #05070b;
    --color-dark-2: #151922;
    --color-border: #2b303b;
}

/* Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 240px;
    background: var(--color-black);
    color: var(--color-white);
    display: flex;
    flex-direction: column;
    transition: width 0.3s;
    z-index: 1000;
}

.sidebar.collapsed {
    width: 70px;
}

html.sidebar-collapsed .sidebar {
    width: 70px;
}

/* Sidebar top */
.sidebar-top {
    padding: 15px;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

/* Toggle button */
.toggle-btn {
    background: none;
    border: none;
    color: var(--color-white);
    font-size: 20px;
    cursor: pointer;
}

/* Sidebar menu */
.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding-top: 20px;
}

/* Menu item */
.menu-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    color: var(--color-grey);
    text-decoration: none;
}

.menu-item:hover {
    background: var(--color-dark-2);
    color: var(--color-white);
}

.menu-item.active {
    background: var(--color-dark-2);
    border-left: 4px solid var(--color-gold);
    color: var(--color-white);
}

.menu-item.active i {
    color: var(--color-gold);
}

.menu-text {
    white-space: nowrap;
}

/* Collapse behaviour */
.sidebar.collapsed .menu-text {
    display: none;
}

html.sidebar-collapsed .sidebar .menu-text {
    display: none;
}

/* Sidebar user (bottom) */
.sidebar-user {
    flex-shrink: 0;
    border-top: 1px solid var(--color-border);
    background: #000000;
}

/* User toggle */
.user-toggle {
    width: 100%;
    max-width: 100%;
    background: none;
    border: none;
    color: var(--color-grey);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    overflow: hidden;
}

.user-toggle .menu-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
}

.sidebar.collapsed .user-toggle .menu-text {
    display: none;
}

html.sidebar-collapsed .sidebar .user-toggle .menu-text {
    display: none;
}

.user-toggle:hover {
    background: var(--color-dark-2);
    color: var(--color-white);
}

/* Chevron */
.chevron {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.3s;
}

/* User menu */
.user-menu {
    display: none;
    flex-direction: column;
    background: var(--color-dark-2);
}

.user-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--color-grey);
    text-decoration: none;
    font-size: 14px;
}

.user-menu a:hover {
    background: #1a1a1a;
    color: var(--color-white);
}

.user-menu .logout {
    color: #ffb3b3;
}

/* Open state */
.sidebar-user.open .user-menu {
    display: flex;
}

.sidebar-user.open .chevron {
    transform: rotate(180deg);
}

/* Collapsed sidebar */
.sidebar.collapsed .chevron {
    display: none;
}

html.sidebar-collapsed .sidebar .chevron {
    display: none;
}

.sidebar.collapsed .user-menu a {
    justify-content: center;
}

html.sidebar-collapsed .sidebar .user-menu a {
    justify-content: center;
}

.sidebar-impersonation-email {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Main content */
.main-content {
    margin-left: 240px;
    flex-grow: 1;
    padding: 30px;
    min-height: 100vh;
    transition: margin-left 0.3s;
}

/* Main when collapsed */
.sidebar.collapsed ~ .main-content {
    margin-left: 70px;
}

html.sidebar-collapsed .main-content {
    margin-left: 70px;
}

/* Datatable hover */
table.dataTable tbody tr:hover td {
    background-color: var(--app-table-hover) !important;
}

.table {
    --bs-table-bg: var(--app-surface);
    --bs-table-color: var(--app-text);
    --bs-table-border-color: var(--app-border);
    --bs-table-striped-bg: var(--app-surface-muted);
    --bs-table-striped-color: var(--app-text);
    --bs-table-hover-bg: var(--app-table-hover);
    --bs-table-hover-color: var(--app-text);
}

.modal-content,
.dropdown-menu,
.card {
    background: var(--app-surface);
    border-color: var(--app-border);
    color: var(--app-text);
}

.modal-header,
.modal-footer {
    border-color: var(--app-border);
}

.form-control,
.form-select {
    background-color: var(--app-surface);
    border-color: var(--app-border);
    color: var(--app-text);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--app-surface);
    color: var(--app-text);
}

.form-control::placeholder {
    color: var(--app-text-muted);
}

.text-muted {
    color: var(--app-text-muted) !important;
}

.breadcrumb,
.breadcrumb-item.active,
.dt-info,
.dt-length,
.dt-search,
.dataTables_info,
.dataTables_length,
.dataTables_filter {
    color: var(--app-text-muted);
}

.page-link {
    background-color: var(--app-surface);
    border-color: var(--app-border);
}

div.dt-container div.dt-layout-row {
    align-items: center;
    margin: 0.35rem 0;
}

div.dt-container {
    position: relative;
}

div.dt-container.argus-dt-loading::before {
    background: rgba(255, 255, 255, 0.45);
    content: "";
    inset: 0;
    pointer-events: none;
    position: absolute;
    z-index: 20;
}

html[data-argus-theme="dark"] div.dt-container.argus-dt-loading::before {
    background: rgba(16, 18, 23, 0.58);
}

div.dt-container.argus-dt-loading::after {
    animation: argus-dt-spin 0.7s linear infinite;
    border: 4px solid rgba(193, 145, 64, 0.25);
    border-radius: 50%;
    border-top-color: var(--color-gold);
    content: "";
    height: 42px;
    left: 50%;
    margin: -21px 0 0 -21px;
    pointer-events: none;
    position: absolute;
    top: 50%;
    width: 42px;
    z-index: 21;
}

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

div.dt-container div.dt-buttons {
    gap: 0.25rem;
    margin-left: 0.5rem;
}

div.dt-container div.dt-buttons .btn {
    border-radius: 4px;
    font-size: 0.75rem;
    padding: 0.2rem 0.45rem;
}

div.dt-container div.dt-buttons .buttons-reset-state {
    background: var(--app-surface-muted);
    border-color: var(--app-border);
    color: var(--app-text);
}

div.dt-container div.dt-buttons .buttons-reset-state:hover {
    background: var(--app-table-hover);
    border-color: var(--app-border);
    color: var(--app-text);
}

div.dt-button-collection .dropdown-item {
    font-size: 0.78rem;
    padding: 0.25rem 0.75rem;
}

body.dtcr-dragging {
    cursor: move;
}

.machine-customer-control {
    border-bottom: 1px solid var(--app-border);
    padding-bottom: 0.75rem;
}

/* ultra compact datatable */
.table.table-sm td,
.table.table-sm th {
    padding: 0.2rem 0.35rem;
    font-size: 0.8rem;
    vertical-align: middle;
}

/* zmenšení tlačítek v tabulce */
.table .btn-sm {
    padding: 0.15rem 0.35rem;
    font-size: 0.75rem;
}


/* Disabled link */
.disabled-link {
    color: #adb5bd;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.6;
}

.menu-item i {
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

tr.row-disabled {
    opacity: 0.45;
    background-color: var(--app-surface-muted) !important;
}

tr.row-disabled td {
    text-decoration: line-through;
}

tr.row-disabled input[type="checkbox"] {
    cursor: not-allowed;
}

.sidebar-footer {
    padding: 10px 15px;
    font-size: 10px;
    color: #8f94c1;
    border-top: 1px solid #2e2e42;
}

.theme-switcher {
    background: #101010;
    border: 1px solid #2e2e42;
    border-radius: 6px;
    display: grid;
    gap: 2px;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 0.55rem;
    padding: 2px;
}

.theme-option {
    background: transparent;
    border: 0;
    border-radius: 4px;
    color: var(--color-grey);
    font-size: 10px;
    line-height: 1.2;
    padding: 0.28rem 0.2rem;
}

.theme-option:hover {
    color: var(--color-white);
}

.theme-option.active {
    background: var(--color-gold);
    color: #000;
    font-weight: 700;
}

.app-meta {
    text-align: center;
    line-height: 1.4;
}

.app-version {
    font-weight: 500;
}

.sidebar.collapsed .sidebar-footer {
    display: none;
}

html.sidebar-collapsed .sidebar .sidebar-footer {
    display: none;
}

#appVersionLink {
    cursor: pointer;
}

.sidebar-version {
    cursor: pointer;
}

.sidebar-version:hover {
    color: var(--color-gold);
}

.sidebar-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 10px;
}

.sidebar-logo img {
    max-width: 140px;
    transition: 0.2s ease;
}

.logo-collapsed {
    display: none;
}

.sidebar.collapsed .logo-expanded {
    display: none;
}

html.sidebar-collapsed .sidebar .logo-expanded {
    display: none;
}

.sidebar.collapsed .logo-collapsed {
    display: block;
    max-width: 40px;
}

html.sidebar-collapsed .sidebar .logo-collapsed {
    display: block;
    max-width: 40px;
}

/* THEAD override */
table.dataTable thead th {
    background: var(--color-black);
    color: var(--color-gold);
    border-bottom: 1px solid var(--color-border);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* BUTTON override */
.btn-primary {
    background-color: var(--color-gold);
    border-color: var(--color-gold);
    color: #000;
}

.btn-primary:hover {
    background-color: #a87c36;
}

/* Bootstrap pagination */
.page-link {
    color: var(--app-text-muted);
}

.page-link:hover {
    color: #a87c36;
}

.page-item.active .page-link {
    background-color: #c19140;
}

.page-item.disabled .page-link {
    color: var(--app-text-muted);
}

/* filter coloring */
table.dataTable tfoot th {
    font-family: "Arial Narrow", "Roboto Condensed", "Segoe UI", sans-serif;
    font-size: 0.68rem;
}

table.dataTable tfoot input.form-control,
table.dataTable tfoot select.form-select {
    font-family: "Arial Narrow", "Roboto Condensed", "Segoe UI", sans-serif;
    font-size: 0.68rem;
}

table.dataTable tfoot input::placeholder {
    font-size: 0.68rem;
}

.datatable-filter-help {
    color: var(--app-text-muted);
    font-family: "Segoe UI", sans-serif;
    font-size: 0.66rem;
    font-weight: 400;
    margin: 0.15rem 0 0.5rem;
}

.datatable-filter-help code {
    color: var(--app-text-muted);
    font-size: 0.66rem;
}

table.dataTable tfoot input.active-filter {
    background-color: #fff3cd;
    border-color: #ffc107;
}

html[data-argus-theme="dark"] table.dataTable tfoot input.active-filter {
    background-color: #3d3216;
    border-color: #c19140;
    color: #f8e7bf;
}

table.dataTable tfoot .range-empty-active .form-check-label {
    color: #8a6500;
    font-weight: 600;
}

html[data-argus-theme="dark"] table.dataTable tfoot .range-empty-active .form-check-label {
    color: #f2c879;
}

table.dataTable thead th.active-filter-col {
    background-color: #fff3cd !important;
}

html[data-argus-theme="dark"] table.dataTable thead th.active-filter-col {
    background-color: #3d3216 !important;
    color: #f2c879;
}

.date-range-filter {
    min-width: 105px;
}

.date-range-filter .form-control-sm {
    font-size: 0.68rem;
    padding: 0.15rem 0.25rem;
}

.date-range-filter[data-range-filter="status"] {
    min-width: 170px;
}

.date-range-filter .range-now {
    font-size: 0.68rem;
    padding: 0.15rem 0.3rem;
}

.request-detail-section {
    border-top: 1px solid var(--app-border);
    padding-top: 0.75rem;
}

.request-detail-section:first-child {
    border-top: 0;
    padding-top: 0;
}

.request-detail-section h6 {
    color: var(--app-text);
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.45rem;
    text-transform: uppercase;
}

.request-detail-table {
    margin-bottom: 0.85rem;
}

.request-detail-table th {
    color: var(--app-text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    width: 180px;
}

.request-detail-table td {
    font-size: 0.82rem;
    white-space: normal;
}

.request-detail-pre {
    background: var(--app-surface-muted);
    border: 1px solid var(--app-border);
    border-radius: 4px;
    color: var(--app-text);
    font-size: 0.76rem;
    margin: 0;
    max-height: 360px;
    overflow: auto;
    padding: 0.55rem 0.65rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.audit-details-json {
    background: #0f172a;
    border-radius: 6px;
    color: #e5e7eb;
    font-size: 0.78rem;
    margin: 0;
    min-height: 180px;
    overflow: auto;
    padding: 0.75rem;
    white-space: pre-wrap;
    word-break: break-word;
}


.config-item {
    display: flex; /* 🔥 důležité */
    justify-content: space-between;
    align-items: center;

    padding: 4px 6px;
    margin: 2px 0;
    border-radius: 4px;
    background: #2d3748;
    color: white;
    cursor: pointer;

    font-size: 12px;
    white-space: nowrap; /* ❗ zákaz zalamování */
}

#jsonViewer {
    overflow: auto;
    background: #1e1e1e;
    padding: 10px;
    border-radius: 8px;
    font-family: monospace;
}

#machineModal .modal-dialog {
    height: calc(100vh - 2rem);
    margin-bottom: 1rem;
    margin-top: 1rem;
}

#machineModal .modal-content {
    height: 100%;
}

#machineModal .modal-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

#machineModal .tab-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

#machineModal .tab-pane.active {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.config-browser {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.config-col {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    min-height: 0;
    width: 180px;
}

.config-title {
    color: var(--app-text-muted);
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
}

.config-list {
    flex: 1 1 auto;
    font-size: 12px;
    min-height: 0;
    overflow-y: auto;
}

.json-container {
    min-height: 0;
    overflow: auto;
}


.config-item:hover {
    background: #4a5568;
}

.config-item.active {
    background: #c19140;
}

.config-item span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-small {
    flex-shrink: 0; /* 🔥 zabrání zalomení */
    margin-left: 6px;
    font-size: 10px;
}

.modal-xl {
    max-width: 95%;
}

html[data-argus-theme="dark"] .btn-outline-secondary {
    border-color: #596170;
    color: #c4cad4;
}

html[data-argus-theme="dark"] .btn-outline-secondary:hover {
    background: #2a303a;
    color: #fff;
}



#machinesTable tbody tr {
    cursor: pointer;
}

/* dblclick highlight */
.table-active-row > td {
    background-color: #c19140 !important;
    color: #000 !important;
}

.dashboard-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 10px;
    table-layout: auto;
    width: max-content;
}

.dashboard-country-grid {
    align-items: flex-start;
    display: flex;
    gap: 4rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.dashboard-country-block {
    flex: 0 0 auto;
}

.dashboard-country-title {
    background: #f1f5f9;
    border-left: 4px solid #28313f;
    color: #111827;
    font-size: 0.8rem;
    font-weight: 800;
    margin: 0 0 0.35rem;
    padding: 0.35rem 0.55rem;
}

.dashboard-table th,
.dashboard-table td {
    font-size: 10px;
    line-height: 1.15;
}

.dashboard-table thead th {
    background: #28313f;
    border-bottom: 2px solid #111827;
    color: #fff;
    font-weight: 700;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
    position: sticky;
    top: 0;
    vertical-align: middle;
    white-space: nowrap;
    z-index: 1;
}

.dashboard-table tbody td {
    border-bottom: 1px solid #e5e7eb;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
    white-space: nowrap;
}

.dashboard-table tbody tr:hover td {
    filter: brightness(0.98);
}

.dashboard-table tbody tr.dashboard-customer-highlight > td:not(.dashboard-count-col):not(.dashboard-total-col) {
    background: #eef2ff;
}

.dashboard-table tbody tr.dashboard-customer-highlight .dashboard-customer-col {
    border-left: 4px solid #6366f1;
    border-left-color: #6366f1;
}

.dashboard-table tbody tr.dashboard-summary-row > td {
    background: #111827 !important;
    border-bottom: 0;
    border-top: 2px solid #020617;
    color: #fff !important;
    font-weight: 800;
}

.dashboard-table tbody tr.dashboard-summary-row .dashboard-total-col {
    background: #020617 !important;
}

.dashboard-table .dashboard-customer-col {
    font-weight: 700;
    width: 1%;
}

.dashboard-table .dashboard-mode-col {
    font-weight: 700;
    width: 1%;
}

.dashboard-table .dashboard-count-col,
.dashboard-table .dashboard-status-col,
.dashboard-table .dashboard-total-col {
    width: 1%;
}

.dashboard-table .dashboard-platform-separator {
    border-left: 4px solid #111827 !important;
}

.dashboard-table .dashboard-total-col {
    background: #f1f5f9;
    color: #111827;
    font-weight: 800;
}

.dashboard-table thead .dashboard-total-col {
    background: #111827;
    color: #fff;
}

.dashboard-table thead .dashboard-mg-gp {
    background: #15803d;
}

.dashboard-table tbody .dashboard-mg-gp {
    background: #dcfce7;
    color: #14532d;
}

.dashboard-table thead .dashboard-mg-gp-k2 {
    background: #15803d;
}

.dashboard-table tbody .dashboard-mg-gp-k2 {
    background: #dcfce7;
    color: #14532d;
}

.dashboard-table thead .dashboard-mg-gp-k7 {
    background: #16a34a;
}

.dashboard-table tbody .dashboard-mg-gp-k7 {
    background: #bbf7d0;
    color: #14532d;
}

.dashboard-table thead .dashboard-mg-od {
    background: #ea580c;
}

.dashboard-table tbody .dashboard-mg-od {
    background: #ffedd5;
    color: #7c2d12;
}

.dashboard-table thead .dashboard-mg-rp {
    background: #b91c1c;
}

.dashboard-table tbody .dashboard-mg-rp {
    background: #fee2e2;
    color: #7f1d1d;
}

.dashboard-table thead .dashboard-mg-rp-k2 {
    background: #b91c1c;
}

.dashboard-table tbody .dashboard-mg-rp-k2 {
    background: #fee2e2;
    color: #7f1d1d;
}

.dashboard-table thead .dashboard-mg-rp-k7 {
    background: #dc2626;
}

.dashboard-table tbody .dashboard-mg-rp-k7 {
    background: #fecaca;
    color: #7f1d1d;
}

.dashboard-table thead .dashboard-mg-yp {
    background: #ca8a04;
    color: #111827;
}

.dashboard-table tbody .dashboard-mg-yp {
    background: #fef9c3;
    color: #713f12;
}

.dashboard-table thead .dashboard-mg-bp {
    background: #2563eb;
}

.dashboard-table tbody .dashboard-mg-bp {
    background: #dbeafe;
    color: #1e3a8a;
}

.dashboard-table thead .dashboard-mg-bl {
    background: #111827;
}

.dashboard-table tbody .dashboard-mg-bl {
    background: #e5e7eb;
    color: #111827;
}

.dashboard-table thead .dashboard-mg-pp {
    background: #7e22ce;
}

.dashboard-table tbody .dashboard-mg-pp {
    background: #f3e8ff;
    color: #581c87;
}

.dashboard-table thead .dashboard-mg-default {
    background: #f8fafc;
    color: #111827;
}

.dashboard-table tbody .dashboard-mg-default {
    background: #fff;
    color: #111827;
}

.dashboard-charts {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, max-content));
    align-items: start;
}

.dashboard-chart-stack {
    display: grid;
    gap: 0.75rem;
}

.dashboard-chart {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.8rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    width: max-content;
}

.dashboard-chart:hover {
    border-color: #94a3b8;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.dashboard-chart h6 {
    color: #374151;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.7rem;
}

.dashboard-chart-compact {
    padding: 0.65rem;
}

.dashboard-chart-compact h6 {
    font-size: 0.76rem;
    margin-bottom: 0.5rem;
}

.dashboard-pie-wrap {
    align-items: flex-start;
    display: grid;
    gap: 0.9rem;
    grid-template-columns: 150px minmax(0, 260px);
}

.dashboard-chart-compact .dashboard-pie-wrap {
    gap: 0.65rem;
    grid-template-columns: 105px minmax(0, 210px);
}

.dashboard-pie {
    display: block;
    height: 150px;
    overflow: visible;
    width: 150px;
}

.dashboard-chart-compact .dashboard-pie {
    height: 105px;
    width: 105px;
}

.dashboard-chart-compact .dashboard-pie-bg,
.dashboard-chart-compact .dashboard-pie-segment {
    stroke-width: 24;
}

.dashboard-chart-compact .dashboard-pie-segment:hover,
.dashboard-chart-compact .dashboard-pie-segment.dashboard-chart-active {
    stroke-width: 28;
}

.dashboard-chart-compact .dashboard-pie-total {
    font-size: 13px;
}

.dashboard-pie-bg {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 30;
}

.dashboard-pie-segment {
    cursor: pointer;
    fill: none;
    stroke-linecap: butt;
    stroke-width: 30;
    transform: rotate(-90deg);
    transform-origin: 60px 60px;
    transition: filter 0.12s ease, stroke-width 0.12s ease;
}

.dashboard-pie-segment:hover {
    filter: brightness(0.92);
    stroke-width: 34;
}

.dashboard-pie-segment.dashboard-chart-active {
    filter: brightness(0.9);
    stroke-width: 34;
}

.dashboard-pie-hole {
    fill: #fff;
    stroke: rgba(17, 24, 39, 0.08);
    stroke-width: 1;
}

.dashboard-pie-total {
    color: #111827;
    dominant-baseline: middle;
    fill: #111827;
    font-size: 14px;
    font-weight: 800;
    pointer-events: none;
    text-anchor: middle;
}

.dashboard-pie-legend {
    display: grid;
    gap: 0.25rem;
    max-height: 220px;
    overflow: auto;
}

.dashboard-chart-compact .dashboard-pie-legend {
    max-height: 115px;
}

.dashboard-chart-compact .dashboard-pie-legend-row {
    font-size: 0.68rem;
    grid-template-columns: 10px minmax(0, 1fr) 34px 46px;
}

.dashboard-pie-legend-row {
    align-items: center;
    border-radius: 4px;
    display: grid;
    font-size: 0.72rem;
    gap: 0.35rem;
    grid-template-columns: 10px minmax(0, 1fr) 44px 52px;
    line-height: 1.2;
    padding: 0.12rem 0.2rem;
    transition: background-color 0.12s ease, color 0.12s ease;
    white-space: nowrap;
}

.dashboard-pie-legend-row:hover {
    background: #f1f5f9;
}

.dashboard-pie-legend-row.dashboard-chart-active {
    background: #e2e8f0;
}

.dashboard-pie-legend-row:hover .dashboard-pie-label,
.dashboard-pie-legend-row:hover .dashboard-pie-value,
.dashboard-pie-legend-row:hover .dashboard-pie-percent,
.dashboard-pie-legend-row.dashboard-chart-active .dashboard-pie-label,
.dashboard-pie-legend-row.dashboard-chart-active .dashboard-pie-value,
.dashboard-pie-legend-row.dashboard-chart-active .dashboard-pie-percent {
    color: #020617;
    font-weight: 700;
}

.dashboard-pie-color {
    border-radius: 2px;
    display: inline-block;
    height: 10px;
    width: 10px;
}

.dashboard-pie-label {
    color: #111827;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-pie-value,
.dashboard-pie-percent {
    color: #374151;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* Dashboard report layout */
.dashboard-section {
    margin-bottom: 2.4rem;
}

.dashboard-section-header {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.dashboard-section-header h5 {
    color: var(--app-text);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0;
}

.dashboard-table-shell {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 6px;
    overflow: hidden;
}

.dashboard-table-scroll {
    max-width: 100%;
    overflow: auto;
}

.dashboard-table {
    --dashboard-header-bg: #202938;
    --dashboard-header-border: #111827;
    --dashboard-total-bg: #eef2f7;
    --dashboard-total-head-bg: #111827;
    --dashboard-sticky-bg: var(--app-surface);
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
    min-width: max-content;
    width: max-content;
}

html[data-argus-theme="dark"] .dashboard-table {
    --dashboard-header-bg: #111722;
    --dashboard-header-border: #05070b;
    --dashboard-total-bg: #242b36;
    --dashboard-total-head-bg: #080b11;
    --dashboard-sticky-bg: var(--app-surface);
}

.dashboard-table th,
.dashboard-table td {
    border-color: var(--app-border);
    font-size: 10px;
    line-height: 1.15;
    padding: 0.28rem 0.42rem;
}

.dashboard-table thead th {
    background: var(--dashboard-header-bg);
    border-bottom: 2px solid var(--dashboard-header-border);
    color: #f8fafc;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    position: sticky;
    text-transform: uppercase;
    top: 0;
    z-index: 3;
}

.dashboard-table tbody td {
    border-bottom: 1px solid var(--app-border);
    white-space: nowrap;
}

.dashboard-table .dashboard-customer-col {
    left: 0;
    max-width: 230px;
    min-width: 150px;
    position: sticky;
    white-space: nowrap;
    z-index: 2;
}

.dashboard-table thead .dashboard-customer-col {
    background: var(--dashboard-total-head-bg);
    z-index: 4;
}

.dashboard-table tbody .dashboard-customer-col {
    background: var(--dashboard-sticky-bg);
    box-shadow: 1px 0 0 var(--app-border);
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-table .dashboard-mode-col {
    font-weight: 800;
}

.dashboard-table .dashboard-count-col,
.dashboard-table .dashboard-status-col,
.dashboard-table .dashboard-total-col {
    font-variant-numeric: tabular-nums;
    min-width: 42px;
    width: 1%;
}

.dashboard-table .dashboard-zero-col {
    color: color-mix(in srgb, var(--app-text-muted) 70%, transparent);
}

.dashboard-table .dashboard-online-col {
    color: #15803d;
    font-weight: 800;
}

.dashboard-table .dashboard-offline-col {
    color: #b91c1c;
    font-weight: 800;
}

html[data-argus-theme="dark"] .dashboard-table .dashboard-online-col {
    color: #4ade80;
}

html[data-argus-theme="dark"] .dashboard-table .dashboard-offline-col {
    color: #f87171;
}

.dashboard-table .dashboard-total-col {
    background: var(--dashboard-total-bg);
    color: var(--app-text);
    font-weight: 900;
}

.dashboard-table thead .dashboard-total-col {
    background: var(--dashboard-total-head-bg);
    color: #fff;
}

.dashboard-table tbody tr:hover > td {
    filter: none;
    outline: 1px solid rgba(193, 145, 64, 0.18);
    outline-offset: -1px;
}

.dashboard-table tbody tr.dashboard-customer-highlight > td:not(.dashboard-count-col):not(.dashboard-total-col) {
    background: #eef2ff;
}

html[data-argus-theme="dark"] .dashboard-table tbody tr.dashboard-customer-highlight > td:not(.dashboard-count-col):not(.dashboard-total-col) {
    background: #20273a;
}

.dashboard-table tbody tr.dashboard-summary-row > td,
.dashboard-table tbody tr.dashboard-summary-row .dashboard-customer-col {
    background: #0f172a !important;
    border-top: 2px solid #020617;
    color: #fff !important;
    font-weight: 900;
}

.dashboard-table tbody tr.dashboard-summary-row .dashboard-total-col {
    background: #020617 !important;
}

html[data-argus-theme="dark"] .dashboard-table tbody .dashboard-mg-gp,
html[data-argus-theme="dark"] .dashboard-table tbody .dashboard-mg-gp-k2 {
    background: #123d26;
    color: #bbf7d0;
}

html[data-argus-theme="dark"] .dashboard-table tbody .dashboard-mg-gp-k7 {
    background: #14532d;
    color: #dcfce7;
}

html[data-argus-theme="dark"] .dashboard-table tbody .dashboard-mg-od {
    background: #4a260d;
    color: #fed7aa;
}

html[data-argus-theme="dark"] .dashboard-table tbody .dashboard-mg-rp,
html[data-argus-theme="dark"] .dashboard-table tbody .dashboard-mg-rp-k2 {
    background: #4c1515;
    color: #fecaca;
}

html[data-argus-theme="dark"] .dashboard-table tbody .dashboard-mg-rp-k7 {
    background: #5f1717;
    color: #fee2e2;
}

html[data-argus-theme="dark"] .dashboard-table tbody .dashboard-mg-yp {
    background: #43310a;
    color: #fef3c7;
}

html[data-argus-theme="dark"] .dashboard-table tbody .dashboard-mg-bp {
    background: #172f63;
    color: #bfdbfe;
}

html[data-argus-theme="dark"] .dashboard-table tbody .dashboard-mg-bl {
    background: #0b0f17;
    color: #d1d5db;
}

html[data-argus-theme="dark"] .dashboard-table tbody .dashboard-mg-pp {
    background: #3d1664;
    color: #e9d5ff;
}

html[data-argus-theme="dark"] .dashboard-table tbody .dashboard-mg-default {
    background: #1f2530;
    color: var(--app-text);
}

.dashboard-country-grid {
    gap: 3rem;
    padding-bottom: 0.6rem;
}

.dashboard-country-block {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 6px;
    overflow: hidden;
}

.dashboard-country-block .dashboard-table-shell {
    border: 0;
    border-radius: 0;
}

.dashboard-country-title {
    align-items: center;
    background: var(--app-surface-muted);
    border: 0;
    border-bottom: 1px solid var(--app-border);
    color: var(--app-text);
    display: flex;
    font-size: 0.78rem;
    justify-content: space-between;
    margin: 0;
    padding: 0.45rem 0.65rem;
}

html[data-argus-theme="dark"] .dashboard-chart {
    background: var(--app-surface);
    border-color: var(--app-border);
}

html[data-argus-theme="dark"] .dashboard-chart h6,
html[data-argus-theme="dark"] .dashboard-pie-label {
    color: var(--app-text);
}

html[data-argus-theme="dark"] .dashboard-pie-bg {
    stroke: #2c3441;
}

html[data-argus-theme="dark"] .dashboard-pie-hole {
    fill: var(--app-surface);
    stroke: var(--app-border);
}

html[data-argus-theme="dark"] .dashboard-pie-total {
    fill: var(--app-text);
}

html[data-argus-theme="dark"] .dashboard-pie-value,
html[data-argus-theme="dark"] .dashboard-pie-percent {
    color: var(--app-text-muted);
}

html[data-argus-theme="dark"] .dashboard-pie-legend-row:hover,
html[data-argus-theme="dark"] .dashboard-pie-legend-row.dashboard-chart-active {
    background: #252c38;
}

html[data-argus-theme="dark"] .dashboard-pie-legend-row:hover .dashboard-pie-label,
html[data-argus-theme="dark"] .dashboard-pie-legend-row:hover .dashboard-pie-value,
html[data-argus-theme="dark"] .dashboard-pie-legend-row:hover .dashboard-pie-percent,
html[data-argus-theme="dark"] .dashboard-pie-legend-row.dashboard-chart-active .dashboard-pie-label,
html[data-argus-theme="dark"] .dashboard-pie-legend-row.dashboard-chart-active .dashboard-pie-value,
html[data-argus-theme="dark"] .dashboard-pie-legend-row.dashboard-chart-active .dashboard-pie-percent {
    color: #fff;
}
