/* ===== Dashboard Layout ===== */
.dashboard-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f5f5f5;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.dashboard-logo-link {
    display: flex;
    align-items: center;
}

.dashboard-logo {
    height: 40px;
    width: auto;
}

.dashboard-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dashboard-client-logo {
    height: 40px;
    width: auto;
}

.dashboard-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 0.85rem;
}

.dashboard-user-name {
    white-space: nowrap;
}

.dashboard-logout-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 4px;
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.dashboard-logout-icon:hover {
    color: #e7163d;
    background: #f5f5f5;
}

.dashboard-back-link {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #666;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    white-space: nowrap;
}

.dashboard-back-link:hover {
    color: #e7163d;
    border-color: #e7163d;
    background: #fef2f4;
}

.dashboard-content {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.dashboard-footer {
    text-align: center;
    padding: 12px;
    color: #888;
    font-size: 0.8rem;
    border-top: 1px solid #ddd;
}

/* ===== Reports Landing ===== */
.reports-landing h1 {
    margin-bottom: 24px;
    color: #333;
}

.report-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.report-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s, transform 0.2s;
    border-left: 4px solid #e7163d;
}

.report-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.report-card-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.report-card h2 {
    font-size: 1.1rem;
    margin: 0 0 8px 0;
    color: #333;
}

.report-card p {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

/* ===== Report Page ===== */
.report-page {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.report-header h1 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
}

.report-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.report-select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}

.report-loading,
.report-empty {
    text-align: center;
    padding: 48px;
    color: #888;
    font-size: 1.1rem;
}

/* ===== Map + Chart row ===== */
.report-visuals {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
    align-items: flex-start;
}

.report-map-container {
    flex: 0 0 400px;
}

.report-chart-container {
    flex: 1;
    min-width: 0;
}

/* ===== Poland Map ===== */
.poland-map {
    position: relative;
}

.poland-map svg {
    width: 100%;
    height: auto;
}

.poland-map path {
    stroke: #fff;
    stroke-width: 2;
    cursor: pointer;
    transition: opacity 0.15s;
}

.poland-map path:hover {
    opacity: 0.8;
    stroke: #333;
    stroke-width: 3;
}

.map-tooltip {
    position: absolute;
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
    transform: translate(-50%, -100%);
    margin-top: -8px;
}

.map-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 0.75rem;
    color: #666;
}

.map-legend-bar {
    flex: 1;
    height: 10px;
    border-radius: 3px;
    background: linear-gradient(to right, #fde0dd, #e7163d);
}

/* ===== Table ===== */
.report-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    white-space: nowrap;
}

.report-table th,
.report-table td {
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
}

.report-table thead th {
    background: #f8f8f8;
    font-weight: 600;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1;
}

.report-table .col-code {
    text-align: center;
    width: 50px;
}

.report-table .col-name {
    text-align: left;
    min-width: 140px;
}

.report-table .col-value {
    text-align: right;
    min-width: 80px;
}

.report-table .col-total {
    text-align: right;
    font-weight: 600;
    min-width: 90px;
    background: #fafafa;
}

.report-table tbody tr:hover {
    background: #f9f2f3;
}

.report-table tfoot .totals-row {
    background: #f0f0f0;
    border-top: 2px solid #ccc;
}

.report-table tfoot .totals-row td {
    padding: 10px;
}

/* ===== Print ===== */
@media print {
    .dashboard-header,
    .dashboard-footer,
    .report-controls {
        display: none !important;
    }

    .dashboard-layout {
        min-height: auto;
        background: white;
    }

    .dashboard-content {
        padding: 0;
        max-width: none;
    }

    .report-page {
        box-shadow: none;
        padding: 0;
    }

    .report-table {
        font-size: 0.75rem;
    }

    .report-visuals {
        page-break-after: always;
    }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 8px 16px;
    }

    .dashboard-content {
        padding: 12px;
    }

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

    .report-visuals {
        flex-direction: column;
    }

    .report-map-container {
        flex: none;
        width: 100%;
        max-width: 400px;
    }
}
