/* ==========================================================
   S.O.S. MINI ENTULHOS - IDENTIDADE VISUAL OFICIAL (CANOAS & RS)
   Cores: Verde Oficial #4B9404 • Preto/Grafite • Branco
   Fontes: Poppins & Inter (Idênticas a sosminientulhos.com.br)
   ========================================================== */

:root {
  /* Cores Oficiais SOS Mini Entulhos */
  --sos-green: #4b9404;
  --sos-green-hover: #5cb805;
  --sos-green-light: #76d611;
  --sos-green-glow: rgba(75, 148, 4, 0.3);
  --sos-green-subtle: rgba(75, 148, 4, 0.12);
  
  --bg-main: #0a101d;
  --bg-card: rgba(16, 26, 44, 0.8);
  --bg-card-hover: rgba(24, 38, 64, 0.9);
  --bg-card-solid: #101a2c;
  --bg-input: #152238;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-brand: rgba(75, 148, 4, 0.35);
  --border-urgent: rgba(239, 68, 68, 0.45);
  
  --urgent-red: #ef4444;
  --waiting-amber: #f59e0b;
  --progress-blue: #3b82f6;
  --success-green: #10b981;
  
  --text-main: #ffffff;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 14px 35px rgba(0, 0, 0, 0.65);
  --shadow-green: 0 0 25px var(--sos-green-glow);
  
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(75, 148, 4, 0.12) 0px, transparent 45%),
    radial-gradient(at 100% 0%, rgba(245, 158, 11, 0.06) 0px, transparent 40%),
    radial-gradient(at 50% 100%, rgba(16, 26, 44, 0.95) 0px, transparent 100%);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .brand-title, .modal-title, .kpi-value, .view-tab {
  font-family: var(--font-heading);
}

.dashboard-container {
  max-width: 1580px;
  margin: 0 auto;
  padding: 20px 28px 60px;
}

/* Glass effect */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

/* Header */
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 26px;
  margin-bottom: 22px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(75, 148, 4, 0.25);
}

.header-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4b9404, #76d611, #f59e0b, #4b9404);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-logo-img {
  height: 52px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
}

.brand-title span {
  color: var(--sos-green-light);
}

.brand-badge {
  font-size: 11px;
  background: var(--sos-green-subtle);
  color: var(--sos-green-light);
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 700;
  border: 1px solid var(--border-brand);
}

.brand-slogan {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-sound {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-sound.active {
  background: rgba(75, 148, 4, 0.2);
  color: #76d611;
  border-color: rgba(75, 148, 4, 0.4);
}

/* Nav View Tabs */
.view-tabs {
  display: flex;
  gap: 8px;
  background: rgba(16, 26, 44, 0.7);
  padding: 6px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}

.view-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition);
}

.view-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.view-tab.active {
  background: linear-gradient(135deg, rgba(75, 148, 4, 0.25), rgba(75, 148, 4, 0.1));
  color: #76d611;
  border: 1px solid var(--border-brand);
  box-shadow: 0 4px 15px rgba(75, 148, 4, 0.2);
}

.view-tab.active.queue-tab {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.22), rgba(75, 148, 4, 0.12));
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.2);
}

.tab-badge {
  background: #ef4444;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-heading);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--sos-green), var(--sos-green-hover));
  color: #ffffff;
  box-shadow: 0 4px 14px var(--sos-green-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, var(--sos-green-hover), var(--sos-green-light));
  box-shadow: 0 6px 20px rgba(75, 148, 4, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* ==========================================================
   QUEUE SECTION (FILA DE ATENDIMENTO)
   ========================================================== */
.queue-banner {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.15), rgba(75, 148, 4, 0.12));
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 14px 22px;
  border-radius: var(--radius-lg);
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.queue-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.queue-banner-title {
  font-size: 16px;
  font-weight: 700;
  color: #fca5a5;
  display: flex;
  align-items: center;
  gap: 8px;
}

.queue-banner-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* Queue Grid */
.queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
  gap: 22px;
}

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

/* Queue Card */
.queue-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.queue-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.queue-card.urgent {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.15);
}

.queue-card.urgent::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #ef4444;
}

.queue-card.in-progress {
  border-color: rgba(59, 130, 246, 0.4);
}

.queue-card.in-progress::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #3b82f6;
}

.queue-card.waiting {
  border-color: rgba(245, 158, 11, 0.4);
}

.queue-card.waiting::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #f59e0b;
}

/* Card Header */
.qc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.qc-client-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.qc-phone {
  font-size: 13px;
  color: #25d366;
  font-weight: 600;
  margin-top: 3px;
}

.qc-time-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.time-urgent {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.time-normal {
  background: rgba(75, 148, 4, 0.18);
  color: #76d611;
  border: 1px solid var(--border-brand);
}

/* PHOTO THUMBNAIL IN CARD */
.qc-photo-container {
  display: flex;
  gap: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-brand);
  border-radius: var(--radius-md);
  padding: 10px;
  margin-bottom: 14px;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
}

.qc-photo-container:hover {
  background: rgba(75, 148, 4, 0.12);
  border-color: var(--sos-green-light);
}

.qc-photo-thumb {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 2px solid var(--sos-green);
  flex-shrink: 0;
}

.qc-photo-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.qc-photo-badge {
  font-size: 11px;
  font-weight: 700;
  color: #76d611;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.qc-photo-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* WhatsApp Main Button */
.btn-whatsapp-attend {
  width: 100%;
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: #ffffff;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  margin-bottom: 14px;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
  transition: var(--transition);
  font-family: var(--font-heading);
}

.btn-whatsapp-attend:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
}

/* Details Grid */
.qc-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: rgba(0, 0, 0, 0.3);
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 14px;
}

.qc-detail-item {
  display: flex;
  flex-direction: column;
}

.qc-detail-item.full-width {
  grid-column: 1 / -1;
}

.qc-detail-label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.qc-detail-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

.qc-price-val {
  font-size: 17px;
  font-weight: 800;
  color: var(--sos-green-light);
}

.qc-transfer-note {
  background: var(--sos-green-subtle);
  border-left: 3px solid var(--sos-green);
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 12px;
  color: #d1fae5;
  margin-bottom: 14px;
  line-height: 1.4;
}

/* Actions in Card */
.qc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 14px;
}

.qc-btn {
  flex: 1;
  min-width: 95px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
  font-family: var(--font-heading);
}

.qc-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.qc-btn.attend {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.35);
}

.qc-btn.wait {
  background: rgba(245, 158, 11, 0.18);
  color: #fde047;
  border-color: rgba(245, 158, 11, 0.35);
}

.qc-btn.finish {
  background: rgba(75, 148, 4, 0.25);
  color: #76d611;
  border-color: var(--border-brand);
}

.qc-btn.finish:hover {
  background: rgba(75, 148, 4, 0.4);
}

.qc-btn.delete {
  flex: 0 0 36px;
  min-width: 36px;
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.25);
}

.qc-btn.delete:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
}

/* Empty Queue */
.empty-queue {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: rgba(16, 26, 44, 0.4);
  border: 1px dashed rgba(75, 148, 4, 0.2);
  border-radius: var(--radius-xl);
}

.empty-queue-icon {
  font-size: 52px;
  margin-bottom: 14px;
}

.empty-queue-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.empty-queue-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* View Panels */
.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.kpi-card {
  padding: 22px;
  border: 1px solid var(--border-brand);
  background: var(--bg-card);
}

.kpi-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.kpi-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.kpi-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: rgba(75, 148, 4, 0.15);
  color: var(--sos-green-light);
}

.kpi-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.kpi-subtext {
  font-size: 12px;
  color: var(--text-dim);
}

/* Charts */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

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

.chart-card {
  padding: 22px;
  border: 1px solid var(--border-brand);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.chart-title {
  font-size: 15px;
  font-weight: 700;
}

.chart-body {
  position: relative;
  flex: 1;
  min-height: 260px;
}

/* Controls */
.controls-card {
  padding: 18px 22px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
}

.search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px 10px 40px;
  color: var(--text-main);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.search-input:focus {
  border-color: var(--sos-green);
}

.filters-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.filter-select {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

/* Table */
.table-card {
  padding: 0;
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: rgba(0, 0, 0, 0.4);
  padding: 14px 18px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-heading);
}

.data-table td {
  padding: 16px 18px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: var(--bg-card-hover);
}

/* Table Photo Mini */
.table-photo-mini {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border-brand);
  cursor: pointer;
  transition: var(--transition);
}

.table-photo-mini:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.status-fila {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.status-atendimento {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.status-aguardo {
  background: rgba(245, 158, 11, 0.2);
  color: #fde047;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.status-concluido {
  background: rgba(75, 148, 4, 0.25);
  color: #76d611;
  border: 1px solid var(--border-brand);
}

.status-cancelado {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.4);
}

.status-enviado {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.4);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-container {
  width: 100%;
  max-width: 680px;
  background: #101a2c;
  border: 1px solid var(--border-brand);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

/* Lightbox Photo Modal */
.modal-lightbox-img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.modal-header {
  padding: 16px 24px;
  background: #0b121e;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  background: #0b121e;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

.form-control:focus {
  border-color: var(--sos-green);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

