/* Camada visual compartilhada: operação diária, acessibilidade e telas menores. */
:root { --canvas: #f3f6f8; --ink: #18342f; --muted: #61726e; --line: #dfe7e5; }
body { -webkit-font-smoothing: antialiased; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid #479fcd; outline-offset: 4px;
}
main:focus { outline: none; }
.skip-link { position: fixed; z-index: 100; left: 1rem; top: -100px; padding: 1rem; background: white; color: var(--green-950); border-radius: 8px; }
.skip-link:focus { top: 1rem; }
.app-shell { grid-template-columns: 258px minmax(0, 1fr); }
.sidebar { padding: 1.2rem .9rem; background: linear-gradient(180deg, var(--green-950), color-mix(in srgb, var(--green-950) 82%, #071b25)); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #ffffff40 transparent; }
.credentialing-menu { width: 100%; }
.credentialing-switcher { margin-bottom: .3rem; }
.nav-label { color: #b8cdc7; font-size: .63rem; letter-spacing: .12em; margin: 1rem .85rem .5rem; }
.nav { gap: .2rem; }
.nav a { position: relative; min-height: 44px; padding: .62rem .8rem; font-size: .8rem; color: #d1e3de; border: 1px solid transparent; }
.nav a[aria-current="page"] { background: #ffffff14; border-color: #ffffff1f; color: white; font-weight: 750; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; width: 3px; height: 18px; left: -1px; border-radius: 0 3px 3px 0; background: #98e0c9; }
.nav a[aria-current="page"] .ui-icon { opacity: 1; color: #98e0c9; }
.nav-new { margin-left: auto; padding: .15rem .35rem; border-radius: 4px; color: #c8f5e7; background: #ffffff14; font-size: .54rem; font-weight: 650; }
.sidebar-user { margin-top: 1.5rem; padding: 1rem .65rem .25rem; }
.sidebar-user span { line-height: 1.7; color: #b8cdc7; }
.logout-button { min-height: 44px; color: #c3d8d2; }
.topbar { height: 76px; background: #ffffffed; }
.topbar-title { font-size: .94rem; }
.topbar-context { margin-top: .2rem; font-size: .73rem; }
.topbar-tools { display: flex; align-items: center; gap: .7rem; }
.topbar-tools > .tag { gap: .35rem; padding: .45rem .7rem; background: #f2f7f5; border: 1px solid #dce9e3; }
.content { padding: clamp(1.2rem, 3vw, 2.5rem); }
.page-heading { margin-bottom: 1.9rem; }
.page-heading .eyebrow { display: block; margin-bottom: .55rem; font-size: .64rem; letter-spacing: .12em; }
.page-heading h1 { font-size: clamp(1.7rem, 2.8vw, 2.35rem); line-height: 1.15; }
.page-heading p { max-width: 680px; line-height: 1.65; font-size: .85rem; }
.panel { border-radius: 15px; box-shadow: 0 3px 14px #18342f04; }
.panel-pad { padding: 1.5rem; }
.section-head { gap: 1rem; align-items: flex-start; }
.section-head h2 { line-height: 1.4; }
.section-copy { line-height: 1.65; }
.button { min-height: 43px; border-radius: 9px; font-size: .79rem; line-height: 1.4; }
.button-primary { box-shadow: 0 2px 3px #07382e15; }
.button-ghost { background: white; }
.button[aria-busy="true"] { opacity: .65; cursor: progress; }
.button:disabled { cursor: not-allowed; }
.field input, .field select, .field textarea, .input { min-height: 44px; border-radius: 9px; font-size: .85rem; line-height: 1.4; }
.field input[type="checkbox"], .field input[type="radio"] { min-height: auto; width: auto; accent-color: var(--green-800); }
.field label { line-height: 1.5; }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--red); background: #fffafb; }
.field-error, .errorlist { color: #a12f38; font-size: .78rem; line-height: 1.55; }
.errorlist { list-style: none; padding-left: 0; }
.help { font-size: .74rem; }
table th { background: #f8faf9; padding-block: 1rem; font-size: .63rem; }
table td { padding-block: 1rem; font-size: .8rem; }
tbody tr:hover { background: #f7faf9; }
.cell-title:hover { color: var(--green-800); text-decoration: underline; text-underline-offset: 3px; }
.empty { padding: 2.7rem 1.5rem; line-height: 1.7; font-size: .84rem; }
.empty .ui-icon { width: 1.8rem; height: 1.8rem; color: #809b94; margin-bottom: .8rem; }
.dashboard-kpis { gap: .85rem; margin-bottom: 1.3rem; }
.dashboard-kpi { min-width: 0; padding: 1.25rem; border-radius: 13px; border-top: 3px solid #a3c9bc; box-shadow: 0 3px 14px #18342f04; }
.dashboard-kpi > span { font-size: .71rem; font-weight: 650; }
.dashboard-kpi strong { font-size: 2.2rem; letter-spacing: -.05em; font-variant-numeric: tabular-nums; margin: .8rem 0 .3rem; }
.dashboard-kpi small { line-height: 1.5; font-size: .65rem; }
.dashboard-kpi.kpi-danger { border-top-color: #d77378; }
.dashboard-kpi.kpi-progress { border-top-color: #6da8cf; }
.dashboard-kpi.kpi-success { border-top-color: #5daa91; }
.dashboard-panel { padding: 1.4rem; }
.insight-strip { gap: .85rem; }
.insight-card { border-radius: 10px; }
.insight-card p { line-height: 1.55; }
.monthly-chart { min-height: 190px; }
.month-bar-track { border-bottom: 1px solid var(--line); }
.month-bar-track i { border-radius: 5px 5px 0 0; background: linear-gradient(0deg, var(--green-800), var(--green-650)); }
.lot-card { box-shadow: 0 3px 14px #18342f04; }
.lot-card::after { width: 70px; height: 70px; opacity: .4; }
.next-name { overflow-wrap: anywhere; }
.service-summary-grid .summary-item { gap: 1.1rem; }
.summary-item strong { overflow-wrap: anywhere; }
.mobile-menu { display: none; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: 1rem; font-size: .8rem; color: var(--muted); }
.pagination-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.pagination [aria-current="page"] { color: white; background: var(--green-800); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item { position: relative; padding: .2rem 0 1.6rem 2rem; border-left: 2px solid var(--line); margin-left: .4rem; }
.timeline-item:last-child { border-color: transparent; padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; width: 12px; height: 12px; border: 3px solid white; background: var(--green-650); border-radius: 50%; left: -7px; top: .35rem; box-shadow: 0 0 0 1px var(--line); }
.timeline-item time { color: var(--muted); font-size: .72rem; }
.timeline-item p { font-size: .8rem; line-height: 1.6; }
.danger-panel { border-color: #edc6cb; margin-top: 1.5rem; }
.danger-panel h2 { color: #9d333e; }
.communication-card { margin-top: 1.2rem; }
.form-feedback { padding: 1rem; border-radius: 9px; line-height: 1.6; }
@media (min-width: 761px) and (max-height: 850px) {
  .sidebar { padding-block: .65rem; }
  .nav a { min-height: 44px; padding-block: .45rem; }
  .nav-label { margin-top: .6rem; }
  .sidebar-user { margin-top: .8rem; padding-top: .65rem; }
}
@media (max-width: 1180px) and (min-width: 761px) {
  .app-shell { grid-template-columns: 226px minmax(0, 1fr); }
  .nav a { font-size: .74rem; gap: .55rem; }
  .nav-new { display: none; }
  .dashboard-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .topbar { height: 66px; padding-inline: 1rem; }
  .topbar-tools > .tag { display: none; }
  .mobile-credentialing-switcher { max-width: calc(100vw - 120px); }
  .mobile-credentialing-switcher > summary { max-width: 100%; overflow: hidden; }
  .mobile-menu { display: block; }
  .mobile-menu > summary { display: flex; align-items: center; gap: .4rem; list-style: none; cursor: pointer; padding: .55rem .65rem; border: 1px solid var(--line); border-radius: 8px; color: var(--green-800); font-size: .72rem; font-weight: 700; }
  .mobile-menu > summary::-webkit-details-marker { display: none; }
  .mobile-menu-panel { position: absolute; left: .6rem; right: .6rem; top: 60px; max-height: calc(100dvh - 145px); overflow: auto; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 18px 45px #122f3433; }
  .mobile-menu .nav-label { color: var(--muted); }
  .mobile-menu .nav a { color: var(--ink); min-height: 44px; }
  .mobile-menu .nav a[aria-current="page"] { color: var(--green-800); background: var(--green-100); border-color: transparent; }
  .mobile-menu .nav a[aria-current="page"] .ui-icon { color: var(--green-800); }
  .mobile-menu .nav-new { color: var(--green-800); background: var(--green-100); }
  .mobile-menu-account { border-top: 1px solid var(--line); margin-top: 1rem; padding: 1rem .8rem .2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: .8rem; }
  .mobile-menu-account .button { font-size: .7rem; }
  .content { padding: 1.4rem 1rem 6.3rem; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 1.4rem; }
  .page-heading h1 { font-size: 1.85rem; }
  .page-heading p { font-size: .8rem; }
  .page-heading > .button { width: 100%; }
  .panel-pad, .dashboard-panel { padding: 1.1rem; }
  .section-head { flex-wrap: wrap; }
  .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .dashboard-kpi { padding: 1rem; }
  .dashboard-kpi:last-child { grid-column: 1 / -1; }
  .dashboard-kpi strong { font-size: 2rem; }
  .mobile-nav { padding: .4rem .6rem calc(.4rem + env(safe-area-inset-bottom)); min-height: 66px; background: #fffffff5; backdrop-filter: blur(12px); z-index: 10; }
  .mobile-nav a { padding: .6rem .25rem; border-radius: 8px; min-height: 44px; }
  .mobile-nav a[aria-current="page"] { color: var(--green-800); background: var(--green-100); font-weight: 750; }
  .pagination { flex-wrap: wrap; }
  .table-wrap { overscroll-behavior-x: contain; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media print {
  .sidebar, .topbar, .mobile-nav, .button-row, .skip-link, form { display: none !important; }
  .app-shell { display: block; }
  .content { padding: 0; max-width: none; }
  .panel, .lot-card { box-shadow: none; break-inside: avoid; }
}
.history-row-occurrence {
  background: color-mix(in srgb, var(--theme-accent, #27b59b) 8%, white);
}

.history-row-occurrence td:first-child {
  border-left: 3px solid var(--theme-accent, #27b59b);
}

.history-type-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.history-type-service {
  background: color-mix(in srgb, var(--theme-primary, #0b5f54) 12%, white);
  color: var(--theme-primary, #0b5f54);
}

.history-type-occurrence {
  background: color-mix(in srgb, var(--theme-accent, #27b59b) 18%, white);
  color: #21564f;
}

.occurrence-result {
  color: #365b56;
  font-weight: 700;
}

/* Sistema visual dos formulários */
:root {
  --form-surface: #ffffff;
  --form-soft: color-mix(in srgb, var(--green-100) 42%, #ffffff);
  --form-border: #d8e4e1;
  --form-border-strong: #b9cec8;
  --form-focus: color-mix(in srgb, var(--green-650) 34%, transparent);
  --form-shadow: 0 18px 45px rgba(11, 52, 45, .07);
}

.form-layout {
  gap: 1.35rem;
}

.form-surface,
.form-section,
.profile-card {
  position: relative;
  border: 1px solid var(--form-border);
  background: linear-gradient(180deg, #fff 0%, #fdfefe 100%);
  box-shadow: var(--form-shadow);
}

.form-surface::before,
.profile-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-800), var(--green-650));
  opacity: .9;
}

.form-section,
.profile-card {
  padding: clamp(1.25rem, 2.3vw, 1.85rem);
  border-radius: 17px;
}

.form-section-heading,
.profile-card-title {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  margin: 0 0 1.35rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.form-section-heading > div,
.profile-card-title > div {
  min-width: 0;
}

.form-section-heading h2,
.profile-card-title h2 {
  margin: 0 0 .25rem;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.35;
}

.form-section-heading p,
.profile-card-title p {
  margin: 0;
  color: var(--muted);
  font-size: .74rem;
  line-height: 1.55;
}

.form-step,
.profile-card-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--green-650) 28%, #fff);
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(145deg, var(--green-800), color-mix(in srgb, var(--green-800) 68%, var(--green-650)));
  box-shadow: 0 6px 15px color-mix(in srgb, var(--green-800) 18%, transparent);
  font-size: .75rem;
  font-weight: 850;
}

.form-block {
  padding: 1.2rem 0;
  border-bottom: 1px solid #edf2f0;
}

.form-block:first-child { padding-top: 0; }
.form-block:last-child { padding-bottom: 0; border-bottom: 0; }

.field {
  position: relative;
  gap: .45rem;
}

.field label,
.field-label-row label {
  color: #294741;
  font-size: .77rem;
  font-weight: 780;
  letter-spacing: .005em;
}

.field:focus-within > label,
.field:focus-within > .field-label-row label {
  color: var(--green-800);
}

.form-required,
.form-optional {
  display: inline-flex;
  align-items: center;
  margin-left: .38rem;
  padding: .14rem .38rem;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 820;
  letter-spacing: .045em;
  line-height: 1.25;
  text-transform: uppercase;
  vertical-align: .08rem;
}

.form-required {
  color: #87522a;
  background: #fff0d8;
}

.form-optional {
  color: #62726f;
  background: #edf2f1;
}

.field input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.field select,
.field textarea,
.input {
  width: 100%;
  min-height: 48px;
  padding: .78rem .88rem;
  border: 1px solid var(--form-border-strong);
  border-radius: 11px;
  color: var(--ink);
  background-color: #fff;
  box-shadow: inset 0 1px 2px rgba(16, 56, 49, .025);
  font-size: .84rem;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.field select,
select.input {
  padding-right: 2.35rem;
  cursor: pointer;
}

.field textarea {
  min-height: 112px;
  line-height: 1.6;
}

.field input::placeholder,
.field textarea::placeholder,
.input::placeholder {
  color: #98a7a4;
  opacity: 1;
}

.field input:hover,
.field select:hover,
.field textarea:hover,
.input:hover {
  border-color: #9fbcb5;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.input:focus {
  border-color: var(--green-650);
  outline: 0;
  background: #fff;
  box-shadow: 0 0 0 4px var(--form-focus), 0 8px 20px rgba(16, 72, 61, .06);
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  color: #788784;
  background: #f1f4f3;
  cursor: not-allowed;
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: #c65f67;
  background: #fffafa;
  box-shadow: 0 0 0 3px rgba(198, 95, 103, .1);
}

.help {
  color: #72827f;
  font-size: .75rem;
  line-height: 1.5;
}

.field-error,
.errorlist {
  display: flex;
  align-items: flex-start;
  gap: .35rem;
  margin: 0;
  padding: .48rem .62rem;
  border-radius: 8px;
  color: #8e333b;
  background: #fff0f1;
  font-size: .75rem;
  font-weight: 680;
}

.field-error::before,
.errorlist li::before {
  content: "!";
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  color: #fff;
  background: #b94953;
  font-size: .58rem;
  font-weight: 900;
}

.field input[type="file"] {
  min-height: 58px;
  padding: .5rem;
  border-style: dashed;
  border-width: 1.5px;
  background: var(--form-soft);
  cursor: pointer;
}

.field input[type="file"]::file-selector-button {
  min-height: 38px;
  margin-right: .7rem;
  padding: .55rem .75rem;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--green-800);
  font: inherit;
  font-size: .75rem;
  font-weight: 780;
  cursor: pointer;
}

.choice-card,
.checkbox-field > ul li label {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  min-height: 48px;
  padding: .78rem .82rem;
  border: 1px solid var(--form-border);
  border-radius: 11px;
  color: #314d47;
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

fieldset.checkbox-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.checkbox-field > legend {
  width: 100%;
  margin-bottom: .48rem;
  color: #294640;
  font-size: .74rem;
  font-weight: 760;
  line-height: 1.5;
}

.choice-card:hover,
.checkbox-field > ul li label:hover {
  border-color: var(--green-650);
  box-shadow: 0 7px 18px rgba(15, 68, 58, .07);
  transform: translateY(-1px);
}

.choice-card:has(input:checked),
.checkbox-field > ul li label:has(input:checked) {
  border-color: var(--green-650);
  background: var(--form-soft);
  box-shadow: inset 3px 0 0 var(--green-650);
}

.choice-card input,
.checkbox-field input {
  width: 18px;
  height: 18px;
  margin-top: .04rem;
  accent-color: var(--green-800);
}

.form-actions-card {
  position: sticky;
  top: 94px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--green-800) 20%, var(--line));
  background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--green-100) 28%, #fff));
  box-shadow: 0 20px 45px rgba(10, 52, 44, .1);
}

.form-actions-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--green-800), var(--green-650));
}

.form-actions-card .button {
  justify-content: center;
  width: 100%;
}

.form-actions-card .button-primary {
  min-height: 49px;
  box-shadow: 0 9px 22px color-mix(in srgb, var(--green-800) 22%, transparent);
}

.form-actions-card .button + .button {
  margin-top: .2rem;
}

.form-meta {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .8rem .85rem;
  border: 1px solid #dce9e5;
  border-radius: 11px;
  color: #45605a;
  background: #f6faf9;
  font-size: .72rem;
  line-height: 1.55;
}

.form-meta .ui-icon {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin-top: .12rem;
  color: var(--green-800);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
  margin-top: 1.35rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.button {
  justify-content: center;
  min-height: 44px;
  padding-inline: 1rem;
  border-radius: 10px;
  font-weight: 780;
}

.button-primary {
  background: linear-gradient(135deg, var(--green-800), color-mix(in srgb, var(--green-800) 78%, var(--green-650)));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--green-800) 18%, transparent);
}

.button-primary:hover {
  box-shadow: 0 11px 24px color-mix(in srgb, var(--green-800) 24%, transparent);
}

.notice,
.error-box,
.success-box {
  border-radius: 11px;
}

.reversal-request-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1rem;
  margin-top: 1.1rem;
  padding: 1.1rem;
  border: 1px solid #e6ddd0;
  border-radius: 14px;
  background: linear-gradient(145deg, #fffdf9, #faf7f1);
}

.reversal-decision-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.15rem;
}

.reversal-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1rem;
  padding: 1.15rem;
  border: 1px solid var(--form-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 44, 38, .06);
}

.reversal-card-approve {
  border-top: 4px solid var(--green-650);
  background: linear-gradient(160deg, #f8fffc, #fff 42%);
}

.reversal-card-reject {
  border-top: 4px solid #bd6b61;
  background: linear-gradient(160deg, #fffafa, #fff 42%);
}

.reversal-card h3 {
  margin: .22rem 0 .25rem;
  color: var(--ink);
  font-size: .98rem;
}

.reversal-card p {
  margin: 0;
  color: var(--muted);
  font-size: .73rem;
  line-height: 1.55;
}

.reversal-card-kicker {
  color: var(--green-800);
  font-size: .62rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.reversal-card-reject .reversal-card-kicker {
  color: #9d4c43;
}

.reversal-card .button {
  width: 100%;
  margin-top: auto;
}

@media (max-width: 760px) {
  .form-layout,
  .form-grid,
  .term-grid,
  .position-grid,
  .checkbox-field > ul {
    grid-template-columns: 1fr;
  }

  .form-section,
  .profile-card {
    padding: 1.15rem;
    border-radius: 14px;
  }

  .form-actions-card {
    position: static;
  }

  .reversal-decision-grid,
  .reversal-request-card {
    grid-template-columns: 1fr;
  }

  .reversal-request-card .button {
    width: 100%;
  }

  .form-actions > .button,
  .form-actions > a,
  .button-row.form-actions > .button {
    width: 100%;
  }
}
