/* ═══════════════════════════════════════════════════════════════════════════
   Legal Embalagens — Extranet Corporativa — Design System
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #1a3a6b;
  --primary-light: #2a5298;
  --primary-dark: #0f2347;
  --accent: #27ae60;
  --accent-light: #2ecc71;
  --bg-gradient-start: #e8f0fe;
  --bg-gradient-end: #f5f7fa;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --danger: #e74c3c;
  --danger-light: #fdeaea;
  --success-bg: #eafaf1;
  --warning: #f39c12;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(26,58,107,0.08);
  --shadow-lg: 0 8px 32px rgba(26,58,107,0.12);
  --transition: all 0.25s ease;
  --sidebar-width: 260px;
  --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
  color: var(--gray-800);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── App Shell ─────────────────────────────────────────────────────────── */
.app-shell {
  min-height: 100vh;
}

.app-shell.login-mode .sidebar {
  display: none;
}

.app-shell.login-mode .content-area {
  margin-left: 0;
}

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.sidebar {
  background: linear-gradient(180deg, var(--primary-dark), var(--primary));
  color: var(--white);
  padding: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 28px 20px 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand .logo-home-btn {
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
}

.logo-home-btn:focus-visible {
  outline: 2px solid rgba(99, 179, 237, 0.9);
  outline-offset: 4px;
}

.logo-container {
  width: 140px;
  height: 56px;
  background: var(--white);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  padding: 6px 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  overflow: hidden;
}

.sidebar-brand h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}

.sidebar-brand .subtitle {
  font-size: 0.75rem;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.sidebar-nav .nav-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.5;
  padding: 8px 12px 4px;
  margin-top: 8px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  font-family: var(--font-family);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.nav-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--white);
}

.nav-btn.active {
  background: rgba(255,255,255,0.18);
  color: var(--white);
  font-weight: 600;
}

.nav-btn.disabled,
.nav-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.35);
}

.nav-btn.disabled:hover,
.nav-btn:disabled:hover {
  background: transparent;
  color: rgba(255,255,255,0.8);
  transform: none;
  box-shadow: none;
}

.nav-btn .nav-icon {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.quality-shield-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.quality-shield-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.72rem;
  text-align: center;
}

.sidebar-profile-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.sidebar-profile-btn:hover {
  background: rgba(255,255,255,0.16);
}

.sidebar-copy {
  opacity: 0.5;
}

/* ── Content Area ──────────────────────────────────────────────────────── */
.content-area {
  margin-left: var(--sidebar-width);
  padding: 32px;
  min-height: 100vh;
}

/* ── Login ──────────────────────────────────────────────────────────────── */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-home-wrapper {
  flex-direction: column;
  gap: 18px;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-card .login-logo {
  width: 220px;
  height: 80px;
  background: #ffffff;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  padding: 8px 16px;
  box-shadow: 0 4px 16px rgba(26,58,107,0.15);
  border: 1px solid #e8eef8;
  overflow: hidden;
}

.login-denuncia-link {
  margin-top: 20px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #fff8f0, #fff3e0);
  border: 1px solid #ffd699;
  border-radius: 10px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
}

.login-denuncia-link span {
  font-size: 1rem;
}

.login-denuncia-link a {
  color: #b45309;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.15s;
}

.login-denuncia-link a:hover {
  color: #92400e;
  text-decoration: underline;
}

/* Bloco de acesso ao Portal do Fornecedor na tela de login */
.login-fornecedor-link {
  margin-top: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f0f4ff, #e8eeff);
  border: 1px solid #b0c4ff;
  border-radius: 10px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
}

.login-fornecedor-link span {
  font-size: 1rem;
}

.login-fornecedor-link a {
  color: #1a3a8f;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.15s;
}

.login-fornecedor-link a:hover {
  color: #0f2460;
  text-decoration: underline;
}

.login-card h2 {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 4px;
}

.login-card .login-subtitle {
  color: var(--gray-500);
  font-size: 0.88rem;
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 18px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-family: var(--font-family);
  color: var(--gray-800);
  background: var(--gray-50);
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(42,82,152,0.12);
  background: var(--white);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--white);
  box-shadow: 0 2px 8px rgba(26,58,107,0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(26,58,107,0.3);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}

.btn-secondary:hover {
  background: var(--gray-200);
}

.btn-success {
  background: var(--accent);
  color: var(--white);
}

.btn-success:hover {
  background: var(--accent-light);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-danger:hover {
  opacity: 0.9;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.82rem;
}

.btn-block {
  width: 100%;
}

/* ── Feedback ──────────────────────────────────────────────────────────── */
.feedback {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-top: 12px;
  display: none;
  font-weight: 500;
}

.feedback.show {
  display: block;
}

.feedback.success {
  background: var(--success-bg);
  color: #1a7a42;
  border: 1px solid #b7ebd0;
}

.feedback.error {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #f5c6c6;
}

/* ── Portal Header ─────────────────────────────────────────────────────── */
.portal-header {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 28px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.portal-header-left h2 {
  font-size: 1.4rem;
  color: var(--primary);
  margin-bottom: 2px;
}

.portal-header-left .header-sub {
  color: var(--gray-500);
  font-size: 0.85rem;
}

.portal-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-secure {
  background: var(--success-bg);
  color: #1a7a42;
}

.badge-gestor {
  background: #e8eeff;
  color: #1a3a8f;
  border: 1px solid #b0c4ff;
}

.badge-release {
  background: var(--gray-100);
  color: var(--gray-500);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--gray-100);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-700);
}

.user-label-btn {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.user-label-btn:hover {
  color: var(--primary);
}

.user-chip .user-avatar {
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
}

.btn-logout {
  padding: 8px 16px;
  background: transparent;
  border: 1.5px solid var(--gray-200);
  color: var(--gray-600);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font-family);
  cursor: pointer;
  transition: var(--transition);
}

.btn-logout:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-light);
}

/* ── Dashboard Cards ───────────────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.dash-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.dash-card[role="button"] {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.dash-card[role="button"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.10);
}

.dash-card[role="button"]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.dash-card .dash-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.dash-icon.status { background: #eafaf1; color: #27ae60; }
.dash-icon.depts { background: #e8f0fe; color: #1a3a6b; }
.dash-icon.channel { background: #fef9e7; color: #f39c12; }

.dash-card .dash-info h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  margin-bottom: 2px;
}

.dash-card .dash-info p {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-800);
}

/* ── Department Selector ───────────────────────────────────────────────── */
.dept-selector {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-bottom: 28px;
}

.dept-selector h3 {
  font-size: 1.15rem;
  color: var(--primary);
  margin-bottom: 20px;
}

.dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.dept-card {
  padding: 20px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--white);
}

.dept-card:hover {
  border-color: var(--primary-light);
  box-shadow: 0 4px 16px rgba(26,58,107,0.1);
  transform: translateY(-2px);
}

.dept-card .dept-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.nav-icon.quality-shield-icon {
  width: 24px;
  height: 24px;
}

.dept-icon.quality-shield-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 8px;
}

.dept-card h4 {
  font-size: 0.95rem;
  color: var(--gray-800);
}

.dept-card.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}


.nav-icon-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-icon-svg img {
  width: 20px;
  height: 20px;
  color: currentColor;
}

.dept-icon-svg {
  display: flex;
  align-items: center;
  justify-content: center;
}

.dept-icon-svg img {
  width: 40px;
  height: 40px;
  color: #0f766e;
}

.quality-icon-picker {
  margin-top: 22px;
  border-top: 1px solid var(--gray-100);
  padding-top: 18px;
}

.quality-icon-picker-header h4 {
  margin-bottom: 4px;
  color: var(--primary);
  font-size: 0.98rem;
}

.quality-icon-picker-header p {
  margin-bottom: 14px;
  font-size: 0.84rem;
  color: var(--gray-500);
}

.quality-icon-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}


.quality-icon-picker-subtitle {
  margin: 12px 0 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--gray-200);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quality-icon-options-colored {
  margin-top: 4px;
}

.quality-icon-option {
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #0f766e;
  transition: var(--transition);
}

.quality-icon-option img {
  width: 34px;
  height: 34px;
}

.quality-icon-option span {
  color: var(--gray-700);
  font-size: 0.77rem;
  font-weight: 600;
  text-align: center;
}

.quality-icon-option:hover {
  border-color: var(--primary-light);
  transform: translateY(-1px);
}

.quality-icon-option.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(42, 82, 152, 0.12);
}

/* ── Section Cards ─────────────────────────────────────────────────────── */
.section-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px;
  margin-bottom: 24px;
}

.section-card h3 {
  font-size: 1.2rem;
  color: var(--primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--gray-100);
}

.section-card .section-back {
  margin-bottom: 16px;
}

/* ── Quality Sub-tabs ──────────────────────────────────────────────────── */
.quality-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.quality-tab-btn {
  padding: 10px 20px;
  border: 2px solid var(--gray-200);
  background: var(--white);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  font-family: var(--font-family);
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
}

.quality-tab-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.quality-tab-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* ── Lotes Dinâmicos ───────────────────────────────────────────────────── */
.lotes-container {
  margin-bottom: 16px;
}

.lote-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.lote-row input {
  flex: 1;
}

.lote-row .btn-remove-lote {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--danger-light);
  color: var(--danger);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.lote-row .btn-remove-lote:hover {
  background: var(--danger);
  color: var(--white);
}

.btn-add-lote {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1.5px dashed var(--gray-300);
  background: transparent;
  color: var(--gray-500);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: var(--font-family);
  cursor: pointer;
  transition: var(--transition);
}

.btn-add-lote:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

/* ── File Upload ───────────────────────────────────────────────────────── */
.file-upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--gray-50);
}

.file-upload-area:hover {
  border-color: var(--primary-light);
  background: var(--bg-gradient-start);
}

.file-upload-area input[type="file"] {
  display: none;
}

.file-upload-area .upload-text {
  color: var(--gray-500);
  font-size: 0.88rem;
}

.file-upload-area .upload-icon {
  font-size: 2rem;
  color: var(--gray-300);
  margin-bottom: 8px;
}

.file-list {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--gray-600);
}

/* ── Tables ────────────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table thead th {
  background: var(--gray-50);
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--gray-600);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--gray-200);
}

.data-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}

.data-table tbody tr:hover {
  background: var(--gray-50);
}

/* ── Permissions Checkboxes ────────────────────────────────────────────── */
.permissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.perm-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.85rem;
}

.perm-checkbox:hover {
  border-color: var(--primary-light);
}

.perm-checkbox input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

/* ── Inline Permissions Editor ─────────────────────────────────────────── */
.inline-perms {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.inline-perms label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  padding: 3px 8px;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  cursor: pointer;
}

.inline-perms label:hover {
  border-color: var(--primary-light);
}

/* ── Últimos Registros ─────────────────────────────────────────────────── */
.records-section {
  margin-top: 28px;
}

.mini-dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.mini-dept-card {
  border: 2px solid var(--gray-200);
  border-radius: 14px;
  background: var(--white);
  min-height: 124px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-family);
  color: var(--gray-800);
  font-size: 0.84rem;
  font-weight: 600;
  text-align: center;
}

.mini-dept-card:hover {
  border-color: var(--primary-light);
  box-shadow: 0 4px 16px rgba(26,58,107,0.1);
  transform: translateY(-2px);
}

.mini-dept-card.disabled,
.mini-dept-card:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
  transform: none;
  filter: grayscale(0.25);
}

.mini-dept-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  font-size: 1.5rem;
}

/* ── Placeholder sections ──────────────────────────────────────────────── */
.placeholder-section {
  text-align: center;
  padding: 48px 24px;
}

.placeholder-section .placeholder-icon {
  font-size: 3rem;
  color: var(--gray-300);
  margin-bottom: 16px;
}

.placeholder-section p {
  color: var(--gray-500);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

/* ── Hidden utility ────────────────────────────────────────────────────── */
.hidden {
  display: none !important;
}

.copy-link-box {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid #d6e0ef;
  border-radius: 8px;
  background: #f7faff;
  word-break: break-all;
}

.section-divider {
  height: 1px;
  background: #e8edf5;
  margin: 20px 0;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.kpi-card {
  background: #f7f9fc;
  border: 1px solid #dfe7f4;
  border-radius: 10px;
  padding: 10px;
}

.kpi-label {
  font-size: 12px;
  color: #5f6f89;
}

.kpi-value {
  font-size: 20px;
  font-weight: 700;
  color: #1f3b64;
}

#comercialSection-satisfacao {
  margin-top: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #d9e3f3;
  background: linear-gradient(180deg, #f9fbff 0%, #f3f7ff 100%);
}

#comercialSection-satisfacao .section-description {
  margin-bottom: 12px;
  color: #36507d;
  font-weight: 500;
}

#comercialSection-satisfacao .form-group label {
  color: #2a4572;
  font-weight: 600;
}

#comercialSection-satisfacao .form-group input,
#comercialSection-satisfacao .form-group textarea {
  border: 1px solid #cfdbf2;
  border-radius: 10px;
}

#comercialSection-satisfacao .form-group input:focus,
#comercialSection-satisfacao .form-group textarea:focus {
  border-color: #2b63b3;
  box-shadow: 0 0 0 3px rgba(43, 99, 179, 0.15);
}

#comercialSection-satisfacao .users-table {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(23, 51, 99, 0.08);
}

#comercialSection-satisfacao .users-table thead th {
  background: #1d4d9b;
  color: #fff;
  border-bottom: none;
}

/* ── Mobile hamburger ──────────────────────────────────────────────────── */
.mobile-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: none;
  background: var(--primary);
  color: var(--white);
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  align-items: center;
  justify-content: center;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .app-shell .content-area {
    margin-left: 0;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .content-area {
    margin-left: 0;
    padding: 24px 16px;
    padding-top: 64px;
  }

  .mobile-toggle {
    display: flex;
  }

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

@media (max-width: 640px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dept-grid {
    grid-template-columns: 1fr 1fr;
  }

  .quality-tabs {
    flex-direction: column;
  }

  .section-card {
    padding: 20px 16px;
  }

  .login-card {
    padding: 32px 24px;
  }

  .portal-header-right {
    flex-wrap: wrap;
  }
}

/* ── Animations ────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

/* ── Scrollbar ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* ── Overlay for mobile sidebar ────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

.sidebar-overlay.show {
  display: block;
}

/* ═══════════════════════════════════════════════════════════════════════════
   REPORTS & PERMISSIONS — v2 Additions
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Section Description ──────────────────────────────────────────────────── */
.section-desc {
  color: var(--gray-500);
  font-size: 0.9rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ── Reports Filter ───────────────────────────────────────────────────────── */
.reports-filter {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 14px 18px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
}

.reports-filter-advanced {
  flex-wrap: wrap;
  align-items: flex-end;
}

.reports-filter-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.reports-filter-search {
  flex: 1 1 280px;
}

.reports-filter label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-600);
  white-space: nowrap;
}

.reports-filter select {
  padding: 8px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: var(--font-family);
  color: var(--gray-700);
  background: var(--white);
  min-width: 200px;
  cursor: pointer;
}

.reports-filter input[type="search"] {
  padding: 8px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: var(--font-family);
  color: var(--gray-700);
  background: var(--white);
  width: 100%;
}

.reports-filter select:focus,
.reports-filter input[type="search"]:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(42,82,152,0.12);
}

/* ── Reports Container ────────────────────────────────────────────────────── */
.reports-container {
  min-height: 100px;
}

.reports-toolbar-summary {
  margin-bottom: 14px;
  font-size: 0.9rem;
  color: var(--gray-600);
}

.reports-loading {
  text-align: center;
  color: var(--gray-400);
  padding: 32px;
  font-size: 0.92rem;
}

.reports-empty {
  text-align: center;
  color: var(--gray-400);
  padding: 48px 24px;
  font-size: 0.95rem;
}

/* ── Report Group ─────────────────────────────────────────────────────────── */
.report-group {
  margin-bottom: 28px;
}

.report-group-title {
  font-size: 1.05rem;
  color: var(--primary);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--bg-gradient-start);
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-count {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--gray-400);
}

/* ── Reports List ─────────────────────────────────────────────────────────── */
.reports-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reports-list-head,
.report-row-summary {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.1fr 1.1fr 1fr 1fr 1.6fr 0.8fr;
  gap: 12px;
  align-items: center;
}

.reports-list-head {
  padding: 0 16px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-400);
}

.report-row {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  overflow: hidden;
}

.report-row:hover {
  border-color: var(--primary-light);
  box-shadow: 0 2px 12px rgba(26,58,107,0.06);
}

.report-row[open] {
  border-color: var(--primary-light);
}

.report-row summary {
  list-style: none;
}

.report-row summary::-webkit-details-marker {
  display: none;
}

.report-row-summary {
  padding: 16px;
  cursor: pointer;
}

.report-cell {
  min-width: 0;
  font-size: 0.88rem;
  color: var(--gray-700);
}

.report-cell-title {
  font-weight: 700;
  color: var(--gray-800);
}

.report-cell-actions {
  display: flex;
  justify-content: flex-end;
}

.report-action-link {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--primary);
}

.report-row-details {
  padding: 0 16px 16px;
  border-top: 1px solid var(--gray-200);
  background: var(--white);
}

.report-row-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 16px;
  padding-top: 16px;
}

.report-detail-item {
  font-size: 0.88rem;
  color: var(--gray-600);
  line-height: 1.5;
}

.report-detail-item strong {
  color: var(--gray-700);
}

.report-row-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 10px;
}

.report-id {
  font-size: 0.75rem;
  color: var(--gray-400);
  font-family: monospace;
}

.evidence-link {
  display: inline-block;
  margin: 4px 8px 0 0;
  padding: 2px 8px;
  background: var(--bg-gradient-start);
  color: var(--primary);
  border-radius: 4px;
  font-size: 0.78rem;
  text-decoration: none;
  margin-right: 4px;
  margin-bottom: 4px;
}

.evidence-link:hover {
  background: var(--primary);
  color: var(--white);
}

.report-evidence-links {
  display: inline-flex;
  flex-wrap: wrap;
}

@media (max-width: 1100px) {
  .reports-list-head {
    display: none;
  }

  .report-row-summary {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .report-cell-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .reports-filter-item,
  .reports-filter-search {
    min-width: 100%;
  }

  .report-row-details {
    padding: 0 12px 12px;
  }

  .report-row-summary {
    padding: 12px;
  }
}

/* ── Permission Badges ────────────────────────────────────────────────────── */
.perm-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-right: 4px;
  margin-bottom: 2px;
}

.perm-qualidade {
  background: #eafaf1;
  color: #1a7a42;
}

.perm-producao {
  background: #fff4e5;
  color: #b05c00;
}

.perm-comercial {
  background: #e8f0fe;
  color: #1a3a6b;
}

.perm-financeiro {
  background: #fef9e7;
  color: #b7791f;
}

.perm-rh {
  background: #fdeaea;
  color: #c0392b;
}

.perm-all {
  background: var(--primary);
  color: var(--white);
}

/* ── Responsive adjustments for reports ───────────────────────────────────── */
@media (max-width: 640px) {
  .reports-filter {
    flex-direction: column;
    align-items: flex-start;
  }

  .reports-filter select {
    width: 100%;
    min-width: unset;
  }

  .report-card-header {
    flex-direction: column;
  }

  .report-card-footer {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
}

/* ── Admin Tabs ──────────────────────────────────────────────────────── */
.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 24px;
}

.admin-tab-btn {
  padding: 10px 24px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--gray-500);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-tab-btn:hover {
  color: var(--primary);
  background: var(--gray-50);
}

.admin-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.admin-tab-content.hidden {
  display: none;
}

.users-summary-layout {
  display: grid;
  grid-template-columns: minmax(280px, 320px) 1fr;
  gap: 16px;
}

.users-summary-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.users-summary-toolbar input,
.users-summary-toolbar select {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 8px 10px;
}

.users-summary-toolbar input {
  min-width: 280px;
}

.users-summary-list-card,
.users-summary-detail-card {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: var(--white);
  padding: 16px;
}

.users-summary-list {
  margin-top: 12px;
  max-height: 70vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.users-summary-list-item {
  text-align: left;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
  cursor: pointer;
}

.users-summary-list-item.active {
  border-color: var(--primary);
  background: rgba(26, 58, 107, 0.08);
}

.users-summary-detail-empty {
  color: var(--gray-500);
  font-style: italic;
}

/* ── Email Config Section ────────────────────────────────────────────── */
.quality-scope-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}

.inline-perms-grid,
.inline-quality-unit-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.inline-quality-units {
  margin: 10px 0;
  padding: 10px;
  background: rgba(26, 58, 107, 0.04);
  border: 1px solid rgba(26, 58, 107, 0.12);
  border-radius: 8px;
  font-size: 0.85rem;
}

.quality-email-grid {
  display: grid;
  gap: 16px;
}

.quality-email-unit-card {
  border: 1px solid var(--gray-100);
  border-radius: 10px;
  padding: 16px;
  background: #fff;
}

.quality-email-unit-card h5 {
  margin-bottom: 12px;
  color: var(--primary);
}

.email-section {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.email-section-title {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 12px;
  font-weight: 700;
}

.email-section-hint {
  font-size: 0.8rem;
  color: var(--gray-400);
  font-weight: 400;
}

.email-list {
  margin-bottom: 12px;
}

.email-empty {
  color: var(--gray-400);
  font-size: 0.88rem;
  font-style: italic;
  padding: 8px 0;
}

.email-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.email-row.email-inactive {
  opacity: 0.55;
  background: var(--gray-100);
}

.email-row-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.email-address {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--gray-800);
}

.email-desc {
  font-size: 0.82rem;
  color: var(--gray-400);
}

.email-status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 10px;
}

.email-status-badge.email-active {
  background: #d4edda;
  color: #155724;
}

.email-status-badge.email-inactive {
  background: #f8d7da;
  color: #721c24;
}

.email-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.email-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.email-add-input {
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 0.9rem;
  flex: 1;
  min-width: 180px;
}

.email-add-input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(26, 58, 107, 0.1);
}

.email-add-desc {
  max-width: 220px;
}

.btn-warning {
  background: #f39c12;
  color: var(--white);
  border: none;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-warning:hover {
  background: #e67e22;
}

/* ═══ DESENVOLVIMENTO MODULE ═══════════════════════════════════════════════ */

/* Dashboard Grid */
.dev-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.dev-stat-card {
  background: white;
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.dev-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.dev-stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.dev-stat-label {
  font-size: 0.85rem;
  color: var(--gray-400);
  margin-top: 4px;
}

/* Alert Cards */
.dev-alerts-section {
  margin-top: 24px;
  grid-column: 1 / -1;
}

.dev-alerts-section h4 {
  color: var(--danger);
  margin-bottom: 12px;
}

.dev-alert-card {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dev-alert-card.expired {
  background: #f8d7da;
  border-color: #dc3545;
}

.dev-alert-card .alert-info {
  flex: 1;
}

.dev-alert-card .alert-info strong {
  display: block;
  margin-bottom: 2px;
}

.dev-alert-card .alert-info small {
  color: var(--gray-400);
}

.dev-alert-card .alert-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.dev-alert-card .alert-badge.warning {
  background: #ffc107;
  color: #856404;
}

.dev-alert-card .alert-badge.danger {
  background: #dc3545;
  color: white;
}

/* Tipo Selector */
.dev-tipo-selector {
  margin-bottom: 24px;
}

.dev-tipo-selector h4 {
  margin-bottom: 12px;
  color: var(--primary);
}

.dev-tipo-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.dev-tipo-btn {
  padding: 10px 20px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  font-family: var(--font-family);
}

.dev-tipo-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.dev-tipo-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Ficha Form */
.ficha-form-section {
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.ficha-form-section h4 {
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-light);
}

.ficha-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.ficha-form-grid .form-group {
  margin-bottom: 0;
}

.ficha-form-grid .form-group.full-width {
  grid-column: 1 / -1;
}

/* Ficha Page Tabs */
.ficha-page-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.ficha-page-tab {
  padding: 8px 16px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  font-family: var(--font-family);
  position: relative;
}

.ficha-page-tab:hover {
  border-color: var(--primary);
}

.ficha-page-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.ficha-page-tab.completed {
  border-color: #28a745;
}

.ficha-page-tab.completed::after {
  content: '\2713';
  position: absolute;
  top: -6px;
  right: -6px;
  background: #28a745;
  color: white;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ficha Cards */
.dev-fichas-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.dev-fichas-filters select {
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 0.9rem;
  min-width: 180px;
  font-family: var(--font-family);
}

.ficha-card {
  background: white;
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.ficha-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ficha-card-info h4 {
  margin-bottom: 4px;
  color: var(--primary-dark);
}

.ficha-card-info .ficha-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--gray-400);
  margin-top: 4px;
}

.ficha-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Status Badges */
.status-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge.rascunho { background: #e2e3e5; color: #383d41; }
.status-badge.em-desenvolvimento { background: #cce5ff; color: #004085; }
.status-badge.em-analise { background: #fff3cd; color: #856404; }
.status-badge.em-testes { background: #d4edda; color: #155724; }
.status-badge.aprovado { background: #28a745; color: white; }
.status-badge.reprovado { background: #dc3545; color: white; }
.status-badge.arquivado { background: #6c757d; color: white; }

/* Search Bar */
.dev-search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.dev-search-bar input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: var(--font-family);
}

/* Ficha Detail */
.dev-ficha-detail-content {
  margin-top: 16px;
}

.ficha-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.ficha-detail-header h3 {
  color: var(--primary);
}

.ficha-detail-header .detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ficha-detail-section {
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.ficha-detail-section h4 {
  color: var(--primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
}

.ficha-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.ficha-detail-field {
  padding: 8px 0;
}

.ficha-detail-field .field-label {
  font-size: 0.8rem;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.ficha-detail-field .field-value {
  font-size: 0.95rem;
  color: var(--gray-600);
  font-weight: 500;
}

/* History Timeline */
.ficha-history {
  margin-top: 16px;
}

.history-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}

.history-item:last-child {
  border-bottom: none;
}

.history-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 4px;
  flex-shrink: 0;
}

.history-content {
  flex: 1;
}

.history-content .history-action {
  font-weight: 500;
  color: var(--gray-600);
}

.history-content .history-date {
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-top: 2px;
}

/* Ficha Form Buttons */
.ficha-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn-draft {
  background: #6c757d;
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-family: var(--font-family);
  font-size: 0.92rem;
  transition: background 0.2s;
}

.btn-draft:hover {
  background: #5a6268;
}

/* Document Cards */
.doc-card {
  background: white;
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.doc-card .doc-info h4 {
  margin-bottom: 2px;
  font-size: 0.95rem;
}

.doc-card .doc-info small {
  color: var(--gray-400);
}

.doc-card .doc-category {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--primary-light);
  color: white;
}

/* Responsive Desenvolvimento */
@media (max-width: 768px) {
  .dev-dashboard-grid {
    grid-template-columns: 1fr;
  }
  .ficha-form-grid {
    grid-template-columns: 1fr;
  }
  .ficha-card {
    grid-template-columns: 1fr;
  }
  .ficha-detail-grid {
    grid-template-columns: 1fr;
  }
  .dev-tipo-grid {
    flex-direction: column;
  }
  .ficha-page-tabs {
    flex-direction: column;
  }
}

/* ── Produção Module ───────────────────────────────────────────────────── */
.production-shell {
  padding: 28px;
}

.production-header,
.production-page-header,
.production-context-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.production-header {
  margin-bottom: 24px;
}

.production-page-header,
.production-context-card {
  margin-bottom: 20px;
}

.production-breadcrumb {
  background: var(--gray-100);
  color: var(--primary);
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
}

.production-selectors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.production-side-card,
.production-inner-card,
.production-context-card,
.production-doc-card,
.production-page-card,
.production-page-view {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.production-side-card,
.production-page-view {
  padding: 18px;
}

.production-inner-card,
.production-context-card,
.production-doc-card {
  padding: 20px;
}

.production-side-card h4,
.production-inner-card h4,
.production-context-card h4,
.production-doc-card h5,
.production-page-card h4,
.production-subsection-head h5,
.production-page-header h4 {
  color: var(--primary);
}

.production-option-list,
.production-page-tabs,
.production-doc-category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.production-option-list {
  flex-direction: column;
}

.production-option-btn,
.production-tab-btn,
.production-doc-category-btn {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  color: var(--gray-700);
  padding: 12px 14px;
  cursor: pointer;
  transition: var(--transition);
}

.production-option-btn {
  width: 100%;
  text-align: left;
}

.production-option-btn strong {
  display: block;
}

.production-option-btn span {
  display: block;
  font-size: 0.82rem;
  color: var(--gray-500);
  margin-top: 4px;
}

.production-tab-btn,
.production-doc-category-btn {
  font-weight: 600;
}

.production-option-btn:hover,
.production-option-btn.active,
.production-tab-btn:hover,
.production-tab-btn.active,
.production-doc-category-btn:hover,
.production-doc-category-btn.active {
  border-color: var(--primary-light);
  background: rgba(42, 82, 152, 0.08);
  color: var(--primary);
}

.production-context-label,
.production-page-card-label,
.production-doc-kicker {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  margin-bottom: 6px;
}

.production-context-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.selected-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 6px 0 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(42, 82, 152, 0.08);
  color: var(--primary);
  font-size: 0.82rem;
}

.production-subtabs {
  margin-bottom: 16px;
}

.production-filters-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}


.production-page-grid,
.production-doc-grid,
.production-detail-grid,
.production-form-grid,
.production-filters {
  display: grid;
  gap: 16px;
}

.production-page-grid,
.production-doc-grid.production-doc-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.production-page-grid.production-page-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.production-page-card {
  border: 1px solid var(--gray-200);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.production-page-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-light);
  box-shadow: var(--shadow-lg);
}

.production-page-card-action {
  display: inline-flex;
  margin-top: 16px;
  color: var(--primary);
  font-weight: 700;
}

.production-page-tabs,
.production-doc-category-list {
  margin-bottom: 18px;
}

.production-tab-panel.hidden,
.production-page-view.hidden {
  display: none;
}

.production-subsection-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  align-items: flex-start;
}

.production-counter {
  background: var(--success-bg);
  color: var(--accent);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 700;
}

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

.production-form-span-2 {
  grid-column: span 2;
}

.production-form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.production-filters {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.production-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}

.production-table {
  min-width: 980px;
}

.table-sort-btn {
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.production-summary-row {
  cursor: pointer;
}

.production-summary-row:hover td,
.production-summary-row.expanded td {
  background: rgba(42, 82, 152, 0.06);
}

.production-cell-sub {
  font-size: 0.78rem;
  color: var(--gray-500);
  margin-top: 4px;
}

.production-row-detail td {
  background: rgba(42, 82, 152, 0.03);
}

.production-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  font-size: 0.88rem;
}

.production-empty-state {
  background: linear-gradient(135deg, rgba(42, 82, 152, 0.08), rgba(39, 174, 96, 0.05));
  border: 1px dashed rgba(42, 82, 152, 0.24);
  border-radius: var(--radius);
  padding: 28px;
}

.production-empty-state.compact {
  margin-top: 20px;
}

.production-checklist {
  margin: 16px 0 0 18px;
  color: var(--gray-700);
}

.production-doc-card ul {
  margin-left: 18px;
  color: var(--gray-700);
}

@media (max-width: 1100px) {
  .production-selectors,
  .production-page-grid,
  .production-page-grid.production-page-grid-3,
  .production-doc-grid.production-doc-grid-2,
  .production-filters,
  .production-detail-grid {
    grid-template-columns: 1fr;
  }

  .production-header,
  .production-page-header,
  .production-context-card {
    display: block;
  }

  .production-breadcrumb {
    display: inline-flex;
    margin-top: 12px;
  }

}

@media (max-width: 768px) {
  .production-shell,
  .production-side-card,
  .production-inner-card,
  .production-context-card,
  .production-doc-card,
  .production-page-card,
  .production-page-view,
  .production-empty-state {
    padding: 18px;
  }

  .production-form-grid,
  .production-detail-grid {
    grid-template-columns: 1fr;
  }

  .production-form-span-2 {
    grid-column: span 1;
  }

  .production-page-tabs,
  .production-doc-category-list {
    flex-direction: column;
  }

  .production-tab-btn,
  .production-doc-category-btn {
    width: 100%;
    text-align: left;
  }
}

/* ── SGI Module ───────────────────────────────────────────────────────────── */
.sgi-shell {
  display: grid;
  gap: 20px;
}

.sgi-hero,
.sgi-panel,
.sgi-note-box,
.sgi-metric-card,
.sgi-page-btn,
.sgi-roadmap-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sgi-hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  padding: 24px;
  align-items: start;
}

.sgi-kicker {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sgi-hero h3,
.sgi-section-head h4,
.sgi-panel-header h5 {
  color: var(--primary);
}

.sgi-hero-text,
.sgi-note-box p,
.sgi-inline-note,
.sgi-cell-sub,
.sgi-empty-state {
  color: var(--gray-600);
}

.sgi-highlight-box,
.sgi-note-box {
  padding: 18px;
  background: linear-gradient(135deg, rgba(42,82,152,0.08), rgba(39,174,96,0.08));
  border-radius: var(--radius);
}

.sgi-page-nav,
.sgi-tab-row,
.sgi-tag-grid,
.sgi-roadmap-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.sgi-page-btn,
.sgi-tab-btn {
  border: 1px solid var(--gray-200);
  background: var(--white);
  border-radius: 999px;
  padding: 12px 16px;
  cursor: pointer;
  transition: var(--transition);
}

.sgi-page-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.sgi-page-btn.active,
.sgi-tab-btn.active,
.sgi-page-btn:hover,
.sgi-tab-btn:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.sgi-section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.sgi-note-box.compact {
  max-width: 320px;
}

.sgi-metric-grid,
.sgi-content-grid,
.sgi-structured-grid {
  display: grid;
  gap: 16px;
}

.sgi-metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sgi-metric-card {
  padding: 18px;
}

.sgi-metric-card span {
  display: block;
  color: var(--gray-500);
  font-size: 0.84rem;
  margin-bottom: 8px;
}

.sgi-metric-card strong {
  font-size: 1.7rem;
  color: var(--primary);
}

.sgi-metric-card.warning strong { color: #d97706; }
.sgi-metric-card.danger strong { color: var(--danger); }
.sgi-metric-card.success strong { color: var(--accent); }

.sgi-content-grid {
  grid-template-columns: minmax(320px, 1.05fr) minmax(420px, 1.4fr);
  align-items: start;
}

.sgi-panel {
  padding: 20px;
}

.sgi-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.sgi-chip,
.sgi-status-chip,
.sgi-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.sgi-chip {
  padding: 6px 12px;
  background: var(--gray-100);
  color: var(--gray-600);
}

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

.sgi-form-grid label,
.sgi-filter-grid .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-700);
}

.sgi-form-grid input,
.sgi-form-grid textarea,
.sgi-form-grid select,
.sgi-filter-grid input,
.sgi-filter-grid select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  font: inherit;
}

.sgi-form-grid textarea {
  min-height: 110px;
  resize: vertical;
}

.sgi-form-span-2,
.sgi-panel-wide {
  grid-column: 1 / -1;
}

.sgi-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.sgi-inline-note {
  margin-top: 12px;
  font-size: 0.82rem;
}

.sgi-table-wrapper {
  overflow-x: auto;
}

.sgi-table tbody tr.is-warning td {
  background: #fff8db;
}

.sgi-table tbody tr.is-overdue td {
  background: #fdeaea;
}

.sgi-table tbody tr.is-obsolete td {
  background: #f1f5f9;
}

.sgi-status-chip {
  padding: 5px 10px;
  color: var(--gray-700);
  background: var(--gray-100);
}

.sgi-status-chip.is-warning { background: #fff1bf; color: #a16207; }
.sgi-status-chip.is-overdue { background: #fecaca; color: #991b1b; }
.sgi-status-chip.is-obsolete { background: #e2e8f0; color: #475569; }
.sgi-status-chip.is-current { background: #dcfce7; color: #166534; }

.sgi-chip.warning {
  background: #fff7ed;
  color: #9a3412;
}

.sgi-global-search-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.03), rgba(42, 82, 152, 0.08));
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.sgi-global-search-copy strong {
  display: block;
  color: var(--primary);
}

.sgi-global-search-control {
  display: flex;
  gap: 10px;
  align-items: center;
}

.sgi-global-search-control input {
  flex: 1;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  background: var(--white);
}

.sgi-global-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.sgi-result-card {
  text-align: left;
  padding: 12px;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  background: var(--white);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sgi-result-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.sgi-result-card strong,
.sgi-result-card small {
  display: block;
}

.sgi-result-type {
  display: inline-flex;
  margin-bottom: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.72rem;
  font-weight: 700;
}

.sgi-empty-state.compact {
  padding: 12px;
  font-size: 0.88rem;
}

.sgi-atas-workspace {
  display: grid;
  gap: 18px;
}

.sgi-ata-form-panel,
.sgi-atas-history-panel {
  width: 100%;
}

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

.sgi-ata-section {
  padding: 16px;
  background: #f8fafc;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
}

.sgi-ata-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.sgi-ata-section-title > span {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-weight: 800;
}

.sgi-ata-section-title strong,
.sgi-ata-card h6 {
  display: block;
  color: var(--primary);
}

.sgi-ata-section-title small {
  color: var(--gray-500);
}

.sgi-form-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sgi-form-span-3 {
  grid-column: 1 / -1;
}

.sgi-current-file {
  margin-bottom: 10px;
  padding: 10px 12px;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  border-radius: 10px;
  color: #155e75;
  font-size: 0.9rem;
}

.sgi-upload-compact {
  min-height: 92px;
}

.sgi-ata-history-list {
  display: grid;
  gap: 12px;
}

.sgi-ata-card {
  padding: 16px;
  border: 1px solid var(--gray-200);
  border-left: 5px solid var(--accent);
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.sgi-ata-card.is-warning {
  border-left-color: #d97706;
}

.sgi-ata-card.is-overdue {
  border-left-color: var(--danger);
}

.sgi-ata-card-main,
.sgi-ata-card-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.sgi-ata-card h6 {
  margin: 0;
  font-size: 1rem;
}

.sgi-ata-card p {
  margin: 4px 0 0;
  color: var(--gray-600);
}

.sgi-ata-card-meta,
.sgi-ata-card-body {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.sgi-ata-card-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 10px;
  background: #f8fafc;
  border-radius: 10px;
}

.sgi-ata-card-meta span,
.sgi-ata-card-body small {
  color: var(--gray-600);
  font-size: 0.84rem;
}

.sgi-ata-card-meta strong,
.sgi-ata-card-body strong {
  display: block;
  margin-bottom: 3px;
  color: var(--gray-700);
}

.sgi-ata-card-body {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sgi-ata-card-body > div {
  min-width: 0;
}

.sgi-ata-card-actions {
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--gray-200);
}

.sgi-empty-state {
  padding: 24px;
  text-align: center;
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 1px dashed var(--gray-300);
}

.sgi-bullet-list {
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.sgi-tag-grid {
  gap: 10px;
}

.sgi-tag {
  padding: 8px 12px;
  background: var(--gray-100);
  color: var(--gray-700);
}

.sgi-roadmap-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sgi-roadmap-card {
  padding: 16px;
}

@media (max-width: 1100px) {
  .sgi-hero,
  .sgi-content-grid,
  .sgi-metric-grid,
  .sgi-roadmap-grid,
  .sgi-structured-grid,
  .sgi-form-grid-3,
  .sgi-ata-card-meta,
  .sgi-ata-card-body {
    grid-template-columns: 1fr;
  }

  .sgi-section-head {
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .sgi-form-grid,
  .sgi-filter-grid {
    grid-template-columns: 1fr;
  }

  .sgi-form-span-2,
  .sgi-form-span-3,
  .sgi-panel-wide {
    grid-column: auto;
  }

  .sgi-form-actions {
    flex-direction: column;
  }

  .sgi-global-search-control,
  .sgi-ata-card-main,
  .sgi-ata-card-actions {
    flex-direction: column;
  }
}

/* ── Canal de Denúncias ─────────────────────────────────────────────── */
.section-description {
  color: var(--gray-500);
  font-size: 0.92rem;
  margin-top: 6px;
}

.denuncias-public-body {
  min-height: 100vh;
  padding: 28px 16px 48px;
}

.denuncias-public-page {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

.denuncias-hero-card,
.denuncias-public-card {
  background: rgba(255,255,255,0.96);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.denuncias-hero-card {
  padding: 28px;
  background: linear-gradient(135deg, rgba(26,58,107,0.96), rgba(42,82,152,0.92));
  color: var(--white);
}

.denuncias-brand {
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 8px;
}

.denuncias-hero-card h1 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.denuncias-hero-text {
  max-width: 760px;
  opacity: 0.92;
}

.denuncias-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.public-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  margin-bottom: 18px;
}

.confidentiality-box,
.identified-box {
  border: 1px solid rgba(39,174,96,0.22);
  background: rgba(39,174,96,0.08);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.identified-box {
  margin: 18px 0;
}

.identified-box h3 {
  color: var(--primary);
  margin-bottom: 6px;
}

.full-span {
  grid-column: 1 / -1;
}

.optional-muted select {
  opacity: 0.7;
}

.public-protocol-form {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.public-protocol-form input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
}

.protocol-result {
  margin-top: 16px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  padding: 16px;
}

.rh-denuncias-shell {
  display: grid;
  gap: 18px;
}

.rh-denuncias-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.rh-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.summary-card {
  background: linear-gradient(180deg, var(--white), var(--gray-50));
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summary-label {
  color: var(--gray-500);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-card strong {
  color: var(--primary);
  font-size: 1.7rem;
}

.rh-denuncias-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.95fr);
  gap: 18px;
}

.rh-list-panel,
.rh-detail-panel {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  padding: 16px;
}

.rh-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.rh-toolbar input,
.rh-toolbar select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
}

.table-responsive {
  overflow-x: auto;
}

.rh-denuncias-table td,
.rh-denuncias-table th {
  vertical-align: top;
}

.rh-row.selected {
  background: rgba(26,58,107,0.05);
}

.table-link-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-weight: 700;
  text-align: left;
}

.table-link-btn:hover {
  text-decoration: underline;
}

.placeholder-section.compact {
  padding: 28px 12px;
}

.detail-kicker {
  display: inline-block;
  color: var(--gray-500);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.rh-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.rh-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.rh-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.rh-detail-content,
.rh-followup-form {
  display: grid;
  gap: 16px;
}

.rh-detail-section-block {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: linear-gradient(180deg, var(--white), var(--gray-50));
}

.section-mini-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.mini-label {
  font-size: 0.76rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.rh-detail-grid-wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-readonly-box {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.rh-last-update-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.last-update-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  padding: 14px;
  display: grid;
  gap: 4px;
}

.last-update-card strong {
  color: var(--primary);
  font-size: 1rem;
}

.rh-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.timeline-item {
  position: relative;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: flex-start;
  gap: 12px;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 6px;
  box-shadow: 0 0 0 4px rgba(26,58,107,0.12);
}

.timeline-content {
  display: grid;
  gap: 6px;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--gray-600);
}

.timeline-title {
  color: var(--primary);
  font-weight: 700;
}

.timeline-body {
  display: grid;
  gap: 6px;
  color: var(--gray-700);
}

.rh-detail-section {
  border-top: 1px solid var(--gray-200);
  padding-top: 14px;
}

.rh-detail-section:first-child {
  border-top: none;
  padding-top: 0;
}

.rh-detail-section h5 {
  color: var(--primary);
  margin-bottom: 8px;
}

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

.rh-inline-files {
  display: grid;
  gap: 6px;
}

.rh-inline-files a {
  color: var(--primary);
  text-decoration: none;
  word-break: break-all;
}

.rh-inline-files a:hover {
  text-decoration: underline;
}

.rh-history-list {
  display: grid;
  gap: 10px;
}

.rh-history-item {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
}

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

@media (max-width: 1100px) {
  .rh-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rh-denuncias-grid,
  .public-card-header {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .denuncias-public-body {
    padding: 14px 10px 28px;
  }

  .denuncias-hero-card,
  .section-card {
    padding: 18px;
  }

  .rh-summary-grid,
  .rh-toolbar,
  .rh-detail-grid,
  .rh-detail-grid-wide,
  .two-col-grid,
  .public-protocol-form,
  .rh-last-update-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .public-protocol-form {
    gap: 10px;
  }

  .rh-denuncias-header,
  .rh-detail-header {
    flex-direction: column;
    align-items: stretch;
  }
}

/* RH - Contratações */
.rh-module-shell { margin-bottom: 14px; }
.rh-module-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.rh-tabs { margin-top: 10px; }
.rh-hiring-shell .rh-toolbar { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.rh-contratacoes-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
@media (max-width: 768px) {
  .rh-contratacoes-header, .rh-module-header { flex-direction: column; align-items: flex-start; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Módulo de Tratativas de Qualidade — Encaminhamentos, Vínculos e Relatórios
   ═══════════════════════════════════════════════════════════════════════════ */

/* Aba de Relatórios de Tratativas */
.quality-tab-btn-relatorio {
  background: linear-gradient(135deg, #1a3a6b 0%, #6b3fa0 100%);
  color: #fff !important;
  border-radius: 6px;
  font-weight: 600;
}
.quality-tab-btn-relatorio.active,
.quality-tab-btn-relatorio:hover {
  background: linear-gradient(135deg, #0f2550 0%, #4a2880 100%);
  color: #fff !important;
}

/* Seção de tratativas dentro do report-row */
.report-tratativas-section {
  border-top: 1px solid #e2e8f0;
  padding: 10px 16px 4px;
  background: #f8fafc;
}

.tratativas-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.btn-tratativa {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: background 0.2s;
}
.btn-tratativa:hover { background: #bae6fd; }

.btn-vinculo {
  background: #f3e8ff;
  color: #7c3aed;
  border: 1px solid #ddd6fe;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: background 0.2s;
}
.btn-vinculo:hover { background: #ddd6fe; }

.tratativas-panel {
  margin-top: 8px;
  padding: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.tratativas-loading {
  color: #64748b;
  font-size: 0.9rem;
  padding: 8px 0;
}

.tratativas-error {
  color: #dc2626;
  font-size: 0.9rem;
}

.tratativas-empty {
  color: #94a3b8;
  font-size: 0.88rem;
  font-style: italic;
  padding: 6px 0;
}

.tratativas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.tratativas-header h4 {
  margin: 0;
  font-size: 0.95rem;
  color: #1e293b;
}

/* Cards de Encaminhamento */
.enc-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.enc-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.enc-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}

.enc-tipo {
  font-weight: 700;
  font-size: 0.85rem;
  color: #1e293b;
}

.enc-card-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.enc-field {
  font-size: 0.85rem;
  color: #374151;
}

.enc-descricao {
  background: #f8fafc;
  border-radius: 4px;
  padding: 6px 8px;
  margin-top: 4px;
  font-size: 0.83rem;
  color: #475569;
}

.enc-meta {
  color: #94a3b8;
  font-size: 0.78rem;
  margin-top: 4px;
}

.enc-card-actions {
  display: flex;
  gap: 6px;
  padding: 6px 12px 8px;
  border-top: 1px solid #f1f5f9;
}

/* Cards de Vínculo */
.vinc-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vinc-card {
  border: 1px solid #ddd6fe;
  border-radius: 8px;
  overflow: hidden;
  background: #faf5ff;
}

.vinc-card-header {
  padding: 7px 12px;
  background: #ede9fe;
  border-bottom: 1px solid #ddd6fe;
}

.vinc-tipo-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: #5b21b6;
  text-transform: capitalize;
}

.vinc-card-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vinc-field {
  font-size: 0.85rem;
  color: #374151;
}

.vinc-id-small {
  font-size: 0.75rem;
  color: #94a3b8;
  font-family: monospace;
}

.vinc-meta {
  color: #94a3b8;
  font-size: 0.78rem;
}

.vinc-card-actions {
  display: flex;
  gap: 6px;
  padding: 6px 12px 8px;
  border-top: 1px solid #ede9fe;
}

.vinc-results-desktop { display: none; }

/* Desktop: visual mais elegante para nomes no painel de vínculos */
@media (min-width: 992px) {
  #vinc-select {
    display: none;
  }

  .vinc-results-desktop {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    max-height: 320px;
    overflow: auto;
    margin-top: 8px;
  }

  .vinc-result-card {
    border: 1px solid #ddd6fe;
    background: #faf5ff;
    border-radius: 10px;
    padding: 8px 10px;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: all .15s ease;
  }

  .vinc-result-card:hover {
    border-color: #a78bfa;
    background: #f5f3ff;
  }

  .vinc-result-card.selected {
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.18);
    background: #f3e8ff;
  }

  .vinc-result-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #4c1d95;
  }

  .vinc-result-meta {
    font-size: 0.8rem;
    color: #6b21a8;
  }

  .vinc-result-extra {
    font-size: 0.75rem;
    color: #7c3aed;
  }

  .vinc-results-empty {
    font-size: 0.82rem;
    color: #6b7280;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
  }

  .vinc-card {
    border-radius: 12px;
    border-color: #c4b5fd;
    background: linear-gradient(180deg, #faf5ff 0%, #ffffff 100%);
    box-shadow: 0 4px 14px rgba(91, 33, 182, 0.08);
  }

  .vinc-card-header {
    padding: 9px 14px;
    background: linear-gradient(90deg, #ede9fe 0%, #f5f3ff 100%);
  }

  .vinc-card-body {
    gap: 8px;
    padding: 12px 14px;
  }

  .vinc-field-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #faf7ff;
    border: 1px solid #e9d5ff;
    border-radius: 10px;
    padding: 8px 10px;
  }

  .vinc-field-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #7c3aed;
    font-weight: 700;
  }

  .vinc-linked-name {
    font-size: 0.98rem;
    font-weight: 700;
    color: #4c1d95;
    line-height: 1.3;
  }

  .vinc-linked-meta {
    font-size: 0.8rem;
    color: #6b21a8;
  }
}

/* Badges de status de encaminhamento */
.badge-pendente { background: #fef3c7; color: #92400e; }
.badge-andamento { background: #dbeafe; color: #1e40af; }
.badge-concluido { background: #d1fae5; color: #065f46; }
.badge-cancelado { background: #fee2e2; color: #991b1b; }

/* Botões extras */
.btn-xs {
  padding: 3px 8px;
  font-size: 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
  font-weight: 600;
  transition: background 0.2s;
}
.btn-outline {
  background: #fff;
  border-color: #cbd5e1;
  color: #374151;
}
.btn-outline:hover { background: #f1f5f9; }
.btn-xs.btn-outline { border-color: #cbd5e1; color: #374151; background: #fff; }
.btn-xs.btn-outline:hover { background: #f1f5f9; }
.btn-xs.btn-danger { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.btn-xs.btn-danger:hover { background: #fca5a5; }

/* Painel de Relatórios de Tratativas */
.relatorio-qual-panel {
  padding: 20px 0;
}
.relatorio-qual-panel h3 {
  font-size: 1.2rem;
  color: #1e293b;
  margin-bottom: 6px;
}
.relatorio-desc {
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.relatorio-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0;
}

.rel-tab {
  padding: 8px 18px;
  border: none;
  background: transparent;
  color: #64748b;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.rel-tab.active {
  color: #1a3a6b;
  border-bottom-color: #1a3a6b;
}
.rel-tab:hover { color: #1a3a6b; }

.rel-form {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.rel-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* Pré-visualização */
.rel-preview-area {
  margin-top: 20px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 20px;
  background: #fff;
}

.preview-header {
  margin-bottom: 16px;
  border-bottom: 2px solid #1a3a6b;
  padding-bottom: 10px;
}
.preview-header h4 {
  margin: 0 0 4px;
  color: #1a3a6b;
  font-size: 1.1rem;
}
.preview-meta {
  color: #64748b;
  font-size: 0.85rem;
  margin: 0;
}

.preview-section-title {
  font-size: 0.95rem;
  color: #1e293b;
  margin: 16px 0 8px;
  border-left: 3px solid #1a3a6b;
  padding-left: 8px;
}

.preview-subs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.preview-sub-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
  margin-bottom: 12px;
}
.preview-table th {
  background: #1a3a6b;
  color: #fff;
  padding: 7px 10px;
  text-align: left;
  font-weight: 600;
}
.preview-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #e2e8f0;
  color: #374151;
}
.preview-table tr:nth-child(even) td { background: #f8fafc; }

/* Modal de Encaminhamentos e Vínculos */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
}
.modal-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #1e293b;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #64748b;
  line-height: 1;
  padding: 0 4px;
}
.modal-close:hover { color: #1e293b; }

.modal-body {
  padding: 20px;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 0 0 12px 12px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.required {
  color: #dc2626;
  font-size: 0.85rem;
}

/* ── Bloco de Vínculo nos Formulários de Qualidade ──────────────────────── */
.quality-vinculo-block {
  background: linear-gradient(135deg, #f0f4ff 0%, #f8f0ff 100%);
  border: 1.5px dashed #a78bfa;
  border-radius: 10px;
  padding: 16px 18px;
  margin-top: 8px;
}

.quality-vinculo-label {
  font-size: 0.93rem;
  font-weight: 600;
  color: #5b21b6;
  display: block;
  margin-bottom: 4px;
}

.quality-vinculo-block .section-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-bottom: 10px;
}

.quality-vinculo-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.quality-vinculo-input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid #c4b5fd;
  border-radius: 7px;
  font-size: 0.85rem;
  background: #fff;
  color: var(--gray-800);
  transition: border-color 0.2s;
}

.quality-vinculo-input:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.quality-vinculo-select {
  padding: 8px 12px;
  border: 1.5px solid #c4b5fd;
  border-radius: 7px;
  font-size: 0.85rem;
  background: #fff;
  color: var(--gray-800);
  min-width: 160px;
  cursor: pointer;
}

.quality-vinculo-obs {
  width: 100%;
  padding: 7px 12px;
  border: 1.5px solid #e9d5ff;
  border-radius: 7px;
  font-size: 0.82rem;
  background: #fff;
  color: var(--gray-800);
  box-sizing: border-box;
}

.quality-vinculo-obs:focus {
  outline: none;
  border-color: #a78bfa;
}

.quality-vinculo-preview {
  margin-top: 8px;
  padding: 8px 12px;
  background: #ede9fe;
  border-radius: 7px;
  font-size: 0.82rem;
  color: #5b21b6;
  border-left: 3px solid #7c3aed;
}

.quality-vinculo-preview.hidden {
  display: none;
}

/* ── Autocomplete de Vínculo ─────────────────────────────────────────────── */
.quality-vinculo-search-wrap {
  position: relative;
}

.quality-vinculo-search {
  width: 100%;
  padding: 9px 14px;
  border: 1.5px solid #c4b5fd;
  border-radius: 8px;
  font-size: 0.88rem;
  background: #fff;
  color: var(--gray-800, #1e293b);
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.quality-vinculo-search:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.quality-vinculo-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid #c4b5fd;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.15);
  z-index: 1000;
  max-height: 320px;
  overflow-y: auto;
}

.quality-vinculo-dropdown.hidden { display: none; }

.vinculo-dropdown-loading,
.vinculo-dropdown-empty {
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--gray-500, #64748b);
  text-align: center;
}

.vinculo-dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f3e8ff;
  transition: background 0.15s;
}

.vinculo-dropdown-item:last-child { border-bottom: none; }
.vinculo-dropdown-item:hover { background: #f5f3ff; }

.vinculo-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.vinculo-tipo-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.vinculo-tipo-visitatcnica,
.vinculo-tipo-visitatecnica { background: #dbeafe; color: #1d4ed8; }
.vinculo-tipo-reclamao,
.vinculo-tipo-reclamacao { background: #fee2e2; color: #dc2626; }
.vinculo-tipo-devoluo,
.vinculo-tipo-devolucao { background: #fef3c7; color: #d97706; }
.vinculo-tipo-sacfornecedor { background: #d1fae5; color: #059669; }
.vinculo-tipo-saccliente { background: #ede9fe; color: #7c3aed; }

.vinculo-item-cliente {
  font-weight: 600;
  font-size: 0.87rem;
  color: var(--gray-800, #1e293b);
}

.vinculo-item-data {
  font-size: 0.78rem;
  color: var(--gray-500, #64748b);
  margin-left: auto;
}

.vinculo-item-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}

.vinculo-tag {
  font-size: 0.72rem;
  background: #f1f5f9;
  color: #475569;
  padding: 1px 7px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.vinculo-item-desc {
  font-size: 0.78rem;
  color: var(--gray-600, #475569);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vinculo-item-id {
  font-size: 0.7rem;
  color: #a78bfa;
  margin-top: 2px;
  font-family: monospace;
}

/* Card do registro selecionado */
.quality-vinculo-selecionado { margin-top: 8px; }
.quality-vinculo-selecionado.hidden { display: none; }

.vinculo-card-selecionado {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #ede9fe;
  border: 1.5px solid #a78bfa;
  border-radius: 9px;
  padding: 10px 14px;
}

.vinculo-card-info { flex: 1; }

.vinculo-remover-btn {
  background: none;
  border: 1px solid #a78bfa;
  color: #7c3aed;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.vinculo-remover-btn:hover {
  background: #7c3aed;
  color: #fff;
}

/* ═══════════════════════════════════════════════════════
   MÓDULO FINANCEIRO — Estilos completos
   ═══════════════════════════════════════════════════════ */

/* Header do módulo */
.financeiro-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.financeiro-header h3 { margin: 0 0 4px; font-size: 1.3rem; color: var(--primary, #1e3a5f); }
.financeiro-header .section-description { margin: 0; color: var(--gray-600, #475569); font-size: 0.92rem; }

/* KPI Cards */
.financeiro-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.financeiro-kpi-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s;
}
.financeiro-kpi-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.10); }
.financeiro-kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500, #64748b);
}
.financeiro-kpi-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary, #1e3a5f);
  line-height: 1.2;
}
.financeiro-kpi-card.kpi-aberto .financeiro-kpi-value { color: #f59e0b; }
.financeiro-kpi-card.kpi-pago .financeiro-kpi-value { color: #10b981; }
.financeiro-kpi-card.kpi-vencido .financeiro-kpi-value { color: #ef4444; }
.financeiro-kpi-card.kpi-total .financeiro-kpi-value { color: #3b82f6; }
.financeiro-kpi-sub { font-size: 0.72rem; color: var(--gray-500, #64748b); }

/* Toolbar */
.financeiro-toolbar {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 20px;
}
.financeiro-search-row { display: flex; gap: 8px; align-items: flex-end; }
.financeiro-search-row input { flex: 1; min-width: 0; }
.financeiro-filtros-grid {
  display: grid;
  grid-template-columns: 160px 160px 160px auto;
  gap: 12px;
  align-items: flex-end;
  margin-top: 12px;
}
@media (max-width: 700px) {
  .financeiro-filtros-grid { grid-template-columns: 1fr 1fr; }
  .financeiro-filter-actions { grid-column: 1 / -1; }
}
.financeiro-filter-actions { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }

/* Secoes */
.financeiro-cliente-section, .financeiro-titulos-section { margin-bottom: 24px; }
.financeiro-cliente-section h4, .financeiro-titulos-section h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary, #1e3a5f);
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid #e2e8f0;
}
.financeiro-selected-client {
  font-size: 0.88rem;
  color: #3b82f6;
  font-weight: 500;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
}
.financeiro-table th, .financeiro-table td { font-size: 0.84rem; white-space: nowrap; }

/* Status badges */
.financeiro-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.financeiro-status.aberto { background: #fef3c7; color: #92400e; }
.financeiro-status.pago { background: #d1fae5; color: #065f46; }
.financeiro-status.cancelado { background: #fee2e2; color: #991b1b; }
.financeiro-status.vencido { background: #fee2e2; color: #991b1b; }
.financeiro-status.desconhecido { background: #f1f5f9; color: #475569; }

/* Alertas de vencimento */
.financeiro-alerta-vencimento {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 9px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  color: #92400e;
}
.financeiro-alerta-vencimento .alerta-icon { font-size: 1.2rem; flex-shrink: 0; }

/* Linhas coloridas */
tr.financeiro-row-vencido td { background: #fff5f5; }
tr.financeiro-row-vencendo td { background: #fffbeb; }

/* Barra de acoes */
.financeiro-titulos-actions { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }

/* Modal do boleto */
.financeiro-boleto-modal {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 16px 18px;
  margin-top: 16px;
  font-size: 0.9rem;
}
.financeiro-boleto-modal strong { display: block; margin-bottom: 8px; color: #0369a1; }
.financeiro-boleto-linha {
  font-family: monospace;
  font-size: 0.85rem;
  background: #fff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  padding: 6px 10px;
  margin: 8px 0;
  word-break: break-all;
  cursor: pointer;
  transition: background 0.15s;
}
.financeiro-boleto-linha:hover { background: #e0f2fe; }
.financeiro-boleto-copy-hint { font-size: 0.72rem; color: #0369a1; margin-top: 2px; }

/* Loading */
.financeiro-loading {
  text-align: center;
  padding: 18px;
  color: #3b82f6;
  font-size: 0.9rem;
  animation: financeiro-pulse 1.5s infinite;
}
@keyframes financeiro-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Empty state */
.financeiro-empty {
  text-align: center;
  padding: 24px;
  color: var(--gray-500, #64748b);
  font-size: 0.88rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px dashed #e2e8f0;
}

/* Health card */
.financeiro-health-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 0.88rem;
  margin-bottom: 14px;
}
.financeiro-health-card.ok { background: #d1fae5; border: 1px solid #6ee7b7; color: #065f46; }
.financeiro-health-card.error { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }
.financeiro-health-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.financeiro-health-card.ok .financeiro-health-dot { background: #10b981; }
.financeiro-health-card.error .financeiro-health-dot { background: #ef4444; }

/* Módulo Comercial IBC - melhorias de layout do formulário */
.ibc-page {
  max-width: 1180px;
}

.ibc-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.05);
}

#ibcPedidoForm.ibc-form-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ibc-form-section {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 14px 16px;
  background: #f8fafc;
}

.ibc-form-section h6 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: #1e3a5f;
  padding-bottom: 8px;
  border-bottom: 1px solid #dbe4ef;
}

.ibc-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px 14px;
}

.ibc-label-title {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ibc-form-grid label,
.ibc-observacoes-full label,
.ibc-anexo-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  color: #334155;
  font-size: 0.85rem;
}

.ibc-form-grid input,
.ibc-form-grid select,
.ibc-observacoes-full textarea,
.ibc-filter-row input,
.ibc-filter-row select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.9rem;
  background: #fff;
}

.ibc-observacoes-full textarea { min-height: 130px; resize: vertical; }
.ibc-field-span-2 { grid-column: span 2; }
.ibc-required { color: #dc2626; font-weight: 700; }
.ibc-form-note { display: block; color: #475569; margin-top: 4px; }

.ibc-anexos-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(250px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.ibc-anexo-card {
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.ibc-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .ibc-form-grid,
  .ibc-anexos-grid {
    grid-template-columns: 1fr;
  }
  .ibc-field-span-2 {
    grid-column: auto;
  }
}

/* ═══ MÓDULO PROJETOS ═══════════════════════════════════════════════════════ */
.projetos-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 10px;
}
.projetos-tab-btn {
  padding: 8px 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  color: #374151;
  font-family: inherit;
}
.projetos-tab-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}
.projetos-tab-btn.active {
  background: #1e3a5f;
  color: #fff;
  border-color: #1e3a5f;
}
.projetos-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.projetos-kpi-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px 20px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.projetos-kpi-card.projetos-kpi-blue { border-left: 4px solid #2563eb; }
.projetos-kpi-card.projetos-kpi-red { border-left: 4px solid #dc2626; }
.projetos-kpi-card.projetos-kpi-green { border-left: 4px solid #16a34a; }
.projetos-kpi-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1e3a5f;
  line-height: 1.2;
}
.projetos-kpi-label {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.projetos-filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}
.projetos-filtro-select,
.projetos-filtro-input {
  padding: 7px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.85rem;
  background: #fff;
  min-width: 160px;
  font-family: inherit;
}
.projetos-filtro-input { min-width: 200px; }
.projetos-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.projetos-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.projetos-table thead { background: #f8fafc; }
.projetos-table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
}
.projetos-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}
.projetos-table tbody tr:hover { background: #f8fafc; }
.projetos-td-nome { max-width: 220px; word-break: break-word; }
.projetos-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}
.projetos-progress-wrap {
  width: 80px;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}
.projetos-progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}
.projetos-progress-label {
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 6px;
  color: #374151;
}
.projetos-prazo-atrasado { color: #dc2626; font-weight: 600; }
.projetos-prazo-proximo { color: #d97706; font-weight: 500; }
.projetos-td-acoes { white-space: nowrap; }
.projetos-td-acoes .btn-sm { padding: 4px 8px; font-size: 0.75rem; }
.projetos-empty {
  text-align: center;
  padding: 40px 20px;
  color: #6b7280;
  font-style: italic;
}
.projetos-form-details {
  margin-bottom: 20px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}
.projetos-form-summary {
  padding: 12px 16px;
  background: #f8fafc;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: #1e3a5f;
  border-bottom: 1px solid #e5e7eb;
}
.projetos-form-summary:hover { background: #f1f5f9; }
.projetos-form { padding: 16px; }
.projetos-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.projetos-form .form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}
.projetos-form .form-group input,
.projetos-form .form-group select,
.projetos-form .form-group textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.85rem;
  box-sizing: border-box;
}
.projetos-form .form-group textarea { resize: vertical; }
.projetos-feedback { margin-top: 10px; }
.projetos-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.projetos-modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.projetos-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}
.projetos-modal-header h4 { margin: 0; font-size: 1rem; color: #1e3a5f; }
.projetos-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6b7280;
  line-height: 1;
}
.projetos-modal-close:hover { color: #dc2626; }
.projetos-modal .projetos-form { padding: 20px; }
.projetos-modal-actions { display: flex; gap: 10px; margin-top: 14px; }
.projetos-anexos-list { display: flex; flex-wrap: wrap; gap: 8px; }
.projetos-anexo-link {
  display: inline-block;
  padding: 4px 10px;
  background: #f3f4f6;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #2563eb;
  text-decoration: none;
}
.projetos-anexo-link:hover { background: #e5e7eb; }
.projetos-content { min-height: 200px; }
@media (max-width: 768px) {
  .projetos-tabs { gap: 4px; }
  .projetos-tab-btn { padding: 6px 10px; font-size: 0.78rem; }
  .projetos-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .projetos-form-grid { grid-template-columns: 1fr; }
  .projetos-filtros { flex-direction: column; align-items: stretch; }
  .projetos-filtro-select, .projetos-filtro-input { min-width: unset; width: 100%; }
}


/* ── Produção > Monitoramento Industrial ───────────────────────────── */
.monitoring-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
  margin: 14px 0 18px;
  flex-wrap: wrap;
}

.monitoring-toolbar-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
}

.monitoring-toolbar-left select {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.monitoring-toolbar-right {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

.status-badge-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-badge-inline.online {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.status-badge-inline.offline {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.monitoring-mini-signal {
  font-family: monospace;
  font-size: 0.84rem;
  color: var(--gray-600);
}

@media (max-width: 980px) {
  .monitoring-kpi-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 640px) {
  .monitoring-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* ── PERFORMANCE_SCROLL_MONITORAMENTO_V1 ───────────────────────────────────
   Reduz travamentos de rolagem em telas grandes do módulo Produção /
   Monitoramento Industrial.
*/

html {
  scroll-behavior: auto;
}

#productionMonitoringPanel,
#productionDedicatedPage {
  contain: layout paint;
}

#productionMonitoringPanel .section-card,
#productionMonitoringPanel .production-inner-card,
#productionDedicatedPage .section-card,
#productionDedicatedPage .production-inner-card {
  contain: layout paint;
}

@supports (content-visibility: auto) {
  #productionMonitoringPanel .section-card,
  #productionMonitoringPanel .production-inner-card,
  #productionDedicatedPage .section-card,
  #productionDedicatedPage .production-inner-card {
    content-visibility: auto;
    contain-intrinsic-size: 1px 520px;
  }
}

#productionMonitoringPanel .production-table-wrapper,
#productionDedicatedPage .production-table-wrapper {
  contain: layout paint;
  max-height: 72vh;
  overflow: auto;
}

#productionMonitoringPanel .data-table,
#productionDedicatedPage .data-table {
  will-change: auto;
}

#productionMonitoringPanel *,
#productionDedicatedPage * {
  transition-duration: 0.08s;
}

#productionMonitoringPanel .data-table tr,
#productionDedicatedPage .data-table tr,
#productionMonitoringPanel .data-table td,
#productionDedicatedPage .data-table td,
#productionMonitoringPanel .data-table th,
#productionDedicatedPage .data-table th {
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  #productionMonitoringPanel *,
  #productionDedicatedPage * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ── PERFORMANCE_SCROLL_MONITORAMENTO_V1 ───────────────────────────────────
   Reduz travamentos de rolagem em telas grandes do módulo Produção /
   Monitoramento Industrial.
*/

html {
  scroll-behavior: auto;
}

#productionMonitoringPanel,
#productionDedicatedPage {
  contain: layout paint;
}

#productionMonitoringPanel .section-card,
#productionMonitoringPanel .production-inner-card,
#productionDedicatedPage .section-card,
#productionDedicatedPage .production-inner-card {
  contain: layout paint;
}

@supports (content-visibility: auto) {
  #productionMonitoringPanel .section-card,
  #productionMonitoringPanel .production-inner-card,
  #productionDedicatedPage .section-card,
  #productionDedicatedPage .production-inner-card {
    content-visibility: auto;
    contain-intrinsic-size: 1px 520px;
  }
}

#productionMonitoringPanel .production-table-wrapper,
#productionDedicatedPage .production-table-wrapper {
  contain: layout paint;
  max-height: 72vh;
  overflow: auto;
}

#productionMonitoringPanel .data-table tr,
#productionDedicatedPage .data-table tr,
#productionMonitoringPanel .data-table td,
#productionDedicatedPage .data-table td,
#productionMonitoringPanel .data-table th,
#productionDedicatedPage .data-table th {
  transition: none !important;
}

#productionMonitoringPanel *,
#productionDedicatedPage * {
  transition-duration: 0.06s;
}

@media (prefers-reduced-motion: reduce) {
  #productionMonitoringPanel *,
  #productionDedicatedPage * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}


/* Produção > Monitoramento Industrial > microciclos */
.pm-machine-card-has-cycle-badges,
.production-monitoring-machine-card,
.production-machine-card,
.pm-machine-card,
[data-production-machine-card] {
  position: relative;
}

.pm-cycle-badge {
  position: absolute;
  z-index: 2;
  font-size: 10px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 3px 5px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: rgba(15, 23, 42, 0.58);
  border: 1px solid rgba(15, 23, 42, 0.07);
  pointer-events: none;
  white-space: nowrap;
}

.pm-cycle-badge-top-left {
  top: 6px;
  left: 6px;
}

.pm-cycle-badge-top-right {
  top: 6px;
  right: 6px;
}

.pm-cycle-badge-bottom-right {
  right: 6px;
  bottom: 6px;
}

@media (max-width: 720px) {
  .pm-cycle-badge {
    font-size: 9px;
    padding: 2px 4px;
  }

  .pm-cycle-badge-top-left {
    top: 4px;
    left: 4px;
  }

  .pm-cycle-badge-top-right {
    top: 4px;
    right: 4px;
  }

  .pm-cycle-badge-bottom-right {
    right: 4px;
    bottom: 4px;
  }
}


/* Produção > Monitoramento Industrial > microciclos operacionais */
.pm-operational-machine-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 160px;
}

.pm-operational-machine-name {
  font-weight: 600;
}

.pm-cycle-microline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  font-size: 10px;
  line-height: 1.1;
  opacity: 0.78;
}

.pm-cycle-microline span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 5px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.07);
  color: rgba(15, 23, 42, 0.64);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .pm-operational-machine-cell {
    min-width: 130px;
  }

  .pm-cycle-microline {
    font-size: 9px;
    gap: 3px;
  }

  .pm-cycle-microline span {
    padding: 2px 4px;
  }
}


/* Produção > Monitoramento Industrial > dashboard por máquina */
.pm-dashboard-machine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.pm-dashboard-machine-card {
  position: relative;
  min-height: 150px;
  padding: 30px 14px 28px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07);
  overflow: hidden;
}

.pm-dashboard-cycle-corner {
  position: absolute;
  z-index: 2;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(15, 23, 42, 0.07);
  white-space: nowrap;
  pointer-events: none;
}

.pm-dashboard-cycle-top-left {
  top: 8px;
  left: 8px;
}

.pm-dashboard-cycle-top-right {
  top: 8px;
  right: 8px;
}

.pm-dashboard-cycle-bottom-right {
  right: 8px;
  bottom: 8px;
}

.pm-dashboard-machine-channel {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: rgba(30, 64, 175, 0.86);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.pm-dashboard-machine-card h6 {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.25;
  color: rgba(15, 23, 42, 0.92);
}

.pm-dashboard-machine-status {
  margin-bottom: 8px;
}

.pm-dashboard-machine-main-number {
  font-size: 30px;
  line-height: 1;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.94);
}

.pm-dashboard-machine-caption {
  margin-top: 3px;
  font-size: 11px;
  color: rgba(15, 23, 42, 0.58);
}

.pm-dashboard-machine-last {
  margin-top: 10px;
  max-width: calc(100% - 58px);
  font-size: 10px;
  line-height: 1.25;
  color: rgba(15, 23, 42, 0.52);
}

@media (max-width: 720px) {
  .pm-dashboard-machine-grid {
    grid-template-columns: 1fr;
  }

  .pm-dashboard-machine-card {
    min-height: 138px;
    padding: 28px 12px 26px;
  }

  .pm-dashboard-cycle-corner {
    font-size: 9px;
    padding: 2px 5px;
  }

  .pm-dashboard-machine-main-number {
    font-size: 26px;
  }
}

/* ── MONITORAMENTO_PERFORMANCE_GUARD_CSS_V1 ─────────────────────────────── */
/* Reduz custo de pintura/layout no Monitoramento Industrial. */

#productionMonitoringPanel .production-monitoring-inner-view.hidden {
  display: none !important;
  visibility: hidden !important;
}

#productionMonitoringPanel .production-monitoring-inner-view:not(.hidden) {
  content-visibility: auto;
  contain: layout paint style;
  contain-intrinsic-size: 900px;
}

#productionMonitoringPanel .table-responsive,
#productionMonitoringPanel .reports-table-wrapper,
#productionMonitoringPanel table {
  content-visibility: auto;
  contain-intrinsic-size: 600px;
}

#productionMonitoringAutoRefreshIndicator {
  display: none !important;
}

#productionMonitoringPanel .pm-area-context-banner {
  contain: layout paint style;
}


/* Produção > Monitoramento Industrial > ciclos nos cards visuais MAQ */
.pm-machine-summary-with-cycles {
  position: relative;
  padding-top: 38px;
  padding-bottom: 34px;
}

.pm-visual-cycle-badge {
  position: absolute;
  z-index: 3;
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 4px 7px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(2px);
  pointer-events: none;
  white-space: nowrap;
}

.pm-visual-cycle-top-left {
  top: 9px;
  left: 12px;
}

.pm-visual-cycle-top-right {
  top: 9px;
  right: 12px;
}

.pm-visual-cycle-bottom-right {
  right: 12px;
  bottom: 9px;
}

@media (max-width: 720px) {
  .pm-machine-summary-with-cycles {
    padding-top: 34px;
    padding-bottom: 32px;
  }

  .pm-visual-cycle-badge {
    font-size: 9px;
    padding: 3px 6px;
  }

  .pm-visual-cycle-top-left {
    top: 8px;
    left: 9px;
  }

  .pm-visual-cycle-top-right {
    top: 8px;
    right: 9px;
  }

  .pm-visual-cycle-bottom-right {
    right: 9px;
    bottom: 8px;
  }
}

/* Ajuste fino: evitar sobreposição dos ciclos nos cards MAQ */
.pm-machine-summary-with-cycles {
  padding-top: 54px !important;
  padding-bottom: 42px !important;
}

.pm-machine-summary-with-cycles .pm-machine-summary-head {
  margin-top: 2px;
}

.pm-visual-cycle-badge {
  font-size: 9px;
  padding: 3px 7px;
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pm-visual-cycle-top-left {
  top: 12px;
  left: 14px;
}

.pm-visual-cycle-top-right {
  top: 12px;
  right: 14px;
}

.pm-visual-cycle-bottom-right {
  right: 14px;
  bottom: 12px;
}

@media (max-width: 720px) {
  .pm-machine-summary-with-cycles {
    padding-top: 48px !important;
    padding-bottom: 38px !important;
  }

  .pm-visual-cycle-badge {
    font-size: 8px;
    padding: 3px 5px;
    max-width: 76px;
  }
}

/* MONITORAMENTO_VISUAL_HOURLY_SCROLL_V1 */
.pm-chart-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.pm-chart-bars-scrollable {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.pm-chart-scroll .pm-chart-bar-wrap {
  flex: 0 0 66px;
}

/* PMV2_HOURLY_MACHINE_DETAIL_V1 */
.pmv2-hourly-click {
  cursor: pointer;
  transition: box-shadow .18s ease, background .18s ease;
}

.pmv2-hourly-click:hover {
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, .16);
  background: rgba(37, 99, 235, .02);
}

.pmv2-hourly-machine-details.hidden {
  display: none;
}

.pmv2-hourly-machine-details {
  margin-top: 16px;
  border-top: 1px solid rgba(15, 23, 42, .08);
  padding-top: 14px;
}

.pmv2-hourly-machine-details-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.pmv2-hourly-machine-details-head h5 {
  margin: 0;
  font-size: 15px;
  color: #0f172a;
}

.pmv2-hourly-machine-details-head p,
.pmv2-hourly-machine-details-head small {
  margin: 4px 0 0;
  font-size: 12px;
  color: #64748b;
}

.pmv2-hourly-machine-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.pmv2-hourly-machine-card {
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 16px;
  background: #fff;
  padding: 12px;
}

.pmv2-hourly-machine-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.pmv2-hourly-machine-head h6 {
  margin: 0;
  font-size: 14px;
  color: #0f172a;
}

.pmv2-hourly-machine-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #64748b;
}

.pmv2-hourly-machine-total {
  min-width: 82px;
  text-align: right;
  background: #f8fafc;
  border-radius: 12px;
  padding: 7px 9px;
}

.pmv2-hourly-machine-total span {
  display: block;
  font-weight: 800;
  color: #0f172a;
}

.pmv2-hourly-machine-total small {
  color: #64748b;
}

.pmv2-hourly-machine-bars {
  height: 145px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}

.pmv2-hourly-machine-bar-wrap {
  flex: 0 0 50px;
  height: 125px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}

.pmv2-hourly-machine-bar-value {
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.pmv2-hourly-machine-bar {
  width: 100%;
  min-height: 4px;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, #2563eb, #38bdf8);
}

.pmv2-hourly-machine-bar-label {
  margin-top: 5px;
  font-size: 11px;
  color: #64748b;
}

/* PMV2_HOURLY_MACHINE_DETAIL_LAYOUT_FIX_V1 */
.pm-vdash-columns {
  align-items: flex-start !important;
}

.pm-vdash-columns > .section-card {
  min-width: 0 !important;
  align-self: flex-start !important;
}

.pm-vdash-columns > .section-card:first-child {
  overflow: hidden;
}

.pm-vdash-columns > .section-card:nth-child(2) {
  height: auto !important;
  align-self: flex-start !important;
}

#pmv2DashHourly,
#pmv2HourlyMachineDetails,
.pmv2-hourly-machine-details,
.pmv2-hourly-machine-grid,
.pmv2-hourly-machine-card {
  min-width: 0;
  max-width: 100%;
}

.pmv2-hourly-machine-details {
  overflow: hidden;
}

.pmv2-hourly-machine-card {
  overflow: hidden;
}

.pmv2-hourly-machine-bars {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto !important;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.pmv2-hourly-machine-bar-wrap {
  flex: 0 0 54px;
}


/* SGI — seleção múltipla de áreas/subáreas e normas nas atas */
.sgi-checkbox-block {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 12px 14px;
}

.sgi-checkbox-block > label {
  display: block;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.sgi-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.sgi-check-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.sgi-check-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  background: #ffffff;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
  color: var(--gray-700);
}

.sgi-check-option:hover {
  border-color: rgba(42, 82, 152, .35);
  box-shadow: 0 4px 14px rgba(26, 58, 107, .08);
  transform: translateY(-1px);
}

.sgi-check-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-light);
}

.sgi-check-option:has(input:checked) {
  border-color: rgba(39, 174, 96, .65);
  background: #f0fdf4;
  color: #166534;
}

.sgi-check-hint {
  display: block;
  margin-top: 8px;
  color: var(--gray-500);
  font-size: .82rem;
}

.sgi-check-empty {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--gray-50);
  color: var(--gray-500);
  border: 1px dashed var(--gray-300);
}


/* SGI — Sprint 1 Atas v1.1: chips, filtros e cards */
.sgi-ata-filter-grid {
  align-items: end;
}

.sgi-ata-filter-actions {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.sgi-ata-chip-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.sgi-card-chip-group small {
  display: block;
  margin-bottom: 5px;
  color: var(--gray-500);
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.sgi-mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 2px 4px 2px 0;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(26, 58, 107, .14);
  background: #ffffff;
  color: var(--gray-700);
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.2;
}

.sgi-mini-chip.unit {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.sgi-mini-chip.area {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.sgi-mini-chip.norma {
  background: #fefce8;
  border-color: #fde68a;
  color: #854d0e;
}

.sgi-mini-chip.muted {
  background: var(--gray-50);
  color: var(--gray-500);
  border-style: dashed;
}

@media (min-width: 900px) {
  .sgi-ata-chip-stack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .sgi-ata-filter-grid {
    grid-template-columns: 1fr !important;
  }

  .sgi-ata-card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .sgi-ata-card-actions > div {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
}


/* SGI — ajuste fino mobile: unidades múltiplas e checkboxes compactos */
.sgi-check-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.sgi-check-unit-group {
  padding: 10px 0 12px;
  border-top: 1px solid var(--gray-200);
}

.sgi-check-unit-group:first-child {
  border-top: 0;
  padding-top: 0;
}

.sgi-check-unit-title {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.sgi-other-area-box {
  margin-top: 10px;
  padding: 12px;
  border: 1px dashed var(--gray-300);
  border-radius: 12px;
  background: var(--gray-50);
}

.sgi-other-area-box label {
  font-weight: 700;
}

.sgi-checkbox-block .sgi-check-option {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 9px !important;
  min-height: 42px !important;
  padding: 8px 11px !important;
  border-radius: 12px !important;
  text-align: left !important;
}

.sgi-checkbox-block .sgi-check-option input {
  flex: 0 0 auto !important;
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
}

.sgi-checkbox-block .sgi-check-option span {
  display: inline !important;
  line-height: 1.25 !important;
}

@media (max-width: 700px) {
  .sgi-checkbox-block {
    padding: 10px !important;
  }

  .sgi-check-grid,
  .sgi-check-grid-compact {
    grid-template-columns: 1fr !important;
    gap: 7px !important;
  }

  .sgi-check-actions .btn {
    width: 100%;
  }

  .sgi-checkbox-block .sgi-check-option {
    min-height: 40px !important;
    padding: 8px 10px !important;
  }
}


/* SGI — Fase 2: detalhe completo da ata */
.sgi-ata-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  justify-content: flex-end;
  pointer-events: auto;
}

.sgi-ata-detail-modal.hidden {
  display: none;
}

.sgi-ata-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .52);
  backdrop-filter: blur(3px);
}

.sgi-ata-detail-panel {
  position: relative;
  z-index: 1;
  width: min(880px, 96vw);
  height: 100vh;
  overflow-y: auto;
  background: #ffffff;
  box-shadow: -18px 0 50px rgba(15, 23, 42, .28);
  padding: 28px;
  outline: none;
}

.sgi-ata-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 16px;
  margin-bottom: 14px;
}

.sgi-ata-detail-header h4 {
  margin: 4px 0;
  color: var(--primary);
  font-size: 1.45rem;
  line-height: 1.2;
}

.sgi-ata-detail-header p {
  margin: 0;
  color: var(--gray-500);
  font-weight: 600;
}

.sgi-ata-detail-close {
  border: 0;
  background: var(--gray-100);
  color: var(--gray-700);
  width: 38px;
  height: 38px;
  border-radius: 999px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.sgi-ata-detail-status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--gray-500);
  font-weight: 700;
}

.sgi-ata-detail-chip-zone {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  margin-bottom: 16px;
}

.sgi-ata-detail-chip-zone small {
  display: block;
  margin-bottom: 6px;
  color: var(--gray-500);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.sgi-ata-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.sgi-ata-detail-row {
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 10px 12px;
  background: #ffffff;
}

.sgi-ata-detail-row span {
  display: block;
  color: var(--gray-500);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.sgi-ata-detail-row strong {
  color: var(--gray-800);
  font-size: .92rem;
  overflow-wrap: anywhere;
}

.sgi-ata-detail-content {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.sgi-ata-detail-text-block,
.sgi-ata-detail-section {
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 14px;
  background: #ffffff;
}

.sgi-ata-detail-text-block h6,
.sgi-ata-detail-section h5 {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: .95rem;
  font-weight: 900;
}

.sgi-ata-detail-text-block p {
  margin: 0;
  color: var(--gray-700);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.sgi-ata-detail-section {
  margin-bottom: 14px;
}

.sgi-ata-detail-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sgi-ata-attachment-list {
  display: grid;
  gap: 8px;
}

.sgi-ata-attachment-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 10px;
  text-decoration: none;
  color: var(--gray-800);
  background: var(--gray-50);
  transition: var(--transition);
}

.sgi-ata-attachment-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.sgi-ata-attachment-card strong,
.sgi-ata-attachment-card small {
  display: block;
}

.sgi-ata-attachment-card small {
  color: var(--gray-500);
  overflow-wrap: anywhere;
}

.sgi-ata-history-timeline {
  position: relative;
  display: grid;
  gap: 10px;
}

.sgi-ata-history-event {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 8px;
  align-items: start;
}

.sgi-ata-history-event > span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary-light);
  margin-top: 6px;
}

.sgi-ata-history-event strong,
.sgi-ata-history-event small {
  display: block;
}

.sgi-ata-history-event small {
  color: var(--gray-500);
}

.sgi-ata-history-event p {
  margin: 4px 0 0;
  color: var(--gray-600);
}

.sgi-ata-detail-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 14px;
  margin-top: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.82), #ffffff 40%);
  border-top: 1px solid var(--gray-200);
}

.sgi-empty-state.compact {
  padding: 12px;
  font-size: .9rem;
}

@media (max-width: 760px) {
  .sgi-ata-detail-panel {
    width: 100vw;
    padding: 18px 14px 26px;
  }

  .sgi-ata-detail-header {
    align-items: flex-start;
  }

  .sgi-ata-detail-header h4 {
    font-size: 1.15rem;
  }

  .sgi-ata-detail-chip-zone,
  .sgi-ata-detail-grid {
    grid-template-columns: 1fr;
  }

  .sgi-ata-detail-status-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .sgi-ata-detail-actions {
    flex-direction: column;
  }

  .sgi-ata-detail-actions .btn {
    width: 100%;
  }
}


/* SGI — Fase 2: histórico real de alterações por campo */
.sgi-ata-change-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.sgi-ata-change-item {
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 10px;
  background: #f8fafc;
}

.sgi-ata-change-item > strong {
  display: block;
  margin-bottom: 7px;
  color: var(--primary);
  font-size: .86rem;
}

.sgi-ata-change-values {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

.sgi-ata-change-values span {
  display: block;
  border: 1px solid var(--gray-200);
  background: #ffffff;
  border-radius: 10px;
  padding: 8px;
  color: var(--gray-700);
  overflow-wrap: anywhere;
}

.sgi-ata-change-values small {
  display: block;
  margin-bottom: 3px;
  color: var(--gray-500);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.sgi-ata-change-values b {
  display: flex;
  align-items: center;
  color: var(--gray-400);
  font-size: 1rem;
}

.sgi-ata-change-item em {
  display: block;
  margin-top: 7px;
  color: var(--gray-600);
  font-style: normal;
  font-size: .82rem;
}

.sgi-ata-change-item.simple p {
  margin: 0;
  color: var(--gray-700);
}

@media (max-width: 700px) {
  .sgi-ata-change-values {
    grid-template-columns: 1fr;
  }

  .sgi-ata-change-values b {
    justify-content: center;
    transform: rotate(90deg);
  }
}

/* SGI - resumo de pendências no card da ata */
.sgi-ata-card-pending-summary p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 4.8em;
}

.sgi-ata-card-pending-summary small {
  display: block;
  margin-top: 6px;
  font-weight: 600;
}

/* SGI - painel de pendências das atas */
.sgi-pending-action-card h6 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sgi-pending-origin {
  margin-top: 4px;
}

.sgi-pending-mini-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.sgi-pending-mini-badges span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.76rem;
  font-weight: 700;
}

.sgi-pending-action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sgi-pending-evidence-box {
  min-width: 240px;
}

.sgi-pending-evidence-box .sgi-file-link-list {
  margin-bottom: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PCP — Fase 1: Botões de seleção, badges de prioridade/ABC e KPIs coloridos
   ═══════════════════════════════════════════════════════════════════════════ */

/* Grupo de botões de seleção (prioridade, ABC, material) */
.pcp-btn-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

/* Base dos botões de prioridade */
.pcp-priority-btn {
  padding: 5px 14px;
  border-radius: 8px;
  border: 2px solid transparent;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  background: #f1f5f9;
  color: #475569;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.pcp-priority-btn:hover { background: #e2e8f0; }
.pcp-priority-normal.active  { background: #dcfce7; border-color: #86efac; color: #166534; }
.pcp-priority-urgente.active { background: #fef9c3; border-color: #fde047; color: #854d0e; }
.pcp-priority-emergencial.active { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }

/* Botões ABC */
.pcp-abc-btn {
  padding: 5px 14px;
  border-radius: 8px;
  border: 2px solid transparent;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  background: #f1f5f9;
  color: #475569;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  min-width: 40px;
  text-align: center;
}
.pcp-abc-btn:hover { background: #e2e8f0; }
.pcp-abc-a.active { background: #dbeafe; border-color: #93c5fd; color: #1e40af; }
.pcp-abc-b.active { background: #dcfce7; border-color: #86efac; color: #166534; }
.pcp-abc-c.active { background: #f1f5f9; border-color: #94a3b8; color: #334155; }

/* Botões de material */
.pcp-material-btn {
  padding: 5px 14px;
  border-radius: 8px;
  border: 2px solid transparent;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  background: #f1f5f9;
  color: #475569;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.pcp-material-btn:hover { background: #e2e8f0; }
.pcp-material-btn.active { background: #ede9fe; border-color: #c4b5fd; color: #5b21b6; }

/* Badges inline nas colunas kanban e tabela */
.pcp-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}
.pcp-badge-emergencial { background: #fee2e2; color: #991b1b; }
.pcp-badge-urgente     { background: #fef9c3; color: #854d0e; }
.pcp-badge-normal      { background: #dcfce7; color: #166534; }
.pcp-badge-abc-a       { background: #dbeafe; color: #1e40af; }
.pcp-badge-abc-b       { background: #dcfce7; color: #166534; }
.pcp-badge-abc-c       { background: #f1f5f9; color: #475569; }
.pcp-badge-info        { background: #f0f9ff; color: #0369a1; }

/* KPI cards com borda superior colorida */
.pcp-kpi-emergencial { border-top: 3px solid #f87171 !important; }
.pcp-kpi-urgente     { border-top: 3px solid #facc15 !important; }
.pcp-kpi-vencendo    { border-top: 3px solid #fb923c !important; }

/* ── Aba Programação PCP ─────────────────────────────────────────────────── */

/* Grid de cards de máquinas — 5 colunas fixas, estilo protótipo */
.pcp-maquinas-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}

@media (max-width: 1200px) {
  .pcp-maquinas-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .pcp-maquinas-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .pcp-maquinas-grid { grid-template-columns: repeat(2, 1fr); }
}

.pcp-maquina-card {
  background: var(--white);
  border: 1px solid #dce3ef;
  border-left: 4px solid #1a3a6b;
  border-radius: 8px;
  padding: 10px 12px 10px;
  font-size: 0.85rem;
  transition: box-shadow 0.15s, border-left-color 0.2s;
  position: relative;
  min-width: 0;        /* essencial para o grid truncar o conteúdo */
  overflow: hidden;
}

.pcp-maquina-card:hover {
  box-shadow: 0 3px 12px rgba(26,58,107,0.12);
}

.pcp-maquina-card.ocupacao-warning {
  border-left-color: #f59e0b;
}

.pcp-maquina-card.ocupacao-danger {
  border-left-color: #ef4444;
}

/* Badge de OPs — canto superior direito, laranja como no protótipo */
.pcp-maquina-ops-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #f97316;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 20px;
  padding: 2px 9px;
  white-space: nowrap;
}

.pcp-maquina-ops-badge.zero {
  background: #e5e7eb;
  color: #6b7280;
}

/* Código da máquina — grande, negrito, cor primária */
.pcp-maquina-codigo {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a3a6b;
  margin-bottom: 0;
  padding-right: 52px; /* espaço para o badge */
}

/* Capacidade e ciclo — linha cinza abaixo do código */
.pcp-maquina-info {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 5px;
}

/* Barra de ocupação */
.pcp-maquina-bar-wrap {
  height: 4px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 3px;
}

.pcp-maquina-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
  min-width: 2px;
}

/* Percentual de ocupação */
.pcp-maquina-pct {
  font-size: 0.73rem;
  font-weight: 600;
  margin-bottom: 5px;
}

/* Molde ativo — truncado em uma linha */
.pcp-maquina-moldes {
  font-size: 0.73rem;
  color: #4b5563;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  display: block;
}

.pcp-maquina-moldes strong {
  font-weight: 600;
  color: #374151;
}

/* Nome do cliente na OP ativa — destaque */
.pcp-maquina-cliente {
  font-size: 0.75rem;
  font-weight: 700;
  color: #1a3a6b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
}

/* Nome do produto + tag do molde */
.pcp-maquina-produto {
  font-size: 0.70rem;
  color: #4b5563;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Tag do molde — pill cinza */
.pcp-maquina-molde-tag {
  display: inline-block;
  background: #e5e7eb;
  color: #374151;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Estado livre — cinza itálico */
.pcp-maquina-livre {
  font-size: 0.72rem;
  color: #9ca3af;
  margin-top: 3px;
}

/* Lista de OPs na fila */
.pcp-ops-fila {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pcp-op-fila-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.84rem;
}

.pcp-op-fila-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.pcp-op-fila-produto {
  color: var(--gray-600);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pcp-op-fila-actions {
  flex-shrink: 0;
}

/* Modal de sugestão de máquina */
.pcp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pcp-modal-overlay.hidden {
  display: none;
}

.pcp-modal-box {
  background: var(--white);
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.pcp-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--gray-200);
}

.pcp-modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--gray-500);
  line-height: 1;
  padding: 0 4px;
}

.pcp-modal-close:hover {
  color: var(--gray-800);
}

.pcp-modal-body {
  padding: 16px 20px;
}

.pcp-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--gray-200);
}
/* ── fim Aba Programação PCP ─────────────────────────────────────────────── */

/* ── Banner cabeçalho da aba Programação (estilo protótipo) ─────────────── */

.pcp-prog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #0f2347 0%, #1a3a6b 60%, #2a5298 100%);
  border-radius: 12px 12px 0 0;
  padding: 20px 28px;
  gap: 16px;
}

.pcp-prog-header-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pcp-prog-header-kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}

.pcp-prog-header-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.2;
}

.pcp-prog-header-sub {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
  margin: 0;
}

.pcp-prog-header-btn {
  background: #fff;
  color: #1a3a6b;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.pcp-prog-header-btn:hover {
  background: #e8eef8;
  box-shadow: 0 4px 14px rgba(0,0,0,0.22);
}

/* ── KPI row da Programação ─────────────────────────────────────────────── */

.pcp-kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

@media (max-width: 1100px) {
  .pcp-kpi-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .pcp-kpi-row { grid-template-columns: repeat(2, 1fr); }
}

.pcp-kpi-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-top: 4px solid #1a3a6b;
  border-radius: 10px;
  padding: 16px 18px 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.pcp-kpi-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.pcp-kpi-label {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
}

/* ── Label de seção dentro do painel ────────────────────────────────────── */

.pcp-section-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1a3a6b;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e8eef8;
  letter-spacing: 0.01em;
}

/* ── fim estilos cabeçalho Programação ──────────────────────────────────── */


/* ═══════════════════════════════════════════════════════════════════════════
   CALENDÁRIO DE PROGRAMAÇÃO PCP
   ═══════════════════════════════════════════════════════════════════════════ */

/* Tabela principal do calendário */
.pcp-calendario-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-size: 12px;
  background: #0f172a;
}

/* Cabeçalho — coluna de máquina */
.pcp-cal-th-maquina {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #1e293b;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 10px;
  border-right: 2px solid #334155;
  border-bottom: 1px solid #334155;
  white-space: nowrap;
  min-width: 110px;
}

/* Cabeçalho — coluna de dia */
.pcp-cal-th-dia {
  background: #1e293b;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  padding: 6px 4px;
  border-right: 1px solid #1e293b;
  border-bottom: 1px solid #334155;
  min-width: 72px;
  max-width: 90px;
  white-space: nowrap;
  line-height: 1.3;
}

/* Destaque para o dia de hoje */
.pcp-cal-th-dia.pcp-cal-hoje,
.pcp-cal-td-vazio.pcp-cal-hoje,
.pcp-cal-td-ocupado.pcp-cal-hoje {
  background: rgba(59, 130, 246, 0.08) !important;
  border-left: 2px solid #3b82f6 !important;
  border-right: 2px solid #3b82f6 !important;
}

.pcp-cal-th-dia.pcp-cal-hoje {
  color: #60a5fa;
  font-weight: 800;
}

/* Coluna fixa de máquina */
.pcp-cal-td-maquina {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #1e293b;
  color: #f1f5f9;
  padding: 6px 10px;
  border-right: 2px solid #334155;
  border-bottom: 1px solid #1e293b;
  white-space: nowrap;
  min-width: 110px;
  vertical-align: middle;
  display: table-cell;
}

.pcp-cal-td-maquina strong {
  display: block;
  font-size: 13px;
  color: #e2e8f0;
  font-weight: 700;
}

.pcp-cal-maq-nome {
  display: block;
  font-size: 10px;
  color: #64748b;
  margin-top: 1px;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Coluna de info (ciclo / prod.dia) */
.pcp-cal-td-info {
  position: sticky;
  left: 110px;
  z-index: 2;
  background: #162032;
  padding: 4px 8px;
  border-right: 2px solid #334155;
  border-bottom: 1px solid #1e293b;
  white-space: nowrap;
  min-width: 80px;
  vertical-align: middle;
  text-align: center;
}

/* Célula vazia */
.pcp-cal-td-vazio {
  background: #0f172a;
  border-right: 1px solid #1e293b;
  border-bottom: 1px solid #1e293b;
  min-width: 72px;
  max-width: 90px;
  height: 48px;
  vertical-align: top;
}

/* Célula ocupada */
.pcp-cal-td-ocupado {
  background: #0f172a;
  border-right: 1px solid #1e293b;
  border-bottom: 1px solid #1e293b;
  min-width: 72px;
  max-width: 90px;
  padding: 2px;
  vertical-align: top;
  height: 48px;
}

/* Bloco de OP dentro da célula */
.pcp-cal-bloco {
  border-radius: 4px;
  padding: 3px 5px;
  margin-bottom: 2px;
  cursor: default;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1px;
  transition: filter 0.15s;
}

.pcp-cal-bloco:hover {
  filter: brightness(1.15);
}

.pcp-cal-bloco-cliente {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.pcp-cal-bloco-pedido {
  font-size: 9px;
  color: rgba(255,255,255,0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.pcp-cal-bloco-qty {
  font-size: 9px;
  color: rgba(255,255,255,0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

/* Linha de zebra para facilitar leitura */
.pcp-calendario-table tbody tr:nth-child(even) .pcp-cal-td-vazio,
.pcp-calendario-table tbody tr:nth-child(even) .pcp-cal-td-ocupado {
  background: #111827;
}

.pcp-calendario-table tbody tr:nth-child(even) .pcp-cal-td-maquina,
.pcp-calendario-table tbody tr:nth-child(even) .pcp-cal-td-info {
  background: #172033;
}

/* Cabeçalho fixo ao rolar verticalmente */
.pcp-calendario-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
}

.pcp-cal-th-maquina {
  z-index: 5 !important;
}

/* ── fim estilos Calendário de Programação ─────────────────────────────── */


/* Comercial — tabela de reenvio de pedidos */

.commercial-resend-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin: 18px 0 8px;
  padding: 16px;
  border: 1px solid #dce3ed;
  border-radius: 10px;
  background: #f8fafc;
}

.commercial-resend-search-wrap {
  flex: 1 1 430px;
  min-width: 260px;
}

.commercial-resend-limit-wrap {
  flex: 0 0 150px;
}

.commercial-resend-toolbar label {
  display: block;
  margin-bottom: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 600;
}

.commercial-resend-search,
.commercial-resend-limit {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  background: #fff;
}

.commercial-resend-search {
  padding: 0 13px;
}

.commercial-resend-limit {
  padding: 0 10px;
}

.commercial-resend-refresh {
  min-height: 42px;
  white-space: nowrap;
}

.commercial-resend-count {
  margin: 8px 0 12px;
  color: #667085;
  font-size: 13px;
  font-weight: 500;
}

.commercial-resend-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e1e7ef;
  border-radius: 10px;
  background: #fff;
}

.commercial-resend-table {
  width: 100%;
  min-width: 1120px;
  table-layout: fixed;
  margin: 0;
}

.commercial-resend-table th {
  padding: 12px 10px;
  background: #f4f7fb;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
  vertical-align: middle;
}

.commercial-resend-table td {
  padding: 13px 10px;
  border-top: 1px solid #edf1f6;
  color: #263244;
  font-size: 13px;
  line-height: 1.4;
  vertical-align: middle;
}

.commercial-resend-table tbody tr:hover {
  background: #f9fbfd;
}

.commercial-resend-table th:nth-child(1),
.commercial-resend-table td:nth-child(1) {
  width: 105px;
}

.commercial-resend-table th:nth-child(2),
.commercial-resend-table td:nth-child(2) {
  width: 115px;
}

.commercial-resend-table th:nth-child(3),
.commercial-resend-table td:nth-child(3) {
  width: 190px;
}

.commercial-resend-table th:nth-child(4),
.commercial-resend-table td:nth-child(4) {
  width: 315px;
}

.commercial-resend-table th:nth-child(5),
.commercial-resend-table td:nth-child(5) {
  width: 145px;
}

.commercial-resend-table th:nth-child(6),
.commercial-resend-table td:nth-child(6) {
  width: 145px;
}

.commercial-resend-table th:nth-child(7),
.commercial-resend-table td:nth-child(7) {
  width: 140px;
}

.commercial-resend-date-cell strong {
  display: block;
  white-space: nowrap;
  color: #1f2937;
}

.commercial-resend-date-cell small,
.commercial-resend-unit-cell small {
  display: block;
  margin-top: 3px;
  color: #667085;
}

.commercial-resend-client,
.commercial-resend-subject {
  overflow: hidden;
  text-overflow: ellipsis;
}

.commercial-resend-client {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-weight: 600;
}

.commercial-resend-subject {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #162f54;
  font-weight: 700;
  line-height: 1.35;
}

.commercial-resend-id {
  margin-top: 5px;
  color: #7b8798;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.commercial-email-status {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.commercial-email-status-success {
  border: 1px solid #a7e2bd;
  background: #eaf8ef;
  color: #176b38;
}

.commercial-email-status-error {
  border: 1px solid #f2b8b5;
  background: #fff0ef;
  color: #a12a24;
}

.commercial-email-status-warning {
  border: 1px solid #f2d28b;
  background: #fff8e6;
  color: #8a5a00;
}

.commercial-email-status-neutral {
  border: 1px solid #d7dde5;
  background: #f3f5f8;
  color: #596579;
}

.commercial-resend-history,
.commercial-resend-last-attempt {
  margin-top: 5px;
  color: #707b8d;
  font-size: 11px;
}

.commercial-resend-action-cell {
  text-align: center;
}

.commercial-resend-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 122px;
  min-height: 38px;
  white-space: nowrap;
}

.commercial-resend-action-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.commercial-resend-empty,
.commercial-resend-loading {
  padding: 28px !important;
  color: #667085 !important;
  text-align: center;
}

@media (max-width: 900px) {
  .commercial-resend-toolbar {
    align-items: stretch;
  }

  .commercial-resend-search-wrap,
  .commercial-resend-limit-wrap {
    flex: 1 1 100%;
  }

  .commercial-resend-refresh {
    width: 100%;
  }
}


/* Comercial — ajuste final de largura e posição */

.commercial-resend-scroll {
  scroll-behavior: auto;
  scrollbar-gutter: stable;
}

.commercial-resend-table {
  min-width: 1030px;
}

.commercial-resend-table th:nth-child(1),
.commercial-resend-table td:nth-child(1) {
  width: 145px;
}

.commercial-resend-table th:nth-child(2),
.commercial-resend-table td:nth-child(2) {
  width: 180px;
}

.commercial-resend-table th:nth-child(3),
.commercial-resend-table td:nth-child(3) {
  width: 300px;
}

.commercial-resend-table th:nth-child(4),
.commercial-resend-table td:nth-child(4) {
  width: 130px;
}

.commercial-resend-table th:nth-child(5),
.commercial-resend-table td:nth-child(5) {
  width: 145px;
}

.commercial-resend-table th:nth-child(6),
.commercial-resend-table td:nth-child(6) {
  width: 130px;
}

.commercial-resend-register-cell strong {
  display: block;
  color: #1f2937;
  white-space: nowrap;
}

.commercial-resend-register-cell small {
  display: block;
  margin-top: 2px;
  color: #667085;
  white-space: nowrap;
}

.commercial-resend-register-seller {
  max-width: 130px;
  margin-top: 7px;
  overflow: hidden;
  color: #344054;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commercial-resend-client-cell {
  overflow: hidden;
}

.commercial-resend-action-button {
  min-width: 118px;
}


/* Comercial — encaixe integral das seis colunas */

/*
 * No desktop, todas as seis colunas ficam visíveis simultaneamente.
 * Em telas menores, a rolagem horizontal continua disponível.
 */
@media (min-width: 1201px) {
  .commercial-resend-scroll {
    overflow-x: hidden;
  }

  .commercial-resend-table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
  }

  .commercial-resend-table th,
  .commercial-resend-table td {
    box-sizing: border-box;
    min-width: 0 !important;
    padding-left: 9px;
    padding-right: 9px;
    overflow: hidden;
  }

  /* Registro */
  .commercial-resend-table th:nth-child(1),
  .commercial-resend-table td:nth-child(1) {
    width: 14% !important;
  }

  /* Cliente */
  .commercial-resend-table th:nth-child(2),
  .commercial-resend-table td:nth-child(2) {
    width: 18% !important;
  }

  /* Pedido */
  .commercial-resend-table th:nth-child(3),
  .commercial-resend-table td:nth-child(3) {
    width: 31% !important;
  }

  /* Unidade / Produto */
  .commercial-resend-table th:nth-child(4),
  .commercial-resend-table td:nth-child(4) {
    width: 13% !important;
  }

  /* E-mail */
  .commercial-resend-table th:nth-child(5),
  .commercial-resend-table td:nth-child(5) {
    width: 14% !important;
  }

  /* Ação */
  .commercial-resend-table th:nth-child(6),
  .commercial-resend-table td:nth-child(6) {
    width: 10% !important;
  }

  .commercial-resend-register-seller {
    max-width: 100%;
  }

  .commercial-resend-subject {
    -webkit-line-clamp: 2;
  }

  .commercial-resend-status-cell {
    overflow: visible !important;
  }

  .commercial-resend-history,
  .commercial-resend-last-attempt {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
  }

  .commercial-resend-action-cell {
    padding-left: 5px !important;
    padding-right: 5px !important;
  }

  .commercial-resend-action-button {
    width: 100%;
    min-width: 0 !important;
    min-height: 38px;
    padding-left: 5px;
    padding-right: 5px;
    font-size: 12px;
    white-space: nowrap;
  }
}

/* Em telas menores, preservar usabilidade por rolagem. */
@media (max-width: 1200px) {
  .commercial-resend-scroll {
    overflow-x: auto;
  }

  .commercial-resend-table {
    width: 100%;
    min-width: 980px !important;
  }
}

/* QUALIDADE — MODAIS MÓVEIS E SELEÇÃO SEGURA — 20260704 */

#enc-modal-overlay .qual-enc-form-row {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

#enc-modal-overlay
.qual-enc-form-row
> .form-group {
  min-width: 0;
  margin-bottom: 0;
}

#enc-modal-overlay
.qual-enc-form-row
input,
#enc-modal-overlay
.qual-enc-form-row
select {
  width: 100%;
  min-width: 0;
}

#vinc-submit-btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

#vinc-submit-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

@media (max-width: 700px) {
  #enc-modal-overlay .qual-enc-form-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  #enc-modal-overlay
  .qual-enc-form-row
  > .form-group {
    margin-bottom: 18px;
  }

  #enc-modal-overlay .modal-box,
  #vinc-modal-overlay .modal-box {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    max-height: calc(100dvh - 24px);
  }

  #enc-modal-overlay .modal-body,
  #vinc-modal-overlay .modal-body {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  #enc-modal-overlay .modal-footer,
  #vinc-modal-overlay .modal-footer {
    flex-wrap: wrap;
    gap: 10px;
  }

  #enc-modal-overlay .modal-footer .btn,
  #vinc-modal-overlay .modal-footer .btn {
    min-height: 46px;
  }
}
