:root,
html[data-theme="light"],
html[data-theme="dark"] {
    color-scheme: dark;
    --bg-main: #11161b;
    --bg-sidebar: #0d1318;
    --bg-topbar: #0d1318;
    --bg-card: #171d22;
    --bg-card-secondary: #1c2329;
    --bg-hover: #202931;
    --border: #2a333b;
    --border-soft: #242c33;
    --primary: #3d7fa6;
    --primary-hover: #4b91ba;
    --primary-muted: rgba(61, 127, 166, 0.14);
    --text-main: #f2f4f5;
    --text-secondary: #a9b2b9;
    --text-muted: #7f8991;
    --success: #5fa768;
    --warning: #c99a4b;
    --danger: #b95e62;
    --info: #5d91b8;

    --primary-fg: #fff;
    --body-fg: var(--text-main);
    --body-bg: var(--bg-main);
    --body-quiet-color: var(--text-secondary);
    --body-medium-color: var(--text-secondary);
    --body-loud-color: var(--text-main);
    --header-color: var(--text-main);
    --header-branding-color: var(--text-main);
    --header-bg: var(--bg-topbar);
    --header-link-color: var(--text-secondary);
    --breadcrumbs-fg: var(--text-secondary);
    --breadcrumbs-link-fg: var(--text-secondary);
    --breadcrumbs-bg: var(--bg-main);
    --link-fg: #6ea5c7;
    --link-hover-color: #8ab9d5;
    --link-selected-fg: #8ab9d5;
    --hairline-color: var(--border-soft);
    --border-color: var(--border);
    --error-fg: #df888c;
    --message-success-bg: rgba(95, 167, 104, 0.14);
    --message-warning-bg: rgba(201, 154, 75, 0.14);
    --message-error-bg: rgba(185, 94, 98, 0.14);
    --darkened-bg: var(--bg-card-secondary);
    --selected-bg: var(--primary-muted);
    --selected-row: rgba(61, 127, 166, 0.1);
    --close-button-bg: #303941;
    --close-button-hover-bg: #3a454e;
    --button-fg: #fff;
    --button-bg: var(--primary);
    --button-hover-bg: var(--primary-hover);
    --default-button-bg: var(--primary);
    --default-button-hover-bg: var(--primary-hover);
    --delete-button-bg: var(--danger);
    --delete-button-hover-bg: #ca6c70;
    --object-tools-fg: var(--text-main);
    --object-tools-bg: #28333b;
    --object-tools-hover-bg: #33414b;
}

* {
    scrollbar-color: #39434c var(--bg-sidebar);
}

html,
body {
    min-height: 100%;
    background: var(--bg-main);
}

body,
input,
textarea,
select,
button {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.5;
}

a:link,
a:visited {
    color: var(--link-fg);
}

a:hover,
a:focus {
    color: var(--link-hover-color);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-hover);
    outline-offset: 2px;
}

/* Global shell */

#container {
    min-width: 0;
    background: var(--bg-main);
}

#header {
    position: sticky;
    z-index: 30;
    top: 0;
    min-height: 64px;
    box-sizing: border-box;
    margin-left: 240px;
    padding: 10px 28px;
    background: var(--bg-topbar);
    border-bottom: 1px solid var(--border-soft);
}

#container > nav {
    margin-left: 240px;
}

#container > .main {
    display: block;
    min-width: 0;
    margin-left: 240px;
}

.main > .content,
.main > #nav-sidebar + .content,
.main.shifted > #nav-sidebar + .content {
    width: 100%;
    max-width: 100%;
}

#content {
    box-sizing: border-box;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 26px 28px 38px;
}

.dashboard #content {
    width: 100%;
}

#content-main {
    float: none;
}

#footer {
    margin-left: 240px;
}

.login #header,
.login #container > .main,
.login #footer,
.popup #container > .main,
.popup #footer {
    margin-left: 0;
}

.login #header {
    justify-content: center;
}

.login #content {
    max-width: 420px;
}

.toggle-nav-sidebar {
    display: none;
}

/* Topbar */

#branding {
    min-width: 0;
}

#site-name.painel-topbar-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
}

.painel-topbar-title a {
    display: block;
    min-width: 0;
    color: var(--text-main) !important;
}

.painel-topbar-title a:hover {
    text-decoration: none !important;
}

#user-tools.painel-user-tools {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: normal;
    line-height: 1.4;
    text-align: right;
    text-transform: none;
}

.painel-welcome {
    white-space: nowrap;
}

.painel-welcome strong {
    color: var(--text-main);
    font-weight: 600;
}

.painel-user-links {
    display: flex;
    align-items: center;
    gap: 14px;
}

.painel-user-links a,
.painel-user-links #logout-form button {
    padding: 5px 0;
    color: var(--text-secondary) !important;
    border: 0;
    border-bottom: 1px solid transparent;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: normal;
    line-height: 1.4;
    text-decoration: none;
    text-transform: none;
    transition: color 150ms ease, border-color 150ms ease;
}

.painel-user-links a:hover,
.painel-user-links #logout-form button:hover {
    color: var(--text-main) !important;
    border-bottom-color: var(--primary);
}

.theme-toggle {
    width: 30px;
    height: 30px;
    padding: 6px;
    color: var(--text-secondary);
    background: var(--bg-card-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
}

/* Authentication */

.painel-auth-page {
    background: var(--bg-main);
}

.painel-auth-page #container {
    display: grid;
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    margin: 0;
    background: var(--bg-main);
    border: 0;
    border-radius: 0;
    overflow: visible;
}

.painel-auth-page #container > .main {
    display: grid;
    min-height: 100vh;
    place-items: center;
}

.painel-auth-page #content {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    padding: 28px 18px;
}

.painel-auth-shell {
    width: min(100%, 410px);
    margin: 0 auto;
}

.painel-auth-card {
    box-sizing: border-box;
    padding: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.24);
}

.painel-auth-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.painel-auth-brand .painel-brand-mark {
    width: 38px;
    height: 38px;
}

.painel-auth-heading {
    margin-bottom: 24px;
    text-align: center;
}

.painel-auth-heading h1 {
    margin: 0 0 6px;
    color: var(--text-main);
    font-size: 24px;
    font-weight: 600;
    line-height: 1.25;
}

.painel-auth-heading p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.painel-auth-card #login-form {
    margin: 0;
}

.painel-auth-card #login-form .form-row {
    padding: 0 0 16px;
    border: 0;
}

.painel-auth-card #login-form .form-row label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.painel-auth-card #login-form .form-row input {
    width: 100%;
    height: 40px;
    box-sizing: border-box;
    padding: 8px 10px;
}

.painel-auth-card #login-form .submit-row {
    padding: 4px 0 0;
    background: transparent;
    border: 0;
}

.painel-auth-card #login-form .submit-row input,
.painel-auth-action {
    display: block;
    width: 100%;
    min-height: 40px;
    box-sizing: border-box;
    padding: 9px 14px;
    text-align: center;
}

.painel-auth-card .password-reset-link {
    margin: -4px 0 15px;
    text-align: right;
}

.painel-auth-card .password-reset-link a {
    font-size: 11px;
}

.painel-auth-card .errornote {
    margin: 0 0 16px;
    padding: 10px 11px;
    color: #dfa3a6;
    background: rgba(185, 94, 98, 0.1);
    border: 1px solid rgba(185, 94, 98, 0.28);
    border-radius: 4px;
    font-size: 12px;
}

.painel-auth-card .errorlist {
    margin: 0 0 6px;
    padding: 0;
    color: #dfa3a6;
    font-size: 11px;
    list-style: none;
}

.painel-auth-card--logout .painel-auth-heading {
    margin-bottom: 22px;
}

/* Sidebar */

#nav-sidebar.painel-sidebar {
    position: fixed;
    z-index: 40;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    width: 240px;
    max-height: none;
    box-sizing: border-box;
    margin: 0;
    visibility: visible;
    color: var(--text-secondary);
    background: var(--bg-sidebar);
    border: 0;
    border-right: 1px solid var(--border-soft);
    overflow: hidden;
}

.painel-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 64px;
    box-sizing: border-box;
    padding: 10px 18px;
    color: var(--text-main) !important;
    border-bottom: 1px solid var(--border-soft);
    text-decoration: none;
}

.painel-sidebar-brand:hover {
    background: rgba(255, 255, 255, 0.018);
}

.painel-brand-mark {
    display: grid;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    place-items: center;
    color: #dcebf3;
    background: var(--primary);
    border-radius: 5px;
}

.painel-brand-mark svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

.painel-sidebar-brand > span:last-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.painel-sidebar-brand strong {
    overflow: hidden;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.painel-sidebar-brand small {
    color: var(--text-muted);
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.painel-sidebar-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 14px 11px;
    overflow-x: hidden;
    overflow-y: auto;
}

#nav-filter {
    width: 100%;
    height: 34px;
    box-sizing: border-box;
    margin: 0 0 16px;
    padding: 6px 10px;
    color: var(--text-main);
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: 4px;
    font-size: 12px;
}

#nav-filter::placeholder {
    color: var(--text-muted);
}

#nav-filter:focus {
    border-color: var(--primary);
}

.painel-nav-group + .painel-nav-group {
    margin-top: 20px;
}

.painel-nav-group h2 {
    margin: 0 8px 7px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

#nav-sidebar .painel-nav-group table,
#nav-sidebar .painel-nav-group tbody {
    display: block;
    width: 100%;
}

#nav-sidebar .painel-nav-group tr,
#nav-sidebar .painel-nav-group th {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    background: transparent;
    border: 0;
}

.painel-nav-item {
    position: relative;
    margin: 2px 0;
    border-radius: 4px;
}

.painel-nav-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 39px;
    box-sizing: border-box;
    padding: 8px 10px;
    color: var(--text-secondary) !important;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: color 150ms ease, background-color 150ms ease;
}

.painel-nav-item a:hover,
.painel-nav-item a:focus {
    color: var(--text-main) !important;
    background: var(--bg-hover);
}

.painel-nav-item svg {
    flex: 0 0 17px;
    width: 17px;
    height: 17px;
    fill: currentColor;
    opacity: 0.8;
}

#nav-sidebar .painel-nav-item.current-model {
    background: var(--primary-muted);
}

#nav-sidebar .painel-nav-item.current-model::before {
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 0;
    width: 2px;
    content: "";
    background: var(--primary-hover);
    border-radius: 2px;
}

#nav-sidebar .painel-nav-item.current-model a {
    color: #d9eaf3 !important;
}

.painel-sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 66px;
    box-sizing: border-box;
    padding: 10px 13px;
    border-top: 1px solid var(--border-soft);
}

.painel-user-avatar {
    display: grid;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    place-items: center;
    color: #d9eaf3;
    background: var(--primary-muted);
    border: 1px solid rgba(75, 145, 186, 0.3);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.painel-sidebar-user {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
}

.painel-sidebar-user strong,
.painel-sidebar-user small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.painel-sidebar-user strong {
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
}

.painel-sidebar-user small {
    color: var(--text-muted);
    font-size: 10px;
}

.painel-sidebar-footer form {
    margin: 0;
}

.painel-sidebar-footer button {
    display: grid;
    width: 30px;
    height: 30px;
    padding: 0;
    place-items: center;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

.painel-sidebar-footer button:hover {
    color: var(--text-main);
    background: var(--bg-hover);
}

.painel-sidebar-footer svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

/* Breadcrumbs and page headings */

div.breadcrumbs {
    padding: 10px 28px;
    color: var(--text-muted);
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-soft);
    font-size: 12px;
}

div.breadcrumbs a {
    color: var(--text-secondary);
}

.painel-page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.painel-page-heading h1,
.painel-dashboard-hero h1 {
    margin: 2px 0 3px;
    color: var(--text-main);
    font-size: clamp(23px, 2vw, 27px);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.painel-page-heading p,
.painel-dashboard-hero p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.painel-page-eyebrow,
.painel-card-kicker {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Modules, cards and messages */

.module,
.painel-card,
.painel-session-overview {
    color: var(--text-main);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.module h2,
.module caption,
.inline-group h2 {
    color: var(--text-main);
    background: var(--bg-card-secondary);
    border-bottom: 1px solid var(--border);
}

.module caption a.section,
.module h2 a {
    color: var(--text-main);
}

ul.messagelist {
    margin: 0 0 20px;
    padding: 0;
}

ul.messagelist li {
    margin: 0 0 8px;
    padding: 11px 14px 11px 40px;
    color: var(--text-main);
    background-position: 14px 13px;
    border: 1px solid var(--border);
    border-radius: 5px;
}

ul.messagelist li.success {
    border-color: rgba(95, 167, 104, 0.35);
}

ul.messagelist li.warning {
    border-color: rgba(201, 154, 75, 0.35);
}

ul.messagelist li.error {
    border-color: rgba(185, 94, 98, 0.4);
}

.painel-card {
    min-width: 0;
    padding: 18px;
}

.painel-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.painel-card-heading h2,
.painel-section-heading h2 {
    margin: 2px 0 0;
    color: var(--text-main);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
}

.painel-card-heading > a,
.painel-card-link {
    color: var(--link-fg);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.painel-card-heading > a:hover,
.painel-card-link:hover {
    color: var(--link-hover-color);
}

.painel-card-total {
    color: var(--text-main);
    font-size: 22px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
}

.painel-empty-state {
    margin: 0;
    padding: 22px 8px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

/* Buttons and forms */

.button,
input[type="submit"],
input[type="button"],
.submit-row input,
a.button {
    min-height: 35px;
    box-sizing: border-box;
    padding: 7px 13px;
    color: var(--button-fg);
    background: #2a353d;
    border: 1px solid #36434d;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    line-height: 19px;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
a.button:hover {
    color: #fff;
    background: #35434d;
    border-color: #44535f;
}

input[type="submit"].default,
.submit-row input.default,
.caixa-session-primary {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

input[type="submit"].default:hover,
.submit-row input.default:hover,
.caixa-session-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

input,
textarea,
select,
.vTextField {
    color: var(--text-main);
    background: var(--bg-card-secondary);
    border-color: var(--border);
    border-radius: 4px;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
}

form .aligned p.help,
form .aligned div.help,
form .aligned .help,
form .aligned .help p {
    color: var(--text-muted);
}

.submit-row {
    padding: 12px;
    background: var(--bg-card-secondary);
    border: 1px solid var(--border);
    border-radius: 5px;
}

fieldset.module {
    overflow: hidden;
}

.form-row {
    padding: 13px 15px;
    border-bottom-color: var(--border-soft);
}

.form-row label {
    color: var(--text-secondary);
    font-weight: 500;
}

.readonly {
    color: var(--text-main);
}

.object-tools {
    margin-top: -54px;
}

.object-tools a {
    min-height: 32px;
    box-sizing: border-box;
    padding: 7px 12px;
    background: var(--object-tools-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 11px;
}

.painel-manual-collection {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.painel-manual-collection h2 {
    margin: 2px 0 3px;
    color: var(--text-main);
    font-size: 16px;
    font-weight: 600;
}

.painel-manual-collection p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.manual-collection-form {
    flex: 0 0 auto;
    margin: 0;
}

/* Changelists */

#changelist {
    display: flex;
    align-items: flex-start;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.changelist-form-container {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

#changelist .results {
    width: 100%;
    overflow-x: auto;
}

#changelist table {
    width: 100%;
    border-collapse: collapse;
}

#changelist table thead th {
    padding: 11px 12px;
    color: var(--text-muted);
    background: var(--bg-card-secondary);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.045em;
    text-transform: uppercase;
    white-space: nowrap;
}

#changelist table thead th.sorted {
    background: #20282e;
}

#changelist table tbody th,
#changelist table tbody td {
    padding: 11px 12px;
    color: var(--text-secondary);
    background: transparent;
    border-bottom: 1px solid var(--border-soft);
    font-size: 13px;
    vertical-align: middle;
}

#changelist table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.012);
}

#changelist table tbody tr:hover {
    background: var(--bg-hover);
}

#changelist table tbody tr:last-child th,
#changelist table tbody tr:last-child td {
    border-bottom: 0;
}

#changelist table tbody th a {
    color: #80afd0;
    font-weight: 600;
}

#changelist table .field-price_display,
#changelist table .field-shares_display,
#changelist table .field-retailers_success_display,
#changelist table .field-retailers_failed_display,
#changelist table .field-pools_seen_display,
#changelist table .field-pools_created_display,
#changelist table .field-pools_updated_display,
#changelist table .field-pools_ended_display {
    font-variant-numeric: tabular-nums;
}

#changelist table .field-price_display,
#changelist table .column-price_display {
    text-align: right;
}

#changelist table .field-last_seen_display,
#changelist table .field-started_at_display,
#changelist table .field-finished_at_display,
#changelist table .field-observed_at_display,
#changelist table .field-last_successful_collection_display {
    color: var(--text-muted);
    white-space: nowrap;
}

#changelist table .field-numbers_display {
    color: #cbd3d8;
}

#changelist table .field-old_value_display,
#changelist table .field-new_value_display {
    max-width: 240px;
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 12px;
}

#changelist table .field-old_value_display {
    color: var(--text-muted);
}

#changelist table .field-new_value_display {
    color: var(--link-hover-color);
}

.model-collectionrun #changelist table {
    min-width: 1180px;
}

.model-poolbet #result_list .sortpriority {
    display: none;
}

.painel-number-list {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 5px;
}

.painel-number {
    display: inline-grid;
    min-width: 28px;
    min-height: 26px;
    box-sizing: border-box;
    padding: 3px 6px;
    place-items: center;
    color: #dce5ea;
    background: var(--bg-card-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

#toolbar {
    padding: 13px;
    background: var(--bg-card-secondary);
    border: 0;
    border-bottom: 1px solid var(--border);
}

#changelist-search > div {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 720px;
}

#changelist-search label {
    display: none;
}

#toolbar form #searchbar {
    flex: 1 1 auto;
    width: min(560px, 100%);
    height: 36px;
    box-sizing: border-box;
    margin: 0;
    padding: 7px 11px;
}

#toolbar form input[type="submit"] {
    height: 36px;
}

#changelist .actions {
    padding: 10px 13px;
    background: var(--bg-card-secondary);
    border-bottom: 1px solid var(--border);
}

#changelist .actions select {
    min-height: 34px;
}

#changelist .paginator {
    margin: 0;
    padding: 13px;
    color: var(--text-muted);
    background: var(--bg-card-secondary);
    border-top: 1px solid var(--border);
}

.paginator a:link,
.paginator a:visited,
.paginator .this-page {
    min-width: 30px;
    height: 30px;
    box-sizing: border-box;
    padding: 5px 8px;
    border-radius: 4px;
}

.paginator .this-page {
    color: #fff;
    background: var(--primary);
}

#changelist-filter {
    flex: 0 0 228px;
    width: 228px;
    margin-left: 16px;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

#changelist-filter h2 {
    padding: 12px 14px;
    color: var(--text-main);
    background: var(--bg-card-secondary);
    border-bottom: 1px solid var(--border);
    border-radius: 5px 5px 0 0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

#changelist-filter h3,
#changelist-filter details summary {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
}

#changelist-filter ul {
    padding: 0 10px 10px;
}

#changelist-filter li {
    margin: 1px 0;
}

#changelist-filter li a {
    display: block;
    padding: 6px 8px;
    color: var(--text-secondary);
    border-radius: 3px;
}

#changelist-filter li a:hover {
    color: var(--text-main);
    background: var(--bg-hover);
}

#changelist-filter li.selected a {
    color: #cfe3ef;
    background: var(--primary-muted);
}

/* Status system */

.painel-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-height: 24px;
    box-sizing: border-box;
    padding: 3px 8px;
    color: var(--text-secondary);
    background: rgba(127, 137, 145, 0.12);
    border: 1px solid rgba(127, 137, 145, 0.24);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    white-space: nowrap;
}

.painel-status::before {
    width: 6px;
    height: 6px;
    content: "";
    background: var(--text-muted);
    border-radius: 50%;
}

.painel-status--success {
    color: #9bcba1;
    background: rgba(95, 167, 104, 0.12);
    border-color: rgba(95, 167, 104, 0.26);
}

.painel-status--success::before,
.painel-tone--success {
    background: var(--success) !important;
}

.painel-status--warning {
    color: #dfbd82;
    background: rgba(201, 154, 75, 0.12);
    border-color: rgba(201, 154, 75, 0.27);
}

.painel-status--warning::before,
.painel-tone--warning {
    background: var(--warning) !important;
}

.painel-status--danger {
    color: #dc9699;
    background: rgba(185, 94, 98, 0.12);
    border-color: rgba(185, 94, 98, 0.3);
}

.painel-status--danger::before,
.painel-tone--danger {
    background: var(--danger) !important;
}

.painel-status--info {
    color: #9ac0db;
    background: rgba(93, 145, 184, 0.12);
    border-color: rgba(93, 145, 184, 0.28);
}

.painel-status--info::before,
.painel-tone--info {
    background: var(--info) !important;
}

.painel-tone--neutral {
    background: var(--text-muted) !important;
}

.painel-boolean {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
}

.painel-boolean::before {
    width: 7px;
    height: 7px;
    content: "";
    background: var(--text-muted);
    border-radius: 50%;
}

.painel-boolean--true::before {
    background: var(--success);
}

.painel-boolean--false::before {
    background: var(--text-muted);
}

/* Dashboard */

.painel-dashboard #content {
    max-width: 1600px;
}

.painel-dashboard-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.painel-dashboard-date {
    padding-bottom: 3px;
    color: var(--text-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.painel-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.painel-kpi-card {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 13px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}

.painel-kpi-icon {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    color: #80afd0;
    background: var(--primary-muted);
    border: 1px solid rgba(61, 127, 166, 0.2);
    border-radius: 5px;
}

.painel-kpi-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.painel-kpi-card > div {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
    grid-template-areas:
        "label value"
        "description value";
    grid-template-columns: minmax(0, 1fr) minmax(52px, auto);
    column-gap: 12px;
}

.painel-kpi-card span:not(.painel-kpi-icon) {
    grid-area: label;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.painel-kpi-card strong {
    grid-area: value;
    align-self: center;
    justify-self: end;
    min-width: 52px;
    color: var(--text-main);
    font-size: 23px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.05;
    text-align: right;
    white-space: nowrap;
}

.painel-kpi-card strong.painel-kpi-date {
    min-width: 92px;
    font-size: 17px;
}

.painel-kpi-card small {
    grid-area: description;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.painel-dashboard-primary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
    margin-bottom: 16px;
}

.painel-dashboard-status-stack {
    display: grid;
    min-width: 0;
    gap: 16px;
    align-content: start;
}

.painel-dashboard-secondary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
    margin-bottom: 24px;
}

.painel-modalities-card .painel-card-heading {
    align-items: flex-end;
}

.painel-modalities-card .painel-card-total {
    padding-bottom: 1px;
}

.painel-detail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.painel-detail-list > div {
    min-width: 0;
    padding: 10px 11px;
    background: var(--bg-card-secondary);
    border: 1px solid var(--border-soft);
    border-radius: 4px;
}

.painel-detail-list dt {
    margin-bottom: 3px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.painel-detail-list dd {
    margin: 0;
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.painel-session-description {
    margin: -3px 0 15px;
    color: var(--text-secondary);
    font-size: 13px;
}

.painel-session-workflow {
    margin-top: 14px;
}

.painel-inline-notice {
    margin: 0;
    padding: 9px 11px;
    color: var(--text-secondary);
    background: rgba(127, 137, 145, 0.08);
    border-left: 3px solid var(--text-muted);
    border-radius: 3px;
    font-size: 12px;
}

.painel-inline-notice p {
    margin: 0 0 5px;
}

.painel-inline-notice p:last-child {
    margin-bottom: 0;
}

.painel-inline-notice--success {
    color: #b3d7b7;
    background: rgba(95, 167, 104, 0.1);
    border-left-color: var(--success);
}

.painel-inline-notice--warning {
    color: #dec08d;
    background: rgba(201, 154, 75, 0.1);
    border-left-color: var(--warning);
}

.painel-inline-notice--danger {
    color: #dfa3a6;
    background: rgba(185, 94, 98, 0.1);
    border-left-color: var(--danger);
}

.painel-inline-notice--info {
    color: #a7c8df;
    background: rgba(93, 145, 184, 0.1);
    border-left-color: var(--info);
}

.caixa-session-actions,
.caixa-session-password-actions,
.painel-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.caixa-session-password {
    margin-top: 12px;
}

.caixa-session-password label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
}

.caixa-session-password input {
    width: 100%;
    height: 36px;
    box-sizing: border-box;
}

.caixa-session-note {
    margin: 9px 0 0;
    color: var(--text-muted);
    font-size: 11px;
}

.painel-compact-table-wrap {
    overflow-x: auto;
}

.painel-compact-table {
    width: 100%;
    border-collapse: collapse;
}

.painel-compact-table th,
.painel-compact-table td {
    padding: 8px 5px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 12px;
}

.painel-compact-table thead th {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.painel-compact-table tbody th {
    color: var(--text-secondary);
    font-weight: 500;
    text-align: left;
}

.painel-compact-table th:last-child,
.painel-compact-table td:last-child {
    text-align: right;
}

.painel-compact-table tbody td {
    color: var(--text-main);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.painel-card-link {
    display: inline-block;
    margin-top: 13px;
}

.painel-activity-list,
.painel-change-list,
.painel-run-list,
.painel-health-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.painel-activity-list li {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border-soft);
}

.painel-activity-list li:last-child,
.painel-change-list li:last-child,
.painel-run-list li:last-child,
.painel-health-list li:last-child {
    border-bottom: 0;
}

.painel-activity-marker {
    width: 7px;
    height: 7px;
    margin-top: 6px;
    background: var(--text-muted);
    border-radius: 50%;
}

.painel-activity-list div,
.painel-activity-list strong,
.painel-activity-list small {
    display: block;
    min-width: 0;
}

.painel-activity-list strong {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.painel-activity-list small,
.painel-activity-list time {
    color: var(--text-muted);
    font-size: 10px;
}

.painel-activity-list time {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.painel-change-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(200px, 0.85fr) 72px;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-soft);
}

.painel-change-list li > div {
    min-width: 0;
}

.painel-change-list strong,
.painel-change-list li > div span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.painel-change-list strong {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
}

.painel-change-list li > div span,
.painel-change-list time {
    color: var(--text-muted);
    font-size: 10px;
}

.painel-change-list time {
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.painel-change-values {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}

.painel-change-values del,
.painel-change-values ins {
    max-width: 92px;
    overflow: hidden;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.painel-change-values del {
    color: var(--text-muted);
}

.painel-change-values ins {
    color: var(--link-hover-color);
}

.painel-change-values b {
    color: var(--text-muted);
    font-weight: 400;
}

.painel-run-list li,
.painel-health-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-soft);
}

.painel-run-list li > span:first-child,
.painel-run-list strong,
.painel-run-list small {
    display: block;
    min-width: 0;
}

.painel-run-list strong {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
}

.painel-run-list small {
    color: var(--text-muted);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}

.painel-health-list li > span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 12px;
}

.painel-health-list i {
    width: 7px;
    height: 7px;
    background: var(--text-muted);
    border-radius: 50%;
}

.painel-health-list strong {
    min-width: 2ch;
    color: var(--text-main);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    text-align: right;
}

.painel-quick-access {
    margin-top: 8px;
}

.painel-section-heading {
    margin-bottom: 12px;
}

.painel-quick-access #content-main {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.painel-quick-access .module {
    margin: 0;
    overflow: hidden;
}

.painel-quick-access .module table {
    width: 100%;
}

.painel-quick-access .module caption {
    padding: 10px 12px;
    font-size: 12px;
    text-align: left;
}

.painel-quick-access .module th,
.painel-quick-access .module td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 12px;
}

.painel-admin-activity #content-related {
    float: none;
    width: 100%;
    margin: 16px 0 0;
}

.painel-admin-activity #content-related .module {
    overflow: hidden;
}

.painel-admin-activity #recent-actions-module h2,
.painel-admin-activity #recent-actions-module h3 {
    margin: 0;
    padding: 10px 14px;
}

.painel-admin-activity #recent-actions-module h3 {
    color: var(--text-muted);
    background: transparent;
    border-bottom: 1px solid var(--border-soft);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.painel-admin-activity .actionlist {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    padding: 6px 14px 12px;
}

.painel-admin-activity .actionlist li {
    padding: 8px;
    border-bottom: 1px solid var(--border-soft);
}

/* Collector session overview */

.painel-session-overview {
    margin-bottom: 18px;
    padding: 18px;
}

.painel-session-overview-grid {
    display: grid;
    grid-template-columns: minmax(220px, 0.7fr) minmax(360px, 1.3fr);
    gap: 16px;
}

.painel-session-state {
    padding: 14px;
    background: var(--bg-card-secondary);
    border: 1px solid var(--border-soft);
    border-radius: 5px;
}

.painel-session-state p {
    margin: 12px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
}

.painel-renewal-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
}

.painel-renewal-summary span {
    display: flex;
    flex-direction: column;
}

.painel-renewal-summary small {
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
}

.painel-renewal-summary strong {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

/* Responsive */

@media (max-width: 1360px) {
    .painel-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .painel-dashboard-primary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .painel-activity-card {
        grid-column: 1 / -1;
    }

    .painel-activity-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 24px;
    }
}

@media (max-width: 1100px) {
    #header {
        padding-right: 20px;
        padding-left: 20px;
    }

    #content {
        padding-right: 20px;
        padding-left: 20px;
    }

    .painel-dashboard-secondary-grid {
        grid-template-columns: 1fr;
    }

    .painel-user-links a:first-child,
    .painel-welcome {
        display: none;
    }
}

@media (max-width: 900px) {
    #header,
    #container > nav,
    #container > .main,
    #footer {
        margin-left: 0;
    }

    #header {
        min-height: 58px;
        padding: 9px 14px 9px 56px;
    }

    #toggle-nav-sidebar {
        position: fixed;
        z-index: 55;
        top: 12px;
        left: 12px;
        display: flex;
        width: 34px;
        height: 34px;
        color: var(--text-secondary);
        background: var(--bg-card-secondary);
        border: 1px solid var(--border);
        border-radius: 4px;
    }

    #toggle-nav-sidebar::before {
        content: "☰";
        font-size: 15px;
    }

    .main.shifted #toggle-nav-sidebar::before {
        content: "×";
        font-size: 21px;
        font-weight: 300;
    }

    #nav-sidebar.painel-sidebar,
    .main > #nav-sidebar.painel-sidebar {
        display: flex;
        width: 240px;
        margin: 0;
        visibility: hidden;
        transform: translateX(-100%);
        transition: transform 160ms ease, visibility 160ms ease;
    }

    .main.shifted > #nav-sidebar.painel-sidebar {
        margin: 0;
        visibility: visible;
        transform: translateX(0);
    }

    #changelist {
        flex-direction: column;
    }

    #changelist-filter {
        width: 100%;
        box-sizing: border-box;
        margin: 14px 0 0;
    }

    .painel-session-overview-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    #content {
        padding: 18px 14px 28px;
    }

    div.breadcrumbs {
        padding: 9px 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #user-tools.painel-user-tools {
        display: block;
    }

    .painel-user-links {
        gap: 9px;
    }

    .painel-user-links a,
    .painel-user-links #logout-form button {
        font-size: 10px;
    }

    .painel-page-heading,
    .painel-dashboard-hero {
        display: block;
    }

    .painel-dashboard-date {
        display: block;
        margin-top: 7px;
    }

    .painel-kpi-grid,
    .painel-dashboard-primary-grid,
    .painel-dashboard-secondary-grid,
    .painel-quick-access #content-main,
    .painel-activity-list {
        grid-template-columns: 1fr;
    }

    .painel-activity-card,
    .painel-dashboard-secondary-grid > :last-child {
        grid-column: auto;
    }

    .painel-detail-list {
        grid-template-columns: 1fr;
    }

    .painel-change-list li {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .painel-change-values {
        justify-content: flex-start;
    }

    .painel-change-list time {
        grid-column: 1 / -1;
    }

    .painel-admin-activity .actionlist {
        grid-template-columns: 1fr;
    }

    .object-tools {
        margin-top: 0;
    }

    #changelist-search > div {
        flex-wrap: wrap;
    }

    #toolbar form #searchbar {
        width: 100%;
    }

    .caixa-session-actions > *,
    .caixa-session-password-actions > * {
        width: 100%;
        text-align: center;
    }

    .painel-manual-collection {
        align-items: stretch;
        flex-direction: column;
    }

    .manual-collection-form input {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
