:root {
  --orange: #ef7d00;
  --orange-dark: #dd6800;
  --red: #e6332a;
  --blue: #0069b4;
  --blue-dark: #005692;
  --navy: #00335e;
  --navy-deep: #001f3b;
  --ink: #121a24;
  --muted: #607083;
  --line: #dce4eb;
  --canvas: #f3f7fa;
  --surface: #fff;
  --soft-blue: #eaf5fb;
  --soft-green: #eaf8f2;
  --green: #138a5b;
  --soft-amber: #fff6e5;
  --amber: #a95f00;
  --soft-red: #fdeeee;
  --shadow: 0 12px 34px rgba(0, 43, 80, .1);
  --shadow-soft: 0 3px 12px rgba(0, 43, 80, .07);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { min-height: 100vh; margin: 0; color: var(--ink); font-family: Manrope, "Segoe UI", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(27px, 3vw, 38px); letter-spacing: -1.3px; line-height: 1.15; }
h2 { margin-bottom: 8px; font-size: 21px; letter-spacing: -.5px; }
h3 { margin-bottom: 7px; font-size: 17px; }
p { color: var(--muted); line-height: 1.55; }
small { color: var(--muted); }
code { padding: 4px 7px; color: var(--navy); border-radius: 6px; background: var(--soft-blue); font-size: 12px; }

.app-shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 28px 20px 18px; color: #fff; background: linear-gradient(180deg, #053e6d 0%, var(--navy-deep) 100%); }
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { width: 46px; height: 46px; object-fit: contain; }
.brand span { display: flex; flex-direction: column; min-width: 0; }
.brand strong { font-size: 20px; letter-spacing: -.5px; white-space: nowrap; }
.brand small { margin-top: 2px; font-size: 9px; font-weight: 800; letter-spacing: 1.6px; }
.brand-inverse small { color: rgba(255,255,255,.6); }
.side-nav { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 7px; margin: 28px -7px 14px 0; padding-right: 7px; overflow-x: hidden; overflow-y: auto; scrollbar-color: rgba(255,255,255,.2) transparent; scrollbar-width: thin; }
.nav-group { flex: 0 0 auto; border-radius: 11px; }
.nav-group summary { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; color: #8fb8d4; border-radius: 9px; cursor: pointer; font-size: 10px; font-weight: 800; letter-spacing: 1.25px; list-style: none; text-transform: uppercase; transition: .18s ease; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-group summary:focus { outline: none; }
.nav-group summary:focus-visible { box-shadow: 0 0 0 2px rgba(159,202,229,.65); }
.nav-group-label { display: flex; min-width: 0; align-items: center; gap: 11px; }
.nav-group-label > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-group-items { display: grid; gap: 3px; padding: 2px 0 7px 9px; }
.nav-chevron { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; transition: transform .18s ease; }
.nav-group[open] > summary .nav-chevron { transform: rotate(180deg); }
.side-nav a { display: flex; min-height: 42px; align-items: center; gap: 12px; padding: 9px 11px; color: rgba(255,255,255,.75); border: 1px solid transparent; border-radius: 10px; font-size: 13px; font-weight: 680; line-height: 1.25; transition: .18s ease; }
.side-nav a:hover { color: white; background: rgba(255,255,255,.07); }
.side-nav a.active { position: relative; color: white; background: rgba(255,255,255,.14); }
.side-nav a.active::before { position: absolute; left: -1px; width: 3px; height: 25px; content: ""; border-radius: 3px; background: var(--orange); }
.nav-icon { width: 20px; height: 20px; flex: 0 0 auto; color: #9fcae5; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.75; transition: .18s ease; }
.side-nav a:hover .nav-icon, .side-nav a.active .nav-icon { color: #fff; }
.side-nav a.active .nav-icon { filter: drop-shadow(0 0 5px rgba(255,255,255,.22)); }
.sidebar-user { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 11px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: rgba(255,255,255,.08); }
.sidebar-user span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; }
.sidebar-user strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user small { color: rgba(255,255,255,.58); font-size: 10px; }
.sidebar-user a { color: #9fc5de; font-size: 11px; font-weight: 700; }

.workspace { min-width: 0; background: var(--canvas); }
.topbar { display: flex; min-height: 76px; align-items: center; justify-content: space-between; padding: 14px 34px; border-bottom: 1px solid var(--line); background: white; }
.topbar > div:first-child { display: flex; flex-direction: column; }
.topbar strong { font-size: 14px; }
.topbar small { margin-top: 3px; font-size: 11px; }
.topbar-actions, .heading-actions, .client-actions, .form-actions { display: flex; align-items: center; gap: 10px; }
.page-content { width: min(1500px, 100%); margin: 0 auto; padding: 34px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-heading p { margin-bottom: 0; }
.page-heading .eyebrow + h1 { margin-top: 8px; }
.eyebrow { display: inline-block; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; }
.eyebrow.inverse { color: #9bd8ff; }
.back-link { display: block; margin-bottom: 20px; color: var(--blue); font-size: 13px; font-weight: 750; }

.btn { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border: 1px solid transparent; border-radius: 9px; background: transparent; font-size: 13px; font-weight: 750; transition: .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.btn-primary { color: #fff; border-color: var(--blue); background: var(--blue); box-shadow: 0 5px 12px rgba(0,105,180,.18); }
.btn-primary:hover { background: var(--blue-dark); }
.btn-accent { color: #fff; border-color: var(--orange); background: var(--orange); }
.btn-accent:hover { background: var(--orange-dark); }
.btn-secondary { color: var(--ink); border-color: var(--line); background: #fff; }
.btn-secondary:hover { border-color: #b9c7d2; background: #f9fbfc; }
.btn-danger { color: #fff; border-color: #c42b25; background: #c42b25; }
.btn-danger:hover { background: #a82420; }
.btn-danger-outline { color: #b52924; border-color: #efc3c0; background: #fff; }
.btn-danger-outline:hover { border-color: #d88d88; background: var(--soft-red); }
.btn-small { min-height: 34px; padding: 6px 11px; font-size: 11px; }
.btn-block { width: 100%; }
.btn-microsoft { color: #1f1f1f; border-color: #8c8c8c; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.btn-microsoft:hover { border-color: #5f5f5f; background: #f7f7f7; }
.microsoft-mark { display: grid; width: 18px; height: 18px; grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); gap: 1px; }
.microsoft-mark i:nth-child(1) { background: #f25022; }
.microsoft-mark i:nth-child(2) { background: #7fba00; }
.microsoft-mark i:nth-child(3) { background: #00a4ef; }
.microsoft-mark i:nth-child(4) { background: #ffb900; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 19px 0; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .6px; }
.login-divider::before, .login-divider::after { height: 1px; flex: 1; content: ""; background: var(--line); }
.login-form-panel .message-stack { margin-bottom: 16px; }
.text-link { color: var(--blue); font-size: 12px; font-weight: 750; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }
.stat-card { position: relative; min-height: 126px; padding: 23px 20px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-soft); }
.stat-card > span { display: block; color: #536173; font-size: 12px; font-weight: 650; }
.stat-card > strong { display: block; margin: 11px 0 5px; font-size: 27px; letter-spacing: -1px; }
.stat-card > small { font-size: 10px; }
.stat-card > i { position: absolute; top: 18px; right: 18px; display: grid; width: 32px; height: 32px; place-items: center; color: var(--blue); border-radius: 9px; background: var(--soft-blue); font-size: 12px; font-style: normal; font-weight: 800; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, .72fr); gap: 18px; }
.panel { overflow: hidden; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow-soft); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-head p { margin: 4px 0 0; font-size: 12px; }
.quick-card { padding: 27px; color: white; border-radius: var(--radius); background: linear-gradient(145deg, #064f84, var(--navy)); box-shadow: var(--shadow); }
.quick-card h2 { margin-top: 12px; font-size: 23px; }
.quick-card p { color: rgba(255,255,255,.7); font-size: 13px; }
.quick-search-form { display: grid; gap: 9px; margin-top: 18px; }
.quick-search-form label { color: rgba(255,255,255,.82); font-size: 11px; font-weight: 750; }
.quick-search-form .form-control { border-color: rgba(255,255,255,.24); }
.quick-search-link { display: block; margin-top: 13px; color: #b9def6; font-size: 10px; font-weight: 700; text-align: center; }
.quick-search-link:hover { color: white; }
.mini-panel { margin-top: 17px; }
.mini-panel p { margin: 9px 0 0; font-size: 12px; }
.warning-text { color: var(--amber); font-weight: 700; }

.table-wrap { overflow-x: auto; margin: 0 -22px -22px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 12px 15px; color: #7a8795; border-top: 1px solid #edf1f4; border-bottom: 1px solid #e8edf1; background: #fafcfd; font-size: 9px; letter-spacing: .7px; text-align: left; text-transform: uppercase; }
td { padding: 13px 15px; border-bottom: 1px solid #edf1f4; vertical-align: middle; }
.sort-link { display: inline-flex; align-items: center; gap: 7px; color: inherit; white-space: nowrap; }
.sort-link span { min-width: 12px; color: #93a4b1; font-size: 11px; line-height: 1; }
th[aria-sort="ascending"] .sort-link, th[aria-sort="descending"] .sort-link { color: var(--blue); }
th[aria-sort="ascending"] .sort-link span, th[aria-sort="descending"] .sort-link span { color: var(--blue); }
.sort-link:hover { color: var(--blue); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdfe; }
td strong { display: block; font-size: 12px; }
td small { display: block; margin-top: 3px; font-size: 10px; }
.entity { display: flex; min-width: 180px; align-items: center; gap: 10px; }
.entity > span:last-child { min-width: 0; }
.avatar { display: inline-grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; color: var(--blue); border-radius: 9px; background: var(--soft-blue); font-size: 11px; font-weight: 800; }
.large-avatar { width: 48px; height: 48px; }
.empty-cell { padding: 42px; color: var(--muted); text-align: center; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.badge::before { width: 6px; height: 6px; content: ""; border-radius: 999px; background: currentColor; }
.badge-success, .badge-success, .badge-authorized { color: var(--green); background: var(--soft-green); }
.badge-warning, .badge-warning { color: var(--amber); background: var(--soft-amber); }
.badge-danger, .badge-failed { color: #c42b25; background: var(--soft-red); }
.badge-info, .badge-running { color: var(--blue); background: var(--soft-blue); }
.badge-neutral { color: #52677a; background: #edf2f6; }

.notice { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; padding: 15px 17px; border: 1px solid #cbe2f0; border-radius: 11px; background: var(--soft-blue); }
.notice i, .rule-note i { display: grid; width: 26px; height: 26px; flex: 0 0 auto; place-items: center; color: white; border-radius: 7px; background: var(--blue); font-size: 12px; font-style: normal; font-weight: 800; }
.notice strong { font-size: 12px; }
.notice p { margin: 3px 0 0; font-size: 11px; }
.sync-strip { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 1px; margin-bottom: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.sync-strip > div { display: flex; min-height: 75px; flex-direction: column; justify-content: center; padding: 14px 18px; background: white; }
.sync-strip span { color: var(--muted); font-size: 10px; }
.sync-strip strong { margin-top: 5px; font-size: 13px; }
.filter-row { display: flex; gap: 10px; margin-bottom: 20px; }
.filter-row .form-control { flex: 1; }
.list-stack { display: grid; gap: 10px; }
.list-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px; border: 1px solid var(--line); border-radius: 11px; }
.list-card p { margin: 4px 0; font-size: 11px; }
.list-card small { font-size: 10px; }
.list-card-actions { display: grid; width: 136px; flex: 0 0 136px; gap: 8px; }
.list-card-actions .btn { width: 100%; }
.membership-card { display: grid; grid-template-columns: minmax(190px, 1fr) 185px 128px; align-items: center; gap: 10px; }
.membership-main { min-width: 0; }
.membership-main .badge { margin: 3px 5px 0 0; }
.role-label { display: inline-block; margin: 0 5px 3px 0; color: var(--muted); }
.muted-role { font-style: italic; }
.membership-quick-controls { display: grid; gap: 7px; padding: 0 4px; }
.membership-quick-controls form { margin: 0; }
.membership-quick-controls form.is-submitting { opacity: .55; pointer-events: none; }
.switch-control { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 9px; cursor: pointer; border-radius: 9px; background: #f5f8fa; }
.switch-control > span:first-child { display: grid; min-width: 0; }
.switch-control strong { font-size: 11px; }
.switch-control small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.switch { position: relative; display: inline-flex; width: 36px; height: 20px; flex: 0 0 36px; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-track { position: absolute; inset: 0; border-radius: 999px; background: #aebbc5; transition: background .16s ease; }
.switch-track::after { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; content: ""; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .16s ease; }
.switch input:checked + .switch-track { background: var(--blue); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 3px solid rgba(0,105,180,.2); outline-offset: 2px; }
.switch input:disabled + .switch-track { opacity: .45; }
.permission-summary-link { color: var(--blue); font-size: 9px; font-weight: 750; text-align: right; }
.permission-summary-links { display: grid; gap: 3px; }
.table-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.table-actions form { margin: 0; }
.request-permission-result { display: flex; grid-column: 1 / -1; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 5px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.request-permission-result > strong { margin-right: 2px; color: var(--ink); font-size: 11px; }
.empty-permissions { color: var(--amber); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.person-management { grid-template-columns: minmax(0, 1.65fr) minmax(290px, .7fr); align-items: start; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 12px; margin-bottom: 18px; }
.account-card { display: flex; min-height: 105px; flex-direction: column; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow-soft); }
.account-card span { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.account-card strong { margin: 9px 0 5px; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.account-card small { font-size: 10px; }
.notice-warning { color: var(--amber); border-color: #eed5aa; background: var(--soft-amber); }
.notice-warning i { background: var(--amber); }
.confirm-card { width: min(620px, 100%); margin: 8vh auto 0; padding: 34px; }
.confirm-card h1 { margin-top: 10px; }

.form-panel { width: min(720px, 100%); }
.field { margin-bottom: 17px; }
.field label { display: block; margin-bottom: 7px; color: #263443; font-size: 12px; font-weight: 750; }
.field-check { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; column-gap: 10px; row-gap: 5px; }
.field-check .form-check-input { flex: 0 0 18px; margin: 0; }
.field-check label { flex: 0 1 auto; margin: 0; }
.field-check > small, .field-check > .field-error, .field-check > .errorlist { flex: 0 0 100%; margin: 0; padding-left: 28px; line-height: 1.45; }
.permission-field { margin: 20px 0; padding: 17px; border: 1px solid var(--line); border-radius: 11px; background: #f8fafb; }
.permission-field legend { padding: 0 5px; color: #263443; font-size: 12px; font-weight: 750; }
.permission-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 9px; padding: 0; list-style: none; }
.permission-options li { margin: 0; }
.permission-options label { display: flex; min-height: 42px; align-items: center; gap: 9px; margin: 0; padding: 9px 11px; border: 1px solid #dce4ea; border-radius: 9px; background: white; cursor: pointer; }
.permission-options input { width: 17px; height: 17px; flex: 0 0 17px; accent-color: var(--blue); }
.permission-field > small { display: block; color: var(--muted); font-size: 10px; line-height: 1.45; }
.form-control { width: 100%; min-height: 44px; padding: 10px 13px; color: var(--ink); border: 1px solid #cfd9e1; border-radius: 9px; outline: none; background: #fff; }
textarea.form-control { min-height: 92px; resize: vertical; }
.form-control:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,105,180,.12); }
.form-check-input { width: 18px; height: 18px; accent-color: var(--blue); }
.field-error, .errorlist { display: block; margin: 6px 0 0; padding: 0; color: #c42b25; font-size: 11px; list-style: none; }
.form-actions { justify-content: flex-end; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.person-summary { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; padding: 15px; border-radius: 10px; background: var(--canvas); }
.person-summary p { margin: 3px 0 0; font-size: 11px; }

.search-hero { padding: 25px; border-radius: var(--radius); background: linear-gradient(130deg, var(--navy-deep), #075387); box-shadow: var(--shadow); }
.search-form { display: grid; grid-template-columns: minmax(250px, 1.5fr) minmax(200px, 1fr) auto; align-items: end; gap: 14px; }
.search-form label { color: #dbeaf4; }
.search-form .field { margin: 0; }
.result-section { margin-top: 24px; }
.result-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.result-header h2 { margin: 6px 0 0; }
.eligibility-card { display: grid; grid-template-columns: auto 1fr; gap: 16px; margin-bottom: 12px; padding: 19px; border: 1px solid var(--line); border-left: 4px solid #9aa8b5; border-radius: 12px; background: white; box-shadow: var(--shadow-soft); }
.decision-liberado { border-left-color: var(--green); }
.decision-liberado_com_restricao, .decision-requer_confirmacao { border-left-color: var(--orange); }
.decision-nao_liberado { border-left-color: var(--red); }
.decision-mark { display: grid; width: 40px; height: 40px; place-items: center; color: var(--navy); border-radius: 10px; background: var(--soft-blue); font-size: 18px; font-weight: 850; }
.decision-content { display: grid; grid-template-columns: 1fr auto; gap: 8px 18px; }
.decision-content h3, .decision-content p { margin-bottom: 3px; }
.decision-reason { grid-column: 1 / -1; margin: 5px 0 0 !important; }

.message-stack { display: grid; gap: 8px; margin-bottom: 18px; }
.alert { padding: 13px 15px; border: 1px solid #cbe2f0; border-radius: 9px; color: #155274; background: var(--soft-blue); font-size: 12px; font-weight: 650; }
.alert-success { color: #116c48; border-color: #bce6d4; background: var(--soft-green); }
.alert-error { color: #a32925; border-color: #f1c2bf; background: var(--soft-red); }
.alert-warning { color: var(--amber); border-color: #eed5aa; background: var(--soft-amber); }
.standard-modal { width: min(680px, calc(100% - 32px)); max-height: calc(100vh - 32px); padding: 0; overflow: visible; border: 0; border-radius: 17px; background: transparent; box-shadow: 0 30px 90px rgba(0,32,55,.28); }
.standard-modal::backdrop { background: rgba(0,32,55,.58); backdrop-filter: blur(3px); }
.standard-modal-card { overflow: hidden; border: 1px solid rgba(255,255,255,.65); border-radius: 17px; background: white; }
.standard-modal-header { display: flex; align-items: center; gap: 14px; padding: 24px 26px 16px; }
.standard-modal-header h2 { margin: 4px 0 0; font-size: 23px; }
.modal-icon { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; color: white; border-radius: 12px; background: var(--navy); font-size: 19px; font-weight: 850; }
.standard-modal-message { margin: 0; padding: 0 26px 20px; color: var(--muted); line-height: 1.55; }
.confirmation-changes { margin: 0 26px 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; }
.change-head, .change-row { display: grid; grid-template-columns: minmax(180px, 1.4fr) minmax(100px, .8fr) minmax(100px, .8fr); gap: 12px; padding: 11px 13px; }
.change-head { color: var(--muted); background: #f3f6f8; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.change-row { align-items: center; border-top: 1px solid var(--line); font-size: 11px; }
.change-row span:first-child { font-weight: 750; }
.change-row span:nth-child(2) { color: var(--muted); }
.change-row span:nth-child(3) { color: var(--navy); font-weight: 750; }
.standard-modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 26px; border-top: 1px solid var(--line); background: #f8fafb; }
.modal-confirm-danger { color: white; border-color: var(--red); background: var(--red); }
.modal-confirm-danger:hover { background: #a7221d; }
.empty-state { padding: 26px; color: var(--muted); text-align: center; }
.empty-state.large { padding: 55px 25px; }
.empty-state.standalone { width: min(620px, calc(100% - 40px)); margin: 12vh auto; padding: 50px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: var(--shadow); }
.empty-state strong { display: block; margin-bottom: 8px; color: var(--ink); font-size: 19px; }

.external-body { background: var(--canvas); }
.client-topbar { display: flex; min-height: 74px; align-items: center; justify-content: space-between; padding: 13px max(30px, calc((100vw - 1240px)/2)); border-bottom: 1px solid var(--line); background: white; }
.client-topbar .brand img { width: 42px; height: 42px; }
.client-topbar .brand strong { color: var(--navy); }
.client-actions { flex-wrap: wrap; justify-content: flex-end; }
.company-context { padding: 10px 14px; color: var(--navy); border: 1px solid var(--line); border-radius: 9px; font-size: 12px; font-weight: 750; line-height: 1.25; white-space: normal; }
.user-pill { padding: 8px 12px; color: var(--blue); border-radius: 999px; background: var(--soft-blue); font-size: 11px; font-weight: 750; }
.client-main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 70px; }
.client-heading { align-items: center; }
.client-tabs { display: flex; gap: 28px; margin: -5px 0 22px; border-bottom: 1px solid var(--line); }
.client-tabs a { padding: 12px 1px; color: var(--muted); font-size: 12px; font-weight: 750; }
.client-tabs a.active { color: var(--blue); border-bottom: 2px solid var(--blue); }
.client-stats { grid-template-columns: repeat(4, 1fr); }
.rule-note { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 15px; color: var(--muted); border: 1px dashed #bac8d2; border-radius: 11px; background: rgba(255,255,255,.5); font-size: 11px; }
.rule-note i { background: var(--navy); }
.selector-hero { max-width: 720px; margin: 20px auto 32px; text-align: center; }
.selector-hero h1 { margin-top: 10px; }
.company-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.company-card { display: grid; grid-template-columns: auto 1fr; gap: 15px; padding: 22px; text-align: left; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: var(--shadow-soft); }
.company-card button { grid-column: 1 / -1; }
.company-card h2 { margin: 3px 0 5px; font-size: 17px; }
.company-card p { margin: 0 0 3px; font-size: 11px; }
.company-logo { display: grid; width: 47px; height: 47px; place-items: center; color: #fff; border-radius: 12px; background: linear-gradient(145deg, var(--blue), var(--navy)); font-size: 12px; font-weight: 850; }
.access-note { margin-top: 28px; padding: 14px; color: var(--muted); border-radius: 10px; background: #f2f4f6; font-size: 11px; line-height: 1.5; }
.access-note.centered { text-align: center; }
.form-page { max-width: 980px; margin: 0 auto; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .7fr); align-items: start; gap: 18px; }
.form-layout .form-panel { width: 100%; }
.context-card { padding: 24px; color: white; border-radius: 14px; background: linear-gradient(145deg, var(--navy), var(--navy-deep)); box-shadow: var(--shadow); }
.context-card .company-logo { background: rgba(255,255,255,.14); }
.context-card h3 { margin-top: 17px; font-size: 19px; }
.context-card p, .context-card li { color: rgba(255,255,255,.72); font-size: 11px; line-height: 1.55; }
.context-card ul { padding-left: 18px; }
.current-status { display: flex; flex-direction: column; margin-top: 20px; padding: 13px; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; background: rgba(255,255,255,.08); }
.current-status span { color: rgba(255,255,255,.55); font-size: 9px; text-transform: uppercase; }
.current-status strong { margin-top: 4px; font-size: 13px; }
.timeline { position: relative; padding-left: 15px; }
.timeline article { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 13px; padding: 0 0 24px; }
.timeline article:not(:last-child)::before { position: absolute; top: 13px; left: 5px; width: 1px; height: calc(100% - 2px); content: ""; background: var(--line); }
.timeline-mark { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 5px; border: 3px solid white; border-radius: 999px; background: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.timeline p { margin: 4px 0; font-size: 11px; }

.login-page { display: grid; min-height: 100vh; place-items: center; padding: 34px; background: radial-gradient(circle at 10% 5%, rgba(0,105,180,.14), transparent 30%), #e7eef4; }
.login-card { display: grid; width: min(1180px, 100%); min-height: 720px; grid-template-columns: 1.08fr .92fr; overflow: hidden; border-radius: 22px; background: white; box-shadow: 0 28px 75px rgba(0,44,80,.18); }
.compact-login { min-height: 620px; }
.login-brand-panel { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 52px; overflow: hidden; color: white; background: linear-gradient(145deg, var(--navy-deep), var(--navy) 70%, #0667a7); }
.login-brand-panel::after { position: absolute; right: -90px; bottom: -140px; width: 360px; height: 360px; content: ""; border: 48px solid rgba(255,255,255,.07); border-radius: 999px; }
.login-brand-panel h1 { position: relative; z-index: 1; max-width: 520px; margin-top: 10px; font-size: clamp(38px, 5vw, 54px); }
.login-brand-panel p { position: relative; z-index: 1; max-width: 520px; color: rgba(255,255,255,.72); }
.brand-shape { position: absolute; top: 180px; right: 80px; width: 220px; height: 62px; border-radius: 16px; background: linear-gradient(90deg, var(--orange), var(--red)); transform: rotate(-14deg); }
.login-form-panel { display: flex; width: min(480px, 100%); flex-direction: column; justify-content: center; justify-self: center; padding: 48px; }
.login-form-panel h2 { margin: 10px 0 8px; font-size: 31px; }
.login-form-panel > p { margin-bottom: 27px; font-size: 13px; }
.login-form-panel .text-link { margin-top: 22px; text-align: center; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 80px minmax(0, 1fr); }
  .sidebar { padding: 22px 12px; }
  .sidebar .brand span, .nav-group-label > span, .nav-chevron, .side-nav a > span { display: none; }
  .side-nav { margin-right: 0; padding-right: 0; }
  .nav-group summary, .side-nav a { justify-content: center; padding: 10px; }
  .nav-group-items { padding-left: 0; }
  .sidebar-user { grid-template-columns: 1fr; justify-items: center; }
  .sidebar-user span:nth-child(2), .sidebar-user a { display: none; }
  .sidebar .brand { justify-content: center; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .two-columns, .account-grid { grid-template-columns: 1fr; }
  .membership-card { grid-template-columns: minmax(190px, 1fr) 185px 128px; }
  .company-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; flex-direction: row; align-items: center; justify-content: space-between; padding: 10px 16px; }
  .sidebar .brand img { width: 38px; height: 38px; }
  .side-nav { display: none; }
  .sidebar-user { background: transparent; }
  .topbar { display: none; }
  .page-content { padding: 23px 16px; }
  .page-heading, .client-heading { flex-direction: column; align-items: stretch; }
  .page-heading .btn, .page-heading form, .heading-actions { width: 100%; }
  .heading-actions { flex-direction: column; }
  .heading-actions .btn { width: 100%; }
  .list-card { align-items: stretch; flex-direction: column; }
  .membership-card { display: grid; grid-template-columns: 1fr; }
  .membership-quick-controls { padding: 5px 0; }
  .permission-summary-link { text-align: left; }
  .list-card-actions { width: 100%; flex-basis: auto; }
  .permission-options { grid-template-columns: 1fr; }
  .stats-grid, .client-stats { grid-template-columns: 1fr; }
  .stat-card { min-height: 105px; }
  .dashboard-grid, .two-columns, .form-layout, .search-form { grid-template-columns: 1fr; }
  .sync-strip { grid-template-columns: 1fr 1fr; }
  .sync-strip > div:first-child { grid-column: 1 / -1; }
  .filter-row { flex-direction: column; }
  .filter-row .btn { width: 100%; }
  .client-topbar { padding: 11px 16px; }
  .client-topbar .brand span, .company-context, .user-pill { display: none; }
  .client-main { width: min(100% - 28px, 1180px); padding-top: 27px; }
  .company-grid { grid-template-columns: 1fr; }
  .login-page { padding: 0; background: white; }
  .login-card { min-height: 100vh; grid-template-columns: 1fr; border-radius: 0; }
  .login-brand-panel { min-height: 270px; padding: 28px; }
  .login-brand-panel > div:last-child { margin-top: 60px; }
  .login-brand-panel h1 { font-size: 31px; }
  .login-brand-panel p { display: none; }
  .brand-shape { top: 110px; right: -25px; width: 170px; height: 45px; }
  .login-form-panel { padding: 35px 25px 50px; }
  .decision-content { grid-template-columns: 1fr; }
  .decision-reason { grid-column: auto; }
  .result-header { align-items: flex-start; flex-direction: column; gap: 8px; }
  .standard-modal { width: min(100% - 20px, 680px); }
  .change-head, .change-row { grid-template-columns: 1fr; gap: 4px; }
  .change-head { display: none; }
  .change-row span:nth-child(2)::before { content: "Antes: "; font-weight: 750; }
  .change-row span:nth-child(3)::before { content: "Depois: "; font-weight: 750; }
  .standard-modal-actions { flex-direction: column-reverse; }
  .standard-modal-actions .btn { width: 100%; }
}
