body { color: var(--ink); }
.masthead a.brand { color: inherit; text-decoration: none; }
.masthead #admin-username { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.actions, .form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.form-actions { justify-content: flex-end; margin-top: 16px; }
button:not(.primary) {
  background: white; color: var(--accent); border: 1px solid #c4d0dc; border-radius: 8px;
  min-height: 38px; padding: 6px 12px; font-size: 14px;
}
button:not(.primary):hover:not(:disabled) { background: #eef3f7; }
button:disabled { opacity: .6; }
button.link { border: 0; padding: 4px 6px; min-height: 36px; background: transparent; }
.link { color: var(--accent); }
form { border: 0; padding: 0; margin: 0; }
label { display: grid; gap: 6px; color: #394b5d; font-size: 14px; }
input, select, textarea {
  width: 100%; min-width: 0; padding: 8px 12px; min-height: 42px; border: 1px solid #b8c6d3;
  border-radius: 8px; color: var(--ink); background: white; font: inherit;
}
textarea { resize: vertical; }
.login-card { width: min(440px, 100%); margin: 20px auto; padding: 32px; }
.login-card h1 { font-size: 26px; margin-bottom: 16px; }
.login-card form { display: grid; gap: 16px; }
.login-card button { justify-self: start; }
.form-error { color: #a33429; min-height: 0; font-size: 14px; }
.form-error:not(:empty), .help { margin-top: 8px; }
.help, .table-meta { font-size: 13px; color: var(--muted); }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-heading h1 { font-size: 32px; }
.page-heading p { color: var(--muted); font-size: 15px; margin-top: 6px; }
.toolbar { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar label:first-child { width: min(320px, 100%); }
.surface { background: white; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
th { background: #f7f9fb; color: #4a5d70; font-weight: 600; }
th, td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
td:last-child { white-space: nowrap; }
.table-name { font-weight: 600; }
.status { font-size: 13px; display: inline-flex; gap: 6px; align-items: center; color: var(--muted); white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.good { color: #276448; }
.status.warn { color: #80570e; }
.loading, .empty { padding: 28px; color: var(--muted); }
.empty h2 { font-size: 17px; color: var(--ink); margin-bottom: 4px; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; color: var(--muted); font-size: 13px; }
dialog {
  border: 1px solid var(--border); border-radius: 12px; padding: 0; width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px); background: white; color: var(--ink); box-shadow: 0 16px 52px #17263829;
}
dialog::backdrop { background: #1c2a3873; }
.dialog-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: white; border-bottom: 1px solid var(--border); padding: 12px 20px; }
.dialog-head h2 { font-size: 18px; }
#dialog-close { font-size: 20px; border: 0; }
#dialog-body { padding: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-note { border-left: 3px solid var(--accent); padding: 8px 12px; background: #f2f6f9; margin-bottom: 14px; font-size: 14px; }
.notifications { position: fixed; bottom: 16px; right: 16px; max-width: calc(100vw - 32px); z-index: 3; display: grid; gap: 8px; }
.toast { display: block; padding: 10px 14px; border-radius: 8px; background: #233445; color: #fff; font-size: 14px; }
.toast.error { background: #8d3026; margin: 0; }
@media (max-width: 620px) {
  .form-grid { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 16px; }
  .page-heading h1 { font-size: 27px; }
  th, td { padding: 10px 12px; }
  td:first-child, td:nth-child(2) { min-width: 138px; }
  .dialog-head, #dialog-body { padding: 12px 14px; }
}
