/* ══════════════════════════════════════════════════════════
   OS-MVMSTI — Sistema de Gestão de Ordens de Serviço
   Identidade: oficina técnica / bancada de diagnóstico
══════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #0b1220;
  --surface: #121b2e;
  --surface2: #1a2740;
  --border: #243352;
  --border2: #2f4368;

  --text: #e7ecf5;
  --text-muted: #8a99b8;
  --text-dim: #4f5d7c;
  --text-on-accent: #07150f;

  --accent: #10b981;
  --accent-hover: #0d9c6f;
  --accent-glow-08: rgba(16,185,129,.08);
  --accent-glow-15: rgba(16,185,129,.15);
  --accent-glow-25: rgba(16,185,129,.25);
  --accent-glow-40: rgba(16,185,129,.40);

  --blue: #3b82f6; --blue-bg: rgba(59,130,246,.12); --blue-text: #93c5fd; --blue-border: rgba(59,130,246,.28);
  --amber: #f59e0b; --amber-bg: rgba(245,158,11,.13); --amber-text: #fcd34d; --amber-border: rgba(245,158,11,.3);
  --red: #ef4444; --red-bg: rgba(239,68,68,.12); --red-text: #fca5a5; --red-border: rgba(239,68,68,.28);
  --green: #10b981; --green-bg: rgba(16,185,129,.12); --green-text: #6ee7b7; --green-border: rgba(16,185,129,.28);
  --gray-bg: rgba(255,255,255,.05); --gray-dot: #64748b;

  --radius: 14px;
  --radius-sm: 9px;
  --font-display: 'Space Grotesk', sans-serif;
  --font: 'Inter', sans-serif;
  --mono: 'JetBrains Mono', monospace;

  --header-bg: rgba(11,18,32,.85);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface2: #eef1f7;
  --border: #dde3ee;
  --border2: #c8d2e3;

  --text: #101826;
  --text-muted: #5b6b88;
  --text-dim: #97a3ba;
  --text-on-accent: #ffffff;

  --accent: #059669;
  --accent-hover: #047857;
  --accent-glow-08: rgba(5,150,105,.07);
  --accent-glow-15: rgba(5,150,105,.13);
  --accent-glow-25: rgba(5,150,105,.2);
  --accent-glow-40: rgba(5,150,105,.32);

  --blue-bg: rgba(59,130,246,.1); --blue-text: #1d4ed8; --blue-border: rgba(59,130,246,.3);
  --amber-bg: rgba(245,158,11,.13); --amber-text: #92400e; --amber-border: rgba(245,158,11,.35);
  --red-bg: rgba(239,68,68,.1); --red-text: #b91c1c; --red-border: rgba(239,68,68,.3);
  --green-bg: rgba(5,150,105,.1); --green-text: #047857; --green-border: rgba(5,150,105,.3);
  --gray-bg: rgba(15,15,30,.05); --gray-dot: #64748b;

  --header-bg: rgba(243,245,249,.85);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  min-height: 100vh; -webkit-font-smoothing: antialiased;
  transition: background .2s, color .2s;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
::selection { background: var(--accent-glow-40); }

input, select, textarea {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 13px; color: var(--text);
  font-family: var(--font); font-size: .9rem; outline: none; transition: border-color .15s, background .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: var(--surface); }
input::placeholder, textarea::placeholder { color: var(--text-dim); }
textarea { resize: vertical; min-height: 70px; }
select { cursor: pointer; }
input[type="color"] { padding: 4px; height: 42px; cursor: pointer; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); cursor: pointer; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: .78rem; font-weight: 600; color: var(--text-muted); }
.field-hint { font-size: .72rem; color: var(--text-dim); line-height: 1.4; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.checkbox-row { display: flex; align-items: center; gap: 9px; }
.checkbox-row label { font-size: .85rem; color: var(--text); cursor: pointer; }

.btn-primary, .btn-secondary, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: none; border-radius: var(--radius-sm); font-family: var(--font);
  font-size: .85rem; font-weight: 600; padding: 10px 18px; cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--text-on-accent); box-shadow: 0 4px 16px var(--accent-glow-25); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 4px 20px var(--accent-glow-40); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border2); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--red-bg); color: var(--red-text); border: 1px solid var(--red-border); }
.btn-danger:hover { background: rgba(239,68,68,.2); }
.btn-icon {
  display: flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); cursor: pointer; transition: all .15s;
}
.btn-icon:hover { color: var(--text); border-color: var(--border2); background: var(--surface2); }
.btn-full { width: 100%; }

.spinner { width: 16px; height: 16px; border: 2px solid var(--spinner-track, rgba(255,255,255,.3)); border-top-color: var(--spinner-active, #fff); border-radius: 50%; animation: spin .6s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.badge-green { background: var(--green-bg); color: var(--green-text); } .badge-green::before { background: var(--green); }
.badge-blue { background: var(--blue-bg); color: var(--blue-text); } .badge-blue::before { background: var(--blue); }
.badge-amber { background: var(--amber-bg); color: var(--amber-text); } .badge-amber::before { background: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red-text); } .badge-red::before { background: var(--red); }
.badge-gray { background: var(--gray-bg); color: var(--text-muted); } .badge-gray::before { background: var(--gray-dot); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.section-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 14px; }
.alert-error { background: var(--red-bg); border: 1px solid var(--red-border); color: var(--red-text); border-radius: var(--radius-sm); padding: 10px 14px; font-size: .85rem; }
.alert-success { background: var(--green-bg); border: 1px solid var(--green-border); color: var(--green-text); border-radius: var(--radius-sm); padding: 10px 14px; font-size: .85rem; }
.alert-info { background: var(--blue-bg); border: 1px solid var(--blue-border); color: var(--blue-text); border-radius: var(--radius-sm); padding: 10px 14px; font-size: .85rem; }

.state-msg { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 56px 20px; color: var(--text-muted); font-size: .88rem; text-align: center; }
.state-icon { font-size: 2rem; opacity: .5; }

.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.table th { text-align: left; padding: 10px 14px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface2); }
.table tbody tr:last-child td { border-bottom: none; }
.td-actions { display: flex; gap: 6px; justify-content: flex-end; }
.mono { font-family: var(--mono); }
.td-numero { font-family: var(--mono); font-weight: 600; color: var(--accent); }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius); width: 100%; max-width: 540px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 24px 64px rgba(0,0,0,.5); }
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 980px; }

/* Modal tela cheia - layout dois painéis (desktop) */
.modal-fullscreen { max-width: 100%; max-height: 100%; width: 100%; height: 100%; border-radius: 0; border: none; }
.modal-overlay.overlay-fullscreen { padding: 0; }
.modal-fullscreen .modal-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 0; overflow: hidden; flex: 1; min-height: 0; }
.modal-fullscreen .form-col { padding: 24px 28px; overflow-y: auto; }
.modal-fullscreen .form-col:first-child { border-right: 1px solid var(--border); }
.modal-fullscreen .col-title { font-family: var(--font-display); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.modal-fullscreen .modal-header { border-radius: 0; }
.modal-fullscreen .modal-footer { border-radius: 0; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); flex-shrink: 0; }
.btn-close { background: none; border: none; color: var(--text-muted); font-size: 1.1rem; cursor: pointer; width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.btn-close:hover { background: var(--surface2); color: var(--text); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; }
.tab-btn { padding: 10px 16px; background: none; border: none; color: var(--text-muted); font-family: var(--font); font-size: .85rem; font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; transition: color .12s, border-color .12s; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.btn-theme-toggle { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted); cursor: pointer; flex-shrink: 0; }
.btn-theme-toggle:hover { color: var(--text); }
.btn-theme-toggle .icon-sun { display: none; }
[data-theme="light"] .btn-theme-toggle .icon-moon { display: none; }
[data-theme="light"] .btn-theme-toggle .icon-sun { display: block; }

/* Trilha de status — signature element: progresso da OS como trilha de circuito */
.trilha-status { display: flex; align-items: flex-start; overflow-x: auto; padding: 8px 2px 4px; gap: 0; }
.trilha-no { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; min-width: 86px; position: relative; }
.trilha-ponto { width: 14px; height: 14px; border-radius: 50%; background: var(--surface2); border: 2px solid var(--border2); z-index: 2; transition: all .2s; }
.trilha-no.feito .trilha-ponto { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow-15); }
.trilha-no.atual .trilha-ponto { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow-25); animation: pulse-no 2s ease-in-out infinite; }
.trilha-no.erro .trilha-ponto { background: var(--red); border-color: var(--red); box-shadow: 0 0 0 3px var(--red-border); }
@keyframes pulse-no { 0%, 100% { box-shadow: 0 0 0 4px var(--accent-glow-25); } 50% { box-shadow: 0 0 0 7px var(--accent-glow-08); } }
.trilha-linha { position: absolute; top: 6px; left: -50%; width: 100%; height: 2px; background: var(--border2); z-index: 1; }
.trilha-no:first-child .trilha-linha { display: none; }
.trilha-no.feito .trilha-linha, .trilha-no.atual .trilha-linha { background: var(--accent); }
.trilha-label { font-size: .66rem; color: var(--text-dim); text-align: center; margin-top: 8px; line-height: 1.3; max-width: 86px; }
.trilha-no.feito .trilha-label, .trilha-no.atual .trilha-label { color: var(--text); font-weight: 600; }

.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 14px; padding-bottom: 18px; position: relative; }
.timeline-item:not(:last-child)::before { content: ''; position: absolute; left: 5px; top: 16px; bottom: 0; width: 2px; background: var(--border); }
.timeline-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); margin-top: 3px; flex-shrink: 0; z-index: 1; }
.timeline-content { flex: 1; }
.timeline-acao { font-size: .85rem; font-weight: 600; }
.timeline-meta { font-size: .72rem; color: var(--text-dim); margin-top: 2px; }
.timeline-detalhe { font-size: .8rem; color: var(--text-muted); margin-top: 5px; background: var(--surface2); padding: 8px 11px; border-radius: 8px; }

.orcamento-item-row { display: grid; grid-template-columns: 1fr 110px 110px 120px 32px; gap: 8px; align-items: center; margin-bottom: 8px; }
.orcamento-total { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; margin-top: 8px; border-top: 1px solid var(--border); font-size: 1.1rem; font-weight: 700; font-family: var(--font-display); }

@media (max-width: 720px) {
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .orcamento-item-row { grid-template-columns: 1fr 1fr; }
  /* Em mobile, fullscreen vira modal normal */
  .modal-fullscreen { max-width: 100%; max-height: 92vh; height: auto; border-radius: var(--radius) var(--radius) 0 0; }
  .modal-overlay.overlay-fullscreen { padding: 0; align-items: flex-end; }
  .modal-fullscreen .modal-body { grid-template-columns: 1fr; overflow-y: auto; max-height: calc(92vh - 130px); }
  .modal-fullscreen .form-col { padding: 16px 18px; overflow-y: visible; height: auto; }
  .modal-fullscreen .form-col:first-child { border-right: none; border-bottom: 1px solid var(--border); }
}

/* ══════════════════════════════════════════════════════════
   MELHORIAS VISUAIS — refinamentos profissionais
══════════════════════════════════════════════════════════ */

/* ─── Scrollbar customizada (dark mode) ─────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ─── Cards com hover sutil ──────────────────────────────── */
.card { transition: border-color .18s, box-shadow .18s; }
.card:hover { border-color: var(--border2); }
.card-clickable { cursor: pointer; }
.card-clickable:hover { box-shadow: 0 4px 20px rgba(0,0,0,.2); transform: translateY(-1px); }

/* ─── Stat cards do dashboard ────────────────────────────── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  transition: border-color .18s, box-shadow .18s;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--stat-accent, var(--accent));
  opacity: 0.7;
}
.stat-card:hover { border-color: var(--border2); box-shadow: 0 4px 20px rgba(0,0,0,.15); }
.stat-card .stat-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.stat-card .stat-value { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat-card .stat-sub { font-size: .75rem; color: var(--text-dim); }
.stat-card.stat-green { --stat-accent: var(--green); }
.stat-card.stat-blue  { --stat-accent: var(--blue); }
.stat-card.stat-amber { --stat-accent: var(--amber); }
.stat-card.stat-red   { --stat-accent: var(--red); }

/* ─── Tabelas com seleção visual e zebra suave ───────────── */
.table tbody tr:nth-child(even) { background: rgba(255,255,255,.013); }
[data-theme="light"] .table tbody tr:nth-child(even) { background: rgba(0,0,0,.018); }
.table tbody tr:hover { background: var(--accent-glow-08); }

/* ─── Botões com ícone — tamanho extra ───────────────────── */
.btn-icon-lg {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text-muted);
  cursor: pointer; transition: all .15s;
}
.btn-icon-lg:hover { color: var(--accent); border-color: var(--accent-glow-40); background: var(--accent-glow-08); }

/* ─── Inputs com ícone à esquerda ────────────────────────── */
.input-icon-wrap { position: relative; }
.input-icon-wrap .icon-left {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-dim); pointer-events: none;
  display: flex; align-items: center;
}
.input-icon-wrap input { padding-left: 38px; }

/* ─── Toast de notificação (feedback visual) ─────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 9999; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  font-size: .85rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  pointer-events: all;
  animation: toast-in .25s cubic-bezier(.22,.68,0,1.2) both;
  max-width: 340px;
}
.toast.toast-ok  { border-left: 3px solid var(--green); }
.toast.toast-err { border-left: 3px solid var(--red); }
.toast.toast-info { border-left: 3px solid var(--blue); }
.toast.out { animation: toast-out .2s ease both; }
@keyframes toast-in  { from { opacity:0; transform: translateY(16px) scale(.95); } to { opacity:1; transform:none; } }
@keyframes toast-out { to   { opacity:0; transform: translateY(8px) scale(.96); } }

/* ─── Empty state com ilustração ────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 64px 24px; gap: 14px; text-align: center;
}
.empty-state-icon {
  width: 56px; height: 56px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: var(--text-dim);
}
.empty-state h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--text); }
.empty-state p  { font-size: .83rem; color: var(--text-muted); max-width: 280px; line-height: 1.55; }

/* ─── Seção título com linha ─────────────────────────────── */
.section-title {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-display); font-size: .95rem; font-weight: 600;
  color: var(--text); margin-bottom: 16px;
}
.section-title::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ─── Alerta de primeiro login ───────────────────────────── */
.primeiro-login-banner {
  display: flex; align-items: center; gap: 14px;
  background: var(--amber-bg); border: 1px solid var(--amber-border);
  border-radius: var(--radius-sm); padding: 14px 18px;
  margin-bottom: 20px;
}
.primeiro-login-banner .icon { color: var(--amber); flex-shrink: 0; }
.primeiro-login-banner p { font-size: .85rem; color: var(--amber-text); flex: 1; line-height: 1.4; }
.primeiro-login-banner strong { font-weight: 700; }
.primeiro-login-banner .btn-trocar { background: var(--amber); color: #1c0900; border: none; border-radius: 7px; padding: 7px 14px; font-size: .8rem; font-weight: 700; cursor: pointer; white-space: nowrap; }

/* ─── Paginação ──────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; gap: 4px;
  justify-content: center; padding: 16px 0 8px;
}
.page-btn {
  min-width: 34px; height: 34px; padding: 0 10px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-muted);
  font-size: .83rem; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.page-btn:hover { color: var(--text); border-color: var(--border2); }
.page-btn.active { background: var(--accent-glow-15); border-color: var(--accent); color: var(--accent); font-weight: 700; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ─── Sidebar / header do admin ─────────────────────────── */
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-radius: var(--radius-sm);
  font-size: .85rem; color: var(--text-muted);
  cursor: pointer; transition: all .12s;
  border: 1px solid transparent;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active {
  background: var(--accent-glow-08);
  border-color: var(--accent-glow-25);
  color: var(--accent); font-weight: 600;
}
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--red); color: #fff;
  font-size: .65rem; font-weight: 700;
  padding: 2px 6px; border-radius: 99px; min-width: 18px; text-align: center;
}

/* ─── Skeleton loader ────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 6px;
}
.skeleton-line { height: 14px; margin-bottom: 8px; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w100 { width: 100%; }

/* ─── Dropdown menu ──────────────────────────────────────── */
.dropdown { position: relative; display: inline-flex; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 300;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); padding: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  min-width: 180px;
  display: none;
}
.dropdown-menu.open { display: block; animation: fade-down .15s ease; }
@keyframes fade-down { from { opacity:0; transform: translateY(-6px); } to { opacity:1; } }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 7px;
  font-size: .84rem; color: var(--text-muted);
  cursor: pointer; transition: all .1s;
}
.dropdown-item:hover { background: var(--surface2); color: var(--text); }
.dropdown-item.danger:hover { background: var(--red-bg); color: var(--red-text); }
.dropdown-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ─── Focus ring acessível ───────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ─── Print: esconde elementos de navegação ──────────────── */
@media print {
  .no-print, .btn-primary, .btn-secondary, .modal-overlay, header, nav { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ─── Responsivo mobile aprimorado ──────────────────────── */
@media (max-width: 480px) {
  .modal { border-radius: var(--radius) var(--radius) 0 0; margin-top: auto; max-height: 92vh; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .toast-container { bottom: 16px; right: 12px; left: 12px; }
  .toast { max-width: 100%; }
  .stat-card .stat-value { font-size: 1.6rem; }
}
