/* =========================================================
   SHARED UI — botões, cards, badges, tabela base
   Prefixo .ab-* — usado por vários módulos, mas sem regras
   específicas de Dashboard/Máquinas/Financeiro.
   ========================================================= */
.ab-btn, .btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border: 0; border-radius: 8px; padding: 0.55rem 1rem;
  background: var(--ab-accent); color: #fff; font-weight: 600; font-size: 0.875rem; cursor: pointer;
}
.ab-btn:hover, .btn-primary:hover { background: var(--ab-accent-hover); color: #fff; }
.ab-btn-ghost, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border: 1px solid var(--ab-border); border-radius: 8px; padding: 0.55rem 1rem;
  background: transparent; color: var(--ab-text); font-size: 0.875rem; cursor: pointer;
}
.ab-btn-ghost:hover, .btn-ghost:hover { border-color: var(--ab-accent); color: var(--ab-accent-hover); }

.ab-card, .panel {
  background: var(--ab-card); border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius); padding: 1.1rem;
}

.ab-kpi-grid { display: grid; gap: 0.85rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .ab-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .ab-kpi-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.ab-kpi { position: relative; overflow: hidden; }
.ab-kpi .label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ab-muted); margin: 0; }
.ab-kpi .value { font-size: 1.35rem; font-weight: 700; margin: 0.35rem 0 0.2rem; }
.ab-kpi .meta { font-size: 0.75rem; color: var(--ab-muted); margin: 0; }
.ab-kpi .meta.up { color: var(--ab-green); }
.ab-kpi .meta.down { color: var(--ab-red); }

.ab-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600;
}
.ab-badge::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.ab-badge-ok { background: rgba(34,197,94,0.15); color: var(--ab-green); }
.ab-badge-warn { background: rgba(234,179,8,0.15); color: var(--ab-yellow); }
.ab-badge-danger { background: rgba(239,68,68,0.15); color: var(--ab-red); }
.ab-badge-info { background: rgba(56,189,248,0.15); color: var(--ab-blue); }
.ab-badge-muted { background: rgba(148,163,184,0.12); color: var(--ab-muted); }

.ab-toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-bottom: 0.85rem; }
.ab-toolbar .grow { flex: 1; min-width: 180px; }
.ab-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.75rem; }
.ab-chip {
  font-size: 0.75rem; padding: 0.25rem 0.55rem; border-radius: 999px;
  background: var(--ab-accent-soft); color: var(--ab-accent-hover);
}

.ab-table-wrap { overflow-x: auto; }
table.ab-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.ab-table th {
  text-align: left; color: var(--ab-muted); font-weight: 500;
  padding: 0.65rem 0.5rem; border-bottom: 1px solid var(--ab-border); white-space: nowrap;
}
table.ab-table td { padding: 0.7rem 0.5rem; border-bottom: 1px solid rgba(51, 65, 85, 0.55); vertical-align: middle; }
table.ab-table tr:hover td { background: rgba(255,255,255,0.02); }
table.ab-table tr.is-selected td { background: var(--ab-accent-soft); }
.ab-row-link { display: flex; align-items: center; gap: 0.65rem; }
.ab-thumb {
  width: 40px; height: 40px; border-radius: 8px; background: var(--ab-card-2);
  border: 1px solid var(--ab-border); display: grid; place-items: center;
  font-size: 0.7rem; color: var(--ab-muted); flex-shrink: 0; overflow: hidden;
}
.ab-thumb img { width: 100%; height: 100%; object-fit: cover; }

.ab-split { display: grid; gap: 1rem; }
@media (min-width: 1100px) {
  .ab-split.has-panel { grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); align-items: start; }
}
.ab-side {
  background: var(--ab-card); border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius); padding: 1rem; position: sticky; top: 0.75rem;
}
.ab-side-head { display: flex; gap: 0.75rem; align-items: flex-start; margin-bottom: 0.85rem; }
.ab-side-head h2 { margin: 0; font-size: 1rem; }
.ab-tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; border-bottom: 1px solid var(--ab-border); margin-bottom: 0.85rem; }
.ab-tabs a, .ab-tabs span {
  padding: 0.45rem 0.65rem; font-size: 0.78rem; color: var(--ab-muted); border-bottom: 2px solid transparent;
}
.ab-tabs a.active, .ab-tabs span.active { color: var(--ab-text); border-bottom-color: var(--ab-accent); }
.ab-side-foot {
  display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end;
  margin-top: 1rem; padding-top: 0.85rem; border-top: 1px solid var(--ab-border);
}

.ab-field { margin-bottom: 0.7rem; }
.ab-field label { display: block; font-size: 0.75rem; color: var(--ab-muted); margin-bottom: 0.25rem; }
.ab-field input, .ab-field select, .ab-field textarea,
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; background: var(--ab-bg); border: 1px solid var(--ab-border);
  border-radius: 8px; padding: 0.5rem 0.7rem; color: var(--ab-text);
}
.ab-field input:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ab-accent); }
.ab-fields-2 { display: grid; gap: 0.6rem; grid-template-columns: 1fr 1fr; }

.ab-empty { text-align: center; color: var(--ab-muted); padding: 2rem 1rem; font-size: 0.9rem; }
.ab-list { list-style: none; margin: 0; padding: 0; }
.ab-list li {
  display: flex; gap: 0.65rem; align-items: center;
  padding: 0.55rem 0; border-bottom: 1px solid rgba(51,65,85,0.45); font-size: 0.85rem;
}
.ab-list li:last-child { border-bottom: 0; }
.ab-progress { height: 6px; background: #0f172a; border-radius: 999px; overflow: hidden; flex: 1; }
.ab-progress > span { display: block; height: 100%; background: var(--ab-accent); }

.flex { display: flex; } .flex-wrap { flex-wrap: wrap; } .items-center { align-items: center; }
.justify-between { justify-content: space-between; } .gap-2 { gap: 0.5rem; } .gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; } .w-full { width: 100%; } .text-sm { font-size: 0.875rem; }
.font-semibold { font-weight: 600; }
.mb-1 { margin-bottom: 0.25rem; } .mb-2 { margin-bottom: 0.5rem; } .mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; } .mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; } .mt-4 { margin-top: 1rem; }

/* aliases legado */
.text-ab-gold, .text-ab-gold-light { color: var(--ab-accent-hover); }
.text-red-300 { color: #fca5a5; }
.text-emerald-400 { color: #4ade80; }
