* { box-sizing: border-box; }
html { color-scheme: light dark; }
body { margin: 0; background: var(--canvas); color: var(--text); font: var(--body)/var(--body-leading) var(--font-family); letter-spacing: 0; }
a { color: var(--information); text-underline-offset: 3px; }
button, input, select { font: inherit; max-width: 100%; }
button, select, input { min-height: var(--touch-target); border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); color: var(--text); padding: var(--space-2); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip-link { position: fixed; top: var(--space-2); left: var(--space-2); padding: var(--space-3); background: var(--surface); transform: translateY(-180%); z-index: 20; }
.skip-link:focus { transform: none; }
.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; overflow-y: auto; padding: var(--space-6) var(--space-4); background: var(--primary-700); color: var(--white); }
.brand { display: block; font-size: var(--section-title); line-height: var(--section-leading); margin-bottom: var(--space-8); overflow-wrap: anywhere; }
.brand span { font-weight: 500; }
.sidebar nav { display: grid; gap: var(--space-1); }
.sidebar nav > * { display: flex; align-items: center; min-height: var(--touch-target); padding: var(--space-3); border-radius: var(--radius-control); color: var(--white); text-decoration: none; font-size: var(--compact); line-height: var(--compact-leading); overflow-wrap: anywhere; }
.sidebar a:hover, .sidebar [aria-current="page"] { background: var(--primary-600); }
.sidebar :focus-visible { outline-color: var(--white); }
.nav-unavailable { border-left: 2px solid transparent; }
.main-column { min-width: 0; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); min-height: 74px; padding: var(--space-3) var(--space-8); background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar > * { min-width: 0; overflow-wrap: anywhere; }
.topbar [data-region="global-search"] { flex: 1 1 160px; }
.topbar [data-region]:empty { display: none; }
.theme-control { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--compact); }
main { width: 100%; max-width: var(--content-max); margin-inline: auto; padding: var(--space-8); }
.breadcrumbs { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0; margin: 0 0 var(--space-6); color: var(--muted); font-size: var(--caption); }
h1 { margin: 0; font-size: var(--page-title); line-height: var(--page-leading); font-weight: 600; overflow-wrap: anywhere; }
.page-heading { padding-bottom: var(--space-6); border-bottom: 1px solid var(--border); }
.empty-state { padding-block: var(--space-12); color: var(--muted); }
.mobile-nav { display: none; }
@media (min-width: 768px) and (max-width: 1023px) {
    main { padding: var(--space-6); }
    .topbar { padding-inline: var(--space-6); }
}
@media (max-width: 767px) {
    .app-shell { display: block; }
    .sidebar { display: none; }
    main { padding: var(--space-4); padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
    .topbar { padding: var(--space-3) var(--space-4); gap: var(--space-3); }
    .mobile-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; inset: auto 0 0; z-index: 5; background: var(--surface); border-top: 1px solid var(--border); padding: var(--space-2) var(--space-1) calc(var(--space-2) + env(safe-area-inset-bottom)); }
    .mobile-nav:not(:has(a, span)) { display: none; }
    .mobile-nav > * { min-width: 0; min-height: var(--touch-target); display: grid; place-items: center; padding: var(--space-1); font-size: var(--caption); line-height: var(--caption-leading); text-align: center; overflow-wrap: anywhere; color: var(--text); text-decoration: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }

﻿html:not([data-theme="dark"]) body:not(.login-stage) {
    color-scheme: light;
    background: #f3f9fc;
    color: #173a54;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}
html:not([data-theme="dark"]) body:not(.login-stage) .app-shell { background: #f3f9fc; }
html:not([data-theme="dark"]) body:not(.login-stage) .sidebar {
    background: linear-gradient(180deg, #07344b, #052a3d);
    color: #e9f7ff;
}
html:not([data-theme="dark"]) body:not(.login-stage) .brand,
html:not([data-theme="dark"]) body:not(.login-stage) .sidebar a,
html:not([data-theme="dark"]) body:not(.login-stage) .sidebar .nav-unavailable { color: #d9eaf2; }
html:not([data-theme="dark"]) body:not(.login-stage) .sidebar a { border-radius: 10px; }
html:not([data-theme="dark"]) body:not(.login-stage) .sidebar a:hover,
html:not([data-theme="dark"]) body:not(.login-stage) .sidebar [aria-current="page"] {
    background: linear-gradient(100deg, #078eb8, #087aa5);
    color: #fff;
}
html:not([data-theme="dark"]) body:not(.login-stage) .nav-unavailable,
html:not([data-theme="dark"]) body:not(.login-stage) .nav-label {
    color: #7fa8bb;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
}
html:not([data-theme="dark"]) body:not(.login-stage) .side-foot { color: #14c0ce; }
html:not([data-theme="dark"]) body:not(.login-stage) .topbar {
    background: #ffffffee;
    border-bottom: 1px solid #e2edf4;
    color: #173a54;
}
html:not([data-theme="dark"]) body:not(.login-stage) .topbar button,
html:not([data-theme="dark"]) body:not(.login-stage) .topbar select {
    background: #fff;
    color: #173a54;
    border: 1px solid #d5e7f3;
    border-radius: 10px;
}
html:not([data-theme="dark"]) body:not(.login-stage) main { color: #173a54; }
html:not([data-theme="dark"]) body:not(.login-stage) h1,
html:not([data-theme="dark"]) body:not(.login-stage) h2,
html:not([data-theme="dark"]) body:not(.login-stage) h3,
html:not([data-theme="dark"]) body:not(.login-stage) h4 { color: #123f5a; }
html:not([data-theme="dark"]) body:not(.login-stage) .page-heading { border-bottom-color: #e2edf4; }
html:not([data-theme="dark"]) body:not(.login-stage) .page-heading p { display: none; }
html:not([data-theme="dark"]) body:not(.login-stage) .breadcrumbs { color: #7b94a7; }
html:not([data-theme="dark"]) body:not(.login-stage) .card {
    background: #fff;
    border: 1px solid #e6f0f6;
    border-radius: 18px;
    box-shadow: 0 10px 28px #1c54710f;
}
html:not([data-theme="dark"]) body:not(.login-stage) input,
html:not([data-theme="dark"]) body:not(.login-stage) select,
html:not([data-theme="dark"]) body:not(.login-stage) textarea {
    background: #fff;
    color: #173a54;
    border-color: #d5e7f3;
    border-radius: 12px;
}
html:not([data-theme="dark"]) body:not(.login-stage) .resource-list .search-bar button,
html:not([data-theme="dark"]) body:not(.login-stage) .query-form button,
html:not([data-theme="dark"]) body:not(.login-stage) .filters button,
html:not([data-theme="dark"]) body:not(.login-stage) .command-form button[type=submit],
html:not([data-theme="dark"]) body:not(.login-stage) .action-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(105deg, #0799b8, #078eb0);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
html:not([data-theme="dark"]) body:not(.login-stage) .data-table { border-collapse: separate; border-spacing: 0; }
html:not([data-theme="dark"]) body:not(.login-stage) .data-table th {
    color: #5d7c96;
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
    border-bottom: 1px solid #e2edf4;
}
html:not([data-theme="dark"]) body:not(.login-stage) .data-table td { border-bottom: 1px solid #eef4f8; color: #173a54; }
html:not([data-theme="dark"]) body:not(.login-stage) .data-table a { color: #078eb0; font-weight: 600; text-decoration: none; }
html:not([data-theme="dark"]) body:not(.login-stage) .resource-id { color: #8aa3b8; font-size: 11px; }
html:not([data-theme="dark"]) body:not(.login-stage) .badge {
    border: 0;
    border-radius: 999px;
    padding: 4px 10px;
    background: #e8f4f8;
    color: #17617d;
    font-size: 12px;
    font-weight: 600;
}
html:not([data-theme="dark"]) body:not(.login-stage) .badge-active,
html:not([data-theme="dark"]) body:not(.login-stage) .badge-activo { background: #e7f8f1; color: #0f7a52; }
html:not([data-theme="dark"]) body:not(.login-stage) .badge-inactive,
html:not([data-theme="dark"]) body:not(.login-stage) .badge-inactivo { background: #f3f4f6; color: #526070; }
html:not([data-theme="dark"]) body:not(.login-stage) .badge-draft,
html:not([data-theme="dark"]) body:not(.login-stage) .badge-rascunho { background: #fff6e8; color: #9a5b12; }
html:not([data-theme="dark"]) body:not(.login-stage) .badge-paused,
html:not([data-theme="dark"]) body:not(.login-stage) .badge-pausado { background: #eef4ff; color: #2450a8; }
html:not([data-theme="dark"]) body:not(.login-stage) .badge-archived,
html:not([data-theme="dark"]) body:not(.login-stage) .badge-arquivado,
html:not([data-theme="dark"]) body:not(.login-stage) .badge-cancelled,
html:not([data-theme="dark"]) body:not(.login-stage) .badge-expired,
html:not([data-theme="dark"]) body:not(.login-stage) .badge-suspended { background: #f4f1ee; color: #6b5848; }
html:not([data-theme="dark"]) body:not(.login-stage) .badge-scheduled,
html:not([data-theme="dark"]) body:not(.login-stage) .badge-in-progress { background: #eef4ff; color: #2450a8; }
html:not([data-theme="dark"]) body:not(.login-stage) .badge-completed { background: #e7f8f1; color: #0f7a52; }
html:not([data-theme="dark"]) body:not(.login-stage) .actions a {
    display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 14px;
    border: 1px solid #d5e7f3; border-radius: 10px; background: #fff; color: #173a54; font-weight: 600; text-decoration: none;
}
html:not([data-theme="dark"]) body:not(.login-stage) .command-form button.button-danger {
    background: #c84630; color: #fff;
}
.section-note { margin: 8px 0 12px; color: #5d7c96; font-size: 13px; }
html:not([data-theme="dark"]) body:not(.login-stage) .byte-hint { display: none; }
.nav-icon { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar { display: flex; flex-direction: column; }
.sidebar .brand, .topbar-brand { text-decoration: none; }
.sidebar .brand { display: flex; justify-content: flex-start; margin: 0 0 22px; padding: 4px 8px 0; background: none; }
.sidebar .brand img { width: min(100%, 200px); height: auto; display: block; }
.nav-label, .side-foot { margin: 0; }
.nav-label { padding: 0 12px 8px; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.side-foot { margin-top: auto; padding: 18px 12px 4px; font-size: 13px; font-weight: 700; }
.topbar-brand { display: none; align-items: center; }
.topbar-brand img { width: 34px; height: 34px; display: block; }
@media (max-width: 767px) {
    .sidebar { display: none; }
    .topbar { align-items: center; row-gap: 8px; }
    .topbar-brand { display: flex; flex: 1 1 120px; order: 1; }
    .topbar-brand img { width: 34px; height: 34px; }
    .topbar [data-region="company-selector"] { order: 2; margin-left: auto; }
    .profile-chip { order: 3; flex: 1 1 120px; }
    .theme-control { order: 4; }
    .topbar [data-region="help"] { order: 5; }
    .company-chip, .profile-chip { min-height: 36px; padding-inline: 8px; font-size: 12px; }
    .company-chip { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .profile-chip { min-width: 0; }
    .profile-chip span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .theme-control { font-size: 0; gap: 6px; }
    .theme-control select { font-size: 13px; }
    .mobile-nav {
        background: #07344b; border-top: 0; color: #d9eaf2;
        width: 100%; box-sizing: border-box;
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
    .mobile-nav > * { min-width: 0; max-width: 100%; overflow: hidden; }
    .mobile-nav a, .mobile-nav span { color: #d9eaf2; gap: 4px; font-size: 10px; line-height: 1.15; }
    .mobile-nav .nav-icon { width: 18px; height: 18px; }
    .mobile-nav [aria-current="page"] { color: #fff; background: #078eb8; border-radius: 12px; }
    main { padding-bottom: calc(136px + env(safe-area-inset-bottom)); }
    .filters { grid-template-columns: 1fr; }
    .filters button { width: 100%; }
}
.sidebar nav a { gap: 10px; }
.logout-form { margin: 0; }
.logout-form button { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.company-chip, .profile-chip, .today {
    display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px;
    border: 1px solid #d5e7f3; border-radius: 12px; background: #fff; color: #173a54; font-size: 13px;
}
@media (max-width: 767px) {
    .today { display: none; }
}
.avatar {
    width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%;
    background: linear-gradient(135deg, #0799b8, #104461); color: #fff; font-size: 13px; font-weight: 700;
}
.breadcrumbs li:not(:last-child)::after { content: "›"; margin-left: 8px; color: #9bb4c9; }
html:not([data-theme="dark"]) body:not(.login-stage) .data-table tbody tr:hover { background: #f7fbfd; }
html:not([data-theme="dark"]) body:not(.login-stage) .logout-form button { background: #fff; color: #104461; }
.card { margin-block: var(--space-6); padding: var(--space-6); border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); min-width: 0; overflow-wrap: anywhere; }
.card h2 { margin-top: 0; }
.card h3, .card h4 { margin: 18px 0 8px; font-size: 15px; line-height: 1.3; }
.field { display: grid; gap: var(--space-2); margin-bottom: var(--space-4); min-width: 0; }
.field label { font-weight: 600; }
.field small, .resource-id { color: var(--muted); font-size: var(--caption); }
.field input, .field select, .field textarea { width: 100%; }
textarea { font: inherit; max-width: 100%; min-height: 100px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); color: var(--text); padding: var(--space-2); }
.command-form { border-block-end: 1px solid var(--border); padding-block: var(--space-4); margin-bottom: var(--space-4); max-width: 780px; }
.command-form button[type=submit] { background: var(--primary-700); color: var(--white); font-weight: 600; cursor: pointer; }
html:not([data-theme="dark"]) body:not(.login-stage) .command-form button.button-secondary,
html:not([data-theme="dark"]) body:not(.login-stage) .command-form button[type=button] {
    display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 14px;
    border: 1px solid #d5e7f3; border-radius: 10px; background: #fff; color: #173a54; font-weight: 600; cursor: pointer;
}
.command-form button:disabled { opacity: .7; cursor: wait; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); margin-block: var(--space-4); }
.actions a { display: inline-flex; min-height: var(--touch-target); align-items: center; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: var(--space-4); margin-block: var(--space-6); }
.kpi-card { min-width: 0; padding: var(--space-4) var(--space-6); border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); }
.kpi-label { margin: 0; color: var(--muted); font-size: var(--caption); font-weight: 600; overflow-wrap: anywhere; }
.kpi-value { margin: var(--space-2) 0 0; color: var(--text); font-size: 28px; line-height: 34px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-card { border-top: 3px solid var(--primary-700); }
html:not([data-theme="dark"]) body:not(.login-stage) .kpi-card {
    background: #fff;
    border: 1px solid #e6f0f6;
    border-top: 3px solid #078eb8;
    border-radius: 18px;
    box-shadow: 0 10px 28px #1c54710f;
}
html:not([data-theme="dark"]) body:not(.login-stage) .kpi-label { color: #5d7c96; }
html:not([data-theme="dark"]) body:not(.login-stage) .kpi-value { color: #173a54; }
.record-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: var(--space-4); padding-block-end: var(--space-4); }
.record-fields div { min-width: 0; }
.record-fields dt { font-size: var(--caption); color: var(--muted); }
.record-fields dd { margin: var(--space-1) 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.notice { padding: var(--space-4); background: var(--surface); border: 2px solid var(--information); border-radius: var(--radius-control); }
.notice-error { border-color: var(--danger); }
.notice h2 { font-size: var(--section-title); }
.toast {
    position: fixed; top: 16px; right: 16px; z-index: 1000; box-sizing: border-box; max-width: min(420px, calc(100vw - 32px));
    margin: 0; padding: 12px 16px; border: 1px solid; border-radius: 14px; box-shadow: 0 10px 28px #0b2c3f1f;
    font-size: 14px; line-height: 1.45; animation: toast-in .35s ease-out, toast-hide 8s forwards;
}
.toast h2 { margin: 0 0 4px; font-size: 14px; line-height: 1.3; }
.toast p { margin: 0; }
.toast a { color: inherit; font-weight: 600; }
.toast-ok { background: #e7f8f1; border-color: #a7e3c8; color: #0f7a52; pointer-events: none; }
.toast-error { background: #fff1f2; border-color: #fecdd3; color: #9f1239; animation: toast-in .35s ease-out, toast-hide 15s forwards; }
@keyframes toast-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: none; }
}
@keyframes toast-hide {
    0%, 85% { opacity: 1; visibility: visible; }
    100% { opacity: 0; visibility: hidden; }
}
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); align-items: end; gap: var(--space-4); }
.table-scroll { overflow-x: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: var(--space-3); border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; min-width: 140px; overflow-wrap: anywhere; }
.resource-id { display: block; margin-top: var(--space-2); }
.badge { display: inline-block; padding: var(--space-1) var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-control); }
fieldset { min-width: 0; border: 1px solid var(--border); margin: var(--space-4) 0; padding: var(--space-4); }
.confirmation { display: flex; align-items: center; gap: var(--space-3); margin-block: var(--space-3); }
.permission-catalogue { min-width: 0; margin-block: var(--space-4); padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-control); }
.permission-catalogue legend { font-weight: 600; }
.permission-category, .permission-preset { margin-block: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-control); }
.permission-category summary, .permission-preset summary { cursor: pointer; min-height: 32px; font-weight: 600; }
.permission-count { display: inline-block; margin-inline-start: 8px; color: var(--muted); font-size: var(--caption); font-weight: 400; }
.permission-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 8px 16px; margin-top: 12px; }
.permission-options .confirmation { margin: 0; min-height: 44px; }
.permission-options input[type=checkbox] { flex: 0 0 auto; width: 20px; height: 20px; }
.permission-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 12px; }
.permission-catalogue [hidden] { display: none; }
.permission-granted { padding-block: 8px; }
.historic-record { border-inline-start: 3px solid var(--information); padding-inline-start: var(--space-4); margin-top: var(--space-6); }
.history-list li { padding-block: var(--space-2); }
body.login-stage {
    color-scheme: light;
    min-height: 100dvh;
    margin: 0;
    color: #104461;
    background: #eaf7fc;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}
body.login-stage main.login-page {
    width: 100%;
    max-width: none;
    min-height: 100dvh;
    margin: 0;
    display: grid;
    place-items: center;
    padding: clamp(24px, 4vw, 48px);
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: linear-gradient(120deg, #e8f6fb, #f8fcfe 54%, #f1f9fc);
}
body.login-stage main.login-page:before,
body.login-stage main.login-page:after { content: ""; position: absolute; z-index: -1; pointer-events: none; }
body.login-stage main.login-page:before {
    width: min(34vw, 420px); height: min(34vw, 420px); left: -6vw; top: -8vw;
    border-radius: 50%; background: radial-gradient(circle, #ffffff80, transparent 72%);
}
body.login-stage main.login-page:after {
    width: min(62vw, 720px); height: min(22vw, 220px); left: -4vw; bottom: -8vw;
    border-radius: 50%; background: linear-gradient(120deg, #9ad9ec33, transparent 72%);
}
body.login-stage .login-composition {
    width: min(100%, 920px);
    display: grid;
    grid-template-columns: minmax(280px, 380px) minmax(0, 440px);
    align-items: center;
    justify-content: center;
    gap: 36px;
    position: relative;
    z-index: 1;
}
body.login-stage .brand {
    display: flex; justify-content: flex-end; margin: 0; padding: 0;
    background: none; color: inherit; font-size: inherit; line-height: inherit;
}
body.login-stage .brand img { width: min(100%, 360px); max-width: 100%; height: auto; display: block; }
body.login-stage .login-card {
    width: 100%; max-width: 440px; justify-self: start; padding: 32px 32px 22px;
    background: #ffffffe0; border: 1px solid #ffffffeB; border-radius: 25px;
    box-shadow: 0 18px 42px #24698b2e, 0 3px 12px #2363800d;
}
body.login-stage h1 {
    margin: 0; color: #123f5a; font-size: 32px; letter-spacing: -0.6px;
    line-height: 1.15; font-weight: 700;
}
body.login-stage .intro { margin: 8px 0 28px; color: #5d7c96; font-size: 15px; line-height: 1.5; }
body.login-stage .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;
}
body.login-stage .login-form { max-width: none; margin: 0; padding: 0; border: 0; }
body.login-stage .login-recover { margin: 8px 0 0; color: #5d7c96; font-size: 14px; }
body.login-stage .login-recover summary { cursor: pointer; }
body.login-stage .recover-form { margin-top: 16px; padding: 0; border: 0; }
body.login-stage .credential {
    position: relative; height: 60px; display: flex; align-items: center; gap: 18px;
    border: 1.5px solid #d5e7f3; border-radius: 13px; padding: 0 18px; margin-bottom: 16px; background: #ffffff6b;
}
body.login-stage .credential:focus-within { border-color: #65bfd8; background: #fff; box-shadow: 0 0 0 4px #0799b814; }
body.login-stage .credential svg, body.login-stage .submit svg {
    width: 22px; height: 22px; flex: 0 0 22px; fill: none; stroke: #164a68; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
}
body.login-stage .credential input {
    width: 100%; min-width: 0; min-height: 0; border: 0; outline: 0; background: transparent;
    color: #17435e; padding: 0; font-size: clamp(14px, 1.2vw, 18px);
}
body.login-stage .credential input::placeholder { color: #9bb4c9; opacity: 1; }
body.login-stage .toggle {
    min-height: 0; padding: 5px 0 5px 8px; border: 0; background: transparent; color: #164a68; cursor: pointer;
}
body.login-stage .submit {
    width: 100%; min-height: 60px; margin-top: 8px; border: 0; border-radius: 13px;
    background: linear-gradient(105deg, #0799b8, #0797b8); color: #fff; font-weight: 600;
    font-size: clamp(16px, 1.4vw, 20px); display: flex; align-items: center; justify-content: center; gap: 15px;
    cursor: pointer; box-shadow: 0 6px 14px #008eb112;
}
body.login-stage .submit svg { stroke: #fff; }
body.login-stage .submit:hover { filter: brightness(1.04); }
body.login-stage .login-footer {
    border-top: 1px solid #e4eff5; margin-top: 28px; padding-top: 16px; text-align: center; color: #8aa3b8; font-size: 12px; line-height: 1.55; letter-spacing: 0.1px;
}
body.login-stage .login-alert {
    display: flex; align-items: flex-start; gap: 12px; margin: 0 0 18px; padding: 12px 14px;
    border: 1px solid #fecdd3; border-radius: 14px; background: #fff1f2; color: #9f1239;
}
body.login-stage .login-alert[hidden] { display: none; }
body.login-stage .login-alert svg {
    width: 20px; height: 20px; flex: 0 0 20px; margin-top: 1px; fill: none; stroke: #e11d48;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
body.login-stage .login-alert strong { display: block; margin-bottom: 2px; color: #9f1239; font-size: 14px; line-height: 1.3; }
body.login-stage .login-alert p { margin: 0; color: #be123c; font-size: 13px; line-height: 1.45; }
body.login-stage .login-alert-ok {
    position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 1000; box-sizing: border-box;
    width: min(420px, calc(100vw - 32px)); margin: 0; border-color: #a7e3c8; background: #e7f8f1; color: #0f7a52;
    pointer-events: none; animation: toast-hide 8s forwards;
}
body.login-stage .login-alert-ok svg { stroke: #0f7a52; }
body.login-stage .login-alert-ok strong { color: #0f7a52; }
body.login-stage .login-alert-ok p { color: #17805a; }
body.login-stage .credential.is-invalid { border-color: #fb7185; background: #fff; box-shadow: 0 0 0 4px #e11d4814; }
@media (min-width: 768px) and (max-width: 900px) {
    body.login-stage .login-composition { width: 100%; grid-template-columns: minmax(190px, 230px) minmax(0, 1fr); gap: 20px; }
    body.login-stage .brand img { width: min(100%, 220px); }
    body.login-stage .login-card { padding: 26px 22px 18px; }
}
.sidebar .nav-unavailable { font-weight: 600; min-height: 0; margin-top: var(--space-4); padding-block: var(--space-2); }
.resource-list .list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.resource-list .list-toolbar h2 { margin: 0; }
.resource-list .search-bar { display: flex; align-items: end; gap: 12px; margin-top: 18px; }
.resource-list .search-field, .resource-list .search-status { display: grid; gap: 6px; min-width: 0; color: #5d7c96; font-size: 12px; font-weight: 600; }
.resource-list .search-field { position: relative; flex: 1 1 280px; }
.resource-list .search-status { flex: 0 1 180px; }
.resource-list .search-field svg { position: absolute; left: 14px; bottom: 13px; width: 18px; height: 18px; fill: none; stroke: #7191a8; stroke-width: 1.8; stroke-linecap: round; }
.resource-list .search-field input, .resource-list .search-status select { width: 100%; min-height: 44px; border: 1px solid #d5e7f3; border-radius: 12px; background: #eff7fb; color: #173a54; }
.resource-list .search-field input { padding: 0 14px 0 42px; }
.resource-list .search-field input:focus, .resource-list .search-status select:focus { background: #fff; border-color: #9fd5e8; }
.resource-list .search-bar button { flex: 0 0 auto; }
.resource-list .person-name a { font-size: 16px; font-weight: 700; }
.resource-list .person-reference { font-weight: 600; }
.resource-list .resource-id { display: block; margin-top: 2px; font-size: 11px; }
.resource-list time { white-space: nowrap; }
.resource-list .empty-state { margin: 12px 0 0; padding: 18px; border: 1px dashed #d5e7f3; border-radius: 12px; background: #f7fbfd; color: #5d7c96; }
@media (max-width: 1023px) {
    .resource-list .search-bar { flex-wrap: wrap; }
    .resource-list .search-field, .resource-list .search-status, .resource-list .search-bar button { flex: 1 1 100%; }
}
@media (max-width: 767px) {
    .resource-list .list-toolbar { align-items: stretch; flex-direction: column; }
    .resource-list .list-toolbar .action-primary { width: 100%; }
    .resource-list .table-scroll { overflow: visible; }
    .resource-list .data-table { min-width: 0; }
    .resource-list .data-table thead { display: none; }
    .resource-list .data-table, .resource-list .data-table tbody, .resource-list .data-table tr, .resource-list .data-table td { display: block; width: 100%; min-width: 0; }
    .resource-list .data-table tr { display: flex; flex-direction: column; padding: 14px 0; border-bottom: 1px solid #eef4f8; }
    .resource-list .data-table td { border: 0; padding: 3px 0; }
    .resource-list .data-table td::before { content: attr(data-label); display: block; margin-bottom: 2px; color: #5d7c96; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
    .resource-list .person-name { order: -1; }
    .resource-list .person-name::before { display: none; }
    .resource-list time { white-space: normal; }
}
@media (max-width: 767px) {
    .card { padding: var(--space-4); }
    .mobile-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    body.login-stage main.login-page { padding: 28px 16px; overflow-y: auto; }
    body.login-stage .login-composition { grid-template-columns: 1fr; gap: 18px; justify-items: center; }
    body.login-stage .brand { justify-content: center; }
    body.login-stage .brand img { width: min(280px, 74vw); }
    body.login-stage .login-card { max-width: 440px; justify-self: center; padding: 25px 20px 20px; border-radius: 20px; }
    body.login-stage h1 { font-size: 26px; }
    body.login-stage .credential, body.login-stage .submit { height: 52px; min-height: 52px; }
}
@media (min-width: 1024px) {
    .app-shell { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
    .app-shell > .sidebar { display: flex; }
    nav.mobile-nav { display: none; }
}
@media (min-width: 768px) and (max-width: 1023px) {
    .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
    .app-shell > .sidebar { display: flex; padding-inline: 12px; }
    .side-foot { display: none; }
    nav.mobile-nav { display: none; }
    main { padding: var(--space-6); }
    .topbar { padding-inline: var(--space-6); }
    .resource-list .list-toolbar { min-height: 44px; }
    .query-search .search-field { height: 44px; }
    body:not(.login-stage) .table-scroll:has(th:nth-child(5)) { overflow-x: hidden; }
    body:not(.login-stage) .data-table:has(th:nth-child(5)) { width: 100%; table-layout: fixed; }
    body:not(.login-stage) .data-table:has(th:nth-child(5)) th,
    body:not(.login-stage) .data-table:has(th:nth-child(5)) td { min-width: 0; overflow-wrap: anywhere; }
    body:not(.login-stage) .data-table:has(th:nth-child(5)) time { white-space: normal; }
    body:not(.login-stage) main button,
    body:not(.login-stage) main select,
    body:not(.login-stage) main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    body:not(.login-stage) main .action-primary,
    body:not(.login-stage) main .actions a,
    body:not(.login-stage) main .filter-toggle-label {
        height: 44px; min-height: 44px;
    }
}
@media (max-width: 767px) {
    .app-shell { display: block; }
    .app-shell > .sidebar { display: none; }
    nav.mobile-nav {
        display: grid;
        position: fixed;
        inset: auto 0 0;
        z-index: 20;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: stretch;
        width: 100%;
        box-sizing: border-box;
        background: #07344b;
        color: #d9eaf2;
        border-top: 0;
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    }
    nav.mobile-nav > a,
    .mobile-more > summary {
        display: grid;
        place-items: center;
        align-content: center;
        gap: 4px;
        min-width: 0;
        min-height: 52px;
        margin: 0;
        padding: 4px 2px;
        color: #d9eaf2;
        font-size: 9px;
        line-height: 1.1;
        text-align: center;
        text-decoration: none;
    }
    .mobile-more > summary { list-style: none; cursor: pointer; }
    .mobile-more > summary::-webkit-details-marker { display: none; }
    .mobile-more > summary::marker { content: ""; }
    nav.mobile-nav > a span,
    .mobile-more > summary span {
        max-width: 100%;
        overflow: hidden;
        letter-spacing: -0.03em;
        text-overflow: clip;
        white-space: nowrap;
    }
    nav.mobile-nav > a[aria-current="page"],
    .mobile-more[open] > summary,
    .mobile-more.is-current > summary {
        color: #fff;
        background: #078eb8;
        border-radius: 12px;
    }
    .mobile-more-panel {
        position: fixed;
        z-index: 21;
        right: 8px;
        bottom: calc(72px + env(safe-area-inset-bottom));
        width: min(280px, calc(100vw - 16px));
        display: grid;
        gap: 4px;
        padding: 8px;
        border-radius: 16px;
        background: #0b3d56;
        box-shadow: 0 16px 40px rgba(7, 28, 42, .28);
    }
    .mobile-more-panel a {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        min-height: 44px;
        padding: 0 12px;
        border-radius: 10px;
        color: #d9eaf2;
        font-size: 14px;
        line-height: 1.2;
        text-align: left;
        text-decoration: none;
        white-space: normal;
    }
    .mobile-more-panel a[aria-current="page"] { color: #fff; background: #078eb8; }
}
body:not(.login-stage) .topbar { min-height: 40px; gap: 6px; padding: 4px 20px; }
body:not(.login-stage) .company-chip,
body:not(.login-stage) .profile-chip,
body:not(.login-stage) .today,
body:not(.login-stage) .logout-form button,
body:not(.login-stage) .theme-control select {
    height: 28px; min-height: 28px; padding-block: 0; line-height: 26px;
}
body:not(.login-stage) .profile-chip .avatar { width: 22px; height: 22px; font-size: 11px; }
body:not(.login-stage) .theme-control { gap: 6px; }
body:not(.login-stage) main { padding: 10px 28px 24px; }
body:not(.login-stage) .breadcrumbs { margin: 0 0 4px; }
body:not(.login-stage) .page-heading { padding-bottom: 10px; }
body:not(.login-stage) .card { margin-block: 12px; padding: 16px 18px; }
body:not(.login-stage) .field { gap: 6px; margin-bottom: 12px; }
body:not(.login-stage) .command-form { padding-block: 12px; margin-bottom: 12px; }
body:not(.login-stage) .actions { gap: 12px; margin-block: 12px; }
body:not(.login-stage) .record-fields { gap: 12px; padding-block-end: 8px; }
body:not(.login-stage) th,
body:not(.login-stage) td { padding: 8px 12px; }
body:not(.login-stage) .resource-list .list-toolbar { gap: 12px; }
body:not(.login-stage) .resource-list .search-bar { margin-top: 12px; gap: 10px; }
body:not(.login-stage) fieldset { margin: 12px 0; padding: 12px; }
@media (min-width: 768px) {
    html:not([data-theme="dark"]) body:not(.login-stage) button,
    html:not([data-theme="dark"]) body:not(.login-stage) select,
    html:not([data-theme="dark"]) body:not(.login-stage) input:not([type="checkbox"]):not([type="radio"]) { min-height: 36px; }
    html:not([data-theme="dark"]) body:not(.login-stage) .resource-list .search-field input,
    html:not([data-theme="dark"]) body:not(.login-stage) .resource-list .search-status select,
    html:not([data-theme="dark"]) body:not(.login-stage) .resource-list .search-bar button,
    html:not([data-theme="dark"]) body:not(.login-stage) .filters button,
    html:not([data-theme="dark"]) body:not(.login-stage) .command-form button[type="submit"],
    html:not([data-theme="dark"]) body:not(.login-stage) .command-form button.button-secondary,
    html:not([data-theme="dark"]) body:not(.login-stage) .command-form button[type=button],
    html:not([data-theme="dark"]) body:not(.login-stage) .action-primary,
    html:not([data-theme="dark"]) body:not(.login-stage) .actions a { min-height: 36px; }
    body:not(.login-stage) .confirmation input {
        width: 16px; height: 16px; min-height: 16px; max-height: 16px; padding: 0; flex: 0 0 16px;
    }
    html:not([data-theme="dark"]) body:not(.login-stage) button,
    html:not([data-theme="dark"]) body:not(.login-stage) select,
    html:not([data-theme="dark"]) body:not(.login-stage) input:not([type="checkbox"]):not([type="radio"]) { padding-block: 0; }
}
@media (max-width: 767px) {
    body:not(.login-stage) .topbar { min-height: 0; gap: 4px; row-gap: 4px; padding: 4px 10px; }
    body:not(.login-stage) .topbar-brand img { width: 34px; height: 34px; }
    body:not(.login-stage) .company-chip,
    body:not(.login-stage) .profile-chip,
    body:not(.login-stage) .logout-form button,
    body:not(.login-stage) .theme-control select { min-height: 36px; }
    body:not(.login-stage) main { padding: 6px 12px calc(104px + env(safe-area-inset-bottom)); }
    body:not(.login-stage) .card { margin-block: 10px; padding: 12px 14px; }
    body:not(.login-stage) .resource-list .search-bar { margin-top: 10px; gap: 8px; }
    body:not(.login-stage) button,
    body:not(.login-stage) select,
    body:not(.login-stage) input:not([type="checkbox"]):not([type="radio"]),
    body:not(.login-stage) .action-primary,
    body:not(.login-stage) .resource-list .search-bar button,
    body:not(.login-stage) .filters button,
    body:not(.login-stage) .resource-list .search-field input,
    body:not(.login-stage) .resource-list .search-status select,
    html:not([data-theme="dark"]) body:not(.login-stage) .actions a { min-height: 44px; }
    body:not(.login-stage) .logout-form button,
    body:not(.login-stage) .theme-control select,
    body:not(.login-stage) .company-chip,
    body:not(.login-stage) .profile-chip { height: 28px; min-height: 28px; padding-block: 0; }
    body:not(.login-stage) .confirmation input {
        width: 16px; height: 16px; min-height: 16px; max-height: 16px; padding: 0; flex: 0 0 16px;
    }
    body:not(.login-stage) { overflow-x: hidden; }
    body:not(.login-stage) .app-shell,
    body:not(.login-stage) .main-column,
    body:not(.login-stage) main,
    body:not(.login-stage) .card,
    body:not(.login-stage) .filters,
    body:not(.login-stage) .topbar,
    body:not(.login-stage) .table-scroll { width: 100%; max-width: 100%; min-width: 0; }
    body:not(.login-stage) .table-scroll { overflow: visible; }
    body:not(.login-stage) .data-table { width: 100%; min-width: 0; }
    body:not(.login-stage) th,
    body:not(.login-stage) td { min-width: 0; max-width: 100%; }
    body:not(.login-stage) .data-table thead { display: none; }
    body:not(.login-stage) .data-table,
    body:not(.login-stage) .data-table tbody,
    body:not(.login-stage) .data-table tr,
    body:not(.login-stage) .data-table td { display: block; width: 100%; min-width: 0; }
    body:not(.login-stage) .data-table tr { display: flex; flex-direction: column; padding: 12px 0; border-bottom: 1px solid #eef4f8; }
    body:not(.login-stage) .data-table td { border: 0; padding: 3px 0; overflow-wrap: anywhere; }
    body:not(.login-stage) .data-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 2px;
        color: #5d7c96;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
    }
    body:not(.login-stage) .person-name { order: -1; }
    body:not(.login-stage) .person-name::before { display: none; }
    body:not(.login-stage) .filters { grid-template-columns: 1fr; }
    body:not(.login-stage) .filters button,
    body:not(.login-stage) .actions,
    body:not(.login-stage) .actions a { max-width: 100%; }
}
.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;
}
.query-form { display: grid; gap: 8px; margin-top: 8px; }
.query-search { display: grid; gap: 8px; }
.query-search .search-field { position: relative; min-width: 0; }
.query-search input,
.query-search button,
.filter-toggle-label {
    width: 100%;
    border-radius: 12px;
}
.filter-drawer { border: 1px solid #d5e7f3; border-radius: 12px; background: #fff; }
.filter-toggle {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.filter-toggle-label {
    display: flex; align-items: center; justify-content: space-between;
    min-height: 44px; padding: 0 14px; cursor: pointer; font-weight: 600; color: #173a54;
}
.filter-toggle-label::after {
    content: ""; width: 8px; height: 8px; border-right: 2px solid #5d7c96; border-bottom: 2px solid #5d7c96;
    transform: rotate(45deg); margin-top: -4px;
}
.filter-toggle:checked ~ .filter-toggle-label::after { transform: rotate(225deg); margin-top: 4px; }
.filter-panel { display: none; }
.filter-toggle:checked ~ .filter-panel { display: grid; gap: 8px; padding: 0 12px 12px; }
.filter-panel .field { margin-bottom: 0; }
.filter-panel button { width: 100%; }
@media (min-width: 768px) {
    .query-search { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
    .query-search button { width: auto; min-width: 120px; }
    .filter-toggle-label { min-height: 36px; }
}
@media (min-width: 1024px) {
    .resource-list .list-toolbar { min-height: 40px; }
    .query-form { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
    .query-search,
    .filter-drawer,
    .query-form .filter-panel,
    .filter-toggle:checked ~ .filter-panel { display: contents; }
    .filter-toggle,
    .filter-toggle-label { display: none; }
    .query-search .search-field { order: 1; display: block; height: 40px; flex: 1 1 280px; min-width: 220px; align-self: center; }
    .query-search .search-field svg { top: 50%; bottom: auto; width: 16px; height: 16px; transform: translateY(-50%); }
        body:not(.login-stage) .filter-panel .field { order: 2; display: flex; align-items: center; align-self: center; flex: 0 0 auto; height: 40px; margin: 0; }
        .query-form select,
        .query-form input:not([type="checkbox"]),
        .query-search button,
        .filter-panel > button { margin: 0; align-self: center; }
    .filter-panel .field > span,
    .filter-panel .field > label {
        position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0);
    }
    .filter-panel select { width: 148px; }
    .filter-panel input[name="taxCountry"] { width: 72px; text-align: center; }
    .filter-panel input[name="tax"] { width: 156px; }
    .query-search button,
    .filter-panel > button { order: 3; width: auto; min-width: 112px; }
    html:not([data-theme="dark"]) body:not(.login-stage) .query-form:has(.query-search) .filter-panel > button { display: none; }
    html:not([data-theme="dark"]) body:not(.login-stage) .query-form input:not([type="checkbox"]),
    html:not([data-theme="dark"]) body:not(.login-stage) .query-form select,
    html:not([data-theme="dark"]) body:not(.login-stage) .query-form button,
    html:not([data-theme="dark"]) body:not(.login-stage) .action-primary,
    html:not([data-theme="dark"]) body:not(.login-stage) .actions a,
    html:not([data-theme="dark"]) body:not(.login-stage) .command-form button[type="submit"],
    html:not([data-theme="dark"]) body:not(.login-stage) .command-form button.button-secondary,
    html:not([data-theme="dark"]) body:not(.login-stage) .command-form button[type=button],
    html:not([data-theme="dark"]) body:not(.login-stage) .command-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    html:not([data-theme="dark"]) body:not(.login-stage) .command-form select,
    html[data-theme="dark"] body:not(.login-stage) .query-form input:not([type="checkbox"]),
    html[data-theme="dark"] body:not(.login-stage) .query-form select,
    html[data-theme="dark"] body:not(.login-stage) .query-form button,
    html[data-theme="dark"] body:not(.login-stage) .action-primary,
    html[data-theme="dark"] body:not(.login-stage) .actions a,
    html[data-theme="dark"] body:not(.login-stage) .command-form button[type="submit"],
    html[data-theme="dark"] body:not(.login-stage) .command-form button.button-secondary,
    html[data-theme="dark"] body:not(.login-stage) .command-form button[type=button],
    html[data-theme="dark"] body:not(.login-stage) .command-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    html[data-theme="dark"] body:not(.login-stage) .command-form select {
        height: 40px; min-height: 40px;
    }
    .query-form input:not([type="checkbox"]),
    .query-form select { border-radius: 10px; }
    body:not(.login-stage) .topbar {
        flex-wrap: nowrap; height: 74px; min-height: 74px; gap: 18px; padding: 0 28px;
    }
    body:not(.login-stage) .topbar [data-region="company-selector"] { display: none; }
    body:not(.login-stage) .topbar [data-region="help"] { margin-left: auto; }
    body:not(.login-stage) .logout-form button {
        width: 40px; height: 40px; min-height: 40px; padding: 0; justify-content: center;
    }
    body:not(.login-stage) .logout-form button span {
        position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0);
    }
    body:not(.login-stage) .theme-control { gap: 0; font-size: 0; }
    body:not(.login-stage) .theme-control select { width: 112px; height: 40px; min-height: 40px; font-size: 12px; }
    body:not(.login-stage) .today,
    body:not(.login-stage) .profile-chip {
        height: auto; min-height: 40px; border: 0; border-radius: 0; background: transparent;
        border-left: 1px solid #e2edf4; padding-left: 16px;
    }
    body:not(.login-stage) .today { display: flex; flex-direction: column; justify-content: center; line-height: 1.15; font-weight: 700; }
    body:not(.login-stage) .today small,
    body:not(.login-stage) .profile-copy small { color: #7b94a7; font-size: 11px; font-weight: 500; }
    body:not(.login-stage) .profile-chip { gap: 10px; }
    body:not(.login-stage) .profile-copy { display: grid; line-height: 1.15; }
    body:not(.login-stage) .profile-copy b { font-size: 13px; font-weight: 700; }
    body:not(.login-stage) .profile-chip .avatar { width: 36px; height: 36px; font-size: 14px; }
}
