@font-face {
    font-family: "Source Sans 3";
    src: url("/static/fonts/source-sans-3.ttf") format("truetype");
    font-weight: 200 900;
    font-display: swap
}

@font-face {
    font-family: "IBM Plex Sans";
    src: url("/static/fonts/ibm-plex-sans.ttf") format("truetype");
    font-weight: 100 700;
    font-display: swap
}

.admin-brand-link {
    color: var(--fg);
    text-decoration: none
}

.page-form .field select {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--fg);
    background: var(--surface);
    font: inherit
}

.page-form .field select:hover {
    border-color: oklch(.68 .04 240)
}

.purchase-region-hint {
    margin: 7px 0 0
}

.purchase-note {
    padding-top: 18px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 14px
}

.dashboard-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 18px
}

.dashboard-summary div {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface)
}

.dashboard-summary strong,
.dashboard-summary span {
    display: block
}

.dashboard-summary strong {
    font-size: 26px
}

.dashboard-summary span,
.muted {
    color: var(--muted)
}

.dashboard-table-wrap {
    margin-top: 16px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface)
}

.admin-dashboard {
    width: min(1400px, 100% - 40px)
}

.csv-backfill-form textarea,
.code-copy-field {
    width: 100%;
    min-height: 8rem;
    resize: vertical;
}

.csv-backfill-form {
    max-width: 1040px
}

.code-copy-field {
    margin-top: 10px;
    min-width: 32rem;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .78rem;
    white-space: pre;
}

.admin-page-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px
}

.operation-form {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px
}

.operation-form .field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 160px;
    margin: 0
}

.purchase-create-form {
    display: grid;
    grid-template-columns: minmax(180px, .8fr) repeat(2, minmax(210px, 1fr));
    align-items: end
}

.purchase-create-form .satellite-selector {
    grid-column: 1 / -1
}

.satellite-selector {
    min-width: 0;
    margin: 0 0 18px;
    border: 0;
    padding: 0
}

.satellite-selector legend {
    margin-bottom: 8px;
    color: var(--fg);
    font-size: 14px;
    font-weight: 700
}

.satellite-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px
}

.satellite-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 150px;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--surface);
    cursor: pointer
}

.satellite-options label:hover {
    border-color: oklch(.68 .04 240);
    background: oklch(.975 .01 235)
}

.operation-form .satellite-options input[type="checkbox"],
.page-form .satellite-options input[type="checkbox"] {
    width: 18px;
    min-width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 0;
    padding: 0;
    accent-color: var(--accent)
}

.satellite-options span,
.satellite-options strong,
.satellite-options small {
    display: block
}

.satellite-options strong {
    font-size: 14px
}

.satellite-options small,
.field-help {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400
}

.field-help {
    display: block;
    margin-top: 8px
}

.optional-form-section {
    margin: 4px 0 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    background: oklch(.985 .003 240)
}

.optional-form-section summary {
    color: var(--fg);
    cursor: pointer;
    font-weight: 700
}

.optional-form-section summary span {
    margin-left: 6px;
    border-radius: 999px;
    padding: 2px 7px;
    background: var(--surface);
    color: var(--muted);
    font-size: 11px
}

.optional-form-section .field {
    margin: 14px 0 0
}

.csv-file-grid {
    gap: 14px
}

.file-field {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    background: oklch(.985 .003 240)
}

.file-field small {
    display: block;
    margin: 2px 0 10px;
    color: var(--muted)
}

.operation-form.compact {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) auto;
    align-items: center;
    gap: 8px;
    width: min(100%, 280px);
    margin: 0
}

.operation-form.compact .field {
    min-width: 0
}

.operation-form.compact select,
.operation-form.compact .button {
    min-height: 36px
}

.operation-form.compact .button {
    padding: 7px 12px
}

.backfill-create-form {
    margin-top: 0
}

.backfill-table {
    min-width: 920px
}

.operation-form .field span {
    display: block;
    margin: 0;
    color: var(--fg);
    font-size: 14px;
    font-weight: 650
}

.operation-form input,
.operation-form select {
    min-height: 40px;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--fg);
    font: inherit;
    width: 100%
}

.operation-message {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface)
}

.button.danger {
    border-color: #b42318;
    color: #b42318
}

.button.danger:hover {
    background: #fef3f2;
    border-color: #912018
}

.account-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0
}

.account-action-note {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px
}

.admin-table-controls {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(190px, 260px) auto auto;
    gap: 12px;
    align-items: end;
    margin: 16px 0 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: oklch(.975 .005 240)
}

.admin-table-controls.has-table-filters {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr))
}

.admin-table-controls .field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    margin: 0
}

.admin-table-controls .field>span {
    color: var(--fg);
    font-size: 13px;
    font-weight: 700
}

.admin-table-controls input,
.admin-table-controls select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 11px;
    background: var(--surface);
    color: var(--fg);
    font: inherit
}

.admin-table-controls input:hover,
.admin-table-controls select:hover {
    border-color: oklch(.68 .04 240)
}

.admin-table-controls input::placeholder {
    color: var(--muted)
}

.admin-sort-direction {
    min-width: 126px;
    min-height: 42px;
    padding-inline: 13px;
    white-space: nowrap
}

.admin-table-result-count {
    display: inline-flex;
    align-items: center;
    align-self: end;
    justify-self: end;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap
}

.admin-table-controls+.dashboard-table-wrap {
    margin-top: 12px
}

.admin-table-no-results td {
    color: var(--muted);
    padding: 24px 14px;
    text-align: center
}

.dashboard-table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    line-height: 1.35
}

.purchase-table {
    min-width: 1900px
}

.purchase-table .external-id,
.purchase-table .date-time,
.purchase-table .purchase-progress,
.purchase-table .button {
    white-space: nowrap
}

.purchase-table .external-id {
    font-family: "IBM Plex Mono", Consolas, monospace;
    font-size: 12px
}

.dashboard-table th,
.dashboard-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle
}

.dashboard-table th {
    background: oklch(.965 .006 240);
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .045em;
    text-transform: uppercase;
    white-space: nowrap
}

.column-help {
    display: block;
    max-width: 170px;
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1.3;
    text-transform: none;
    white-space: normal
}

.dashboard-table tbody tr:nth-child(even) td {
    background: oklch(.985 .003 240)
}

.dashboard-table tbody tr:hover td {
    background: oklch(.955 .012 235)
}

.dashboard-table tbody tr:last-child td {
    border-bottom: 0
}

.dashboard-table td strong {
    font-weight: 700
}

.table-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 0
}

.table-summary span,
.table-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px 9px;
    background: var(--surface);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap
}

.table-status.active,
.table-status.ongoing {
    border-color: oklch(.77 .08 220);
    background: oklch(.96 .025 220);
    color: oklch(.42 .11 220)
}

.table-status.completed {
    border-color: oklch(.75 .08 155);
    background: oklch(.96 .025 155);
    color: var(--success)
}

.table-status.waiting {
    border-color: oklch(.8 .08 75);
    background: oklch(.97 .025 75);
    color: oklch(.48 .1 65)
}

.table-status.failed {
    border-color: oklch(.72 .12 25);
    background: oklch(.97 .03 25);
    color: var(--danger)
}

.table-status.neutral {
    border-color: var(--border);
    background: oklch(.975 .005 240);
    color: var(--muted)
}

.batch-admin-table {
    min-width: 1680px
}

.batch-admin-table th:nth-child(1) {
    width: 14%
}

.batch-admin-table th:nth-child(3) {
    width: 20%
}

.batch-admin-table .date-range {
    white-space: nowrap
}

.batch-admin-table .work-progress {
    white-space: nowrap
}

.ais-status-details {
    max-width: 250px;
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px
}

.ais-status-note {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px
}

.ais-status-details summary {
    width: fit-content;
    color: var(--accent);
    cursor: pointer;
    font-weight: 700
}

.ais-status-details p {
    margin: 6px 0 0;
    line-height: 1.4
}

.batch-name-cell strong,
.batch-name-cell span {
    display: block
}

.owning-purchase-cell strong,
.owning-purchase-cell span {
    display: block
}

.owning-purchase-cell span+span {
    margin-top: 2px
}

.coverage-policy-note {
    max-width: 900px;
    margin: 8px 0 0;
    border-left: 3px solid oklch(.68 .08 235);
    padding: 8px 11px;
    background: oklch(.975 .01 235);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45
}

.coverage-cell {
    min-width: 250px;
    vertical-align: top !important
}

.coverage-cell details {
    max-width: 340px
}

.coverage-cell summary {
    width: fit-content;
    color: var(--accent);
    cursor: pointer;
    font-weight: 700
}

.coverage-cell summary:hover {
    text-decoration: underline
}

.coverage-cell summary:focus-visible {
    border-radius: 4px;
    outline: 3px solid oklch(.75 .12 235 / 45%);
    outline-offset: 3px
}

.coverage-help {
    margin: 10px 0 8px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4
}

.coverage-list {
    display: grid;
    gap: 8px;
    min-width: 280px;
    margin: 0;
    padding: 0;
    list-style: none
}

.coverage-list li {
    display: grid;
    gap: 2px;
    border-top: 1px solid var(--border);
    padding-top: 8px
}

.coverage-list li:first-child {
    border-top: 0;
    padding-top: 0
}

.batch-name-cell span {
    margin-top: 2px;
    font-size: 12px
}

@media (max-width: 800px) {
    .dashboard-summary {
        grid-template-columns: repeat(2, 1fr)
    }

    .purchase-create-form {
        grid-template-columns: 1fr
    }

    .purchase-create-form .button {
        justify-self: start
    }

    .admin-page-heading {
        align-items: start;
        flex-direction: column
    }

    .dashboard-table th,
    .dashboard-table td {
        padding: 11px 12px
    }

    .admin-table-controls {
        grid-template-columns: 1fr 1fr
    }

    .admin-table-controls.has-table-filters {
        grid-template-columns: 1fr 1fr
    }

    .admin-table-search,
    .admin-table-result-count {
        grid-column: 1 / -1
    }

    .admin-table-result-count {
        justify-self: start
    }
}

@media (max-width: 560px) {
    .admin-table-controls {
        grid-template-columns: 1fr
    }

    .admin-table-controls.has-table-filters {
        grid-template-columns: 1fr
    }

    .admin-table-controls>* {
        grid-column: 1
    }

    .admin-sort-direction {
        width: 100%
    }
}

@media (min-width: 801px) and (max-width: 1050px) {
    .purchase-create-form {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .purchase-create-form .button {
        justify-self: start
    }
}
.batch-export-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 20px;
}

.batch-export-heading h2 {
    margin-top: 0;
}

.batch-select-column {
    width: 44px;
    text-align: center !important;
}

.batch-select-column input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.export-selection-error {
    margin-top: 14px;
}

.batch-export-dialog {
    width: min(520px, calc(100% - 32px));
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--fg);
}

.batch-export-dialog::backdrop {
    background: rgb(0 0 0 / 55%);
}

.batch-export-dialog-content {
    padding: 24px;
}

.batch-export-dialog-content h2 {
    margin-top: 0;
}

.batch-export-dialog .field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 20px;
}

.batch-export-dialog .field > span {
    font-weight: 650;
}

.export-filename-input {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    overflow: hidden;
}

.export-filename-input:focus-within {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.export-filename-input input {
    min-width: 0;
    flex: 1;
    padding: 10px 12px;
    border: 0;
    background: transparent;
    color: var(--fg);
    font: inherit;
    outline: 0;
}

.export-filename-input > span {
    padding: 10px 12px;
    border-left: 1px solid var(--border);
    color: var(--muted);
}

.batch-export-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

@media (max-width: 600px) {
    .batch-export-heading {
        flex-direction: column;
    }

    .batch-export-dialog-actions {
        flex-direction: column-reverse;
    }

    .batch-export-dialog-actions .button {
        width: 100%;
    }
}
