:root {
  --bg: #0f172a;
  --panel: #111827;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.2);
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #22c55e;
  --blue: #3b82f6;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: linear-gradient(180deg, #0b1120 0%, #111827 100%); color: var(--text); font-family: Arial, Helvetica, sans-serif; }
body.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.app-shell { max-width: 1400px; margin: 0 auto; padding: 24px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; font-size: 12px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.8rem, 2vw, 2.5rem); }
.topbar-pill { background: rgba(34, 197, 94, 0.12); color: #bbf7d0; border: 1px solid rgba(34, 197, 94, 0.35); padding: 10px 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot.live { background: #22c55e; box-shadow: 0 0 14px rgba(34, 197, 94, 0.8); }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.summary-card, .panel, .tec-card, .auth-card, .pending-card, .modal-card { background: rgba(17, 24, 39, 0.88); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.summary-card { padding: 18px; }
.summary-card .label { color: var(--muted); font-size: 0.82rem; margin-bottom: 8px; }
.summary-card .value { font-size: 2rem; font-weight: 700; }
.summary-card.warning { border-color: rgba(245, 158, 11, 0.35); }
.summary-card.success { border-color: rgba(34, 197, 94, 0.35); }
.summary-card.danger { border-color: rgba(239, 68, 68, 0.35); }
.summary-card.primary { border-color: rgba(59, 130, 246, 0.35); }
.panel { padding: 18px; margin-bottom: 24px; }
.panel-header { margin-bottom: 18px; }
.panel-header.row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.filters { display: flex; gap: 12px; }
select, input, button, textarea { border-radius: 10px; border: 1px solid var(--border); background: rgba(15, 23, 42, 0.9); color: var(--text); padding: 10px 12px; font-size: 0.95rem; }
button { background: linear-gradient(135deg, #2563eb, #3b82f6); border: none; font-weight: 700; cursor: pointer; transition: 0.2s ease; }
button:hover { filter: brightness(1.1); }
.auth-shell { width: min(440px, 100%); }
.auth-card { padding: 28px; }
.brand { display: inline-block; padding: 6px 10px; border-radius: 999px; background: rgba(59, 130, 246, 0.14); color: #bfdbfe; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 18px; }
.auth-subtitle, .login-note, .empty-state { color: var(--muted); }
.auth-form { display: grid; gap: 16px; margin-top: 22px; }
.auth-form label { display: grid; gap: 8px; color: var(--muted); }
.primary-btn, .secondary-btn, .action-btn { border: none; cursor: pointer; }
.primary-btn { margin-top: 8px; padding: 12px 16px; }
.login-note { margin-top: 16px; font-size: 0.85rem; }
.tecnicos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.tec-card { padding: 16px; }
.tec-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.region-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 999px; background: rgba(148, 163, 184, 0.12); font-size: 0.8rem; }
.region-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.tec-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; color: var(--muted); font-size: 0.82rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 1450px; }
th, td { border-bottom: 1px solid var(--border); padding: 12px 10px; text-align: left; vertical-align: middle; }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.client-link-source, .client-link-pending { color: var(--muted); font-size: 0.75rem; }
.client-link-pending { color: #fcd34d; }
.link-client-btn { display: block; margin-top: 6px; white-space: nowrap; }
.client-search-results { display: grid; gap: 8px; max-height: 240px; overflow-y: auto; }
.client-result { display: grid; gap: 5px; text-align: left; background: rgba(15, 23, 42, 0.75); border: 1px solid var(--border); }
.client-result span { color: var(--muted); font-size: 0.8rem; font-weight: 400; }
.selected-client { border: 1px solid var(--border); border-radius: 10px; padding: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.status-pill { display: inline-flex; align-items: center; justify-content: center; padding: 6px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; text-transform: capitalize; }
.status-agendada { background: rgba(59, 130, 246, 0.14); color: #bfdbfe; }
.status-em_andamento { background: rgba(245, 158, 11, 0.14); color: #fcd34d; }
.status-concluida { background: rgba(34, 197, 94, 0.14); color: #bbf7d0; }
.status-atrasada { background: rgba(239, 68, 68, 0.14); color: #fecaca; }
.status-cancelada { background: rgba(148, 163, 184, 0.14); color: #e2e8f0; }
.pending-card { padding: 18px; border: 1px solid rgba(34, 197, 94, 0.28); background: rgba(15, 118, 110, 0.08); }
.pending-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; }
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.75); display: grid; place-items: center; padding: 20px; z-index: 50; }
.modal.hidden { display: none; }
.modal-card { width: min(560px, 100%); padding: 22px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.close-modal { background: transparent; border: none; color: var(--text); font-size: 2rem; cursor: pointer; }
.modal-form { display: grid; gap: 16px; }
.modal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 12px; }
.secondary-btn { background: rgba(148, 163, 184, 0.14); }
@media (max-width: 720px) { .topbar, .panel-header.row, .pending-head { flex-direction: column; align-items: flex-start; } .filters { width: 100%; flex-direction: column; } .filters select { width: 100%; } }
