@font-face {
  font-family: "Dekor Oswald";
  src: url("producao/assets/fonts/Oswald-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Dekor Oswald";
  src: url("producao/assets/fonts/Oswald-Medium.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Dekor Oswald";
  src: url("producao/assets/fonts/Oswald-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --brand-red: #be0000;
  --brand-black: #111111;
  --bg: #f7f7f7;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --line: #e5e5e5;
  --line-strong: #cfcfcf;
  --text: #171717;
  --muted: #696969;
  --red: #be0000;
  --red-soft: #f9e0e0;
  --green: #00a968;
  --blue: #3b82f6;
  --orange: #f97316;
  --purple: #8b5cf6;
  --gray-status: #7b7f86;
  --shadow: 0 20px 50px rgba(17, 17, 17, 0.12);
  --radius: 8px;
  --font-brand: "BentonSans Book", "Benton Sans", "Dekor Oswald", Arial, sans-serif;
  --font-brand-medium: "BentonSans Medium", "Benton Sans", "Dekor Oswald", Arial, sans-serif;
  font-family: var(--font-brand);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-brand);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.screen {
  min-height: 100vh;
}

.loading-screen {
  display: grid;
  place-items: center;
}

.loader {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.login-screen {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(380px, 1.1fr);
  background: var(--bg);
}

.login-hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 5vw, 64px);
  background:
    linear-gradient(135deg, rgba(190, 0, 0, 0.08), rgba(17, 17, 17, 0.05)),
    var(--surface);
  color: var(--text);
  border-right: 1px solid var(--line);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-brand-medium);
  font-weight: 700;
}

.brand-mark .logo-img {
  width: 38px;
  height: 38px;
}

.hero-copy h1 {
  margin: 0 0 18px;
  max-width: 640px;
  color: var(--brand-black);
  font-family: var(--font-brand-medium);
  font-size: clamp(46px, 6vw, 84px);
  line-height: 0.94;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 540px;
  margin: 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.45;
}

.hero-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-width: 620px;
}

.hero-strip span {
  min-height: 7px;
  border-radius: 999px;
  background: #d8d8d8;
}

.login-panel-wrap {
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-card {
  width: min(100%, 470px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 28px;
}

.panel-top,
.module-header,
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-top {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand-red);
  font-family: var(--font-brand-medium);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
strong {
  font-family: var(--font-brand-medium);
}

.login-card h2,
.module-header h1,
.modal h2 {
  margin: 0;
  letter-spacing: 0;
}

.login-card h2 {
  font-size: 30px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea,
.search-box input,
.mini-select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  outline: none;
}

.field input,
.field select,
.search-box input,
.mini-select {
  height: 42px;
  padding: 0 12px;
}

.field textarea {
  min-height: 90px;
  padding: 10px 12px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-box input:focus,
.mini-select:focus {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(190, 0, 0, 0.12);
}

.icon-button,
.primary-button,
.danger-button,
.ghost-button,
.soft-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0 14px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-brand-medium);
  font-weight: 700;
  text-decoration: none;
}

.icon-button {
  width: 40px;
  padding: 0;
}

.primary-button {
  background: var(--brand-red);
  border-color: var(--brand-red);
  color: #fff;
}

.primary-button:hover {
  background: #990000;
}

.danger-button {
  background: var(--red-soft);
  border-color: #fecaca;
  color: #991b1b;
}

.ghost-button:hover,
.soft-button:hover,
.icon-button:hover {
  background: var(--surface-2);
}

.soft-button {
  background: #fff;
}

.primary-button:disabled,
.danger-button:disabled,
.ghost-button:disabled,
.soft-button:disabled {
  opacity: 0.5;
}

.icon-button svg,
.module-icon svg,
.primary-button svg,
.danger-button svg,
.ghost-button svg,
.soft-button svg,
.search-box svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.login-actions {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.message {
  min-height: 20px;
  margin: 14px 0 0;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 700;
}

.message.success {
  color: var(--green);
}

.workspace {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  font-family: var(--font-brand-medium);
  font-weight: 700;
}

.side-brand .logo-img {
  width: 34px;
  height: 34px;
}

.user-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.user-box strong {
  display: block;
  margin-bottom: 3px;
}

.user-box span {
  color: var(--muted);
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.module-chip {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.module-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-chip.active {
  background: #fff5f5;
  border-color: #f1c7c7;
  color: var(--brand-red);
}

.module-chip.locked {
  color: #9ca3af;
}

.side-spacer {
  flex: 1;
}

.main {
  min-width: 0;
  padding: 28px;
}

.module-header {
  align-items: center;
  margin-bottom: 22px;
}

.module-header h1 {
  font-size: clamp(28px, 3vw, 42px);
}

.module-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.launcher-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 16px;
}

.module-card {
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
  box-shadow: 0 8px 30px rgba(17, 17, 17, 0.06);
  text-align: left;
}

.module-card:not(.locked):hover {
  border-color: var(--brand-red);
  transform: translateY(-1px);
}

.module-card.locked {
  opacity: 0.52;
}

.module-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  color: #fff;
}

.module-chip .module-icon {
  width: 34px;
  height: 34px;
  margin-bottom: 0;
}

.module-chip .module-icon svg {
  width: 18px;
  height: 18px;
}

.module-card h3 {
  margin: 0 0 8px;
  font-size: 21px;
  letter-spacing: 0;
}

.module-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.icon-home,
.icon-production {
  background: var(--brand-red);
}

.icon-quality {
  background: var(--brand-black);
}

.icon-score {
  background: #8b5e53;
}

.icon-materials {
  background: #7b7f86;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.search-box {
  position: relative;
  width: min(100%, 340px);
}

.search-box svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--muted);
}

.search-box input {
  padding-left: 38px;
}

.mini-select {
  width: 170px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.summary-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.material-table {
  width: 100%;
  min-width: 1060px;
  border-collapse: collapse;
  font-size: 13px;
}

.material-table th,
.material-table td {
  height: 38px;
  padding: 7px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.material-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  color: #3f3f46;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.material-table tr:hover td {
  background: #fffafa;
}

.material-table tr.selected td {
  background: #fff1f1;
}

.material-table td:last-child,
.material-table th:last-child {
  border-right: 0;
}

.group-row td {
  height: 44px;
  background: #fff;
  border-right: 0;
  color: var(--brand-red);
  font-size: 15px;
  font-weight: 700;
}

.group-row.chapas td {
  color: #8b5e53;
}

.group-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.group-name::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 24px;
  border-radius: 999px;
  background: currentColor;
}

.check-cell {
  width: 42px;
  text-align: center;
}

.row-check {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-red);
}

.element-cell {
  min-width: 250px;
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

.status-button,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 118px;
  height: 28px;
  border: 0;
  border-radius: 3px;
  padding: 0 9px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.status-button {
  width: 100%;
}

.status-button:disabled {
  opacity: 0.75;
}

.status-orange {
  background: #f97316;
}

.status-gray {
  background: var(--gray-status);
}

.status-red {
  background: var(--brand-red);
}

.status-blue {
  background: #3b82f6;
}

.status-purple {
  background: #8b5cf6;
}

.status-green {
  background: #00a968;
}

.status-menu {
  position: fixed;
  z-index: 20;
  display: none;
  width: 250px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.status-menu.open {
  display: grid;
  gap: 8px;
}

.status-menu button {
  justify-content: center;
  width: 100%;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--brand-red);
  font-size: 11px;
  font-weight: 700;
}

.empty-state {
  display: grid;
  justify-items: start;
  gap: 10px;
  max-width: 520px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 22px;
}

.empty-state h2,
.empty-state p {
  margin: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(17, 17, 17, 0.38);
}

.modal-backdrop.open {
  display: grid;
}

.modal {
  width: min(100%, 860px);
  max-height: min(92vh, 820px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.modal-body {
  padding: 20px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1120px) {
  .launcher-grid,
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .login-screen,
  .workspace {
    grid-template-columns: 1fr;
  }

  .login-hero {
    min-height: 380px;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-spacer {
    display: none;
  }

  .module-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .login-panel-wrap,
  .main {
    padding: 16px;
  }

  .login-card {
    padding: 20px;
  }

  .hero-strip,
  .launcher-grid,
  .summary-grid,
  .two-col,
  .nav-list {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .toolbar-left,
  .toolbar-right,
  .search-box,
  .mini-select,
  .primary-button,
  .ghost-button,
  .soft-button,
  .danger-button {
    width: 100%;
  }
}
