﻿:root {
    --bg: #f4f5f7;
    --surface: #fff;
    --text: #1c2530;
    --muted: #5a6675;
    --line: #d7dce3;
    --accent: #1f5fbf;
    --accent-dark: #174a97;
    --ok: #1a7341;
    --ok-bg: #e6f4ea;
    --fail: #b3261e;
    --fail-bg: #fdecea;
    --warn: #6b4f00;
    --warn-bg: #fff5d6;
    --info-bg: #e9f1fc;
    --radius: 6px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 1.1rem; margin: 24px 0 8px; }
p { margin: 0 0 12px; }
ul { margin: 0 0 12px; padding-left: 20px; }
code { font-family: Consolas, "Courier New", monospace; }

/* Page frame */
.container { max-width: 1180px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
/* Two rows: the name and the account on top, the sections below. The menu never squeezes between them. */
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 18px; min-height: 52px; padding-top: 8px; padding-bottom: 6px; }
.brand { font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none; }
.main-nav { display: flex; flex-wrap: wrap; gap: 2px; order: 3; flex: 1 0 100%; margin-left: -10px; }
.main-nav a { padding: 5px 10px; border-radius: var(--radius); color: var(--text); text-decoration: none; }
.main-nav a:hover { background: var(--bg); }
.main-nav a.active { background: var(--info-bg); color: var(--accent-dark); font-weight: 600; }
.user-box { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--muted); font-size: .88rem; }
main { padding-top: 22px; padding-bottom: 36px; }
footer { color: var(--muted); font-size: .85rem; padding-bottom: 24px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }

/* Blocks */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.card h2 { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.panel { max-width: 460px; margin: 16px auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 22px 26px; }
.panel.wide { max-width: 720px; }
.panel > :last-child { margin-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 14px 0 18px; }
.stat-label { color: var(--muted); font-size: .88rem; }
.stat-value { font-size: 1.9rem; font-weight: 600; line-height: 1.25; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin-bottom: 18px; }
a.tile { color: inherit; text-decoration: none; }
a.tile:hover { border-color: var(--accent); }
a.tile strong { display: block; color: var(--accent-dark); }
details.hint { margin: 14px 0; }
details.hint summary { cursor: pointer; font-weight: 600; }
details.hint[open] summary { margin-bottom: 10px; }
dl.props { display: grid; grid-template-columns: max-content 1fr; gap: 4px 18px; margin: 0 0 14px; }
dl.props dt { color: var(--muted); }
dl.props dd { margin: 0; }

/* Forms */
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 3px; }
input, select, textarea {
    width: 100%;
    padding: 6px 9px;
    border: 1px solid #b7bfc9;
    border-radius: var(--radius);
    background: #fff;
    color: inherit;
    font: inherit;
}
/* One height for text fields, dates and lists, so labels in a filter row stay on one line. */
input, select { height: 36px; }
input[type=checkbox], input[type=radio] { width: auto; height: auto; }
select.compact { width: auto; height: auto; padding: 3px 6px; font-size: .88rem; }
input:focus, select:focus, textarea:focus, button:focus-visible, .btn:focus-visible { outline: 2px solid #9bbff3; outline-offset: 1px; border-color: var(--accent); }
.form-field { margin-bottom: 12px; }
.form-field small { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; }
.field-validation-error { display: block; color: var(--fail); font-size: .88rem; }
.validation-summary-valid { display: none; }
.validation-summary-errors ul { margin: 0; }
.inline-form { display: inline; }
form + form, form + p, .external-login { margin-top: 12px; }
.inline-form + .inline-form { margin-top: 0; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin: 12px 0 14px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.filters .field { flex: 1 1 150px; min-width: 130px; }
.filters .field.wide { flex-basis: 230px; }
.filters .actions { display: flex; gap: 8px; }
.quick-links { color: var(--muted); font-size: .9rem; }

/* Buttons */
button, .btn {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid #b7bfc9;
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    font: inherit;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
}
button:hover, .btn:hover { background: #edf0f4; color: var(--text); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover, .btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
button.danger, .btn.danger { border-color: #e0a8a3; color: var(--fail); }
button.danger:hover, .btn.danger:hover { background: var(--fail-bg); color: var(--fail); }
button.small, .btn.small { padding: 2px 9px; font-size: .86rem; }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; }
.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data-table th, .data-table td { padding: 7px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid #e7eaee; }
.data-table thead th { background: #eff1f4; border-bottom-color: var(--line); font-weight: 600; white-space: nowrap; }
.data-table tbody th { font-weight: 600; }
.data-table tbody tr:hover { background: #f7f9fb; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table tfoot th, .data-table tfoot td { border-top: 1px solid var(--line); border-bottom: 0; background: #f7f8fa; font-weight: 600; }
.data-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Wide tables scroll sideways on a narrow screen instead of squeezing every column. */
.data-table.wide { min-width: 960px; }
/* An address stays on one line; a very long one is cut and shown in full in the tooltip. */
.data-table .account { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.pager { display: flex; align-items: center; gap: 12px; margin-top: 12px; }

/* Messages and labels */
.alert, p[role=status], p[role=alert], .validation-summary-errors {
    margin: 0 0 14px;
    padding: 9px 12px;
    border: 1px solid #c4d8f6;
    border-radius: var(--radius);
    background: var(--info-bg);
}
.alert.warn { border-color: #ead79c; background: var(--warn-bg); color: var(--warn); }
.alert.error, p[role=alert], .validation-summary-errors { border-color: #f2c2bd; background: var(--fail-bg); color: #8a1c16; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; background: #e8ecf1; color: #3c4857; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.fail { background: var(--fail-bg); color: var(--fail); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.recovery-codes { list-style: none; padding: 0; columns: 2; }
.recovery-codes code { display: block; font-size: 1rem; }

@media (max-width: 640px) {
    .panel { padding: 16px; }
    dl.props { grid-template-columns: 1fr; gap: 0; }
    dl.props dd { margin-bottom: 8px; }
}
