:root {
  --navy: #0b1730;
  --navy-2: #132440;
  --ink: #192538;
  --muted: #697588;
  --line: #e3e8ef;
  --bg: #f4f6f8;
  --white: #fff;
  --teal: #16a394;
  --teal-dark: #087a70;
  --teal-soft: #e5f6f3;
  --blue: #3478f6;
  --blue-soft: #edf3ff;
  --amber: #e9a23b;
  --amber-soft: #fff4df;
  --red: #d45151;
  --red-soft: #ffeded;
  --green: #2a9a64;
  --green-soft: #e8f7ef;
  --shadow: 0 10px 30px rgba(13, 25, 46, .06);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(22,163,148,.22); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Acesso seguro e administração multiempresa */
.auth-experience { min-height: 100vh; display: grid; grid-template-columns: minmax(390px, .92fr) minmax(480px, 1.08fr); background: #f3f6f8; }
.auth-brand-panel { position: relative; isolation: isolate; overflow: hidden; min-height: 100vh; display: flex; flex-direction: column; padding: clamp(36px, 5vw, 72px); background: #09162e; color: #fff; }
.auth-brand-panel::before { content: ""; position: absolute; width: 560px; height: 560px; right: -270px; top: -250px; z-index: -1; border: 1px solid rgba(48,211,193,.18); border-radius: 50%; box-shadow: 0 0 0 70px rgba(48,211,193,.025), 0 0 0 150px rgba(52,120,246,.025); }
.auth-logo { width: min(215px, 62%); filter: brightness(0) invert(1); }
.auth-brand-copy { max-width: 620px; margin: auto 0 48px; }
.auth-brand-copy > span, .auth-kicker { color: #3ad4c3; font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.auth-brand-copy h1 { margin: 18px 0; font-size: clamp(2.2rem, 4vw, 3.7rem); line-height: 1.04; letter-spacing: -.045em; }
.auth-brand-copy p { max-width: 560px; margin: 0; color: #a9b8ce; font-size: 1rem; line-height: 1.65; }
.auth-security-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding-top: 30px; border-top: 1px solid rgba(255,255,255,.12); }
.auth-security-list article { display: grid; grid-template-columns: 30px 1fr; gap: 10px; }
.auth-security-list b { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid rgba(58,212,195,.3); border-radius: 8px; color: #5ee3d4; font-size: .7rem; }
.auth-security-list strong { display: block; margin-bottom: 4px; color: #edf4fb; font-size: .85rem; }
.auth-security-list small { color: #8697af; font-size: .75rem; line-height: 1.5; }
.auth-form-panel { min-height: 100vh; display: grid; place-items: center; padding: 42px; background: radial-gradient(circle at 72% 12%, rgba(22,163,148,.09), transparent 31%), #f3f6f8; }
.auth-card { position: relative; width: min(460px, 100%); min-height: 590px; display: flex; flex-direction: column; justify-content: center; padding: 60px 54px 42px; border: 1px solid #dfe6ec; border-radius: 24px; background: #fff; box-shadow: 0 30px 80px rgba(11,23,48,.1); }
.auth-card-mark { position: absolute; top: 28px; right: 30px; width: 45px; height: 45px; display: grid; place-items: center; border-radius: 13px; background: #0b1730; box-shadow: 0 10px 25px rgba(11,23,48,.18); }
.auth-card-mark img { width: 28px; }
.auth-panel { animation: auth-rise .26s ease; }
@keyframes auth-rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.auth-panel h2 { margin: 10px 0 9px; color: #152238; font-size: 1.8rem; line-height: 1.2; letter-spacing: -.035em; }
.auth-panel > p { margin: 0 0 26px; color: #748095; font-size: .9rem; line-height: 1.6; }
.auth-form { display: grid; gap: 17px; }
.auth-form label { display: grid; gap: 8px; color: #445169; font-size: .875rem; font-weight: 700; }
.auth-form input { width: 100%; min-height: 50px; padding: 12px 14px; border-color: #dbe3ea; font-size: 1rem; }
.auth-form input:focus { border-color: #62cabe; box-shadow: 0 0 0 4px rgba(22,163,148,.09); outline: 0; }
.auth-submit { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 4px; padding: 0 18px; border: 0; border-radius: 10px; background: linear-gradient(135deg, #16a394, #11877d); color: #fff; font-size: .9rem; font-weight: 800; box-shadow: 0 10px 24px rgba(22,163,148,.22); transition: .18s ease; }
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 13px 28px rgba(22,163,148,.28); }
.auth-submit:disabled { cursor: wait; opacity: .65; transform: none; }
.auth-submit b { font-size: 1.25rem; font-weight: 400; }
.auth-link { display: block; margin: 18px auto 0; border: 0; background: transparent; color: #65758c; font-size: .82rem; font-weight: 650; }
.auth-link:hover { color: #087a70; }
.auth-code-form input { text-align: center; font-size: 1.35rem; font-weight: 750; letter-spacing: .28em; }
.auth-loader { width: 52px; height: 52px; margin: 0 auto 24px; border: 4px solid #e7eeee; border-top-color: #16a394; border-radius: 50%; animation: auth-spin .8s linear infinite; }
#authLoadingPanel { text-align: center; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
.mfa-setup { display: grid; grid-template-columns: 132px 1fr; align-items: center; gap: 16px; margin: -5px 0 21px; }
.mfa-qr { width: 132px; height: 132px; display: grid; place-items: center; padding: 8px; border: 1px solid #dce5e8; border-radius: 13px; }
.mfa-qr img { width: 100%; height: 100%; }
.mfa-setup > div:last-child { min-width: 0; display: grid; gap: 7px; }
.mfa-setup span { color: #758296; font-size: .75rem; font-weight: 750; text-transform: uppercase; }
.mfa-setup code { padding: 9px; border-radius: 7px; background: #f2f6f7; color: #244051; font-size: .72rem; overflow-wrap: anywhere; }
.auth-feedback { margin-top: 17px; padding: 11px 13px; border: 1px solid #f0caca; border-radius: 9px; background: #fff1f1; color: #a33e3e; font-size: .82rem; line-height: 1.5; }
.auth-feedback[data-type="success"] { border-color: #bde3d4; background: #edf9f4; color: #247451; }
.auth-feedback[data-type="info"] { border-color: #c9d9ef; background: #eff5fc; color: #3e638e; }
.auth-state-icon { width: 50px; height: 50px; display: grid; place-items: center; margin-bottom: 20px; border-radius: 14px; background: #fff2df; color: #b97115; font-size: 1.2rem; font-weight: 800; }
.auth-card-footer { position: absolute; left: 54px; right: 54px; bottom: 25px; display: flex; justify-content: space-between; gap: 12px; padding-top: 15px; border-top: 1px solid #edf0f3; color: #8b96a5; font-size: .72rem; }
.auth-card-footer span { display: flex; align-items: center; gap: 7px; font-weight: 700; }
.auth-card-footer i { width: 7px; height: 7px; border-radius: 50%; background: #28b696; box-shadow: 0 0 0 4px rgba(40,182,150,.1); }
.private-preview { margin-top: 22px; padding: 13px; border: 1px solid #d4e4ed; border-radius: 10px; background: #f4f8fb; }
.private-preview span { color: #315978; font-size: .76rem; font-weight: 800; }
.private-preview p { margin: 5px 0 10px; color: #718296; font-size: .75rem; line-height: 1.45; }
.private-preview button { width: 100%; padding: 9px; border: 1px solid #b9d2df; border-radius: 8px; background: #fff; color: #215675; font-size: .8rem; font-weight: 750; }

.platform-console { min-height: 100vh; background: #f2f5f7; }
.platform-header { height: 78px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(24px, 5vw, 72px); background: #0b1730; color: #fff; }
.platform-header > img { width: 175px; filter: brightness(0) invert(1); }
.platform-header > div { display: flex; align-items: center; gap: 18px; }
.platform-header span { font-size: .85rem; font-weight: 700; }
.platform-header button { padding: 8px 11px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; background: rgba(255,255,255,.06); color: #d4deea; font-size: .8rem; }
.platform-main { width: min(1280px, calc(100% - 44px)); margin: 0 auto; padding: 50px 0 70px; }
.platform-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; }
.platform-heading h1 { margin: 9px 0 7px; font-size: 2rem; letter-spacing: -.035em; }
.platform-heading p { max-width: 680px; margin: 0; color: #6e7a8c; font-size: .9rem; line-height: 1.55; }
.platform-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 28px 0 22px; }
.platform-summary article { display: grid; gap: 4px; padding: 18px 20px; border: 1px solid #e0e6eb; border-radius: 13px; background: #fff; box-shadow: 0 6px 20px rgba(11,23,48,.035); }
.platform-summary span { color: #6d798b; font-size: .75rem; font-weight: 750; text-transform: uppercase; }
.platform-summary strong { color: #16233a; font-size: 1.65rem; }
.platform-summary small { color: #929da9; font-size: .75rem; }
.platform-office-grid { display: grid; gap: 13px; }
.platform-office-card { display: grid; grid-template-columns: 58px minmax(0,1fr) auto; align-items: center; gap: 18px; padding: 20px 22px; border: 1px solid #dfe6eb; border-radius: 14px; background: #fff; box-shadow: 0 7px 24px rgba(11,23,48,.035); }
.platform-office-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 15px; background: linear-gradient(145deg,#102747,#0a877f); color: #fff; font-weight: 800; }
.platform-office-main h2 { margin: 6px 0 3px; font-size: 1rem; }
.platform-office-main p { margin: 0; color: #778496; font-size: .8rem; }
.platform-office-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 5px; }
.office-status { padding: 4px 8px; border-radius: 999px; background: #e9f7f1; color: #23815b; font-size: .72rem; font-weight: 800; }
.office-status[data-status="trial"] { background: #fff2dd; color: #a56814; }
.platform-office-actions { min-width: 190px; display: grid; justify-items: end; gap: 7px; }
.platform-office-actions span, .platform-office-actions small { color: #788597; font-size: .75rem; text-align: right; }
.platform-office-actions button { padding: 10px 13px; border: 0; border-radius: 8px; background: #0e2b49; color: #fff; font-size: .8rem; font-weight: 750; }
.platform-empty { padding: 50px; border: 1px dashed #cdd6de; border-radius: 14px; background: #fff; text-align: center; }
.office-modal { width: min(790px, calc(100vw - 28px)); }
.office-form-note { display: grid; gap: 4px; margin: 20px 24px 0; padding: 12px 14px; border: 1px solid #cde7e2; border-radius: 10px; background: #eff9f7; }
.office-form-note strong { color: #176f66; font-size: .8rem; }
.office-form-note span, .office-invite-note { color: #66847f; font-size: .76rem; line-height: 1.5; }
.office-form-grid { padding: 18px 24px 5px; }
.office-invite-note { margin: 10px 24px 0; padding: 11px 12px; border-radius: 9px; background: #fff5e5; color: #826027; }

@media (max-width: 980px) {
  .auth-experience { grid-template-columns: 1fr; }
  .auth-brand-panel { min-height: auto; padding: 30px 34px; }
  .auth-brand-copy { margin: 54px 0 30px; }
  .auth-security-list { max-width: 760px; }
  .auth-form-panel { min-height: auto; padding: 55px 24px; }
  .platform-summary { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 620px) {
  .auth-brand-panel { padding: 25px 22px; }
  .auth-brand-copy { margin: 42px 0 25px; }
  .auth-brand-copy h1 { font-size: 2rem; }
  .auth-security-list { grid-template-columns: 1fr; }
  .auth-form-panel { padding: 25px 14px; }
  .auth-card { min-height: 570px; padding: 58px 25px 42px; border-radius: 18px; }
  .auth-card-footer { left: 25px; right: 25px; }
  .mfa-setup { grid-template-columns: 1fr; justify-items: center; }
  .platform-header { padding: 0 18px; }
  .platform-header > img { width: 135px; }
  .platform-header span { display: none; }
  .platform-main { width: calc(100% - 28px); padding-top: 30px; }
  .platform-heading { align-items: stretch; flex-direction: column; }
  .platform-summary { grid-template-columns: 1fr 1fr; }
  .platform-office-card { grid-template-columns: 48px 1fr; padding: 16px; }
  .platform-office-icon { width: 46px; height: 46px; }
  .platform-office-actions { grid-column: 1/-1; justify-items: stretch; }
  .platform-office-actions span, .platform-office-actions small { text-align: left; }
}

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--navy); color: #fff; padding: 28px 18px 20px; display: flex; flex-direction: column; z-index: 20; overflow: hidden; }
.brand { display: flex; align-items: center; min-height: 54px; padding: 0 5px 24px; }
.brand-logo { display: block; width: 100%; max-width: 202px; height: auto; filter: drop-shadow(0 9px 20px rgba(15,104,208,.13)); }
.main-nav { display: grid; gap: 8px; min-height: 0; overflow-y: auto; padding-right: 2px; scrollbar-width: thin; scrollbar-color: #34435b transparent; }
.nav-item { min-height: 46px; appearance: none; border: 0; background: transparent; color: #aab7ca; display: flex; align-items: center; gap: 12px; padding: 12px 13px; border-radius: 11px; text-align: left; font-size: 13px; font-weight: 650; transition: .18s ease; }
.nav-item svg, .nav-group-toggle svg, .nav-subitem svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-item.is-active { color: #fff; background: rgba(31,181,165,.15); box-shadow: inset 3px 0 var(--teal); }
.nav-group { padding-top: 2px; }
.nav-group + .nav-group { margin-top: 2px; }
.nav-group-toggle { width: 100%; min-height: 46px; appearance: none; border: 0; background: transparent; color: #aab7ca; display: grid; grid-template-columns: 19px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 13px; border-radius: 11px; text-align: left; transition: .18s ease; }
.nav-group-toggle:hover { color: #fff; background: rgba(255,255,255,.045); }
.nav-group.has-active > .nav-group-toggle { color: #fff; background: rgba(31,181,165,.15); box-shadow: inset 3px 0 var(--teal); }
.nav-group-label { font-size: 13px; font-weight: 650; line-height: 1.25; }
.nav-count { min-width: 21px; padding: 4px 6px; border-radius: 999px; background: rgba(255,255,255,.08); color: #9fadc2; font-size: 9px; text-align: center; }
.nav-chevron { color: #8c9bb0; font-size: 13px; transition: transform .18s ease; }
.nav-submenu { display: grid; gap: 2px; margin: 0 0 5px 10px; padding: 3px 0 3px 13px; border-left: 1px solid rgba(255,255,255,.1); }
.nav-submenu[hidden] { display: none; }
.nav-subitem { width: 100%; min-height: 36px; appearance: none; border: 0; background: transparent; color: #94a3b8; display: grid; grid-template-columns: 17px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 7px 7px 8px; border-radius: 8px; text-align: left; transition: .18s ease; }
.nav-subitem svg { width: 15px; height: 15px; }
.nav-subitem > span { min-width: 0; font-size: 10.5px; font-weight: 560; line-height: 1.2; }
.nav-subitem > small { max-width: 68px; padding: 3px 6px; border-radius: 999px; background: rgba(49,122,236,.16); color: #6da9ff; font-size: 8.5px; font-weight: 700; line-height: 1.05; text-align: center; }
.nav-subitem:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-subitem.is-active { color: #fff; background: rgba(31,181,165,.13); }
.nav-subitem.is-active > small { background: rgba(31,181,165,.18); color: #6ee1d2; }
.sidebar-foot { margin-top: auto; display: grid; gap: 13px; padding: 17px 3px 2px; border-top: 1px solid rgba(255,255,255,.72); flex: 0 0 auto; }
.sidebar-company-card { position: relative; display: grid; justify-items: center; gap: 5px; padding: 14px 10px 12px; border: 1px solid #d9e1eb; border-radius: 10px; background: #fff; color: var(--navy); text-align: center; box-shadow: 0 8px 20px rgba(2,10,24,.12); }
.sidebar-company-card svg { position: absolute; left: 14px; top: 22px; width: 16px; height: 16px; fill: none; stroke: #2aabff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-company-card strong { max-width: 150px; font-size: 12px; line-height: 1.25; }
.sidebar-company-card span { color: #687993; font-size: 9.5px; }
.sidebar-company-card small { padding: 4px 7px; border: 1px solid #b8d1ff; border-radius: 5px; background: #eaf2ff; color: #4f8be9; font-size: 8.5px; }
.sidebar-user { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 3px 5px; }
.profile-avatar-shell { position: relative; width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center; isolation: isolate; }
.profile-avatar-shell::before { content: ""; position: absolute; inset: -4px; z-index: -2; border-radius: 50%; background: radial-gradient(circle, rgba(41,214,195,.7) 0%, rgba(22,163,148,.36) 42%, rgba(52,120,246,0) 72%); filter: blur(4px); animation: profile-aura 2.6s ease-in-out infinite; }
.profile-avatar-shell::after { content: ""; position: absolute; inset: 1px; z-index: -1; border: 1px solid rgba(91,235,216,.72); border-radius: 50%; box-shadow: 0 0 10px rgba(41,214,195,.72), 0 0 22px rgba(22,163,148,.36); animation: profile-ring 2.6s ease-in-out infinite; }
.profile-avatar { width: 42px; height: 42px; display: grid; place-items: center; overflow: hidden; border: 2px solid rgba(219,255,250,.9); border-radius: 50%; background: linear-gradient(145deg, var(--avatar, #16a394), #0b7e73); color: #fff; font-size: 12px; font-weight: 800; box-shadow: 0 5px 16px rgba(3,13,27,.35); }
.profile-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.profile-avatar span { display: grid; place-items: center; width: 100%; height: 100%; }
@keyframes profile-aura { 0%, 100% { opacity: .42; transform: scale(.84); } 50% { opacity: 1; transform: scale(1.18); } }
@keyframes profile-ring { 0%, 100% { opacity: .6; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.1); } }
.sidebar-user-info { min-width: 0; }
.sidebar-user-info > div { min-width: 0; display: flex; align-items: center; gap: 6px; }
.sidebar-user-info strong { overflow: hidden; color: #fff; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-info small { flex: 0 0 auto; padding: 3px 5px; border-radius: 4px; background: #087a50; color: #70e5ae; font-size: 7.5px; font-weight: 750; }
.sidebar-user-info > span { display: block; margin-top: 4px; color: #9eb0c8; font-size: 9.5px; }
.sidebar-logout { width: 100%; display: flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 8px; background: rgba(209,55,89,.12); color: #ff647d; padding: 10px 12px; font-size: 10px; font-weight: 750; text-align: center; }
.sidebar-logout:hover { background: rgba(209,55,89,.2); }
.sidebar-logout svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (prefers-reduced-motion: reduce) {
  .profile-avatar-shell::before, .profile-avatar-shell::after { animation: none; }
  .profile-avatar-shell::before { opacity: .7; transform: scale(1); }
}

.main-content { min-width: 0; padding: 0 34px 48px; }
.topbar { min-height: 108px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.topbar h1 { margin: 3px 0 0; font-size: 26px; letter-spacing: -.03em; }
.eyebrow, .section-kicker { margin: 0; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.prototype-pill, .safe-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--teal-dark); background: var(--teal-soft); padding: 7px 10px; border-radius: 999px; font-size: 11px; font-weight: 650; }
.prototype-pill i { width: 7px; height: 7px; background: var(--teal); border-radius: 50%; }
.safe-badge { color: #77541e; background: var(--amber-soft); }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 23px; color: var(--ink); }

.view { display: none; }
.view.is-active { display: block; animation: rise .24s ease; }
@keyframes rise { from { opacity: .2; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; margin-bottom: 18px; }
.summary-card { position: relative; overflow: hidden; min-height: 130px; background: var(--white); border: 1px solid color-mix(in srgb, var(--card-color, var(--teal)) 42%, var(--line)); border-left: 4px solid var(--card-color, var(--teal)); border-radius: 14px; padding: 17px 16px 15px; box-shadow: 0 4px 18px rgba(13,25,46,.025); }
.summary-label { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-height: 41px; color: #53617a; font-size: 11px; font-weight: 650; line-height: 1.35; }
.summary-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: var(--card-soft, var(--teal-soft)); color: var(--card-color, var(--teal)); font-size: 14px; }
.summary-bottom { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.summary-value { display: block; color: var(--card-color, var(--teal)); font-size: 27px; line-height: 1; font-weight: 750; letter-spacing: -.04em; }
.summary-status { display: inline-flex; align-items: center; gap: 5px; max-width: 112px; padding: 4px 8px; border: 1px solid color-mix(in srgb, var(--card-color, var(--teal)) 42%, var(--line)); border-radius: 6px; background: var(--card-soft, var(--teal-soft)); color: color-mix(in srgb, var(--card-color, var(--teal)) 80%, #18243a); font-size: 9px; font-weight: 750; line-height: 1.05; }
.summary-status::before { content: ""; width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--card-color, var(--teal)); box-shadow: inset 0 0 0 2px rgba(255,255,255,.22); }

.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.agenda-panel { margin-bottom: 18px; }
.panel-heading { padding: 20px 22px 15px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.panel-heading h2 { margin: 4px 0 0; font-size: 17px; letter-spacing: -.02em; }
.panel-description { color: var(--muted); font-size: 12px; line-height: 1.6; margin: -5px 22px 14px; }
.date-navigation { display: flex; align-items: center; gap: 5px; }
.icon-btn { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 9px; font-size: 20px; display: grid; place-items: center; }
.btn { border: 0; border-radius: 9px; padding: 10px 14px; font-size: 12px; font-weight: 700; transition: .18s ease; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 7px 18px rgba(22,163,148,.18); }
.btn-primary:hover { background: #118e82; }
.btn-secondary { background: var(--navy); color: #fff; }
.btn-quiet { background: #f1f4f7; color: #526074; }
.btn-link { background: transparent; color: var(--teal-dark); padding: 5px; }
.action-icon { width: 14px; height: 14px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.filter-row { display: flex; align-items: center; gap: 8px; padding: 0 22px 17px; }
select, input, textarea { border: 1px solid #dbe2ea; background: #fff; color: var(--ink); border-radius: 9px; padding: 10px 11px; font-size: 12px; }
select { padding-right: 30px; }
.clear-filter { margin-left: auto; }

.week-grid { display: grid; grid-template-columns: repeat(7, minmax(128px, 1fr)); border-top: 1px solid var(--line); overflow-x: auto; }
.day-column { min-height: 235px; border-right: 1px solid var(--line); background: #fbfcfd; }
.day-column:last-child { border-right: 0; }
.day-column.is-today { background: #f6fbfa; }
.day-head { min-width: 128px; padding: 13px 12px 11px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; text-transform: uppercase; font-weight: 750; letter-spacing: .07em; }
.day-head b { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: var(--ink); font-size: 12px; }
.is-today .day-head b { background: var(--teal); color: #fff; }
.day-events { padding: 8px; display: grid; gap: 7px; align-content: start; }
.calendar-event { width: 100%; text-align: left; border: 0; border-left: 3px solid var(--event-color, var(--teal)); background: #fff; padding: 9px 9px 8px; border-radius: 8px; box-shadow: 0 2px 8px rgba(13,25,46,.055); }
.calendar-event:hover { box-shadow: 0 5px 15px rgba(13,25,46,.1); }
.event-time { display: block; color: var(--muted); font-size: 9px; margin-bottom: 3px; }
.event-title { display: block; font-size: 10.5px; font-weight: 750; line-height: 1.28; }
.event-client { display: block; color: var(--muted); margin-top: 4px; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-day { padding: 15px 7px; text-align: center; color: #a7b0bd; font-size: 10px; }

.list-panel { overflow: hidden; }
.muted { color: var(--muted); font-size: 11px; }
.agenda-list { border-top: 1px solid var(--line); }
.agenda-row { display: grid; grid-template-columns: 78px minmax(180px, 1.55fr) 1fr 148px 116px 70px; align-items: center; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--line); }
.agenda-row:last-child { border-bottom: 0; }
.agenda-row:hover { background: #fbfcfd; }
.due-box { text-align: center; color: var(--muted); font-size: 9px; }
.due-box strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 2px; }
.due-box.is-overdue strong, .due-box.is-overdue span { color: var(--red); }
.routine-name strong { display: block; font-size: 12px; }
.routine-name small { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.owner { display: flex; align-items: center; gap: 8px; min-width: 0; }
.avatar { width: 29px; height: 29px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--avatar, var(--teal)); font-size: 9px; font-weight: 800; }
.owner span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.status-select { width: 100%; padding: 8px 9px; font-size: 10px; font-weight: 700; border-color: transparent; background: #fff7e5; color: #a96800; }
.status-select[data-status="Crítico"] { background: var(--red-soft); color: #ba3535; }
.status-select[data-status="Pendência Externa"] { background: var(--blue-soft); color: #285fc4; }
.status-select[data-status="Aguardando Revisor"] { background: #f1edff; color: #6a3adc; }
.status-select[data-status="Finalizada"] { background: var(--green-soft); color: #167950; }
.priority { justify-self: start; padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 750; background: #f0f2f5; color: #626d7b; }
.priority[data-priority="Alta"] { background: var(--amber-soft); color: #8a5a10; }
.priority[data-priority="Crítica"] { background: var(--red-soft); color: #ae3636; }
.row-actions { display: flex; gap: 3px; justify-content: flex-end; }
.mini-action { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; border-radius: 8px; color: #667285; font-size: 12px; }
.mini-action .action-icon { width: 13px; height: 13px; }
.empty-state { padding: 38px 22px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); font-size: 13px; margin-bottom: 5px; }

.page-intro { min-height: 52px; display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.page-intro p { margin: 0; color: var(--muted); font-size: 13px; }
.routines-toolbar { display: flex; align-items: center; gap: 9px; padding: 17px 20px; }
.search-box { display: flex; align-items: center; flex: 1; min-width: 220px; border: 1px solid #dbe2ea; border-radius: 9px; padding-left: 10px; background: #fff; }
.search-box svg { width: 17px; height: 17px; fill: none; stroke: #8994a3; stroke-width: 1.8; }
.search-box input { width: 100%; border: 0; padding-left: 8px; outline: 0; }
.result-count { color: var(--muted); font-size: 10px; margin-left: auto; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 20px; text-align: left; color: var(--muted); background: #f7f9fa; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
td { padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 11px; vertical-align: middle; }
tbody tr:hover { background: #fbfcfd; }
.table-title strong { display: block; font-size: 12px; }
.table-title span { color: var(--muted); font-size: 9px; display: block; margin-top: 4px; }
.date-cell strong { display: block; }
.date-cell span { display: block; color: var(--muted); font-size: 9px; margin-top: 3px; }
.routine-cards { display: none; }

.cadastro-panel { overflow: hidden; }
.cadastro-intro { align-items: center; }
.cadastro-hero { display: flex; align-items: center; gap: 15px; padding: 22px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #fbfdfd, #f5faf9); }
.cadastro-mark { width: 52px; height: 52px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 14px; background: var(--navy); color: #fff; font-size: 21px; font-weight: 800; box-shadow: 0 8px 22px rgba(11,23,48,.14); }
.cadastro-hero h2 { margin: 0; font-size: 17px; }
.cadastro-hero p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.cadastro-hero .safe-badge { margin-left: auto; }
.registration-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.registration-field { padding: 18px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.registration-field:nth-child(3n) { border-right: 0; }
.registration-field span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.registration-field strong { display: block; margin-top: 6px; font-size: 12px; }
.registry-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 19px 21px; border-bottom: 1px solid var(--line); }
.registry-heading strong { font-size: 13px; }
.registry-heading span { color: var(--muted); font-size: 10px; }
.registry-heading > div:first-child { display: grid; gap: 4px; }
.registry-list { display: grid; }
.registry-row { display: grid; grid-template-columns: minmax(180px, 1.4fr) 1fr 110px auto; align-items: center; gap: 15px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.registry-row:last-child { border-bottom: 0; }
.registry-row:hover { background: #fbfcfd; }
.managed-registry-row { grid-template-columns: minmax(220px, 1fr) 140px auto; }
.registry-main strong { display: block; font-size: 12px; }
.registry-main small, .registry-meta small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.registry-meta strong { display: block; font-size: 10.5px; }
.registry-status { justify-self: start; padding: 5px 8px; border-radius: 999px; background: var(--green-soft); color: #23784f; font-size: 9px; font-weight: 750; }
.department-grid, .profile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 20px; }
.department-card, .profile-card { padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfd; }
.department-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.department-card-head > div:first-child { display: flex; align-items: center; gap: 8px; min-width: 0; }
.department-card i { width: 9px; height: 9px; border-radius: 50%; background: var(--department-color, var(--teal)); }
.department-card strong, .profile-card strong { font-size: 12px; }
.department-card p, .profile-card p { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.profile-permissions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.profile-permissions span { padding: 4px 7px; border-radius: 999px; background: var(--blue-soft); color: #3566bc; font-size: 8px; font-weight: 700; }
.module-empty { padding: 50px 24px; text-align: center; }
.module-empty-icon { width: 48px; height: 48px; margin: 0 auto 13px; display: grid; place-items: center; border-radius: 14px; background: var(--teal-soft); color: var(--teal-dark); font-size: 22px; }
.module-empty strong { display: block; font-size: 13px; }
.module-empty p { max-width: 410px; margin: 7px auto 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.registry-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.registry-action { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #5b687a; font-size: 9px; font-weight: 700; }
.registry-action:hover { border-color: #b8c5d5; color: var(--ink); }
.registry-action.edit { color: #a76a08; background: #fffaf0; border-color: #f0d39c; }
.registry-action.toggle { color: #415a78; background: #f3f6fa; border-color: #cdd7e4; }
.registry-action.activate { color: #08775d; background: #effbf7; border-color: #aee3d4; }
.registry-action.delete { color: #bd3f5d; background: #fff5f7; border-color: #efc1cd; }
.registry-action .action-icon { width: 13px; height: 13px; }
.user-registry-summary { display: flex; align-items: center; gap: 8px; }
.user-count-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; background: #edf9f5; color: #17755f; font-size: 10px; font-weight: 750; }
.user-count-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #1a9f7e; }
.user-count-pill.is-inactive { background: #f0f3f7; color: #69778a; }
.user-count-pill.is-inactive::before { background: #8b98a8; }
.user-list-head, .user-registry-row { display: grid; grid-template-columns: minmax(235px, 1.35fr) minmax(130px, .75fr) minmax(180px, 1fr) 115px auto; align-items: center; gap: 14px; }
.user-list-head { padding: 10px 20px; border-bottom: 1px solid var(--line); background: #f7f9fb; color: #728096; font-size: 9px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.user-list-head span:last-child { text-align: right; }
.user-registry-row { padding: 14px 20px; border-bottom: 1px solid var(--line); }
.user-registry-row:last-child { border-bottom: 0; }
.user-registry-row:hover { background: #fbfcfd; }
.user-registry-row.is-inactive { background: #f8f9fb; }
.user-identity { min-width: 0; display: flex; align-items: center; gap: 11px; }
.user-identity > div { min-width: 0; }
.user-identity strong { display: block; overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.user-identity small { display: block; overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.user-avatar { width: 42px; height: 42px; font-size: 11px; overflow: hidden; box-shadow: 0 0 0 3px #edf2f6; }
.user-avatar img, .team-row .avatar img, .owner .avatar img { width: 100%; height: 100%; display: block; border-radius: inherit; object-fit: cover; }
.user-access-meta strong { display: block; font-size: 11px; }
.user-access-meta small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.user-departments { display: flex; flex-wrap: wrap; gap: 5px; }
.user-departments span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 999px; background: #edf4ff; color: #3e6da8; font-size: 9px; font-weight: 700; }
.user-departments i { width: 6px; height: 6px; border-radius: 50%; background: var(--department-color, var(--teal)); }
.user-status-block { display: grid; justify-items: start; gap: 4px; }
.user-status { padding: 5px 8px; border-radius: 999px; background: #eaf8f3; color: #14745c; font-size: 9px; font-weight: 800; }
.user-status.is-inactive { background: #eceff3; color: #6d7989; }
.user-status-block small { color: var(--muted); font-size: 8.5px; }
.user-actions { display: flex; justify-content: flex-end; gap: 6px; }
.user-empty { padding: 44px 24px; text-align: center; color: var(--muted); font-size: 12px; }
.module-landing { min-height: 235px; display: flex; align-items: center; gap: 20px; padding: 34px; overflow: hidden; }
.module-landing-icon { width: 58px; height: 58px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 17px; background: var(--teal-soft); color: var(--teal-dark); font-size: 25px; font-weight: 800; }
.module-landing h2 { margin: 5px 0 0; font-size: 22px; }
.module-landing p { max-width: 620px; margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.finance-landing .module-landing-icon { background: var(--blue-soft); color: #3566bc; }
.contracts-landing .module-landing-icon { background: #f1edff; color: #7248cc; }

.cadastro-panel.clients-surface { border: 0; background: transparent; box-shadow: none; overflow: visible; }
.client-page { display: grid; gap: 14px; color: #f4f8ff; }
.client-page-header, .client-toolbar, .client-table-shell { background: #1b293e; border: 1px solid #293b56; border-radius: 12px; box-shadow: 0 8px 24px rgba(11,23,48,.08); }
.client-page-header { padding: 15px 18px 18px; }
.client-back { border: 1px solid #3b4b63; background: transparent; color: #b8c8dd; border-radius: 7px; padding: 7px 10px; font-size: 9px; }
.client-back:hover { color: #fff; border-color: #5d7391; }
.client-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 10px; }
.client-heading-row h2 { margin: 0; color: #fff; font-size: 20px; }
.client-heading-row p { margin: 5px 0 0; color: #9bb8d8; font-size: 10px; }
.client-count-badge { padding: 7px 11px; border: 1px solid #28529a; border-radius: 8px; background: rgba(30,102,226,.15); color: #61a0ff; font-size: 9px; font-weight: 750; }
.client-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; }
.client-search { width: min(400px, 100%); display: flex; align-items: center; gap: 8px; border: 1px solid #3a4d69; border-radius: 8px; background: #0d192c; padding: 0 11px; }
.client-search svg { width: 15px; height: 15px; flex: 0 0 auto; fill: none; stroke: #7890ad; stroke-width: 1.8; }
.client-search input { width: 100%; border: 0; outline: 0; background: transparent; color: #e8f1ff; padding: 10px 0; }
.client-search input::placeholder { color: #68809f; }
.client-new { background: #2968e8; box-shadow: 0 7px 18px rgba(41,104,232,.18); }
.client-new:hover { background: #205cca; }
.client-table-shell { overflow: hidden; }
.client-table-scroll { overflow-x: auto; }
.client-table { min-width: 1040px; table-layout: fixed; color: #eaf2ff; }
.client-table th { padding: 13px 16px; border-color: #33445c; background: #0f1a2e; color: #8db1dd; font-size: 8.5px; }
.client-table th:first-child { width: 24%; }
.client-table th:nth-child(2) { width: auto; }
.client-table th:last-child { position: sticky; right: 0; z-index: 4; width: 370px; min-width: 370px; text-align: right; box-shadow: -10px 0 18px rgba(5,13,27,.18); }
.client-table td { padding: 13px 16px; border-color: #314159; color: #dfebfa; font-size: 9.5px; }
.client-table td:last-child { position: sticky; right: 0; z-index: 3; width: 370px; min-width: 370px; background: #1b293e; box-shadow: -10px 0 18px rgba(5,13,27,.18); }
.client-table tbody tr:hover { background: rgba(255,255,255,.025); }
.client-table tbody tr:hover td:last-child { background: #213149; }
.client-table tbody tr.is-inactive { opacity: .58; }
.client-name strong { display: block; color: #fff; font-size: 10.5px; }
.client-name span { display: block; margin-top: 4px; color: #6582a5; font-size: 8.5px; }
.client-groups { max-width: 560px; color: #cbdcf1; line-height: 1.45; }
.client-actions { display: flex; justify-content: flex-end; gap: 6px; min-width: max-content; }
.client-action { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 0; border-radius: 6px; padding: 6px 9px; color: #fff; font-size: 8px; font-weight: 750; white-space: nowrap; }
.client-action.view { background: #08b8d1; }
.client-action.edit { background: #f59e0b; }
.client-action.toggle { background: #56677f; }
.client-action.delete { background: #ee3f6b; }
.client-action:hover { filter: brightness(1.08); }
.client-empty { padding: 35px; text-align: center; color: #88a0bc; font-size: 10px; }
.client-form-page { display: grid; gap: 12px; color: #edf4ff; }
.client-form-trail, .client-form-header, .client-form-section, .client-form-footer { border: 1px solid #2b3c55; border-radius: 10px; background: #1b293e; box-shadow: 0 8px 24px rgba(11,23,48,.07); }
.client-form-trail { display: flex; align-items: center; gap: 10px; padding: 10px 13px; color: #a9bdd5; font-size: 8.5px; }
.client-form-trail strong { padding: 6px 9px; border-radius: 5px; background: #2869e8; color: #fff; }
.client-form-trail b { color: #657a97; }
.selected-client { margin-left: auto; padding: 5px 8px; border: 1px solid #334863; border-radius: 6px; background: #112034; color: #b8cae0; }
.client-form-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 16px; }
.client-form-header h2 { margin: 9px 0 0; font-size: 15px; }
.client-form-header p { margin: 4px 0 0; color: #8fa7c2; font-size: 8.5px; }
.client-form-section { overflow: hidden; }
.client-form-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px 11px; border-bottom: 1px solid #34445a; }
.client-form-section-head strong { color: #fff; font-size: 10.5px; }
.client-form-section-head p { margin: 4px 0 0; color: #8098b5; font-size: 8px; }
.group-count { padding: 5px 8px; border-radius: 999px; background: rgba(234,170,27,.15); color: #f0bb46; font-size: 8px; font-weight: 750; }
.dark-form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; padding: 14px 16px 15px; }
.dark-form-grid.address-grid { grid-template-columns: .75fr 1.65fr .55fr; }
.dark-field { display: grid; gap: 5px; color: #9fb2ca; font-size: 8px; font-weight: 650; }
.dark-field input, .dark-field select { width: 100%; border: 1px solid #3b4d67; border-radius: 5px; background: #0d192c; color: #eaf2ff; padding: 8px 9px; font-size: 9px; }
.dark-field input::placeholder { color: #607795; }
.cnpj-search-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.cnpj-search-control button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 132px; border: 1px solid #4b8cf5; border-radius: 5px; background: #2869e8; color: #fff; padding: 7px 11px; font-size: 8.5px; font-weight: 750; white-space: nowrap; box-shadow: 0 5px 13px rgba(40,105,232,.2); }
.cnpj-search-control button:hover:not(:disabled) { background: #3478ee; }
.cnpj-search-control button:focus-visible { outline: 2px solid #9cc6ff; outline-offset: 2px; }
.cnpj-search-control button:disabled { cursor: wait; opacity: .78; }
.cnpj-search-control button.is-loading .action-icon { animation: lookup-pulse .9s ease-in-out infinite alternate; }
.cnpj-lookup-status { min-height: 12px; color: #7f96b2; font-size: 7.2px; font-weight: 500; line-height: 1.35; }
.cnpj-lookup-status.is-loading { color: #85b8ff; }
.cnpj-lookup-status.is-success { color: #57d5ae; }
.cnpj-lookup-status.is-warning { color: #f1bd52; }
.cnpj-lookup-status.is-error { color: #ff829a; }
@keyframes lookup-pulse { to { opacity: .35; transform: scale(.88); } }
.address-divider { display: flex; align-items: center; gap: 7px; margin: 0 16px; padding: 10px 0 0; border-top: 1px solid #34445a; }
.address-divider strong { color: #fff; font-size: 9px; }
.address-divider span { color: #7f96b2; font-size: 7.5px; }
.client-group-selector { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 14px 16px 10px; }
.client-group-option { min-height: 50px; display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid #3a4d68; border-radius: 7px; background: #101d30; cursor: pointer; }
.client-group-option:hover { border-color: #4c6689; }
.client-group-option input { width: 14px; height: 14px; accent-color: #2c74f0; }
.client-group-option span strong { display: block; color: #eef5ff; font-size: 8.8px; }
.client-group-option span small { display: block; margin-top: 3px; color: #768eaa; font-size: 7px; line-height: 1.3; }
.client-group-option em { padding: 4px 6px; border: 1px solid #3e5069; border-radius: 4px; color: #8fa4bd; font-size: 7px; font-style: normal; }
.client-group-option:has(input:checked) { border-color: #157b69; background: rgba(6,125,105,.08); }
.client-group-option:has(input:checked) em { border-color: #157b69; background: rgba(9,151,122,.14); color: #4ed4b5; }
.add-client-group { width: calc(100% - 32px); margin: 0 16px 14px; padding: 9px; border: 1px dashed #50627b; border-radius: 6px; background: transparent; color: #91a9c5; font-size: 8px; }
.add-client-group:hover { border-color: #6d87a8; color: #fff; }
.client-form-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 11px 14px; }
.client-cancel { border: 1px solid #44556d; background: #16243a; color: #aebfd4; }
.client-detail { padding: 20px 24px 24px; }
.client-detail-status { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: var(--green-soft); color: #23784f; font-size: 9px; font-weight: 750; }
.client-detail-status.is-inactive { background: #edf0f4; color: #697586; }
.client-detail dl { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin: 18px 0; }
.client-detail dt { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.client-detail dd { margin: 5px 0 0; font-size: 11px; font-weight: 650; }
.client-group-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.client-group-chips span { padding: 5px 8px; border-radius: 999px; background: var(--blue-soft); color: #3566bc; font-size: 8.5px; font-weight: 700; }

.client-details-page { display: grid; gap: 14px; color: #edf5ff; }
.client-details-header, .client-overview-card, .client-tabs, .client-tab-content { border: 1px solid #2b3d57; border-radius: 12px; background: #1b293e; box-shadow: 0 8px 24px rgba(7,18,36,.09); }
.client-details-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 16px 18px; }
.client-details-title { min-width: 0; }
.client-title-line { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.client-company-mark { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(145deg, #286de8, #13a8b2); color: #fff; font-size: 13px; font-weight: 800; box-shadow: 0 8px 18px rgba(35,105,224,.22); }
.client-title-line h2 { margin: 3px 0 0; color: #fff; font-size: 18px; line-height: 1.2; }
.client-title-line p { margin: 4px 0 0; color: #88a1be; font-size: 9px; }
.client-details-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.client-status-pill { display: inline-flex; align-items: center; min-height: 31px; padding: 0 10px; border: 1px solid #157c67; border-radius: 7px; background: rgba(5,151,116,.12); color: #48d6b2; font-size: 8px; font-weight: 750; white-space: nowrap; }
.client-status-pill.is-inactive { border-color: #53657c; background: rgba(111,130,153,.12); color: #aabbd0; }
.client-detail-edit, .client-detail-toggle { min-height: 31px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #3e5572; border-radius: 7px; background: #14233a; color: #d6e3f4; font-size: 8px; }
.client-detail-edit:hover, .client-detail-toggle:hover { border-color: #58769c; color: #fff; }
.client-detail-delete { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid #784052; border-radius: 7px; background: rgba(237,57,103,.1); color: #ff7194; }
.client-detail-delete:hover { background: #dc315d; color: #fff; }
.client-overview-card { overflow: hidden; }
.client-overview-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid #34465e; }
.client-overview-heading > div { display: flex; align-items: center; gap: 9px; }
.client-overview-heading strong { color: #cfe0f5; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.client-overview-heading > span { color: #7691b0; font-size: 8px; }
.client-overview-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; background: rgba(51,119,238,.13); color: #70a5ff; }
.client-overview-grid { display: grid; grid-template-columns: 1.12fr .88fr; padding: 18px; }
.client-info-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; padding-right: 28px; }
.client-info-item { min-width: 0; }
.client-info-item span, .client-address-block > span, .client-overview-groups > span { display: block; color: #7e97b5; font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.client-info-item strong { display: block; overflow-wrap: anywhere; margin-top: 6px; color: #eaf3ff; font-size: 10.5px; font-weight: 650; }
.client-address-block { padding-left: 28px; border-left: 1px solid #34465e; }
.client-address-block address { display: grid; gap: 4px; margin-top: 8px; color: #d2e0f1; font-style: normal; }
.client-address-block address b { font-size: 9.5px; font-weight: 500; }
.client-info-missing { margin-top: 8px; color: #7189a7; font-size: 9px; }
.client-overview-groups { display: grid; grid-template-columns: 125px 1fr; align-items: start; gap: 15px; margin: 0 18px; padding: 14px 0 17px; border-top: 1px solid #34465e; }
.client-overview-groups > span { padding-top: 5px; }
.client-detail-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.client-detail-chips em { padding: 5px 8px; border: 1px solid #315894; border-radius: 6px; background: rgba(43,103,206,.14); color: #8bb7ff; font-size: 8px; font-style: normal; font-weight: 700; }
.client-detail-chips small { color: #7189a7; font-size: 9px; }
.client-tabs { display: flex; align-items: stretch; overflow-x: auto; border-radius: 12px 12px 0 0; scrollbar-width: thin; }
.client-tab { min-height: 48px; display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 7px; padding: 0 15px; border: 0; border-right: 1px solid #34465e; border-bottom: 2px solid transparent; background: #1b293e; color: #7892b0; font-size: 9px; font-weight: 650; white-space: nowrap; }
.client-tab:last-child { border-right: 0; }
.client-tab span { color: #7697bb; font-size: 13px; }
.client-tab:hover { background: #1e3048; color: #dce9f8; }
.client-tab.is-active { border-bottom-color: #25bfd1; background: #20334a; color: #fff; }
.client-tab.is-active span { color: #35cee0; }
.client-tab-content { min-height: 255px; margin-top: -14px; border-radius: 0 0 12px 12px; overflow: hidden; }
.client-tab-toolbar { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 18px; border-bottom: 1px solid #34465e; }
.client-tab-toolbar strong { color: #f1f6ff; font-size: 11px; }
.client-tab-toolbar p { margin: 4px 0 0; color: #7d96b3; font-size: 8px; }
.client-contact-add { background: #2968e8; font-size: 9px; }
.contact-table { overflow-x: auto; }
.contact-row { min-width: 920px; display: grid; grid-template-columns: 1.15fr .8fr 1.35fr .9fr .8fr 75px; align-items: center; border-bottom: 1px solid #31435b; }
.contact-row:last-child { border-bottom: 0; }
.contact-row > * { min-width: 0; padding: 12px 14px; color: #c7d7e9; font-size: 9px; overflow-wrap: anywhere; }
.contact-row strong { color: #f3f7fd; font-size: 9.5px; }
.contact-head { background: #101c30; }
.contact-head span { color: #8eacd0; font-size: 8px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.contact-email { color: #83b5fa; }
.detail-state { display: inline-flex; padding: 4px 7px; border: 1px solid #4b5d74; border-radius: 999px; color: #93a7bf; font-size: 7.5px; white-space: nowrap; }
.detail-state.is-on { border-color: #157c67; background: rgba(5,151,116,.1); color: #4ad4b2; }
.contact-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.contact-actions button { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid #3d526d; border-radius: 6px; background: #142238; color: #a9c0dc; }
.contact-actions button:hover { color: #fff; border-color: #607fa5; }
.contact-actions button.is-danger { color: #ff7395; border-color: #704052; }
.client-record-list { display: grid; gap: 10px; padding: 15px 18px 18px; }
.client-record-card { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 14px; border: 1px solid #354962; border-radius: 9px; background: #142238; }
.client-record-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: rgba(47,115,223,.13); color: #78a9f3; font-size: 16px; }
.client-record-main { min-width: 0; }
.client-record-main > span { color: #6485ae; font-size: 7px; font-weight: 800; letter-spacing: .07em; }
.client-record-main > strong { display: block; margin-top: 5px; color: #f1f6ff; font-size: 10.5px; }
.client-record-main > p { margin: 7px 0 0; color: #91a8c3; font-size: 9px; line-height: 1.55; white-space: pre-wrap; }
.client-record-main > small { display: block; margin-top: 8px; color: #627b99; font-size: 7.5px; }
.particularity-departments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.particularity-departments em { padding: 4px 7px; border: 1px solid #315f7b; border-radius: 999px; background: rgba(45,122,164,.12); color: #81bfe2; font-size: 7.5px; font-style: normal; font-weight: 700; }
.particularity-departments em.is-unlinked { border-color: #475a72; background: rgba(118,139,163,.08); color: #8298b0; }
.client-record-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 9px; }
.client-record-meta em { color: #7f98b5; font-size: 8px; font-style: normal; }
.client-record-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.client-record-actions button, .access-reveal { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #3d526d; border-radius: 6px; background: #101d30; color: #a9c0dc; }
.client-record-actions button:hover, .access-reveal:hover { border-color: #627fa4; color: #fff; }
.client-record-actions button.is-danger { border-color: #704052; color: #ff7395; }
.client-expiry-card { grid-template-columns: 38px minmax(0, 1fr) minmax(135px, auto) auto; align-items: center; }
.client-expiry { display: grid; justify-items: end; gap: 5px; text-align: right; }
.client-expiry > strong { color: #879fbb; font-size: 8px; }
.expiry-badge { padding: 5px 7px; border-radius: 6px; font-size: 7.5px; font-weight: 750; font-style: normal; white-space: nowrap; }
.expiry-badge.is-ok { border: 1px solid #147c67; background: rgba(6,151,116,.13); color: #41d5b1; }
.expiry-badge.is-warning { border: 1px solid #846126; background: rgba(235,162,39,.14); color: #f1b64d; }
.expiry-badge.is-expired { border: 1px solid #7e3d50; background: rgba(238,63,107,.13); color: #ff7899; }
.expiry-badge.is-neutral { border: 1px solid #475a72; background: rgba(118,139,163,.1); color: #94a9c0; }
.client-inline-empty { display: flex; align-items: center; gap: 11px; margin: 16px 18px 18px; padding: 14px 16px; border: 1px solid #2f6478; border-radius: 8px; background: rgba(37,150,183,.13); color: #6bd7f4; }
.client-inline-empty > span { font-size: 16px; }
.client-inline-empty strong { color: #9ae7f8; font-size: 9.5px; }
.client-inline-empty p { margin: 3px 0 0; color: #75aabd; font-size: 8px; }
.client-security-note { display: flex; align-items: flex-start; gap: 9px; margin: 15px 18px 0; padding: 11px 12px; border: 1px solid #7b612a; border-radius: 8px; background: rgba(235,162,39,.1); }
.client-security-note strong { flex: 0 0 auto; color: #efb74c; font-size: 8.5px; }
.client-security-note span { color: #bda87d; font-size: 8px; line-height: 1.45; }
.access-record-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.access-record-grid > div { position: relative; min-width: 0; padding: 9px 10px; border: 1px solid #2f425a; border-radius: 7px; background: #0f1c2f; }
.access-record-grid small { display: block; color: #617b9a; font-size: 7px; }
.access-record-grid b, .access-secret { display: block; overflow: hidden; margin-top: 5px; color: #cad9eb; font-size: 8.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.access-record-grid > div:nth-child(2) { padding-right: 42px; }
.access-reveal { position: absolute; right: 6px; top: 50%; width: 26px; height: 26px; transform: translateY(-50%); }
.access-reveal.is-revealed { border-color: #217b76; color: #50d4c6; }
.client-detail-empty { min-height: 188px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; text-align: center; }
.client-detail-empty > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: #14233a; color: #5e85b7; font-size: 19px; }
.client-detail-empty strong { margin-top: 12px; color: #dce8f6; font-size: 11px; }
.client-detail-empty p { max-width: 460px; margin: 6px 0 0; color: #728aa7; font-size: 9px; line-height: 1.5; }
.detail-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 15px 18px 18px; }
.detail-info-card { min-height: 105px; padding: 14px; border: 1px solid #354962; border-radius: 9px; background: #142238; }
.detail-info-card > span { color: #5e82ae; font-size: 7px; font-weight: 800; letter-spacing: .06em; }
.detail-info-card strong { display: block; margin-top: 7px; color: #f1f6ff; font-size: 10px; }
.detail-info-card p { margin: 7px 0 0; color: #7991ad; font-size: 8px; line-height: 1.45; }
.particularities-editor { display: grid; gap: 7px; padding: 18px; color: #9eb2ca; font-size: 8px; font-weight: 700; }
.particularities-editor textarea { width: 100%; resize: vertical; border: 1px solid #3c506b; border-radius: 8px; outline: 0; background: #0f1c2f; color: #e7f0fc; padding: 12px; font: inherit; font-size: 10px; line-height: 1.6; }
.particularities-editor textarea:focus { border-color: #2f73df; box-shadow: 0 0 0 3px rgba(47,115,223,.12); }
.particularities-editor small { color: #687f9a; font-size: 7.5px; font-weight: 500; }
.detail-coming-soon { padding: 5px 8px; border: 1px solid #43566f; border-radius: 999px; color: #8ba2bd; font-size: 7.5px; }
.client-contact-modal, .client-data-modal { background: #19283d; color: #edf5ff; }
.client-data-modal { max-height: min(90vh, 820px); overflow-y: auto; }
.client-contact-modal .modal-head, .client-data-modal .modal-head { border-color: #34465e; }
.client-contact-modal .modal-head h2, .client-data-modal .modal-head h2 { color: #fff; }
.client-contact-modal .modal-head .icon-btn, .client-data-modal .modal-head .icon-btn { background: #112036; color: #aebfd3; }
.client-contact-modal .field, .client-data-modal .field { color: #a6bad1; }
.client-contact-modal .field input, .client-contact-modal .field select, .client-data-modal .field input, .client-data-modal .field select, .client-data-modal .field textarea { border-color: #3c506b; background: #0e1a2d; color: #eef5ff; }
.client-data-modal .field input::placeholder, .client-data-modal .field textarea::placeholder { color: #627b99; }
.client-contact-modal .modal-actions, .client-data-modal .modal-actions { border-top: 1px solid #34465e; }
.client-contact-modal .btn-quiet, .client-data-modal .btn-quiet { background: #142238; color: #aebfd3; }
.client-data-modal input[type="file"] { padding: 7px; color: #8fa5bf; }
.client-data-modal input[type="file"]::file-selector-button { margin-right: 9px; border: 0; border-radius: 6px; background: #263a54; color: #c9d8e9; padding: 7px 9px; }
.client-data-modal .field > small { color: #69819d; font-size: 7.5px; font-weight: 500; }
.client-data-form { gap: 16px; }
.data-form-section { display: grid; gap: 12px; padding-top: 14px; border-top: 1px solid #34465e; }
.data-form-heading { display: flex; align-items: center; gap: 9px; }
.data-form-heading > span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; background: #142238; color: #79a2d4; }
.data-form-heading strong { display: block; color: #d6e3f3; font-size: 10px; }
.data-form-heading small { display: block; margin-top: 3px; color: #6e87a4; font-size: 7.5px; }
.data-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.input-with-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.input-with-action input { border-radius: 8px 0 0 8px !important; }
.input-with-action button { border: 1px solid #3c506b; border-left: 0; border-radius: 0 8px 8px 0; background: #253b58; color: #81adff; padding: 0 12px; font-size: 8px; font-weight: 750; }
.file-validation-state, .prototype-file-note { margin: 0; color: #7e96b2; font-size: 8px; line-height: 1.45; }
.file-validation-state.is-valid { color: #42d3ad; }
.prototype-file-note { padding: 8px 10px; border-radius: 7px; background: rgba(52,120,246,.08); color: #7495bd; }
.modal-security-warning { display: grid; gap: 4px; padding: 10px 11px; border: 1px solid #7b612a; border-radius: 8px; background: rgba(235,162,39,.1); }
.modal-security-warning strong { color: #efb74c; font-size: 9px; }
.modal-security-warning span { color: #bda87d; font-size: 8px; }
.contact-permission-grid { padding: 0; }
.department-link-field { margin: 0; padding: 13px; border: 1px solid #3c506b; border-radius: 9px; }
.department-link-field legend { padding: 0 5px; color: #a6bad1; font-size: 9px; font-weight: 700; }
.department-link-field > p { margin: 0 0 10px; color: #6f88a6; font-size: 8px; line-height: 1.45; }
.department-check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; outline: 0; }
.department-check-option { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 9px; border: 1px solid #354962; border-radius: 7px; background: #101d30; color: #b8c9dd; cursor: pointer; }
.department-check-option:hover { border-color: #56708f; }
.department-check-option:has(input:checked) { border-color: #257d71; background: rgba(24,154,137,.11); color: #ecfffb; }
.department-check-option input { width: 14px; height: 14px; margin: 0; accent-color: var(--teal); }
.department-check-option span { display: flex; align-items: center; gap: 7px; font-size: 8.5px; font-weight: 650; }
.department-check-option i { width: 8px; height: 8px; border-radius: 50%; background: var(--department-color, var(--teal)); }
#particularityDepartmentError { display: block; min-height: 13px; margin-top: 7px; color: #ff7899; font-size: 8px; }

/* Sistema de Gestão da Qualidade */
.quality-page, .quality-documents-page { display: grid; gap: 16px; }
.quality-hero, .quality-documents-hero { display: flex; align-items: center; gap: 17px; padding: 21px 23px; border: 1px solid #dce6e7; border-radius: 16px; background: linear-gradient(135deg, #ffffff 0%, #f3faf8 100%); box-shadow: var(--shadow); }
.quality-hero-mark { width: 52px; height: 52px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 15px; background: linear-gradient(145deg, #20b7a6, #087a70); color: #fff; font-size: 23px; font-weight: 850; box-shadow: 0 10px 22px rgba(18,163,148,.22); }
.quality-hero > div:nth-child(2), .quality-documents-hero > div { min-width: 0; }
.quality-hero h2, .quality-documents-hero h2 { margin: 4px 0 0; font-size: 20px; letter-spacing: -.025em; }
.quality-hero p, .quality-documents-hero p { max-width: 690px; margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.quality-hero-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.quality-private-badge { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-dark); font-size: 9px; font-weight: 750; white-space: nowrap; }
.quality-private-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.quality-summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 11px; }
.quality-summary-card { position: relative; min-height: 105px; overflow: hidden; padding: 15px 16px; border: 1px solid color-mix(in srgb, var(--quality-color) 25%, var(--line)); border-radius: 13px; background: #fff; box-shadow: 0 5px 18px rgba(13,25,46,.035); }
.quality-summary-card::after { content: ""; position: absolute; right: -17px; bottom: -21px; width: 75px; height: 75px; border-radius: 50%; background: var(--quality-soft); }
.quality-summary-card > span { position: relative; z-index: 1; display: block; color: #627087; font-size: 9px; font-weight: 700; line-height: 1.3; }
.quality-summary-card > strong { position: relative; z-index: 1; display: block; margin-top: 10px; color: var(--quality-color); font-size: 25px; line-height: 1; }
.quality-summary-card > small { position: relative; z-index: 1; display: block; margin-top: 5px; color: #8b95a4; font-size: 8px; }
.quality-control-panel { overflow: hidden; }
.quality-tabs { display: flex; align-items: stretch; overflow-x: auto; border-bottom: 1px solid var(--line); background: #f8fafb; scrollbar-width: thin; }
.quality-tab { min-height: 53px; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 0 13px; border: 0; border-right: 1px solid var(--line); border-bottom: 2px solid transparent; background: transparent; color: #6d798b; font-size: 9px; font-weight: 700; white-space: nowrap; }
.quality-tab > span { color: #7a91ad; font-size: 13px; }
.quality-tab > small { min-width: 18px; padding: 3px 5px; border-radius: 999px; background: #e8edf2; color: #738093; font-size: 7px; text-align: center; }
.quality-tab:hover { background: #f1f6f5; color: var(--ink); }
.quality-tab.is-active { border-bottom-color: var(--teal); background: #fff; color: var(--teal-dark); }
.quality-tab.is-active > span { color: var(--teal); }
.quality-tab.is-active > small { background: var(--teal-soft); color: var(--teal-dark); }
.quality-module-content { min-height: 390px; }
.quality-overview { display: grid; gap: 22px; padding: 23px; }
.quality-overview-intro, .quality-module-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.quality-overview-intro h3, .quality-module-heading h3, .quality-guideline-panel h3 { margin: 4px 0 0; font-size: 16px; }
.quality-overview-intro p, .quality-module-heading p { max-width: 720px; margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.quality-source-note { flex: 0 0 auto; padding: 7px 9px; border: 1px solid #caddeb; border-radius: 8px; background: #f4f9fd; color: #58748f; font-size: 8px; font-weight: 650; }
.quality-module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quality-module-card { min-height: 118px; display: grid; grid-template-columns: 37px minmax(0, 1fr); grid-template-rows: 1fr auto; align-items: start; gap: 5px 11px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); text-align: left; transition: .18s ease; }
.quality-module-card:hover { transform: translateY(-1px); border-color: #acd8d2; box-shadow: 0 9px 22px rgba(13,25,46,.07); }
.quality-module-icon, .quality-record-symbol { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--teal-soft); color: var(--teal-dark); font-size: 16px; font-style: normal; font-weight: 800; }
.quality-module-card strong { display: block; font-size: 10.5px; }
.quality-module-card p { margin: 5px 0 0; color: var(--muted); font-size: 8.5px; line-height: 1.45; }
.quality-module-card em { grid-column: 2; align-self: end; color: #8a94a2; font-size: 8px; font-style: normal; }
.quality-guideline-panel { display: grid; grid-template-columns: 205px minmax(0, 1fr); gap: 18px; padding: 18px; border: 1px solid #d5e5e1; border-radius: 12px; background: #f5fbf9; }
.quality-guideline-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.quality-guideline-grid article { display: flex; align-items: flex-start; gap: 9px; padding: 10px; border-radius: 9px; background: #fff; }
.quality-guideline-grid article > span { width: 21px; height: 21px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--teal-soft); color: var(--teal-dark); font-size: 10px; font-weight: 800; }
.quality-guideline-grid strong { display: block; font-size: 9px; }
.quality-guideline-grid p { margin: 4px 0 0; color: var(--muted); font-size: 8px; line-height: 1.45; }
.quality-module-heading { padding: 22px 23px 17px; border-bottom: 1px solid var(--line); }
.swot-score-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 17px 23px 0; }
.swot-score-grid article { padding: 12px; border-left: 3px solid var(--swot-color, var(--teal)); border-radius: 9px; background: #f7f9fa; }
.swot-score-grid span { display: block; color: var(--muted); font-size: 8px; }
.swot-score-grid strong { display: block; margin-top: 5px; color: var(--swot-color, var(--ink)); font-size: 18px; }
.quality-record-list { display: grid; }
.quality-record-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.quality-record-row:last-child { border-bottom: 0; }
.quality-record-row:hover { background: #fbfcfd; }
.quality-record-symbol { width: 34px; height: 34px; font-size: 14px; }
.quality-record-data { min-width: 0; display: grid; grid-template-columns: minmax(170px, 1.5fr) repeat(3, minmax(90px, 1fr)); align-items: center; gap: 14px; }
.quality-record-data > div { min-width: 0; }
.quality-record-data small { display: block; margin-bottom: 4px; color: #8994a3; font-size: 7px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.quality-record-data strong, .quality-record-data span { display: block; overflow: hidden; color: #536074; font-size: 9px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.quality-record-data .is-primary strong { color: var(--ink); font-size: 10.5px; }
.quality-record-actions { display: flex; gap: 5px; }
.quality-record-actions button { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #efd59f; border-radius: 8px; background: #fffaf0; color: #a66b0b; }
.quality-record-actions button.is-danger { border-color: #efc7d1; background: #fff5f7; color: #c24260; }
.quality-empty { min-height: 230px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; text-align: center; }
.quality-empty > span { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 13px; background: var(--teal-soft); color: var(--teal-dark); font-size: 19px; }
.quality-empty strong { margin-top: 12px; font-size: 12px; }
.quality-empty p { max-width: 440px; margin: 6px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }

.quality-documents-hero { justify-content: space-between; }
.quality-document-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.quality-document-summary article { padding: 14px 16px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.quality-document-summary span { display: block; color: var(--muted); font-size: 8.5px; font-weight: 650; }
.quality-document-summary strong { display: block; margin-top: 7px; color: var(--teal-dark); font-size: 21px; }
.quality-document-summary .is-warning strong { color: #ae7111; }
.quality-document-summary .is-obsolete strong { color: #7b8594; }
.quality-document-panel { overflow: hidden; }
.quality-document-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(125px, auto)) auto; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #f8fafb; }
.quality-document-toolbar > select { min-width: 0; padding-top: 8px; padding-bottom: 8px; font-size: 9px; }
.quality-document-toolbar > span { color: var(--muted); font-size: 8px; white-space: nowrap; }
.quality-document-search { display: flex; align-items: center; min-width: 0; padding-left: 10px; border: 1px solid #dbe2ea; border-radius: 9px; background: #fff; }
.quality-document-search .action-icon { color: #8793a4; }
.quality-document-search input { width: 100%; min-width: 0; border: 0; outline: 0; padding: 9px 10px 9px 7px; font-size: 10px; }
.quality-document-list { display: grid; }
.quality-document-row { display: grid; grid-template-columns: 82px minmax(230px, 1fr) 145px 145px 178px; align-items: center; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.quality-document-row:last-child { border-bottom: 0; }
.quality-document-row:hover { background: #fbfcfd; }
.quality-document-row.is-obsolete { background: #fafbfc; opacity: .82; }
.quality-document-code { align-self: start; display: grid; gap: 5px; }
.quality-document-code > span { display: inline-flex; justify-content: center; padding: 6px 7px; border-radius: 7px; background: var(--navy); color: #fff; font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.quality-document-code small { color: var(--muted); font-size: 8px; text-align: center; }
.quality-document-main { min-width: 0; }
.quality-document-main > div:first-child { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.quality-document-type, .quality-document-status { display: inline-flex; padding: 4px 6px; border-radius: 999px; background: var(--blue-soft); color: #3566bc; font-size: 7px; font-weight: 750; }
.quality-document-status { background: var(--amber-soft); color: #9a6716; }
.quality-document-status[data-status="Aprovado"] { background: var(--green-soft); color: #167950; }
.quality-document-status[data-status="Obsoleto"] { background: #eef0f3; color: #707a88; }
.quality-document-status[data-status="Em revisão"] { background: #f1edff; color: #6941c4; }
.quality-document-main > strong { display: block; margin-top: 7px; font-size: 10.5px; line-height: 1.35; }
.quality-document-main > p { margin: 5px 0 0; color: var(--muted); font-size: 8px; line-height: 1.4; }
.quality-document-departments { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.quality-document-departments em { padding: 3px 6px; border-radius: 999px; background: #f0f3f6; color: #667386; font-size: 7px; font-style: normal; }
.quality-document-review, .quality-document-file { display: grid; gap: 4px; }
.quality-document-review strong, .quality-document-file strong { color: #435066; font-size: 8.5px; line-height: 1.35; }
.quality-document-review span, .quality-document-review small, .quality-document-file small { color: var(--muted); font-size: 7.5px; line-height: 1.35; }
.quality-document-review.is-overdue strong { color: var(--red); }
.quality-document-review.is-warning strong { color: #a86a08; }
.quality-document-review.is-ok strong { color: var(--green); }
.quality-document-file > span { width: 31px; padding: 4px 0; border-radius: 5px; background: #eff1f4; color: #7f8997; font-size: 7px; font-weight: 850; text-align: center; }
.quality-document-file.has-file > span { background: var(--red-soft); color: #c14343; }
.quality-document-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.quality-document-actions button { min-height: 29px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 5px 6px; border: 0; border-radius: 7px; color: #fff; font-size: 7.5px; font-weight: 750; }
.quality-document-actions button:disabled { opacity: .42; cursor: not-allowed; }
.quality-document-actions .view { background: #09aac1; }
.quality-document-actions .edit { background: #ec9b13; }
.quality-document-actions .toggle { background: #586a82; }
.quality-document-actions .delete { background: #e74769; }
.quality-document-history { grid-column: 2 / -1; padding-top: 3px; }
.quality-document-history summary { color: var(--teal-dark); font-size: 8px; font-weight: 700; cursor: pointer; }
.quality-document-history > div { display: grid; grid-template-columns: 60px 78px 1fr; gap: 9px; margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: #f6f8fa; }
.quality-document-history strong, .quality-document-history span, .quality-document-history p { margin: 0; font-size: 8px; }
.quality-document-history span, .quality-document-history p { color: var(--muted); }
.quality-prototype-note { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid #f0dba9; border-radius: 10px; background: #fff9ec; color: #795d29; }
.quality-prototype-note strong { flex: 0 0 auto; font-size: 9px; }
.quality-prototype-note span { font-size: 8.5px; line-height: 1.5; }

.quality-document-modal { width: min(900px, calc(100vw - 28px)); }
.quality-document-modal > form, .quality-record-modal > form { max-height: min(900px, calc(100vh - 30px)); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.quality-document-form { overflow-y: auto; padding-bottom: 15px; }
.quality-document-grid { padding-bottom: 14px; }
.quality-training-option { display: flex; align-items: flex-start; gap: 9px; padding: 11px 12px; border: 1px solid #cbe2dd; border-radius: 9px; background: #f3faf8; color: #345d58; cursor: pointer; }
.quality-training-option input { width: 15px; height: 15px; margin: 2px 0 0; accent-color: var(--teal); }
.quality-training-option strong { display: block; font-size: 10px; }
.quality-training-option small { display: block; margin-top: 3px; color: #6c8985; font-size: 8px; font-weight: 500; }
.quality-department-field { margin: 4px 24px 14px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; }
.quality-department-field legend { padding: 0 5px; color: #4e5969; font-size: 10px; font-weight: 750; }
.quality-department-field > p { margin: 0 0 10px; color: var(--muted); font-size: 8.5px; }
.quality-department-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; outline: 0; }
.quality-department-option { min-height: 37px; display: flex; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; background: #f9fafb; color: #5d6879; cursor: pointer; }
.quality-department-option:has(input:checked) { border-color: #8fcfc5; background: var(--teal-soft); color: var(--teal-dark); }
.quality-department-option input { width: 14px; height: 14px; margin: 0; accent-color: var(--teal); }
.quality-department-option span { display: flex; align-items: center; gap: 7px; font-size: 9px; font-weight: 650; }
.quality-department-option i { width: 7px; height: 7px; border-radius: 50%; background: var(--department-color, var(--teal)); }
#qualityDocumentDepartmentError { display: block; min-height: 12px; margin-top: 6px; color: var(--red); font-size: 8px; }
.quality-file-section { display: grid; grid-template-columns: minmax(190px, .7fr) minmax(260px, 1.3fr); align-items: center; gap: 12px; margin: 0 24px 14px; padding: 13px; border: 1px dashed #bdcbd8; border-radius: 10px; background: #f8fafb; }
.quality-file-heading { display: flex; align-items: center; gap: 9px; }
.quality-file-heading > span { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 9px; background: var(--red-soft); color: #c64646; font-size: 8px; font-weight: 850; }
.quality-file-heading strong { display: block; font-size: 10px; }
.quality-file-heading small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.quality-file-picker { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; border: 1px solid #d7dee7; border-radius: 8px; overflow: hidden; background: #fff; cursor: pointer; }
.quality-file-picker strong { padding: 9px 11px; background: #eaf0f4; color: #4f5f73; font-size: 8.5px; }
.quality-file-picker span { overflow: hidden; padding: 9px 10px; color: var(--muted); font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }
.quality-file-section > small { grid-column: 2; color: var(--muted); font-size: 8px; }
.quality-file-section > small.is-success { color: var(--green); }
.quality-file-section > small.is-error { color: var(--red); }
.quality-revision-note { margin: 0 24px; }
.quality-record-modal { width: min(790px, calc(100vw - 28px)); }
.quality-record-fields { max-height: min(650px, calc(100vh - 190px)); overflow-y: auto; padding-bottom: 20px; }
.quality-record-modal .modal-actions, .quality-document-modal .modal-actions { border-top: 1px solid var(--line); }

.settings-grid { display: grid; grid-template-columns: .82fr 1.18fr; gap: 18px; align-items: start; }
.team-list { border-top: 1px solid var(--line); }
.team-row { padding: 14px 20px; display: grid; grid-template-columns: 36px 1fr auto; gap: 11px; align-items: center; border-bottom: 1px solid var(--line); }
.team-row:last-child { border-bottom: 0; }
.team-info strong { display: block; font-size: 12px; }
.team-info span { color: var(--muted); font-size: 9px; display: block; margin-top: 3px; }
.capacity { text-align: right; }
.capacity strong { display: block; font-size: 12px; }
.capacity span { display: block; color: var(--muted); font-size: 9px; margin-top: 2px; }
.team-edit { grid-column: 3; display: inline-flex; align-items: center; gap: 5px; padding: 4px 0; background: transparent; border: 0; color: var(--teal-dark); font-size: 10px; }
.btn-link:has(.action-icon) { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.notification-list { border-top: 1px solid var(--line); }
.notification-card { display: grid; grid-template-columns: 40px 1fr auto; align-items: start; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.notification-card:last-child { border-bottom: 0; }
.notification-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--teal-dark); background: var(--teal-soft); font-size: 15px; }
.notification-content strong { display: block; font-size: 12px; }
.notification-content p { margin: 4px 0 9px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.notification-options { display: flex; gap: 7px; flex-wrap: wrap; }
.notification-options select { padding: 7px 25px 7px 8px; font-size: 9px; background: #f7f9fa; }
.preview-link { border: 0; background: transparent; color: var(--teal-dark); padding: 7px 0; font-size: 10px; font-weight: 700; }
.switch { position: relative; width: 36px; height: 20px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { position: absolute; inset: 0; background: #ccd3dc; border-radius: 999px; transition: .2s; }
.switch span::after { content: ""; position: absolute; width: 14px; height: 14px; top: 3px; left: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + span { background: var(--teal); }
.switch input:checked + span::after { transform: translateX(16px); }

.modal { width: min(660px, calc(100vw - 28px)); border: 0; border-radius: 18px; padding: 0; color: var(--ink); box-shadow: 0 24px 80px rgba(5,14,29,.3); }
.modal::backdrop { background: rgba(7,16,32,.58); backdrop-filter: blur(3px); }
.modal > form, .modal > .modal-content { padding: 0; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 3px 0 0; font-size: 19px; }
.modal .modal-head .icon-btn { border: 0; background: #f2f4f6; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 20px 24px 10px; }
.form-stack { display: grid; gap: 14px; padding: 20px 24px; }
.field { display: grid; gap: 6px; color: #4e5969; font-size: 10px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; font-weight: 450; font-size: 12px; }
#routineClientHint { color: var(--muted); font-size: 8.5px; font-weight: 500; line-height: 1.35; }
.span-2 { grid-column: span 2; }
.email-preview-note { margin: 4px 24px 0; display: flex; gap: 10px; align-items: center; padding: 11px 12px; border-radius: 10px; background: #f4faf9; color: var(--teal-dark); }
.email-preview-note > span { font-size: 17px; }
.email-preview-note strong { display: block; font-size: 10px; }
.email-preview-note small { display: block; margin-top: 3px; color: #60817e; font-size: 9px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 18px 24px 22px; }
.modal-narrow { width: min(470px, calc(100vw - 28px)); }
.modal-history { width: min(580px, calc(100vw - 28px)); padding-bottom: 22px; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.user-modal { width: min(900px, calc(100vw - 28px)); border: 1px solid #34465f; border-radius: 14px; background: #1b293e; color: #edf4ff; }
.user-modal > form { max-height: min(820px, calc(100vh - 36px)); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.user-modal .modal-head { border-color: #34465e; background: #1b293e; }
.user-modal .modal-head h2 { color: #fff; }
.user-modal .modal-head .icon-btn { background: #112036; color: #aebfd3; }
.user-form-layout { min-height: 0; display: grid; grid-template-columns: 190px minmax(0, 1fr); overflow-y: auto; }
.user-photo-panel { display: flex; flex-direction: column; align-items: center; padding: 28px 20px; border-right: 1px solid #34465e; background: #142238; text-align: center; }
.user-photo-preview { width: 112px; height: 112px; display: grid; place-items: center; overflow: hidden; border: 3px solid #3d5879; border-radius: 50%; background: linear-gradient(145deg, #2d4668, #506c8f); color: #fff; font-size: 31px; font-weight: 800; box-shadow: 0 12px 28px rgba(5,14,29,.28); }
.user-photo-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.user-photo-panel > strong { margin-top: 17px; color: #fff; font-size: 13px; }
.user-photo-panel > p { margin: 6px 0 14px; color: #7790ae; font-size: 10px; line-height: 1.45; }
.user-photo-select, .user-photo-remove { width: 100%; border-radius: 7px; padding: 8px 9px; font-size: 10px; font-weight: 750; cursor: pointer; }
.user-photo-select { border: 1px solid #4c8cff; background: #2869e8; color: #fff; }
.user-photo-select:hover { background: #3478ee; }
.user-photo-remove { margin-top: 7px; border: 1px solid #465b76; background: transparent; color: #a9bdd5; }
.user-photo-remove:hover { border-color: #e06b86; color: #ff8ba2; }
.user-photo-remove:disabled { opacity: .4; cursor: default; }
.user-photo-panel > small { min-height: 28px; margin-top: 10px; color: #7089a7; font-size: 9px; line-height: 1.4; }
.user-photo-panel > small.is-error { color: #ff829a; }
.user-photo-panel > small.is-success { color: #57d5ae; }
.user-form-fields { display: grid; gap: 15px; padding: 22px 24px; }
.user-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.user-modal .field { color: #a6bad1; font-size: 11px; }
.user-modal .field input, .user-modal .field select { min-height: 40px; border-color: #3c506b; background: #0e1a2d; color: #eef5ff; font-size: 12px; }
.user-modal .field input::placeholder { color: #627b99; }
.user-modal .field > small { color: #6f88a6; font-size: 9px; font-weight: 500; line-height: 1.4; }
.user-department-field { margin: 0; padding: 13px; border: 1px solid #3c506b; border-radius: 9px; }
.user-department-field legend { padding: 0 5px; color: #a6bad1; font-size: 11px; font-weight: 700; }
.user-department-field > p { margin: 0 0 10px; color: #7089a7; font-size: 9px; }
.user-department-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; outline: 0; }
.user-department-option { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 9px; border: 1px solid #354962; border-radius: 7px; background: #101d30; color: #b8c9dd; cursor: pointer; }
.user-department-option:hover { border-color: #56708f; }
.user-department-option:has(input:checked) { border-color: #257d71; background: rgba(24,154,137,.11); color: #ecfffb; }
.user-department-option input { width: 14px; height: 14px; margin: 0; accent-color: var(--teal); }
.user-department-option span { display: flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 650; }
.user-department-option i { width: 8px; height: 8px; border-radius: 50%; background: var(--department-color, var(--teal)); }
#personDepartmentError { display: block; min-height: 13px; margin-top: 7px; color: #ff829a; font-size: 9px; }
.user-notification-option { display: flex; align-items: flex-start; gap: 9px; padding: 11px 12px; border: 1px solid #3c506b; border-radius: 9px; background: #101d30; color: #d8e6f7; cursor: pointer; }
.user-notification-option input { width: 15px; height: 15px; margin: 2px 0 0; accent-color: var(--teal); }
.user-notification-option strong { display: block; font-size: 11px; }
.user-notification-option small { display: block; margin-top: 3px; color: #7089a7; font-size: 9px; line-height: 1.4; }
.user-access-note { margin: 0; padding: 9px 11px; border-radius: 8px; background: rgba(52,120,246,.09); color: #86a8cf; font-size: 9px; line-height: 1.5; }
.user-modal .modal-actions { border-top: 1px solid #34465e; background: #18253a; }
.user-modal .btn-quiet { border: 1px solid #465b76; background: transparent; color: #a9bdd5; }
.routine-snapshot { margin: 18px 24px 4px; padding: 13px 14px; background: #f7f9fa; border: 1px solid var(--line); border-radius: 11px; }
.routine-snapshot strong { display: block; font-size: 12px; }
.routine-snapshot span { color: var(--muted); font-size: 10px; display: block; margin-top: 3px; }
.timeline { padding: 10px 28px 4px 36px; }
.timeline-item { position: relative; padding: 0 0 18px 18px; border-left: 1px solid #dbe2ea; }
.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: -5px; top: 2px; width: 9px; height: 9px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
.timeline-item strong { display: block; font-size: 11px; }
.timeline-item p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.timeline-item time { display: block; color: #99a2af; font-size: 9px; margin-top: 4px; }
.email-mock { margin: 20px 24px 10px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.email-mock-head { background: var(--navy); color: #fff; padding: 17px; }
.email-mock-head strong { display: block; font-size: 13px; }
.email-mock-head span { display: block; margin-top: 4px; color: #aebcd0; font-size: 9px; }
.email-mock-body { padding: 18px; font-size: 11px; line-height: 1.65; color: #4c5869; }
.email-mock-body b { color: var(--ink); }
.email-cta { display: inline-block; margin-top: 12px; padding: 8px 12px; border-radius: 8px; background: var(--teal); color: #fff; font-weight: 700; font-size: 10px; }
.preview-disclaimer { margin: 0 24px 22px; padding: 9px; text-align: center; border-radius: 8px; background: var(--amber-soft); color: #7b571e; font-size: 9px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; max-width: 340px; padding: 12px 16px; border-radius: 10px; background: var(--navy); color: #fff; font-size: 11px; box-shadow: 0 14px 40px rgba(8,20,40,.28); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .22s; }
.toast.is-visible { opacity: 1; transform: none; }

@media (max-width: 1080px) {
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
  .quality-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quality-module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quality-guideline-panel { grid-template-columns: 1fr; }
  .quality-document-toolbar { grid-template-columns: minmax(250px, 1fr) repeat(2, minmax(125px, auto)); }
  .quality-document-toolbar > select:nth-of-type(3), .quality-document-toolbar > span { grid-row: 2; }
  .quality-document-row { grid-template-columns: 76px minmax(230px, 1fr) 145px 170px; }
  .quality-document-file { grid-column: 2; }
  .quality-document-actions { grid-column: 4; grid-row: 1 / span 2; }
  .quality-document-history { grid-column: 2 / -1; }
  .settings-grid { grid-template-columns: 1fr; }
  .agenda-row { grid-template-columns: 65px minmax(180px, 1.5fr) 1fr 135px 85px; }
  .agenda-row .row-actions { display: none; }
  .client-details-header { align-items: flex-start; flex-direction: column; }
  .client-details-actions { justify-content: flex-start; }
  .detail-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-list-head { display: none; }
  .user-registry-row { grid-template-columns: minmax(230px, 1fr) auto; align-items: start; }
  .user-access-meta, .user-departments { grid-column: 1; }
  .user-status-block { grid-column: 2; grid-row: 1; }
  .user-actions { width: 200px; grid-column: 2; grid-row: 2 / span 2; flex-wrap: wrap; }
}

@media (max-width: 800px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -260px; width: 248px; transition: .22s; box-shadow: 20px 0 50px rgba(4,12,25,.25); }
  .sidebar.is-open { left: 0; }
  .main-content { padding: 0 16px 38px; }
  .topbar { min-height: 92px; }
  .topbar h1 { font-size: 21px; }
  .mobile-menu { display: block; }
  .topbar > div:nth-child(2) { margin-right: auto; }
  .prototype-pill { display: none; }
  .topbar-actions .btn-primary { padding: 9px 11px; }
  .filter-row { overflow-x: auto; }
  .filter-row select { flex: 0 0 auto; }
  .clear-filter { margin-left: 0; }
  .agenda-row { grid-template-columns: 52px 1fr auto; gap: 9px; }
  .agenda-row .owner, .agenda-row .priority, .agenda-row .row-actions { display: none; }
  .agenda-row .status-select { width: 110px; }
  .routines-toolbar { flex-wrap: wrap; }
  .search-box { flex-basis: 100%; }
  .table-wrap { display: none; }
  .routine-cards { display: grid; border-top: 1px solid var(--line); }
  .routine-card { padding: 15px 17px; border-bottom: 1px solid var(--line); }
  .routine-card-head { display: flex; justify-content: space-between; gap: 12px; }
  .routine-card .owner { margin-top: 12px; }
  .routine-card-foot { margin-top: 12px; display: flex; gap: 7px; }
  .registration-grid { grid-template-columns: 1fr 1fr; }
  .registration-field:nth-child(3n) { border-right: 1px solid var(--line); }
  .registration-field:nth-child(2n) { border-right: 0; }
  .client-heading-row { align-items: flex-start; }
  .client-table-scroll { overflow: visible; }
  .client-table { display: block; min-width: 0; table-layout: auto; }
  .client-table thead { display: none; }
  .client-table tbody { display: grid; gap: 10px; padding: 10px; }
  .client-table tbody tr { display: grid; border: 1px solid #33465f; border-radius: 9px; overflow: hidden; background: #1b293e; }
  .client-table td, .client-table td:last-child { position: static; width: auto; min-width: 0; padding: 11px 12px; border-bottom: 1px solid #314159; background: transparent; box-shadow: none; }
  .client-table td:last-child { border-bottom: 0; }
  .client-actions { justify-content: flex-start; flex-wrap: wrap; }
  .client-action { flex: 1 1 105px; padding: 8px 9px; }
  .client-form-trail { flex-wrap: wrap; }
  .selected-client { margin-left: 0; }
  .client-group-selector { grid-template-columns: 1fr; }
  .client-overview-grid { grid-template-columns: 1fr; gap: 18px; }
  .client-info-column { padding-right: 0; }
  .client-address-block { padding: 17px 0 0; border-top: 1px solid #34465e; border-left: 0; }
  .client-overview-groups { grid-template-columns: 1fr; gap: 9px; }
  .client-tab-toolbar { align-items: flex-start; }
  .contact-table { padding: 10px; }
  .contact-row { min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 10px; border: 1px solid #354962; border-radius: 9px; background: #142238; }
  .contact-row:last-child { margin-bottom: 0; border-bottom: 1px solid #354962; }
  .contact-head { display: none; }
  .contact-row > * { display: grid; gap: 4px; padding: 10px 12px; }
  .contact-row > *::before { content: attr(data-label); color: #6f89a8; font-size: 7px; font-weight: 750; text-transform: uppercase; }
  .contact-actions { justify-content: flex-start; }
  .client-expiry-card { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .client-expiry-card .client-expiry { grid-column: 2; grid-row: 2; justify-items: start; text-align: left; }
  .client-expiry-card > .client-record-actions { grid-column: 3; grid-row: 1; }
  .access-record-grid { grid-template-columns: 1fr; }
  .user-form-layout { grid-template-columns: 1fr; }
  .user-photo-panel { border-right: 0; border-bottom: 1px solid #34465e; }
  .user-photo-preview { width: 96px; height: 96px; }
  .quality-hero, .quality-documents-hero { align-items: flex-start; flex-wrap: wrap; padding: 18px; }
  .quality-hero-actions { width: 100%; margin-left: 69px; }
  .quality-documents-hero .btn { width: 100%; }
  .quality-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quality-overview { padding: 18px; }
  .quality-overview-intro, .quality-module-heading { flex-direction: column; }
  .quality-source-note { align-self: flex-start; }
  .quality-guideline-grid { grid-template-columns: 1fr; }
  .quality-record-data { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quality-document-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quality-document-search { grid-column: 1 / -1; }
  .quality-document-toolbar > select:nth-of-type(3), .quality-document-toolbar > span { grid-row: auto; }
  .quality-document-row { grid-template-columns: 70px minmax(0, 1fr) 150px; align-items: start; }
  .quality-document-review { grid-column: 2; }
  .quality-document-file { grid-column: 2; }
  .quality-document-actions { grid-column: 3; grid-row: 1 / span 3; }
  .quality-document-history { grid-column: 2 / -1; }
  .quality-file-section { grid-template-columns: 1fr; }
  .quality-file-section > small { grid-column: 1; }
  .quality-department-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .summary-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .summary-card { padding: 15px; }
  .summary-value { font-size: 23px; }
  .summary-status { padding: 4px 6px; }
  .calendar-heading { align-items: flex-start; }
  .topbar-actions .btn-primary { font-size: 0; width: 39px; height: 39px; padding: 0; }
  .topbar-actions .btn-primary::after { content: "+"; font-size: 21px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .notification-card { grid-template-columns: 36px 1fr auto; }
  .cadastro-hero { align-items: flex-start; }
  .cadastro-hero .safe-badge { display: none; }
  .registration-grid, .department-grid, .profile-grid { grid-template-columns: 1fr; }
  .registration-field { border-right: 0 !important; }
  .registry-row { grid-template-columns: 1fr auto; gap: 9px; }
  .registry-row .registry-meta { display: none; }
  .client-heading-row { display: grid; }
  .client-count-badge { justify-self: start; }
  .client-toolbar { align-items: stretch; flex-direction: column; }
  .client-search { width: 100%; }
  .client-detail dl { grid-template-columns: 1fr; }
  .client-form-header { align-items: flex-start; flex-direction: column; }
  .dark-form-grid, .dark-form-grid.address-grid { grid-template-columns: 1fr; }
  .dark-form-grid .span-2 { grid-column: span 1; }
  .cnpj-search-control { grid-template-columns: 1fr; }
  .cnpj-search-control button { width: 100%; }
  .client-form-section-head { align-items: flex-start; flex-direction: column; }
  .client-details-header { padding: 14px; }
  .client-title-line { align-items: flex-start; }
  .client-details-actions { display: grid; grid-template-columns: 1fr 1fr auto; width: 100%; }
  .client-status-pill { grid-column: 1 / -1; justify-content: center; }
  .client-detail-edit, .client-detail-toggle { padding: 8px; }
  .client-overview-heading { align-items: flex-start; }
  .client-info-column { grid-template-columns: 1fr; gap: 15px; }
  .client-overview-grid { padding: 15px; }
  .client-overview-groups { margin: 0 15px; }
  .client-tab-toolbar { flex-direction: column; }
  .client-tab-toolbar .btn { width: 100%; }
  .contact-row { grid-template-columns: 1fr; }
  .detail-card-grid { grid-template-columns: 1fr; }
  .contact-permission-grid { grid-template-columns: 1fr; }
  .client-record-list { padding: 12px; }
  .client-record-card, .client-expiry-card { grid-template-columns: 34px minmax(0, 1fr); }
  .client-record-actions, .client-expiry-card > .client-record-actions { grid-column: 2; grid-row: auto; justify-content: flex-start; }
  .client-expiry-card .client-expiry { grid-column: 2; grid-row: auto; }
  .client-security-note { flex-direction: column; }
  .data-form-grid { grid-template-columns: 1fr; }
  .department-check-grid { grid-template-columns: 1fr; }
  .module-landing { align-items: flex-start; flex-direction: column; padding: 24px; }
  .registry-action span { display: none; }
  .registry-action { width: 32px; justify-content: center; padding: 0; }
  .user-registry-summary { align-items: flex-start; flex-direction: column; }
  .user-registry-row { grid-template-columns: 1fr; gap: 11px; }
  .user-access-meta, .user-departments, .user-status-block, .user-actions { width: auto; grid-column: 1; grid-row: auto; }
  .user-actions { justify-content: flex-start; }
  .user-actions .registry-action { width: auto; flex: 1 1 92px; padding: 7px 8px; }
  .user-actions .registry-action span { display: inline; }
  .user-form-fields { padding: 18px 16px; }
  .user-form-grid, .user-department-grid { grid-template-columns: 1fr; }
  .user-form-grid .span-2 { grid-column: span 1; }
  .quality-hero-mark { width: 44px; height: 44px; border-radius: 13px; font-size: 20px; }
  .quality-hero > div:nth-child(2) { width: calc(100% - 61px); }
  .quality-hero h2, .quality-documents-hero h2 { font-size: 17px; }
  .quality-hero-actions { margin-left: 0; }
  .quality-hero-actions .btn { flex: 1; }
  .quality-summary-grid, .quality-document-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quality-module-grid { grid-template-columns: 1fr; }
  .quality-module-heading { padding: 18px; }
  .quality-module-heading .btn { width: 100%; }
  .swot-score-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px 18px 0; }
  .quality-record-row { grid-template-columns: 34px minmax(0, 1fr); padding: 13px 16px; }
  .quality-record-data { grid-template-columns: 1fr; gap: 8px; }
  .quality-record-actions { grid-column: 2; }
  .quality-document-toolbar { grid-template-columns: 1fr; }
  .quality-document-search { grid-column: 1; }
  .quality-document-row { grid-template-columns: 65px minmax(0, 1fr); gap: 11px; padding: 14px; }
  .quality-document-review, .quality-document-file, .quality-document-actions, .quality-document-history { grid-column: 2; grid-row: auto; }
  .quality-document-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quality-document-history > div { grid-template-columns: 1fr; }
  .quality-prototype-note { flex-direction: column; }
  .quality-department-grid { grid-template-columns: 1fr; }
  .quality-department-field, .quality-file-section, .quality-revision-note { margin-left: 16px; margin-right: 16px; }
}

/* Contratos e financeiro */
.nav-item > .nav-group-label { min-width: 0; flex: 1; }
.business-page { display: grid; gap: 18px; }
.business-hero { position: relative; display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; gap: 16px; overflow: hidden; padding: 22px 24px; border: 1px solid #dce4ed; border-radius: 16px; background: linear-gradient(125deg, #fff 0%, #fbfdfd 65%, #edf9f7 100%); box-shadow: var(--shadow); }
.business-hero::after { content: ""; position: absolute; right: -55px; top: -80px; width: 210px; height: 210px; border: 1px solid rgba(22,163,148,.15); border-radius: 50%; box-shadow: 0 0 0 28px rgba(22,163,148,.035), 0 0 0 60px rgba(52,120,246,.025); pointer-events: none; }
.finance-hero { background: linear-gradient(125deg, #fff 0%, #fbfcff 62%, #edf3ff 100%); }
.finance-hero::after { border-color: rgba(52,120,246,.14); box-shadow: 0 0 0 28px rgba(52,120,246,.035), 0 0 0 60px rgba(22,163,148,.025); }
.business-hero-icon { position: relative; z-index: 1; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 15px; background: var(--teal-soft); color: var(--teal); font-size: 25px; font-weight: 800; box-shadow: inset 0 0 0 1px rgba(22,163,148,.16); }
.finance-hero .business-hero-icon { background: var(--blue-soft); color: var(--blue); }
.business-hero h2 { margin: 4px 0 3px; font-size: 22px; letter-spacing: -.035em; }
.business-hero p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.business-hero-actions { position: relative; z-index: 1; display: grid; justify-items: end; gap: 9px; }
.database-state { display: inline-flex; align-items: center; gap: 7px; min-height: 24px; padding: 5px 9px; border-radius: 999px; background: #eef2f6; color: #657287; font-size: 10px; font-weight: 750; }
.database-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #9aa6b5; }
.database-state[data-state="synced"] { background: var(--green-soft); color: #267b55; }
.database-state[data-state="synced"]::before { background: var(--green); box-shadow: 0 0 0 3px rgba(42,154,100,.12); }
.database-state[data-state="saving"], .database-state[data-state="connecting"] { background: var(--amber-soft); color: #8a641f; }
.database-state[data-state="saving"]::before, .database-state[data-state="connecting"]::before { background: var(--amber); animation: database-pulse 1.1s ease-in-out infinite; }
.database-state[data-state="error"] { background: var(--red-soft); color: #a53d3d; }
.database-state[data-state="error"]::before { background: var(--red); }
@keyframes database-pulse { 50% { opacity: .3; transform: scale(.72); } }
.business-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.business-summary-grid article { position: relative; min-height: 116px; overflow: hidden; padding: 17px 18px; border: 1px solid #dfe6ed; border-radius: 14px; background: #fff; box-shadow: 0 5px 20px rgba(12,28,50,.035); }
.business-summary-grid article::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--teal); }
.business-summary-grid article.is-warning::before { background: var(--amber); }
.business-summary-grid article.is-blue::before { background: var(--blue); }
.business-summary-grid article.is-danger::before { background: var(--red); }
.business-summary-grid article.is-success::before { background: var(--green); }
.business-summary-grid span { display: block; color: #647186; font-size: 12px; font-weight: 650; }
.business-summary-grid strong { display: block; margin-top: 10px; color: #17243a; font-size: 22px; letter-spacing: -.035em; }
.business-summary-grid small { display: block; margin-top: 5px; color: #8994a4; font-size: 11px; }
.business-panel { overflow: hidden; }
.business-toolbar, .finance-toolbar { display: flex; align-items: center; gap: 9px; padding: 15px 17px; border-bottom: 1px solid var(--line); background: #fbfcfd; }
.business-toolbar > span, .finance-toolbar > span { margin-left: auto; color: #7d899a; font-size: 11px; font-weight: 650; white-space: nowrap; }
.business-search { min-width: 280px; flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid #d9e2eb; border-radius: 9px; background: #fff; color: #8692a3; }
.business-search input { width: 100%; min-height: 40px; padding: 9px 0; border: 0; outline: 0; background: transparent; font-size: 13px; }
.business-toolbar select, .finance-toolbar select, .competence-filter input { min-height: 42px; font-size: 12px; }
.business-alert { display: flex; align-items: center; gap: 11px; padding: 13px 16px; border: 1px solid #f1d0d0; border-radius: 12px; background: var(--red-soft); color: #8e3f3f; font-size: 12px; }
.business-alert span { color: #a65b5b; }
.business-empty { min-height: 260px; display: grid; place-items: center; align-content: center; gap: 8px; padding: 28px; text-align: center; color: #768397; }
.business-empty > span { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: #edf3f6; color: #7890a7; font-size: 23px; }
.business-empty strong { color: #243249; font-size: 15px; }
.business-empty p { max-width: 430px; margin: 0 0 5px; font-size: 12px; line-height: 1.55; }
.business-empty.compact { min-height: 210px; }
.business-footnote { display: flex; align-items: flex-start; gap: 11px; padding: 12px 15px; border: 1px solid #dce5ed; border-radius: 11px; background: #f8fafc; color: #6e7b8d; font-size: 11px; line-height: 1.5; }
.business-footnote strong { color: #344258; white-space: nowrap; }

.contract-list { display: grid; }
.contract-row { display: grid; grid-template-columns: 100px minmax(220px, 1.5fr) 160px 175px auto; align-items: center; gap: 15px; padding: 15px 17px; border-bottom: 1px solid var(--line); transition: background .18s ease; }
.contract-row:last-child { border-bottom: 0; }
.contract-row:hover { background: #fbfcfd; }
.contract-row.is-inactive { opacity: .68; background: #f8f9fa; }
.contract-code { display: grid; gap: 5px; }
.contract-code span { color: var(--teal-dark); font-size: 12px; font-weight: 800; }
.contract-code small { width: max-content; padding: 4px 7px; border-radius: 999px; background: var(--green-soft); color: #277d57; font-size: 9px; font-weight: 750; }
.is-inactive .contract-code small { background: #edf0f3; color: #687587; }
.contract-main, .contract-cycle, .contract-renewal { min-width: 0; display: grid; gap: 4px; }
.contract-main strong { overflow: hidden; color: #1e2b40; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.contract-main span { overflow: hidden; color: #526176; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.contract-main small, .contract-cycle small, .contract-renewal small { color: #8a95a4; font-size: 10px; line-height: 1.35; }
.contract-cycle > span, .contract-renewal > span { color: #8190a2; font-size: 10px; font-weight: 700; }
.contract-cycle strong, .contract-renewal strong { color: #243249; font-size: 13px; }
.contract-renewal.danger strong { color: var(--red); }
.contract-renewal.warning strong, .contract-renewal.attention strong { color: #a16e14; }
.contract-renewal.ok strong { color: var(--green); }
.business-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.business-actions button { height: 34px; display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 8px; padding: 0 9px; color: #fff; font-size: 10px; font-weight: 750; }
.business-actions .view { background: #14a8c3; }
.business-actions .edit { background: #f0a00b; }
.business-actions .toggle { background: #66758a; }
.business-actions .delete { background: #e64e70; }
.business-actions button:hover { filter: brightness(.95); transform: translateY(-1px); }

.contract-modal { width: min(930px, calc(100vw - 28px)); }
.contract-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 18px 22px 6px; background: #f7f9fb; }
.contract-form-section { padding: 16px; border: 1px solid #dce4ec; border-radius: 13px; background: #fff; }
.contract-form-section.span-2 { grid-column: 1 / -1; }
.contract-form-heading { display: flex; align-items: center; gap: 10px; padding-bottom: 13px; border-bottom: 1px solid #ebeff3; }
.contract-form-heading > span { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; background: var(--teal-soft); color: var(--teal-dark); font-size: 10px; font-weight: 800; }
.contract-form-heading strong { display: block; color: #253248; font-size: 13px; }
.contract-form-heading small { display: block; margin-top: 2px; color: #7f8b9d; font-size: 10px; }
.contract-fields { padding: 14px 0 0; }
.contract-fields .field { color: #576477; font-size: 11px; }
.contract-fields .field input, .contract-fields .field select, .contract-form-grid > .field textarea { min-height: 42px; font-size: 13px; }
.contract-auto-option { grid-column: 1 / -1; display: flex; align-items: flex-start; gap: 9px; min-height: 54px; padding: 10px 11px; border: 1px solid #cfe9e5; border-radius: 9px; background: var(--teal-soft); cursor: pointer; }
.contract-auto-option input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--teal); }
.contract-auto-option strong { display: block; color: #20695f; font-size: 11px; }
.contract-auto-option small { display: block; margin-top: 3px; color: #5f8a83; font-size: 9px; }
.contract-form-grid > .field { grid-column: 1 / -1; padding: 4px 2px 10px; font-size: 11px; }
.contract-detail-modal { width: min(820px, calc(100vw - 28px)); padding-bottom: 22px; }
.contract-detail-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 24px; background: linear-gradient(130deg, #f8fbfb, #eef8f6); }
.contract-detail-code { display: inline-flex; padding: 5px 8px; border-radius: 6px; background: #dff4f0; color: var(--teal-dark); font-size: 10px; font-weight: 800; }
.contract-detail-hero h3 { margin: 9px 0 3px; color: #1d2b40; font-size: 18px; }
.contract-detail-hero p { margin: 0; color: #657387; font-size: 11px; }
.contract-status { padding: 6px 9px; border-radius: 999px; background: var(--green-soft); color: #267b55; font-size: 10px; font-weight: 750; }
.contract-status.inactive { background: #e9edf1; color: #667485; }
.contract-detail-grid, .finance-history-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 16px 24px; }
.contract-detail-grid article, .finance-history-summary > div { display: grid; gap: 5px; padding: 13px; border: 1px solid #e1e7ed; border-radius: 10px; background: #fff; }
.contract-detail-grid span, .finance-history-summary span { color: #758296; font-size: 10px; }
.contract-detail-grid strong, .finance-history-summary strong { color: #243249; font-size: 13px; }
.contract-detail-grid small { color: #919aa8; font-size: 9px; line-height: 1.35; }
.contract-detail-rule { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 24px; padding: 13px 14px; border-radius: 10px; background: #f4f7fa; }
.contract-detail-rule div { display: grid; gap: 4px; }
.contract-detail-rule span, .contract-notes span { color: #7d8999; font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.contract-detail-rule strong { color: #334158; font-size: 11px; }
.contract-notes { margin: 12px 24px 0; padding: 12px 14px; border: 1px solid #e2e7ed; border-radius: 10px; }
.contract-notes p { margin: 6px 0 0; color: #5f6d80; font-size: 11px; line-height: 1.55; }
.contract-linked-titles { margin: 14px 24px 0; overflow: hidden; border: 1px solid #e0e6ec; border-radius: 11px; }
.contract-linked-titles > div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; background: #f7f9fb; }
.contract-linked-titles > div strong { font-size: 12px; }
.contract-linked-titles > div span { color: #7e8a9a; font-size: 10px; }
.contract-linked-titles article { display: grid; grid-template-columns: 75px minmax(0, 1fr) auto 95px; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid #e7ebef; }
.contract-linked-titles article > span { color: #6d7a8d; font-size: 10px; }
.contract-linked-titles article > strong { font-size: 11px; }
.contract-linked-titles article > b { text-align: right; font-size: 11px; }
.contract-no-titles { margin: 0; padding: 18px; color: #7d899a; font-size: 11px; text-align: center; }
.contract-detail-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px 0; }
.contract-detail-actions .btn { display: inline-flex; align-items: center; gap: 6px; }

.finance-integration-note { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid #d3e2f8; border-radius: 12px; background: #f2f7ff; }
.finance-integration-note > span { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: var(--blue-soft); color: var(--blue); font-weight: 800; }
.finance-integration-note strong { display: block; color: #294a7a; font-size: 12px; }
.finance-integration-note p { margin: 3px 0 0; color: #607b9e; font-size: 11px; line-height: 1.5; }
.finance-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 13px 16px 0; border-bottom: 1px solid var(--line); }
.finance-tabs button { display: inline-flex; align-items: center; gap: 7px; min-height: 39px; padding: 0 13px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #728095; font-size: 12px; font-weight: 700; white-space: nowrap; }
.finance-tabs button small { min-width: 20px; padding: 3px 6px; border-radius: 999px; background: #edf1f5; color: #748196; font-size: 9px; }
.finance-tabs button.is-active { border-bottom-color: var(--teal); color: var(--teal-dark); }
.finance-tabs button.is-active small { background: var(--teal-soft); color: var(--teal-dark); }
.finance-toolbar { flex-wrap: wrap; }
.competence-filter { display: inline-flex; align-items: center; gap: 7px; color: #6e7b8d; font-size: 10px; font-weight: 700; }
.receivable-table { display: grid; }
.receivable-row { display: grid; grid-template-columns: minmax(220px, 1.45fr) 105px 135px 145px 132px 138px; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); transition: background .18s ease; }
.receivable-row:last-child { border-bottom: 0; }
.receivable-row:not(.receivable-head):hover { background: #fbfcfd; }
.receivable-row.overdue { background: #fffafa; }
.receivable-head { min-height: 38px; padding-top: 9px; padding-bottom: 9px; background: #f7f9fb; color: #718095; font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.receivable-row > div { min-width: 0; display: grid; gap: 4px; }
.receivable-row > div strong { overflow: hidden; color: #253248; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.receivable-row > div small { color: #8591a1; font-size: 9.5px; line-height: 1.35; }
.finance-status { display: inline-flex; width: max-content; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; font-size: 9px; font-style: normal; font-weight: 800; }
.finance-status.open { background: var(--blue-soft); color: #3167c9; }
.finance-status.overdue { background: var(--red-soft); color: #b04040; }
.finance-status.partial { background: var(--amber-soft); color: #936619; }
.finance-status.paid { background: var(--green-soft); color: #277c56; }
.finance-status.cancelled { background: #eceff2; color: #6a7585; }
.charge-state { display: block; margin-top: 2px; color: #919baa; font-size: 9px; }
.charge-state.has-charge { color: #3478f6; }
.receivable-actions { display: flex !important; grid-auto-flow: column; justify-content: end; gap: 5px !important; }
.receivable-actions button { width: 31px; height: 31px; display: grid; place-items: center; border: 0; border-radius: 8px; color: #fff; }
.receivable-actions .charge { background: #14a8c3; }
.receivable-actions .payment { background: var(--green); }
.receivable-actions .cancel { background: #e64e70; }
.receivable-actions .history { background: #6e7c91; }
.finance-history-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding: 16px; background: #f7f9fb; }
.finance-history-layout > section { overflow: hidden; border: 1px solid #e0e6ec; border-radius: 12px; background: #fff; }
.finance-section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; border-bottom: 1px solid #e6ebef; background: #fbfcfd; }
.finance-section-title strong { display: block; font-size: 12px; }
.finance-section-title span { display: block; margin-top: 2px; color: #8994a3; font-size: 9px; }
.finance-section-title em { min-width: 27px; padding: 5px 7px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-dark); font-size: 9px; font-style: normal; font-weight: 800; text-align: center; }
.finance-history-list { max-height: 430px; overflow-y: auto; }
.finance-history-list article { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 11px 13px; border-bottom: 1px solid #edf0f3; }
.finance-history-list article:last-child { border-bottom: 0; }
.history-symbol { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 800; }
.history-symbol.payment { background: var(--green-soft); color: var(--green); }
.finance-history-list strong { display: block; color: #2b384d; font-size: 10.5px; line-height: 1.35; }
.finance-history-list p { margin: 3px 0 0; color: #8691a1; font-size: 9px; }
.finance-history-list time { color: #909baa; font-size: 9px; white-space: nowrap; }
.finance-no-history { margin: 0; padding: 20px; color: #7d899a; font-size: 11px; text-align: center; }
.modal-history-list { max-height: 440px; margin: 0 24px; border: 1px solid #e0e6ec; border-radius: 11px; }

.payment-modal { width: min(650px, calc(100vw - 28px)); }
.payment-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; padding: 17px 22px 3px; }
.payment-summary > div { display: grid; gap: 4px; padding: 11px; border: 1px solid #e1e7ed; border-radius: 10px; background: #f8fafb; }
.payment-summary span { color: #7d8999; font-size: 9px; }
.payment-summary strong { color: #26344a; font-size: 11px; }
.payment-summary small { color: #6d8a84; font-size: 8.5px; line-height: 1.35; }
.payment-summary .is-total { border-color: #bfe2dc; background: var(--teal-soft); }
.payment-summary .is-total strong { color: var(--teal-dark); font-size: 13px; }
.payment-fields { padding-top: 15px; }
.payment-fields .field { font-size: 11px; }
.payment-help { margin: 5px 24px 0; padding: 10px 12px; border-radius: 9px; background: #f2f6fb; color: #60748f; font-size: 10px; line-height: 1.45; }
.charge-modal { width: min(720px, calc(100vw - 28px)); }
.charge-sheet { margin: 18px 22px 12px; overflow: hidden; border: 1px solid #dce3ea; border-radius: 13px; background: #fff; box-shadow: 0 8px 24px rgba(15,31,54,.055); }
.charge-sheet > header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px 19px; background: var(--navy); color: #fff; }
.charge-sheet > header span { display: block; color: #79dacc; font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.charge-sheet > header strong { display: block; margin-top: 4px; font-size: 15px; }
.charge-sheet > header em { color: #aec0d8; font-size: 10px; font-style: normal; }
.charge-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.charge-grid > div { min-height: 84px; display: grid; align-content: center; gap: 4px; padding: 14px 17px; border-right: 1px solid #e5e9ee; border-bottom: 1px solid #e5e9ee; }
.charge-grid > div:nth-child(2n) { border-right: 0; }
.charge-grid span, .charge-value span, .charge-reference span { color: #7c8899; font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.charge-grid strong { color: #253248; font-size: 12px; }
.charge-grid small { color: #7e8a9a; font-size: 9px; }
.charge-value { display: grid; justify-items: center; gap: 6px; padding: 19px; background: #f4fbfa; text-align: center; }
.charge-value strong { color: var(--teal-dark); font-size: 27px; letter-spacing: -.04em; }
.charge-value small { color: #6e837f; font-size: 9px; }
.charge-reference { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 17px; border-top: 1px dashed #dce3e9; }
.charge-reference code { overflow-wrap: anywhere; color: #4c5c73; font-size: 9px; }
.charge-disclaimer { display: flex; align-items: flex-start; gap: 8px; margin: 0 22px; padding: 10px 12px; border-radius: 9px; background: var(--amber-soft); color: #7d5a1d; font-size: 9px; line-height: 1.45; }
.charge-disclaimer strong { white-space: nowrap; }

/* Lançamentos avulsos, descontos e melhorias */
.finance-hero-buttons { display: flex; justify-content: flex-end; gap: 8px; }
.receivable-actions .discount { background: #7657cf; font-size: 12px; font-weight: 900; }
.receivable-actions .edit-entry { background: #f0a00b; }
.finance-entry-modal { width: min(760px, calc(100vw - 28px)); }
.finance-entry-kind { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 18px 22px 2px; }
.finance-entry-kind label { cursor: pointer; }
.finance-entry-kind input { position: absolute; opacity: 0; pointer-events: none; }
.finance-entry-kind label > span { min-height: 76px; display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto; align-content: center; gap: 2px 10px; padding: 12px 14px; border: 1px solid #dce3ea; border-radius: 11px; background: #f8fafb; transition: .18s ease; }
.finance-entry-kind b { grid-row: 1 / 3; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: #eaf0f5; color: #60738b; font-size: 18px; }
.finance-entry-kind strong { align-self: end; color: #253249; font-size: 13px; }
.finance-entry-kind small { color: #7f8b9c; font-size: 10px; }
.finance-entry-kind input[value="income"]:checked + span { border-color: #9cd8c0; background: var(--green-soft); box-shadow: 0 0 0 3px rgba(42,154,100,.08); }
.finance-entry-kind input[value="income"]:checked + span b { background: #d1efdf; color: var(--green); }
.finance-entry-kind input[value="expense"]:checked + span { border-color: #efb5b5; background: var(--red-soft); box-shadow: 0 0 0 3px rgba(212,81,81,.07); }
.finance-entry-kind input[value="expense"]:checked + span b { background: #f9d7d7; color: var(--red); }
.finance-entry-fields { padding-top: 16px; }
.entry-table { display: grid; }
.entry-row { display: grid; grid-template-columns: minmax(220px, 1.45fr) 135px 130px 120px 100px 150px; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.entry-row:last-child { border-bottom: 0; }
.entry-row:not(.entry-head):hover { background: #fbfcfd; }
.entry-row.expense { background: #fffdfd; }
.entry-row.cancelled { opacity: .62; }
.entry-head { min-height: 38px; padding-top: 9px; padding-bottom: 9px; background: #f7f9fb; color: #718095; font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.entry-row > div { min-width: 0; display: grid; gap: 4px; }
.entry-row > div:first-child { grid-template-columns: 34px minmax(0, 1fr); align-items: center; }
.entry-row strong { overflow: hidden; color: #253248; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.entry-row small { color: #8591a1; font-size: 9.5px; }
.entry-kind-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--green-soft); color: var(--green); font-weight: 900; }
.entry-row.expense .entry-kind-icon { background: var(--red-soft); color: var(--red); }
.discount-modal { width: min(650px, calc(100vw - 28px)); }
.discount-list { display: grid; }
.discount-list article { display: grid; grid-template-columns: 38px minmax(220px, 1fr) 125px 140px auto; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.discount-list article:last-child { border-bottom: 0; }
.discount-symbol { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: #eee9fc; color: #7657cf; font-size: 15px; font-weight: 900; }
.discount-list article > div { min-width: 0; display: grid; gap: 4px; }
.discount-list strong { overflow: hidden; color: #26344a; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.discount-list p { overflow: hidden; margin: 0; color: #6f7d90; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.discount-list small { color: #8a95a4; font-size: 9px; }
.discount-list button { min-height: 32px; display: inline-flex; align-items: center; gap: 5px; padding: 0 9px; border: 1px solid #dce2e8; border-radius: 8px; background: #fff; color: #56657a; font-size: 10px; font-weight: 750; }
.discount-list button:disabled { cursor: not-allowed; opacity: .45; }
.discount-state { width: max-content; padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 800; }
.discount-state.active { background: var(--green-soft); color: #277c56; }
.discount-state.expired { background: var(--red-soft); color: #b04040; }
.discount-state.used { background: var(--blue-soft); color: #3167c9; }

.improvements-hero { background: linear-gradient(125deg, #fff 0%, #fbfefd 62%, #eaf9f6 100%); }
.improvements-hero .business-hero-icon { background: linear-gradient(135deg, #dff7f3, #edf3ff); color: var(--teal); }
.improvement-list { display: grid; }
.improvement-card { position: relative; display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 17px 18px; border-bottom: 1px solid var(--line); transition: .18s ease; }
.improvement-card:last-child { border-bottom: 0; }
.improvement-card:hover { background: #fbfdfd; }
.improvement-card::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 4px 4px 0; background: var(--blue); }
.improvement-card[data-status="needs_info"]::before { background: var(--amber); }
.improvement-card[data-status="approved"]::before, .improvement-card[data-status="in_progress"]::before { background: #7657cf; }
.improvement-card[data-status="rejected"]::before { background: var(--red); }
.improvement-card[data-status="completed"]::before { background: var(--green); }
.improvement-card-code { display: grid; gap: 6px; }
.improvement-card-code span { color: var(--teal-dark); font-size: 10px; font-weight: 850; letter-spacing: .04em; }
.improvement-card-code small { color: #8b96a5; font-size: 9px; }
.improvement-card-main { min-width: 0; display: grid; gap: 6px; }
.improvement-card-main > div { display: flex; align-items: center; gap: 9px; }
.improvement-card-main > div > small { color: #929cab; font-size: 9px; }
.improvement-card-main h3 { margin: 0; color: #233148; font-size: 13px; }
.improvement-card-main p { overflow: hidden; margin: 0; color: #687589; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.improvement-card-main > span { color: #8a95a4; font-size: 9.5px; }
.improvement-card-main > span strong { color: #59687c; }
.improvement-open { min-height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 11px; border: 0; border-radius: 8px; background: #14a8c3; color: #fff; font-size: 10px; font-weight: 800; }
.improvement-status { display: inline-flex; width: max-content; padding: 5px 8px; border-radius: 999px; background: var(--blue-soft); color: #3167c9; font-size: 9px; font-weight: 800; }
.improvement-status.needs_info { background: var(--amber-soft); color: #8c631c; }
.improvement-status.approved, .improvement-status.in_progress { background: #eee9fc; color: #6849bd; }
.improvement-status.rejected { background: var(--red-soft); color: #ac4141; }
.improvement-status.completed { background: var(--green-soft); color: #277c56; }
.improvement-modal { width: min(760px, calc(100vw - 28px)); }
.improvement-author-card { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin: 18px 22px 0; padding: 13px 14px; border: 1px solid #cfe5e1; border-radius: 12px; background: #f4fbfa; }
.improvement-author-avatar { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, var(--teal), #3478f6); color: #fff; font-size: 13px; font-weight: 850; box-shadow: 0 0 0 4px rgba(22,163,148,.1); }
.improvement-author-card span, .improvement-author-card small { display: block; color: #7b8999; font-size: 9px; }
.improvement-author-card strong { display: block; margin: 3px 0; color: #27354b; font-size: 12px; }
.improvement-author-card time { color: #68788d; font-size: 10px; white-space: nowrap; }
.improvement-form-fields { padding-top: 17px; }
.improvement-file-picker { min-height: 64px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 10px 12px; border: 1px dashed #a9c8c3; border-radius: 10px; background: #f7fbfb; cursor: pointer; }
.improvement-file-picker > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--teal-soft); color: var(--teal); font-weight: 900; }
.improvement-file-picker strong { display: block; color: #344359; font-size: 11px; }
.improvement-file-picker small { display: block; margin-top: 3px; color: #7c8a9c; font-size: 9px; }
.improvement-file-picker em { max-width: 230px; overflow: hidden; color: #6e7d91; font-size: 9px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.improvement-detail-modal { width: min(880px, calc(100vw - 28px)); max-height: min(880px, calc(100vh - 24px)); }
.improvement-detail-modal > #improvementDetailBody { max-height: 54vh; overflow-y: auto; background: #f7f9fb; }
.improvement-detail-head { display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid #e1e7ed; background: #fff; }
.improvement-detail-head > div { display: grid; gap: 3px; }
.improvement-detail-head > div span { color: #8692a2; font-size: 9px; text-transform: uppercase; }
.improvement-detail-head strong { color: #28364b; font-size: 11px; }
.improvement-detail-head small { color: #8591a1; font-size: 9px; }
.improvement-description { margin: 15px 20px; padding: 15px 16px; border: 1px solid #dfe6ec; border-radius: 11px; background: #fff; }
.improvement-description > span { color: #798697; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.improvement-description > p { margin: 8px 0 0; color: #4e5d72; font-size: 11px; line-height: 1.6; }
.improvement-timeline { margin: 0 20px 18px; overflow: hidden; border: 1px solid #dfe6ec; border-radius: 11px; background: #fff; }
.improvement-update { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 14px 16px; border-bottom: 1px solid #e8edf1; }
.improvement-update:last-child { border-bottom: 0; }
.improvement-update-dot { width: 12px; height: 12px; margin-top: 3px; border: 3px solid #c8d3e2; border-radius: 50%; background: #fff; }
.improvement-update.masterflow .improvement-update-dot { border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
.improvement-update header { display: flex; align-items: center; gap: 7px; }
.improvement-update header strong { color: #2a384d; font-size: 10.5px; }
.improvement-update header span { padding: 3px 6px; border-radius: 999px; background: #edf2f7; color: #64758b; font-size: 8px; font-weight: 750; }
.improvement-update.masterflow header span { background: var(--teal-soft); color: var(--teal-dark); }
.improvement-update header time { margin-left: auto; color: #929ca9; font-size: 8.5px; }
.improvement-update p { margin: 7px 0 0; color: #5b697c; font-size: 10.5px; line-height: 1.55; }
.improvement-status-change { display: flex; align-items: center; gap: 7px; margin-top: 8px; color: #8994a3; font-size: 9px; }
.improvement-status-change span { text-decoration: line-through; }
.improvement-status-change strong { color: #5c48a6; }
.improvement-attachments { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.improvement-attachments button { min-width: 170px; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px; border: 1px solid #dfe5eb; border-radius: 9px; background: #f8fafb; color: #607086; text-align: left; }
.improvement-attachments button > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; background: var(--blue-soft); color: var(--blue); font-size: 8px; font-weight: 850; }
.improvement-attachments strong { display: block; max-width: 180px; overflow: hidden; color: #344258; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.improvement-attachments small { color: #8a95a4; font-size: 8px; }
.improvement-reply-form { padding-top: 14px; border-top: 1px solid #dfe5eb; background: #fff; }
.improvement-reply-form .form-grid { padding-top: 0; }
.improvement-admin-status { grid-column: 1 / -1; }

@media (max-width: 1220px) {
  .contract-row { grid-template-columns: 90px minmax(210px, 1fr) 150px 160px; }
  .contract-row .business-actions { grid-column: 2 / -1; justify-content: flex-start; }
  .receivable-row { grid-template-columns: minmax(200px, 1.3fr) 90px 120px 135px 120px; }
  .receivable-row > .receivable-actions { grid-column: 2 / -1; justify-content: flex-start; }
  .receivable-head span:last-child { display: none; }
  .entry-row { grid-template-columns: minmax(200px, 1.3fr) 120px 120px 110px 100px; }
  .entry-row > .receivable-actions { grid-column: 2 / -1; justify-content: flex-start; }
  .entry-head span:last-child { display: none; }
}

@media (max-width: 900px) {
  .business-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .business-hero { grid-template-columns: 48px minmax(0, 1fr); }
  .business-hero-icon { width: 48px; height: 48px; }
  .business-hero-actions { grid-column: 2; justify-items: start; }
  .business-toolbar, .finance-toolbar { align-items: stretch; }
  .business-search { min-width: 100%; flex-basis: 100%; }
  .contract-form-grid { grid-template-columns: 1fr; }
  .contract-form-section.span-2 { grid-column: auto; }
  .contract-detail-grid, .finance-history-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-history-layout { grid-template-columns: 1fr; }
  .payment-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .discount-list article { grid-template-columns: 38px minmax(0, 1fr) 110px; }
  .discount-list article > div:nth-of-type(3), .discount-list article > button { grid-column: 2 / -1; }
  .improvement-card { grid-template-columns: 125px minmax(0, 1fr); }
  .improvement-open { grid-column: 2; justify-self: start; }
}

@media (max-width: 700px) {
  .business-hero { padding: 18px; }
  .business-hero h2 { font-size: 19px; }
  .business-hero p { font-size: 12px; }
  .business-hero-actions { grid-column: 1 / -1; width: 100%; justify-items: stretch; }
  .business-hero-actions .btn { width: 100%; }
  .finance-hero-buttons { width: 100%; flex-direction: column; }
  .database-state { justify-content: center; }
  .business-toolbar > select, .finance-toolbar > select, .competence-filter { flex: 1 1 145px; }
  .business-toolbar > span, .finance-toolbar > span { width: 100%; margin-left: 0; }
  .contract-row { grid-template-columns: 78px minmax(0, 1fr); gap: 11px; padding: 14px; }
  .contract-cycle, .contract-renewal { grid-column: 2; }
  .contract-row .business-actions { grid-column: 1 / -1; flex-wrap: wrap; }
  .business-actions button { flex: 1 1 105px; justify-content: center; }
  .receivable-head { display: none; }
  .receivable-table { gap: 10px; padding: 10px; background: #f5f7f9; }
  .receivable-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px; border: 1px solid #dfe5eb; border-radius: 11px; background: #fff; }
  .receivable-row.overdue { background: #fffafa; }
  .receivable-row > div::before { content: attr(data-label); color: #8b96a5; font-size: 8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
  .receivable-row > .receivable-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .receivable-actions button { width: 36px; height: 36px; }
  .entry-head { display: none; }
  .entry-table { gap: 10px; padding: 10px; background: #f5f7f9; }
  .entry-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px; border: 1px solid #dfe5eb; border-radius: 11px; background: #fff; }
  .entry-row > div::before { content: attr(data-label); color: #8b96a5; font-size: 8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
  .entry-row > div:first-child { grid-template-columns: 34px minmax(0, 1fr); }
  .entry-row > div:first-child::before { grid-column: 1 / -1; }
  .entry-row > .receivable-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .improvement-card { grid-template-columns: 1fr; padding-left: 20px; }
  .improvement-open { grid-column: 1; }
  .improvement-detail-head { grid-template-columns: 1fr; }
  .contract-detail-hero { flex-direction: column; }
  .contract-detail-rule { grid-template-columns: 1fr; }
  .contract-linked-titles article { grid-template-columns: 65px 1fr; }
  .contract-linked-titles article > em, .contract-linked-titles article > b { justify-self: start; }
}

@media (max-width: 520px) {
  .business-summary-grid { grid-template-columns: 1fr; }
  .business-summary-grid article { min-height: 98px; }
  .business-footnote, .finance-integration-note { flex-direction: column; }
  .business-footnote strong { white-space: normal; }
  .business-actions button span { display: inline; }
  .contract-form-grid { padding: 12px; }
  .contract-form-section { padding: 13px; }
  .contract-fields { grid-template-columns: 1fr; }
  .contract-fields .span-2 { grid-column: auto; }
  .contract-detail-grid, .finance-history-summary, .payment-summary, .charge-grid { grid-template-columns: 1fr; }
  .charge-grid > div { border-right: 0; }
  .contract-detail-rule, .contract-notes, .contract-linked-titles, .modal-history-list { margin-left: 16px; margin-right: 16px; }
  .contract-linked-titles article { grid-template-columns: 1fr; }
  .contract-detail-actions { flex-direction: column; padding-left: 16px; padding-right: 16px; }
  .contract-detail-actions .btn { justify-content: center; width: 100%; }
  .receivable-row { grid-template-columns: 1fr; }
  .receivable-row > .receivable-actions { grid-column: 1; }
  .payment-fields { grid-template-columns: 1fr; }
  .payment-fields .span-2 { grid-column: auto; }
  .finance-entry-kind { grid-template-columns: 1fr; }
  .entry-row { grid-template-columns: 1fr; }
  .entry-row > .receivable-actions { grid-column: 1; }
  .discount-list article { grid-template-columns: 38px minmax(0, 1fr); }
  .discount-list article > div, .discount-list article > button { grid-column: 2; }
  .improvement-author-card { grid-template-columns: 44px minmax(0, 1fr); }
  .improvement-author-card time { grid-column: 2; }
  .improvement-file-picker { grid-template-columns: 32px minmax(0, 1fr); }
  .improvement-file-picker em { grid-column: 2; }
  .improvement-update header { align-items: flex-start; flex-wrap: wrap; }
  .improvement-update header time { width: 100%; margin-left: 0; }
  .charge-sheet { margin-left: 14px; margin-right: 14px; }
  .charge-reference, .charge-disclaimer { align-items: flex-start; flex-direction: column; }
  .charge-disclaimer { margin-left: 14px; margin-right: 14px; }
}

@media print {
  body * { visibility: hidden !important; }
  #chargeModal[open], #chargeModal[open] * { visibility: visible !important; }
  #chargeModal[open] { position: fixed; inset: 0; width: 100%; max-width: none; border-radius: 0; box-shadow: none; }
  #chargeModal .modal-head, #chargeModal .charge-disclaimer, #chargeModal .modal-actions { display: none !important; }
  .charge-sheet { margin: 0; border: 0; box-shadow: none; }
}
