:root {
  color-scheme: light;
  --green: #b9f467;
  --green-hover: #a8e257;
  --green-dark: #3c681f;
  --green-soft: #eaf4de;
  --ink: #15251e;
  --muted: #626f66;
  --surface: #fff;
  --surface-alt: #f3f6ef;
  --line: #dfe5db;
  --dark: #101e18;
  --danger: #9f3f31;
  --danger-soft: #f9eae6;
  --warning: #8b5a20;
  --warning-soft: #fbf0df;
  --shadow: 0 24px 70px #10251a12, 0 10px 30px #10251a0c;
  --sidebar-width: 270px;
  --scrollbar-thumb: #9aad94;
  --scrollbar-hover: #718b68;
  --scrollbar-track: #edf2e8;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--surface-alt);
}

* { box-sizing: border-box; }
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); border-radius: 10px; }
::-webkit-scrollbar-thumb { border: 2px solid var(--scrollbar-track); border-radius: 10px; background: var(--scrollbar-thumb); }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); }
::-webkit-scrollbar-corner { background: var(--scrollbar-track); }
html, body { min-height: 100%; margin: 0; }
body { background: var(--surface-alt); -webkit-font-smoothing: antialiased; }
body.is-locked { overflow: hidden; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .52; }
[hidden] { display: none !important; }
svg { display: block; }
::selection { color: var(--dark); background: var(--green); }
:focus-visible { outline: 3px solid #5a971d; outline-offset: 3px; }
.skip-link { position: fixed; z-index: 3000; left: 18px; top: -80px; padding: 11px 16px; border-radius: 7px; background: var(--green); color: var(--dark); font-weight: 700; }
.skip-link:focus { top: 12px; }
.eyebrow { display: block; color: var(--green-dark); font-size: .69rem; line-height: 1.4; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.status-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgb(185 244 103 / 10%); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 43px; padding: 0 16px; border: 1px solid transparent; border-radius: 8px; font-size: .88rem; font-weight: 700; transition: background .15s, border-color .15s, color .15s, transform .15s; }
.button svg { width: 18px; height: 18px; }
.button-primary { color: var(--dark); background: var(--green); border-color: var(--green); }
.button-primary:hover:not(:disabled) { background: var(--green-hover); border-color: var(--green-hover); }
.button-secondary { color: var(--ink); background: var(--surface); border-color: var(--line); }
.button-secondary:hover:not(:disabled) { border-color: #9cbc78; color: var(--green-dark); }
.button-ghost { color: #eaf1e9; background: transparent; border-color: #ffffff2b; }
.button-ghost:hover { color: var(--green); border-color: #b9f46778; background: #ffffff08; }
.button-wide { width: 100%; justify-content: space-between; min-height: 50px; padding-inline: 20px; }

/* Carregamento e login */
.loading-view { position: fixed; z-index: 2500; inset: 0; display: grid; place-content: center; justify-items: center; gap: 17px; background: var(--dark); color: #d9e3d9; font-size: .88rem; }
.loading-mark { width: 38px; height: 38px; border: 3px solid #ffffff18; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-view { min-height: 100dvh; display: grid; place-items: center; padding: 40px; background: radial-gradient(circle at 10% 15%, #b9f46710, transparent 28%), var(--surface-alt); }
.login-card { display: grid; grid-template-columns: minmax(360px, .92fr) minmax(410px, 1.08fr); width: min(960px, 100%); min-height: 620px; overflow: hidden; border: 1px solid #dce4d8; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.login-brand-panel { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 48px; overflow: hidden; color: #fff; background: var(--dark); }
.login-brand-panel::before, .login-brand-panel::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid #b9f46717; pointer-events: none; }
.login-brand-panel::before { width: 430px; height: 430px; right: -250px; top: 90px; }
.login-brand-panel::after { width: 270px; height: 270px; right: -112px; top: 170px; box-shadow: 0 0 0 50px #b9f46705; }
.login-brand-panel > img { position: relative; z-index: 1; width: 168px; height: 68px; object-fit: contain; object-position: left center; }
.login-brand-copy { position: relative; z-index: 1; margin-block: auto; }
.login-brand-copy .eyebrow { margin-bottom: 19px; color: var(--green); }
.login-brand-copy h1 { margin: 0 0 24px; color: #fff; font-family: Manrope, Inter, "Segoe UI", sans-serif; font-size: clamp(2.9rem, 5vw, 4.3rem); line-height: .99; font-weight: 600; letter-spacing: -.065em; }
.login-brand-copy p { max-width: 320px; margin: 0; color: #b5c5b7; font-size: .91rem; line-height: 1.8; }
.login-trust { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; color: #aebcaf; font-size: .75rem; }
.login-form-panel { display: flex; flex-direction: column; justify-content: center; padding: 58px 68px 40px; }
.login-form-heading { margin-bottom: 31px; }
.login-form-heading .eyebrow { margin-bottom: 12px; }
.login-form-heading h2 { margin: 0 0 12px; font-family: Manrope, Inter, "Segoe UI", sans-serif; font-size: 2rem; line-height: 1.15; font-weight: 650; letter-spacing: -.05em; }
.login-form-heading p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.6; }

/* User administration: independent, explicitly granted menu permissions. */
.users-form h2 { margin: 0 0 8px; }
.users-credentials { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 24px 0 14px; }
.users-credentials .field { min-width: 0; }
.users-credentials input { width: 100%; min-width: 0; }
#user-name, #user-search { text-transform: uppercase; }
.users-permissions { min-width: 0; margin: 28px 0 8px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; }
.users-permissions legend { padding: 0 8px; font-size: 1rem; font-weight: 800; }
.users-permissions > p { margin: 0 0 18px; color: var(--muted); font-size: .82rem; }
.users-permissions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.users-permission { display: flex; align-items: flex-start; gap: 12px; padding: 17px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfa; cursor: pointer; }
.users-permission:has(input:checked) { border-color: #94ba54; background: #f1f9e5; }
.users-permission:focus-within { outline: 2px solid #577b27; outline-offset: 2px; }
.module-form .users-permission input { flex: 0 0 20px; width: 20px; height: 20px; padding: 0; margin: 1px 0 0; accent-color: #527b20; }
.users-permission strong { display: block; color: var(--ink); font-size: .86rem; }
.users-permission small { display: block; margin-top: 5px; color: var(--muted); font-size: .74rem; line-height: 1.5; }
.users-badges { display: flex; flex-wrap: wrap; gap: 5px; max-width: 520px; }
.users-badges span { padding: 5px 8px; border-radius: 6px; color: #3b581e; background: #f0f6e8; font-size: .68rem; }
.users-row-actions { display: flex; gap: 15px; }
.users-feedback { padding: 13px 16px; border: 1px solid #efc4be; border-radius: 9px; color: #a83425; background: #fff7f5; font-size: .83rem; }
.module-table.users-table { min-width: 660px; }
@media (max-width: 850px) {
  .users-credentials { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .users-permissions-grid { grid-template-columns: minmax(0, 1fr); }
  .users-permissions { padding: 14px; }
}
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label, .status-filter legend { color: #536250; font-size: .74rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.input-shell { display: flex; align-items: center; min-height: 50px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfa; transition: border-color .15s, box-shadow .15s; }
.input-shell:focus-within { border-color: #82a85e; box-shadow: 0 0 0 3px #b9f46722; }
.input-shell > svg { width: 18px; height: 18px; margin-left: 15px; color: var(--green-dark); }
.input-shell input, .input-shell select { width: 100%; min-width: 0; height: 48px; padding: 0 13px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: .93rem; }
#usuario, #senha { text-transform: uppercase; }
.input-shell select { cursor: pointer; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; margin-right: 2px; border: 0; border-radius: 7px; color: #687568; background: transparent; }
.icon-button:hover { color: var(--green-dark); background: var(--green-soft); }
.icon-button svg { width: 18px; height: 18px; }
.form-feedback { margin: -2px 0 16px; padding: 11px 13px; border: 1px solid #edc8c0; border-radius: 7px; color: var(--danger); background: var(--danger-soft); font-size: .8rem; line-height: 1.5; }
.login-footer { margin: auto 0 0; padding-top: 34px; color: #859086; font-size: .7rem; text-align: center; }
.noscript-message { position: fixed; z-index: 4000; inset: 0; display: grid; place-items: center; padding: 30px; color: var(--ink); background: var(--surface-alt); text-align: center; }

/* Estrutura da aplicação */
.app-view { min-height: 100dvh; background: var(--surface-alt); }
.app-header { position: fixed; z-index: 1200; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 86px; padding: 11px 28px; color: #eef3ec; background: #101e18f8; border-bottom: 1px solid #ffffff10; box-shadow: 0 8px 28px #00000012; backdrop-filter: blur(18px); }
.header-brand, .header-user { display: flex; align-items: center; }
.header-brand { min-width: 0; gap: 24px; }
.header-brand > img { width: 150px; height: 60px; object-fit: contain; object-position: left center; }
.header-divider { width: 1px; height: 38px; background: #ffffff22; }
.header-title { display: grid; gap: 3px; min-width: 0; }
.header-title small { color: var(--green); font-size: .62rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.header-title strong { overflow: hidden; color: #fff; font-family: Manrope, Inter, sans-serif; font-size: 1rem; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.header-user { gap: 13px; }
.user-copy { display: grid; gap: 2px; text-align: right; }
.user-copy strong { color: #f5f8f4; font-size: .83rem; }
.user-copy span { max-width: 250px; overflow: hidden; color: #aabbad; font-size: .69rem; text-overflow: ellipsis; white-space: nowrap; }
.user-avatar { display: grid; place-items: center; width: 39px; height: 39px; border: 1px solid #b9f46745; border-radius: 50%; color: var(--green); background: #b9f4670f; font-size: .78rem; font-weight: 800; }
.menu-toggle { display: block; flex-shrink: 0; width: 42px; height: 42px; padding: 9px; border: 1px solid #ffffff28; border-radius: 8px; background: transparent; transition: background .2s ease, border-color .2s ease; }
.menu-toggle:hover { background: #b9f46715; border-color: #b9f46770; }
.menu-toggle span { display: block; width: 21px; height: 2px; margin: 4px 0; background: #fff; }
.app-layout { min-height: 100dvh; padding-top: 86px; }
.sidebar { position: fixed; z-index: 1000; top: 86px; bottom: 0; left: 0; display: flex; flex-direction: column; width: var(--sidebar-width); padding: 22px 16px 18px; overflow-y: auto; color: #dce7dd; background: #15261e; border-right: 1px solid #ffffff0c; }
.sidebar { --scrollbar-thumb: #526f5b; --scrollbar-hover: #8aaf70; --scrollbar-track: #15261e; overscroll-behavior: contain; transition: transform .2s ease, visibility .2s ease; }
.sidebar button { color: inherit; }
.sidebar-home, .menu-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 45px; padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; text-align: left; font-size: .84rem; font-weight: 650; }
.sidebar-home:hover, .menu-item:hover:not(:disabled), .sidebar-home.is-active, .menu-item.is-active { color: var(--green); background: #ffffff08; }
.menu-icon { display: grid; place-items: center; width: 27px; height: 27px; flex: 0 0 auto; border-radius: 7px; color: #aac1ad; background: #ffffff08; }
.is-active .menu-icon, .menu-item:hover:not(:disabled) .menu-icon { color: var(--dark); background: var(--green); }
.menu-icon svg { width: 16px; height: 16px; }
.menu-group { padding-top: 19px; }
.menu-group-title { display: block; padding: 0 12px 7px; color: #7f9484; font-size: .61rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.menu-item:disabled { color: #7f9184; opacity: .7; }
.menu-item:disabled::after { content: "Em breve"; margin-left: auto; color: #748478; font-size: .57rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.sidebar-footer { display: grid; gap: 8px; margin-top: auto; padding: 22px 12px 0; border-top: 1px solid #ffffff0e; }
.connection-pill { display: flex; align-items: center; gap: 9px; color: #b3c2b5; font-size: .7rem; }
.sidebar-footer small { color: #6f8174; font-size: .62rem; }
.sidebar-backdrop { position: fixed; z-index: 900; inset: 86px 0 0; border: 0; background: #06100b80; }
.main-content { min-height: calc(100dvh - 86px); margin-left: var(--sidebar-width); padding: 36px clamp(28px, 4vw, 58px) 54px; }
.main-content { transition: margin-left .2s ease; }
@media (min-width: 981px) {
  .app-view.sidebar-collapsed .sidebar { transform: translateX(-100%); visibility: hidden; }
  .app-view.sidebar-collapsed .main-content { margin-left: 0; }
}
.screen { width: min(1500px, 100%); margin: 0 auto; }
.screen-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.screen-heading .eyebrow { margin-bottom: 10px; }
.screen-heading h1 { margin: 0 0 8px; font-family: Manrope, Inter, sans-serif; font-size: clamp(1.9rem, 3vw, 2.65rem); line-height: 1.08; font-weight: 650; letter-spacing: -.055em; }
.screen-heading p { margin: 0; color: var(--muted); font-size: .86rem; }
.date-card { display: grid; gap: 4px; min-width: 174px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); text-align: right; }
.date-card span { color: var(--muted); font-size: .7rem; text-transform: capitalize; }
.date-card strong { color: var(--green-dark); font-size: .91rem; }

/* Tela inicial */
.dashboard-grid { display: grid; grid-template-columns: minmax(300px, .78fr) minmax(430px, 1.22fr); gap: 24px; align-items: stretch; }
.welcome-panel, .quick-panel { min-height: 455px; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 35px #10251a08; }
.welcome-panel { position: relative; display: flex; flex-direction: column; justify-content: flex-end; padding: 38px; overflow: hidden; color: #fff; background: var(--dark); }
.welcome-panel .eyebrow { position: relative; z-index: 1; margin-bottom: 16px; color: var(--green); }
.welcome-panel h2 { position: relative; z-index: 1; max-width: 480px; margin: 0 0 18px; font-family: Manrope, Inter, sans-serif; font-size: clamp(2rem, 3.2vw, 3rem); line-height: 1.06; font-weight: 550; letter-spacing: -.06em; }
.welcome-panel p { position: relative; z-index: 1; max-width: 410px; margin: 0; color: #b4c3b6; font-size: .83rem; line-height: 1.7; }
.welcome-orbit { position: absolute; inset: 0; opacity: .7; }
.welcome-orbit::before, .welcome-orbit::after, .welcome-orbit span { content: ""; position: absolute; border-radius: 50%; }
.welcome-orbit::before { width: 420px; height: 420px; top: -230px; right: -120px; border: 1px solid #b9f4672c; }
.welcome-orbit::after { width: 260px; height: 260px; top: -135px; right: -38px; border: 1px solid #b9f4671c; box-shadow: 0 0 0 55px #b9f46706; }
.welcome-orbit span { width: 7px; height: 7px; background: var(--green); box-shadow: 0 0 13px #b9f46780; }
.welcome-orbit span:nth-child(1) { top: 72px; right: 68px; }
.welcome-orbit span:nth-child(2) { top: 148px; right: 204px; width: 4px; height: 4px; }
.welcome-orbit span:nth-child(3) { top: 38px; right: 260px; width: 5px; height: 5px; }
.quick-panel { padding: 31px; background: var(--surface); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.panel-heading .eyebrow { margin-bottom: 8px; }
.panel-heading h2 { margin: 0; font-family: Manrope, Inter, sans-serif; font-size: 1.45rem; letter-spacing: -.045em; }
.count-badge { min-width: 31px; padding: 6px 9px; border-radius: 999px; color: var(--green-dark); background: var(--green-soft); font-size: .69rem; font-weight: 800; text-align: center; }
.quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.quick-action { display: grid; grid-template-columns: 42px minmax(0, 1fr) 19px; align-items: center; gap: 13px; min-height: 78px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fbfcfa; text-align: left; transition: transform .15s, border-color .15s, background .15s; }
.quick-action:hover:not(:disabled) { transform: translateY(-2px); border-color: #a9c68a; background: #f8fbf4; }
.quick-action:disabled { cursor: default; opacity: .58; }
.quick-action .quick-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 9px; color: var(--green-dark); background: var(--green-soft); }
.quick-action .quick-icon svg { width: 20px; height: 20px; }
.quick-action strong { display: block; overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.quick-action small { display: block; margin-top: 4px; color: var(--muted); font-size: .65rem; }
.quick-action > svg { width: 17px; height: 17px; color: #8da07f; }

/* Contas a receber */
.receivables-heading { align-items: center; }
.filter-panel { padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 8px 28px #10251a07; }
.status-filter { display: flex; align-items: center; gap: 4px; margin: 0 0 19px; padding: 0; border: 0; }
.status-filter legend { float: left; margin-right: 19px; padding: 9px 0; }
.status-filter label { cursor: pointer; }
.status-filter input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.status-filter span { display: block; padding: 9px 14px; border: 1px solid transparent; border-radius: 7px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.status-filter input:focus-visible + span { outline: 3px solid #5a971d; outline-offset: 2px; }
.status-filter input:checked + span { color: var(--green-dark); border-color: #cde3b6; background: var(--green-soft); }
.filter-grid { display: grid; grid-template-columns: minmax(315px, 1.35fr) minmax(95px, .35fr) minmax(210px, 1fr) minmax(210px, .8fr) auto; gap: 13px; align-items: end; }
.compact-field { min-width: 0; margin: 0; }
.compact-field input, .compact-field select { width: 100%; min-width: 0; height: 43px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: #fbfcfa; font-size: .82rem; }
.compact-field input:focus, .compact-field select:focus { outline: 0; border-color: #82a85e; box-shadow: 0 0 0 3px #b9f46722; }
.date-range { display: grid; grid-template-columns: minmax(130px, 1fr) auto minmax(130px, 1fr); align-items: center; gap: 8px; }
.date-range span { color: var(--muted); font-size: .7rem; }
.search-button { min-height: 43px; }
.results-area { margin-top: 22px; }
.summary-row { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(190px, .55fr) 1fr; gap: 13px; align-items: stretch; margin-bottom: 13px; }
.summary-card { display: grid; gap: 5px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.summary-card > span { color: var(--muted); font-size: .69rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.summary-card strong { font-family: Manrope, Inter, sans-serif; font-size: 1.55rem; line-height: 1.15; letter-spacing: -.045em; }
.summary-card small { color: #7a887b; font-size: .65rem; }
.primary-summary { color: #fff; border-color: var(--dark); background: var(--dark); }
.primary-summary > span, .primary-summary small { color: #aebdaf; }
.primary-summary strong { color: var(--green); }
.results-meta { display: flex; align-items: flex-end; justify-content: flex-end; gap: 13px; padding: 0 4px 9px; color: var(--muted); font-size: .68rem; }
.text-button { padding: 0; border: 0; color: var(--green-dark); background: transparent; font-size: .7rem; font-weight: 800; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.table-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: 0 8px 28px #10251a06; }
.table-scroll { overflow: auto; }
table { width: 100%; min-width: 1120px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { padding: 13px 14px; color: #718071; background: #f7f9f5; border-bottom: 1px solid var(--line); font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px 14px; border-bottom: 1px solid #ebeee8; color: #33453a; font-size: .76rem; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f9fbf7; }
td:nth-child(6) { min-width: 270px; max-width: 420px; font-weight: 600; }
.numeric { text-align: right; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px; color: var(--green-dark); background: var(--green-soft); font-size: .61rem; font-weight: 800; letter-spacing: .03em; white-space: nowrap; }
.status-badge.is-overdue, .status-badge.is-cancelled { color: var(--danger); background: var(--danger-soft); }
.status-badge.is-today, .status-badge.is-remittance { color: var(--warning); background: var(--warning-soft); }
.status-badge.is-reversal { color: #60566b; background: #eeeaf2; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 58px; padding: 11px 15px; border-top: 1px solid var(--line); }
.pagination-info { color: var(--muted); font-size: .7rem; }
.pagination-actions { display: flex; align-items: center; gap: 7px; }
.page-button { min-width: 34px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: #fff; font-size: .7rem; font-weight: 700; }
.page-button:hover:not(:disabled) { color: var(--green-dark); border-color: #9cbc78; }
.results-state { display: grid; justify-items: center; max-width: 470px; margin: 72px auto 0; text-align: center; }
.state-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 16px; border-radius: 50%; color: var(--green-dark); background: var(--green-soft); }
.state-icon svg { width: 24px; height: 24px; }
.results-state h2 { margin: 0 0 9px; font-family: Manrope, Inter, sans-serif; font-size: 1.1rem; letter-spacing: -.035em; }
.results-state p { max-width: 410px; margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.65; }
.results-state.is-error .state-icon { color: var(--danger); background: var(--danger-soft); }
.results-state.is-loading .state-icon { animation: breathe 1.1s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45; } }
.toast-region { position: fixed; z-index: 2200; right: 22px; bottom: 22px; display: grid; gap: 9px; width: min(380px, calc(100% - 44px)); }
.toast { padding: 13px 15px; border: 1px solid #cfe3bd; border-radius: 9px; color: #29441f; background: #f8fcf3; box-shadow: var(--shadow); font-size: .78rem; line-height: 1.5; }
.toast.is-error { color: var(--danger); border-color: #ecc7bf; background: #fff8f6; }

@media (max-width: 1220px) {
  :root { --sidebar-width: 245px; }
  .filter-grid { grid-template-columns: 1.4fr .4fr 1fr 1fr; }
  .search-button { grid-column: 4; justify-self: end; min-width: 130px; }
  .type-field { grid-column: 3; }
  .name-field { grid-column: 1 / 3; }
  .code-field { grid-column: 4; grid-row: 1; }
}

@media (max-width: 980px) {
  .app-header { padding-inline: 18px; }
  .menu-toggle { display: block; }
  .header-divider, .header-title { display: none; }
  .sidebar { transform: translateX(-100%); visibility: hidden; box-shadow: 20px 0 45px #0003; }
  .sidebar.is-open { transform: none; visibility: visible; }
  .main-content { margin-left: 0; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .welcome-panel { min-height: 340px; }
  .quick-panel { min-height: auto; }
  .login-card { grid-template-columns: .85fr 1.15fr; }
  .login-brand-panel { padding: 40px; }
  .login-form-panel { padding-inline: 45px; }
}

@media (max-width: 760px) {
  .login-view { padding: 20px; }
  .login-card { grid-template-columns: 1fr; min-height: auto; }
  .login-brand-panel { min-height: 220px; padding: 27px 30px; }
  .login-brand-panel > img { width: 139px; height: 56px; }
  .login-brand-copy { margin-top: 28px; }
  .login-brand-copy h1 { margin-bottom: 0; font-size: 2.35rem; }
  .login-brand-copy p, .login-trust { display: none; }
  .login-form-panel { padding: 35px 30px 25px; }
  .login-form-heading h2 { font-size: 1.65rem; }
  .app-header { min-height: 75px; padding-block: 8px; }
  .header-brand { gap: 13px; }
  .header-brand > img { width: 126px; height: 51px; }
  .user-copy { display: none; }
  .button-ghost { width: 40px; min-height: 40px; padding: 0; }
  .button-ghost span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .app-layout { padding-top: 75px; }
  .sidebar { top: 75px; width: min(300px, 87vw); }
  .sidebar-backdrop { inset: 75px 0 0; }
  .main-content { min-height: calc(100dvh - 75px); padding: 27px 18px 42px; }
  .screen-heading { align-items: flex-start; }
  .date-card { display: none; }
  .dashboard-heading p { max-width: 280px; }
  .welcome-panel, .quick-panel { border-radius: 14px; }
  .welcome-panel { min-height: 315px; padding: 28px; }
  .welcome-panel h2 { font-size: 2rem; }
  .quick-panel { padding: 23px; }
  .quick-actions { grid-template-columns: 1fr; }
  .receivables-heading .button { width: 42px; padding: 0; }
  .receivables-heading .button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .filter-panel { padding: 17px; }
  .status-filter { align-items: stretch; }
  .status-filter legend { float: none; position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .status-filter label { flex: 1; }
  .status-filter span { padding-inline: 7px; text-align: center; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .compact-field, .name-field, .type-field, .code-field, .search-button { grid-column: auto; grid-row: auto; }
  .compact-field:first-child, .name-field, .type-field, .search-button { grid-column: 1 / -1; }
  .date-range { grid-template-columns: 1fr; gap: 6px; }
  .date-range span { display: none; }
  .search-button { width: 100%; }
  .summary-row { grid-template-columns: 1fr 1fr; }
  .results-meta { grid-column: 1 / -1; align-items: center; justify-content: space-between; padding: 4px 2px; }
  .summary-card { padding: 15px; }
  .summary-card strong { font-size: 1.18rem; }
  .pagination { align-items: flex-start; flex-direction: column; }
  .pagination-actions { width: 100%; justify-content: space-between; }
}

@media (max-width: 430px) {
  .login-view { padding: 0; background: var(--surface); }
  .login-card { min-height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
  .login-brand-panel { min-height: 198px; border-radius: 0 0 20px 20px; }
  .login-form-panel { justify-content: flex-start; }
  .user-avatar { display: none; }
  .screen-heading h1 { font-size: 1.8rem; }
  .welcome-panel { min-height: 290px; }
  .summary-row { grid-template-columns: 1fr; }
  .results-meta { grid-column: auto; }
}

@media print {
  body { background: #fff; }
  .app-header, .sidebar, .sidebar-backdrop, .filter-panel, .receivables-heading .button, .results-meta, .pagination, .toast-region { display: none !important; }
  .app-layout { padding: 0; }
  .main-content { margin: 0; padding: 0; }
  .dashboard-screen { display: none !important; }
  .receivables-screen { display: block !important; }
  .receivables-heading { display: block; margin: 0 0 20px; }
  .results-area { display: block !important; margin: 0; }
  .summary-row { grid-template-columns: 1fr 1fr; }
  .primary-summary { color: #000; border-color: #aaa; background: #fff; }
  .primary-summary strong, .primary-summary > span, .primary-summary small { color: #000; }
  .table-card { overflow: visible; border: 0; box-shadow: none; }
  .table-scroll { overflow: visible; }
  table { min-width: 0; font-size: 8pt; }
  th, td { padding: 5px; }
  body.printing-chart .receivables-screen { display: none !important; }
  body.printing-chart .module-screen { display: block !important; }
  body.printing-chart .module-heading { margin: 0 0 15px; }
  body.printing-chart .chart-panel { padding: 0; border: 0; border-radius: 0; box-shadow: none; background: #fff; }
  body.printing-chart .chart-report-mark, body.printing-chart .chart-plot { display: none !important; }
  body.printing-chart .chart-summary { grid-template-columns: repeat(2, 1fr); margin: 18px 0; }
  body.printing-chart .chart-stat { border: 1px solid #bbb; background: #fff; color: #111; box-shadow: none; }
  body.printing-chart .chart-stat strong, body.printing-chart .chart-stat span, body.printing-chart .chart-stat small { color: #111; }
  body.printing-chart .chart-details { border-color: #bbb; }
  body.printing-chart .chart-details thead { display: table-header-group; }
  body.printing-chart .chart-details tr { break-inside: avoid; }
  body.printing-chart .chart-generated { display: block; margin-top: 16px; color: #555; font-size: 9pt; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Módulos administrativos */
.module-heading { align-items: flex-start; }
.module-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.inline-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.inline-filter input, .inline-filter select, .inline-filter label input { min-height: 43px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--surface); font-size: .82rem; }
.inline-filter label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.module-body { min-height: 180px; }
.module-form, .chart-panel { padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 8px 28px #10251a07; }
.module-form-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 15px; }
.module-form .field { margin: 0; }
.module-form input, .module-form select, .module-form textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: #fbfcfa; font-size: .83rem; }
.module-form textarea { resize: vertical; }
.full-field { grid-column: 1 / -1; }
.check-field { display: flex; align-items: center; align-self: end; gap: 8px; min-height: 43px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.check-field input { width: auto; }
.module-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 23px; padding-top: 18px; border-top: 1px solid var(--line); }
.module-table { min-width: 880px; }
.module-table td:last-child { white-space: nowrap; }
.danger-text { color: var(--danger); margin-left: 9px; }
.module-note, .empty-copy { color: var(--muted); font-size: .8rem; }
.chart-filter { gap: 12px; margin-bottom: 16px; }
.chart-filter-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.chart-panel { padding: 28px; overflow: hidden; background: linear-gradient(155deg, #fff 0%, #fbfdf9 100%); }
.chart-report-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.chart-report-heading h2 { margin: 5px 0 4px; color: var(--ink); font-size: 1.35rem; letter-spacing: -.035em; }
.chart-report-heading p { margin: 0; color: var(--muted); font-size: .82rem; }
.chart-report-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; color: #366521; background: #e8f8d4; font-size: .88rem; font-weight: 850; }
.chart-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 22px 0 25px; }
.chart-stat { display: grid; align-content: center; min-height: 91px; gap: 6px; padding: 15px 18px; border: 1px solid #dce8d4; border-radius: 12px; background: #f6faef; }
.chart-stat:first-child { border-color: #2d593a; color: #fff; background: linear-gradient(135deg, #163b2a, #295b3a); box-shadow: 0 12px 25px #173d291d; }
.chart-stat span { color: #5f715c; font-size: .71rem; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }
.chart-stat strong { color: #173a28; font-size: clamp(1.1rem, 1.8vw, 1.5rem); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-stat small { color: var(--muted); font-size: .72rem; }
.chart-stat:first-child span, .chart-stat:first-child strong { color: #fff; }
.chart-state { display: grid; place-items: center; min-height: 220px; margin: 0; color: var(--muted); text-align: center; }
.chart-plot { overflow-x: auto; padding: 16px 10px 2px; border: 1px solid #e4ecdf; border-radius: 12px; background: #fff; }
.chart-bars { display: flex; align-items: flex-end; gap: 10px; min-height: 258px; padding: 14px 12px 10px; border-bottom: 1px solid #bed0b7; background: repeating-linear-gradient(to top, transparent 0 51px, #eaf0e7 51px 52px); }
.chart-item { display: flex; flex: 1 0 78px; flex-direction: column; align-items: center; justify-content: flex-end; gap: 9px; min-width: 78px; height: 242px; }
.chart-item strong { color: #5f6f5c; font-size: .71rem; font-variant-numeric: tabular-nums; }
.chart-value { color: #355735; font-size: .66rem; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-column { position: relative; width: min(46px, 64%); min-height: 8px; border-radius: 9px 9px 3px 3px; background: linear-gradient(180deg, #b5ef70 0%, #6cb53d 100%); box-shadow: 0 7px 15px #629c342b; transform-origin: bottom; animation: chart-rise .7s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--bar-order) * 45ms); }
.chart-column::after { position: absolute; inset: 2px auto 2px 5px; width: 4px; border-radius: 4px; background: #ffffff45; content: ''; }
.chart-item.is-peak .chart-column { background: linear-gradient(180deg, #65ba63, #1d7042); box-shadow: 0 8px 16px #2b765044; }
.chart-item.is-peak .chart-value { color: #175a37; }
.chart-item:hover .chart-column { filter: brightness(1.08); }
@keyframes chart-rise { from { opacity: .35; transform: scaleY(.04); } to { opacity: 1; transform: scaleY(1); } }
.chart-details { margin-top: 26px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.chart-details-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.chart-details-heading h3 { margin: 0; color: var(--ink); font-size: .98rem; }
.chart-details-heading span { color: var(--muted); font-size: .76rem; }
.chart-details table { width: 100%; border-collapse: collapse; font-size: .82rem; font-variant-numeric: tabular-nums; }
.chart-details th, .chart-details td { padding: 10px 20px; border-bottom: 1px solid #edf1ea; text-align: left; }
.chart-details td { text-align: right; }
.chart-details thead th { color: #61745d; background: #f7faf4; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }
.chart-details tbody tr:nth-child(even) { background: #fbfdf9; }
.chart-generated { display: none; }
.adm-dashboard { display: grid; gap: 20px; }
.adm-reference-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 20px; margin: 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.adm-reference-field label { display: block; margin-bottom: 7px; color: var(--muted); font-size: .75rem; font-weight: 750; }
.adm-reference-navigation { display: flex; align-items: center; gap: 8px; }
.adm-reference-navigation input { width: 196px; min-width: 0; height: 43px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfa; color: var(--ink); font-size: .88rem; font-weight: 650; }
.adm-month-arrow { display: grid; place-items: center; width: 40px; height: 43px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #f5f8f0; color: var(--ink); font-size: 1.7rem; line-height: 1; cursor: pointer; }
.adm-month-arrow:hover:not(:disabled) { background: #e9f6dd; border-color: #9cbc78; }
.adm-month-arrow:disabled { opacity: .4; cursor: default; }
.adm-reference-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.adm-reference-actions .button { min-height: 43px; }
.adm-reference-info { flex: 1 1 210px; margin: 0; padding-bottom: 12px; color: var(--muted); font-size: .76rem; text-align: right; }
.adm-reference-info.danger-text { color: var(--danger); }
.adm-reference-bar :focus-visible { outline: 2px solid #6b9d52; outline-offset: 3px; }
@media (max-width: 700px) { .adm-reference-info { flex-basis: 100%; text-align: left; padding: 0; } }
@media (max-width: 400px) { .adm-reference-bar { padding: 14px; } .adm-reference-field { width: 100%; } .adm-reference-navigation input { flex: 1; width: 120px; } .adm-month-arrow { flex-shrink: 0; } .adm-reference-actions { width: 100%; } .adm-reference-actions .button { flex: 1 1 auto; } }
.adm-dashboard-hero { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; min-height: 224px; padding: 34px; overflow: hidden; border-radius: 17px; color: #fff; background: radial-gradient(circle at 86% 12%, #b9f46736 0 2px, transparent 3px), radial-gradient(circle at 88% -54%, #b9f4671c 0 180px, transparent 181px), linear-gradient(125deg, #12291f, #28573a); box-shadow: 0 15px 38px #1535241c; }
.adm-dashboard-hero::after { position: absolute; width: 340px; height: 340px; top: -170px; right: -100px; border: 1px solid #b9f46734; border-radius: 50%; content: ''; pointer-events: none; }
.adm-dashboard-hero > div, .adm-dashboard-count { position: relative; z-index: 1; }
.adm-dashboard-hero .eyebrow { color: var(--green); }
.adm-dashboard-hero h2 { max-width: 620px; margin: 12px 0 9px; font-family: Manrope, Inter, sans-serif; font-size: clamp(1.7rem, 2.7vw, 2.5rem); line-height: 1.15; letter-spacing: -.045em; }
.adm-dashboard-hero p { margin: 0; color: #c6d7c9; font-size: .85rem; }
.adm-dashboard-count { flex: 0 0 auto; padding: 11px 14px; border: 1px solid #c6efa354; border-radius: 999px; color: #e1f6d0; background: #ffffff14; font-size: .75rem; font-weight: 750; white-space: nowrap; }
.adm-dashboard-notice { display: flex; align-items: center; gap: 10px; margin: 0; padding: 13px 17px; border: 1px solid #dce9d3; border-radius: 10px; color: #496543; background: #f5faef; font-size: .8rem; line-height: 1.5; }
.adm-dashboard-notice span { color: #79ac46; font-size: .68rem; }
.adm-indicator-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.adm-indicator { --indicator-accent: #6b9d52; --indicator-tint: #eaf5e2; display: flex; flex-direction: column; min-height: 236px; min-width: 0; padding: 20px; border: 1px solid var(--line); border-top: 3px solid var(--indicator-accent); border-radius: 13px; background: #fff; box-shadow: 0 10px 28px #10251a09; }
.adm-indicator--customers { --indicator-accent: #50925f; --indicator-tint: #e7f4e9; }
.adm-indicator--attention { --indicator-accent: #c69250; --indicator-tint: #fbf2e5; }
.adm-indicator--received { --indicator-accent: #62a33d; --indicator-tint: #e9f6dd; }
.adm-indicator-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 19px; }
.adm-indicator-icon { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 10px; color: var(--indicator-accent); background: var(--indicator-tint); }
.adm-indicator-icon svg { width: 20px; height: 20px; }
.adm-indicator-number { color: #a1aca0; font-size: .73rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.adm-indicator h3 { min-height: 36px; margin: 0 0 8px; color: #38503b; font-size: .79rem; line-height: 1.35; }
.adm-indicator output { display: block; color: var(--ink); font-family: Manrope, Inter, sans-serif; font-size: 2rem; font-weight: 750; line-height: 1.1; }
.adm-indicator p { margin: 10px 0 17px; color: var(--muted); font-size: .72rem; line-height: 1.45; }
.adm-indicator-state { margin-top: auto; color: #758571; font-size: .67rem; font-weight: 700; }
.adm-indicator--live h3 { min-height: 0; margin-bottom: 13px; font-size: .95rem; }
.adm-client-totals { margin: 0 0 17px; }
.adm-client-totals > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #edf1e9; }
.adm-client-totals > div:first-child { padding-top: 0; }
.adm-client-totals dt { color: #526454; font-size: .76rem; line-height: 1.4; }
.adm-client-totals dd { margin: 0; color: var(--ink); font-family: Manrope, Inter, sans-serif; font-size: 1.18rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.adm-client-totals > div:first-child dd { color: #3b7b47; font-size: 1.6rem; }
.adm-receipt-totals > div { flex-wrap: wrap; column-gap: 8px; row-gap: 3px; }
.adm-receipt-totals dd, .adm-receipt-totals > div:first-child dd { margin-left: auto; white-space: nowrap; font-size: 1.08rem; color: var(--ink); }
.adm-receipt-totals > div:last-child dd { color: #3b7b47; font-size: 1.2rem; }
.adm-fiscal-totals > div { flex-wrap: wrap; row-gap: 2px; }
.adm-fiscal-totals dd, .adm-fiscal-totals > div:first-child dd { margin-left: auto; white-space: nowrap; font-size: .92rem; color: var(--ink); }
.adm-fiscal-totals > div:last-child dd { color: #3b7b47; font-size: 1.2rem; }
.adm-receivable-totals > div:last-child dd { color: var(--ink); font-size: .92rem; }
.adm-activity-totals dt { min-width: 0; overflow-wrap: anywhere; }
.adm-activity-totals dd { flex-shrink: 0; }
.adm-client-totals > div[hidden] { display: none; }
.adm-plan-totals dt { flex-basis: 100%; min-width: 0; overflow-wrap: anywhere; }
.adm-indicator-refresh { align-self: flex-start; margin-top: 12px; padding: 0; font-size: .72rem; }
.adm-indicator-refresh:disabled { opacity: .5; cursor: wait; }
.adm-indicator--live .adm-indicator-state.danger-text { margin-left: 0; color: var(--danger); }
@media (max-width: 1200px) { .adm-indicator-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .adm-dashboard-hero { display: block; min-height: 0; padding: 25px; } .adm-dashboard-count { display: inline-block; margin-top: 21px; } .adm-indicator-grid { grid-template-columns: minmax(0, 1fr); } .adm-indicator { min-height: 210px; } }
.news-list { display: grid; gap: 12px; }
.news-card { display: flex; justify-content: space-between; gap: 20px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.news-card small { display: block; margin-top: 5px; color: var(--muted); font-size: .7rem; }
.news-card p { max-width: 900px; margin: 12px 0 0; color: #435247; font-size: .86rem; line-height: 1.6; }

/* Cadastro de clientes */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.client-window { container-type: inline-size; container-name: clients; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 10px 32px #10251a0a; }
.client-command-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #edf3eb; }
.client-command-bar > div { display: flex; flex-wrap: wrap; gap: 7px; }
.client-command { min-height: 38px; padding: 0 14px; border: 1px solid #9bb292; border-radius: 6px; color: #17331f; background: #fff; font-size: .78rem; font-weight: 700; }
.client-command:hover:not(:disabled) { border-color: #6b9454; background: var(--green-soft); }
.client-tabs { display: flex; gap: 5px; padding: 8px 16px 0; border-bottom: 1px solid var(--line); background: #f7faf5; }
.client-tabs button { min-height: 40px; padding: 0 20px; border: 0; border-radius: 7px 7px 0 0; color: #5c6b5a; background: transparent; font-size: .82rem; font-weight: 750; }
.client-tabs button.is-active { color: #17311e; background: white; box-shadow: 0 -1px 0 var(--line), 1px 0 0 var(--line), -1px 0 0 var(--line); }
.client-panel { min-height: 425px; padding: 20px; }
#client-fields { min-width: 0; margin: 0; padding: 0; border: 0; }
.client-form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 138px; align-items: start; gap: 22px; }
.client-main-fields { display: grid; gap: 16px; min-width: 0; }
.client-row { display: grid; gap: 12px; align-items: end; min-width: 0; }
.client-row-identity { grid-template-columns: 68px minmax(140px, 1.3fr) minmax(100px, 1fr) minmax(134px, 1fr) minmax(134px, 1fr); }
.client-row-name { grid-template-columns: minmax(0, 3fr) minmax(170px, 1.3fr); }
.client-row-address { grid-template-columns: minmax(0, 2.3fr) 96px minmax(120px, 1fr); }
.client-row-location { grid-template-columns: minmax(120px, 1.2fr) 76px minmax(150px, 1.7fr) 112px; }
.client-row-phones { grid-template-columns: repeat(2, minmax(110px, 1fr)) repeat(3, minmax(120px, 1.2fr)); }
.client-row-contact { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.client-field { display: grid; min-width: 0; gap: 6px; }
.client-field > span, .client-field > label, .client-photo > span { color: #425340; font-size: .73rem; font-weight: 700; line-height: 1.4; }
.client-field input, .client-field select, .client-city-control input { width: 100%; min-width: 0; height: 39px; padding: 0 10px; border: 1px solid #ccd6c9; border-radius: 6px; color: var(--ink); background: #fff; font-size: .82rem; }
.client-field input:disabled, .client-field select:disabled { color: #52614e; -webkit-text-fill-color: #52614e; opacity: 1; background: #f0f3ee; }
.client-field input[readonly] { background: #f4f6f2; }
.client-field input:focus, .client-field select:focus { outline: 0; border-color: #7ba05f; box-shadow: 0 0 0 3px #b9f46725; }
.field-latitude input, .field-longitude input { font-variant-numeric: tabular-nums; }
.client-city-control { display: flex; gap: 5px; min-width: 0; }
.client-city-control button { flex: 0 0 35px; border: 1px solid #9bb292; border-radius: 6px; color: #315228; background: var(--green-soft); font-size: 1.4rem; }
.client-photo { display: grid; justify-items: start; gap: 7px; min-width: 0; }
.client-photo-preview { display: grid; place-items: center; width: 136px; height: 136px; overflow: hidden; border: 1px solid #ccd6c9; border-radius: 8px; color: #798575; background: #f5f7f4; font-size: .75rem; }
.client-photo-preview img { width: 100%; height: 100%; object-fit: contain; }
.client-photo-actions { display: flex; gap: 6px; width: 136px; }
.client-photo small { max-width: 138px; color: var(--muted); font-size: .67rem; line-height: 1.5; }
.mini-button { flex: 1; min-height: 30px; padding: 0 7px; border: 1px solid #9ab092; border-radius: 5px; color: #315228; background: #fff; font-size: .7rem; font-weight: 750; }
.mini-button.is-danger { color: var(--danger); border-color: #deb4ad; }
.client-blocked { display: flex; align-items: flex-start; gap: 6px; margin-top: 10px; color: #566354; font-size: .75rem; line-height: 1.5; }
.client-blocked input { margin: 3px 0 0; }
.client-footer { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--line); background: #edf3eb; }
#client-mode { margin-right: auto; color: var(--muted); font-size: .75rem; }
.client-footer .button { min-height: 40px; min-width: 95px; font-size: .78rem; }
.client-save { color: #17331f; border-color: #9cbd8f; background: #cfe8c4; }
.client-cancel { color: #6b541e; border-color: #d8bd79; background: #f2dda8; }
.client-exit { color: #fff; border-color: #416f57; background: #2f6248; }
.client-feedback { padding: 12px 15px; margin: 16px 20px 0; border: 1px solid #e3b8b0; border-radius: 7px; color: var(--danger); background: var(--danger-soft); font-size: .82rem; line-height: 1.5; }
.client-search { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; margin-bottom: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: #f7faf5; }
.client-search > .client-field { flex: 1 1 220px; }
.client-status { display: flex; align-items: center; gap: 13px; min-height: 39px; margin: 0; padding: 0; border: 0; color: #536250; font-size: .76rem; }
.client-status legend { padding: 0; margin-bottom: 6px; font-size: .73rem; font-weight: 700; }
.client-status label { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.client-status input { width: 15px; height: 15px; margin: 0; accent-color: var(--green-dark); }
.client-table { min-width: 620px; width: 100%; }
.client-table td:nth-child(2) { white-space: normal; min-width: 200px; }
.client-table td:last-child { white-space: nowrap; }
.client-table tbody tr[data-client-code] { cursor: pointer; }
.client-table tbody tr.is-selected td { background: #eaf6de; }
.client-table tbody tr:focus { outline: 2px solid #7ba05f; outline-offset: -2px; }
.client-loading { padding: 35px !important; color: var(--muted); text-align: center !important; white-space: normal !important; }
.client-pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; color: var(--muted); font-size: .75rem; }
.client-pagination > div { display: flex; align-items: center; gap: 10px; }
.client-dialog { width: min(780px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--line); border-radius: 13px; background: white; color: var(--ink); box-shadow: var(--shadow); }
.client-dialog::backdrop { background: #101e1870; }
.client-dialog > header { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.client-dialog h2 { margin: 0; font-size: 1rem; }
.client-dialog-body { padding: 20px; }
.client-dialog-search { display: flex; align-items: end; gap: 12px; margin-bottom: 16px; }
.client-dialog-search .client-field { flex: 1; }
.client-dialog [data-error] { color: var(--danger); font-size: .85rem; line-height: 1.5; }
.client-choice-list, .client-manager-list { display: grid; gap: 6px; max-height: 330px; overflow: auto; padding: 2px; font-size: .84rem; }
.client-choice { padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--ink); text-align: left; font-size: .83rem; }
.client-choice:hover { background: var(--green-soft); }
.client-manager-item { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.client-manager-item > span { flex: 1; overflow-wrap: anywhere; }
.client-manager-form { display: grid; gap: 14px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.client-manager-actions { display: flex; justify-content: flex-end; gap: 8px; }
@container clients (max-width: 1000px) {
  .client-row-identity { grid-template-columns: 68px minmax(145px, 1fr) minmax(100px, 1fr); }
  .client-row-identity .field-dataCadastro { grid-column: 1 / 3; }
  .client-row-phones { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .client-row-phones .field-latitude, .client-row-phones .field-longitude { grid-column: span 3; }
  .client-row-phones .field-fone, .client-row-phones .field-fax, .client-row-phones .field-cel { grid-column: span 2; }
  .client-row-location .field-cidade { grid-column: 1; }
  .client-row-location .field-cep { width: 112px; justify-self: end; }
  .client-row-location { grid-template-columns: minmax(0, 1fr) 112px; }
  .client-row-location .field-uf { width: 76px; justify-self: end; }
}
@container clients (max-width: 650px) {
  .client-panel { padding: 14px; }
  .client-form-layout { grid-template-columns: minmax(0, 1fr); }
  .client-photo { grid-template-columns: 136px 1fr; column-gap: 16px; }
  .client-photo > span { grid-column: 1 / -1; }
  .client-photo-preview { grid-row: 2 / 5; }
  .client-photo-actions, .client-photo small, .client-blocked { grid-column: 2; }
  .client-row-identity { grid-template-columns: 68px minmax(0, 1fr); }
  .client-row-identity .field-rg { grid-column: 1 / -1; }
  .client-row-identity .field-dataCadastro { grid-column: 1 / -1; }
  .client-row-identity .field-dataNascimento { grid-column: 1 / -1; }
  .client-row-name, .client-row-contact { grid-template-columns: minmax(0, 1fr); }
  .client-row-address { grid-template-columns: minmax(0, 1fr) 96px; }
  .client-row-address .field-complemento { grid-column: 1 / -1; }
  .client-row-phones { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-row-phones > .client-field { grid-column: auto !important; }
  .client-row-phones .field-cel { grid-column: 1 / -1 !important; }
  .client-pagination { flex-wrap: wrap; }
  .client-footer { padding: 12px 14px; }
  #client-mode { flex-basis: 100%; }
  .client-search { padding: 12px; }
  .client-search > button { width: 100%; }
}
@container clients (max-width: 340px) {
  .client-photo { grid-template-columns: minmax(0, 1fr); }
  .client-photo-preview { grid-row: auto; }
  .client-photo-actions, .client-photo small, .client-blocked { grid-column: 1; }
  .client-status { flex-wrap: wrap; }
  .client-footer .button { min-width: 0; flex: 1; padding-inline: 8px; }
}
@media (max-width: 760px) {
  .module-toolbar { align-items: stretch; flex-direction: column; }
  .inline-filter { align-items: stretch; flex-direction: column; }
  .inline-filter input, .inline-filter select, .inline-filter button, .inline-filter label { width: 100%; }
  .chart-filter-actions { width: 100%; }
  .chart-filter-actions .button { flex: 1; }
  .chart-panel { padding: 18px; }
  .chart-summary { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .chart-stat { min-height: 78px; }
  .chart-stat strong { font-size: 1.25rem; }
  .chart-details th, .chart-details td { padding-inline: 13px; }
  .module-form-grid { grid-template-columns: 1fr; }
  .full-field { grid-column: auto; }
  .module-form { padding: 17px; }
}
