/* ================================================================
   HOTSPOT MASTER V3 — Design System: Componentes
   ================================================================ */

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: 38px; padding: 0 var(--space-4);
  font-family: var(--font-ui); font-size: 13.5px; font-weight: 600;
  border-radius: var(--radius-md); border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-sm { height: 30px; padding: 0 var(--space-3); font-size: 12.5px; }
.btn-lg { height: 44px; padding: 0 var(--space-6); font-size: 15px; }
.btn-icon { width: 38px; padding: 0; }
.btn-block { width: 100%; }

.btn-primary { background: var(--primary); color: var(--primary-text-on); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface-alt); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-hover); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-alt); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-bg); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.card-pad { padding: var(--space-5); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border);
}
.card-title { font-size: 14.5px; font-weight: 700; }
.card-subtitle { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.card-body { padding: var(--space-5); }

/* KPI stat card */
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3);
  position: relative; overflow: hidden;
}
.stat-card .stat-icon {
  width: 36px; height: 36px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-bg); color: var(--primary);
}
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-card .stat-value { font-family: var(--font-mono); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.stat-card .stat-delta { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.stat-delta.up { color: var(--success); }
.stat-delta.down { color: var(--danger); }
.stat-card .stat-fictitious {
  position: absolute; top: var(--space-3); right: var(--space-3);
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-faint); background: var(--surface-alt); padding: 2px 6px; border-radius: var(--radius-full);
}

/* ---------- Inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.input, .select, textarea.input {
  height: 38px; width: 100%; padding: 0 var(--space-3);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  color: var(--text); font-family: var(--font-ui); font-size: 13.5px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
textarea.input { height: auto; padding: var(--space-3); resize: vertical; min-height: 80px; }
.input:focus, .select:focus, textarea.input:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); outline: none;
}
.input::placeholder { color: var(--text-faint); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235a6472'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px; }
.field-hint { font-size: 11.5px; color: var(--text-faint); }
.input-group { display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.input-group .input { border: none; height: 36px; }
.input-group .input-addon { padding: 0 var(--space-3); color: var(--text-faint); font-size: 12.5px; }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table.table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 13px; }
table.table th {
  text-align: left; padding: var(--space-3) var(--space-4); background: var(--surface-alt);
  color: var(--text-muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
table.table tbody tr:last-child td { border-bottom: none; }
table.table tbody tr { transition: background var(--t-fast); }
table.table tbody tr:hover { background: var(--surface-alt); }
.table-empty { padding: var(--space-10); text-align: center; color: var(--text-muted); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 var(--space-2);
  border-radius: var(--radius-full); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-neutral { background: var(--surface-alt); color: var(--text-muted); }

/* ---------- Alertas ---------- */
.alert { display: flex; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-md); border: 1px solid; font-size: 13px; }
.alert-icon { flex-shrink: 0; }
.alert-title { font-weight: 700; margin-bottom: 2px; }
.alert-info    { background: var(--info-bg);    border-color: var(--info);    color: var(--info); }
.alert-success { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.alert-warning { background: var(--warning-bg); border-color: var(--warning); color: var(--warning); }
.alert-danger  { background: var(--danger-bg);  border-color: var(--danger);  color: var(--danger); }
.alert p { color: var(--text); }

/* ---------- Modais ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: var(--scrim); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 900;
  opacity: 0; pointer-events: none; transition: opacity var(--t-base);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-modal);
  width: 100%; max-width: 520px; max-height: 88vh; display: flex; flex-direction: column;
  transform: translateY(12px) scale(0.98); transition: transform var(--t-base);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-lg { max-width: 760px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: var(--space-5); border-bottom: 1px solid var(--border); }
.modal-title { font-size: 15.5px; font-weight: 700; }
.modal-body { padding: var(--space-5); overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: var(--space-2); padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border); }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; top: 0; left: 0; height: 100vh; width: var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 200;
  transition: width var(--t-base), transform var(--t-base);
}
.sidebar.collapsed { width: var(--sidebar-w-collapsed); }
.sidebar-brand { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-5); height: var(--topbar-h); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.signal-mark { display: flex; align-items: flex-end; gap: 3px; height: 18px; flex-shrink: 0; }
.signal-mark span { width: 4px; background: var(--primary); border-radius: 2px; animation: signal-pulse 1.8s var(--ease) infinite; }
.signal-mark span:nth-child(1) { height: 6px;  animation-delay: 0s; }
.signal-mark span:nth-child(2) { height: 11px; animation-delay: .2s; }
.signal-mark span:nth-child(3) { height: 16px; animation-delay: .4s; }
.signal-mark span:nth-child(4) { height: 9px;  animation-delay: .6s; }
@keyframes signal-pulse { 0%,100% { opacity: .45; } 50% { opacity: 1; } }
.sidebar-brand .brand-text { font-weight: 800; font-size: 15px; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; }
.sidebar-brand .brand-text small { display: block; font-size: 10px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; }
.sidebar.collapsed .brand-text, .sidebar.collapsed .nav-label, .sidebar.collapsed .nav-section-title { display: none; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: var(--space-4) var(--space-3); }
.nav-section-title { font-size: 10.5px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; padding: var(--space-3) var(--space-3) var(--space-1); }
.nav-item {
  display: flex; align-items: center; gap: var(--space-3); padding: 9px var(--space-3);
  border-radius: var(--radius-md); color: var(--text-muted); font-weight: 600; font-size: 13.3px;
  cursor: pointer; margin-bottom: 2px; transition: background var(--t-fast), color var(--t-fast);
}
.nav-item svg { flex-shrink: 0; width: 18px; height: 18px; }
.nav-item:hover { background: var(--surface-alt); color: var(--text); }
.nav-item.active { background: var(--primary-bg); color: var(--primary); }
.sidebar.collapsed .nav-item { justify-content: center; }
.sidebar-footer { padding: var(--space-3); border-top: 1px solid var(--border); flex-shrink: 0; }
.collapse-toggle {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 34px;
  border-radius: var(--radius-md); color: var(--text-muted); cursor: pointer; background: transparent; border: none;
}
.collapse-toggle:hover { background: var(--surface-alt); }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; height: var(--topbar-h); background: var(--surface);
  border-bottom: 1px solid var(--border); display: flex; align-items: center;
  gap: var(--space-4); padding: 0 var(--space-5); z-index: 150;
}
.topbar-search {
  flex: 1; max-width: 420px; display: flex; align-items: center; gap: var(--space-2);
  height: 38px; padding: 0 var(--space-3); background: var(--surface-alt); border-radius: var(--radius-md);
  color: var(--text-faint); border: 1px solid transparent; cursor: pointer;
}
.topbar-search:hover { border-color: var(--border); }
.topbar-search kbd { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; color: var(--text-faint); }
.topbar-actions { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.icon-btn {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md); color: var(--text-muted); cursor: pointer; position: relative; background: transparent; border: none;
}
.icon-btn:hover { background: var(--surface-alt); color: var(--text); }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }
.status-pill { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: var(--radius-full); background: var(--success-bg); color: var(--success); font-size: 12px; font-weight: 700; }
.status-pill .pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: signal-pulse 1.6s infinite; }
.topbar-profile { display: flex; align-items: center; gap: var(--space-2); padding: 4px 8px 4px 4px; border-radius: var(--radius-full); cursor: pointer; }
.topbar-profile:hover { background: var(--surface-alt); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12.5px; flex-shrink: 0; }

/* ---------- Dropdown ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: var(--space-2); z-index: 300;
  opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity var(--t-fast), transform var(--t-fast);
}
.dropdown-menu.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.dropdown-item { display: flex; align-items: center; gap: var(--space-2); padding: 9px 10px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; }
.dropdown-item:hover { background: var(--surface-alt); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: var(--space-2) 4px; }
.dropdown-header { padding: 8px 10px; font-size: 12px; color: var(--text-muted); }

/* ---------- Paginação ---------- */
.pagination { display: flex; align-items: center; gap: 4px; justify-content: flex-end; padding: var(--space-3) 0; }
.page-btn { min-width: 32px; height: 32px; padding: 0 8px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.page-btn:hover { background: var(--surface-alt); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Skeleton / Loading ---------- */
.skeleton { background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 37%, var(--skeleton-base) 63%); background-size: 400% 100%; animation: skeleton-shimmer 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes skeleton-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skeleton-text { height: 12px; border-radius: 4px; margin-bottom: 8px; }
.skeleton-card { height: 96px; border-radius: var(--radius-lg); }
.spinner { width: 18px; height: 18px; border: 2.5px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { display: flex; align-items: center; justify-content: center; padding: var(--space-16); color: var(--text-muted); gap: var(--space-3); }

/* ---------- Toast ---------- */
.toast-container { position: fixed; bottom: var(--space-5); right: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); z-index: 999; }
.toast {
  display: flex; align-items: flex-start; gap: var(--space-3); min-width: 300px; max-width: 380px;
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--primary);
  border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); box-shadow: var(--shadow-lg);
  animation: toast-in var(--t-base);
}
.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.danger { border-left-color: var(--danger); }
.toast-title { font-weight: 700; font-size: 13px; }
.toast-msg { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.toast-close { margin-left: auto; cursor: pointer; color: var(--text-faint); }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }

/* ---------- Breadcrumb ---------- */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-faint); margin-bottom: var(--space-1); }
.breadcrumb .sep { opacity: 0.6; }
.breadcrumb .current { color: var(--text-muted); font-weight: 600; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border); }
.tab-btn { padding: 10px var(--space-4); font-size: 13px; font-weight: 600; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-color: var(--primary); }

/* ---------- Empty state ---------- */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: var(--space-16) var(--space-6); color: var(--text-muted); gap: var(--space-3); }
.empty-state svg { color: var(--text-faint); }
.empty-state h4 { color: var(--text); }

/* ---------- Toggle switch ---------- */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track { position: absolute; inset: 0; background: var(--border-strong); border-radius: var(--radius-full); cursor: pointer; transition: background var(--t-fast); }
.switch-track::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform var(--t-fast); }
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::before { transform: translateX(18px); }

/* ---------- Progress bar ---------- */
.progress { height: 8px; border-radius: var(--radius-full); background: var(--surface-alt); overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); border-radius: var(--radius-full); transition: width var(--t-base); }

/* ---------- Upload dropzone ---------- */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius-lg);
  padding: var(--space-10); text-align: center; color: var(--text-muted); cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: var(--primary-bg); }
.dropzone svg { color: var(--text-faint); margin-bottom: var(--space-3); }

/* ---------- Utilities ---------- */
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-1{gap:4px;} .gap-2{gap:8px;} .gap-3{gap:12px;} .gap-4{gap:16px;}
.grid { display: grid; gap: var(--space-5); }
.text-muted { color: var(--text-muted); } .text-faint { color: var(--text-faint); }
.text-sm { font-size: 12.5px; } .text-lg { font-size: 16px; } .fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.w-full { width: 100%; } .mt-2{margin-top:8px;} .mt-4{margin-top:16px;} .mb-2{margin-bottom:8px;} .mb-4{margin-bottom:16px;}
