/* Migrado de command-center.css; regras modulares abaixo mantêm autoridade final. */
body.command-center.modal-aberto {
  overflow: hidden;
}

body.command-center #modal {
  z-index: 70;
  padding: 16px;
}

body.command-center .image-modal-box {
  position: relative;
  display: grid;
  max-width: 96vw;
  max-height: 94vh;
  place-items: center;
}

body.command-center #modal .image-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 44px;
  min-width: 44px;
  padding: 0;
  border-color: rgba(255, 255, 255, .7) !important;
  background: rgba(3, 31, 58, .9) !important;
  color: #fff !important;
  font-size: 25px;
}

body.command-center #modal .image-modal-box img {
  max-width: 96vw;
  max-height: 92vh;
  border-radius: 8px;
}

body.command-center [aria-busy="true"] {
  cursor: progress !important;
}

body.command-center .md-back {
  z-index: 80;
  background: rgba(3, 31, 58, .72);
  backdrop-filter: blur(3px);
}

body.command-center .md-box {
  border: 1px solid #9bacba;
  border-top: 4px solid var(--gold);
  border-radius: 6px;
  box-shadow: 0 24px 70px rgba(3, 31, 58, .32);
}

/* Diálogos institucionais: substituem prompt/confirm nativos e preservam o contexto da aplicação. */
body.command-center .app-dialog-box {
  width: min(540px, 100%);
  max-width: 540px;
  padding: 0;
  overflow: hidden;
  animation: app-dialog-in .18s ease-out both;
}

body.command-center .app-dialog-cab {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px 17px;
  border-bottom: 1px solid var(--cc-line);
  background: linear-gradient(115deg, #f9fafb, #eef3f6);
}

body.command-center .app-dialog-cab span {
  display: block;
  margin-bottom: 5px;
  color: #657682;
  font-family: var(--cc-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

body.command-center .app-dialog-cab h2 {
  margin: 0;
  color: var(--navy);
  font-size: 22px;
  letter-spacing: .02em;
}

body.command-center .app-dialog-form {
  padding: 20px 22px 21px;
}

body.command-center .app-dialog-descricao {
  margin-bottom: 16px;
  color: #536572;
  font-size: 14px;
  line-height: 1.55;
}

body.command-center .app-dialog-campo {
  display: block;
}

body.command-center .app-dialog-campo > span {
  display: block;
  margin-bottom: 7px;
  color: var(--navy);
  font-family: var(--cc-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body.command-center .app-dialog-campo textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  border: 1px solid #aebbc5;
  border-radius: 4px;
  background: #fff;
  color: var(--txt);
  line-height: 1.5;
}

body.command-center .app-dialog-campo textarea:focus {
  border-color: var(--navy2);
  box-shadow: 0 0 0 3px rgba(12, 68, 124, .14);
  outline: 0;
}

body.command-center .app-dialog-acoes {
  justify-content: flex-end;
  margin-top: 20px;
}

body.command-center .app-dialog-acoes .ui-button {
  min-width: 132px;
}

@keyframes app-dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

html[data-frontend="modular"] body.command-center :is(.md-back, .drawer-operacional-backdrop, .portaria-veiculos-backdrop) {
  background: rgb(11 43 69 / 52%);
  backdrop-filter: blur(3px);
}

html[data-frontend="modular"] body.command-center .md-box {
  color: var(--g-color-ink);
  background: var(--g-color-surface);
  border: 1px solid var(--g-color-border);
  border-radius: var(--g-radius-lg);
  box-shadow: var(--g-shadow-overlay);
}

html[data-frontend="modular"] body.command-center :is(.drawer-operacional, .portaria-veiculos-drawer) {
  color: var(--g-color-ink);
  background: var(--g-color-surface);
  border-left: 1px solid var(--g-color-border);
  box-shadow: var(--g-shadow-overlay);
}

@media (max-width: 760px) {
  html[data-frontend="modular"] body.command-center .md-back {
    padding: 10px;
    align-items: flex-end;
  }

  html[data-frontend="modular"] body.command-center .md-box {
    max-height: calc(100dvh - 20px);
    border-radius: var(--g-radius-lg) var(--g-radius-lg) 0 0;
  }
}

/* Only automatic entry focus is quiet. Real pointer/keyboard interaction
   removes the marker, restoring each component's normal focus styles. */
html[data-frontend="modular"] body.command-center [data-entry-focus]:focus {
  outline: none !important;
  box-shadow: none !important;
}
html[data-frontend="modular"] body.command-center :is(input, select, textarea)[data-entry-focus]:focus {
  border-color: var(--g-color-border-strong) !important;
}
