:root {
    --accent: #0b5cad;
    --error: #b42318;
    --border: #d0d5dd;
    --muted: #667085;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #101828;
}

body { margin: 0; background: #f8f9fb; }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
a { color: var(--accent); }
main { padding: 1.5rem; }

.topbar { display: flex; align-items: center; gap: 1.5rem; padding: .75rem 1.5rem; background: #fff; border-bottom: 1px solid var(--border); }
.topbar .brand { font-weight: 600; text-decoration: none; color: inherit; }
.topbar nav { display: flex; gap: 1rem; flex: 1; }
.topbar nav a { text-decoration: none; color: var(--muted); }
.topbar nav a.active { color: var(--accent); font-weight: 600; }
.topbar .user { color: var(--muted); }
.topbar form { margin: 0; }

.account { display: flex; justify-content: center; padding: 4rem 1rem; }
.account-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 2rem; width: 100%; max-width: 28rem; }
.account-card .brand { font-weight: 600; color: var(--accent); margin-bottom: 1.5rem; }
.account-card form { display: flex; flex-direction: column; gap: .5rem; }
.account-card .qr svg { width: 12rem; height: 12rem; margin: .5rem 0; }

input[type=text], input[type=password], input[type=email], input[type=search], input[type=number], input:not([type]), select { padding: .5rem; border: 1px solid var(--border); border-radius: 6px; font: inherit; }
button { font: inherit; padding: .5rem 1rem; border-radius: 6px; border: 1px solid var(--border); background: #fff; cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }

.alert { padding: .75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.alert-error { background: #fef3f2; color: var(--error); }
.alert-info { background: #eff8ff; color: var(--accent); }
.validation, .validation-message { color: var(--error); }
.recovery-codes { columns: 2; font-size: 1.1rem; }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: .75rem 1.5rem; background: #fffbe6; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

h2 { font-size: 1.1rem; margin: 1.5rem 0 .75rem; }
.muted { color: var(--muted); }
table { border-collapse: collapse; width: 100%; background: #fff; border: 1px solid var(--border); }
th, td { text-align: left; padding: .5rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-weight: 600; font-size: .85rem; color: var(--muted); background: #f9fafb; }
td.actions, div.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.filters, form.inline { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters input[type=search] { min-width: 18rem; }
button.danger { background: var(--error); border-color: var(--error); color: #fff; }
button:disabled { opacity: .5; cursor: default; }
.badge { display: inline-block; font-size: .75rem; padding: .1rem .5rem; border-radius: 999px; background: #f2f4f7; color: var(--muted); vertical-align: middle; }
.badge-blocked, .badge-rejected { background: #fef3f2; color: var(--error); }
.badge-pending { background: #fffaeb; color: #b54708; }
.badge-approved { background: #ecfdf3; color: #067647; }
.presence.online { color: #067647; font-weight: 600; }
.presence.online::before { content: "● "; }
.presence.offline { color: var(--muted); }
dl.details { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.5rem; background: #fff; border: 1px solid var(--border); padding: 1rem 1.25rem; border-radius: 8px; }
dl.details dt { color: var(--muted); }
dl.details dd { margin: 0; }
h1:focus { outline: none; }
.language { display: flex; gap: .5rem; font-size: .85rem; color: var(--muted); }
.language a { color: var(--muted); }
.account-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1.5rem; }
.account-header .brand { margin-bottom: 0; }
form.stacked { display: flex; flex-direction: column; gap: .4rem; max-width: 36rem; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.25rem; }
.monospace { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.remote { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: .75rem 1.25rem; }
.small { font-size: .85rem; }
nav.tabs { display: flex; gap: 1.25rem; border-bottom: 1px solid var(--border); margin: -.25rem 0 1rem; }
nav.tabs a { padding: .4rem 0; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
nav.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.state-running { background: #ecfdf3; color: #067647; }
.state-failed { background: #fef3f2; color: var(--error); }
.state-starting, .state-stopping { background: #fffaeb; color: #b54708; }

/* File browser */
a.button { display: inline-block; padding: .5rem 1rem; border-radius: 6px; border: 1px solid var(--border); background: #fff; color: inherit; text-decoration: none; }
input.path { flex: 1; min-width: 18rem; font-family: ui-monospace, monospace; }
.dropzone { position: relative; display: block; margin-bottom: 1rem; padding: 1rem; border: 2px dashed var(--border); border-radius: 6px; text-align: center; color: var(--muted); }
.dropzone:hover { border-color: var(--accent); color: var(--accent); }
.dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.clipboard { margin-bottom: 1rem; }
textarea.editor { width: 100%; min-height: 24rem; box-sizing: border-box; font-family: ui-monospace, monospace; font-size: .9rem; }
section.card { background: #fff; border: 1px solid var(--border); padding: 0 1.25rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.filters form.inline { margin: 0; }

/* Remote shell */
pre.terminal { background: #101828; color: #e4e7ec; padding: 1rem; border-radius: 8px; height: 28rem; overflow: auto; white-space: pre-wrap; word-break: break-all; font-size: .85rem; margin: 0 0 .75rem; }
form.shell-input input { flex: 1; min-width: 18rem; font-family: ui-monospace, monospace; }

/* Audit log */
td.nowrap { white-space: nowrap; }
td.details { font-family: ui-monospace, monospace; font-size: .85rem; word-break: break-all; }
label.inline { display: flex; gap: .4rem; align-items: center; color: var(--muted); }
input[type=date] { padding: .45rem; border: 1px solid var(--border); border-radius: 6px; font: inherit; }

/* Public pages (download) */
.public { max-width: 52rem; margin: 0 auto; padding: 2rem 1rem 4rem; }
.public .brand { font-weight: 600; color: var(--accent); }
section.card.download { padding: .25rem 1.5rem 1rem; }
.download-file { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; margin: .75rem 0; }
.download-file .sha { flex-basis: 100%; word-break: break-all; }
a.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
span.button.disabled { display: inline-block; padding: .5rem 1rem; border-radius: 6px; border: 1px solid var(--border); color: var(--muted); }
code { font-family: ui-monospace, monospace; background: #f2f4f7; padding: .1rem .35rem; border-radius: 4px; }
input.version { width: 7rem; }

/* Quick support */
.badge-quick { background: #fef0c7; color: #93370d; }
form.pick { align-items: center; padding: .75rem 1rem; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
form.pick input { width: 9rem; font-family: ui-monospace, monospace; letter-spacing: .05em; }
