/* Goalgus API — shared design system (landing, auth, dashboard) */

:root {
    --radius: 0.5rem;
    --radius-sm: 0.375rem;
    /* 40px — matches Safari’s practical <select> floor; keeps btn/input/select aligned. */
    --control-h: 2.5rem;
    --control-h-sm: 2rem;
    --font: "DM Sans", "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: "Syne", "DM Sans", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --header-h: 3.5rem;
    --sidebar-w: 16rem;
}

/* Grayscale zinc palette (shadcn-like). Legacy --blue-* aliases kept for existing CSS.
   Light tokens also live on :root so first paint is sane before the FOUC boot script. */
:root,
html[data-theme="light"] {
    color-scheme: light;
    --white: #ffffff;
    --on-primary: #ffffff;
    --blue-950: #09090b;
    --blue-900: #18181b;
    --blue-800: #27272a;
    --blue-700: #3f3f46;
    --blue-600: #27272a;
    --blue-500: #71717a;
    --blue-400: #a1a1aa;
    --blue-100: #e4e4e7;
    --blue-50: #f4f4f5;
    --surface: #fafafa;
    --surface-raised: #ffffff;
    --surface-muted: #f4f4f5;
    --border: #e4e4e7;
    --border-strong: #d4d4d8;
    --ring: #18181b;
    --text: #09090b;
    --text-muted: #71717a;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --danger-text: #991b1b;
    --success-bg: #ecfdf5;
    --success-text: #065f46;
    --success-border: #a7f3d0;
    --warn-bg: #fffbeb;
    --warn-text: #92400e;
    --warn-border: #fde68a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --white: #ffffff;
    --on-primary: #09090b;
    --blue-950: #fafafa;
    --blue-900: #f4f4f5;
    --blue-800: #e4e4e7;
    --blue-700: #d4d4d8;
    --blue-600: #fafafa;
    --blue-500: #a1a1aa;
    --blue-400: #71717a;
    --blue-100: #3f3f46;
    --blue-50: #27272a;
    --surface: #09090b;
    --surface-raised: #18181b;
    --surface-muted: #27272a;
    --border: #27272a;
    --border-strong: #3f3f46;
    --ring: #d4d4d8;
    --text: #fafafa;
    --text-muted: #a1a1aa;
    --danger: #f87171;
    --danger-bg: #450a0a;
    --danger-border: #7f1d1d;
    --danger-text: #fecaca;
    --success-bg: #052e1c;
    --success-text: #6ee7b7;
    --success-border: #065f46;
    --warn-bg: #422006;
    --warn-text: #fbbf24;
    --warn-border: #854d0e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.55);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--surface);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

a:hover {
    color: var(--blue-800);
}

.container {
    width: min(1120px, calc(100% - 2rem));
    margin-inline: auto;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
}

.brand img {
    height: 36px;
    width: 36px;
    object-fit: contain;
}

html[data-theme="dark"] .brand img {
    filter: invert(1);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-raised);
    color: var(--text);
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    border-color: var(--text);
    background: var(--surface-muted);
    outline: none;
}

.theme-toggle__icon {
    display: none;
}

html:not([data-theme="dark"]) .theme-toggle__icon--sun {
    display: block;
}

html[data-theme="dark"] .theme-toggle__icon--moon {
    display: block;
}

.brand span {
    font-size: 0.95rem;
}

.brand em {
    font-style: normal;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--blue-600);
    margin-left: 0.15rem;
}

.ui-locale-switch {
    position: relative;
    display: inline-block;
}

.ui-locale-switch__trigger {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 2.25rem;
    padding: 0 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-raised);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    cursor: pointer;
    user-select: none;
    box-shadow: var(--shadow);
}

.ui-locale-switch__trigger::-webkit-details-marker {
    display: none;
}

.ui-locale-switch__trigger::marker {
    content: "";
}

.ui-locale-switch__globe,
.ui-locale-switch__chevron {
    flex-shrink: 0;
}

.ui-locale-switch__chevron {
    opacity: 0.7;
    transition: transform 0.15s ease;
}

.ui-locale-switch[open] .ui-locale-switch__chevron {
    transform: rotate(180deg);
}

.ui-locale-switch__trigger:hover,
.ui-locale-switch__trigger:focus-visible {
    border-color: var(--text);
    outline: none;
}

.ui-locale-switch__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    z-index: 80;
    min-width: 11.5rem;
    padding: 0.35rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-raised);
    box-shadow: var(--shadow-lg);
}

.ui-locale-switch__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.55rem;
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
}

.ui-locale-switch__option:hover,
.ui-locale-switch__option:focus-visible {
    background: var(--blue-50);
    outline: none;
}

.ui-locale-switch__option.is-active {
    background: var(--blue-50);
}

.ui-locale-switch__meta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.ui-locale-switch__check {
    color: var(--text);
}

/* ---------- Buttons ---------- */

.btn,
.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    box-sizing: border-box;
    height: var(--control-h);
    min-height: var(--control-h);
    padding: 0 1rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn:hover,
.btn-submit:hover {
    text-decoration: none;
}

.btn-primary,
.btn-submit {
    background: var(--blue-900);
    color: var(--on-primary);
    border-color: var(--blue-900);
}

.btn-primary:hover,
.btn-submit:hover {
    background: var(--blue-950);
    border-color: var(--blue-950);
    color: var(--on-primary);
    opacity: 0.92;
}

.btn-outline {
    background: var(--surface-raised);
    color: var(--text);
    border-color: var(--border);
}

.btn-outline:hover {
    background: var(--surface-muted);
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
    border-color: var(--danger);
}

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    color: var(--white);
}

.btn-sm {
    height: var(--control-h-sm);
    min-height: var(--control-h-sm);
    padding: 0 0.75rem;
    font-size: 0.8125rem;
}

.btn-block {
    width: 100%;
}

/* ---------- Page header / panels ---------- */

.page-header {
    margin-bottom: 1.25rem;
}

.page-header h1 {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--text);
}

.page-header .lead,
.panel .lead {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.55;
}

.panel {
    background: var(--surface-raised);
    border-radius: var(--radius);
    box-shadow: none;
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.panel h1 {
    margin: 0 0 0.35rem;
    color: var(--text);
    font-family: inherit;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.panel .lead {
    margin: 0 0 1.35rem;
}

.panel a:not(.btn) {
    color: var(--blue-600);
    font-weight: 600;
}

.panel a:not(.btn):hover {
    color: var(--blue-800);
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.panel-head h1 {
    margin: 0 0 0.25rem;
}

.panel-head .lead {
    margin: 0;
}

.panel .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.25rem;
    padding: 0 0.25rem;
}

/* ---------- Forms ---------- */

.field {
    margin-bottom: 1.1rem;
}

.field label,
.toolbar label,
.form-grid label,
.content-section-body label,
.email-test-form label,
.modal-form label:not(.checkbox-label) {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text);
}

.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.field textarea,
.field select,
.toolbar input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.toolbar select,
.form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.form-grid textarea,
.form-grid select,
.content-section-body input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.content-section-body textarea,
.email-test-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.email-test-form textarea,
.queue-action-card input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.queue-action-card textarea,
.queue-action-card select,
.site-settings-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.site-settings-form textarea,
.site-settings-form select,
.modal-form input[type="text"],
.modal-form input[type="email"],
.modal-form input[type="password"],
.modal-form input[type="search"],
.modal-form select,
.auth-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]) {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    height: var(--control-h);
    min-height: var(--control-h);
    padding: 0 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: inherit;
    line-height: 1;
    background: var(--surface-raised);
    color: var(--text);
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field select,
.toolbar select,
.form-grid select,
.queue-action-card select,
.site-settings-form select,
.modal-form select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    background-size: 1rem;
    background-color: var(--surface-raised);
    padding-right: 2.25rem;
}

/* WebKit search/number fields otherwise ignore our control height. */
input[type="search"],
input[type="number"] {
    -webkit-appearance: none;
    appearance: none;
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
    -webkit-appearance: none;
}

.field textarea,
.form-grid textarea,
.content-section-body textarea,
.email-test-form textarea,
.queue-action-card textarea,
.site-settings-form textarea {
    resize: vertical;
    min-height: 5.5rem;
    height: auto;
    padding: 0.6rem 0.75rem;
    line-height: 1.45;
}

.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.field textarea:focus,
.field select:focus,
.toolbar input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.toolbar select:focus,
.form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.form-grid textarea:focus,
.form-grid select:focus,
.content-section-body input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.content-section-body textarea:focus,
.email-test-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.email-test-form textarea:focus,
.queue-action-card input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.queue-action-card textarea:focus,
.queue-action-card select:focus,
.site-settings-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.site-settings-form textarea:focus,
.site-settings-form select:focus,
.modal-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.modal-form select:focus,
.auth-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 18%, transparent);
}

.field input:not([type="checkbox"]):not([type="radio"]):disabled,
.form-grid input:not([type="checkbox"]):not([type="radio"]):disabled,
.modal-form input:not([type="checkbox"]):not([type="radio"]):disabled,
.auth-form input:not([type="checkbox"]):not([type="radio"]):disabled {
    background: var(--surface-muted);
    color: var(--text-muted);
    opacity: 1;
    cursor: not-allowed;
}

.field .error,
.field-error,
.auth-form .error {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    color: var(--danger);
}

.field-hint {
    margin: 0.3rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.input-with-action {
    position: relative;
}

.input-with-action input {
    padding-right: 3rem;
}

.input-toggle {
    position: absolute;
    top: 50%;
    right: 0.4rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
}

.input-toggle:hover {
    color: var(--blue-800);
    background: var(--blue-50);
}

.input-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 18%, transparent);
}

.input-toggle .icon-eye-off {
    display: none;
}

.input-toggle.is-visible .icon-eye {
    display: none;
}

.input-toggle.is-visible .icon-eye-off {
    display: block;
}

.checkbox-label,
.checkbox-inline {
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500 !important;
    color: var(--text) !important;
    font-size: 0.875rem !important;
    margin-bottom: 0 !important;
    line-height: 1.25;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"],
.checkbox-inline input[type="checkbox"],
.confirm-dialog__form input[type="checkbox"] {
    appearance: auto;
    width: 1rem !important;
    height: 1rem !important;
    min-width: 1rem;
    min-height: 1rem;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: 0.25rem;
    background: var(--surface-raised) !important;
    box-shadow: none !important;
    flex-shrink: 0;
    accent-color: var(--blue-900);
    cursor: pointer;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.85rem 1rem;
}

.form-grid input,
.form-grid textarea,
.form-grid select {
    margin-top: 0.35rem;
}

.form-section-title {
    margin: 1.75rem 0 0.85rem;
    font-size: 1rem;
    color: var(--blue-900);
}

.form-section-title:first-of-type {
    margin-top: 0;
}

.form-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.inline-form {
    display: inline;
}

/* ---------- Tables / badges / toolbar ---------- */

.toolbar {
    --toolbar-label-h: calc(0.875rem * 1.25);
    --toolbar-label-gap: 0.35rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

/* Labeled fields: title on top, control underneath. */
.toolbar > label:not(.checkbox-label) {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: var(--toolbar-label-gap);
}

/* Buttons / checkboxes have no title — reserve the same label slot so they sit on the control row. */
.toolbar > .checkbox-label {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center;
    align-self: flex-start;
    box-sizing: border-box;
    height: var(--control-h);
    min-height: var(--control-h);
    margin: 0 !important;
    margin-top: calc(var(--toolbar-label-h) + var(--toolbar-label-gap)) !important;
    white-space: nowrap;
}

.toolbar input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.toolbar select {
    min-width: 200px;
    width: auto;
    max-width: none;
    box-sizing: border-box !important;
    margin: 0;
    height: var(--control-h) !important;
    min-height: var(--control-h) !important;
    max-height: var(--control-h) !important;
    padding: 0 0.75rem !important;
    font-size: 0.875rem !important;
    line-height: calc(var(--control-h) - 2px) !important;
}

.toolbar select {
    padding-right: 2.25rem !important;
}

.toolbar > .btn,
.toolbar > .btn-submit,
.toolbar > button.btn,
.toolbar > a.btn {
    box-sizing: border-box !important;
    align-self: flex-start;
    flex-shrink: 0;
    height: var(--control-h) !important;
    min-height: var(--control-h) !important;
    max-height: var(--control-h) !important;
    margin-top: calc(var(--toolbar-label-h) + var(--toolbar-label-gap));
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    font-size: 0.875rem !important;
    line-height: 1 !important;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    font-weight: 600;
    color: var(--blue-900);
    background: var(--surface);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.data-table tr:hover td {
    background: var(--surface-muted);
}

.data-table code {
    font-size: 0.8125rem;
    color: var(--blue-900);
    background: var(--blue-50);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-family: var(--font-mono);
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.badge-failed {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.badge-warn {
    background: var(--warn-bg);
    color: var(--warn-text);
}

.field-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text-muted);
    font-weight: 400;
}

.role-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.55rem;
    border-radius: 999px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.4;
}

/* ---------- Alerts / tabs ---------- */

.status-banner,
.auth-alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.status-banner {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
}

.status-banner.warn {
    background: var(--warn-bg);
    border-color: var(--warn-border);
    color: var(--warn-text);
}

.status-banner.error,
.auth-alert {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--danger-text);
}

.status-banner code {
    font-size: 0.875em;
    background: color-mix(in srgb, var(--text) 8%, transparent);
    padding: 0.1em 0.35em;
    border-radius: 4px;
    font-family: var(--font-mono);
}

.tab-nav {
    display: flex;
    gap: 0.15rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tab-link {
    padding: 0.65rem 0.95rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tab-link:hover {
    color: var(--blue-800);
    background: var(--blue-50);
}

.tab-link.is-active {
    color: var(--blue-900);
    border-bottom-color: var(--blue-600);
    background: transparent;
}

/* ---------- Misc shared ---------- */

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

.text-muted {
    font-size: 0.875rem;
    font-weight: 500;
}

.text-warn {
    color: var(--warn-text);
}

.muted-block {
    padding: 1rem;
    background: var(--blue-50);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-align: center;
}

.small {
    font-size: 0.8125rem;
}

.mono {
    font-family: var(--font-mono);
}

.col-actions {
    width: 1%;
    white-space: nowrap;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.meta-card {
    padding: 1rem 1.15rem;
    background: var(--surface-raised);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
}

.meta-card strong {
    display: block;
    font-size: 0.75rem;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    font-weight: 500;
}

.pagination {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
}

.pagination a {
    background: var(--surface-raised);
    color: var(--blue-800);
    border: 1px solid var(--border);
}

.pagination a:hover {
    background: var(--blue-50);
    border-color: var(--border-strong);
    color: var(--blue-900);
}

.pagination span:not(.current) {
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
}

.pagination span.current {
    background: var(--blue-600);
    color: var(--on-primary);
    font-weight: 600;
    border: 1px solid var(--blue-600);
}

.section-title {
    margin: 2rem 0 0.75rem;
    font-size: 1.05rem;
    color: var(--blue-900);
}

@media (max-width: 640px) {
    .panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .panel-head .btn {
        width: 100%;
    }

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

    .toolbar > label:not(.checkbox-label),
    .toolbar input,
    .toolbar select,
    .toolbar .btn {
        width: 100%;
        min-width: 0;
    }
}
