:root {
    color-scheme: light;
    --bg: #f6f7f9;
    --panel: #ffffff;
    --text: #1f2933;
    --muted: #667085;
    --line: #d8dee8;
    --accent: #176b87;
    --accent-dark: #12536a;
    --danger: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 58px;
    padding: 0 24px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}

.brand {
    color: var(--text);
    font-weight: 700;
}

.topbar nav {
    display: flex;
    flex: 1;
    gap: 14px;
}

.topbar form {
    margin: 0;
}

.page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 20px 48px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 22px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.card {
    display: block;
    min-height: 118px;
    padding: 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
}

.card strong {
    display: block;
    margin-bottom: 8px;
}

.muted {
    color: var(--muted);
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

textarea {
    min-height: 86px;
    resize: vertical;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.button.secondary {
    background: #eef2f6;
    color: var(--text);
}

.button.secondary:hover {
    background: #dfe6ef;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.page-header h1 {
    margin-bottom: 2px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 14px;
}

.details {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px 12px;
    margin: 0;
}

.details dt {
    color: var(--muted);
    font-weight: 600;
}

.details dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.checkbox-row input {
    width: auto;
    min-height: 0;
    margin-right: 8px;
}

.choice-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.choice-list label {
    margin: 0;
    font-weight: 400;
}

.choice-list input {
    width: auto;
    min-height: 0;
    margin-right: 7px;
}

.copy-output {
    width: 100%;
    min-height: 240px;
    font-family: Consolas, "Courier New", monospace;
    white-space: pre;
}

.report-filter {
    display: flex;
    align-items: end;
    gap: 12px;
    margin-bottom: 18px;
}

.report-filter .form-row {
    width: min(280px, 100%);
    margin-bottom: 0;
}
+

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: end;
    gap: 12px;
    margin-bottom: 18px;
}

.filter-grid .form-row {
    margin: 0;
}

.filter-grid .filter-wide {
    grid-column: span 2;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.summary {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.summary span,
.summary strong {
    display: block;
}

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

.summary strong {
    margin-top: 4px;
    font-size: 20px;
}

.notice.success {
    border-left-color: #238636;
    background: #edf8ef;
    color: #185c27;
}

.narrow-form {
    width: min(560px, 100%);
    margin-right: auto;
    margin-left: auto;
}

.danger-button {
    background: var(--danger);
}

.danger-button:hover {
    background: #8f1c13;
}

.secret-key {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f8fafc;
    overflow-wrap: anywhere;
    font-size: 18px;
}

.recovery-codes {
    min-height: 250px;
    margin-bottom: 16px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 17px;
    line-height: 1.7;
}

.import-confirm {
    display: flex;
    align-items: center;
    gap: 12px;
}

.import-confirm label {
    margin: 0;
}


.section-space {
    margin-top: 18px;
}

.inline-form {
    display: flex;
    align-items: end;
    gap: 12px;
}

.inline-form .form-row {
    min-width: 180px;
    margin: 0;
}

.inline-form .inline-form-wide {
    flex: 1;
}

@media print {
    .topbar,
    .report-filter,
    .page-header .actions {
        display: none;
    }

    body,
    .panel,
    table {
        background: #fff;
    }

    .page {
        max-width: none;
        padding: 0;
    }

    .panel {
        border: 0;
        padding: 0;
    }

    .avoid-break {
        break-inside: avoid;
    }
}

button:hover,
.button:hover {
    background: var(--accent-dark);
    text-decoration: none;
}

.form-row {
    margin-bottom: 14px;
}

.error {
    margin-top: 6px;
    color: var(--danger);
}

.notice {
    padding: 10px 12px;
    border-left: 4px solid #b7791f;
    background: #fff7e6;
    color: #6b4608;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel);
}

.table-scroll {
    width: 100%;
    margin-bottom: 18px;
    overflow-x: auto;
}

.table-scroll table {
    min-width: 1180px;
}

th,
td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    font-size: 13px;
    color: var(--muted);
}

@media (max-width: 760px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 18px;
    }

    .topbar nav {
        flex-wrap: wrap;
    }

    .inline-form {
        align-items: stretch;
        flex-direction: column;
    }
}
