:root {
    --navy: #315d78;
    --navy-dark: #234963;
    --cyan: #2397b5;
    --page: #eef5f8;
    --line: #c9d8e1;
    --text: #17364a;
    --muted: #607789;
    --danger: #a83636;
    --success: #176a49;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #f7fbfd 0%, var(--page) 100%);
    color: var(--text);
    font-family: "Segoe UI", Arial, sans-serif;
}

.topbar, .bottombar { background: var(--navy); color: white; }
.topbar {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 22px;
    gap: 24px;
}
.brand-logo { width: 184px; height: 42px; object-fit: contain; object-position: left center; }
.topbar-label { font-weight: 600; }
.bottombar { min-height: 58px; display: grid; place-items: center; padding: 12px; font-size: 14px; }

.page-center, .setup-wrap, .dashboard-wrap {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 48px 20px;
}
.card, .welcome-card {
    position: relative;
    width: min(100%, 460px);
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(31, 65, 86, .13);
    padding: 38px 36px 32px;
}
.card-accent { position: absolute; inset: 0 0 auto; height: 5px; border-radius: 8px 8px 0 0; background: var(--cyan); }
h1 { margin: 0 0 8px; font-size: clamp(27px, 5vw, 36px); text-align: center; }
h2 { margin: 8px 0; }
.subtitle { margin: 0 0 26px; color: var(--muted); text-align: center; }
label { display: block; margin: 17px 0 7px; font-weight: 700; }
.login-card label { font-weight: 400; }
input, select {
    width: 100%;
    min-height: 45px;
    border: 1px solid #b9cbd6;
    border-radius: 5px;
    padding: 10px 12px;
    background: white;
    color: var(--text);
    font: inherit;
}
input:focus, select:focus { outline: 3px solid rgba(35,151,181,.18); border-color: var(--cyan); }
.lockable-field { position: relative; }
.lockable-field input { padding-right: 52px; }
.lockable-field input.is-login-locked { background: #f2f7fa; color: var(--navy-dark); font-weight: 400; }
.field-lock,
.field-lock:hover {
    position: absolute;
    top: 50%;
    right: 4px;
    width: 38px;
    min-height: 37px;
    margin: 0;
    padding: 0;
    transform: translateY(-50%);
    border-left: 1px solid #d4e0e7;
    border-radius: 0 4px 4px 0;
    background: transparent;
    color: #78909f;
}
.field-lock:focus-visible { outline: 3px solid rgba(35,151,181,.24); outline-offset: 1px; }
.field-lock span { position: relative; width: 14px; height: 12px; margin-top: 5px; border: 2px solid currentColor; border-radius: 2px; }
.field-lock span::before {
    content: "";
    position: absolute;
    left: 1px;
    top: -9px;
    width: 8px;
    height: 8px;
    border: 2px solid currentColor;
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    transform: translateX(3px) rotate(27deg);
    transform-origin: left bottom;
}
.field-lock.is-locked { color: var(--navy); background: #e9f2f7; }
.field-lock.is-locked span::before { transform: none; }
.password-field { position: relative; }
.password-field input { padding-right: 52px; }
.password-visibility,
.password-visibility:hover {
    position: absolute;
    top: 50%;
    right: 4px;
    width: 38px;
    min-height: 37px;
    margin: 0;
    padding: 0;
    transform: translateY(-50%);
    border-left: 1px solid #d4e0e7;
    border-radius: 0 4px 4px 0;
    background: transparent;
    color: #78909f;
}
.password-visibility:focus-visible { outline: 3px solid rgba(35,151,181,.24); outline-offset: 1px; }
.password-eye {
    position: relative;
    width: 17px;
    height: 17px;
    border: 2px solid currentColor;
    border-radius: 75% 15%;
    transform: rotate(45deg);
}
.password-eye::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: currentColor;
}
.password-visibility::after {
    content: "";
    position: absolute;
    width: 23px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transform: rotate(45deg);
    box-shadow: 0 0 0 2px white;
}
.password-visibility.is-visible { color: var(--navy); background: #e9f2f7; }
.password-visibility.is-visible::after { display: none; }
.login-lock-note { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; text-align: center; }
button, .button-link {
    width: 100%;
    min-height: 47px;
    margin-top: 24px;
    border: 0;
    border-radius: 5px;
    background: var(--cyan);
    color: white;
    font: 700 16px/1 "Segoe UI", Arial, sans-serif;
    cursor: pointer;
    text-decoration: none;
    display: inline-grid;
    place-items: center;
}
button:hover, .button-link:hover { background: #167f9d; }
.test-note { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid #dbe5eb; color: var(--muted); text-align: center; font-size: 13px; }
.message { margin: 18px 0; border-radius: 5px; padding: 12px 14px; font-weight: 600; }
.message.error { background: #fff0f0; border: 1px solid #ecc5c5; color: var(--danger); }
.message.success { background: #eefaf4; border: 1px solid #bfe1cf; color: var(--success); }
.privacy-note { margin: 18px 0; padding: 14px; border-left: 4px solid var(--cyan); background: #f1f7fa; color: var(--muted); }

.user-summary { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 22px; font-size: 14px; }
.welcome-card { width: min(100%, 900px); padding: 46px; text-align: center; }
.status-pill { display: inline-block; margin-bottom: 20px; padding: 7px 12px; border-radius: 20px; color: var(--success); background: #eaf8f1; font-weight: 700; }
.eyebrow { color: var(--cyan); font-weight: 800; letter-spacing: .15em; font-size: 12px; }
.welcome-card > p:not(.eyebrow) { color: var(--muted); }
.identity-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 34px; text-align: left; }
.identity-grid div { min-height: 90px; padding: 18px; border: 1px solid #d6e2e9; background: #f8fbfc; border-radius: 6px; }
.identity-grid small { display: block; margin-bottom: 8px; color: var(--muted); }
.identity-grid strong { word-break: break-word; }
.logout-form { max-width: 230px; margin: 10px auto 0; }
.secondary-button { background: var(--navy); }

.setup-wrap { align-items: start; }
.setup-card { width: min(100%, 920px); }
.setup-card h1 { margin-bottom: 24px; }
.progress-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 12px 0 28px; }
.progress-grid div { display: flex; justify-content: space-between; padding: 16px; background: #f3f8fa; border: 1px solid #d4e1e8; border-radius: 6px; }
fieldset { margin: 26px 0 0; border: 1px solid #cbdbe4; border-radius: 7px; padding: 20px; }
legend { padding: 0 8px; font-weight: 800; color: var(--navy); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.complete-state { padding: 22px 0 8px; text-align: center; }
.complete-icon { width: 72px; height: 72px; margin: 0 auto; display: grid; place-items: center; border-radius: 50%; background: #e8f8f0; color: var(--success); font-size: 38px; font-weight: 800; }
.complete-state .button-link { max-width: 260px; }

@media (max-width: 720px) {
    .topbar { align-items: flex-start; flex-direction: column; }
    .topbar-label { align-self: flex-end; margin-top: -34px; }
    .user-summary { width: 100%; justify-content: flex-start; padding: 4px 0; }
    .identity-grid, .form-grid, .progress-grid { grid-template-columns: 1fr; }
    .card, .welcome-card { padding: 34px 22px 28px; }
}

/* Painel principal do appSmart */
.app-shell-body {
    height: 100vh;
    min-height: 640px;
    overflow: hidden;
    background: #f7f9fb;
}

.app-header {
    min-height: 54px;
    display: flex;
    align-items: center;
    color: white;
    background: var(--navy-dark);
    box-shadow: 0 2px 8px rgba(24, 53, 72, .22);
    z-index: 30;
}

.app-brand {
    width: 245px;
    height: 54px;
    padding: 7px 18px;
    display: flex;
    align-items: center;
    border-right: 1px solid rgba(255,255,255,.12);
}

.app-brand img {
    width: 168px;
    height: 40px;
    object-fit: contain;
    object-position: left center;
}

.header-nav {
    height: 54px;
    margin-left: auto;
    display: flex;
    align-items: stretch;
}

.header-nav a {
    padding: 0 18px;
    display: flex;
    align-items: center;
    color: rgba(255,255,255,.9);
    border-left: 1px solid rgba(255,255,255,.1);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.header-nav a:hover,
.header-nav a.active { background: rgba(255,255,255,.09); color: white; }

.header-account {
    min-width: 335px;
    padding: 5px 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 12px;
    align-items: center;
    border-left: 1px solid rgba(255,255,255,.12);
    font-size: 12px;
}

.account-company { font-weight: 700; }
.account-user { grid-column: 1; opacity: .78; font-size: 11px; }
.header-account form { grid-column: 2; grid-row: 1 / span 2; }

.header-logout,
.sidebar-toggle,
.new-record {
    width: auto;
    min-height: 34px;
    margin: 0;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 13px;
}

.header-logout { background: transparent; border: 1px solid rgba(255,255,255,.45); }
.header-logout:hover { background: rgba(255,255,255,.1); }

.app-toolbar {
    min-height: 52px;
    padding: 7px 14px;
    display: grid;
    grid-template-columns: minmax(300px, 1fr) 250px 260px;
    gap: 10px;
    align-items: center;
    background: white;
    border-bottom: 1px solid #cbd9e1;
    box-shadow: 0 2px 8px rgba(29, 63, 84, .08);
    z-index: 20;
}

.app-toolbar input,
.app-toolbar select {
    min-height: 38px;
    margin: 0;
    padding: 7px 11px;
    border-radius: 3px;
}

.sidebar-toggle { display: none; background: var(--navy); }
.new-record { min-height: 38px; background: var(--cyan); font-weight: 700; }

.app-layout {
    min-height: 0;
    flex: 1;
    display: flex;
    overflow: hidden;
}

.app-sidebar {
    width: 245px;
    min-width: 245px;
    overflow-y: auto;
    background: #f3f6f8;
    border-right: 1px solid #cfdae1;
}

.sidebar-title {
    height: 47px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    background: var(--navy-dark);
    font-weight: 700;
}

.app-sidebar nav { padding: 9px 9px 18px; }
.app-sidebar nav a {
    min-height: 37px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 4px;
    color: #345469;
    text-decoration: none;
    font-size: 14px;
}

.app-sidebar nav a:hover { background: #e5edf2; }
.app-sidebar nav a.sidebar-active { background: #d8e8f1; color: #174d6f; font-weight: 700; }
.menu-icon { width: 21px; color: #6b8291; text-align: center; font-size: 12px; }
.sidebar-divider { height: 1px; margin: 9px 5px; background: #d7e0e5; }
.module-pending { cursor: default; }

.app-main {
    min-width: 0;
    flex: 1;
    overflow-y: auto;
    scrollbar-gutter: stable;
    padding: 24px 20px 34px;
    background: white;
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
}

.app-main .page-heading h1 {
    margin: 0;
    color: var(--navy-dark);
    font-size: 25px;
    line-height: 1.2;
    text-align: left;
}

.page-heading p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.heading-status { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.heading-status > span {
    padding: 6px 10px;
    border: 1px solid #d4e0e7;
    border-radius: 16px;
    color: #557083;
    background: #fafcfd;
    font-size: 11px;
}
.heading-status .online-chip { color: var(--success); border-color: #bfe0cd; background: #effaf4; }

.demo-warning {
    margin: 17px 0 12px;
    padding: 9px 12px;
    border-left: 4px solid #e2a626;
    background: #fff9e9;
    color: #745514;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(155px, 1fr));
    gap: 10px;
}

.metric-card {
    min-height: 112px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid #d4e0e7;
    background: #fff;
}

.metric-card > span { color: #4e6c80; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.metric-card strong { margin: 11px 0 5px; color: #1f536f; font-size: 25px; line-height: 1; }
.metric-card small { color: #879aa7; font-size: 11px; }

.dashboard-panel { margin-top: 14px; border: 1px solid #d4e0e7; background: white; }
.panel-heading {
    min-height: 47px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #dbe5ea;
}
.app-main .panel-heading h2 { margin: 0; font-size: 16px; }
.panel-heading > span { color: #8295a2; font-size: 11px; }

.quick-grid { padding: 13px; display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 11px; }
.quick-grid article { min-height: 88px; padding: 15px; border: 1px solid #d7e2e8; background: #fbfcfd; }
.quick-grid strong { color: #245c7c; }
.quick-grid p { margin: 7px 0 0; color: #6d8290; font-size: 12px; line-height: 1.4; }

.indicator-list { padding: 13px; display: flex; flex-wrap: wrap; gap: 8px; }
.indicator-list span { padding: 7px 11px; border: 1px solid #d3e0e7; border-radius: 16px; color: #587184; background: #fafcfd; font-size: 11px; }

.app-statusbar {
    min-height: 30px;
    padding: 5px 14px;
    display: flex;
    align-items: center;
    gap: 22px;
    color: white;
    background: var(--navy);
    font-size: 11px;
    z-index: 30;
}
.app-statusbar span:first-child { color: #7cf2af; font-weight: 800; }

@media (max-width: 1180px) {
    .metric-grid { grid-template-columns: repeat(3, minmax(155px, 1fr)); }
    .quick-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
    .header-account { min-width: 280px; }
}

@media (max-width: 820px) {
    .app-shell-body { overflow: auto; }
    .app-header { min-height: 58px; }
    .app-brand { width: auto; min-width: 155px; border-right: 0; }
    .app-brand img { width: 138px; }
    .header-nav { display: none; }
    .header-account { min-width: 0; margin-left: auto; border-left: 0; }
    .account-company, .account-user { display: none; }
    .app-toolbar { grid-template-columns: 42px 1fr; }
    .app-toolbar select, .new-record { display: none; }
    .sidebar-toggle { display: inline-grid; place-items: center; }
    .app-layout { overflow: visible; }
    .app-sidebar {
        position: fixed;
        inset: 110px auto 30px 0;
        transform: translateX(-105%);
        transition: transform 180ms ease;
        box-shadow: 12px 0 30px rgba(26,55,74,.2);
        z-index: 50;
    }
    .sidebar-open .app-sidebar { transform: translateX(0); }
    .app-main { overflow: visible; padding: 20px 13px 30px; }
    .page-heading { flex-direction: column; }
    .heading-status { justify-content: flex-start; }
    .metric-grid { grid-template-columns: repeat(2, minmax(135px, 1fr)); }
    .quick-grid { grid-template-columns: 1fr; }
    .app-statusbar { position: sticky; bottom: 0; overflow-x: auto; white-space: nowrap; }
}

@media (max-width: 480px) {
    .header-account { padding-left: 4px; }
    .app-toolbar { padding: 7px 9px; }
    .metric-grid { grid-template-columns: 1fr; }
    .app-main .page-heading h1 { font-size: 22px; }
}

/* Refinamento do painel: informações únicas, ícones e menu do perfil */
.app-icon { width: 20px; height: 20px; flex: 0 0 auto; }

.clean-header {
    overflow: visible;
    color: #fff;
    background: var(--navy-dark);
    border-bottom: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 3px 12px rgba(28, 59, 78, .12);
}

.clean-header .app-brand {
    align-self: stretch;
    background: transparent;
    border-right: 0;
}

.header-actions {
    height: 54px;
    margin-left: auto;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.icon-action {
    position: relative;
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    margin: 0;
    padding: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: rgba(255, 255, 255, .92);
    background: transparent;
}

.icon-action:hover,
.icon-action:focus-visible { color: #fff; background: rgba(255, 255, 255, .12); }
.icon-action.assistant-action { color: rgba(255, 255, 255, .92); background: transparent; }
.icon-action.assistant-action:hover,
.icon-action.assistant-action:focus-visible { color: #fff; background: rgba(255, 255, 255, .12); }
.notification-dot { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border: 2px solid var(--navy-dark); border-radius: 50%; background: #e95050; }

.icon-action::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 9px);
    left: 50%;
    z-index: 90;
    min-width: max-content;
    padding: 9px 12px;
    border-radius: 7px;
    color: white;
    background: #34485b;
    box-shadow: 0 8px 20px rgba(20, 42, 58, .22);
    font-size: 11px;
    font-weight: 600;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -4px);
    transition: opacity 120ms ease, transform 120ms ease;
}
.icon-action:hover::after,
.icon-action:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }

.profile-area { position: relative; margin-left: 5px; }
.profile-trigger {
    width: auto;
    min-width: 236px;
    min-height: 44px;
    margin: 0;
    padding: 4px 8px 4px 5px;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 23px;
    color: #fff;
    background: rgba(255, 255, 255, .05);
    text-align: left;
}
.profile-trigger:hover,
.profile-trigger[aria-expanded="true"] { color: #fff; background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .45); }

.profile-avatar {
    overflow: hidden;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, .18);
    font-weight: 800;
}
.profile-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.small-avatar { width: 34px; height: 34px; font-size: 11px; }
.large-avatar { width: 58px; height: 58px; font-size: 17px; }
.profile-trigger-text { min-width: 0; align-self: stretch; flex: 0 1 auto; margin-right: auto; display: flex; align-items: center; justify-content: flex-start; }
.profile-trigger-name { overflow: hidden; font-size: 12px; font-weight: 400; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; }
.profile-chevron { margin: 0 2px 3px; font-size: 16px; }

.profile-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 100;
    width: 350px;
    padding: 12px;
    border: 1px solid #d7e1e7;
    border-radius: 12px;
    background: white;
    box-shadow: 0 18px 45px rgba(23, 52, 70, .2);
}
.profile-menu[hidden] { display: none; }
.profile-menu-head { padding: 7px 7px 14px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #e1e8ec; }
.profile-menu-head > div { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.profile-menu-head small { color: #8193a0; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.profile-menu-head strong { margin-top: 3px; color: #324d60; font-size: 14px; }
.profile-menu-head > div > span { margin-top: 3px; color: #708391; font-size: 11px; }

.profile-company-owner {
    margin: 8px 0 2px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #607b8c;
}
.profile-company-owner .app-icon { width: 19px; height: 19px; flex: 0 0 19px; }
.profile-company-owner > div { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.profile-company-owner small { color: #8193a0; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.profile-company-owner strong { margin-top: 2px; overflow: hidden; color: #324d60; font-size: 13px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }

.profile-menu form { margin: 0; }
.profile-menu-item,
.profile-photo-label {
    width: 100%;
    min-height: 43px;
    margin: 3px 0 0;
    padding: 9px 10px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    border: 0;
    border-radius: 6px;
    color: #425a6c;
    background: transparent;
    font: 600 13px/1.25 "Segoe UI", Arial, sans-serif;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.profile-menu-item:hover,
.profile-photo-label:hover { color: #214b65; background: #edf3f6; }
.profile-menu-item .app-icon,
.profile-photo-label .app-icon { width: 19px; height: 19px; }
.profile-menu-divider { height: 1px; margin: 8px 5px; background: #e0e7eb; }
.logout-item { color: #a43c3c; }
.logout-item:hover { color: #8a2929; background: #fff0f0; }

.search-field { position: relative; min-width: 0; }
.search-field .app-icon { position: absolute; top: 50%; left: 11px; width: 17px; height: 17px; color: #758a98; transform: translateY(-50%); pointer-events: none; }
.app-toolbar .search-field input { width: 100%; padding-left: 37px; }
.new-record { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.new-record .app-icon { width: 17px; height: 17px; }

.app-sidebar nav a .app-icon { width: 17px; height: 17px; color: #6b8190; }
.app-sidebar nav a.sidebar-active .app-icon { color: #1d5e84; }
.simple-heading { justify-content: flex-start; }
.nine-metrics { grid-template-columns: repeat(3, minmax(210px, 1fr)); }
.page-message { margin: 0 0 12px; padding: 10px 12px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.page-message.success { color: var(--success); background: #edf9f3; border: 1px solid #bee0cd; }
.page-message.error { color: var(--danger); background: #fff0f0; border: 1px solid #ecc5c5; }

.copyright-statusbar { justify-content: center; color: rgba(255,255,255,.94); font-size: 11px; text-align: center; }
.copyright-statusbar::first-line { color: inherit; }

.app-toast {
    position: fixed;
    right: 22px;
    bottom: 48px;
    z-index: 120;
    max-width: min(360px, calc(100vw - 30px));
    padding: 12px 16px;
    border-radius: 7px;
    color: white;
    background: #344a5c;
    box-shadow: 0 12px 30px rgba(21, 45, 61, .26);
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 150ms ease, transform 150ms ease;
}
.app-toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1180px) {
    .nine-metrics { grid-template-columns: repeat(3, minmax(170px, 1fr)); }
    .profile-trigger { min-width: 190px; }
}

@media (max-width: 820px) {
    .clean-header { min-height: 58px; }
    .clean-header .app-brand { min-width: 154px; }
    .header-actions { height: 58px; padding: 0 7px; gap: 1px; }
    .icon-action { width: 34px; min-width: 34px; min-height: 34px; }
    .icon-action:nth-of-type(2), .icon-action:nth-of-type(3) { display: none; }
    .profile-trigger { min-width: 44px; width: 44px; padding: 4px; }
    .profile-trigger-text, .profile-chevron { display: none; }
    .profile-menu { position: fixed; top: 66px; right: 8px; width: min(350px, calc(100vw - 16px)); }
    .nine-metrics { grid-template-columns: repeat(2, minmax(135px, 1fr)); }
}

@media (max-width: 480px) {
    .clean-header .app-brand { min-width: 135px; padding-left: 12px; }
    .clean-header .app-brand img { width: 120px; }
    .icon-action:nth-of-type(4) { display: none; }
    .nine-metrics { grid-template-columns: 1fr; }
}

/* Organização do painel: busca no conteúdo e menu lateral mais leve */
.dashboard-heading-row {
    margin-bottom: 16px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
    align-items: center;
    gap: 24px;
}

.dashboard-search input {
    width: 100%;
    min-height: 40px;
    margin: 0;
    padding: 8px 13px 8px 39px;
    border: 1px solid #ccd9e1;
    border-radius: 7px;
    color: #29485c;
    background: #fbfcfd;
    box-shadow: 0 1px 2px rgba(34, 67, 87, .04);
}

.dashboard-search input:focus {
    border-color: #6aa6c3;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(42, 151, 185, .1);
    outline: 0;
}

.app-sidebar {
    background: #f7f9fa;
    border-right-color: #d8e1e6;
}

.sidebar-title {
    height: 43px;
    padding: 0 18px;
    gap: 9px;
    color: #6b8190;
    background: transparent;
    border-bottom: 1px solid #dce4e9;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.sidebar-title .app-icon { width: 15px; height: 15px; }
.app-sidebar nav { padding: 9px 10px 20px; }
.app-sidebar nav a {
    min-height: 38px;
    padding: 8px 13px;
    gap: 11px;
    border-radius: 6px;
    color: #3d596b;
    font-size: 13px;
}
.app-sidebar nav a:hover { background: #edf2f5; }
.app-sidebar nav a.sidebar-active {
    color: #174f70;
    background: #e4eef4;
    box-shadow: inset 3px 0 #2a8bad;
}
.app-sidebar nav a .app-icon { color: #778d9b; }
.sidebar-divider { margin: 10px 7px; background: #dce4e9; }

@media (max-width: 820px) {
    .dashboard-heading-row {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 10px;
    }
    .dashboard-heading-row .page-heading { grid-column: 1 / -1; grid-row: 1; }
    .dashboard-heading-row .sidebar-toggle { grid-column: 1; grid-row: 2; }
    .dashboard-heading-row .dashboard-search { grid-column: 2; grid-row: 2; }
    .app-sidebar { inset: 58px auto 30px 0; }
}

/* Painel na barra superior e título lateral sempre fixo */
.header-panel-link {
    align-self: stretch;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    background: rgba(255, 255, 255, .08);
    border-left: 1px solid rgba(255, 255, 255, .12);
    border-right: 1px solid rgba(255, 255, 255, .12);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.header-panel-link:hover,
.header-panel-link:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, .15);
    outline: 0;
}

.header-panel-link .app-icon { width: 17px; height: 17px; }

.app-sidebar {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar-title { flex: 0 0 43px; }
.app-sidebar nav {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

@media (max-width: 600px) {
    .header-panel-link { padding: 0 13px; }
    .header-panel-link span { display: none; }
}

/* Lateral dividida: cabeçalho imóvel e rolagem somente nos módulos */
.clean-header .header-panel-link,
.clean-header .header-panel-link:link,
.clean-header .header-panel-link:visited {
    color: #fff !important;
}

.clean-header .dashboard-action,
.clean-header .dashboard-action:link,
.clean-header .dashboard-action:visited {
    color: rgba(255, 255, 255, .92);
    text-decoration: none;
}

.clean-header .dashboard-action:hover,
.clean-header .dashboard-action:focus-visible {
    color: #fff;
}

@media (max-width: 820px) {
    .clean-header .dashboard-action { display: grid !important; }
}

.sidebar-column {
    width: 245px;
    min-width: 245px;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f7f9fa;
    border-right: 1px solid #d8e1e6;
}

.sidebar-column > .sidebar-title {
    position: relative;
    z-index: 2;
    width: 100%;
    flex: 0 0 43px;
    background: #f7f9fa;
}

.sidebar-column > .app-sidebar {
    position: static;
    inset: auto;
    width: 100%;
    min-width: 0;
    min-height: 0;
    flex: 1;
    display: block;
    overflow: hidden;
    transform: none;
    border: 0;
    box-shadow: none;
    background: transparent;
}

.sidebar-column > .app-sidebar nav {
    height: 100%;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.test-heading-row { grid-template-columns: minmax(0, 1fr); }
.navigation-test-panel { max-width: 920px; }
.test-agenda-list { padding: 6px 16px 16px; }
.test-agenda-list article {
    padding: 16px 4px;
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 18px;
    border-bottom: 1px solid #e0e7eb;
}
.test-agenda-list article:last-child { border-bottom: 0; }
.test-agenda-list article > strong { color: #217c9d; font-size: 15px; }
.test-agenda-list article div { display: flex; flex-direction: column; gap: 4px; }
.test-agenda-list b { color: #294c63; font-size: 14px; }
.test-agenda-list span { color: #758795; font-size: 12px; }

@media (max-width: 820px) {
    .sidebar-column {
        position: fixed;
        inset: 58px auto 30px 0;
        transform: translateX(-105%);
        transition: transform 180ms ease;
        box-shadow: 12px 0 30px rgba(26,55,74,.2);
        z-index: 50;
    }
    .sidebar-open .sidebar-column { transform: translateX(0); }
    .sidebar-column > .app-sidebar { position: static; transform: none; box-shadow: none; }
    .test-heading-row { grid-template-columns: 42px minmax(0, 1fr); }
}

/* Preferência individual para exibição de valores */
.dashboard-title-line {
    display: flex;
    align-items: center;
    gap: 8px;
}

.values-toggle {
    width: 30px;
    min-width: 30px;
    min-height: 30px;
    margin: 0;
    padding: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #287c35;
    background: transparent;
}
.values-toggle:hover,
.values-toggle:focus-visible { color: #185f27; background: #edf6ee; outline: 0; }
.values-toggle[data-visible="0"] { color: #758792; }
.values-toggle:disabled { opacity: .55; cursor: wait; }
.values-toggle .app-icon { width: 18px; height: 18px; }
.values-toggle .eye-open,
.values-toggle .eye-closed { display: none; align-items: center; justify-content: center; }
.values-toggle[data-visible="1"] .eye-open,
.values-toggle[data-visible="0"] .eye-closed { display: inline-flex; }
.sensitive-value { min-height: 34px; }
.sensitive-inline { color: inherit; font-weight: 500; }

/* Navegação lateral por grupos e subgrupos */
.app-sidebar > nav:not(.sidebar-navigation) { display: none; }
.sidebar-column > .app-sidebar nav.sidebar-navigation {
    height: 100%;
    padding: 9px 10px 20px;
    overflow-y: auto;
    scrollbar-gutter: stable;
}
.sidebar-view { display: none; }
.sidebar-view[hidden] { display: none !important; }
.sidebar-view.is-active {
    display: grid;
    gap: 2px;
}
.sidebar-menu-button {
    width: 100%;
    min-height: 31px;
    margin: 0;
    padding: 5px 12px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    border: 0;
    border-radius: 5px;
    color: #345469;
    background: transparent;
    box-shadow: none;
    font: 400 13px/1.2 "Segoe UI", Arial, sans-serif;
    text-align: left;
    text-decoration: none;
}
.sidebar-menu-button:hover,
.sidebar-menu-button:focus-visible {
    color: #21485f;
    background: #edf2f5;
    outline: 2px solid rgba(35,151,181,.22);
    outline-offset: -2px;
}
.sidebar-menu-button .app-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    color: #778d9b;
    stroke-width: 1.8;
}
.sidebar-menu-button span { min-width: 0; }
.sidebar-column > .app-sidebar nav.sidebar-navigation .sidebar-menu-button {
    min-height: 31px;
    padding: 5px 12px;
    gap: 10px;
    font: 400 13px/1.2 "Segoe UI", Arial, sans-serif;
}
.sidebar-column > .app-sidebar nav.sidebar-navigation .sidebar-menu-button .app-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}
.sidebar-logout-form { margin: 0; }
.sidebar-logout-form input { display: none; }
.sidebar-back-button,
.sidebar-exit-button {
    margin-top: 8px;
    border-top: 1px solid #dce4e9;
    border-radius: 0 0 5px 5px;
}
.sidebar-back-button .app-icon { transform: rotate(180deg); }

.sidebar-title span { color: #344b5c; }
.sidebar-title.is-group-title span { color: #c62828; }

.menu-editor-page { display: grid; gap: 10px; }
.menu-editor-layout { display: grid; grid-template-columns: minmax(300px, .85fr) minmax(420px, 1.15fr); gap: 10px; min-height: 470px; }
.menu-tree-panel, .menu-item-editor { min-width: 0; border: 1px solid #c8d6df; background: #fff; }
.menu-tree-panel .panel-heading, .menu-item-editor .panel-heading { min-height: 45px; padding: 7px 10px; border-bottom: 1px solid #c8d6df; }
.menu-tree-list { height: 424px; overflow-y: auto; padding: 4px; }
.menu-tree-item { width: 100%; min-height: 34px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 4px; padding: 4px 7px; border: 0; border-bottom: 1px solid #e0e7eb; background: #fff; color: #27475c; text-align: left; cursor: pointer; }
.menu-tree-item:hover, .menu-tree-item.is-selected { background: #e8f1f6; }
.menu-tree-item.is-inactive { color: #7f8f99; background: #f5f7f8; }
.menu-tree-indent { color: #8296a3; letter-spacing: 2px; }
.menu-tree-tags { display: flex; gap: 3px; }
.menu-tree-tags small { padding: 2px 5px; border-radius: 3px; background: #e2ebf0; color: #476174; font-size: 10px; }
.menu-item-editor { display: flex; flex-direction: column; }
.compact-menu-form { padding: 10px; gap: 8px 10px; align-content: start; flex: 1; }
.compact-menu-form label > span { margin-bottom: 3px; }
.menu-check { min-height: 36px; display: flex !important; flex-direction: row !important; align-items: center; gap: 7px; padding: 4px 8px; border: 1px solid #c8d6df; border-radius: 3px; }
.menu-check input { width: 16px; height: 16px; margin: 0; }
.menu-check span { margin: 0 !important; }
.menu-item-editor .access-editor-actions { margin-top: auto; border-top: 1px solid #c8d6df; padding: 9px 10px; }
@media (max-width: 900px) {
    .menu-editor-layout { grid-template-columns: 1fr; }
    .menu-tree-list { height: 250px; }
}
.auth-check-pending body { visibility: hidden; }

/* Modelo padrão de listas e formulários demonstrativos */
.records-main { padding-bottom: 4px; display: flex; flex-direction: column; }
.records-page { min-width: 0; min-height: 100%; flex: 1; display: flex; flex-direction: column; }
.records-heading-row {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 12px;
}
.records-heading-copy { min-height: 38px; display: flex; align-items: center; justify-content: flex-start; gap: 10px; min-width: 0; text-align: left; }
.records-heading-copy h1 { margin: 0; color: #193e56; font-size: 25px; line-height: 38px; transform: translateY(10px); }
.records-toolbar { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.neutral-action {
    min-height: 38px;
    padding: 8px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid #aebdc7;
    border-radius: 5px;
    background: #f6f8f9;
    color: #344f61;
    font: 500 13px/1.2 "Segoe UI", Arial, sans-serif;
    cursor: pointer;
}
.neutral-action:hover { background: #e9eef1; border-color: #879ba8; }
.neutral-action:focus-visible { outline: 2px solid rgba(35,151,181,.3); outline-offset: 2px; }
.neutral-action .app-icon { width: 16px; height: 16px; }
.neutral-action-primary { background: #415d6e; border-color: #415d6e; color: #fff; }
.neutral-action-primary:hover { background: #304b5c; border-color: #304b5c; }

.records-filter-panel {
    padding: 8px 12px;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 150px 170px;
    align-items: end;
    gap: 10px;
    border: 1px solid #d0dce4;
    background: #fafbfc;
}
.record-search-field {
    height: 32px;
    min-height: 32px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid #bdccd6;
    border-radius: 4px;
    background: #fff;
}
.record-search-field:focus-within { border-color: #7796a9; box-shadow: 0 0 0 2px rgba(70,120,150,.1); }
.record-search-field .app-icon { width: 17px; height: 17px; color: #71899a; }
.record-search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: #29495d; font: 400 14px/1.2 "Segoe UI", Arial, sans-serif; }
.compact-filter { display: grid; gap: 4px; color: #607888; font-size: 11px; }
.compact-filter select,
#record-page-size {
    min-height: 32px;
    height: 32px;
    padding: 4px 8px;
    border: 1px solid #bdccd6;
    border-radius: 4px;
    background: #fff;
    color: #29495d;
    font: 400 13px "Segoe UI", Arial, sans-serif;
}
.records-message { margin-top: 10px; padding: 9px 12px; border: 1px solid #b8c7d0; background: #eef3f6; color: #315164; font-size: 13px; }
.records-message.is-error { border-color: #cbb8b8; background: #f5eeee; color: #704141; }
.records-table-wrap { overflow-x: auto; border: 1px solid #d0dce4; border-top: 0; background: #fff; }
.records-table { width: 100%; min-width: 1100px; table-layout: fixed; border-collapse: collapse; color: #354f60; font-size: 13px; }
.record-col-id { width: 6%; }
.record-col-name { width: 34%; }
.record-col-document { width: 19%; }
.record-col-city { width: 20%; }
.record-col-status { width: 10%; }
.record-col-actions { width: 11%; }
.records-table th { height: 34px; padding: 0 12px; border-bottom: 1px solid #c7d4dd; background: #e9eef2; color: #344c5c; font-weight: 600; text-align: left; vertical-align: middle; white-space: nowrap; }
.records-table td { height: 34px; padding: 0 12px; border-bottom: 1px solid #e0e7eb; vertical-align: middle; white-space: nowrap; }
.records-table tbody tr:last-child td { border-bottom: 0; }
.records-table tbody tr:hover { background: #fafcfd; }
.record-id-cell { color: #294b60; font-variant-numeric: tabular-nums; font-weight: 600; }
.record-name-cell strong { display: inline; font-weight: 500; color: #27495e; }
.actions-column { text-align: center !important; }
.actions-column > span { display: inline-block; transform: translateX(-22px); }
.record-status-cell { vertical-align: middle !important; }
.record-actions-cell { text-align: center; vertical-align: middle !important; }
.record-row-actions { position: relative; left: -22px; width: 100%; height: 28px; display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.record-action-button,
.record-page-button {
    min-height: 28px;
    padding: 4px 10px;
    border: 1px solid #b4c2cb;
    border-radius: 4px;
    background: #f7f8f9;
    color: #385466;
    font: 400 12px "Segoe UI", Arial, sans-serif;
    cursor: pointer;
}
.record-action-button:hover,
.record-page-button:hover:not(:disabled) { background: #e8edef; border-color: #8499a7; }
.record-action-button {
    width: auto;
    height: 22px;
    min-height: 22px;
    padding: 0 9px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.record-status-badge { height: auto; min-width: 0; padding: 0; display: inline; vertical-align: middle; box-sizing: border-box; border: 0; border-radius: 0; background: transparent; color: #4e6573; font-size: 11px; line-height: inherit; text-align: inherit; }
.record-status-badge.is-inactive { color: #6d6d6d; background: transparent; }
.records-empty-row td { padding: 30px 12px; color: #788e9c; text-align: center; }
.records-footer { min-height: 34px; margin-top: auto; padding: 4px 0 2px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border: 0; background: transparent; color: #667e8e; font-size: 12px; }
.records-pagination-controls,
.records-pagination { display: flex; align-items: center; gap: 6px; }
.records-pagination-controls > label { height: 28px; display: flex; align-items: center; gap: 7px; line-height: 1; white-space: nowrap; }
#record-count { height: 28px; display: inline-flex; align-items: center; line-height: 1; }
#record-count.is-success { color: var(--success); font-weight: 700; }
#record-count { transform: translateY(10px); }
.records-pagination-controls > label { transform: translateY(8px); }
#record-page-size { min-height: 28px; height: 28px; padding: 2px 7px; }
.record-page-button { height: 28px; min-height: 28px; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; line-height: 1; white-space: nowrap; }
.record-page-button.is-current { background: #435f70; border-color: #435f70; color: #fff; }
.record-page-button:disabled { opacity: .45; cursor: default; }

.record-modal[hidden] { display: none; }
.record-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; }
.record-modal-backdrop { position: absolute; inset: 0; background: rgba(25,42,53,.48); }
.record-modal-dialog { position: relative; width: min(1080px, 100%); max-height: calc(100vh - 56px); overflow: auto; border: 1px solid #9eb0bc; border-radius: 5px; background: #fff; box-shadow: 0 18px 48px rgba(21,42,55,.25); }
.record-modal-dialog > header { min-height: calc(26px + 3mm); padding: 2px 12px; display: flex; align-items: center; justify-content: space-between; gap: 15px; background: #3c5c72; color: #fff; }
.record-modal-dialog > header h2 { margin: 0; font-size: 13px; font-weight: 600; }
.record-modal-close { width: 25px; height: 22px; min-height: 22px; margin: 0; padding: 0; border: 0; background: transparent; color: #fff; font-size: 19px; line-height: 1; cursor: pointer; }
.record-modal-dialog form,
.record-modal-body,
.record-tab-panel { background: #fff; }
.record-modal-body { padding: 8px 14px; }
.record-tabs { margin: -2px 0 6px; display: flex; gap: 3px; border-bottom: 1px solid #cbd7de; }
.record-tab { width: auto; min-height: 30px; margin: 0 0 -1px; padding: 5px 17px; border: 1px solid transparent; border-bottom-color: #cbd7de; border-radius: 4px 4px 0 0; background: transparent; color: #617987; font: 600 12px/1.2 "Segoe UI", Arial, sans-serif; cursor: pointer; }
.record-tab:hover { background: #f2f6f8; color: #344f61; }
.record-tab.is-active { border-color: #cbd7de #cbd7de #fff; background: #fff; color: #274b62; }
.record-tab:focus-visible { outline: 2px solid rgba(35,151,181,.25); outline-offset: -2px; }
.record-form-message { margin: 0 0 8px; padding: 8px 10px; border: 1px solid #d7a3a3; border-radius: 4px; background: #fff1f1; color: #8d2323; font-size: 12px; }
.record-tab-panel { box-sizing: border-box; }
.record-tab-panel[hidden] { display: none; }
.record-form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 10px; }
.record-form-grid label { display: grid; gap: 2px; color: #344d5e; font-size: 12px; font-weight: 500; }
.record-form-grid label.span-2 { grid-column: span 2; }
.record-form-grid label.span-4 { grid-column: 1 / -1; }
.record-form-grid label.record-primary-name { grid-column: 1 / span 2; }
.record-form-grid input,
.record-form-grid select,
.record-form-grid textarea { width: 100%; min-height: 31px; padding: 4px 8px; border: 1px solid #c0ced7; border-radius: 4px; background: #fff; color: #2e4b5d; font: 400 13px/1.3 "Segoe UI", Arial, sans-serif; resize: vertical; }
.record-form-grid input[readonly] { background: #f3f5f6; color: #657b89; }
.record-form-grid input:focus,
.record-form-grid select:focus,
.record-form-grid textarea:focus { outline: 2px solid rgba(35,151,181,.18); border-color: #7796a9; }
.record-form-grid textarea { min-height: 54px; }
.record-tab-placeholder { min-height: inherit; padding: 26px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 7px; border: 1px dashed #c7d3da; border-radius: 4px; background: #fff; color: #748997; text-align: center; }
.record-tab-placeholder strong { color: #405d6f; font-size: 14px; }
.record-tab-placeholder span { max-width: 520px; font-size: 12px; }
.record-modal-dialog form > footer { padding: 8px 16px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid #d9e2e7; background: #fff; }
.record-modal-dialog form > footer .record-form-action { width: 5cm; max-width: calc(50% - 4px); flex: 0 1 5cm; }
.record-modal-open { overflow: hidden; }

.record-col-group-name { width: 31%; }
.record-col-notes { width: auto; }
.record-col-username { width: 13%; }
.record-col-user-name { width: 24%; }
.record-col-email { width: 24%; }
.record-col-profile { width: 12%; }
.user-switch-row { min-height: 34px; display: flex; align-items: center; gap: 9px; padding: 5px 9px; border: 1px solid #c0ced7; border-radius: 4px; background: #f8fafb; }
.user-switch-row input { width: 16px; min-height: 16px; margin: 0; }
.user-switch-row b { font-size: 13px; font-weight: 500; }
.user-permission-panel { border: 1px solid #cbd7de; border-radius: 4px; overflow: hidden; }
.user-permission-panel > p { margin: 0; padding: 9px 12px; border-bottom: 1px solid #d8e1e7; background: #f7f9fa; color: #617987; font-size: 12px; }
.user-permission-table { width: 100%; border-collapse: collapse; table-layout: fixed; color: #344f61; font-size: 12px; }
.user-permission-table th, .user-permission-table td { height: 31px; padding: 4px 10px; border-right: 1px solid #d8e1e7; border-bottom: 1px solid #d8e1e7; text-align: center; }
.user-permission-table tr:last-child > * { border-bottom: 0; }
.user-permission-table tr > *:last-child { border-right: 0; }
.user-permission-table thead th { background: #edf2f5; font-weight: 600; }
.user-permission-table tbody th { width: 36%; text-align: left; font-weight: 500; }
.user-permission-table select { width: 100%; min-width: 84px; height: 25px; padding: 2px 4px; border: 1px solid #c0ced7; border-radius: 3px; background: #fff; color: #344f61; font: 400 11px/1.2 "Segoe UI", Arial, sans-serif; }
.access-levels-dialog { width: min(720px, 100%); }
.access-levels-explanation { margin: 0 0 12px; padding: 10px 12px; border-left: 3px solid #3c5c72; background: #f3f7f9; color: #516b7b; font-size: 12px; line-height: 1.45; }
.access-level-list { display: grid; border: 1px solid #cbd7de; border-radius: 4px; overflow: hidden; }
.access-level-row { min-height: 54px; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #d8e1e7; background: #fff; color: #344f61; }
.access-level-row:last-child { border-bottom: 0; }
.access-level-copy { display: grid; gap: 3px; }
.access-level-copy strong { font-size: 13px; }
.access-level-copy small { color: #748997; font-size: 11px; font-weight: 400; }
.access-level-row input { width: 17px; height: 17px; margin: 0; }
.records-toolbar .neutral-action { height: 38px; min-height: 38px; padding-top: 0; padding-bottom: 0; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; white-space: nowrap; }
.records-toolbar .neutral-action span { white-space: nowrap; }
.user-modal-dialog { height: min(470px, calc(100vh - 32px)); overflow: hidden; }
.user-modal-dialog > form { height: calc(100% - 41px); display: flex; flex-direction: column; min-height: 0; }
.user-modal-dialog .record-modal-body { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.user-modal-dialog .record-tabs { flex: 0 0 auto; }
.user-modal-dialog .record-tab-panel { flex: 1; min-height: 0; overflow-y: auto; padding-right: 2px; }
.user-modal-dialog form > footer { flex: 0 0 auto; }

.access-control-dialog { width: min(1080px, 100%); height: min(560px, calc(100vh - 32px)); overflow: hidden; display: flex; flex-direction: column; }
.access-control-shell { flex: 1; min-height: 0; padding: 8px 14px 0; display: flex; flex-direction: column; background: #fff; }
.access-control-tabs { flex: 0 0 auto; overflow-x: auto; overflow-y: hidden; white-space: nowrap; }
.access-control-tabs .record-tab { flex: 0 0 auto; padding-right: 12px; padding-left: 12px; }
.access-control-shell > .record-form-message { flex: 0 0 auto; }
.access-control-panel { flex: 1; min-height: 0; display: none; grid-template-columns: 34% minmax(0, 1fr); border: 1px solid #cbd7de; border-radius: 3px; overflow: hidden; }
.access-control-panel.is-active { display: grid; }
.access-entity-list-column,
.access-subject-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid #cbd7de; background: #fafcfd; }
.access-column-heading { min-height: 36px; padding: 4px 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid #cbd7de; background: #edf3f6; color: #344f61; box-sizing: border-box; }
.access-column-heading strong { font-size: 12px; }
.access-column-heading span { color: #6d8493; font-size: 11px; }
.access-small-action { width: auto; height: 27px; min-height: 27px; padding: 0 11px; }
.access-entity-list,
.access-subject-list { flex: 1; min-height: 0; overflow-y: auto; }
.access-list-item { width: 100%; min-height: 38px; margin: 0; padding: 5px 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 0; border-bottom: 1px solid #dde5ea; border-radius: 0; background: #fff; color: #344f61; text-align: left; cursor: pointer; }
.access-list-item:hover { background: #f2f6f8; }
.access-list-item.is-selected { background: #dce8ee; box-shadow: inset 3px 0 0 #3c5c72; }
.access-list-item > span:first-child,
.access-list-item:not(:has(> span)) { min-width: 0; }
.access-list-item strong,
.access-list-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.access-list-item strong { font-size: 12px; font-weight: 600; }
.access-list-item small { margin-top: 1px; color: #748997; font-size: 10px; font-weight: 400; }
.access-state-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #3b8a5a; }
.access-state-dot.is-inactive { background: #9daab2; }
.access-entity-form { min-width: 0; min-height: 0; padding: 10px 12px; display: flex; flex-direction: column; overflow-y: auto; }
.compact-access-form { flex: 1; align-content: start; }
.access-editor-actions { flex: 0 0 auto; padding-top: 8px; display: flex; justify-content: flex-end; gap: 8px; }
.access-editor-actions .neutral-action { width: 150px; height: 34px; min-height: 34px; justify-content: center; }
.access-list-search { height: 31px; min-height: 31px; margin: 6px; padding: 4px 8px; border: 1px solid #c0ced7; border-radius: 3px; font: 400 12px "Segoe UI", Arial, sans-serif; }
.access-functions-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.access-function-list { flex: 1; min-height: 0; overflow-y: auto; }
.access-function-row { width: 100%; min-height: 32px; margin: 0; padding: 3px 9px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 0; border-bottom: 1px solid #e0e6ea; border-radius: 0; background: #fff; color: #344f61; text-align: left; cursor: pointer; }
.access-function-row:hover { background: #f4f7f8; }
.access-function-row strong { display: block; font-size: 11px; font-weight: 500; }
.access-function-row small { display: block; color: #7b8e99; font-size: 9px; text-transform: uppercase; }
.access-effect { width: 25px; flex: 0 0 25px; color: #82939d; font-size: 17px; text-align: center; }
.access-function-row.is-permitir .access-effect { color: #26804b; }
.access-function-row.is-bloquear .access-effect { color: #a23a3a; }
.access-bulk-actions { flex: 0 0 auto; min-height: 46px; padding: 6px 8px; display: flex; align-items: center; justify-content: flex-end; gap: 6px; border-top: 1px solid #cbd7de; background: #f8fafb; box-sizing: border-box; }
.access-bulk-actions .neutral-action { width: auto; height: 32px; min-height: 32px; padding: 0 11px; justify-content: center; white-space: nowrap; }
.access-control-footer { flex: 0 0 48px; padding: 7px 14px; display: flex; align-items: center; justify-content: flex-end; border-top: 1px solid #d9e2e7; background: #fff; box-sizing: border-box; }
.access-control-footer .neutral-action { width: 150px; height: 34px; min-height: 34px; justify-content: center; }
.record-form-message.is-success { border-color: #9bc6a9; background: #edf8f0; color: #28633e; }
.record-notes-cell { max-width: 620px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.groups-form-grid textarea { min-height: 112px; }
.records-toolbar .neutral-action:disabled { opacity: .45; cursor: not-allowed; }
.emitter-modal-dialog { width: min(1080px, 100%); }
.emitter-form-grid { gap: 8px 12px; }
.emitter-form-grid label.emitter-primary-name { grid-column: 1 / -1; }
.emitter-report-layout { grid-template-columns: 250px minmax(0, 1fr); }
.emitter-report-layout .organization-logo-preview { height: 112px; }
.emitter-report-layout .report-header-preview { min-height: 112px; }

.organization-main { padding-bottom: 12px; }
.organization-page { width: 100%; min-width: 0; }
.organization-heading-row { min-height: 74px; display: flex; align-items: center; }
.organization-heading-row .records-heading-copy { align-items: center; }
.organization-heading-row h1 { margin: 0; color: #193e56; font-size: 25px; line-height: 1.2; }
.organization-heading-row p { margin: 5px 0 0; color: #6d8493; font-size: 13px; }
.organization-card { border: 1px solid #c7d5de; border-radius: 4px; background: #fff; box-shadow: 0 4px 14px rgba(35,67,86,.05); }
.organization-tabs { margin: 0; padding: 10px 16px 0; }
.organization-panel { box-sizing: border-box; padding: 18px 20px 20px; }
.organization-panel[hidden] { display: none; }
.organization-form-grid { gap: 12px 14px; }
.organization-form-grid label.organization-primary-name { grid-column: 1 / -1; }
.organization-form-grid input,
.organization-form-grid select { resize: none; }
.organization-report-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; }
.organization-logo-box,
.organization-header-sample { min-width: 0; }
.organization-logo-box h2,
.organization-header-sample h2 { margin: 0 0 10px; color: #294b60; font-size: 14px; }
.organization-logo-preview { height: 132px; margin-bottom: 10px; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 1px dashed #afbec8; border-radius: 4px; background: #f8fafb; color: #8295a1; font-size: 12px; text-align: center; }
.organization-logo-preview img { width: 100%; height: 100%; padding: 12px; object-fit: contain; box-sizing: border-box; }
.organization-logo-button { width: 100%; justify-content: center; cursor: pointer; box-sizing: border-box; }
.organization-logo-box small { display: block; margin-top: 8px; color: #738894; font-size: 11px; line-height: 1.4; }
.report-header-preview { min-height: 132px; padding: 12px; display: grid; grid-template-columns: 190px minmax(0, 1fr); align-items: center; gap: 15px; border: 1px solid #728896; background: #fff; box-sizing: border-box; }
.report-header-logo { height: 92px; display: flex; align-items: center; justify-content: center; overflow: hidden; color: #8a9ba5; font-size: 12px; }
.report-header-logo img { width: 100%; height: 100%; object-fit: contain; }
.report-header-copy { min-width: 0; display: grid; gap: 5px; color: #172f3e; }
.report-header-copy strong { overflow-wrap: anywhere; font-size: 17px; line-height: 1.25; }
.report-header-copy span { overflow-wrap: anywhere; font-size: 12px; line-height: 1.25; }
.organization-header-sample > p { margin: 9px 0 0; color: #738894; font-size: 11px; }
.organization-form-footer { min-height: 58px; padding: 8px 20px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-top: 1px solid #d9e2e7; background: #fff; box-sizing: border-box; }
.organization-save-status { min-height: 18px; display: inline-flex; align-items: center; color: #667e8e; font-size: 12px; }
.organization-save-status.is-success { color: var(--success); font-weight: 700; }
.organization-save-status.is-error { color: var(--danger); font-weight: 700; }
.organization-save-button { width: 5cm; justify-content: center; }

@media (max-width: 900px) {
    .records-heading-row { align-items: stretch; }
    .records-filter-panel { grid-template-columns: 1fr 1fr; }
    .record-search-field { grid-column: 1 / -1; }
    .organization-report-layout { grid-template-columns: 1fr; }
    .emitter-report-layout { grid-template-columns: 1fr; }
    .report-header-preview { grid-template-columns: 150px minmax(0, 1fr); }
}
@media (max-width: 620px) {
    .records-heading-row { display: grid; }
    .records-toolbar { justify-content: flex-end; }
    .records-filter-panel { grid-template-columns: 1fr; }
    .record-form-grid { grid-template-columns: 1fr 1fr; }
    .record-form-grid label.span-2,
    .record-form-grid label.span-4 { grid-column: 1 / -1; }
    .record-form-grid label.record-primary-name { grid-column: 1 / -1; }
    .organization-form-grid label.organization-primary-name { grid-column: 1 / -1; }
    .emitter-form-grid label.emitter-primary-name { grid-column: 1 / -1; }
    .records-footer { align-items: flex-start; flex-direction: column; }
    .records-pagination-controls { width: 100%; justify-content: space-between; }
}

@media (max-width: 620px) {
    .record-form-grid { grid-template-columns: 1fr; }
    .record-form-grid label.span-2,
    .record-form-grid label.span-4 { grid-column: auto; }
    .record-form-grid label.record-primary-name { grid-column: auto; }
    .organization-panel { padding: 14px; }
    .organization-form-grid label.organization-primary-name { grid-column: auto; }
    .emitter-form-grid label.emitter-primary-name { grid-column: auto; }
    .report-header-preview { grid-template-columns: 1fr; text-align: center; }
    .organization-form-footer { align-items: stretch; flex-direction: column; }
    .organization-save-button { width: 100%; }
}
.standard-print-frame { display: contents; }
.standard-print-header, .standard-print-footer { display: none; }
@media print {
    @page { size: A4 portrait; margin: 0; }
    html, body { background: #fff !important; color: #182f3e !important; }
    body { font-size: 9pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .app-header, .sidebar-column, .app-statusbar, .records-heading-row, .records-toolbar, .records-filter-panel, .records-footer, .records-message, .record-row-actions, .sidebar-toggle, .profile-menu, .record-modal { display: none !important; }
    .app-shell, .app-layout, .app-main { display: block !important; width: 100% !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; background: #fff !important; }
    .records-page { display: block !important; width: auto !important; min-height: 0 !important; margin: 0 !important; padding: 8mm 7mm 4mm !important; overflow: visible !important; background: #fff !important; }
    .standard-print-frame { position: relative; display: block; box-sizing: border-box; width: 100%; border: 0; }
    .standard-print-frame::after { content: ""; position: absolute; z-index: 5; inset: 0; box-sizing: border-box; border: .35mm solid #000; border-bottom: 0; pointer-events: none; }
    .standard-print-header { display: block !important; margin: 0; break-inside: avoid; page-break-inside: avoid; }
    .standard-print-company { display: grid; grid-template-columns: 52mm 1fr; min-height: 28mm; margin-bottom: 0; border: 0; box-shadow: inset 0 -.35mm 0 #000; }
    .standard-print-logo { display: flex; align-items: center; justify-content: center; min-width: 0; padding: 3mm 5mm; color: #80909b; font-weight: 700; letter-spacing: .12em; }
    .standard-print-logo img { display: block; width: 100%; height: 20mm; object-fit: contain; }
    .standard-print-company-copy { display: flex; flex-direction: column; justify-content: center; gap: 1.1mm; min-width: 0; padding: 3mm 5mm 3mm 2mm; line-height: 1.25; }
    .standard-print-company-copy strong { font-size: 12pt; color: #173246; }
    .standard-print-company-copy span { display: block; min-height: 3mm; font-size: 8.4pt; color: #324b5b; }
    .standard-print-title-band { display: flex; align-items: center; justify-content: center; box-sizing: border-box; min-height: 8mm; margin: 0; border: 0; box-shadow: inset 0 -.35mm 0 #000; background: #d9e0e5 !important; color: #173246; }
    .standard-print-title-band strong { display: block; padding: 1.5mm 3mm; font-size: 10pt; line-height: 1.1; text-align: center; text-transform: uppercase; }
    .records-table-wrap { box-sizing: border-box; width: 100%; min-height: 242mm; margin-top: 0; border: 0; overflow: visible !important; }
    .records-table { width: 100% !important; min-width: 0 !important; table-layout: fixed; border-collapse: collapse; font-size: 7.6pt; }
    .records-table thead { display: table-header-group; }
    .records-table tr { break-inside: avoid; page-break-inside: avoid; }
    .records-table th, .records-table td { box-sizing: border-box; height: 5mm; max-height: 5mm; padding: 0 1.5mm; border-bottom: 1px solid #d1d8dd; white-space: nowrap; overflow: hidden; text-overflow: clip; line-height: 4.8mm; }
    .records-table tbody td:not(:nth-last-child(2)):not(:last-child) { border-right: 1px solid #000; }
    .records-table tbody tr:last-child td { border-bottom: 1px solid #000; }
    .records-table td strong, .records-table td span { white-space: nowrap; }
    .records-table th { height: 6mm; max-height: 6mm; border-right: 1px solid #000; border-bottom: 1px solid #000; background: #fff !important; color: #000; font-size: 8pt; font-weight: 700; line-height: 5.8mm; }
    .records-table th:first-child { border-left: 0; }
    .records-table th:nth-last-child(2) { border-right: 0; }
    .records-table tbody tr:hover { background: transparent; }
    .records-table .actions-column, .records-table tr > :last-child { display: none !important; }
    .records-table col.record-col-actions { visibility: collapse; width: 0 !important; }
    .records-table col.record-col-id { width: 7%; }
    .records-table col.record-col-name { width: 34%; }
    .records-table col.record-col-document { width: 21%; }
    .records-table col.record-col-city { width: 24%; }
    .records-table col.record-col-status { width: 14%; }
    .records-table .groups-colgroup .record-col-id { width: 7%; }
    .records-table .groups-colgroup .record-col-group-name { width: 28%; }
    .records-table .groups-colgroup .record-col-notes { width: 51%; }
    .records-table .groups-colgroup .record-col-status { width: 14%; }
    .records-table .users-colgroup .record-col-id { width: 7%; }
    .records-table .users-colgroup .record-col-username { width: 15%; }
    .records-table .users-colgroup .record-col-user-name { width: 24%; }
    .records-table .users-colgroup .record-col-email { width: 25%; }
    .records-table .users-colgroup .record-col-profile { width: 16%; }
    .records-table .users-colgroup .record-col-status { width: 13%; }
    .standard-print-footer { position: fixed; right: 7mm; bottom: 6mm; left: 7mm; display: flex !important; align-items: center; justify-content: space-between; padding-top: 2mm; border-top: 1px solid #000; color: #263f50; font-size: 7.5pt; line-height: 1; }
    .standard-print-page-number { font-weight: 700; }
}
