/* ============================================================
   PersonalCRM — style.css
   Versão completa com login + app + configurações
   ============================================================ */

/* ── RESET / BASE ─────────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary:       #1a1a2e;
  --secondary:     #16213e;
  --accent:        #e94560;
  --accent-dark:   #c73652;
  --blue:          #3498db;
  --green:         #2ecc71;
  --red:           #e74c3c;
  --orange:        #e67e22;
  --gold:          #f1c40f;
  --purple:        #9b59b6;
  --teal:          #1abc9c;
  --gray:          #95a5a6;
  --navy:          #2c3e50;
  --white:         #ffffff;
  --bg:            #f4f6fb;
  --text:          #2c3e50;
  --text-light:    #7f8c8d;
  --gray-border:   #e8ecf0;
  --sidebar-w:     240px;
  --right-sidebar-w: 200px;
  --radius:        10px;
  --shadow:        0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:     0 8px 28px rgba(0,0,0,0.14);
  --transition:    0.2s ease;
}

html, body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

input, select, textarea, button {
  font-family: inherit;
  font-size: inherit;
}

/* ── LOGIN PAGE ───────────────────────────────────────────── */

body.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.login-container {
  width: 100%;
  max-width: 440px;
  padding: 16px;
}

.login-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 32px 28px;
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-header h1 {
  font-size: 1.9rem;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.login-header p {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--text-light);
}

.login-error {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--red);
  min-height: 18px;
}

#block-view h2 {
  color: var(--red);
  margin-bottom: 10px;
}

#block-view p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 6px;
}

#loading-view p {
  color: var(--text-light);
  font-size: 0.95rem;
  text-align: center;
  padding: 20px 0;
}

/* ── LAYOUT PRINCIPAL ─────────────────────────────────────── */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(180deg, #e3f2fd 0%, #bbdefb 100%);
  border-right: 1px solid var(--gray-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border-bottom: 2px solid var(--gray-border);
  min-height: 72px;
}

.sidebar-logo i {
  font-size: 1.4rem;
  color: var(--accent);
}

#empresa-nome-sidebar {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar ul {
  flex: 1;
  padding: 12px 0;
}

.sidebar ul li {
  margin: 2px 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.45);
  color: var(--primary);
}

.nav-link.active {
  background: var(--blue);
  color: var(--white);
}

.nav-link i {
  width: 18px;
  text-align: center;
  font-size: 0.95rem;
}

/* Sidebar Dropdown */
.nav-dropdown {
  display: flex;
  flex-direction: column;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between !important;
  width: 100%;
}

.dropdown-toggle div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dropdown-toggle .chevron {
  font-size: 0.75rem;
  transition: transform 0.2s;
  color: var(--text-light);
}

.nav-dropdown.open .dropdown-toggle .chevron {
  transform: rotate(180deg);
}

.dropdown-content {
  display: none;
  flex-direction: column;
  padding-left: 14px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  margin-top: 4px;
  margin-bottom: 4px;
}

.nav-dropdown.open .dropdown-content {
  display: flex;
}

.dropdown-content .nav-link {
  padding: 8px 12px;
  font-size: 0.85rem;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(0,0,0,0.06);
  font-size: 0.8rem;
  color: var(--text-light);
  text-align: center;
}

.main-content {
  margin-left: var(--sidebar-w);
  margin-right: var(--right-sidebar-w);
  padding: 28px 24px;
  min-height: 100vh;
}

/* Sidebar Direita (Favoritos) */
.right-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--right-sidebar-w);
  height: 100vh;
  background: var(--white);
  border-left: 1px solid var(--gray-border);
  padding: 24px 16px;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.right-sidebar h3 {
  font-size: 0.85rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--gray-border);
  padding-bottom: 10px;
}

.fav-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}

.fav-item:hover {
  background: var(--white);
  border-color: var(--blue);
  color: var(--blue);
  transform: translateX(-4px);
  box-shadow: var(--shadow);
}

.fav-item i {
  color: var(--blue);
  font-size: 0.9rem;
  width: 16px;
  text-align: center;
}

.fav-empty {
  text-align: center;
  padding: 20px 10px;
  color: var(--text-light);
  font-size: 0.8rem;
  font-style: italic;
  background: #fafbfc;
  border-radius: 8px;
  border: 1px dashed var(--gray-border);
}

/* Botão Favorito (Estrela) na Header */
.btn-fav {
  border: none;
  background: none;
  cursor: pointer;
  padding: 8px;
  font-size: 1.1rem;
  color: #d1d5db; /* cinza claro */
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.btn-fav:hover {
  background: rgba(0,0,0,0.03);
  color: var(--gold);
}

.btn-fav.active {
  color: var(--gold);
}

.btn-fav i {
  filter: drop-shadow(0 0 1px rgba(0,0,0,0.1));
}

/* ── SEÇÕES ───────────────────────────────────────────────── */

.section {
  max-width: 1200px;
}

.hidden {
  display: none !important;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 1.3rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-header h2 i {
  color: var(--accent);
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── BOTÕES ───────────────────────────────────────────────── */

.btn-primary {
  background: var(--accent);
  color: var(--white);
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-secondary {
  background: var(--white);
  color: var(--text);
  border: 2px solid var(--gray-border);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-whatsapp {
  background: #25D366;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: 0.2s ease;
}

.btn-whatsapp:hover {
  background: #128C7E;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 0.95rem;
}

.btn-icon:hover {
  background: var(--gray-border);
}

.btn-file {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.btn-file input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  cursor: pointer;
}

/* ── FILTROS ──────────────────────────────────────────────── */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  background: var(--white);
  padding: 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.filter-bar input[type="text"],
.filter-bar select {
  padding: 8px 12px;
  border: 2px solid var(--gray-border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.88rem;
  transition: var(--transition);
  min-width: 160px;
  flex: 1;
}

.filter-bar input[type="text"]:focus,
.filter-bar select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--white);
}

/* ── CARDS DE CONTATO ─────────────────────────────────────── */

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.contact-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border-top: 4px solid var(--gray-border);
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition);
}

.contact-card:hover {
  box-shadow: var(--shadow-lg);
}

.contact-card.status-fechou         { border-top-color: var(--green);  }
.contact-card.status-naofechou      { border-top-color: var(--red);    }
.contact-card.status-em-atendimento { border-top-color: var(--blue);   }
.contact-card.status-vaipens        { border-top-color: var(--gold);   }
.contact-card.status-outro          { border-top-color: var(--gray);   }

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 14px 8px;
  gap: 8px;
}

.card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.card-date {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 2px;
}

.card-info {
  padding: 0 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.card-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.4;
}

.card-row i {
  color: var(--text-light);
  width: 14px;
  margin-top: 2px;
  flex-shrink: 0;
  font-size: 0.8rem;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 12px;
  border-top: 1px solid var(--gray-border);
  margin-top: 4px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-schedule-alert {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 0.82rem;
  color: var(--blue);
  background: #eaf4fd;
  padding: 8px 14px;
  border-top: 1px solid #d0e8f8;
}

.card-schedule-alert i {
  margin-top: 2px;
  flex-shrink: 0;
}

.card-schedule-alert.alert-overdue {
  background: #fdecea;
  color: var(--red);
  border-top-color: #f5c6c2;
}

.card-schedule-alert.alert-today {
  background: #fff8e1;
  color: #b7850a;
  border-top-color: #ffe082;
}

/* ── BADGES ───────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.badge-fechou         { background: #d4f5e2; color: #1a7a42; }
.badge-naofechou      { background: #fde8e8; color: #c0392b; }
.badge-em-atendimento { background: #daeeff; color: #1a5fa8; }
.badge-vaipens        { background: #fef9e1; color: #9a6c00; }
.badge-outro          { background: #efefef; color: #555;    }

.badge-instagram      { background: #fce4ec; color: #c2185b; }
.badge-whatsapp       { background: #e8f5e9; color: #2e7d32; }
.badge-facebook       { background: #e3f2fd; color: #1565c0; }
.badge-indicacao      { background: #f3e5f5; color: #6a1b9a; }
.badge-site           { background: #e0f7fa; color: #00697a; }
.badge-jacliente      { background: #fff3e0; color: #e65100; }
.badge-outroorcamento { background: #fbe9e7; color: #bf360c; }

/* ── FORMULÁRIOS ──────────────────────────────────────────── */

.form-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group select,
.form-group textarea {
  padding: 9px 12px;
  border: 2px solid var(--gray-border);
  border-radius: 8px;
  background: #fafbfc;
  color: var(--text);
  font-size: 0.9rem;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--white);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.label-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}

.label-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 4px;
}

.schedule-block {
  background: #f8f9ff;
  border: 1px dashed var(--blue);
  border-radius: 8px;
  padding: 14px;
}

.logo-upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* ── AUTOCOMPLETE DROPDOWN ───────────────────────────────── */

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 2px solid var(--accent);
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: var(--shadow-lg);
  max-height: 220px;
  overflow-y: auto;
  z-index: 500;
  animation: acDropIn 0.15s ease;
}

@keyframes acDropIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.autocomplete-dropdown .ac-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-border);
  transition: background 0.12s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.autocomplete-dropdown .ac-item:last-child {
  border-bottom: none;
}

.autocomplete-dropdown .ac-item:hover,
.autocomplete-dropdown .ac-item.ac-active {
  background: #eaf4fd;
}

.autocomplete-dropdown .ac-item-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--primary);
}

.autocomplete-dropdown .ac-item-info {
  font-size: 0.78rem;
  color: var(--text-light);
  display: flex;
  gap: 12px;
}

.autocomplete-dropdown .ac-item-new {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--gray-border);
  transition: background 0.12s ease;
}

.autocomplete-dropdown .ac-item-new:hover {
  background: #fff0f3;
}

.autocomplete-dropdown .ac-item-new i {
  color: var(--accent);
}

/* ── MODAL ────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.modal-box {
  background: var(--white);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-border);
  background: var(--bg);
}

.modal-header h3 {
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
}

.modal-header h3 i {
  color: var(--accent);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

/* ── DASHBOARD / CARDS ────────────────────────────────────── */

.period-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.period-btn {
  padding: 7px 14px;
  border: 2px solid var(--gray-border);
  border-radius: 8px;
  background: var(--white);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-light);
  transition: var(--transition);
}

.period-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.period-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

.custom-period {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--white);
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--text-light);
}

.custom-period input[type="date"] {
  padding: 6px 10px;
  border: 2px solid var(--gray-border);
  border-radius: 7px;
  font-size: 0.85rem;
  background: var(--bg);
}

.custom-period input[type="date"]:focus {
  outline: none;
  border-color: var(--accent);
}

.custom-period-label {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.82rem;
}

.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.dash-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  border-top: 4px solid var(--gray-border);
  transition: box-shadow var(--transition);
}

.dash-card:hover {
  box-shadow: var(--shadow-lg);
}

.dash-card.total          { border-top-color: var(--primary); }
.dash-card.fechou         { border-top-color: var(--green);   }
.dash-card.nao            { border-top-color: var(--red);     }
.dash-card.em-atendimento { border-top-color: var(--blue);    }
.dash-card.vaipens        { border-top-color: var(--gold);    }
.dash-card.taxa           { border-top-color: var(--accent);  }
.dash-card.canal-total    { border-top-color: var(--navy);    }
.dash-card.canal-fech     { border-top-color: var(--green);   }
.dash-card.canal-taxa     { border-top-color: var(--accent);  }

.dash-card-icon {
  font-size: 1.5rem;
  color: var(--text-light);
}

.dash-card.total          .dash-card-icon { color: var(--primary); }
.dash-card.fechou         .dash-card-icon { color: var(--green);   }
.dash-card.nao            .dash-card-icon { color: var(--red);     }
.dash-card.em-atendimento .dash-card-icon { color: var(--blue);    }
.dash-card.vaipens        .dash-card-icon { color: var(--gold);    }
.dash-card.taxa           .dash-card-icon { color: var(--accent);  }
.dash-card.canal-total    .dash-card-icon { color: var(--navy);    }
.dash-card.canal-fech     .dash-card-icon { color: var(--green);   }
.dash-card.canal-taxa     .dash-card-icon { color: var(--accent);  }

.dash-card-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.dash-card-label {
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 500;
}

/* ── CHARTS / GRÁFICOS ────────────────────────────────────── */

.dash-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.dash-chart-box {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px;
}

.dash-chart-box h3 {
  font-size: 0.92rem;
  color: var(--primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid var(--gray-border);
  padding-bottom: 10px;
}

.dash-chart-box h3 i {
  color: var(--accent);
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bar-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bar-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text);
}

.bar-track {
  height: 10px;
  background: var(--gray-border);
  border-radius: 6px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
}

.bar-fill.accent  { background: var(--accent);  }
.bar-fill.green   { background: var(--green);   }
.bar-fill.red     { background: var(--red);     }
.bar-fill.blue    { background: var(--blue);    }
.bar-fill.gold    { background: var(--gold);    }
.bar-fill.purple  { background: var(--purple);  }
.bar-fill.teal    { background: var(--teal);    }
.bar-fill.orange  { background: var(--orange);  }
.bar-fill.gray    { background: var(--gray);    }
.bar-fill.navy    { background: var(--navy);    }

.empty-chart {
  font-size: 0.88rem;
  color: var(--text-light);
  text-align: center;
  padding: 20px 0;
}

/* ── EMPTY STATE ──────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 14px;
  display: block;
  color: var(--gray-border);
}

.empty-state p {
  font-size: 1rem;
  margin-bottom: 18px;
}

/* ── CONFIGURAÇÕES ────────────────────────────────────────── */

.section-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
  border-bottom: 2px solid var(--gray-border);
  padding-bottom: 0;
}

.tab-btn {
  padding: 9px 18px;
  border-radius: 8px 8px 0 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-light);
  border-bottom: 3px solid transparent;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: -2px;
}

.tab-btn:hover {
  color: var(--accent);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: #fff6f8;
}

.param-hint {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  background: #eef6ff;
  border: 1px solid #cce3ff;
  border-radius: 8px;
  padding: 10px 12px;
}

.param-hint i {
  color: var(--blue);
  margin-top: 2px;
  flex-shrink: 0;
}

.param-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.param-card {
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  padding: 16px 14px;
  background: #fafbfc;
}

.param-card h3 {
  margin: 0 0 12px;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--primary);
  border-bottom: 1px solid var(--gray-border);
  padding-bottom: 10px;
}

.param-card h3 i {
  color: var(--accent);
}

.param-list {
  max-height: 230px;
  overflow-y: auto;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.param-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 7px;
  background: var(--white);
  border: 1px solid var(--gray-border);
  font-size: 0.88rem;
  transition: var(--transition);
}

.param-item:hover {
  border-color: var(--red);
}

.param-item span {
  flex: 1;
  margin-right: 8px;
  color: var(--text);
}

.param-item button {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--red);
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 0.82rem;
  transition: var(--transition);
}

.param-item button:hover {
  background: #fde8e8;
}

.param-add {
  display: flex;
  gap: 6px;
  align-items: center;
}

.param-add input {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 2px solid var(--gray-border);
  background: var(--white);
  font-size: 0.88rem;
  transition: var(--transition);
}

.param-add input:focus {
  outline: none;
  border-color: var(--accent);
}

.param-add .btn-primary {
  padding: 8px 11px;
  flex-shrink: 0;
}

/* ── RESPONSIVO ───────────────────────────────────────────── */

@media (max-width: 768px) {
  :root {
    --sidebar-w: 0px;
    --right-sidebar-w: 0px;
  }

  .right-sidebar {
    display: none;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    overflow-x: auto;
  }

  .sidebar ul {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 6px 8px;
  }

  .sidebar ul li {
    margin: 0;
    flex-shrink: 0;
  }

  .nav-link span {
    display: none;
  }

  .nav-link {
    padding: 8px 12px;
  }

  .sidebar-footer {
    display: none;
  }

  .main-content {
    margin-left: 0;
    margin-right: 0;
    padding: 16px 12px;
  }

  .contacts-grid {
    grid-template-columns: 1fr;
  }

  .dash-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-box {
    max-height: 95vh;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-bar {
    flex-direction: column;
  }

  .filter-bar input,
  .filter-bar select {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .dash-cards {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .param-grid {
    grid-template-columns: 1fr;
  }
}

/* ── NOTIFICAÇÕES DE AGENDAMENTO ─────────────────────────── */
.appointment-notification-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 380px;
  pointer-events: none;
}

.appointment-notification {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-left: 6px solid var(--accent);
  animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: auto;
  position: relative;
  overflow: hidden;
}

.appointment-notification::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(233, 69, 96, 0.05) 0%, transparent 100%);
  pointer-events: none;
}

@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.appointment-notification.fade-out {
  animation: slideOutRight 0.4s forwards;
}

@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}

.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notification-title {
  font-weight: 800;
  color: var(--primary);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.notification-title i {
  color: var(--accent);
  font-size: 1.1rem;
}

.notification-close {
  background: rgba(0,0,0,0.05);
  border: none;
  cursor: pointer;
  color: var(--text-light);
  font-size: 0.9rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.notification-close:hover {
  background: var(--red);
  color: white;
}

.notification-body {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.5;
}

.notification-body strong {
  color: var(--primary);
}

.notification-footer {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-notification-action {
  background: var(--blue);
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s;
  box-shadow: 0 4px 10px rgba(52, 152, 219, 0.2);
}

.btn-notification-action:hover {
  background: var(--navy);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(52, 152, 219, 0.3);
}