:root {
  color-scheme: light;
  font-family: "Segoe UI", Arial, sans-serif;
  color: #173345;
  background: #eef4f7;
  --blue: #2476a8;
  --blue-dark: #185b86;
  --border: #bfd1dc;
  --success: #24734f;
  --warning: #9b5d16;
  --error: #9a3d30;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: linear-gradient(180deg, #f8fbfc, #eaf2f6); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; }

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 104px;
  padding: 16px clamp(18px, 4vw, 56px);
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.topbar img { width: 72px; height: 72px; object-fit: contain; }
.topbar h1 { margin: 2px 0 0; font-size: clamp(1.35rem, 3vw, 2rem); }
.topbar-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

main { width: min(1120px, calc(100% - 32px)); margin: 36px auto 84px; }
.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 14px 36px rgba(30, 67, 88, .10);
  padding: clamp(22px, 4vw, 40px);
}
.login-panel { width: min(520px, 100%); margin: 8vh auto 0; }
.login-panel h2 { margin-top: 0; }
label { display: grid; gap: 7px; margin-top: 18px; font-weight: 700; }
input, select, textarea {
  width: 100%;
  border: 1px solid #9eb7c5;
  border-radius: 9px;
  padding: 11px 12px;
  color: #173345;
  background: #fff;
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid rgba(36, 118, 168, .25); outline-offset: 2px; }
.password-control { display: grid; grid-template-columns: 1fr 48px; align-items: stretch; }
.password-control input { border-radius: 9px 0 0 9px; }
.password-toggle { border: 1px solid #9eb7c5; border-left: 0; border-radius: 0 9px 9px 0; background: #f2f7f9; }
.password-toggle:hover { background: #e2eef4; }

button { min-height: 42px; border-radius: 9px; padding: 9px 15px; font-weight: 750; }
.primary { border: 1px solid var(--blue); color: #fff; background: var(--blue); }
.primary:hover { background: var(--blue-dark); }
.secondary { border: 1px solid #7198ae; color: #173345; background: #e7f1f6; }
.secondary:hover { background: #d9eaf2; }
.quiet { border: 1px solid #b7c8d1; color: #24495f; background: #f5f8fa; }
.quiet:hover { background: #e8f0f4; }
.danger-soft { border: 1px solid #d2a88b; color: #713a24; background: #fbe8d8; }
.danger-soft:hover { background: #f6dcc6; }
.danger { border: 1px solid #8f3f32; color: #fff; background: #a84b3d; }
.danger:hover { color: #fff; background: #8f3f32; }
.security-button { border: 1px solid #bb8f3d; color: #513b12; background: #f8e7b9; }
.security-button:hover { color: #382707; background: #efd58d; }
.login-panel .primary { width: 100%; margin-top: 8px; }
.text-link { display: block; margin-top: 17px; color: #185b86; font-weight: 700; text-align: center; }
.text-link:hover { color: #103f5c; }

.status { min-height: 24px; margin: 18px 0; color: #31586d; }
.status.is-error { color: var(--error); font-weight: 700; }
.status.is-success { color: var(--success); font-weight: 700; }
.eyebrow { margin: 0; color: #527487; font-size: .78rem; font-weight: 800; letter-spacing: .08em; }

.review-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); gap: 30px; align-items: end; }
.review-heading h2 { margin: 5px 0 0; font-size: clamp(1.8rem, 4vw, 3rem); color: #103f5c; }
.practice-subtitle { margin: 7px 0 0; font-size: 1.1rem; }
.practice-picker { margin: 0; }

.document-card { margin-top: 24px; border: 1px solid var(--border); border-radius: 13px; padding: 24px; background: #fbfdfe; }
.document-card-head { display: flex; gap: 18px; justify-content: space-between; align-items: start; }
.document-card h3 { margin: 4px 0 0; overflow-wrap: anywhere; }
.badge { border-radius: 999px; padding: 7px 12px; font-weight: 800; font-size: .78rem; white-space: nowrap; background: #e4edf2; }
.badge.pending_review { color: #6f430b; background: #fff0cc; }
.badge.approved { color: #14583b; background: #dcefe5; }
.badge.rejected { color: #7f3025; background: #f9e0db; }
dl { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; margin: 24px 0; border-top: 1px solid #d8e4ea; }
dt, dd { margin: 0; padding: 11px 0; border-bottom: 1px solid #d8e4ea; overflow-wrap: anywhere; }
dt { font-weight: 800; }
.document-actions, .decision-actions, .dialog-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.decision-panel { margin-top: 24px; padding-top: 22px; border-top: 1px solid #d8e4ea; }
.decision-panel textarea { resize: vertical; min-height: 105px; }
.decision-actions { margin-top: 16px; }

.security-panel { display: grid; gap: 22px; }
.security-heading { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.security-heading h2 { margin: 5px 0 0; font-size: clamp(1.7rem, 4vw, 2.7rem); color: #103f5c; }
.security-card { border: 1px solid var(--border); border-radius: 13px; padding: 22px; background: #fbfdfe; }
.security-card h3 { margin: 5px 0 10px; }
.security-card-heading { display: flex; justify-content: space-between; gap: 18px; align-items: start; }
.monitoring-card { border-color: #9fc3d8; background: #f7fbfd; }
.monitoring-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.monitoring-timestamp, .monitoring-detail { margin: 6px 0 0; color: #48697b; }
.monitoring-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 12px; margin-top: 20px; }
.monitoring-grid > div { min-height: 94px; display: grid; align-content: space-between; gap: 10px; padding: 14px; border: 1px solid #cadce6; border-radius: 10px; background: #fff; }
.monitoring-grid span { color: #48697b; font-size: .86rem; font-weight: 700; }
.monitoring-grid strong { color: #103f5c; font-size: 1.8rem; font-variant-numeric: tabular-nums; }
.activity-filter { width: min(420px, 100%); }
.activity-filter label { margin-top: 0; }
.activity-list article { border-left: 4px solid #9fc3d8; }
.activity-list article.security { border-left-color: #c48a35; }
.activity-list article.concessionario { border-left-color: #4b91b8; }
.portal-control-card { border-color: #d7b985; background: #fffaf0; }
.mfa-box { display: grid; grid-template-columns: minmax(180px, 240px) 1fr; gap: 24px; align-items: center; margin-top: 18px; }
.mfa-box img { display: block; width: 100%; max-width: 240px; aspect-ratio: 1; border: 1px solid var(--border); background: #fff; }
.mfa-secret { display: block; margin-top: 10px; padding: 10px; background: #eef4f7; border-radius: 8px; overflow-wrap: anywhere; user-select: all; }
.mfa-challenge { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 12px; align-items: end; margin-top: 18px; }
.mfa-challenge label { grid-column: 1 / -1; margin-top: 0; }
.mfa-challenge input { letter-spacing: .2em; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
#securityControls { display: grid; gap: 22px; }
.inline-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.ute-state { margin-bottom: 6px; }
.confirmation-help { min-height: 28px; margin: 16px 0 0; }
.confirmation-help code, .portal-control-card code { padding: 3px 6px; background: #edf2f5; border-radius: 5px; overflow-wrap: anywhere; }
#portalCloseButton, #uteExecuteButton { margin-top: 16px; }
.audit-list { display: grid; gap: 10px; margin-top: 16px; }
.audit-list article { padding: 13px 15px; border: 1px solid #d6e2e8; border-radius: 9px; background: #fff; }
.audit-list p { margin: 6px 0; }
.audit-list code { display: block; color: #48697b; font-size: .78rem; overflow-wrap: anywhere; }

dialog { width: min(520px, calc(100% - 32px)); border: 1px solid var(--border); border-radius: 14px; padding: 26px; color: #173345; }
dialog::backdrop { background: rgba(18, 41, 55, .45); }
dialog h2 { margin-top: 0; }

footer { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 18px; text-align: center; color: #466779; background: rgba(255,255,255,.96); border-top: 1px solid var(--border); }
.product-footer-line { display: block; line-height: 1.4; }
.product-footer-title { color: #173345; }
.release-version { color: #607786; font-size: .9em; }

@media (max-width: 760px) {
  .topbar { align-items: flex-start; flex-wrap: wrap; }
  .topbar-actions { margin-left: 0; width: 100%; }
  .topbar-actions button { flex: 1 1 220px; }
  .review-heading { grid-template-columns: 1fr; }
  dl { grid-template-columns: 1fr; }
  dt { padding-bottom: 2px; border-bottom: 0; }
  dd { padding-top: 2px; }
  .document-card-head { display: grid; }
  .document-actions button, .decision-actions button { width: 100%; }
  .security-heading, .security-card-heading { display: grid; }
  .monitoring-actions { justify-content: stretch; }
  .monitoring-actions > * { width: 100%; text-align: center; }
  .mfa-box, .mfa-challenge, .inline-action { grid-template-columns: 1fr; }
  .mfa-challenge label { grid-column: auto; }
  .security-card button { width: 100%; }
}
