/*
 * Tema e identidade CYDAK: cores, navegação, estados dos controles e ajustes de contraste.
 */

:root {
  --brand: #004693;
  --accent: #f4a220;
  --surface: #fff;
  --ink: #18304b;
  --muted: #66788d;
  --line: #dce6f0;
}
body {
  background: #f3f6fa;
  color: var(--ink);
  font-family: 'Poppins', sans-serif;
}
h1,
h2,
h3,
h4 {
  font-family: 'Days One', sans-serif;
  color: var(--brand);
  font-weight: 400;
}
aside {
  background: var(--brand);
  border-radius: 0 20px 20px 0;
  box-shadow: 4px 0 25px #00469315;
}
aside img {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  box-sizing: border-box;
}
nav button {
  font-family: 'Poppins', sans-serif;
  border-radius: 9px;
  margin: 4px 0;
  padding: 12px 14px;
  transition:
    background 0.15s,
    transform 0.15s;
}
nav button.active {
  background: var(--accent);
  color: #152d48;
  font-weight: 600;
}
nav button:hover {
  background: #ffffff1a;
}
nav button.active:hover {
  background: var(--accent);
}
.main {
  padding: 28px;
}
.main > header {
  padding: 0 0 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.main > header h1 {
  font-size: 24px;
  margin-bottom: 7px;
}
.card {
  border: 1px solid var(--line);
  box-shadow: 0 5px 20px #00469307;
  border-radius: 14px;
  padding: 22px;
}
.table {
  padding: 0;
  overflow: auto;
}
.table table th {
  background: #eef4fa;
  color: var(--brand);
  padding: 15px;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
}
.table td {
  padding: 14px 15px;
}
.table tbody tr:hover {
  background: #f8fbff;
}
button {
  font-family: 'Poppins', sans-serif;
  border-radius: 9px;
  min-height: 38px;
  font-weight: 500;
  transition: box-shadow 0.15s;
}
button.primary {
  background: var(--brand);
  border-color: var(--brand);
}
button.primary:hover {
  background: #003875;
  box-shadow: 0 4px 12px #00469325;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
input,
select,
textarea {
  border: 1px solid #cbd9e7;
  border-radius: 9px;
  font-family: 'Poppins', sans-serif;
  padding: 11px 12px;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #f4a22070;
  border-color: var(--accent);
}
input[type='checkbox'],
input[type='radio'] {
  accent-color: var(--brand);
  width: 18px;
  height: 18px;
  padding: 0;
  flex: 0 0 18px;
}
.toolbar {
  gap: 12px;
  align-items: center;
}
.stats {
  gap: 18px;
}
.stats .card {
  border-top: 3px solid var(--accent);
}
.stats strong {
  color: var(--brand);
  font-size: 30px;
}
.stats span {
  font-size: 12px;
}
.badge.loaned {
  background: #fff2d9;
  color: #855500;
}
.badge.available {
  background: #e8f6ed;
  color: #23613d;
}
.badge.maintenance {
  background: #fff0e6;
  color: #994311;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
}
dialog h2 {
  font-size: 20px;
}
dialog::backdrop {
  background: #002e6080;
}
.return-item {
  background: #f7fafc;
}
.selection-summary {
  background: #fff4df;
  border: 1px solid #f4a22060;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: #684800;
}
.sound-settings {
  margin-top: 20px;
}
.sound-settings .formgrid {
  max-width: 700px;
}
.sound-settings input[type='range'] {
  padding: 0;
}
.operation-summary {
  border-left: 4px solid var(--accent);
  background: #f4f8fc;
  padding: 14px;
  border-radius: 8px;
}
.tool-picker .choices {
  max-height: 230px;
}
.tool-picker .check {
  display: grid;
  grid-template-columns: 18px 76px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}
.tool-picker .check:last-child {
  border-bottom: 0;
}
.tool-picker .check:has(input:checked) {
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 7%, transparent);
  box-shadow: inset 3px 0 var(--accent);
}
.toast-success {
  background: #004693 !important;
}
.toast-error {
  background: #934100 !important;
}
.toast-info {
  background: #004693 !important;
}
#toast {
  border-left: 5px solid var(--accent);
  box-shadow: 0 8px 28px #0002;
  line-height: 1.6;
}
.login {
  box-shadow: 0 10px 45px #00469312;
  border: 1px solid var(--line);
}
.document-header {
  border-color: var(--brand);
  color: var(--brand);
}
.document-table th {
  color: var(--brand);
  background: #eef4fa;
}
.document-page,
.document-page td,
.document-page p,
.document-page strong,
.document-footer {
  font-family: 'Poppins', sans-serif;
}
.document-page h1,
.document-page h2,
.document-page h3 {
  font-family: 'Days One', sans-serif;
  font-weight: 400;
  color: var(--brand);
}
.document-header h1 {
  font-size: 16px;
}
.document-footer > p {
  font-size: 8px;
}
@media (max-width: 850px) {
  aside {
    border-radius: 0;
  }
  .main {
    padding: 16px;
  }
  .main > header {
    gap: 16px;
    flex-wrap: wrap;
  }
  .main > header h1 {
    font-size: 20px;
  }
  .card {
    padding: 16px;
  }
  .table {
    padding: 0;
  }
  .toolbar {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* Retirada em etapas: mesma identidade, com menor carga visual por tela. */
.loan-wizard {
  width: min(100%, 1120px);
  margin-inline: auto;
}
.wizard-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
  counter-reset: none;
}
.wizard-progress li {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 0;
  padding: 10px 6px 16px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}
.wizard-progress li::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--line);
}
.wizard-progress li span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface, #fff);
}
.wizard-progress li.active {
  color: var(--brand);
}
.wizard-progress li.active::after,
.wizard-progress li.complete::after {
  background: var(--accent);
}
.wizard-progress li.active span,
.wizard-progress li.complete span {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}
.wizard-step {
  min-height: 320px;
}
.wizard-step[hidden] {
  display: none !important;
}
.wizard-heading {
  margin-bottom: 22px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}
.wizard-heading h2 {
  margin: 4px 0 5px;
  color: var(--brand);
}
.wizard-heading p {
  margin: 0;
}
.wizard-step > section + section {
  margin-top: 24px;
}
.wizard-actions {
  position: sticky;
  bottom: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 28px -26px -26px;
  padding: 14px 26px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  background: color-mix(in srgb, #fff 94%, transparent);
  box-shadow: 0 -10px 24px #0046930a;
  backdrop-filter: blur(8px);
}
#loanStepStatus {
  margin-right: auto;
  font-weight: 600;
}
#loanChoices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 470px;
  padding: 10px;
  overflow: auto;
}
#loanChoices .check {
  display: grid;
  grid-template-columns: auto 76px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 78px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
#loanChoices .check:has(input:checked) {
  border-color: var(--brand);
  box-shadow: inset 3px 0 var(--accent);
}
.tool-choice-content {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.tool-choice-content strong,
.tool-choice-content small {
  overflow-wrap: anywhere;
}
.tool-choice-content small {
  color: var(--muted);
  font-weight: 400;
}
#loanPicker .selection-summary,
#caseSummary {
  position: sticky;
  bottom: 0;
  z-index: 4;
  margin: 10px 0 0;
  box-shadow: 0 5px 18px #68480018;
}
:root[data-theme='dark'] .wizard-actions,
:root[data-theme='dark'] #loanChoices .check {
  background: color-mix(in srgb, #102338 94%, transparent);
}
@media (max-width: 760px) {
  .wizard-progress li {
    flex-direction: column;
    font-size: 0.7rem;
  }
  #loanChoices {
    grid-template-columns: 1fr;
  }
  .wizard-actions {
    margin-inline: -16px;
    margin-bottom: -16px;
    padding: 12px 16px;
  }
}
@media (max-width: 480px) {
  .wizard-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  #loanStepStatus {
    grid-column: 1 / -1;
    grid-row: 1;
    margin: 0;
    text-align: center;
  }
  .wizard-actions button {
    width: 100%;
  }
}

/* Refinamentos do cabeçalho lateral e tempos de transição. */
html,
body,
.main,
.main > header,
.card,
.toolbar,
.table,
dialog,
input,
select,
textarea,
button {
  transition-duration: 320ms;
}
html,
body,
.main,
.main > header,
.card,
.toolbar,
.table,
dialog,
input,
select,
textarea {
  transition-property: background-color, border-color, color, box-shadow;
  transition-timing-function: ease;
}
@media (min-width: 851px) {
  .shell {
    transition-duration: 400ms;
  }
  .sidebar-brand {
    box-sizing: border-box;
    min-height: 0;
    height: 102px;
    padding: 0 10px;
    gap: 6px;
  }
  .sidebar-brand .cydak-brand {
    width: 238px;
    max-width: 238px;
  }
  .sidebar-brand .cydak-brand__logo {
    width: 238px;
    max-width: 238px;
    height: 102px;
  }
  .sidebar-brand .cydak-brand__logo img {
    object-fit: contain;
  }
  .sidebar-brand .sidebar-toggle {
    flex: 0 0 34px;
    width: 34px;
    margin-left: 0;
    padding: 0;
    font-weight: 400;
  }
  .sidebar-collapsed .sidebar-brand {
    height: 64px;
    padding: 0 15px;
    gap: 0;
    justify-content: center;
  }
  .sidebar-collapsed .sidebar-brand .sidebar-toggle {
    flex: 0 0 34px;
    width: 34px;
    margin: 0;
    padding: 0;
    font-weight: 400;
  }
}
.sidebar-toggle,
.sidebar-toggle span {
  font-weight: 400 !important;
}
.sidebar-controls {
  grid-template-columns: 1fr 42px;
}
.sidebar-logout {
  display: grid;
  place-items: center;
  width: 42px;
  padding: 7px;
  font-size: 1.15rem;
}
.sidebar-logout svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#content.module-enter {
  animation-duration: 380ms;
}

/* Administração dos avisos sonoros. */
.sound-library + .card,
.sound-action-list + .card {
  margin-top: 18px;
}
.sound-action-list,
.sound-file-list {
  display: grid;
  gap: 10px;
}
.sound-action-row,
.sound-file-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.sound-file-row {
  align-items: center;
}
.sound-file-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}
@media (max-width: 700px) {
  .sound-action-row,
  .sound-file-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}
@media (prefers-reduced-motion: reduce) {
  html,
  body,
  .main,
  .main > header,
  .card,
  .toolbar,
  .table,
  dialog,
  input,
  select,
  textarea,
  button {
    transition: none !important;
  }
}
@media print {
  .document-page {
    border-radius: 0;
    box-shadow: none;
  }
  .document-table th {
    print-color-adjust: exact;
  }
  .document-header {
    border-color: #004693;
  }
}

/* Identidade fixa: logo padrão branco no menu e variante adaptada ao tema no login. */
.sidebar-brand .cydak-brand {
  display: block;
  width: min(100%, 218px);
  max-width: 218px;
}
.sidebar-brand .cydak-brand__logo {
  display: block;
  width: 100%;
  max-width: 218px;
  height: auto;
  aspect-ratio: 1894 / 830;
}
.sidebar-brand .brand-logo--blue {
  display: none !important;
}
.sidebar-brand .brand-logo--white {
  display: block !important;
}
.login-brand .brand-logo--blue {
  display: block !important;
}
.login-brand .brand-logo--white {
  display: none !important;
}
:root[data-theme='dark'] .login-brand .brand-logo--blue {
  display: none !important;
}
:root[data-theme='dark'] .login-brand .brand-logo--white {
  display: block !important;
}
@media (max-width: 850px) {
  .sidebar-brand .cydak-brand,
  .sidebar-brand .cydak-brand__logo {
    width: min(100%, 190px);
    max-width: 190px;
  }
}

nav button {
  background: transparent;
  color: white;
}
nav button.active {
  color: #004693;
  background: #f4a220;
}
.main > header h1 {
  color: #004693;
}

nav button {
  background: transparent;
  color: white;
}
nav button.active {
  color: #004693;
  background: #f4a220;
}
.main > header h1 {
  color: #004693;
}

.tool-thumbnail {
  width: 76px;
  height: 58px;
  object-fit: contain;
  border: 1px solid #dce6f0;
  border-radius: 8px;
  background: #fff;
  display: block;
}
.thumbnail-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 58px;
  background: #eef4fa;
  border-radius: 8px;
  font-size: 10px;
  color: #66788d;
}
.photo-mode {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}
.photo-mode select {
  width: auto;
}
.diag-ok {
  background: #e8f6ed;
  color: #23613d;
}
.diag-warning {
  background: #fff2d9;
  color: #855500;
}
.diag-error {
  background: #fee7e6;
  color: #a03025;
}

.epi-delivery-row {
  border: 1px solid #dce6f0;
  border-radius: 9px;
  padding: 12px;
  margin: 10px 0;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}
.epi-delivery-row input[type='number'] {
  max-width: 150px;
}
@media (max-width: 600px) {
  .epi-delivery-row {
    grid-template-columns: 1fr;
  }
}

.epi-section-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.epi-section-nav button {
  padding: 16px;
  font-weight: 600;
  background: #eef4fa;
  color: #004693;
}
.epi-section-nav button.active {
  background: #004693;
  color: #fff;
  border-bottom: 4px solid #f4a220;
}
.epi-photo-button {
  background: none;
  padding: 0;
  border: 0;
}
.epi-photo-large {
  width: 100%;
  height: 360px;
  object-fit: contain;
  border-radius: 12px;
  background: #f3f6fa;
}
.epi-search-label {
  margin-bottom: 8px;
}
.epi-employee-summary {
  border-left: 4px solid #f4a220;
  padding: 15px;
  background: #f7fafc;
  margin: 15px 0;
}
@media (max-width: 850px) {
  .epi-section-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.choice-unavailable {
  background: #f5f7fa;
  color: #66788d;
  border-radius: 8px;
  padding: 8px;
}
.choice-unavailable input:disabled {
  cursor: not-allowed;
}
.case-tool-selector .choices {
  max-height: 320px;
}
.case-tool-selector > input {
  margin-bottom: 10px;
}
#loanCases .check {
  align-items: flex-start;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}
#loanCases small {
  font-weight: 400;
  line-height: 1.55;
}
.badge.inactive {
  background: #edf0f4;
  color: #586777;
}
.badge.pending {
  background: #fff2d9;
  color: #855500;
}
.badge.approved {
  background: #e8f6ed;
  color: #23613d;
}
.badge.rejected {
  background: #fee7e6;
  color: #a03025;
}
#requestCaseChoices,
#requestToolChoices {
  max-height: 250px;
  margin-top: 10px;
}
#loanCases .tool-thumbnail {
  flex: 0 0 58px;
}

/* Identidade visual CYDAK original — baseada na pasta institucional fornecida. */
:root {
  --brand: #004693;
  --brand-dark: #003570;
  --brand-deep: #092b51;
  --accent: #f4a220;
  --accent-light: #ffb743;
  --ink: #172b43;
  --muted: #52657b;
  --surface: #f3f6fa;
  --line: #d4deea;
  --radius: 12px;
  color-scheme: light;
}
html {
  background: var(--surface);
  scroll-behavior: smooth;
}
body {
  background: var(--surface);
  color: var(--ink);
  font:
    400 1rem/1.6 'Poppins',
    sans-serif;
}
::selection {
  background: #f4a22055;
  color: var(--ink);
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Days One', sans-serif;
  font-weight: 400;
  line-height: 1.22;
  text-wrap: balance;
  color: var(--brand);
}
a {
  color: var(--brand);
  text-underline-offset: 3px;
}
.eyebrow {
  display: block;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 7px;
}
.cydak-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  white-space: nowrap;
}
.cydak-brand__mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 7px;
  background: #fff;
  color: var(--brand);
  font:
    400 17px/1 'Days One',
    sans-serif;
  letter-spacing: -2px;
}
.cydak-brand__word {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 7px;
  background: #fff;
  font:
    400 22px/1 'Days One',
    sans-serif;
}
.cydak-brand__word span {
  color: var(--brand);
}
.cydak-brand__word b {
  color: var(--accent);
  font: inherit;
}
.cydak-brand--compact .cydak-brand__word {
  display: none;
}
.shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}
.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: linear-gradient(180deg, var(--brand), var(--brand-dark));
  border: 0;
  border-radius: 0;
  color: #e3edfa;
  box-shadow: 2px 0 12px #0002;
  overflow: hidden;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  min-height: 74px;
  padding: 12px;
  background: var(--brand);
  border-bottom: 1px solid #ffffff20;
}
.sidebar-brand .cydak-brand__mark {
  width: 38px;
  height: 38px;
  font-size: 14px;
}
.sidebar-brand .cydak-brand__word {
  font-size: 17px;
  min-height: 38px;
}
.nav-section {
  margin: 20px 20px 6px;
  color: #c5d9ef;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.app-sidebar nav {
  display: grid;
  gap: 3px;
  min-height: 0;
  overflow: auto;
  padding: 5px 10px 14px;
}
.app-sidebar nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 47px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-left: 4px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #e3edfa;
  font-size: 0.84rem;
  font-weight: 500;
  text-align: left;
  box-shadow: none;
}
.app-sidebar nav button:hover {
  background: #ffffff10;
  color: #fff;
  transform: none;
}
.app-sidebar nav button.active {
  background: #ffffff1f;
  color: #fff;
  border-left-color: #00d2ff;
  font-weight: 600;
}
.nav-icon {
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  font:
    600 18px/1 'Poppins',
    sans-serif;
  color: currentColor;
}
.sidebar-footer {
  margin-top: auto;
  padding: 16px 18px;
  background: #0000002e;
  border-top: 1px solid #ffffff20;
}
.sidebar-footer span,
.sidebar-footer small {
  display: block;
}
.sidebar-footer span {
  font-size: 0.72rem;
  font-weight: 600;
}
.sidebar-footer small {
  margin-top: 3px;
  color: #c5d9ef;
  font-size: 0.66rem;
}
.main {
  padding: 0 30px 40px;
}
.main > header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 88px;
  margin: 0 -30px 28px;
  padding: 15px 30px;
  background: #f3f6faee;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.main > header h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2vw, 1.9rem);
}
.main > header .actions {
  display: flex;
  align-items: center;
  gap: 9px;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-right: 5px;
  font-size: 0.82rem;
  font-weight: 600;
}
.user-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-family: 'Days One', sans-serif;
}
button {
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 600;
  transition:
    background 0.15s,
    border-color 0.15s,
    box-shadow 0.15s,
    transform 0.15s;
}
button:hover {
  background: #eaf1f9;
  border-color: #b8c8d9;
}
button:active {
  transform: translateY(1px);
}
button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
button.primary:hover {
  background: var(--brand-dark);
  box-shadow: 0 5px 14px #0046932b;
}
.button-outline {
  background: transparent;
  border-color: var(--brand);
  color: var(--brand);
}
.button-outline:hover {
  background: #eaf1f9;
}
button.danger,
.danger {
  color: #a03025;
}
input,
select,
textarea {
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid #7f91a7;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
textarea {
  min-height: 110px;
  resize: vertical;
}
input::placeholder,
textarea::placeholder {
  color: #7b8b9e;
}
input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid #00a8d766;
  outline-offset: 2px;
  border-color: var(--brand);
}
input[type='checkbox'] {
  min-height: 0;
  accent-color: var(--brand);
}
label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #30465f;
}
.card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 5px 20px #00469308;
}
.stats .card {
  position: relative;
  overflow: hidden;
  border-top: 0;
}
.stats .card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
}
.stats strong {
  font-family: 'Days One', sans-serif;
  font-weight: 400;
  color: var(--brand);
}
.toolbar {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 14px #00469308;
}
.toolbar:empty {
  display: none;
}
.table {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 16px #00469307;
}
.table table {
  border-collapse: separate;
  border-spacing: 0;
}
.table th {
  padding: 13px 15px;
  background: #eaf1f9;
  color: var(--brand);
  font-size: 0.69rem;
  letter-spacing: 0.05em;
}
.table td {
  padding: 14px 15px;
}
.table tbody tr:last-child td {
  border-bottom: 0;
}
.table tbody tr:hover {
  background: #f8fbff;
}
.badge {
  padding: 5px 9px;
  border-radius: 999px;
  font-weight: 600;
}
.choices {
  border-color: var(--line);
  border-radius: 8px;
  background: #fbfdff;
}
.choice-row {
  padding: 9px;
  border-bottom: 1px solid var(--line);
}
.choice-row:last-child {
  border-bottom: 0;
}
.choice-row details {
  margin-left: 28px;
  color: var(--muted);
  font-size: 0.78rem;
}
.choice-row summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 600;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 27px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 70px #001c3f42;
}
dialog::backdrop {
  background: #092b518c;
  backdrop-filter: blur(3px);
}
dialog footer {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
#toast {
  border-radius: 6px;
  border-left: 5px solid var(--accent);
  box-shadow: 0 10px 35px #0003;
}
.login-screen {
  position: relative;
  display: grid;
  grid-template-columns: minmax(380px, 520px) 1fr;
  min-height: 100vh;
  background: #fff;
}
.login-screen .login {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(35px, 7vw, 90px);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.login-brand {
  margin-bottom: 58px;
}
.login-screen .login h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 8px 0 14px;
}
.login-screen .login > p {
  max-width: 430px;
  margin-bottom: 28px;
}
.login-screen .login form {
  max-width: 430px;
  gap: 18px;
}
.login-screen .login form button {
  margin-top: 4px;
  min-height: 50px;
}
.login-visual {
  display: flex;
  align-items: flex-end;
  min-height: 100%;
  padding: clamp(38px, 6vw, 78px);
  background:
    linear-gradient(145deg, #004693ee, #003570f5),
    radial-gradient(circle at 80% 20%, #f4a22055, transparent 35%);
  color: #fff;
  overflow: hidden;
}
.login-visual > div {
  max-width: 660px;
}
.login-visual .eyebrow {
  color: var(--accent);
}
.login-visual h2 {
  max-width: 650px;
  margin: 10px 0 20px;
  color: #fff;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
}
.login-visual p {
  color: #e3edfa;
  font-size: 1.05rem;
}
.epi-section-nav {
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.epi-section-nav button {
  border: 0;
}
.epi-section-nav button.active {
  background: var(--brand);
  border-bottom: 4px solid var(--accent);
}
@media (max-width: 1000px) {
  .login-screen {
    grid-template-columns: 1fr;
  }
  .login-visual {
    display: none;
  }
  .login-screen .login {
    max-width: 560px;
    margin: auto;
  }
  .user-chip > span:last-child {
    display: none;
  }
}
@media (max-width: 850px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .app-sidebar {
    position: relative;
    width: 100%;
    height: auto;
    max-height: none;
    border-radius: 0;
  }
  .sidebar-brand {
    min-height: 62px;
  }
  .sidebar-brand .cydak-brand__word {
    display: flex;
  }
  .nav-section,
  .sidebar-footer {
    display: none;
  }
  .app-sidebar nav {
    display: flex;
    overflow: auto;
    padding: 8px;
  }
  .app-sidebar nav button {
    min-width: max-content;
    width: auto;
    border-left: 0;
    border-bottom: 3px solid transparent;
  }
  .app-sidebar nav button.active {
    border-left: 0;
    border-bottom-color: #00d2ff;
  }
  .main {
    padding: 0 16px 28px;
  }
  .main > header {
    position: relative;
    margin: 0 -16px 20px;
    padding: 14px 16px;
    min-height: 76px;
  }
  .main > header .actions {
    gap: 5px;
  }
  .main > header .actions button {
    padding-inline: 10px;
  }
  .toolbar {
    padding: 10px;
  }
  .card {
    padding: 18px;
  }
}
@media (max-width: 520px) {
  .login-screen .login {
    padding: 28px 20px;
  }
  .login-brand {
    margin-bottom: 38px;
  }
  .cydak-brand__word {
    font-size: 18px;
  }
  .main > header {
    align-items: flex-start;
  }
  .main > header .actions {
    width: 100%;
    justify-content: flex-end;
  }
  .user-chip {
    margin-right: auto;
  }
  .formgrid {
    grid-template-columns: 1fr;
  }
  .wide {
    grid-column: auto;
  }
}

/* Acesso por teclado: o atalho permanece invisível até receber foco. */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: #003b7a;
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 120ms ease;
}
.skip-link:focus {
  transform: translateY(0);
}
#heading:focus,
#content:focus {
  outline: none;
}
@media (prefers-reduced-motion: reduce) {
  .skip-link {
    transition: none;
  }
}

/* Refinamento visual das telas operacionais sem alterar menu ou estados dos botões. */
#content {
  display: grid;
  align-content: start;
  gap: 18px;
}
#content > h2,
#content > section > h2,
#content > .toolbar h2 {
  margin-top: 0;
  color: var(--brand);
  letter-spacing: -0.02em;
}
#content > .toolbar:first-child {
  position: relative;
  align-items: end;
}
#content > .toolbar:first-child::before {
  content: '';
  position: absolute;
  inset: auto 14px 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), var(--accent), transparent 72%);
  opacity: 0.34;
}
.formgrid {
  row-gap: 18px;
}
.formgrid > label,
.filters > label,
.toolbar > label {
  display: grid;
  align-content: start;
  gap: 6px;
}
.table {
  position: relative;
  overflow-x: auto;
  overflow-y: visible;
  max-height: none;
}
.table thead {
  position: static;
}
.table thead th {
  position: static;
}
.table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--brand) 2.5%, transparent);
}
.table tbody tr {
  transition:
    background-color 140ms ease,
    box-shadow 140ms ease;
}
.table tbody tr:focus-within {
  background: color-mix(in srgb, var(--brand) 7%, transparent);
  box-shadow: inset 3px 0 var(--accent);
}
.table td:last-child {
  white-space: nowrap;
}
.empty {
  padding: 38px 20px !important;
  color: var(--muted);
  font-weight: 600;
  text-align: center;
}
.empty::before {
  content: '—';
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 0 auto 10px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--brand);
  background: var(--surface, #fff);
}
.stats [data-dashboard-link] {
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}
.stats [data-dashboard-link]:hover,
.stats [data-dashboard-link]:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
  box-shadow: 0 10px 28px #00469318;
  outline: none;
}
.stats [data-dashboard-link]::after {
  content: 'Abrir →';
  display: block;
  margin-top: 12px;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0;
  transform: translateY(4px);
  transition: 140ms ease;
}
.stats [data-dashboard-link]:hover::after,
.stats [data-dashboard-link]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}
.user-action-card {
  position: relative;
  overflow: hidden;
}
.user-action-card::after {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent 62%);
  opacity: 0.45;
}
.action-content strong {
  color: var(--brand);
  font-size: 0.96rem;
}
.action-content small {
  display: inline-block;
  margin-top: 4px;
}
.screen-skeleton {
  display: grid;
  gap: 14px;
  width: 100%;
}
.skeleton-line,
.skeleton-block,
.skeleton-cards > span {
  display: block;
  border-radius: 10px;
  background: linear-gradient(90deg, #e8eef5 25%, #f7f9fc 50%, #e8eef5 75%);
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.2s linear infinite;
}
.skeleton-title {
  width: min(280px, 58%);
  height: 28px;
}
.skeleton-subtitle {
  width: min(440px, 82%);
  height: 14px;
}
.skeleton-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.skeleton-cards > span {
  height: 94px;
}
.skeleton-block {
  height: 240px;
}
@keyframes skeleton-shimmer {
  to {
    background-position: -220% 0;
  }
}
:root[data-theme='dark'] .skeleton-line,
:root[data-theme='dark'] .skeleton-block,
:root[data-theme='dark'] .skeleton-cards > span {
  background-image: linear-gradient(90deg, #17283b 25%, #20364d 50%, #17283b 75%);
}
@media (max-width: 680px) {
  .skeleton-cards {
    grid-template-columns: 1fr;
  }
  .table td:last-child {
    white-space: normal;
  }
}

/* Painel lateral para consultas extensas; confirmações continuam em modais centrais. */
dialog.detail-drawer {
  inset: 0 0 0 auto;
  width: min(720px, 94vw);
  max-width: 94vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  padding: 0;
  border-width: 0 0 0 1px;
  border-radius: 18px 0 0 18px;
  overflow: hidden;
  animation: detail-drawer-enter 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
dialog.detail-drawer #modalForm {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
dialog.detail-drawer #modalBody {
  flex: 1 1 auto;
  min-height: 0;
  padding: 28px;
  overflow: auto;
  overscroll-behavior: contain;
}
dialog.detail-drawer #modalBody > h2 {
  position: sticky;
  top: -28px;
  z-index: 5;
  margin: -28px -28px 22px;
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--brand);
  background: color-mix(in srgb, #fff 94%, transparent);
  backdrop-filter: blur(10px);
}
dialog.detail-drawer footer {
  position: static;
  flex: 0 0 auto;
  margin: 0;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface, #fff);
}
dialog.detail-drawer footer #cancelModal {
  display: none;
}
dialog.detail-drawer footer button[type='submit'] {
  margin-left: auto;
}
:root[data-theme='dark'] dialog.detail-drawer #modalBody > h2 {
  background: color-mix(in srgb, #102338 94%, transparent);
}
@keyframes detail-drawer-enter {
  from {
    opacity: 0;
    transform: translateX(36px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@media (max-width: 680px) {
  dialog.detail-drawer {
    width: 100vw;
    max-width: 100vw;
    border-left: 0;
    border-radius: 0;
  }
  dialog.detail-drawer #modalBody {
    padding: 20px 16px;
  }
  dialog.detail-drawer #modalBody > h2 {
    top: -20px;
    margin: -20px -16px 18px;
    padding: 18px 16px 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  dialog.detail-drawer {
    animation: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .table tbody tr,
  .stats [data-dashboard-link],
  .stats [data-dashboard-link]::after {
    transition: none;
  }
  .stats [data-dashboard-link]:hover,
  .stats [data-dashboard-link]:focus-visible {
    transform: none;
  }
  .skeleton-line,
  .skeleton-block,
  .skeleton-cards > span {
    animation: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
@media print {
  .document-table th {
    print-color-adjust: exact;
  }
  .document-header {
    border-color: var(--brand);
  }
}

/* Navegação recolhível, marca oficial e temas. */
.cydak-brand__mark img,
.cydak-brand__word img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cydak-brand__mark {
  padding: 2px;
}
.cydak-brand__word {
  width: 126px;
  height: 38px;
  padding: 5px 7px;
}
.sidebar-brand {
  gap: 7px;
}
.sidebar-toggle {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 38px;
  min-height: 38px;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #e3edfa;
  font-size: 18px;
}
.sidebar-toggle:hover {
  background: #ffffff12;
  border-color: transparent;
  color: #fff;
}
.sidebar-controls {
  display: grid;
  grid-template-columns: 1fr 70px;
  gap: 6px;
  margin-top: 11px;
}
.sidebar-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 38px;
  padding: 7px;
  border: 1px solid #ffffff35;
  background: transparent;
  color: #e3edfa;
  font-size: 0.68rem;
}
.sidebar-action:hover {
  background: #ffffff12;
  border-color: #ffffff55;
  color: #fff;
}
.sidebar-logout {
  color: #fff;
}
.app-sidebar nav {
  overflow-x: hidden;
  overflow-y: auto;
  align-content: start;
}
.app-sidebar nav button {
  min-height: clamp(34px, 5.2vh, 47px);
  padding-block: clamp(5px, 1vh, 10px);
}
.sidebar-collapsed {
  grid-template-columns: 64px minmax(0, 1fr);
}
.sidebar-collapsed .sidebar-brand {
  padding-inline: 13px;
}
.sidebar-collapsed .nav-section,
.sidebar-collapsed .sidebar-caption {
  display: none;
}
.sidebar-collapsed .app-sidebar nav {
  padding-inline: 5px;
}
.sidebar-collapsed .app-sidebar nav button {
  justify-content: center;
  padding-inline: 7px;
  border-left-width: 3px;
}
.sidebar-collapsed .app-sidebar nav button > span:last-child {
  width: 0;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateX(-8px);
  white-space: nowrap;
}
.sidebar-collapsed .nav-icon {
  flex-basis: 24px;
}
.sidebar-collapsed .sidebar-footer {
  padding: 8px 5px;
}
.sidebar-collapsed .sidebar-controls {
  grid-template-columns: 1fr;
  margin-top: 0;
}
.sidebar-collapsed .sidebar-action {
  padding: 7px 2px;
}
.sidebar-collapsed .sidebar-action > span:last-child {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --ink: #eef4fc;
  --muted: #b5c4d7;
  --surface: #0c1624;
  --line: #34465d;
}
html[data-theme='dark'],
html[data-theme='dark'] body {
  background: #0c1624;
  color: #eef4fc;
}
html[data-theme='dark'] .main > header {
  background: #0c1624ee;
}
html[data-theme='dark'] .card,
html[data-theme='dark'] .toolbar,
html[data-theme='dark'] .table,
html[data-theme='dark'] dialog,
html[data-theme='dark'] input,
html[data-theme='dark'] select,
html[data-theme='dark'] textarea,
html[data-theme='dark'] button:not(.primary):not(.sidebar-action):not(.sidebar-toggle),
html[data-theme='dark'] .choices,
html[data-theme='dark'] .epi-section-nav {
  background: #142235;
  color: #eef4fc;
  border-color: #34465d;
}
html[data-theme='dark'] .table th {
  background: #1a304c;
  color: #91c4ff;
}
html[data-theme='dark'] .table tbody tr:hover {
  background: #1a2b40;
}
html[data-theme='dark'] h1,
html[data-theme='dark'] h2,
html[data-theme='dark'] h3,
html[data-theme='dark'] h4,
html[data-theme='dark'] .eyebrow,
html[data-theme='dark'] a,
html[data-theme='dark'] .choice-row summary {
  color: #91c4ff;
}
html[data-theme='dark'] label {
  color: #dce7f5;
}
html[data-theme='dark'] .muted {
  color: #b5c4d7;
}
html[data-theme='dark'] .operation-summary,
html[data-theme='dark'] .epi-employee-summary,
html[data-theme='dark'] .return-item {
  background: #182a40;
  color: #eef4fc;
}
html[data-theme='dark'] .user-action-card {
  background: #182a40;
  border-color: #34465d;
  border-left-color: var(--orange);
}
html[data-theme='dark'] .action-number {
  background: #203b5b;
  color: #91c4ff;
}
html[data-theme='dark'] .pending-empty {
  background: #173528;
  color: #b8e5c8;
}
html[data-theme='dark'] .inventory-scan {
  background: #182a40;
}
html[data-theme='dark'] .notification-item.unread {
  background: #182a40;
}
html[data-theme='dark'] dialog::backdrop {
  background: #000b18aa;
}
html[data-theme='dark'] .login-screen {
  background: #0c1624;
}
html[data-theme='dark'] .login-screen .login {
  background: #0c1624;
}
html[data-theme='dark'] .login-visual {
  background: linear-gradient(145deg, #003570, #092b51);
}
html[data-theme='dark'] .document-page,
html[data-theme='dark'] .document-page * {
  color: #172b43;
}
html[data-theme='dark'] .document-page h1,
html[data-theme='dark'] .document-page h2,
html[data-theme='dark'] .document-page h3,
html[data-theme='dark'] .document-header strong,
html[data-theme='dark'] .document-table th {
  color: #004693;
}
@media (max-height: 760px) and (min-width: 851px) {
  .sidebar-brand {
    min-height: 58px;
    padding-block: 8px;
  }
  .sidebar-brand .cydak-brand__mark {
    width: 34px;
    height: 34px;
  }
  .sidebar-brand .cydak-brand__word {
    height: 34px;
  }
  .nav-section {
    margin-top: 9px;
  }
  .app-sidebar nav {
    gap: 1px;
    padding-block: 2px;
  }
  .app-sidebar nav button {
    min-height: 32px;
    padding-block: 4px;
    font-size: 0.76rem;
  }
  .nav-icon {
    font-size: 15px;
  }
  .sidebar-footer {
    padding: 8px 12px;
  }
  .sidebar-controls {
    margin-top: 5px;
  }
  .sidebar-action {
    min-height: 31px;
  }
  .sidebar-caption small {
    display: none;
  }
}
@media (max-width: 850px) {
  .sidebar-toggle {
    display: none;
  }
  .sidebar-collapsed {
    grid-template-columns: 1fr;
  }
  .sidebar-collapsed .sidebar-brand .cydak-brand {
    display: inline-flex;
  }
  .sidebar-collapsed .app-sidebar nav {
    padding: 8px;
  }
  .sidebar-collapsed .app-sidebar nav button > span:last-child {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
  }
  .sidebar-collapsed .sidebar-footer {
    display: none;
  }
  .app-sidebar nav {
    overflow-x: auto;
    overflow-y: hidden;
  }
  .sidebar-controls {
    grid-template-columns: 1fr 70px;
  }
  .sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .sidebar-caption {
    margin-right: auto;
  }
  .sidebar-controls {
    margin-top: 0;
    min-width: 210px;
  }
}
.app-sidebar nav {
  scrollbar-width: none;
}
.app-sidebar nav::-webkit-scrollbar {
  display: none;
}
.sidebar-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}
.sidebar-controls {
  display: flex;
  grid-template-columns: none;
  margin-top: 0;
}
.sidebar-action {
  width: auto;
  white-space: nowrap;
}
.sidebar-action:first-child > span:last-child {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.sidebar-logout {
  padding-inline: 10px;
}
.sidebar-collapsed .sidebar-footer {
  display: block;
}
.sidebar-collapsed .sidebar-controls {
  display: grid;
}
.sidebar-collapsed .sidebar-logout {
  padding-inline: 2px;
}

/* Revisão fiel dos controles e da navegação CYDAK. */
.sidebar-brand {
  padding: 10px 9px;
  min-height: 64px;
}
.sidebar-brand .cydak-brand {
  gap: 5px;
}
.sidebar-brand .cydak-brand__mark {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 5px;
}
.sidebar-brand .cydak-brand__word {
  width: 138px;
  height: 34px;
  min-height: 34px;
  padding: 4px 6px;
}
.sidebar-toggle {
  flex-basis: 31px;
  width: 31px;
  height: 34px;
  min-height: 34px;
  font-size: 16px;
}
.app-sidebar nav {
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #ffffff55 transparent;
}
.app-sidebar nav::-webkit-scrollbar {
  display: block;
  width: 6px;
  height: 0;
}
.app-sidebar nav::-webkit-scrollbar-track {
  background: transparent;
}
.app-sidebar nav::-webkit-scrollbar-thumb {
  background: #ffffff55;
  border-radius: 8px;
}
.app-sidebar nav::-webkit-scrollbar-thumb:hover {
  background: #ffffff88;
}
button:not(.sidebar-toggle):not(.sidebar-action):not(.app-sidebar nav button):not(
    .epi-photo-button
  ) {
  background: #004693;
  border-color: #004693;
  color: #fff;
  border-radius: 6px;
  box-shadow: none;
}
button:not(.sidebar-toggle):not(.sidebar-action):not(.app-sidebar nav button):not(
    .epi-photo-button
  ):hover {
  background: #003570;
  border-color: #003570;
  color: #fff;
  box-shadow: none;
}
button:not(.sidebar-toggle):not(.sidebar-action):not(.app-sidebar nav button):not(
    .epi-photo-button
  ):active {
  background: #092b51;
  border-color: #092b51;
  transform: translateY(1px);
}
button:not(.sidebar-toggle):not(.sidebar-action):not(.app-sidebar nav button):not(
    .epi-photo-button
  ):focus-visible {
  outline: 3px solid #f4a220;
  outline-offset: 3px;
}
button:not(.sidebar-toggle):not(.sidebar-action):not(.app-sidebar nav button):not(
    .epi-photo-button
  ):disabled {
  background: #8ca9c7;
  border-color: #8ca9c7;
  color: #eef4fc;
  opacity: 0.65;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
button.danger {
  background: transparent !important;
  border-color: #a03025 !important;
  color: #a03025 !important;
}
button.danger:hover {
  background: #fee7e6 !important;
  color: #7b211a !important;
}
.modal-cancel,
dialog footer button:first-child {
  background: transparent !important;
  border-color: #004693 !important;
  color: #004693 !important;
}
dialog footer button:first-child:hover {
  background: #eaf1f9 !important;
  color: #003570 !important;
}
.app-sidebar nav button,
.app-sidebar nav button:hover,
.app-sidebar nav button:active,
.app-sidebar nav button:focus,
.app-sidebar nav button:focus-visible {
  color: #e3edfa;
}
.app-sidebar nav button {
  background: transparent !important;
  border-color: transparent;
  border-left-color: transparent;
}
.app-sidebar nav button:hover {
  background: #ffffff0d !important;
  color: #fff;
}
.app-sidebar nav button:active {
  background: #ffffff18 !important;
  transform: none;
}
.app-sidebar nav button.active,
.app-sidebar nav button[aria-current='page'] {
  background: #ffffff1f !important;
  border-left-color: #00d2ff;
  color: #fff;
}
.app-sidebar nav button:focus-visible {
  outline: 2px solid #00d2ff;
  outline-offset: -2px;
}
:root[data-theme='dark'] .app-sidebar {
  background: linear-gradient(180deg, #004693, #003570);
  color: #e3edfa;
}
:root[data-theme='dark'] .app-sidebar nav button {
  background: transparent !important;
  border-color: transparent;
  color: #e3edfa;
}
:root[data-theme='dark'] .app-sidebar nav button:hover {
  background: #ffffff0d !important;
  color: #fff;
}
:root[data-theme='dark'] .app-sidebar nav button.active,
:root[data-theme='dark'] .app-sidebar nav button[aria-current='page'] {
  background: #ffffff1f !important;
  border-left-color: #00d2ff;
  color: #fff;
}
:root[data-theme='dark'] .sidebar-action,
:root[data-theme='dark'] .sidebar-toggle {
  background: transparent !important;
  border-color: #ffffff35;
  color: #e3edfa;
}
:root[data-theme='dark'] .sidebar-action:hover,
:root[data-theme='dark'] .sidebar-toggle:hover {
  background: #ffffff12 !important;
  color: #fff;
}
@media (max-width: 850px) {
  .app-sidebar nav {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .app-sidebar nav::-webkit-scrollbar {
    display: none;
  }
  .sidebar-brand .cydak-brand__mark {
    width: 28px;
    height: 28px;
  }
  .sidebar-brand .cydak-brand__word {
    width: 132px;
    height: 32px;
  }
}
.nav-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  font-size: 0;
}
.nav-icon svg {
  display: block;
  width: 20px;
  height: 20px;
  overflow: visible;
}
.app-sidebar nav button:hover .nav-icon,
.app-sidebar nav button[aria-current='page'] .nav-icon {
  color: #fff;
}
.sidebar-collapsed .nav-icon,
.sidebar-collapsed .nav-icon svg {
  width: 22px;
  height: 22px;
}

/* Proporções independentes da marca no menu e na tela de acesso. */
.sidebar-brand {
  min-height: 56px;
  padding: 8px 9px;
}
.sidebar-brand .cydak-brand__mark {
  width: 24px;
  height: 24px;
}
.sidebar-brand .cydak-brand__word {
  width: 112px;
  height: 28px;
  min-height: 28px;
  padding: 3px 5px;
}
.sidebar-brand .sidebar-toggle {
  height: 30px;
  min-height: 30px;
}
.login-brand .cydak-brand {
  gap: 12px;
}
.login-brand .cydak-brand__mark {
  width: 72px;
  height: 72px;
  padding: 3px;
  border-radius: 9px;
}
.login-brand .cydak-brand__word {
  width: 230px;
  height: 64px;
  min-height: 64px;
  padding: 7px 10px;
  border-radius: 9px;
}
@media (max-height: 760px) and (min-width: 851px) {
  .sidebar-brand {
    min-height: 50px;
    padding-block: 6px;
  }
  .sidebar-brand .cydak-brand__mark {
    width: 22px;
    height: 22px;
  }
  .sidebar-brand .cydak-brand__word {
    width: 104px;
    height: 26px;
    min-height: 26px;
  }
}
@media (max-width: 850px) {
  .sidebar-brand .cydak-brand__mark {
    width: 23px;
    height: 23px;
  }
  .sidebar-brand .cydak-brand__word {
    width: 110px;
    height: 27px;
    min-height: 27px;
  }
  .login-brand .cydak-brand__mark {
    width: 62px;
    height: 62px;
  }
  .login-brand .cydak-brand__word {
    width: 205px;
    height: 58px;
    min-height: 58px;
  }
}
@media (max-width: 420px) {
  .login-brand .cydak-brand {
    gap: 8px;
  }
  .login-brand .cydak-brand__mark {
    width: 54px;
    height: 54px;
  }
  .login-brand .cydak-brand__word {
    width: 178px;
    height: 52px;
    min-height: 52px;
  }
}

/* Cabeçalho do menu reproduzido conforme a referência enviada. */
@media (min-width: 851px) {
  .shell {
    grid-template-columns: 300px minmax(0, 1fr);
  }
  .shell.sidebar-collapsed {
    grid-template-columns: 64px minmax(0, 1fr);
  }
  .sidebar-brand {
    min-height: 76px;
    padding: 15px;
    gap: 8px;
  }
  .sidebar-brand .cydak-brand {
    gap: 8px;
  }
  .sidebar-brand .cydak-brand__mark {
    width: 45px;
    height: 45px;
    padding: 0;
    border-radius: 7px;
  }
  .sidebar-brand .cydak-brand__word {
    width: 150px;
    height: 45px;
    min-height: 45px;
    padding: 5px 9px;
    border-radius: 7px;
  }
  .sidebar-brand .sidebar-toggle {
    flex: 0 0 36px;
    width: 36px;
    height: 40px;
    min-height: 40px;
    margin-left: auto;
    font-size: 18px;
  }
  .sidebar-collapsed .sidebar-brand {
    min-height: 64px;
    padding: 12px 14px;
  }
  .sidebar-collapsed .sidebar-brand .sidebar-toggle {
    width: 36px;
    height: 40px;
  }
}
@media (max-width: 850px) {
  .sidebar-brand {
    min-height: 68px;
    padding: 11px 14px;
    gap: 8px;
  }
  .sidebar-brand .cydak-brand {
    gap: 8px;
  }
  .sidebar-brand .cydak-brand__mark {
    width: 42px;
    height: 42px;
  }
  .sidebar-brand .cydak-brand__word {
    width: 145px;
    height: 42px;
    min-height: 42px;
  }
}

/* Marca do menu: neutraliza margens herdadas e reduz a área branca ao mínimo. */
.sidebar-brand .cydak-brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 5px;
  height: 40px;
}
.sidebar-brand .cydak-brand__mark,
.sidebar-brand .cydak-brand__word {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-sizing: border-box;
  overflow: hidden;
  background: #fff;
}
.sidebar-brand .cydak-brand__mark {
  width: 40px;
  height: 40px;
  padding: 1px;
  border-radius: 6px;
}
.sidebar-brand .cydak-brand__word {
  width: 144px;
  height: 40px;
  min-height: 40px;
  padding: 1px 3px;
  border-radius: 6px;
}
.sidebar-brand .cydak-brand__mark img,
.sidebar-brand .cydak-brand__word img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  object-fit: contain;
}

/* Logo CYDAK AMS: arquivo único para preservar proporções e legibilidade. */
.cydak-brand__logo {
  display: block;
  width: min(100%, 360px);
  aspect-ratio: 1894 / 830;
}
.cydak-brand__logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.sidebar-brand .cydak-brand__logo {
  width: 164px;
  height: 52px;
}
.login-brand .cydak-brand__logo {
  width: clamp(220px, 62vw, 360px);
}
.cydak-brand--compact .cydak-brand__logo {
  width: 52px;
  overflow: hidden;
}
.cydak-brand--compact .cydak-brand__logo img {
  width: 119px;
  max-width: none;
  object-position: left center;
}
@media (max-height: 760px) and (min-width: 851px) {
  .sidebar-brand .cydak-brand__logo {
    width: 148px;
    height: 46px;
  }
}
@media (max-width: 850px) {
  .sidebar-brand .cydak-brand__logo {
    width: 154px;
    height: 48px;
  }
}

/* Identidade CYDAK AMS sem placas de fundo, conforme o menu de referência. */
.cydak-brand__logo,
.cydak-brand__logo img {
  background: transparent !important;
}
.brand-logo--blue {
  display: none !important;
}
.sidebar-brand .cydak-brand {
  height: auto;
}
.sidebar-brand .cydak-brand__logo {
  width: 170px;
  height: auto;
  aspect-ratio: 1894 / 830;
}
.sidebar-brand .brand-logo--white {
  display: block !important;
}
.login-screen .login {
  position: relative;
}
.login-brand {
  width: min(100%, 430px);
  margin-bottom: 42px;
}
.login-brand .cydak-brand,
.login-brand .cydak-brand__logo {
  display: block;
  width: 100%;
  height: auto;
}
.login-brand .brand-logo--white {
  display: none !important;
}
.login-brand .brand-logo--blue {
  display: block !important;
}
:root[data-theme='dark'] .login-brand .brand-logo--blue {
  display: none !important;
}
:root[data-theme='dark'] .login-brand .brand-logo--white {
  display: block !important;
}
.login-theme-toggle {
  position: absolute;
  z-index: 3;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  align-items: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid #001f4966 !important;
  border-radius: 10px;
  background: #071a30cc !important;
  color: #fff !important;
  font-size: 1.05rem;
  line-height: 1;
  box-shadow: 0 3px 12px #001a3540 !important;
}
.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;
}
.login-theme-toggle:hover {
  background: #0d2948 !important;
  border-color: #7ab8ff88 !important;
  color: #fff !important;
}
:root[data-theme='dark'] .login-theme-toggle {
  border-color: #4f6b8c !important;
  background: #071a30e8 !important;
  color: #fff !important;
}
:root[data-theme='dark'] .login-theme-toggle:hover {
  background: #123352 !important;
}
@media (max-height: 760px) and (min-width: 851px) {
  .sidebar-brand .cydak-brand__logo {
    width: 150px;
    height: auto;
  }
}
@media (max-width: 850px) {
  .sidebar-brand .cydak-brand__logo {
    width: 158px;
    height: auto;
  }
}
@media (max-width: 520px) {
  .login-theme-toggle {
    color: #fff !important;
  }
  .login-brand {
    margin-top: 42px;
  }
}
@media (max-height: 760px) and (min-width: 851px) {
  .sidebar-brand .cydak-brand {
    height: 36px;
  }
  .sidebar-brand .cydak-brand__mark {
    width: 36px;
    height: 36px;
  }
  .sidebar-brand .cydak-brand__word {
    width: 130px;
    height: 36px;
    min-height: 36px;
  }
}
@media (max-width: 850px) {
  .sidebar-brand .cydak-brand {
    height: 38px;
  }
  .sidebar-brand .cydak-brand__mark {
    width: 38px;
    height: 38px;
  }
  .sidebar-brand .cydak-brand__word {
    width: 138px;
    height: 38px;
    min-height: 38px;
  }
}

/* Estados CYDAK para todos os botões, exceto os controles do menu lateral. */
button:not(.app-sidebar button) {
  background: #004693 !important;
  border-color: #004693 !important;
  color: #fff !important;
  opacity: 1;
  box-shadow: none !important;
}
button:not(.app-sidebar button):hover:not(:disabled) {
  background: #f4a220 !important;
  border-color: #f4a220 !important;
  color: #102a47 !important;
}
button:not(.app-sidebar button):active:not(:disabled),
button:not(.app-sidebar button).active,
button:not(.app-sidebar button)[aria-pressed='true'],
button:not(.app-sidebar button)[aria-current='true'] {
  background: #fff !important;
  border-color: #004693 !important;
  color: #004693 !important;
  transform: translateY(1px);
}
button:not(.app-sidebar button):disabled {
  background: #00469373 !important;
  border-color: #00469333 !important;
  color: #eef5fc !important;
  opacity: 1;
  cursor: not-allowed;
  box-shadow: none !important;
  transform: none;
}
button:not(.app-sidebar button):focus-visible {
  outline: 3px solid #f4a220 !important;
  outline-offset: 3px;
}
.modal-cancel,
dialog footer button:first-child,
.button-outline {
  background: #fff !important;
  border-color: #004693 !important;
  color: #004693 !important;
}
.modal-cancel:hover,
dialog footer button:first-child:hover,
.button-outline:hover {
  background: #f4a220 !important;
  border-color: #f4a220 !important;
  color: #102a47 !important;
}

/* Contraste das ferramentas indisponíveis/emprestadas na retirada. */
:root[data-theme='dark'] .tool-picker .choice-unavailable {
  background: #203854;
  color: #f4f8fd;
  border: 1px solid #58799d;
}
:root[data-theme='dark'] .tool-picker .choice-unavailable .badge.loaned {
  background: #f4a220;
  color: #102a47;
  border: 1px solid #ffc45c;
}
:root[data-theme='dark'] .tool-picker .choice-unavailable input:disabled {
  opacity: 0.82;
}
.profile-access-note {
  margin: 4px 0 0;
  padding: 13px 15px;
  border-left: 4px solid #f4a220;
  border-radius: 6px;
  background: #eef4fa;
  color: #30465f;
}
:root[data-theme='dark'] .profile-access-note {
  background: #203854;
  color: #eef4fc;
}

/* O submenu de Desenvolvimento segue a mesma navegação visual do módulo de EPIs. */
.development-section-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.development-section-nav button {
  min-width: 0;
  padding: 16px;
  border: 0;
  font-weight: 600;
}
.development-section-nav button.active {
  border: 1px solid #004693 !important;
  border-bottom: 4px solid #f4a220 !important;
  background: #fff !important;
  color: #004693 !important;
}
:root[data-theme='dark'] .development-section-nav {
  background: #142235;
  border-color: #34465d;
}
@media (max-width: 850px) {
  .development-section-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .development-section-nav {
    grid-template-columns: 1fr;
  }
}

/* Maletas da retirada: contraste completo no modo escuro. */
:root[data-theme='dark'] #loanCases .check {
  background: #182a40;
  color: #eef4fc;
  border: 1px solid #34465d;
  border-radius: 8px;
}
:root[data-theme='dark'] #loanCases .check strong,
:root[data-theme='dark'] #loanCases .check small {
  color: inherit;
}
:root[data-theme='dark'] #loanCases .check.choice-unavailable {
  background: #203854;
  color: #f4f8fd;
  border-color: #58799d;
}
:root[data-theme='dark'] #loanCases .check:has(input:checked) {
  background: #fff;
  color: #004693;
  border-color: #f4a220;
  box-shadow: inset 4px 0 0 #f4a220;
}
:root[data-theme='dark'] #loanCases input:disabled {
  opacity: 0.82;
}
:root[data-theme='dark'] #loanCases .tool-thumbnail {
  background: #fff;
  border: 1px solid #58799d;
}
:root[data-theme='dark'] #caseSummary {
  background: #203854;
  color: #ffd58b;
  border-color: #f4a22080;
}

/* Navegação inspirada no MES: marca dominante e movimentos curtos e suaves. */
@media (min-width: 851px) {
  .shell {
    grid-template-columns: 300px minmax(0, 1fr);
    transition: grid-template-columns 280ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  .shell.sidebar-collapsed {
    grid-template-columns: 64px minmax(0, 1fr);
  }
  .sidebar-brand {
    min-height: 112px;
    padding: 14px 12px 14px 16px;
  }
  .sidebar-brand .cydak-brand {
    width: 218px;
    max-width: 218px;
    opacity: 1;
    transform: translateX(0);
    transform-origin: left center;
    transition:
      max-width 240ms cubic-bezier(0.22, 1, 0.36, 1),
      opacity 160ms ease,
      transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  .sidebar-brand .cydak-brand__logo {
    width: 218px;
    max-width: 218px;
    height: auto;
  }
  .sidebar-brand .sidebar-toggle {
    flex: 0 0 34px;
    width: 34px;
    height: 38px;
    min-height: 38px;
    font-size: 1.75rem;
    line-height: 1;
    transition:
      background-color 160ms ease,
      color 160ms ease,
      transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  .sidebar-brand .sidebar-toggle:active {
    transform: scale(0.9);
  }
  .sidebar-collapsed .sidebar-brand {
    padding-inline: 14px;
  }
  .sidebar-collapsed .sidebar-brand .cydak-brand {
    display: flex;
    width: 0;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateX(-14px) scale(0.94);
    pointer-events: none;
  }
}
.app-sidebar nav button,
.app-sidebar nav button > span:last-child,
.nav-icon,
.sidebar-footer,
.sidebar-action > span:last-child {
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    opacity 180ms ease,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    width 220ms cubic-bezier(0.22, 1, 0.36, 1),
    max-width 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.app-sidebar nav button > span:last-child {
  width: auto;
  max-width: 220px;
  opacity: 1;
  transform: translateX(0);
}
.app-sidebar nav button:hover .nav-icon {
  transform: translateX(2px) scale(1.06);
}
.app-sidebar nav button[aria-current='page'] .nav-icon {
  transform: scale(1.08);
}

/* Entrada do conteúdo após a troca de módulo. */
#content.module-loading {
  opacity: 0.68;
}
#content.module-enter {
  animation: module-content-enter 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes module-content-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .shell,
  .sidebar-brand .cydak-brand,
  .sidebar-brand .sidebar-toggle,
  .app-sidebar nav button,
  .app-sidebar nav button > span:last-child,
  .nav-icon,
  .sidebar-footer,
  .sidebar-action > span:last-child {
    transition: none !important;
  }
  #content.module-enter {
    animation: none;
  }
}

/* Acabamento final do cabeçalho: somente a marca, sem placa ou divisor visual. */
.sidebar-brand {
  position: relative;
  background: transparent;
  border-bottom: 0;
  display: block;
  width: 100%;
  min-height: 0;
  padding: 0;
  gap: 0;
  overflow: hidden;
}
.sidebar-brand .cydak-brand,
.sidebar-brand .cydak-brand__logo,
.sidebar-brand .cydak-brand__logo img {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  margin: 0;
  padding: 0;
}
@media (min-width: 851px) {
  .sidebar-brand {
    min-height: 0;
    padding: 0;
  }
  .sidebar-brand .sidebar-toggle {
    position: absolute;
    top: 50%;
    right: 0;
    z-index: 1;
    margin: 0;
    transform: translateY(-50%);
  }
  .sidebar-collapsed .sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    padding: 0;
  }
  .sidebar-collapsed .sidebar-brand .sidebar-toggle {
    position: static;
    margin: auto;
    transform: none;
  }
}
@media (max-width: 850px) {
  .sidebar-brand {
    padding: 0;
    gap: 0;
  }
}

/* Ferramentas reservadas e demais indisponíveis permanecem legíveis no tema escuro. */
:root[data-theme='dark'] #loanPicker .choice-unavailable {
  background: #203854;
  color: #f4f8fd;
  border: 1px solid #6f8eaf;
}
:root[data-theme='dark'] #loanPicker .choice-unavailable .badge {
  color: #102a47;
  background: #ffd58b;
  border: 1px solid #f4a220;
}
:root[data-theme='dark'] #loanPicker .choice-unavailable .badge.reserved {
  color: #102a47;
  background: #9fd8ff;
  border-color: #62b9f4;
}
:root[data-theme='dark'] #loanPicker .choice-unavailable input:disabled {
  opacity: 0.9;
}

/* Login sempre contido na janela, com densidade adaptada à altura disponível. */
body.login-open {
  height: 100dvh;
  overflow: hidden;
}
.login-open #root,
.login-screen {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.login-screen .login {
  min-height: 0;
  padding: clamp(18px, 5dvh, 64px) clamp(20px, 6vw, 76px);
}
.login-screen .login-brand {
  margin-bottom: clamp(12px, 4dvh, 42px);
}
.login-screen .login h1 {
  font-size: clamp(1.65rem, min(4vw, 5dvh), 3rem);
  margin-block: clamp(4px, 1dvh, 10px);
}
.login-screen .login > p {
  margin-bottom: clamp(10px, 2.5dvh, 26px);
}
.login-screen .login form {
  gap: clamp(9px, 2dvh, 18px);
}
.login-visual {
  min-height: 0;
}
.password-field {
  position: relative;
  display: block;
}
.login-field {
  display: grid;
  gap: 7px;
}
.login-submit {
  order: 10;
}
.password-field input {
  padding-right: 52px;
}
.password-field #toggleLoginPassword {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 7px;
  background: transparent !important;
  color: var(--brand) !important;
  cursor: pointer;
}
.password-field #toggleLoginPassword:hover {
  background: #00469312 !important;
}
.password-field #toggleLoginPassword:focus-visible {
  outline: 3px solid #00a8d766;
  outline-offset: 0;
}
.password-eye {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.password-eye-hide,
.password-field #toggleLoginPassword[aria-pressed='true'] .password-eye-show {
  display: none;
}
.password-field #toggleLoginPassword[aria-pressed='true'] .password-eye-hide {
  display: block;
}
:root[data-theme='dark'] .password-field #toggleLoginPassword {
  color: #9fd8ff !important;
}
:root[data-theme='dark'] .password-field #toggleLoginPassword:hover {
  background: #ffffff12 !important;
}
@media (max-height: 620px) {
  .login-brand {
    width: min(52dvh, 100%);
  }
  .login-screen .login-brand {
    margin-bottom: 8px;
  }
  .login-screen .login > .eyebrow,
  .login-screen .login > p {
    display: none;
  }
  .login-screen .login form {
    gap: 7px;
  }
  .login-screen .login form button {
    min-height: 42px;
  }
}

/* Logo configurável, aplicado sem criar margens laterais no cabeçalho. */
.brand-logo--custom {
  display: block !important;
  width: var(--custom-logo-width, 100%) !important;
  max-width: none !important;
  height: var(--custom-logo-height, 132px) !important;
  margin: 0 auto !important;
  object-fit: var(--custom-logo-fit, contain) !important;
  object-position: var(--custom-logo-position, 50% 50%) !important;
}
.sidebar-brand:has(.brand-logo--custom) .cydak-brand,
.sidebar-brand:has(.brand-logo--custom) .cydak-brand__logo {
  position: absolute;
  top: var(--custom-logo-top, 0%);
  left: var(--custom-logo-left, 0%);
  width: var(--custom-logo-width, 100%);
  height: var(--custom-logo-height, 132px);
  transform: translate(
    calc(0% - var(--custom-logo-left, 0%)),
    calc(0% - var(--custom-logo-top, 0%))
  );
}
.sidebar-brand:has(.brand-logo--custom) {
  height: 180px;
}
.sidebar-brand:has(.brand-logo--custom) .brand-logo--custom {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
}
.login-brand .brand-logo--custom {
  max-height: min(var(--custom-logo-height, 132px), 24dvh);
}

.menu-order-list {
  display: grid;
  gap: 8px;
  max-width: 720px;
  padding: 0;
  list-style: none;
}
.menu-order-list li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface, #fff);
}
.menu-order-actions {
  display: flex;
  gap: 5px;
}
.menu-order-actions button {
  width: 40px;
  min-height: 36px;
  padding: 0;
}
.logo-editor-stage {
  position: relative;
  width: min(100%, 720px);
  height: 260px;
  overflow: hidden;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #004693;
  touch-action: none;
  user-select: none;
}
.logo-editor-object {
  position: absolute;
  min-width: 10%;
  min-height: 40px;
  cursor: grab;
  touch-action: none;
  outline: 2px solid #f4a220;
  outline-offset: 2px;
}
.logo-editor-object:active {
  cursor: grabbing;
}
.logo-editor-object img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.logo-resize-handle {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 22px;
  height: 22px;
  border: 2px solid #fff;
  border-radius: 4px 0 0;
  background: #f4a220;
  cursor: nwse-resize;
}
@media (max-width: 850px) {
  .logo-editor-stage {
    height: 220px;
  }
}

/* Cabeçalho definitivo do menu: logo proporcional e botão sem sobreposição. */
.shell:not(.sidebar-collapsed) .sidebar-brand {
  display: grid;
  grid-template-columns: minmax(0, 205px) 36px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 112px;
  padding: 10px 10px 10px 14px;
  overflow: visible;
}
.shell:not(.sidebar-collapsed) .sidebar-brand .cydak-brand,
.shell:not(.sidebar-collapsed) .sidebar-brand .cydak-brand__logo {
  position: static;
  display: block;
  width: 100%;
  max-width: 205px;
  height: auto;
  margin: 0;
  padding: 0;
  aspect-ratio: 1894 / 830;
  overflow: visible;
  transform: none;
}
.shell:not(.sidebar-collapsed) .sidebar-brand .cydak-brand__logo img {
  position: static;
  display: block;
  width: 100%;
  max-width: 205px;
  height: auto;
  margin: 0;
  object-fit: contain;
  object-position: center;
}
.shell:not(.sidebar-collapsed) .sidebar-brand .sidebar-toggle {
  position: static;
  align-self: center;
  width: 36px;
  min-width: 36px;
  height: 40px;
  margin: 0;
  transform: none;
}
@media (max-width: 850px) {
  .shell:not(.sidebar-collapsed) .sidebar-brand {
    grid-template-columns: minmax(0, 180px) 36px;
    min-height: 92px;
    padding: 8px 10px 8px 12px;
  }
  .shell:not(.sidebar-collapsed) .sidebar-brand .cydak-brand,
  .shell:not(.sidebar-collapsed) .sidebar-brand .cydak-brand__logo,
  .shell:not(.sidebar-collapsed) .sidebar-brand .cydak-brand__logo img {
    max-width: 180px;
  }
}

/* Camada responsiva final: mantém ações e dados operacionais utilizáveis em telas pequenas. */
@media (max-width: 850px) {
  .shell,
  .shell.sidebar-collapsed {
    display: block;
  }
  .app-sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
    max-height: none;
  }
  .app-sidebar nav,
  .sidebar-collapsed .app-sidebar nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 7px 10px 10px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }
  .app-sidebar nav button,
  .sidebar-collapsed .app-sidebar nav button {
    flex: 0 0 auto;
    width: auto;
    min-width: 120px;
    min-height: 44px;
    scroll-snap-align: start;
  }
  .sidebar-collapsed .app-sidebar nav button > span:last-child {
    display: inline;
  }
  .sidebar-footer,
  .nav-section {
    display: none;
  }
  .content,
  main.content {
    min-width: 0;
    padding: 14px;
  }
  .table {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }
  .table table {
    min-width: 720px;
  }
  .table th,
  .table td {
    padding: 10px;
    white-space: normal;
  }
  .toolbar {
    align-items: stretch;
    gap: 8px;
  }
  .toolbar > input,
  .toolbar > select,
  .toolbar > button {
    min-height: 44px;
  }
  dialog {
    width: min(96vw, 760px);
    max-width: 96vw;
    max-height: 92dvh;
    margin: auto;
    padding: 16px;
    overflow: auto;
  }
  dialog footer {
    position: sticky;
    bottom: -16px;
    z-index: 2;
    margin: 16px -16px -16px;
    padding: 12px 16px;
    background: var(--surface, #fff);
    border-top: 1px solid var(--line);
  }
  button,
  input,
  select,
  textarea {
    min-height: 44px;
  }
  input[type='checkbox'],
  input[type='radio'] {
    min-height: auto;
  }
}

@media (max-width: 520px) {
  .formgrid,
  .filters,
  .return-filters {
    grid-template-columns: minmax(0, 1fr);
  }
  .toolbar,
  .executive-heading,
  .pending-center-heading {
    flex-direction: column;
  }
  .toolbar > button,
  .toolbar > label,
  .action-button,
  dialog footer button {
    width: 100%;
  }
  dialog footer {
    display: grid;
    grid-template-columns: 1fr;
  }
  .notification-item,
  .user-action-card {
    overflow-wrap: anywhere;
  }
  .table table {
    min-width: 640px;
  }
}

/* Pendências agrupadas por urgência, preservando as ações existentes. */
.pending-groups {
  display: grid;
  gap: 22px;
  margin-top: 20px;
}
.pending-group {
  display: grid;
  gap: 10px;
}
.pending-group-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.pending-group-heading h3 {
  margin: 0;
  color: var(--brand);
  font-size: 0.95rem;
}
.pending-group-heading span {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding-inline: 6px;
  border-radius: 12px;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 9%, transparent);
  font-size: 0.72rem;
  font-weight: 700;
}
.pending-group .user-action-list {
  margin-top: 0;
}
.action-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.urgency-label {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
}
.user-action-card.urgency-overdue {
  border-left-color: #c7352b;
  background: color-mix(in srgb, #c7352b 4%, #fff);
}
.urgency-overdue .urgency-label {
  border-color: #c7352b40;
  color: #9f2d25;
  background: #fff1f0;
}
.user-action-card.urgency-today {
  border-left-color: var(--accent);
}
.urgency-today .urgency-label {
  border-color: #f4a22055;
  color: #765000;
  background: #fff6e5;
}
.user-action-card.urgency-upcoming {
  border-left-color: var(--brand);
}
.urgency-upcoming .urgency-label {
  border-color: #00469333;
  color: var(--brand);
  background: #edf4fb;
}
.user-action-card.urgency-no-deadline {
  border-left-color: #8492a4;
}
:root[data-theme='dark'] .urgency-label,
:root[data-theme='dark'] .user-action-card.urgency-overdue,
:root[data-theme='dark'] .urgency-overdue .urgency-label,
:root[data-theme='dark'] .urgency-today .urgency-label,
:root[data-theme='dark'] .urgency-upcoming .urgency-label {
  color: var(--text, #edf4fb);
  background: #172b43;
}

/* Camada final de contraste: mantém estados e seletores legíveis no tema escuro. */
:root[data-theme='dark'] input::placeholder,
:root[data-theme='dark'] textarea::placeholder {
  color: #aebdd0;
  opacity: 1;
}
:root[data-theme='dark'] .selection-summary {
  color: #ffd58b;
  background: #3b2d18;
  border-color: #a97822;
}
:root[data-theme='dark'] .tool-picker .check {
  color: #eef4fc;
  border-color: #34465d;
}
:root[data-theme='dark'] .tool-picker .check:has(input:checked) {
  color: #eef4fc;
  background: #203854;
  box-shadow: inset 3px 0 #f4a220;
}
:root[data-theme='dark'] .tool-picker .check strong,
:root[data-theme='dark'] .tool-picker .check small {
  color: inherit;
}
:root[data-theme='dark'] .tool-thumbnail {
  border-color: #58799d;
}
:root[data-theme='dark'] .thumbnail-empty {
  color: #dce7f5;
  background: #203854;
  border: 1px solid #58799d;
}
:root[data-theme='dark'] .empty::before {
  color: #91c4ff;
  background: #182a40;
  border-color: #58799d;
}
:root[data-theme='dark'] button.danger {
  color: #ffb4ae !important;
  background: transparent !important;
  border-color: #ff8e87 !important;
}
:root[data-theme='dark'] button.danger:hover:not(:disabled) {
  color: #fff !important;
  background: #8f2e2a !important;
  border-color: #ffb4ae !important;
}
:root[data-theme='dark'] .modal-cancel,
:root[data-theme='dark'] dialog footer button:first-child,
:root[data-theme='dark'] .button-outline {
  color: #9fd8ff !important;
  background: #142235 !important;
  border-color: #7ab8ff !important;
}
:root[data-theme='dark'] .modal-cancel:hover:not(:disabled),
:root[data-theme='dark'] dialog footer button:first-child:hover:not(:disabled),
:root[data-theme='dark'] .button-outline:hover:not(:disabled) {
  color: #102a47 !important;
  background: #f4a220 !important;
  border-color: #f4a220 !important;
}
:root[data-theme='dark'] button:not(.app-sidebar button):active:not(:disabled),
:root[data-theme='dark'] button:not(.app-sidebar button).active,
:root[data-theme='dark'] button:not(.app-sidebar button)[aria-pressed='true'],
:root[data-theme='dark'] button:not(.app-sidebar button)[aria-current='true'],
:root[data-theme='dark'] .development-section-nav button.active {
  color: #9fd8ff !important;
  background: #203854 !important;
  border-color: #7ab8ff !important;
}
:root[data-theme='dark'] button:not(.app-sidebar button):disabled {
  color: #dce7f5 !important;
  background: #29415e !important;
  border-color: #58799d !important;
}
:root[data-theme='dark'] #loanCases .check:has(input:checked) {
  color: #eef4fc;
  background: #203854;
  border-color: #f4a220;
}
@media (max-width: 680px) {
  .pending-groups {
    gap: 18px;
  }
  .action-title {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Central de ajuda: leitura progressiva, índice e pesquisa em qualquer tamanho de tela. */
.help-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.75fr);
  align-items: center;
  gap: 28px;
  background: linear-gradient(135deg, #fff 35%, #edf4fb);
  border-top: 4px solid var(--accent);
}
.help-hero h2 {
  margin: 4px 0 8px;
  font-size: clamp(1.35rem, 3vw, 2rem);
}
.help-hero p {
  margin: 0;
  color: var(--muted);
}
.help-search {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface, #fff);
}
.help-index h2 {
  margin-top: 0;
  font-size: 1.05rem;
}
.help-index > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}
.help-index a {
  padding: 9px 11px;
  border-radius: 7px;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 7%, transparent);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}
.help-index a:hover,
.help-index a:focus-visible {
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  text-decoration: underline;
}
.help-result {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.help-topics {
  display: grid;
  gap: 12px;
}
.help-topic {
  overflow: clip;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  scroll-margin-top: 110px;
}
.help-topic summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  cursor: pointer;
  list-style: none;
}
.help-topic summary::-webkit-details-marker {
  display: none;
}
.help-topic summary::after {
  content: '+';
  grid-column: 3;
  color: var(--brand);
  font-size: 1.4rem;
  font-weight: 500;
}
.help-topic[open] summary::after {
  content: '−';
}
.help-topic summary > span:nth-child(2) {
  display: grid;
  gap: 2px;
}
.help-topic summary small {
  color: var(--muted);
  font-weight: 400;
}
.help-topic-number {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-size: 0.72rem;
  font-weight: 700;
}
.help-topic-body {
  padding: 4px 22px 22px 70px;
  border-top: 1px solid var(--line);
}
.help-topic-body ol {
  margin: 18px 0;
  padding-left: 24px;
}
.help-topic-body ol li {
  margin-bottom: 10px;
  padding-left: 5px;
}
.help-topic-body ol li::marker {
  color: var(--brand);
  font-weight: 700;
}
.help-tip {
  padding: 13px 16px;
  border-left: 4px solid var(--accent);
  border-radius: 7px;
  color: #5e430e;
  background: #fff6e5;
}
.help-tip ul {
  margin: 6px 0 0;
  padding-left: 20px;
}
.help-topic[hidden] {
  display: none;
}
:root[data-theme='dark'] .help-hero {
  background: linear-gradient(135deg, #142235 35%, #182f4a);
}
:root[data-theme='dark'] .help-search,
:root[data-theme='dark'] .help-topic {
  color: #eef4fc;
  background: #142235;
  border-color: #34465d;
}
:root[data-theme='dark'] .help-index a {
  color: #9fd8ff;
  background: #203854;
}
:root[data-theme='dark'] .help-topic summary::after,
:root[data-theme='dark'] .help-topic-body ol li::marker {
  color: #9fd8ff;
}
:root[data-theme='dark'] .help-tip {
  color: #ffd58b;
  background: #3b2d18;
}
@media (max-width: 760px) {
  .help-hero {
    grid-template-columns: 1fr;
  }
  .help-topic-body {
    padding: 4px 16px 18px;
  }
}
@media print {
  .help-search,
  .help-index,
  .help-result {
    display: none;
  }
  .help-topic {
    break-inside: avoid;
  }
  .help-topic > .help-topic-body {
    display: block;
  }
}
