* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    background: #f0f2f5;
    color: #1a1b1f;
}

.page { min-height: 100vh; }

.header {
    background: linear-gradient(135deg, #19233c, #2c3e60);
    color: white;
    padding: 24px 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header h1 {
    margin: 0 0 8px 0;
    font-size: 26px;
    font-weight: 700;
}

.subtitle {
    margin: 0;
    color: #b0c4de;
    font-size: 13px;
    line-height: 1.6;
}

.updated {
    color: #64c8ff;
    font-weight: 600;
}

.content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 32px;
}

.empty {
    background: white;
    padding: 60px;
    text-align: center;
    border-radius: 12px;
    color: #777;
    font-size: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* Cards */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    border-left: 4px solid #0078d7;
}

.card-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
    font-weight: 600;
}

.card-value {
    font-size: 28px;
    font-weight: 700;
    color: #19233c;
}

.card-value.warn {
    color: #d97706;
}

/* Section titles */
h2 {
    margin: 32px 0 16px 0;
    font-size: 20px;
    color: #19233c;
}

h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #19233c;
}

/* Bar chart */
.chart {
    background: white;
    padding: 24px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.bar-row {
    display: grid;
    grid-template-columns: 280px 1fr 100px;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    font-size: 13px;
}

.bar-label {
    display: flex;
    gap: 8px;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.bar-rank {
    background: #19233c;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
}

.bar-cod {
    background: #e0e7f0;
    color: #19233c;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 11px;
}

.bar-name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bar-track {
    background: #f0f2f5;
    height: 32px;
    border-radius: 6px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
    color: white;
    font-weight: 700;
    font-size: 12px;
    transition: width 0.6s ease;
    min-width: 80px;
}

.bar-value { white-space: nowrap; }

.bar-meta {
    text-align: right;
    color: #888;
    font-size: 12px;
}

/* Tables */
.datatable {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}

.datatable.small { font-size: 13px; }

.datatable th {
    background: #19233c;
    color: white;
    padding: 12px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
}

.datatable td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f2f5;
    font-size: 14px;
}

.datatable tr:hover td { background: #f7f9fc; }
.datatable .num { text-align: right; font-variant-numeric: tabular-nums; }
.datatable tr.ok td { background: #e8f5e9; }
.datatable tr.ok:hover td { background: #d4edda; }
.datatable tr.pending td { background: #fff8e1; }
.datatable tr.pending:hover td { background: #ffecb3; }

/* Reports grid */
.reports {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.report-block {
    background: white;
    padding: 16px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.report-block .datatable {
    margin: 0;
    box-shadow: none;
}

footer {
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 12px;
    border-top: 1px solid #e0e0e0;
    margin-top: 40px;
}

/* Blazor error UI */
#blazor-error-ui {
    background: #fffbcc;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

@media (max-width: 800px) {
    .bar-row { grid-template-columns: 1fr; gap: 4px; }
    .reports { grid-template-columns: 1fr; }
    .header { padding: 16px; }
    .header h1 { font-size: 18px; }
    .content { padding: 12px; }
}
