:root {
  --ink: #172d2b;
  --muted: #6d7e7a;
  --green: #0b6c59;
  --green-dark: #104c42;
  --line: #e2e8e3;
  --paper: #f5f7f3;
  --yellow: #e9c66a;
  --bs-primary: #0b6c59;
  --bs-body-color: var(--ink);
  --bs-body-font-family: Segoe UI, system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  font-size: 14px;
}
button,
input,
select,
textarea {
  font: inherit;
}
[hidden] {
  display: none !important;
}
a {
  color: var(--green);
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 34px;
  letter-spacing: -1.1px;
  font-weight: 650;
  line-height: 1.2;
}
h2 {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.4px;
}
h3 {
  font-size: 17px;
  font-weight: 650;
}
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.8px;
}
.brand {
  color: inherit;
  text-decoration: none;
  font-weight: 750;
  letter-spacing: -2px;
  font-size: 38px;
  line-height: 1;
}
.brand-dot {
  font-size: 11px;
  vertical-align: middle;
  margin-left: 4px;
  color: var(--yellow);
}
.workspace {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 248px;
  flex: 0 0 248px;
  background: #153f37;
  color: #d8e6de;
  padding: 32px 22px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.sidebar .brand {
  padding-left: 12px;
  color: #fff;
}
.sidebar-label {
  font-size: 10px;
  letter-spacing: 2.1px;
  color: #9eb8aa;
  margin: 12px 12px 36px;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.nav-item {
  border: 0;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  text-align: left;
  padding: 12px 13px;
  border-radius: 8px;
  font-weight: 550;
  transition: background 0.15s;
}
.nav-item:hover {
  background: #245347;
}
.nav-item.active {
  background: #d8e7b5;
  color: #183c2a;
}
.nav-item > span:first-child {
  font-size: 19px;
  width: 22px;
  line-height: 1;
}
.nav-section {
  margin: 34px 12px 13px;
  font-size: 9px;
}
.nav-count {
  font-size: 10px !important;
  border-radius: 4px;
  background: #193f2b15;
  padding: 2px 6px;
  margin-left: auto;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 56px;
}
.sidebar-bottom p {
  font-size: 11px;
  line-height: 1.7;
  color: #9cb4a7;
  margin: 12px;
}
.local-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 0 12px;
}
.local-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 100%;
  background: #b8d981;
}
.main-shell {
  flex: 1;
  min-width: 0;
}
.topbar {
  height: 85px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 42px;
  gap: 16px;
}
.breadcrumb {
  font-size: 12px;
  color: #84918b;
  margin: 0;
  gap: 16px;
  align-items: center;
}
.breadcrumb strong {
  font-weight: 550;
  color: #364b43;
}
.profile {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}
.profile strong {
  font-weight: 600;
}
.profile small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}
.mock-badge {
  color: #73765b;
  font-size: 9px;
  letter-spacing: 0.8px;
  border: 1px solid #e7e6d3;
  border-radius: 4px;
  padding: 5px 7px;
  margin-right: 8px;
  background: #faf9f0;
}
.avatar {
  background: #e6ecdf;
  color: #486344;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
}
main {
  padding: 36px 42px 40px;
  max-width: 1480px;
  margin: auto;
  min-height: calc(100vh - 144px);
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 27px;
  gap: 16px;
}
.page-heading p {
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 0;
}
.page-heading .eyebrow {
  display: block;
  margin-bottom: 12px;
  color: var(--green);
}
.btn {
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 11px 17px;
}
.btn-primary {
  background: var(--green);
  border-color: var(--green);
}
.btn-primary:hover,
.btn-primary:focus {
  background: var(--green-dark);
  border-color: var(--green-dark);
}
.btn-outline-secondary {
  border-color: #d3ded4;
  color: #42594e;
}
.btn-light {
  background: #f3f6ee;
  border: 1px solid var(--line);
}
.btn-danger {
  background: #a84237;
  border-color: #a84237;
}
.status-banner {
  background: #eef2e5;
  border: 1px solid #dce5ce;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 18px;
  color: #56624c;
  margin-bottom: 25px;
  font-size: 12px;
}
.status-banner > span:first-child {
  font-size: 20px;
}
.status-banner strong {
  font-weight: 650;
}
.status-banner small {
  display: block;
  margin-top: 3px;
  color: #78816c;
  font-size: 11px;
}
.status-banner a {
  margin-left: auto;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 26px;
}
.metric {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 20px 22px;
}
.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #6d7f73;
  font-size: 11px;
}
.metric-icon {
  background: #f1f5ed;
  border-radius: 5px;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  color: #637c5c;
  font-size: 16px;
}
.metric-value {
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -1px;
  margin: 11px 0 6px;
  line-height: 1;
}
.metric small {
  font-size: 10px;
  color: #8b978c;
}
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 22px;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  margin-bottom: 22px;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 22px 24px;
  border-bottom: 1px solid #edf0e9;
}
.panel-header h2 {
  font-size: 16px;
  margin: 0;
}
.panel-header p {
  font-size: 11px;
  color: var(--muted);
  margin: 5px 0 0;
}
.panel-header a,
.text-link {
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}
.panel-body {
  padding: 24px;
}
.table {
  font-size: 12px;
  margin: 0;
  --bs-table-bg: transparent;
  --bs-table-border-color: #edf0e9;
}
.table th {
  font-size: 9px;
  font-weight: 650;
  color: #8b968d;
  letter-spacing: 0.7px;
  padding: 14px 23px;
  background: #fafbf8;
  white-space: nowrap;
}
.table td {
  padding: 17px 23px;
  vertical-align: middle;
}
.incident-title {
  font-weight: 600;
  color: #293f36;
  display: block;
  text-decoration: none;
  font-size: 12px;
  background: none;
  padding: 0;
  border: 0;
  text-align: left;
}
.incident-title:hover {
  color: var(--green);
  text-decoration: underline;
}
.table .secondary {
  font-size: 10px;
  color: #8b988b;
  margin-top: 4px;
}
.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  font-size: 9px;
  padding: 5px 7px;
  font-weight: 600;
  white-space: nowrap;
  background: #edf1e9;
  color: #66765c;
}
.tag.yellow {
  background: #fcf3dc;
  color: #997d31;
}
.tag.red {
  background: #f9e9e5;
  color: #a35a49;
}
.tag.green {
  background: #eaf3e6;
  color: #5b7d47;
}
.tag.blue {
  background: #eaf0f3;
  color: #5b798b;
}
.activity-item {
  display: flex;
  gap: 13px;
  margin: 0 0 22px;
  font-size: 12px;
}
.activity-dot {
  flex: 0 0 26px;
  height: 26px;
  border-radius: 50%;
  background: #f0f4e9;
  color: #7f925c;
  display: grid;
  place-items: center;
}
.activity-item strong {
  font-weight: 600;
  font-size: 11px;
}
.activity-item p {
  color: #84907c;
  font-size: 11px;
  margin: 4px 0;
  line-height: 1.6;
}
.activity-item small {
  color: #9ba28f;
  font-size: 10px;
}
.guide-card {
  background: #eaf0df;
  border: 1px solid #dbe5cc;
  padding: 24px;
  border-radius: 9px;
  margin-bottom: 22px;
}
.guide-card .eyebrow {
  color: #7f8a55;
}
.guide-card h3 {
  font-size: 21px;
  margin-top: 12px;
}
.guide-card p {
  color: #778268;
  font-size: 12px;
  line-height: 1.8;
  margin: 10px 0 20px;
}
.guide-card .btn {
  background: #fff;
  color: #4a6541;
  border-color: #dce6cc;
}
.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.toolbar input {
  flex: 1;
  min-width: 170px;
}
.toolbar select {
  width: 180px;
}
.form-control,
.form-select {
  font-size: 12px;
  border-color: #dce4d8;
  border-radius: 6px;
  padding: 11px 13px;
  background-color: #fff;
}
.form-control:focus,
.form-select:focus {
  border-color: #92b293;
  box-shadow: 0 0 0 3px #92b29322;
}
.form-label {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 7px;
}
.form-hint {
  color: #7a8a79;
  font-size: 11px;
  margin: 6px 0 14px;
}
.form-check {
  margin-bottom: 12px;
}
textarea {
  resize: vertical;
}
footer {
  padding: 17px 42px;
  border-top: 1px solid var(--line);
  color: #8b9987;
  font-size: 10px;
  display: flex;
  justify-content: space-between;
}
.toast-message {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 13px 20px;
  border-radius: 7px;
  background: #173c31;
  color: #fff;
  z-index: 1000;
  box-shadow: 0 6px 20px #0002;
  max-width: 90vw;
}
.toast-message.error {
  background: #923c34;
}
.empty {
  padding: 38px 25px;
  text-align: center;
  color: #89987f;
  font-size: 13px;
}
.detail-top {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 16px;
}
.detail-description {
  font-size: 13px;
  color: #667c6c;
  white-space: pre-wrap;
  line-height: 1.8;
}
.chat-messages {
  min-height: 240px;
  max-height: 560px;
  overflow: auto;
  background: #f9faf6;
  padding: 23px;
}
.message {
  font-size: 12px;
  line-height: 1.8;
  white-space: pre-wrap;
  border: 1px solid #e5ecdc;
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  margin: 0 0 16px;
  max-width: 95%;
  overflow-wrap: anywhere;
}
.message.user {
  background: #eaf0df;
  margin-left: auto;
  max-width: 80%;
}
.message-label {
  font-size: 9px;
  font-weight: 700;
  color: #789069;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
.chat-form {
  padding: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 9px;
}
.chat-form textarea {
  min-height: 45px;
  max-height: 150px;
}
.approval-card {
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: 7px;
  margin-bottom: 14px;
}
.approval-card p {
  font-size: 12px;
  color: #718269;
  margin: 9px 0;
  white-space: pre-wrap;
}
.approval-card small {
  font-size: 10px;
  color: #8c9884;
}
.approval-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.timeline {
  border-left: 1px solid #d9e4cc;
  padding-left: 18px;
}
.timeline-item {
  margin-bottom: 23px;
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.timeline-item small {
  display: block;
  color: #88967d;
  font-size: 10px;
  margin-top: 5px;
}
dialog {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  width: min(540px, 92vw);
  max-height: 90vh;
  box-shadow: 0 25px 80px #0002;
}
dialog::backdrop {
  background: #122b2670;
  backdrop-filter: blur(2px);
}
.modal-head {
  padding: 21px 25px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-head h2 {
  margin: 0;
  font-size: 20px;
}
.icon-button {
  border: 0;
  background: none;
  color: #82907d;
  font-size: 25px;
}
.modal-body,
#modal-body {
  padding: 24px 25px;
}
.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}
.login-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 100vh;
}
.login-story {
  background: #153f37;
  color: #f3f7ec;
  padding: 48px 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 70px;
}
.login-story .eyebrow {
  color: #b7cc91;
}
.login-story h1 {
  font-size: 45px;
  line-height: 1.25;
  margin: 25px 0;
  max-width: 530px;
}
.login-story p {
  max-width: 390px;
  color: #b7cabb;
  line-height: 1.9;
  font-size: 14px;
}
.login-principles {
  display: flex;
  gap: 25px;
  font-size: 11px;
  color: #d8e6ba;
  margin-top: 45px;
}
.login-story small {
  font-size: 10px;
  color: #97b49f;
}
.login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 45px;
}
.login-form {
  width: 100%;
  max-width: 350px;
}
.login-form h2 {
  font-size: 32px;
  margin: 18px 0 14px;
}
.login-form > p {
  font-size: 13px;
  margin-bottom: 30px;
}
.login-note {
  font-size: 11px !important;
  color: #8d9888;
  line-height: 1.8;
  margin-top: 25px;
}
.data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 17px 0;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.data-row:last-child {
  border: 0;
}
.data-row small {
  display: block;
  font-size: 11px;
  color: #88987c;
  margin-top: 5px;
}
.policy-state {
  border-radius: 8px;
  padding: 22px;
  background: #f8f2e6;
  color: #8b704a;
  margin: 20px 0;
}
.safe-copy {
  font-size: 11px;
  color: #859277;
  line-height: 1.8;
}
.skeleton {
  color: #718468;
  padding: 50px;
  text-align: center;
}
@media (min-width: 1600px) {
  main {
    padding-top: 48px;
  }
}
@media (max-width: 1100px) {
  .sidebar {
    width: 210px;
    flex-basis: 210px;
    padding: 28px 14px;
  }
  .topbar {
    padding: 0 26px;
  }
  main {
    padding: 30px 26px;
  }
  .content-grid {
    grid-template-columns: 1fr;
  }
  .metrics {
    gap: 10px;
  }
  .metric {
    padding: 17px;
  }
  .profile .mock-badge {
    display: none;
  }
}
@media (max-width: 740px) {
  .workspace {
    display: block;
  }
  .sidebar {
    width: 100%;
    min-height: 0;
    padding: 20px;
  }
  .sidebar .brand {
    font-size: 31px;
    padding: 0;
  }
  .sidebar > .sidebar-label {
    display: none;
  }
  .sidebar nav {
    margin-top: 20px;
    display: flex;
    flex-direction: row;
    overflow: auto;
    gap: 8px;
  }
  .sidebar nav .admin-only {
    display: flex;
    gap: 8px;
  }
  .sidebar nav .nav-section {
    display: none;
  }
  .nav-item {
    width: auto;
    white-space: nowrap;
    font-size: 11px;
    padding: 9px 12px;
    gap: 7px;
  }
  .sidebar-bottom {
    padding: 0;
    margin: 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .sidebar-bottom p {
    display: none;
  }
  .local-indicator {
    padding: 0;
    font-size: 10px;
  }
  .topbar {
    height: 68px;
    padding: 0 20px;
  }
  .breadcrumb {
    font-size: 10px;
    gap: 8px;
  }
  .profile {
    gap: 7px;
  }
  .profile strong {
    font-size: 10px;
  }
  .profile small {
    font-size: 9px;
  }
  .avatar {
    width: 29px;
    height: 29px;
  }
  main {
    padding: 25px 18px;
  }
  .page-heading {
    align-items: flex-start;
  }
  h1 {
    font-size: 27px;
  }
  .page-heading p {
    font-size: 11px;
    max-width: 230px;
  }
  .page-heading .btn {
    padding: 10px;
    font-size: 10px;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .metric-value {
    font-size: 28px;
  }
  .metric-top {
    font-size: 10px;
  }
  .table td,
  .table th {
    padding: 14px 16px;
  }
  .panel-header {
    padding: 20px;
  }
  .panel-body {
    padding: 20px;
  }
  .content-grid {
    gap: 0;
  }
  footer {
    padding: 18px;
    gap: 20px;
    font-size: 9px;
  }
  .login-layout {
    display: block;
  }
  .login-story {
    padding: 30px;
    gap: 35px;
    min-height: 350px;
  }
  .login-story h1 {
    font-size: 30px;
    margin: 15px 0;
  }
  .login-story p,
  .login-principles,
  .login-story small {
    display: none;
  }
  .login-form-panel {
    padding: 40px 28px;
  }
  .login-form h2 {
    font-size: 28px;
  }
  .chat-form {
    padding: 12px;
  }
  .chat-form .btn {
    padding: 10px;
  }
  .chat-messages {
    padding: 16px;
  }
}
:where(.content-grid > div, .panel, .metrics > article) {
  min-width: 0;
}
.content-grid {
  max-width: 100%;
}
.panel .table-responsive {
  max-width: 100%;
}
h1,
h2,
h3 {
  overflow-wrap: anywhere;
}

.fixture-log {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f4f6ef;
  border-radius: 7px;
  padding: 16px;
  font-size: 11px;
}
.approval-card {
  overflow-wrap: anywhere;
}
.toolbar .btn {
  flex: 1;
  min-width: 140px;
}

.operational-metric {
  text-align: left;
  color: var(--ink);
  transition: border-color 0.15s;
}
.operational-metric:hover {
  border-color: var(--green);
}
/* Formulários operacionais: campos inteiros legíveis também em telas estreitas. */
#phase3-controls .form-label,
#phase3-knowledge .form-label,
#phase3-verify .form-label { display: block; width: 100%; }
