﻿/* === WRAPPER === */
.heatmap-wrapper {
    height: 500px !important;
    margin: 40px auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.heatmap-wrapper:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.heatmap-wrapper h3 {
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 15px;
}

/* === MAPA === */
#heatmap {
    flex-grow: 1;
    min-height: 400px;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    z-index: 0;
}

.leaflet-container {
    border-radius: 12px;
}

/* === LEGENDA === */
.heatmap-legend {
    background: rgba(30, 30, 30, 0.9);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12px;
    color: #eee;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    text-align: center;
}

.gradient-bar {
    height: 10px;
    width: 120px;
    background: linear-gradient(
            to right,
            rgba(255, 215, 0, 0.2),
            rgba(255, 215, 0, 0.4),
            rgba(255, 215, 0, 0.6),
            rgba(255, 215, 0, 0.8),
            #FFD700
    );
    border-radius: 5px;
    margin: 6px auto;
}

.legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    text-transform: uppercase;
    opacity: 0.8;
}


/* === BAR === */
.progress-bar {
    position: relative;
    width: 100%;
    height: 10px;
    border-radius: 10px;
    background: #e9ecef;
    overflow: hidden;
}

/* ka┼╛d├╜ progress pruh je absolutn├¡ */
.progress-bar > div {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    transition: width 0.5s ease;
}

/* konkr├⌐tn├¡ barvy */
.progress-green {
    background: #2A9D8F;
    z-index: 3;
}

.progress-yellow {
    background: #ffc107;
    z-index: 2;
}

.progress-red {
    background: #E76F51;
    z-index: 2;
}

.progress-gray {
    background: #adb5bd;
    z-index: 1;
}

/* === GRID === */
.kpi-grid {
    display: grid;
    grid-template-columns: 2fr 2fr;
    grid-auto-rows: auto;
    margin-top: 0 !important;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1px;
    background-color: #f1f2f4;
}

/* === CARD === */
.kpi-card {
    background: #fff;
    padding: 20px;
    text-align: center;
    transition: transform .2s;
    height: 80px;
    justify-content: center;
    align-items: center;
}

/* === LABELS & VALUES === */
.kpi-value {
    font-size: 20px;
    font-weight: bold;
    color: #ffc107;
}

.kpi-label {
    font-size: 13px;
    color: #666;
}

#kpi-delivery-status {
    grid-column: 1 / 3;
    grid-row: 1;
}

#kpi-delivery-returned {
    grid-column: 1;
    grid-row: 2;
}

#kpi-orders-total {
    grid-column: 1;
    grid-row: 3;
}

#kpi-delivery-avg-time {
    grid-column: 1;
    grid-row: 4;
}

.kpi-graph {
    grid-column: 2;
    grid-row: 2 / 5;
}

.kpi-graph, .kpi-graph canvas, .kpi-graph .charts-container, .kpi-graph .chart-section {
    height: 100% !important;
}

/* === PROGRESS SECTIONS === */
.progress-header, .progress-values {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #555;
}

.progress-values {
    font-size: 18px;
    font-weight: bold;
    color: #111;
    margin-bottom: 5px;
}

.charts-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between; /* rovnom─¢rn├⌐ rozlo┼╛en├¡ */
    align-items: stretch;
    gap: 30px;
}

.chart-section {
    flex: 1 1 20%;
    /*max-height: 400px;*/
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    height: 100%;
    max-height: 360px;
}

.chart-section canvas {
    flex: 1;
    width: 100% !important;
    height: 100% !important;
    background-color: white;
    border-radius: 8px;
    padding: 5px;
}

.chart-section h3 {
    display: none;
}

@media (max-width: 768px) {
    .chart-section {
        flex: 1 1 100%;
        height: 360px;
    }
}


/* === Heatmap pozic === */
.heatmap-wrap {
    display: flex;
    margin: 40px auto;
    position: relative;
    user-select: none;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    padding: 20px;
    overflow: hidden;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.heatmap-inner {
    position: relative;
    width: 100%;
    height: auto;
}

.heatmap-canvas,
.heatmap-overlay {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 8px;
    display: block;
}

.heatmap-canvas {
    background: #000;
    height: 500px;
}

.heatmap-tooltip {
    position: absolute;
    padding: 8px;
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    pointer-events: none;
    font-size: 12px;
    z-index: 10000;
    display: none;
    white-space: nowrap;
}

.dashboard-item-content.heatmap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: #2B333D;
}

.dashboard-item-content.heatmap .button {
    margin: 5px;
}


.info_block {
    margin: 0px 5px;
    padding: 10px;
    background: #ffffff;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);

}

.line-charts-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: stretch;
    gap: 20px;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

.line-charts-container .line-chart-wrapper {
    flex: 1;
    min-width: 100px;
}

.heatmap-wrap,
.heatmap-inner {
    position: relative;
    overflow: visible; /* Γ£à povol├¡ p┼Öesah */
}

.chart-section {
    position: relative;
}

.chart-section .chartjs-legend,
.chart-section .chartjs-legend ul {
    max-height: 80px;
    overflow-y: auto;
}


.dashboard-item-content {
    border: 1px solid #c9c8c8;
    background: white;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 8px !important;
    height: 100% !important;
}

.dashboard-item-content.contrast {
   border: none !important;
    color: #000000;
    background: #eeeeee;
}

.dashboard-item-content table, .dashboard-item-content tbody, dashboard-item-content {
    border: none !important;
}

.dashboard-item-content:has(> table) {
    padding: 0 !important;
}

.dashboard_table_row td {
    background-color: white !important;
}

.dashboard_table_header {
    background-color: #f7f7f7 !important;
    color:##767474;
}

#task_chart, #task_chart div {
    border-radius: 8px !important;
}

.dashboard-item-content .row {
    margin: 5px !important;
    border-radius: 8px !important;
    gap: 1px !important;
}

.tile_stats_count {
    border-radius: 8px !important;
}

.tile_stats_count .count_top {
    border-radius: 8px 8px 0 0 !important;
}

.dashboard-item-content svg {
    border-radius: 8px !important;
}


.dashboard-card {
    border-radius: 8px;
}

.dashboard-card-section {
    border-radius: 8px;
    background: #eeeeee;

}

.dashboard-card-header {
    padding: 12px 15px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 600;
    background: #eeeeee;
    color: #000000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-sizing: border-box;
}

.dashboard-card-body {
    padding: 0;
    border-radius: 8px;
}

.dashboard-card-section--first {
    overflow: hidden;
}

.dashboard-card-section--first .dashboard-card-header {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.dashboard-card-section--last {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    overflow: hidden;
}

.dashboard-card-section table {
    margin: 0;
    border: none;
    background-color: white;
    border-collapse: separate;
    border-radius: 8px;
}

.dashboard-card-section table tr {
    flex-direction: row;
}

.dashboard-card-section td {
    background: white;
    border-collapse: separate;
    border-radius: 8px;
    border-bottom: #eee;
}

/* ================================
   DASHBOARD ΓÇô LAST OPERATIONS
   ================================ */

/* jemn├í interakce ┼Ö├ídk┼» */
.dashboard-card-section table tr {
    transition: background-color 0.2s ease;
}

.dashboard-card-section table tr:hover {
    background-color: #F8FAFC;
}

/* zarovn├ín├¡ bun─¢k */
.operation-cell,
.shipping-cell,
.shipment-cell-block {
    vertical-align: middle;
}


/* OPERATION INFO */
.operation-cell strong {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

/* ================================
   CLICKABLE OPERATION BLOCK
   ================================ */

.operation-link {
    display: flex;
    flex-direction: column;
    padding: 8px 10px;
    border-radius: 12px;

    line-height: 0.6;
    text-decoration: none;
    color: inherit;
    gap: 2px;

    transition: background-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.1s ease;
    cursor: pointer;
}

/* hover = jasn├╜ sign├íl klikatelnosti */
.operation-link:hover {
    background-color: #EEF2F7;
    box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.06);
}

/* jemn├╜ "press" efekt */
.operation-link:active {
    transform: translateY(1px);
}

/* ─ì├¡slo operace jako hlavn├¡ CTA */
.operation-link strong {
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: text-decoration-color 0.15s ease;
}

.operation-link:hover strong {
    text-decoration-color: currentColor;
}

.operation-cell small {
    display: inline-block;
    margin-top: 2px;
    font-size: 12px;
    color: #6B7280;
}

.shipment-carrier {
    display: inline-block;
    margin-top: 4px;
    font-size: 12px;
    color: #9CA3AF;
}

/* ================================
   SHIPMENT STATUS ΓÇô MODERN BADGE
   ================================ */

.shipping-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.shipment-status {
    --bg: color-mix(in srgb, var(--status-color) 14%, transparent);

    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    align-self: center;
    justify-self: center;

    padding: 4px 12px;
    border-radius: 999px;

    text-transform: uppercase;

    background-color: var(--bg);
    color: var(--status-color) !important;
    border: 1px solid var(--status-color);
}

/* ================================
   SHIPMENTS / TRACKING LINKS
   ================================ */

.shipment-cell-block {
    gap: 6px !important;
    display: flex;
    justify-content: center;
    flex-direction: column;
}

.shipment-cell {
    display: flex;
    align-items: center;
    justify-content: end;
    gap: 6px;

    padding: 4px 10px;
    border-radius: 10px;

    font-size: 13px;
    text-decoration: none;
    color: #374151;

    transition: background-color 0.15s ease, color 0.15s ease;
}

.shipment-cell:hover {
    background-color: #EEF2F7;
    color: #111827;
}

.shipment-cell i {
    font-size: 12px;
    opacity: 0.6;
}

/* ================================
   TEXT CLEANUP
   ================================ */

.dashboard-card-body p {
    margin: 0 !important;
}

/* ================================
   UNIFIED CLICKABLE BEHAVIOR
   ================================ */

.clickable {
    cursor: pointer;
    border-radius: 12px;
    transition: background-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.1s ease;
}

.clickable:hover {
    background-color: #EEF2F7;
    box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.06);
}

.clickable:active {
    transform: translateY(1px);
}

.operation-title-inner {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.last_send_operation_row {
    display: grid;
    grid-template-columns: 33% 33% 33%;
}

.expiring_items_row {
    display: grid;
    grid-template-columns: 40% 20% 20% 20%;
}


.row_graphs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: auto;
    background-color: white;
}

.row_graphs .chart-section {
    height: auto;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    background-color: white;
}

.dashboard-item-content .small,
.dashboard-item-content .small .chart-section {
    min-height: 300px !important;
    height: auto !important;
}

.dashboard-item-content .small .charts-container {
    min-height: 240px;
}

.dashboard-item-content .small canvas {
    min-height: 200px;
}

/* === KPI overview widget === */
.kpi-overview-widget {
    height: auto !important;
    min-height: 0 !important;
    background: #fff !important;
    border: none !important;
    padding: 0 !important;
}

.kpi-overview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
}

.kpi-overview-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px 12px;
    border-right: 1px solid #e3e8ef;
}

.kpi-overview-stat:last-child {
    border-right: none;
}

.kpi-overview-value {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    color: #e6a800;
    text-decoration: none;
}

a.kpi-overview-value:hover {
    color: #c99200;
}

.kpi-overview-label {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #59677e;
}

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

    .kpi-overview-stat {
        border-right: none;
        border-bottom: 1px solid #e3e8ef;
    }

    .kpi-overview-stat:last-child {
        border-bottom: none;
    }
}

.operation-overview-widget {
    height: auto !important;
    min-height: 0 !important;
    background: #fff !important;
    border: none !important;
}

.operation-overview-charts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 12px;
}

.operation-overview-charts .charts-container {
    display: contents;
}

.operation-overview-widget .chart-section {
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
    padding: 12px;
    border: 1px solid #e3e8ef;
    border-radius: 8px;
    background: #fff;
}

.operation-overview-widget .chart-section h3 {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #59677e;
    margin: 0 0 8px;
    text-align: center;
}

.operation-overview-widget .chart-section canvas {
    width: 100% !important;
    height: 200px !important;
    max-height: 200px !important;
    min-height: 0 !important;
}

@media (max-width: 900px) {
    .operation-overview-charts {
        grid-template-columns: 1fr;
    }
}
/* === Shipping activity dashboard widget === */
.shipping-activity-widget {
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    border: none !important;
}

.shipping-compact-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 12px;
    padding: 12px;
    align-items: center;
}

.shipping-compact-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.shipping-compact-total {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 4px 0;
}

.shipping-compact-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: #e6a800;
}

.shipping-compact-value--sm {
    font-size: 18px;
}

.shipping-compact-label {
    font-size: 13px;
    font-weight: 600;
    color: #59677e;
}

.shipping-compact-bar {
    padding: 8px 10px;
    border: 1px solid #e3e8ef;
    border-radius: 8px;
    background: #fafbfc;
}

.shipping-bar-header,
.shipping-bar-values {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    font-size: 12px;
    color: #59677e;
}

.shipping-bar-values {
    margin: 4px 0 6px;
    font-size: 15px;
    font-weight: 700;
    color: #111;
}

.shipping-compact-bar--single .shipping-bar-header {
    grid-template-columns: 1fr auto;
    margin-bottom: 6px;
    font-weight: 600;
    color: #111;
}

.shipping-compact-bar .progress-bar {
    height: 8px;
}

.shipping-compact-chart {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border: 1px solid #e3e8ef;
    border-radius: 8px;
    background: #fff;
    align-self: center;
}

.shipping-compact-chart .charts-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 100%;
    min-height: 0;
}

.shipping-compact-chart .chart-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
}

.shipping-compact-chart .chart-section canvas {
    width: 120px !important;
    height: 120px !important;
    max-width: 120px !important;
    max-height: 120px !important;
    min-height: 0 !important;
}

@media (max-width: 700px) {
    .shipping-compact-layout {
        grid-template-columns: 1fr;
    }

    .shipping-compact-chart {
        justify-self: center;
        width: 160px;
    }
}
/* === Inventory dashboard widget === */
.inventory-widget {
    height: auto !important;
    min-height: 0 !important;
    background: #fff !important;
    border: none !important;
    padding: 12px !important;
}

.inventory-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.inventory-stat-card {
    padding: 10px 12px;
    border: 1px solid #e3e8ef;
    border-radius: 8px;
    background: #fafbfc;
    text-align: center;
}

.inventory-stat-title {
    font-size: 13px;
    font-weight: 600;
    color: #59677e;
    margin-bottom: 6px;
}

.inventory-stat-values {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

.inventory-done {
    color: #59677e;
    text-decoration: none;
}

.inventory-undone {
    color: #bbb;
    text-decoration: none;
}

.inventory-done:hover,
.inventory-undone:hover {
    text-decoration: underline;
}

.inventory-sep {
    color: #ccc;
    margin: 0 4px;
}

.inventory-stat-sub {
    font-size: 11px;
    color: #999;
    margin: 4px 0 8px;
}

.inventory-stat-bar {
    height: 6px;
    border-radius: 999px;
    background: #e9ecef;
    overflow: hidden;
}

.inventory-stat-bar-done {
    height: 100%;
    background: #59677e;
    border-radius: 999px;
}

.inventory-ops-table {
    width: 100%;
    margin: 0 !important;
    font-size: 13px;
}

.inventory-ops-table th {
    background: #f7f7f7 !important;
    color: #59677e !important;
    font-weight: 600;
    padding: 8px 10px !important;
}

.inventory-ops-table td {
    padding: 6px 10px !important;
    background: #fff !important;
}

.inventory-ops-count {
    text-align: right;
}

.inventory-empty {
    margin: 12px 0 0;
    text-align: center;
    color: #bbb;
    font-size: 14px;
}

@media (max-width: 800px) {
    .inventory-stats-grid {
        grid-template-columns: 1fr;
    }
}
/* === Shipping heatmap dashboard widget === */
.shipping-heatmap-widget {
    height: auto !important;
    min-height: 0 !important;
    padding: 12px !important;
    background: #2b333d !important;
    border: none !important;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}

.shipping-heatmap-widget .heatmap-wrapper {
    height: auto !important;
    min-height: 0 !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 8px !important;
    background: #2b333d !important;
    box-shadow: none !important;
}

.shipping-heatmap-widget .heatmap-wrapper:hover {
    transform: none;
    box-shadow: none;
}

.shipping-heatmap-widget #heatmap {
    height: 200px !important;
    min-height: 200px !important;
    max-height: 200px !important;
    width: 100%;
    border-radius: 8px !important;
}

.shipping-heatmap-widget .button {
    display: block;
    text-align: center;
    margin: 0;
}

.widget-empty-msg {
    margin: 0;
    padding: 16px 12px;
    text-align: center;
    font-size: 13px;
    color: #9aa5b1;
}

.shipping-heatmap-widget .widget-empty-msg {
    color: #c5cdd6;
}
/* === Last sent operations widget === */
.last-sent-widget {
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    border: none !important;
}

.last-sent-table {
    width: 100%;
    margin: 0 !important;
    font-size: 13px;
}

.last-sent-table td {
    padding: 8px 12px !important;
    vertical-align: middle;
    background: #fff !important;
    border-bottom: 1px solid #eef2f7;
}

.last-sent-table tr:last-child td {
    border-bottom: none;
}

.last_send_operation_row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
}

.last-sent-widget .operation-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-decoration: none;
    color: inherit;
}

.last-sent-widget .operation-link:hover strong {
    color: #e6a800;
}

.last-sent-widget .shipment-carrier {
    font-size: 12px;
    color: #59677e;
}

.last-sent-widget .muted {
    font-size: 11px;
    color: #999;
}

.last-sent-widget .shipment-status {
    font-size: 11px;
    padding: 3px 10px;
}

.last-sent-widget .shipment-cell {
    font-size: 12px;
    padding: 3px 8px;
}

.last-sent-widget .widget-empty-msg {
    padding: 20px 12px;
    color: #bbb;
}
