html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    color: #26292c;
    background-color: #f4f5f7;
}

h1:focus {
    outline: none;
}

a {
    color: #08a742;
}

.page-title {
    margin: 0 0 4px 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #26292c;
}

.page-subtitle {
    margin: 0 0 24px 0;
    font-size: 0.9rem;
    color: #747678;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

/* Pipedrive-style cards */
.card {
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(38, 41, 44, 0.06);
    padding: 20px;
}

.error-card {
    border-left: 4px solid #f94839;
    color: #a12a21;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.module-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px 20px;
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(38, 41, 44, 0.06);
    text-decoration: none;
    color: #26292c;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.module-card:hover {
    border-color: #08a742;
    box-shadow: 0 4px 12px rgba(38, 41, 44, 0.12);
}

.module-card-icon {
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.module-icon-svg {
    width: 100%;
    height: 100%;
}

.module-card-name {
    font-size: 1rem;
    font-weight: 600;
}

/* Period picker */
.period-picker {
    display: inline-flex;
    border: 1px solid #d4d6d8;
    border-radius: 6px;
    overflow: hidden;
    background-color: #ffffff;
}

.period-button {
    border: none;
    background: transparent;
    padding: 8px 14px;
    font-size: 0.85rem;
    color: #404346;
    cursor: pointer;
}

.period-button + .period-button {
    border-left: 1px solid #d4d6d8;
}

.period-button.selected {
    background-color: #08a742;
    color: #ffffff;
    font-weight: 600;
}

/* KPI cards */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.kpi-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kpi-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #747678;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.kpi-positive {
    color: #08a742;
}

.kpi-negative {
    color: #f94839;
}

/* Chart */
.chart-card {
    margin-bottom: 16px;
}

.chart-title {
    margin: 0 0 16px 0;
    font-size: 1rem;
    font-weight: 600;
}

.stock-chart {
    width: 100%;
    height: auto;
}

.stock-chart .stack-seg:hover {
    opacity: 0.8;
    cursor: default;
}

/* Drill-down */
.stock-chart .drill-target {
    cursor: pointer;
}

.stock-chart .drill-target.selected {
    stroke: #1d1f21;
    stroke-width: 2;
}

.link-button {
    border: none;
    background: transparent;
    padding: 0;
    font: inherit;
    color: #08a742;
    text-decoration: underline;
    cursor: pointer;
}

.link-button.selected {
    font-weight: 700;
    color: #056b2b;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 12px;
    font-size: 0.82rem;
    color: #4a4b4d;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-swatch {
    display: inline-block;
    width: 13px;
    height: 13px;
    border-radius: 2px;
    flex-shrink: 0;
}

.stock-chart .grid-line {
    stroke: #e9eaeb;
    stroke-width: 1;
}

.stock-chart .axis-label {
    fill: #747678;
    font-size: 12px;
}

/* Data table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eceded;
    text-align: left;
}

.data-table th {
    color: #747678;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

.data-table .numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Module tabs */
.module-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
}

.module-tab {
    padding: 8px 14px;
    border: 1px solid #d4d6d8;
    border-radius: 6px;
    background-color: #ffffff;
    font-size: 0.85rem;
    color: #404346;
    text-decoration: none;
}

.module-tab.selected {
    background-color: #08a742;
    border-color: #08a742;
    color: #ffffff;
    font-weight: 600;
}

/* View catalog cards */
.view-card-description {
    font-size: 0.85rem;
    color: #747678;
}

.view-card-source {
    font-size: 0.75rem;
    color: #9a9c9e;
}

/* Data grid */
.grid-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.search-field {
    flex: 1 1 320px;
}

.search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 0.9rem;
    border: 1px solid #d4d6d8;
    border-radius: 6px;
}

.page-size-field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #747678;
}

.grid-summary {
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: #747678;
}

.grid-scroll {
    overflow-x: auto;
}

.grid-table {
    min-width: 900px;
}

.filter-input {
    width: 100%;
    box-sizing: border-box;
    padding: 5px 8px;
    font-size: 0.8rem;
    border: 1px solid #d4d6d8;
    border-radius: 4px;
    background-color: #ffffff;
}

.filter-range {
    display: flex;
    gap: 4px;
}

.filter-row td {
    padding: 6px 12px;
    background-color: #fafbfb;
}

.sort-button {
    border: none;
    background: transparent;
    padding: 0;
    font: inherit;
    color: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    cursor: pointer;
}

.sort-button.sorted {
    color: #08a742;
}

.sort-indicator {
    font-size: 0.7rem;
}

.grid-pagination {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    font-size: 0.85rem;
    color: #747678;
}

.grid-pagination .period-button {
    border: 1px solid #d4d6d8;
    border-radius: 6px;
}

.grid-pagination .period-button:disabled {
    color: #b6b8ba;
    cursor: default;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

#blazor-error-ui .reload {
    color: #26292c;
}
