@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Barlow:wght@400;500;600;700&display=swap');

html, body {
    font-family: 'Barlow', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

button,
input,
select,
textarea,
table {
    font-family: inherit;
}

/* Match the leading column to the surrounding card heading and metadata. */
:is(.ca-table, .shops-table, .um-table, .kr-table, .bpj-table) > :is(thead, tbody, tfoot) > tr > :is(th, td):first-child {
    padding-left: 1rem;
}

/* These tables already start at the heading's inset. */
:is(.home-table, .pjd-table, .diag-table, .dst-table) > :is(thead, tbody, tfoot) > tr > :is(th, td):first-child,
.kr-preview > .kr-table > :is(thead, tbody, tfoot) > tr > :is(th, td):first-child {
    padding-left: 0;
}

.kampanjhistorik-table .mud-table-root > :is(thead, tbody, tfoot) > tr > .mud-table-cell:first-child {
    padding-left: 20px;
}

/* Separate table titles and descriptions from their data. */
.ca-card > .ca-card-head,
.kr-card > .kr-card-head,
.home-card[aria-label="Recent print jobs"] > .home-card-head {
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.pjd-section:has(> .table-responsive) > h3 {
    padding-bottom: .75rem;
    border-bottom: 1px solid #e5e7eb;
}

.diag-section-label + .diag-table,
.result-box + .diag-table {
    border-top: 1px solid #e5e7eb;
}

div:has(> .dst-table) {
    border-top: 1px solid rgba(255, 152, 0, .22);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Archivo Black', sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background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LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.campaign-builder-card {
    border: 1px solid #dbe5f1;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.campaign-step-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.85rem;
}

.campaign-step-card {
    border: 1px solid #d6e2f0;
    border-radius: 0.6rem;
    padding: 0.75rem;
    background-color: #fff;
}

.campaign-step-title {
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #5a6b7f;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.campaign-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.campaign-metric-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    color: #6b7280;
}

.campaign-metric-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
}

.campaign-type-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.campaign-type-income {
    background-color: #ecfdf3;
    border-color: #86efac;
    color: #166534;
}

.campaign-type-age {
    background-color: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.campaign-type-general {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

.campaign-segment-item {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    border: 1px solid #dde5ef;
    border-radius: 0.55rem;
    padding: 0.55rem 0.7rem;
    background: #fff;
}

.selected-shop-chip {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.45rem;
    background: #fff7ed;
    border: 1.5px solid #fd7e14;
    border-radius: 0.55rem;
    padding: 0.45rem 0.7rem;
    max-width: 100%;
}

.selected-shop-icon {
    font-size: 1rem;
    line-height: 1.4;
    flex-shrink: 0;
}

/* ── Heat-band legend selector ────────────────────────────── */
.heat-band-grid {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-width: 460px;
}

.heat-band-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 0.45rem;
    padding: 0.45rem 0.7rem;
    background: #fafafa;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.12s, background 0.12s;
}

.heat-band-row:hover {
    border-color: #6b7280;
    background: #f3f4f6;
}

.heat-band-row--selected {
    border-color: #198754;
    background: #ecfdf5;
}

.heat-band-swatch {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.12);
}

.heat-band-label {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 500;
}

.heat-band-check {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
}

/* ── Wizard stepper ─────────────────────────────────────────── */
.wizard-stepper {
    display: flex;
    align-items: flex-start;
    gap: 0;
    margin-bottom: 1.25rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.wizard-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 80px;
    position: relative;
    cursor: default;
}

.wizard-step-item.is-clickable {
    cursor: pointer;
}

.wizard-step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 16px;
    left: calc(50% + 16px);
    right: calc(-50% + 16px);
    height: 2px;
    background-color: #d1d5db;
    z-index: 0;
}

.wizard-step-item.is-done:not(:last-child)::after,
.wizard-step-item.is-active:not(:last-child)::after {
    background-color: #1b6ec2;
}

.wizard-step-bubble {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: #f9fafb;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    position: relative;
    z-index: 1;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.wizard-step-item.is-done .wizard-step-bubble {
    border-color: #1b6ec2;
    background: #1b6ec2;
    color: #fff;
}

.wizard-step-item.is-active .wizard-step-bubble {
    border-color: #1b6ec2;
    background: #fff;
    color: #1b6ec2;
    box-shadow: 0 0 0 3px rgba(27,110,194,0.15);
}

.wizard-step-label {
    font-size: 0.68rem;
    text-align: center;
    margin-top: 0.25rem;
    color: #9ca3af;
    font-weight: 600;
    line-height: 1.2;
    max-width: 80px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.wizard-step-item.is-done .wizard-step-label,
.wizard-step-item.is-active .wizard-step-label {
    color: #1b6ec2;
}

.wizard-panel {
    background: #fff;
    border: 1px solid #d6e2f0;
    border-radius: 0.6rem;
    padding: 1rem 1.1rem;
    min-height: 140px;
}

.wizard-panel-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #5a6b7f;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.wizard-nav-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    gap: 0.5rem;
}

.print-preview-list {
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.8rem;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.4rem;
    background: #f8fafc;
    padding: 0.5rem 0.75rem;
}

/* ── Campaign signal chips (step 1) ─────────────────────────── */
.signal-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.signal-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 500;
    border: 1.5px solid transparent;
}

.signal-chip--age {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.signal-chip--income {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: #065f46;
}

.signal-chip--radius {
    background: #fff7ed;
    border-color: #fcd34d;
    color: #92400e;
}

.signal-chip--data {
    background: #f5f3ff;
    border-color: #c4b5fd;
    color: #5b21b6;
}

/* ── Radius preset buttons (step 3) ─────────────────────────── */
.radius-preset-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.radius-preset-btn {
    padding: 0.3rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 999px;
    border: 1.5px solid #d1d5db;
    background: #f9fafb;
    color: #374151;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    white-space: nowrap;
}

.radius-preset-btn:hover:not(:disabled) {
    border-color: #1b6ec2;
    color: #1b6ec2;
    background: #eff6ff;
}

.radius-preset-btn--active {
    background: #1b6ec2;
    border-color: #1b6ec2;
    color: #fff;
}

.radius-preset-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ── Heat band cell count bar (step 4) ───────────────────────── */
.heat-band-count {
    flex: 1;
    min-width: 80px;
    max-width: 140px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: #f3f4f6;
    border-radius: 4px;
    height: 16px;
    overflow: hidden;
    position: relative;
}

.heat-band-count-bar {
    height: 100%;
    background: linear-gradient(90deg, #bfdbfe, #3b82f6);
    border-radius: 4px 0 0 4px;
    transition: width 0.25s;
    min-width: 2px;
}

.heat-band-count-text {
    position: absolute;
    right: 4px;
    font-size: 0.68rem;
    color: #374151;
    white-space: nowrap;
    line-height: 16px;
}

/* ── Audience composition card (steps 5 & 6) ─────────────────── */
.audience-composition-card {
    border: 1px solid #dde5ef;
    border-radius: 0.55rem;
    padding: 0.75rem 1rem;
    background: #f8fbff;
    max-width: 440px;
}

.composition-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.45rem;
}

.composition-label {
    font-size: 0.78rem;
    color: #374151;
    min-width: 130px;
    white-space: nowrap;
}

.composition-bar-wrap {
    flex: 1;
    height: 10px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.composition-bar {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s;
    min-width: 2px;
}

.composition-bar--age    { background: linear-gradient(90deg, #93c5fd, #1d4ed8); }
.composition-bar--income { background: linear-gradient(90deg, #6ee7b7, #065f46); }
.composition-bar--dist   { background: linear-gradient(90deg, #fcd34d, #b45309); }

.composition-pct {
    font-size: 0.78rem;
    font-weight: 600;
    color: #111827;
    min-width: 46px;
    text-align: right;
}

.composition-quality {
    font-size: 0.8rem;
    color: #374151;
}

/* ── Quality badge ───────────────────────────────────────────── */
.quality-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.15rem 0.65rem;
    font-size: 0.76rem;
    font-weight: 700;
    border: 1.5px solid transparent;
    margin-left: 0.3rem;
}

.quality-badge--excellent { background: #ecfdf5; border-color: #6ee7b7; color: #065f46; }
.quality-badge--good      { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }
.quality-badge--fair      { background: #fff7ed; border-color: #fcd34d; color: #92400e; }
.quality-badge--none      { background: #f3f4f6; border-color: #d1d5db; color: #6b7280; }

/* ── Cost estimate row (step 6) ──────────────────────────────── */
.cost-estimate-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    background: #f8fbff;
    border: 1px solid #dde5ef;
    border-radius: 0.5rem;
    padding: 0.6rem 0.9rem;
    max-width: 440px;
}

.cost-estimate-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    font-weight: 700;
    white-space: nowrap;
}
