.card,
.chart-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card {
  padding: 24px;
}

/* ── Buttons ────────────────────────────────────────── */

.primary {
  background: var(--orange);
  color: #fff;
}

.primary:hover {
  background: var(--orange-dark);
}

.secondary {
  background: #f3f4f6;
  color: #565d66;
}

.secondary:hover {
  background: #e5e7eb;
}

.info {
  background: var(--blue);
}

.info:hover {
  background: #3d739e;
}

.danger {
  background: #c0392b;
  color: #fff;
}

.danger:hover {
  background: #a93226;
}

.small {
  padding: 8px 14px;
  font-size: 0.86rem;
}

.action-button {
  padding: 9px 13px;
  font-size: 0.9rem;
}

/* ── Form elements ──────────────────────────────────── */

.check-line {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: #5f6570;
}

.check-line input {
  width: 18px;
  min-height: 18px;
  box-shadow: none;
}

.form {
  display: grid;
  gap: 18px;
}

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

.help-text {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.45;
}

.form-actions,
.user-actions {
  gap: 10px;
  flex-wrap: wrap;
}

#login-form .form-actions {
  justify-content: center;
}

/* ── Feedback ───────────────────────────────────────── */

.message {
  min-height: 22px;
  margin-bottom: 0;
  color: var(--purple);
  font-weight: 700;
}

.message.error   { color: #c0392b; }
.message.success { color: #1a7a45; }

.empty-state {
  margin: 0;
  color: var(--muted);
}

/* ── Section headings ───────────────────────────────── */

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--purple);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-heading,
.list-header {
  margin-bottom: 18px;
}

.list-header {
  justify-content: space-between;
  gap: 16px;
}

.chart-head h2,
.list-header h2,
.section-heading h2 {
  margin: 0;
  color: #6a6f78;
  font-size: 1.12rem;
  letter-spacing: 0.1em;
}

/* ── Cards (usuarios / setores) ─────────────────────── */

.user-list,
.sector-list,
.placeholder-grid {
  display: grid;
  gap: 12px;
}

.user-card,
.sector-card,
.placeholder-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  background: #fbfbfc;
}

.user-card h3,
.sector-card h3,
.placeholder-card h3 {
  margin: 0 0 8px;
}

.user-card p,
.sector-card p,
.placeholder-card p {
  margin: 4px 0;
  color: var(--muted);
  line-height: 1.5;
}

.sector-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.sector-subtitle {
  margin-top: 2px;
  font-weight: 700;
}

.sector-meta {
  display: grid;
  gap: 2px;
  margin-top: 10px;
}

.sector-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 61, 16, 0.1);
  color: var(--orange-dark);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.path-chip {
  display: inline-block;
  padding: 8px 10px;
  border: 1px dashed #d7d9de;
  border-radius: 6px;
  background: #ffffff;
  color: #4d5560;
  font-family: "Courier New", monospace;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.user-actions {
  display: flex;
  margin-top: 14px;
}

/* ── Sector table ─────────────────────────────────── */

.sector-list-divider {
  height: 1px;
  background: var(--line);
  margin: 24px 0 20px;
}

.sector-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sector-table-wrap {
  overflow-x: auto;
}

.sector-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.st-head {
  text-align: left;
  padding: 8px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}

.st-head-actions {
  text-align: right;
}

.st-row {
  border-bottom: 1px solid var(--line);
  transition: background 0.12s;
}

.st-row:last-child {
  border-bottom: none;
}

.st-row:hover {
  background: #fafafa;
}

.st-cell {
  padding: 12px 12px;
  vertical-align: middle;
}

.st-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.st-sector-name {
  font-weight: 700;
  color: #1a1d23;
}

.st-sector-model {
  font-size: 0.78rem;
  color: var(--muted);
}

.st-type-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255,61,16,0.08);
  color: var(--orange-dark);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.st-type-sep {
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
}

.st-actions {
  text-align: right;
  white-space: nowrap;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.st-inline-msg {
  font-size: 0.82rem;
  font-weight: 600;
  color: #16a34a;
  white-space: nowrap;
}

.st-inline-msg.st-msg-error {
  color: #dc2626;
}

/* ── Sector modal ───────────────────────────────────── */

.sector-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.sector-modal-overlay.hidden { display: none; }

.sector-modal {
  background: #fff;
  border-radius: 14px;
  padding: 28px 32px;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}

.sector-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 20px;
}

.sector-caixa-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  cursor: pointer;
  user-select: none;
}

.sector-caixa-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--orange);
  cursor: pointer;
  flex-shrink: 0;
}

.sector-caixa-row label {
  display: block;
  color: #333;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  margin: 0;
  gap: 0;
}

.sector-caixa-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(234, 88, 12, 0.18);
  color: #ea580c;
  margin-left: 4px;
}

/* ── Responsive ─────────────────────────────────────── */

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

  .sector-card-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .st-head,
  .st-cell {
    padding: 8px 6px;
  }
}

/* ── Modal de confirmação global ────────────────────── */

.global-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.global-confirm-overlay.hidden { display: none; }

.global-confirm-box {
  background: #fff;
  border-radius: 14px;
  padding: 28px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}

.global-confirm-msg {
  margin: 0 0 20px;
  font-size: 1rem;
  color: #1a1a1a;
  text-align: center;
  line-height: 1.5;
}

.global-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
