/*
 * hsports visual system
 * Camada única de componentes para manter a mesma linguagem em todos os módulos.
 * As regras de negócio continuam em app.js e os estilos específicos permanecem
 * em app.css; este arquivo padroniza somente apresentação e acessibilidade.
 */

:root {
  --brand-navy-950: #071a30;
  --brand-navy-900: #0d2949;
  --brand-navy-800: #123a63;
  --brand-navy-700: #1e527f;
  --brand-blue-600: #2f73b8;
  --brand-gold-500: #d9a62a;
  --brand-gold-300: #f0c65c;
  --brand-green-600: #257b59;
  --navy: #102d50;
  --navy-light: #1f527f;
  --gold: #d9a62a;
  --gold-pale: #fff7df;
  --background: #f3f6f9;
  --white: #ffffff;
  --text: #24364a;
  --muted: #65768a;
  --green: #257b59;
  --red: #bd4545;
  --border: #dce4eb;
  --blue-pale: #edf4fa;
  --surface-soft: #f7f9fb;
  --surface-raised: #ffffff;
  --focus-ring: rgba(47, 111, 177, 0.2);
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 11px;
  --radius-lg: 14px;
  --shadow-sm: 0 2px 8px rgba(13, 39, 72, 0.05);
  --shadow: 0 8px 24px rgba(13, 39, 72, 0.07);
  --shadow-lg: 0 18px 48px rgba(13, 39, 72, 0.14);
}

html,
body,
button,
input,
select,
textarea {
  font-family: "Segoe UI", Arial, sans-serif;
}

body {
  font-size: 10pt;
  line-height: 1.4;
  color: var(--text);
  background:
    radial-gradient(circle at 88% 6%, rgba(54, 118, 197, 0.06), transparent 22%),
    var(--background);
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

button:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
}

* {
  scrollbar-color: #aebdca transparent;
  scrollbar-width: thin;
}

/* Autenticação: a mesma identidade visual usada dentro dos módulos. */
.auth-gate {
  background:
    radial-gradient(circle at 88% 8%, rgba(47, 115, 184, 0.1), transparent 24%),
    linear-gradient(145deg, #edf3f8, #f8fafc 56%, #eef4f8);
}

.auth-brand-panel {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 18%, rgba(217, 166, 42, 0.28), transparent 29%),
    radial-gradient(circle at 15% 88%, rgba(47, 115, 184, 0.2), transparent 30%),
    linear-gradient(145deg, var(--brand-navy-950), var(--brand-navy-800));
  border-right-color: var(--brand-gold-500);
}

.auth-brand-panel::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -130px;
  width: 330px;
  height: 330px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 48px rgba(255, 255, 255, 0.025),
    0 0 0 96px rgba(255, 255, 255, 0.018);
  pointer-events: none;
}

.auth-brand-logos,
.auth-brand-copy {
  position: relative;
  z-index: 1;
}

.auth-brand-panel .auth-hsports-logo,
.auth-brand-panel .auth-jm-logo,
.auth-mobile-brand img {
  border: 1px solid rgba(240, 198, 92, 0.38);
  box-shadow: 0 20px 48px rgba(2, 15, 29, 0.32);
}

.auth-brand-panel span,
.auth-eyebrow {
  color: var(--brand-gold-300);
  font-size: 8pt;
  letter-spacing: 0.11em;
}

.auth-brand-panel strong {
  color: #fff;
  font-size: 23pt;
  line-height: 1.15;
}

.auth-brand-panel p {
  color: #d6e3ef;
  font-size: 10pt;
}

.auth-form-panel {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  background:
    radial-gradient(circle at 85% 12%, rgba(217, 166, 42, 0.12), transparent 28%),
    transparent;
}

.auth-form {
  position: relative;
  overflow: hidden;
  padding: 34px;
  border: 1px solid #d5e0e9;
  border-top: 4px solid var(--brand-gold-500);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 64px rgba(7, 26, 48, 0.15);
}

.auth-form,
.auth-form * {
  box-sizing: border-box;
}

.auth-form::before {
  content: "";
  position: absolute;
  top: -80px;
  right: -70px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(47, 115, 184, 0.045);
  pointer-events: none;
}

.auth-form h1 {
  position: relative;
  color: var(--brand-navy-900);
  font-size: 19pt;
  line-height: 1.18;
}

.auth-form > p {
  color: var(--muted);
  font-size: 9.5pt;
}

.auth-form label > span {
  color: #42586e;
  font-size: 8.5pt;
  letter-spacing: 0.015em;
}

.auth-form input {
  min-height: 48px;
  padding: 0 13px;
  color: var(--text);
  background: #fbfcfe;
  border: 1px solid #c7d4df;
  border-radius: var(--radius-sm);
  font-size: 10pt;
}

.auth-form input:hover {
  border-color: #9fb3c5;
  background: #fff;
}

.auth-form input:focus {
  border-color: var(--brand-blue-600);
  background: #fff;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.auth-primary-button {
  min-height: 48px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand-navy-800), var(--brand-blue-600));
  box-shadow: 0 8px 20px rgba(30, 82, 127, 0.2);
  font-size: 9.5pt;
  font-weight: 850;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.auth-primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 12px 24px rgba(30, 82, 127, 0.26);
}

.auth-form > small {
  min-height: 18px;
  color: var(--red);
  font-size: 8.5pt;
}

/* Estrutura principal */
.app-sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 252, 253, 0.98));
  border-right-color: #dfe6ec;
  box-shadow: 8px 0 28px rgba(13, 39, 72, 0.07);
}

.sidebar-brand {
  border-bottom-color: #e3e9ef;
}

.sidebar-nav-item {
  border-radius: var(--radius-md);
  transition: color 0.16s ease, background 0.16s ease,
    border-color 0.16s ease, transform 0.16s ease;
}

.sidebar-nav-item:hover:not(:disabled) {
  transform: translateX(2px);
}

.sidebar-nav-item > svg,
.sidebar-account button svg,
.context-navigation svg,
.module-icon svg,
.process-icon svg,
.file-icon svg,
.empty-icon svg,
.ui-action-icon,
#refresh-dollar-rate svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.module-icon,
.process-icon,
.file-icon,
.empty-icon,
.context-navigation button > svg,
.context-navigation button > b {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22),
    0 4px 10px rgba(13, 39, 72, 0.08);
}

.hero {
  background:
    radial-gradient(circle at 88% 28%, rgba(218, 168, 43, 0.18), transparent 24%),
    linear-gradient(118deg, #0b2340, #12375f 62%, #173e5a);
  border-bottom-width: 3px;
}

.hero-title {
  letter-spacing: 0;
}

.hero-subtitle {
  color: #d7e4ef;
}

.app-shell > main {
  padding: 18px 24px 20px;
  background:
    linear-gradient(rgba(244, 247, 250, 0.97), rgba(244, 247, 250, 0.98)),
    radial-gradient(circle at 8% 4%, rgba(217, 166, 42, 0.14), transparent 26%);
}

/* Navegação interna */
.context-navigation {
  min-height: 82px;
  padding: 10px 22px;
  background: rgba(247, 249, 252, 0.97);
  border-bottom-color: #dce4eb;
  box-shadow: 0 5px 16px rgba(13, 39, 72, 0.06);
}

.context-navigation button {
  --context-accent: #3676c5;
  --context-soft: #e9f2fc;
  min-height: 60px;
  border: 1px solid #dce4eb;
  border-radius: var(--radius-md);
  color: #42566a;
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.16s ease, box-shadow 0.16s ease,
    transform 0.16s ease, background 0.16s ease;
}

.context-navigation button:hover:not(:disabled),
.context-navigation button:focus-visible {
  border-color: color-mix(in srgb, var(--context-accent) 38%, #fff);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--context-accent) 13%, transparent);
  transform: translateY(-1px);
}

.context-navigation button > svg,
.context-navigation button > b {
  width: 36px;
  height: 36px;
  padding: 7px;
  display: grid;
  flex: 0 0 36px;
  place-items: center;
  color: var(--context-accent);
  background: var(--context-soft);
  border-radius: 10px;
}

.context-navigation button > b svg {
  width: 22px;
  height: 22px;
}

.context-navigation button strong {
  color: var(--navy);
  font-size: 9pt;
}

.context-navigation button small {
  color: var(--muted);
  font-size: 7.5pt;
}

.commercial-context-navigation button:nth-child(1),
.commercial-context-navigation button:nth-child(2) {
  --context-accent: #23875c;
  --context-soft: #e6f5ed;
}

.commercial-context-navigation button:nth-child(3) {
  --context-accent: #3676c5;
  --context-soft: #e8f1fc;
}

.commercial-context-navigation button:nth-child(n + 4) {
  --context-accent: #bc7b1d;
  --context-soft: #fff2dc;
}

.admin-context-navigation button:nth-child(1) {
  --context-accent: #7655a6;
  --context-soft: #f0eafb;
}

.admin-context-navigation button:nth-child(2) {
  --context-accent: #3676c5;
  --context-soft: #e8f1fc;
}

.admin-context-navigation button:nth-child(3) {
  --context-accent: #23875c;
  --context-soft: #e6f5ed;
}

.admin-context-navigation button:nth-child(4) {
  --context-accent: #c17d19;
  --context-soft: #fff1d9;
}

.admin-context-navigation button:nth-child(5) {
  --context-accent: #c34f62;
  --context-soft: #fde9ed;
}

.context-navigation button.active {
  color: #fff;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--context-accent) 82%, #0d2748),
    var(--context-accent)
  );
  border-color: var(--context-accent);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--context-accent) 25%, transparent);
}

.context-navigation button.active strong,
.context-navigation button.active small {
  color: #fff;
}

.context-navigation button.active > svg,
.context-navigation button.active > b,
.admin-navigation button.active > b {
  color: #fff;
  background: rgba(255, 255, 255, 0.17);
}

/* Títulos e painéis */
.workspace-heading,
.users-heading {
  min-height: 104px;
  padding: 20px 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 90% 10%, rgba(217, 166, 42, 0.25), transparent 30%),
    linear-gradient(120deg, var(--brand-navy-900), var(--brand-navy-700));
  box-shadow: var(--shadow);
}

.workspace-heading > div > span,
.users-heading > div > span,
.records-card header span,
.workspace-form header span,
.users-list-card header span,
.audit-card header span,
.file-copy > span,
.section-eyebrow,
.edit-eyebrow,
.modules-heading > div:first-child > span {
  color: #c78d1c;
  font-size: 7.5pt;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.workspace-heading h1,
.users-heading h1 {
  margin: 6px 0 5px;
  color: #fff;
  font-size: 20px;
  line-height: 1.18;
}

.workspace-heading p,
.users-heading p {
  margin: 0;
  max-width: 920px;
  color: #d8e4ef;
  font-size: 9pt;
  line-height: 1.45;
}

.records-card,
.workspace-form,
.users-list-card,
.user-form-card,
.audit-card,
.ops-list-panel,
.op-form-panel,
.repository-ops-panel,
.repository-files-panel,
.file-card,
.table-card,
.detail-card,
.summary-card,
.repository-permission-banner,
.repository-config-card,
.view-only-note {
  border-color: var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
}

.records-card > header,
.workspace-form > header,
.users-list-card > header,
.audit-card > header,
.ops-list-header,
.form-title,
.repository-panel-heading,
.repository-selected-heading {
  min-height: 62px;
  padding: 12px 15px;
  background:
    linear-gradient(90deg, rgba(217, 166, 42, 0.08), transparent 22%),
    linear-gradient(180deg, #fff, #f8fafc);
  border-bottom: 1px solid #e5ebf0;
  border-left: 3px solid var(--brand-gold-500);
}

.records-card header strong,
.workspace-form header strong,
.users-list-card header strong,
.audit-card header strong,
.ops-list-header strong,
.form-title strong,
.repository-panel-heading strong,
.repository-selected-heading strong {
  color: var(--navy);
  font-size: 11pt;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.workspace-panel,
.users-workspace,
.ops-workspace,
.repository-workspace {
  gap: 16px;
}

.workspace-panel,
.stock-workspace-panel {
  margin-top: 16px;
}

.modules-heading {
  min-height: 58px;
  padding: 14px 4px 9px;
}

.modules-heading > div:first-child strong {
  font-size: 12pt;
}

/* Cartões de módulo e indicadores */
.module-grid {
  gap: 14px;
}

.module-card {
  --module-accent: var(--brand-blue-600);
  border-radius: var(--radius-md);
  border-top: 3px solid var(--module-accent);
  box-shadow: var(--shadow-sm);
}

.module-card:hover:not(:disabled) {
  box-shadow: var(--shadow);
}

.module-card.planning { --module-accent: #2f73b8; }
.module-card.medal { --module-accent: #2389a8; }
.module-card.trophy { --module-accent: #c78d1c; }
.module-card.assembly { --module-accent: #2d8663; }
.module-card.shipping { --module-accent: #a55f3d; }
.module-card.repository { --module-accent: #6554a6; }
.module-card.administration { --module-accent: #7d4ca0; }

.module-card .module-icon {
  color: var(--module-accent);
  background: color-mix(in srgb, var(--module-accent) 11%, #fff);
}

.module-card.active .module-icon {
  color: #fff;
  background: color-mix(in srgb, var(--module-accent) 86%, var(--brand-navy-900));
}

.process-step b.process-icon {
  border: 1px solid color-mix(in srgb, currentColor 22%, #fff);
}

.process-strip,
.dashboard-section,
.home-daily-agenda,
.pcp-daily-agenda {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.summary-grid {
  gap: 10px;
}

.summary-card {
  min-height: 76px;
  overflow: hidden;
}

.summary-card > div:last-child {
  padding: 11px 15px;
}

.summary-card strong {
  font-size: 21px;
}

.summary-card span {
  font-size: 8.5pt;
  line-height: 1.3;
}

/* Formulários */
.workspace-form-grid,
.user-form-scroll,
.form-scroll {
  padding: 16px;
}

.workspace-form > p {
  margin: 14px 15px 0;
  color: var(--muted);
  font-size: 8.5pt;
  line-height: 1.45;
}

.workspace-form-grid,
.form-grid {
  gap: 12px;
}

.workspace-form-grid label > span,
.form-grid label > span,
.product-quantity > span,
.delivery-fieldset label > span,
.repository-upload-panel label > span {
  color: #40566c;
  font-size: 8pt;
  font-weight: 800;
  line-height: 1.25;
}

.workspace-form input,
.workspace-form select,
.workspace-form textarea,
.form-grid input,
.form-grid select,
.user-form-card .form-grid input,
.user-form-card .form-grid select,
.repository-config-card input,
.repository-search input,
.repository-upload-panel input,
.repository-upload-panel select,
.edit-row input,
.workflow-status-group select,
.confirmation-dialog input {
  min-height: 42px;
  padding: 8px 11px;
  color: var(--text);
  background: #fff;
  border: 1px solid #cbd6df;
  border-radius: var(--radius-xs);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background 0.15s ease;
}

.proposal-history-filters,
.controls,
.ops-filter-bar,
.repository-search,
.commercial-op-history-filters {
  background:
    linear-gradient(180deg, #f8fafc, #f2f6f9);
  border-color: #dbe4eb;
}

.proposal-history-filters label > span,
.controls label > span,
.filter-group > span,
.ops-filter-group > span {
  color: #40566c;
  font-size: 8pt;
  font-weight: 850;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.proposal-history-filters input,
.proposal-history-filters select,
.controls input,
.controls select,
.ops-search input,
.search-box input {
  border-color: #cbd7e1;
  border-radius: var(--radius-sm);
  background: #fff;
}

.proposal-history-filters input:focus,
.proposal-history-filters select:focus,
.controls input:focus,
.controls select:focus,
.ops-search input:focus,
.search-box input:focus {
  border-color: var(--brand-blue-600);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}

.workspace-form textarea {
  min-height: 78px;
}

.workspace-form input:hover:not(:disabled),
.workspace-form select:hover:not(:disabled),
.workspace-form textarea:hover:not(:disabled),
.form-grid input:hover:not(:disabled),
.form-grid select:hover:not(:disabled) {
  border-color: #9eb1c2;
}

.workspace-form input:focus,
.workspace-form select:focus,
.workspace-form textarea:focus,
.form-grid input:focus,
.form-grid select:focus,
.user-form-card .form-grid input:focus,
.user-form-card .form-grid select:focus,
.repository-search input:focus,
.repository-config-card input:focus,
.repository-upload-panel input:focus,
.repository-upload-panel select:focus,
.edit-row input:focus,
.workflow-status-group select:focus,
.confirmation-dialog input:focus {
  border-color: #477aa8;
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}

input:disabled,
select:disabled,
textarea:disabled,
input[readonly] {
  color: #526273;
  background: #eef2f6;
  opacity: 1;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--green);
}

.active-toggle,
.user-active-row,
.delivery-address-toggle,
.switch-row {
  border-radius: var(--radius-sm);
}

.active-toggle,
.user-active-row {
  min-height: 46px;
}

.delivery-fieldset,
.proposal-item-builder {
  border-color: #d9e2e9;
  border-radius: var(--radius-md);
  background: #fbfcfd;
}

.item-spec-section,
.product-card,
.detail-field {
  border-radius: var(--radius-sm);
}

.proposal-group-picker button {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.proposal-group-picker button > b svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Botões e ações */
.button,
.form-clear,
.table-action,
.repository-open,
.repository-delete,
.pcp-agenda-open,
.ops-filter,
.filter-button,
.mobile-ops-nav button,
.confirmation-dialog-actions button {
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-xs);
  font-size: 8.5pt;
  font-weight: 800;
  line-height: 1.15;
  text-decoration: none;
  transition: transform 0.14s ease, filter 0.14s ease,
    box-shadow 0.14s ease, border-color 0.14s ease,
    background 0.14s ease;
}

.button:hover:not(:disabled),
.form-clear:hover:not(:disabled),
.table-action:hover:not(:disabled),
.repository-open:hover,
.repository-delete:hover:not(:disabled),
.pcp-agenda-open:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.button:active:not(:disabled),
.form-clear:active:not(:disabled),
.table-action:active:not(:disabled) {
  transform: translateY(0);
}

.button,
.button.secondary {
  color: #fff;
  background: var(--navy-light);
  border: 1px solid transparent;
}

.button.save,
.button.save-op,
.button.save-user-button,
.button.user-new-button,
.table-action.primary {
  color: #fff;
  background: var(--green);
}

.form-clear,
.button.tertiary,
.confirmation-cancel {
  color: var(--navy);
  background: #fff;
  border: 1px solid #cfd9e2;
}

.button.delete-op,
.button.delete-user-button,
.table-action.danger,
.repository-delete,
.confirmation-delete {
  color: #a82f2f;
  background: #fff2f2;
  border: 1px solid #eccccc;
}

.button.delete-op:hover:not(:disabled),
.button.delete-user-button:hover:not(:disabled),
.table-action.danger:hover:not(:disabled),
.repository-delete:hover:not(:disabled),
.confirmation-delete:hover:not(:disabled) {
  color: #fff;
  background: #b63b3b;
  border-color: #b63b3b;
}

.ui-action-icon,
.button > svg,
.form-clear > svg,
.table-action > svg,
.repository-open > svg,
.repository-delete > svg,
.pcp-agenda-open > svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.table-action {
  min-height: 34px;
  padding: 0 10px;
  color: var(--navy-light);
  background: #eef5fb;
  border: 1px solid #d6e4f0;
}

.table-action-group,
.repository-actions,
.form-footer-actions,
.user-form-actions {
  gap: 7px;
}

.form-footer {
  background: linear-gradient(180deg, #fffaf0, #fff5d9);
  border-top-color: #eadfbe;
}

#refresh-dollar-rate {
  display: grid;
  place-items: center;
}

#refresh-dollar-rate svg {
  width: 18px;
  height: 18px;
}

/* Tabelas, filtros e estados */
.workspace-table-scroll,
.users-table-scroll,
.audit-table-scroll,
.ops-table-scroll,
.table-scroll,
.repository-table-scroll,
.grouped-table-scroll {
  background: #fff;
}

.workspace-table-scroll thead,
.users-table-scroll thead,
.audit-table-scroll thead,
.ops-table-scroll thead,
.table-scroll > table > thead,
.grouped-table-scroll thead,
.repository-table-scroll thead {
  position: sticky;
  z-index: 3;
  top: 0;
}

.workspace-table-scroll th,
.users-table th,
.audit-table th,
.ops-table th,
.table-scroll > table th,
.grouped-table th,
.repository-table th {
  height: 42px;
  padding: 8px 11px;
  color: #e7eef5;
  background: linear-gradient(180deg, var(--brand-navy-700), var(--brand-navy-800));
  border-right: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 7.5pt;
  font-weight: 800;
  letter-spacing: 0.045em;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
}

.workspace-table-scroll td,
.users-table td,
.audit-table td,
.ops-table td,
.table-scroll > table td,
.grouped-table td,
.repository-table td {
  min-height: 44px;
  padding: 10px 11px;
  border-right: 1px solid #edf1f4;
  border-bottom: 1px solid #e7edf2;
  color: var(--text);
  font-size: 8.5pt;
  line-height: 1.35;
}

.users-table {
  min-width: 720px;
  table-layout: auto;
}

.audit-table {
  min-width: 760px;
  table-layout: auto;
}

.users-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-name-with-icon {
  min-width: 0;
}

.user-name-with-icon strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-table-scroll tbody tr:nth-child(even) td,
.users-table tbody tr:nth-child(even) td,
.audit-table tbody tr:nth-child(even) td,
.repository-table tbody tr:nth-child(even) td {
  background: #fbfcfd;
}

.workspace-table-scroll tbody tr:hover td,
.users-table tbody tr:hover td,
.ops-table tbody tr:hover td,
.table-scroll > table tbody tr:hover td,
.repository-table tbody tr:hover td {
  background: #edf5fb;
}

.grouped-table {
  min-width: 700px;
  table-layout: auto;
}

.grouped-table th,
.grouped-table td {
  white-space: nowrap;
}

.grouped-table th:nth-child(2),
.grouped-table td:nth-child(2) {
  min-width: 116px;
}

.grouped-table th:nth-child(3),
.grouped-table td:nth-child(3),
.grouped-table th:nth-child(6),
.grouped-table td:nth-child(6) {
  min-width: 96px;
}

.ops-search,
.search-box,
.repository-search input {
  border-radius: var(--radius-sm);
  background: #fff;
}

.ops-filter,
.filter-button {
  color: #53677b;
  background: #fff;
  border: 1px solid #d5dfe7;
}

.ops-filter.active,
.filter-button.active {
  color: #fff;
  background: var(--navy-light);
  border-color: var(--navy-light);
  box-shadow: 0 4px 12px rgba(31, 82, 127, 0.16);
}

.history-status-counter {
  border-color: #d7e1e9;
  background: #f8fafc;
  box-shadow: 0 2px 7px rgba(13, 39, 72, 0.04);
}

.history-status-counter.active {
  border-color: var(--brand-gold-500);
  background: var(--gold-pale);
  box-shadow: 0 4px 12px rgba(217, 166, 42, 0.13);
}

.status-pill.perdida,
.status-pill.cancelada,
.history-status-counter.perdida,
.history-status-counter.cancelada {
  color: #9d2d2d;
  background: #fff0f0;
  border-color: #efcccc;
}

/* Filtro temporal do painel inicial. */
.dashboard-period-control {
  min-width: 0;
  display: grid;
  justify-items: end;
  gap: 6px;
}

.dashboard-period-control > small {
  color: var(--muted);
  font-size: 8pt;
  font-weight: 700;
}

.dashboard-period-filter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: #edf2f6;
  border: 1px solid #d7e1e9;
  border-radius: 10px;
}

.dashboard-period-filter button {
  min-height: 36px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #52677b;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  font: inherit;
  font-size: 8pt;
  font-weight: 800;
  cursor: pointer;
}

.dashboard-period-filter button span {
  color: inherit;
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
}

.dashboard-period-filter button svg,
.op-status-card i svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-period-filter button:hover:not(:disabled) {
  color: var(--brand-navy-700);
  background: rgba(255, 255, 255, 0.7);
}

.dashboard-period-filter button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-navy-700), var(--brand-blue-600));
  border-color: var(--brand-blue-600);
  box-shadow: 0 4px 10px rgba(30, 82, 127, 0.18);
}

.dashboard-period-filter button:disabled {
  opacity: 0.62;
}

.op-status-card i svg {
  width: 20px;
  height: 20px;
}

.status-pill,
.stage-pill,
.ops-status,
.user-status-pill,
.access-count,
.history-status-counter {
  border-radius: 999px;
  font-weight: 800;
}

.empty-state,
.repository-empty,
.workspace-empty {
  color: var(--muted);
}

.empty-icon {
  color: var(--navy-light);
  background: #eaf2f9;
}

.empty-icon svg {
  width: 25px;
  height: 25px;
}

/* OPs, arquivos e usuários */
.file-card {
  min-height: 70px;
  padding: 12px 15px;
}

.file-icon {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
  color: #fff;
  background: linear-gradient(135deg, #1e527f, #3676c5);
  border-radius: 12px;
}

.file-icon svg {
  width: 23px;
  height: 23px;
}

.file-copy strong {
  font-size: 11pt;
}

.linked-badge {
  min-height: 34px;
  border-radius: 999px;
}

.repository-permission-banner {
  border-left-width: 4px;
}

.repository-op-item {
  min-height: 66px;
  border-bottom-color: #e8edf2;
}

.repository-op-item:hover,
.repository-op-item.selected {
  background: #f0f6fb;
}

.repository-open,
.repository-delete {
  min-height: 34px;
}

.users-workspace {
  height: 420px;
}

.users-list-card,
.user-form-card,
.audit-card {
  overflow: hidden;
}

.user-list-avatar,
.user-avatar {
  background: linear-gradient(135deg, #2c6597, #234b74);
}

.permission-table {
  border-color: #dce4eb;
  border-radius: var(--radius-sm);
}

.permission-row {
  min-height: 38px;
  border-bottom-color: #e8edf2;
  font-size: 8pt;
}

.permission-row.header {
  color: #52677b;
  background: #f1f5f8;
  font-size: 7pt;
}

.user-form-card .form-title::before {
  display: none;
}

/* Avisos e diálogos */
.edit-mode-banner,
.op-review-banner,
.repository-missing-folder,
.commission-guidance {
  border-radius: var(--radius-sm);
}

.confirmation-overlay {
  background: rgba(8, 27, 47, 0.76);
  backdrop-filter: blur(3px);
}

.confirmation-dialog {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.toast {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Proteção contra textos fora dos cartões. */
.workspace-heading,
.workspace-heading *,
.records-card,
.records-card *,
.workspace-form,
.workspace-form *,
.module-card,
.module-card *,
.file-card,
.file-card *,
.repository-permission-banner,
.repository-permission-banner *,
.detail-card,
.detail-card *,
.users-heading,
.users-heading *,
.audit-card,
.audit-card * {
  min-width: 0;
}

.workspace-heading h1,
.workspace-heading p,
.records-card strong,
.workspace-form strong,
.file-copy strong,
.file-copy small,
.module-copy strong,
.module-copy span,
.repository-permission-banner p,
.detail-field strong,
.users-heading h1,
.users-heading p,
.audit-card strong {
  overflow-wrap: anywhere;
}

@media (max-width: 1250px) {
  .workspace-panel {
    grid-template-columns: minmax(0, 1.2fr) minmax(330px, 0.8fr);
  }

  .table-action-group {
    flex-wrap: wrap;
  }

  .table-action {
    flex: 1 1 auto;
  }
}

@media (max-width: 900px) {
  .auth-gate {
    min-height: 100dvh;
    height: auto;
    grid-template-columns: 1fr;
  }

  .auth-brand-panel {
    display: none;
  }

  .auth-form-panel {
    min-height: 100dvh;
    padding: 24px;
  }

  .auth-mobile-brand {
    padding-bottom: 18px;
    display: flex;
    justify-content: center;
    gap: 10px;
    border-bottom: 1px solid #e2e8ee;
  }

  .auth-mobile-brand img {
    height: 70px;
    width: auto;
    border-radius: 10px;
    object-fit: contain;
    background: #000;
  }

  .app-shell > main {
    padding: 15px;
  }

  .context-navigation {
    padding: 8px 12px;
  }

  .workspace-panel,
  .stock-workspace-panel,
  .users-workspace,
  .repository-workspace {
    height: auto;
    grid-template-columns: 1fr;
  }

  .users-list-card,
  .user-form-card {
    min-height: 390px;
  }

  .ops-workspace {
    grid-template-columns: 1fr;
  }
}

/* Mantém o conteúdo de Logística rolável sem comprimir ou recortar os cartões. */
.freight-view:not([hidden]) > *,
.billing-view:not([hidden]) > * {
  flex-shrink: 0;
}

/* Logística, faturamento e tabelas compactas — 2026-08-07 */
.freight-view:not([hidden]),
.billing-view:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 18px 22px 34px;
}

.freight-summary-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.freight-summary-grid .summary-card,
.billing-summary-grid .summary-card {
  min-width: 0;
}

.summary-card.dispatched .summary-accent {
  background: #6f7fa0;
}

.freight-controls {
  grid-template-columns: minmax(320px, 1fr) 230px;
}

.freight-status-filter {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 6px 10px;
  border: 1px solid var(--shell-line);
  border-radius: 12px;
  background: #fff;
}

.freight-status-filter span {
  color: #536254;
  font-size: 8pt;
  font-weight: 800;
  text-transform: uppercase;
}

.freight-status-filter select {
  min-width: 0;
  min-height: 38px;
  border: 0;
  color: var(--shell-navy);
  background: transparent;
  font-weight: 700;
}

.freight-table,
.billing-table {
  width: 100%;
  table-layout: fixed;
}

.freight-table th,
.freight-table td,
.billing-table th,
.billing-table td {
  padding: 9px 6px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.freight-table th:nth-child(1) { width: 6%; }
.freight-table th:nth-child(2) { width: 12%; }
.freight-table th:nth-child(3),
.freight-table th:nth-child(4) { width: 10%; }
.freight-table th:nth-child(5) { width: 9%; }
.freight-table th:nth-child(6) { width: 10%; }
.freight-table th:nth-child(7) { width: 8%; }
.freight-table th:nth-child(8) { width: 19%; }
.freight-table th:nth-child(9) { width: 16%; }

.freight-row-late td {
  color: #9f2f35;
  background: #fff0f0 !important;
  font-weight: 700;
}

.freight-records-body tr,
.freight-table tbody tr {
  cursor: pointer;
}

.freight-table tbody tr.selected td {
  box-shadow: inset 0 2px #b89b5e, inset 0 -2px #b89b5e;
}

.op-preview-link {
  min-width: 0;
  min-height: 32px;
  padding: 4px 7px;
  border: 0;
  border-radius: 8px;
  color: #435f46;
  background: #e7eee4;
  font: inherit;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.op-preview-link:hover,
.op-preview-link:focus-visible {
  color: #fff;
  background: #657762;
}

.freight-detail-card {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(330px, 0.8fr);
  overflow: hidden;
  border: 1px solid var(--shell-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(61, 77, 62, 0.07);
}

.freight-detail-main,
.freight-edit-panel {
  padding: 18px;
}

.freight-detail-main > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.freight-detail-main header div,
.freight-detail-main header span,
.freight-detail-main header strong {
  display: block;
}

.freight-detail-main header span,
.order-tracking-title span {
  color: #aa7f2a;
  font-size: 8pt;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.freight-detail-main header strong {
  color: var(--shell-navy);
  font-size: 15pt;
}

.freight-detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.freight-detail-facts > div {
  min-width: 0;
  padding: 10px;
  border-radius: 10px;
  background: #f5f7f2;
}

.freight-detail-facts span,
.freight-detail-facts strong {
  display: block;
}

.freight-detail-facts span {
  color: #6c786b;
  font-size: 7.5pt;
  font-weight: 800;
  text-transform: uppercase;
}

.freight-detail-facts strong {
  margin-top: 4px;
  color: #405043;
  font-size: 9pt;
  overflow-wrap: anywhere;
}

.order-tracking-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #dfe5da;
  border-radius: 12px;
  background: linear-gradient(135deg, #fbfcf9, #f2f5ee);
}

.order-tracking-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.order-tracking-title strong {
  color: #4f6651;
}

.order-tracking {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
}

.order-tracking-journey {
  position: relative;
  grid-column: 1 / -1;
  height: 44px;
  margin: 0 19px 4px;
}

.order-tracking-rail,
.order-tracking-rail-progress {
  position: absolute;
  top: 20px;
  right: 0;
  left: 0;
  height: 4px;
  border-radius: 999px;
}

.order-tracking-rail {
  overflow: hidden;
  background: #dbe1d8;
}

.order-tracking-rail-progress {
  top: 0;
  right: auto;
  width: var(--tracking-progress);
  background: linear-gradient(90deg, #8d9d86, #c3a152);
  animation: order-tracking-fill 900ms ease-out both;
}

.order-tracking-medal {
  position: absolute;
  top: 1px;
  left: var(--tracking-progress);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid #c3a152;
  border-radius: 50%;
  background: #fffdf6;
  box-shadow: 0 5px 14px rgba(77, 88, 72, 0.18);
  font-size: 18pt;
  transform: translateX(-50%);
  animation: order-tracking-travel 1.2s cubic-bezier(0.22, 0.8, 0.25, 1) both;
}

@keyframes order-tracking-fill {
  from { width: 0; }
  to { width: var(--tracking-progress); }
}

@keyframes order-tracking-travel {
  0% {
    left: 0;
    transform: translateX(-50%) translateY(0) rotate(-10deg) scale(0.9);
  }
  65% {
    transform: translateX(-50%) translateY(-7px) rotate(7deg) scale(1.04);
  }
  100% {
    left: var(--tracking-progress);
    transform: translateX(-50%) translateY(0) rotate(0) scale(1);
  }
}

.order-tracking-stage {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 0;
  color: #8b958a;
  text-align: center;
  font-size: 7pt;
  font-weight: 800;
}

.order-tracking-stage::before {
  position: absolute;
  top: 18px;
  right: 50%;
  width: 100%;
  height: 3px;
  content: "";
  background: #dbe1d8;
  transform: translateX(-50%);
  z-index: 0;
}

.order-tracking-stage:first-child::before { display: none; }

.order-tracking-stage i {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 3px solid #dbe1d8;
  border-radius: 50%;
  background: #fff;
  font-style: normal;
  filter: grayscale(1);
}

.order-tracking-stage.completed::before,
.order-tracking-stage.current::before {
  background: #758772;
}

.order-tracking-stage.completed i,
.order-tracking-stage.current i {
  border-color: #758772;
  color: #fff;
  background: #758772;
  filter: none;
}

.order-tracking-stage.current i {
  box-shadow: 0 0 0 5px rgba(184, 155, 94, 0.2);
}

@media (prefers-reduced-motion: reduce) {
  .order-tracking-rail-progress,
  .order-tracking-medal {
    animation: none;
  }
}

.freight-edit-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 10px;
  border-left: 1px solid #e5e9e1;
  background: #faf8ef;
}

.freight-edit-panel label,
.freight-edit-panel label span {
  display: grid;
  gap: 5px;
}

.freight-edit-panel label span {
  color: #596758;
  font-size: 7.5pt;
  font-weight: 800;
}

.freight-edit-panel input,
.freight-edit-panel select {
  width: 100%;
  min-height: 44px;
}

.freight-lock-note,
.freight-edit-panel button {
  grid-column: 1 / -1;
}

.freight-lock-note {
  padding: 10px;
  border-radius: 9px;
  color: #7c5a20;
  background: #fff0cf;
  font-size: 8pt;
  font-weight: 700;
}

.billing-external-note {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-left: 5px solid #b89b5e;
  border-radius: 10px;
  color: #536254;
  background: #fff8e8;
}

.billing-external-note strong { color: #7a5b20; }
.billing-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.module-table-status {
  width: 100%;
  min-width: 980px;
  table-layout: fixed;
}

.module-table-status th,
.module-table-status td {
  padding: 7px 5px;
}

.module-table-status th:nth-child(1) { width: 6%; }
.module-table-status th:nth-child(2) { width: 9%; }
.module-table-status th:nth-child(3) { width: 5%; }
.module-table-status th:nth-child(4) { width: 5%; }
.module-table-status th:nth-child(5) { width: 21%; }
.module-table-status th:nth-child(6) { width: 5%; }
.module-table-status th:nth-child(7) { width: 25%; }
.module-table-status th:nth-child(8) { width: 8%; }
.module-table-status th:nth-child(9) { width: 9%; }
.module-table-status th:nth-child(10) { width: 7%; }

.status-stage-summary > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
}

.status-stage-summary span {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 3px 4px;
  border-radius: 6px;
  color: #526052;
  background: #eef2eb;
  line-height: 1.15;
}

.status-stage-summary b,
.status-stage-summary small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.status-stage-summary b { font-size: 6.8pt; }
.status-stage-summary small { font-size: 6.2pt; }
.status-stage-summary em {
  grid-column: 1 / -1;
  color: #517055;
  font-size: 6.5pt;
  font-style: normal;
  font-weight: 900;
}

.grouped-table {
  width: 100%;
  table-layout: fixed;
}

.grouped-table th,
.grouped-table td {
  padding-inline: 5px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.delivery-label-print {
  margin-top: 24px;
  padding: 32px;
  border: 3px solid #3f4f41;
  text-align: center;
}

.delivery-label-print > span {
  color: #8a6a2d;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.delivery-label-print h2 {
  margin: 18px 0 12px;
  font-size: 22pt;
}

.delivery-label-print p {
  margin: 0 auto 24px;
  max-width: 720px;
  font-size: 15pt;
  line-height: 1.5;
}

@media (max-width: 1200px) {
  .freight-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .freight-detail-card { grid-template-columns: 1fr; }
  .freight-edit-panel { border-top: 1px solid #e5e9e1; border-left: 0; }
}

@media (max-width: 700px) {
  .freight-view:not([hidden]),
  .billing-view:not([hidden]) { padding: 10px 10px 120px; }
  .freight-summary-grid,
  .billing-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .freight-controls { grid-template-columns: 1fr; }
  .freight-table { min-width: 980px; }
  .freight-detail-facts,
  .freight-edit-panel { grid-template-columns: 1fr; }
  .freight-edit-panel label,
  .freight-lock-note,
  .freight-edit-panel button { grid-column: 1; }
  .order-tracking { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 16px; }
  .order-tracking-stage::before { display: none; }
}

@media (max-width: 600px) {
  .auth-form-panel {
    padding: 14px 10px;
    align-items: start;
  }

  .auth-form {
    width: 100%;
    max-width: 100%;
    margin: 10px 0;
    padding: 24px 18px;
  }

  .auth-form h1 {
    font-size: 18pt;
  }

  .auth-mobile-brand img {
    max-width: 58%;
    height: 64px;
  }

  .app-shell > main {
    padding: 12px 10px 18px;
  }

  .app-sidebar {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
  }

  .sidebar-nav-item:hover:not(:disabled) {
    transform: none;
  }

  .sidebar-nav-item > svg {
    width: 27px;
    height: 27px;
    padding: 5px;
  }

  .context-navigation {
    min-height: 72px;
    padding: 7px 8px;
    scroll-snap-type: x proximity;
  }

  .dashboard-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-period-control {
    justify-items: stretch;
  }

  .dashboard-period-filter {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-period-filter button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }

  .context-navigation button {
    min-width: 154px;
    min-height: 58px;
    scroll-snap-align: start;
  }

  .context-navigation button > svg,
  .context-navigation button > b {
    width: 34px;
    height: 34px;
  }

  .workspace-heading,
  .users-heading {
    min-height: 0;
    padding: 17px;
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-heading .button,
  .users-heading .button {
    width: 100%;
  }

  .workspace-panel,
  .stock-workspace-panel,
  .users-workspace,
  .ops-workspace,
  .repository-workspace {
    gap: 12px;
  }

  .records-card > header,
  .workspace-form > header,
  .users-list-card > header,
  .audit-card > header,
  .ops-list-header,
  .form-title,
  .repository-panel-heading,
  .repository-selected-heading {
    min-height: 58px;
    padding: 11px 12px;
  }

  .workspace-form-grid,
  .form-grid,
  .finish-grid {
    grid-template-columns: 1fr;
  }

  .workspace-form-grid .span-two,
  .form-grid .form-span-two {
    grid-column: auto;
  }

  .workspace-form input,
  .workspace-form select,
  .workspace-form textarea,
  .form-grid input,
  .form-grid select,
  .user-form-card .form-grid input,
  .user-form-card .form-grid select,
  .repository-search input,
  .repository-config-card input,
  .repository-upload-panel input,
  .repository-upload-panel select,
  .edit-row input,
  .workflow-status-group select,
  .confirmation-dialog input {
    min-height: 48px;
    font-size: 10pt;
  }

  .button,
  .form-clear,
  .table-action,
  .repository-open,
  .repository-delete,
  .pcp-agenda-open,
  .ops-filter,
  .filter-button,
  .mobile-ops-nav button,
  .confirmation-dialog-actions button {
    min-height: 44px;
  }

  .form-footer-actions,
  .user-form-actions,
  .confirmation-dialog-actions {
    width: 100%;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .form-footer-actions .button,
  .user-form-actions .button,
  .confirmation-dialog-actions .button {
    width: 100%;
  }

  .file-card,
  .file-actions,
  .repository-permission-banner,
  .repository-config-card {
    align-items: stretch;
    flex-direction: column;
  }

  .file-actions {
    width: 100%;
    margin: 10px 0 0;
  }

  .file-actions .button {
    width: 100%;
  }

  .summary-grid,
  .op-status-dashboard,
  .business-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-card {
    min-height: 82px;
  }

  .workspace-table-scroll table,
  .users-table,
  .audit-table,
  .repository-table,
  .ops-table,
  .module-table {
    min-width: 720px;
  }

  .workspace-table-scroll th:first-child,
  .workspace-table-scroll td:first-child,
  .users-table th:first-child,
  .users-table td:first-child,
  .audit-table th:first-child,
  .audit-table td:first-child,
  .repository-table th:first-child,
  .repository-table td:first-child,
  .ops-table th:first-child,
  .ops-table td:first-child,
  .module-table th:first-child,
  .module-table td:first-child {
    position: sticky;
    left: 0;
  }

  .workspace-table-scroll th:first-child,
  .users-table th:first-child,
  .audit-table th:first-child,
  .repository-table th:first-child,
  .ops-table th:first-child,
  .module-table th:first-child {
    z-index: 5;
    background: #173c63;
  }

  .workspace-table-scroll td:first-child,
  .users-table td:first-child,
  .audit-table td:first-child,
  .repository-table td:first-child,
  .ops-table td:first-child,
  .module-table td:first-child {
    z-index: 2;
    background: #fff;
    box-shadow: 3px 0 7px rgba(13, 39, 72, 0.08);
  }

  .table-action-group,
  .repository-actions {
    min-width: 160px;
  }

  .table-action,
  .repository-open,
  .repository-delete {
    flex: 1 1 auto;
  }

  .proposal-group-picker {
    grid-template-columns: 1fr;
  }

  .proposal-group-picker button {
    min-height: 66px;
  }

  .toast {
    right: 10px;
    left: 10px;
  }
}

@media (max-width: 390px) {
  .summary-grid,
  .op-status-dashboard,
  .business-kpi-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 17px;
  }

  .hero-subtitle {
    font-size: 9pt;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/*
 * hsports Visual 2
 * Estrutura efetivamente nova para todo o sistema: navegação escura, barra
 * superior clara e superfícies operacionais com a mesma hierarquia visual.
 */
:root {
  --shell-navy: #081d34;
  --shell-navy-soft: #102f50;
  --shell-gold: #d8a62a;
  --shell-canvas: #f2f5f8;
  --shell-line: #d9e2e9;
  --shell-card-shadow: 0 10px 28px rgba(8, 29, 52, 0.07);
}

body {
  background:
    radial-gradient(circle at 92% 2%, rgba(48, 113, 181, 0.08), transparent 24%),
    var(--shell-canvas);
}

.app-shell > main {
  background:
    radial-gradient(circle at 96% 0%, rgba(216, 166, 42, 0.08), transparent 22%),
    linear-gradient(180deg, #f4f7fa, #f1f4f7);
}

.workspace-heading,
.users-heading {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 15%, rgba(216, 166, 42, 0.23), transparent 27%),
    linear-gradient(118deg, #0b2745, #174b72);
  border: 0;
  border-left: 5px solid var(--shell-gold);
  box-shadow: 0 14px 34px rgba(8, 29, 52, 0.13);
}

.workspace-heading::after,
.users-heading::after {
  content: "";
  position: absolute;
  width: 210px;
  height: 210px;
  right: -120px;
  bottom: -150px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(255, 255, 255, 0.025);
  pointer-events: none;
}

.records-card,
.workspace-form,
.users-list-card,
.user-form-card,
.audit-card,
.ops-list-panel,
.op-form-panel,
.repository-ops-panel,
.repository-files-panel,
.file-card,
.table-card,
.detail-card,
.repository-config-card {
  border: 1px solid var(--shell-line);
  border-top: 3px solid var(--brand-blue-600);
  border-radius: 13px;
  box-shadow: var(--shell-card-shadow);
}

.workspace-form,
.user-form-card,
.op-form-panel,
.repository-files-panel {
  border-top-color: var(--shell-gold);
}

@media (min-width: 901px) {
  .module-view .summary-grid {
    gap: 8px;
    margin-top: 8px;
  }

  .module-view .summary-card {
    min-height: 62px;
  }

  .module-view .summary-card > div:last-child {
    padding: 8px 12px;
  }

  .module-view .controls {
    gap: 8px;
    margin-top: 8px;
    padding: 8px;
  }

  .module-view .search-box,
  .module-view .filter-button {
    min-height: 38px;
  }

  .module-view .table-card {
    height: clamp(360px, 46vh, 620px);
    min-height: 360px;
    margin-top: 8px;
  }

  .module-view .grouped-list-header {
    flex-basis: 38px;
  }

  .module-view .grouped-tables.has-other {
    grid-template-rows: minmax(220px, 1fr) minmax(120px, 0.42fr);
  }

  .module-view .grouped-tables.has-item .grouped-table {
    min-width: 680px;
  }
}

.records-card > header,
.workspace-form > header,
.users-list-card > header,
.audit-card > header,
.ops-list-header,
.form-title,
.repository-panel-heading,
.repository-selected-heading {
  min-height: 64px;
  padding: 13px 16px;
  background: #fff;
  border-bottom: 1px solid #e2e9ef;
  border-left: 0;
}

.commercial-summary article,
.summary-card,
.op-status-card,
.business-kpi-card {
  border: 1px solid #dbe4eb;
  border-radius: 11px;
  background:
    linear-gradient(145deg, #fff, #f8fafc);
  box-shadow: 0 7px 20px rgba(8, 29, 52, 0.05);
}

.commercial-summary article {
  border-top: 3px solid var(--brand-blue-600);
}

.commercial-summary article:nth-child(2) {
  border-top-color: var(--brand-green-600);
}

.commercial-summary article:nth-child(3) {
  border-top-color: var(--shell-gold);
}

.commercial-summary article:nth-child(4) {
  border-top-color: #7457a6;
}

.proposal-history-filters,
.controls,
.ops-filter-bar,
.repository-search,
.commercial-op-history-filters {
  padding: 13px;
  background: #eef3f7;
  border: 1px solid #d8e2e9;
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.workspace-form input,
.workspace-form select,
.workspace-form textarea,
.form-grid input,
.form-grid select,
.user-form-card .form-grid input,
.user-form-card .form-grid select,
.repository-config-card input,
.repository-search input,
.repository-upload-panel input,
.repository-upload-panel select,
.edit-row input,
.workflow-status-group select,
.confirmation-dialog input,
.proposal-history-filters input,
.proposal-history-filters select,
.controls input,
.controls select,
.ops-search input,
.search-box input {
  background: #f9fbfd;
  border-color: #c7d4de;
  border-radius: 7px;
}

.workspace-form input:focus,
.workspace-form select:focus,
.workspace-form textarea:focus,
.form-grid input:focus,
.form-grid select:focus,
.repository-search input:focus,
.proposal-history-filters input:focus,
.proposal-history-filters select:focus,
.controls input:focus,
.controls select:focus,
.ops-search input:focus,
.search-box input:focus {
  background: #fff;
  border-color: var(--brand-blue-600);
  box-shadow: 0 0 0 3px rgba(47, 115, 184, 0.16);
}

.workspace-table-scroll th,
.users-table th,
.audit-table th,
.ops-table th,
.table-scroll > table th,
.grouped-table th,
.repository-table th {
  color: #3c536a;
  background: #eef3f7;
  border-right-color: #dce5ec;
  border-bottom: 2px solid #ccd8e2;
  font-weight: 850;
}

.workspace-table-scroll td,
.users-table td,
.audit-table td,
.ops-table td,
.table-scroll > table td,
.grouped-table td,
.repository-table td {
  padding-top: 11px;
  padding-bottom: 11px;
  border-bottom-color: #e5ebf0;
}

.workspace-table-scroll tbody tr:nth-child(even) td,
.users-table tbody tr:nth-child(even) td,
.audit-table tbody tr:nth-child(even) td,
.repository-table tbody tr:nth-child(even) td {
  background: #f8fafc;
}

.workspace-table-scroll tbody tr:hover td,
.users-table tbody tr:hover td,
.ops-table tbody tr:hover td,
.table-scroll > table tbody tr:hover td,
.repository-table tbody tr:hover td {
  background: #edf5fa;
}

.button,
.form-clear,
.table-action,
.repository-open,
.repository-delete,
.pcp-agenda-open,
.ops-filter,
.filter-button,
.mobile-ops-nav button,
.confirmation-dialog-actions button {
  border-radius: 7px;
}

.button,
.button.secondary {
  background: linear-gradient(135deg, #123a63, #236496);
  box-shadow: 0 5px 13px rgba(13, 58, 99, 0.14);
}

.form-clear,
.button.tertiary,
.confirmation-cancel {
  color: #183a5e;
  background: #fff;
  border-color: #c9d5df;
  box-shadow: none;
}

.table-action {
  color: #174d76;
  background: #edf4f9;
  border-color: #d2e0ea;
}

.status-pill,
.stage-pill,
.history-status-counter,
.linked-badge {
  border-radius: 6px;
}

@media (min-width: 901px) {
  .app-sidebar {
    color: #fff;
    background:
      radial-gradient(circle at 55% 0%, rgba(216, 166, 42, 0.15), transparent 28%),
      linear-gradient(180deg, var(--shell-navy), var(--shell-navy-soft));
    border-right: 3px solid var(--shell-gold);
    box-shadow: 10px 0 30px rgba(4, 20, 36, 0.16);
  }

  .sidebar-brand {
    border-bottom-color: rgba(255, 255, 255, 0.13);
  }

  .sidebar-brand strong {
    color: #fff;
  }

  .sidebar-brand span {
    color: #aebfd0;
  }

  .sidebar-brand > img:first-child,
  .sidebar-brand .sidebar-jm-logo {
    border: 1px solid rgba(216, 166, 42, 0.35);
    box-shadow: 0 9px 22px rgba(0, 0, 0, 0.2);
  }

  .sidebar-nav-item,
  .sidebar-nav-item[data-sidebar-area] {
    color: #d8e3ed;
    background: transparent;
    border-color: transparent;
  }

  .sidebar-nav-item strong {
    color: inherit;
  }

  .sidebar-nav-item small {
    color: #91a7ba;
  }

  .sidebar-nav-item > svg,
  .sidebar-nav-item[data-sidebar-area] > svg {
    color: #e9bd4b;
    background: rgba(216, 166, 42, 0.1);
    border: 1px solid rgba(216, 166, 42, 0.26);
    box-shadow: none;
  }

  .sidebar-nav-item:hover:not(:disabled),
  .sidebar-nav-item:focus-visible,
  .sidebar-nav-item.active,
  .sidebar-nav-item[data-sidebar-area].active {
    color: #fff;
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(216, 166, 42, 0.38);
    box-shadow: inset 4px 0 var(--shell-gold);
    transform: none;
  }

  .sidebar-nav-item.active small {
    color: #c2d1de;
  }

  .sidebar-nav-item.active > svg {
    color: #102a46;
    background: var(--shell-gold);
    border-color: var(--shell-gold);
  }

  .sidebar-motivation {
    color: #f0f5f8;
    background:
      radial-gradient(circle at 96% 5%, rgba(216, 166, 42, 0.2), transparent 40%),
      rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
  }

  .sidebar-motivation span {
    color: #f0c75f;
  }

  .sidebar-motivation strong {
    color: #fff;
  }

  .sidebar-motivation small {
    color: #aec0cf;
  }

  .sidebar-account {
    border-top-color: rgba(255, 255, 255, 0.13);
  }

  .sidebar-user-copy .user-avatar {
    color: #102a46;
    background: var(--shell-gold);
  }

  .sidebar-user-copy strong {
    color: #fff;
  }

  .sidebar-user-copy span {
    color: #9fb2c3;
  }

  .sidebar-account > button {
    color: #f0d7cb;
    background: rgba(255, 255, 255, 0.055);
    border-color: rgba(255, 255, 255, 0.14);
  }

  .sidebar-account > button:hover {
    color: #fff;
    background: rgba(190, 73, 73, 0.24);
    border-color: rgba(239, 153, 153, 0.36);
  }

  .hero {
    min-height: 76px;
    color: var(--shell-navy);
    background:
      radial-gradient(circle at 92% -40%, rgba(216, 166, 42, 0.13), transparent 34%),
      #fff;
    border-bottom: 1px solid var(--shell-line);
    box-shadow: 0 4px 14px rgba(8, 29, 52, 0.05);
  }

  .app-shell > .hero {
    min-height: 76px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .hero-title {
    color: var(--shell-navy);
    font-size: 20px;
  }

  .hero-subtitle {
    margin-top: 5px;
    color: #697c8e;
    font-size: 10pt;
  }

  .brand-signature {
    display: none;
  }

  .context-navigation {
    min-height: 76px;
    background: rgba(247, 249, 251, 0.98);
    border-bottom-color: #dbe4eb;
    box-shadow: 0 4px 13px rgba(8, 29, 52, 0.045);
  }

  .context-navigation button {
    min-height: 56px;
    border-top: 3px solid var(--context-accent);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(8, 29, 52, 0.045);
  }

  .module-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
  }

  .module-card {
    min-height: 145px;
    padding: 17px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border: 1px solid #d9e2e9;
    border-top: 4px solid var(--module-accent);
    border-left-color: #d9e2e9;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 7px 20px rgba(8, 29, 52, 0.055);
  }

  .module-card:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(8, 29, 52, 0.1);
  }

  .module-card .module-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 10px;
  }

  .module-card .module-copy {
    margin-top: 12px;
    gap: 5px;
  }

  .module-card .module-copy strong,
  .module-card .module-copy span {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .module-card .module-copy strong {
    font-size: 10.5pt;
    line-height: 1.25;
  }

  .module-card .module-copy span {
    font-size: 8.5pt;
    line-height: 1.35;
  }

  .module-card small {
    margin-top: auto;
    align-self: flex-start;
  }

  .module-card.active {
    border-color: color-mix(in srgb, var(--module-accent) 42%, #d9e2e9);
    border-top-color: var(--module-accent);
    background:
      linear-gradient(145deg, #fff, color-mix(in srgb, var(--module-accent) 7%, #fff));
  }
}

@media (max-width: 900px) {
  .hero {
    color: var(--shell-navy);
    background: #fff;
    border-bottom: 2px solid var(--shell-gold);
  }

  .hero-title {
    color: var(--shell-navy);
  }

  .hero-subtitle {
    color: #6f786d;
  }

  .workspace-table-scroll th:first-child,
  .users-table th:first-child,
  .audit-table th:first-child,
  .repository-table th:first-child,
  .ops-table th:first-child,
  .module-table th:first-child {
    color: #425343;
    background: #e8ede3;
  }
}

/* hsports Olive v4: mantém o tema acima de todas as camadas legadas. */
.dashboard-welcome-copy,
.home-intro {
  background:
    radial-gradient(circle at 92% 12%, rgba(222, 200, 136, 0.25), transparent 34%),
    linear-gradient(125deg, #425343, #596b55 62%, #718269);
}

.dashboard-welcome-copy p,
.home-intro p {
  color: #e3e9df;
}

.dashboard-welcome-copy > span,
.dashboard-welcome-copy h1 b,
.dashboard-welcome-copy cite,
.home-eyebrow {
  color: #dec888;
}

.dashboard-welcome-copy blockquote {
  color: #fbf7ea;
  background: rgba(255, 255, 255, 0.1);
  border-left-color: #dec888;
}

.home-daily-agenda,
.pcp-daily-agenda {
  border-color: #d7ddd1;
  box-shadow: 0 7px 20px rgba(61, 77, 62, 0.06);
}

.home-daily-agenda > header,
.pcp-daily-agenda > header {
  background: linear-gradient(120deg, #425343, #667861);
}

.home-daily-agenda > header span,
.home-daily-agenda > header small,
.pcp-daily-agenda > header small {
  color: #e0e7dc;
}

.home-daily-agenda > header > div:first-child > span,
.pcp-daily-agenda > header span:first-child {
  color: #dec888;
}

.home-agenda-summary {
  background: #f7f8f4;
  border-bottom-color: #dfe4da;
}

.home-agenda-summary span {
  color: #596b55;
  background: #e9eee4;
}

.home-agenda-item > b,
.file-icon,
.user-list-avatar,
.user-avatar,
.process-step b.process-icon,
.repository-file-icon {
  background: linear-gradient(135deg, #667861, #829077);
  box-shadow: 0 5px 14px rgba(61, 77, 62, 0.14);
}

.process-icon.medal-flow {
  background: #789284;
}

.op-status-card.total { --status-accent: #63735f; }
.op-status-card.despachado { --status-accent: #788b77; }

.commercial-context-navigation button:nth-child(3),
.admin-context-navigation button:nth-child(2) {
  --context-accent: #789284;
  --context-soft: #eaf1ed;
}

.production-detail-product td {
  background: #edf1e8;
  border-top-color: #bfcbb8;
}

.production-detail-product td:first-child,
.production-detail-product td:last-child,
.proposal-print-totals p.grand {
  color: #425343;
}

.production-detail-component td:nth-child(2),
.proposal-print-items small,
.proposal-print > footer {
  color: #647063;
}

:root {
  --brand-navy-950: #354238;
  --brand-navy-900: #425343;
  --brand-navy-800: #526451;
  --brand-navy-700: #667861;
  --brand-blue-600: #7a8b6b;
  --brand-gold-500: #b79b5d;
  --brand-gold-300: #dec888;
  --brand-green-600: #657b58;
  --navy: #465747;
  --navy-light: #6a7b60;
  --gold: #b79b5d;
  --gold-pale: #f7f1df;
  --background: #f4f5f0;
  --text: #344137;
  --muted: #6f786d;
  --green: #657b58;
  --border: #d9ddd3;
  --blue-pale: #edf1e8;
  --surface-soft: #f7f8f4;
  --focus-ring: rgba(106, 123, 96, 0.24);
  --shell-navy: #3f4f41;
  --shell-navy-soft: #596b55;
  --shell-gold: #c0a56a;
  --shell-canvas: #f2f4ee;
  --shell-line: #d9ddd3;
  --shell-card-shadow: 0 10px 28px rgba(61, 77, 62, 0.08);
  --sidebar-olive-start: #60705f;
  --sidebar-olive-end: #7a8876;
}

body {
  background:
    radial-gradient(circle at 92% 2%, rgba(122, 139, 107, 0.1), transparent 24%),
    var(--shell-canvas);
}

.auth-gate {
  background:
    radial-gradient(circle at 88% 8%, rgba(122, 139, 107, 0.14), transparent 24%),
    linear-gradient(145deg, #edf1e9, #fafbf8 56%, #f0f3ec);
}

.auth-brand-panel {
  background:
    radial-gradient(circle at 80% 18%, rgba(222, 200, 136, 0.25), transparent 29%),
    radial-gradient(circle at 15% 88%, rgba(148, 164, 133, 0.22), transparent 30%),
    linear-gradient(145deg, #354238, #596b55);
  border-right-color: var(--shell-gold);
}

.auth-brand-panel p {
  color: #e0e7dc;
}

.auth-form-panel {
  background:
    radial-gradient(circle at 85% 12%, rgba(192, 165, 106, 0.13), transparent 28%),
    transparent;
}

.auth-form {
  border-color: #d8ded3;
  border-top-color: var(--shell-gold);
  box-shadow: 0 24px 64px rgba(53, 66, 56, 0.15);
}

.auth-form h1,
.auth-form h2,
.auth-form strong {
  color: var(--shell-navy);
}

.app-shell > main {
  background:
    radial-gradient(circle at 96% 0%, rgba(192, 165, 106, 0.1), transparent 22%),
    linear-gradient(180deg, #f6f7f3, #f1f3ed);
}

.workspace-heading,
.users-heading {
  background:
    radial-gradient(circle at 88% 15%, rgba(222, 200, 136, 0.2), transparent 27%),
    linear-gradient(118deg, #425343, #667861);
  border-left-color: var(--shell-gold);
  box-shadow: 0 14px 34px rgba(61, 77, 62, 0.13);
}

.records-card,
.workspace-form,
.users-list-card,
.user-form-card,
.audit-card,
.ops-list-panel,
.op-form-panel,
.repository-ops-panel,
.repository-files-panel,
.file-card,
.table-card,
.detail-card,
.repository-config-card {
  border-color: var(--shell-line);
  border-top-color: var(--brand-blue-600);
  box-shadow: var(--shell-card-shadow);
}

.workspace-form,
.user-form-card,
.op-form-panel,
.repository-files-panel {
  border-top-color: var(--shell-gold);
}

.proposal-history-filters,
.controls,
.ops-filter-bar,
.repository-search,
.commercial-op-history-filters {
  background: #edf1e8;
  border-color: #d7ddd1;
}

.workspace-form input,
.workspace-form select,
.workspace-form textarea,
.form-grid input,
.form-grid select,
.user-form-card .form-grid input,
.user-form-card .form-grid select,
.repository-config-card input,
.repository-search input,
.repository-upload-panel input,
.repository-upload-panel select,
.edit-row input,
.workflow-status-group select,
.confirmation-dialog input,
.proposal-history-filters input,
.proposal-history-filters select,
.controls input,
.controls select,
.ops-search input,
.search-box input {
  color: var(--text);
  background: #fbfcf9;
  border-color: #cbd3c6;
}

.workspace-form input:focus,
.workspace-form select:focus,
.workspace-form textarea:focus,
.form-grid input:focus,
.form-grid select:focus,
.repository-search input:focus,
.proposal-history-filters input:focus,
.proposal-history-filters select:focus,
.controls input:focus,
.controls select:focus,
.ops-search input:focus,
.search-box input:focus {
  border-color: var(--brand-blue-600);
  box-shadow: 0 0 0 3px rgba(122, 139, 107, 0.18);
}

.workspace-table-scroll th,
.users-table th,
.audit-table th,
.ops-table th,
.table-scroll > table th,
.grouped-table th,
.repository-table th {
  color: #4b5a4b;
  background: #e8ede3;
  border-right-color: #d5dcd0;
  border-bottom-color: #c9d2c3;
}

.workspace-table-scroll tbody tr:nth-child(even) td,
.users-table tbody tr:nth-child(even) td,
.audit-table tbody tr:nth-child(even) td,
.repository-table tbody tr:nth-child(even) td {
  background: #fafbf8;
}

.workspace-table-scroll tbody tr:hover td,
.users-table tbody tr:hover td,
.ops-table tbody tr:hover td,
.table-scroll > table tbody tr:hover td,
.repository-table tbody tr:hover td {
  background: #f0f3ec;
}

.ops-table tbody tr.selected td {
  background: #e8eee2;
  box-shadow: inset 0 1px 0 rgba(82, 100, 81, 0.08);
}

.button,
.button.secondary {
  background: linear-gradient(135deg, #526451, #72836a);
  box-shadow: 0 5px 13px rgba(61, 77, 62, 0.14);
}

.form-clear,
.button.tertiary,
.confirmation-cancel {
  color: #465747;
  border-color: #ccd4c7;
}

.table-action,
.repository-open,
.pcp-agenda-open {
  color: #526451;
  background: #edf1e8;
  border-color: #d4dbce;
}

.ops-filter.active,
.filter-button.active,
.mobile-ops-nav button.active,
.dashboard-period-filter button.active {
  color: #fff;
  background: var(--navy-light);
  border-color: var(--navy-light);
}

.context-navigation {
  background: rgba(247, 249, 245, 0.98);
  border-bottom-color: #dbe1d5;
  box-shadow: 0 4px 13px rgba(61, 77, 62, 0.045);
}

.context-navigation button.active {
  color: #fff;
  background: linear-gradient(145deg, #596b55, #718269);
  border-color: #718269;
}

.module-card { --module-accent: #7a8b6b; }
.module-card.planning { --module-accent: #718267; }
.module-card.medal { --module-accent: #789284; }
.module-card.trophy { --module-accent: #a18b61; }
.module-card.assembly { --module-accent: #66806d; }
.module-card.shipping { --module-accent: #9a7c64; }
.module-card.repository { --module-accent: #7e758d; }
.module-card.administration { --module-accent: #88738c; }

.document-preview-overlay {
  background: rgba(53, 66, 56, 0.84);
}

.document-preview-toolbar {
  background: #425343;
  border-bottom-color: var(--shell-gold);
}

.proposal-print {
  color: #344137;
}

.proposal-print-header h1,
.proposal-print-parties strong,
.proposal-print-conditions h2 {
  color: #425343;
}

.proposal-print-items th {
  background: #526451;
}

.proposal-print-parties > div {
  background: #f7f8f4;
  border-color: #dce2d7;
}

/* Mantém Visualizar e Imprimir sempre disponíveis na Entrada de OPs. */
.ops-table {
  min-width: 1120px;
  table-layout: auto;
}

.ops-table th:not(.ops-actions-column) {
  width: auto;
}

.ops-table th:nth-child(6) {
  min-width: 210px;
}

.ops-table .ops-actions-column,
.ops-table .ops-actions-cell {
  position: sticky;
  right: 0;
  width: 190px;
  min-width: 190px;
  box-shadow: -8px 0 14px rgba(61, 77, 62, 0.08);
}

.ops-table .ops-actions-column {
  z-index: 6;
  color: #425343;
  background: #e3e9de;
}

.ops-table .ops-actions-cell {
  z-index: 2;
  background: #fff;
}

.ops-table tbody tr:nth-child(even) .ops-actions-cell {
  background: #fafbf8;
}

.ops-table tbody tr:hover .ops-actions-cell {
  background: #f0f3ec;
}

.ops-table tbody tr.selected .ops-actions-cell {
  background: #e8eee2;
}

/* Mantém textos comerciais e fiscais contidos na própria célula. */
.workspace-table-scroll table.bounded-data-table {
  min-width: 820px;
  table-layout: auto;
}

.workspace-table-scroll table.bounded-data-table.wide {
  min-width: 1100px;
}

.workspace-table-scroll table.bounded-data-table th,
.workspace-table-scroll table.bounded-data-table td,
.workspace-table-scroll table.bounded-data-table td strong,
.workspace-table-scroll table.bounded-data-table td small,
.workspace-table-scroll table.bounded-data-table td span {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.workspace-table-scroll table.bounded-data-table td {
  min-width: 0;
  max-width: 300px;
  overflow: hidden;
}

.proposal-items-table table.bounded-data-table td:nth-child(2) {
  min-width: 280px;
  max-width: 460px;
}

.workspace-table-scroll table.bounded-data-table .table-action-group {
  min-width: 0;
  max-width: 100%;
}

.workspace-table-scroll table.bounded-data-table .table-action,
.workspace-table-scroll table.bounded-data-table .status-pill {
  max-width: 100%;
  height: auto;
  text-align: center;
  white-space: normal;
}

/* Alinhamento único para todas as tabelas operacionais do sistema. */
.app-shell table th,
.app-shell table td {
  vertical-align: middle;
  text-align: center;
}

.app-shell table td strong,
.app-shell table td small,
.app-shell table td span {
  text-align: center;
}

.app-shell .table-action-group,
.app-shell .repository-actions,
.app-shell .user-name-with-icon {
  justify-content: center;
}

.ops-actions-cell .table-action-group {
  justify-content: center;
  flex-wrap: wrap;
}

/* Status das OPs: preserva contexto, separa os grupos e dá leitura aos textos longos. */
.app-shell .module-table-status thead th {
  color: #fff;
  text-shadow: 0 1px 1px rgba(31, 42, 32, 0.3);
}

.app-shell .module-table-status td.status-text-cell {
  text-align: justify;
  text-justify: inter-word;
}

@media (min-width: 901px) {
  .module-table-status .status-core-col {
    position: sticky;
    z-index: 3;
  }

  .module-table-status th.status-core-col {
    top: 0;
    z-index: 8;
  }

  .module-table-status .status-op-col {
    left: 0;
  }

  .module-table-status .status-order-col {
    left: 84px;
  }

  .module-table-status .status-dispatch-col {
    left: 192px;
  }

  .module-table-status .status-priority-col {
    left: 308px;
    box-shadow: 8px 0 14px rgba(61, 77, 62, 0.1);
  }
}

@media (min-width: 901px) {
  .app-sidebar {
    background:
      radial-gradient(circle at 55% 0%, rgba(222, 200, 136, 0.16), transparent 28%),
      linear-gradient(
        180deg,
        var(--sidebar-olive-start),
        var(--sidebar-olive-end)
      );
    border-right-color: var(--shell-gold);
    box-shadow: 10px 0 30px rgba(53, 66, 56, 0.11);
  }

  .sidebar-brand span,
  .sidebar-nav-item small,
  .sidebar-nav-item.active small,
  .sidebar-user-copy span {
    color: #e2e7df;
  }

  .sidebar-nav-item,
  .sidebar-nav-item[data-sidebar-area] {
    color: #edf1ea;
  }

  .sidebar-nav-item > svg,
  .sidebar-nav-item[data-sidebar-area] > svg {
    color: #dec888;
    background: rgba(222, 200, 136, 0.11);
    border-color: rgba(222, 200, 136, 0.28);
  }

  .sidebar-nav-item:hover:not(:disabled),
  .sidebar-nav-item:focus-visible,
  .sidebar-nav-item.active,
  .sidebar-nav-item[data-sidebar-area].active {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(222, 200, 136, 0.42);
    box-shadow: inset 4px 0 var(--shell-gold);
  }

  .sidebar-nav-item.active > svg,
  .sidebar-user-copy .user-avatar {
    color: #3f4f41;
    background: var(--shell-gold);
    border-color: var(--shell-gold);
  }

  .hero {
    color: var(--shell-navy);
    background:
      radial-gradient(circle at 92% -40%, rgba(192, 165, 106, 0.14), transparent 34%),
      #fff;
    border-bottom-color: var(--shell-line);
    box-shadow: 0 4px 14px rgba(61, 77, 62, 0.05);
  }

  .hero-subtitle {
    color: #6f786d;
  }

  .module-card {
    border-color: #d9dfd3;
    border-top-color: var(--module-accent);
    box-shadow: 0 7px 20px rgba(61, 77, 62, 0.055);
  }

  .module-card:hover:not(:disabled) {
    box-shadow: 0 14px 28px rgba(61, 77, 62, 0.1);
  }
}

@media (max-width: 900px) {
  .hero {
    color: var(--shell-navy);
    border-bottom-color: var(--shell-gold);
  }

  .hero-title {
    color: var(--shell-navy);
  }

  .hero-subtitle {
    color: #6f786d;
  }

  .workspace-table-scroll th:first-child,
  .users-table th:first-child,
  .audit-table th:first-child,
  .repository-table th:first-child,
  .ops-table th:first-child,
  .module-table th:first-child {
    color: #425343;
    background: #e8ede3;
  }

  .ops-table {
    min-width: 1040px;
  }

  .ops-table .ops-actions-column,
  .ops-table .ops-actions-cell {
    width: 156px;
    min-width: 156px;
  }

  .ops-actions-cell .table-action {
    width: 100%;
    min-height: 44px;
  }
}

@media (max-width: 600px) {
  .freight-summary-grid,
  .billing-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .freight-summary-grid .summary-card,
  .billing-summary-grid .summary-card {
    min-height: 72px;
  }
}

@media (min-width: 901px) {
  .module-table-status .status-dispatch-col,
  .module-table-status .status-priority-col {
    position: static;
    left: auto;
    box-shadow: none;
  }
}
