@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --blue: #1a6bff;
  --blue-dark: #0f4fd4;
  --blue-light: #e8f0ff;
  --blue-mid: #3d7fff;
  --green: #00c853;
  --green-dark: #009624;
  --green-light: #e6fff2;
  --black: #0d0d14;
  --gray-dark: #1e1e2e;
  --gray: #6b7280;
  --gray-light: #f0f2f8;
  --white: #ffffff;
  --red: #f02020;
  --orange: #ff7b00;
  --yellow: #f5c400;
  --border: #dde3f0;
  --shadow: 0 2px 12px rgba(26,107,255,0.10);
  --shadow-lg: 0 8px 32px rgba(26,107,255,0.14);
  --radius: 12px;
  --radius-lg: 20px;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--white);
  color: var(--black);
  min-height: 100vh;
}

/* === HEADER === */
.header {
  background: var(--black);
  color: var(--white);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

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

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.logo-text {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo-text span { color: var(--blue-mid); }

.header-info {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: #aaa;
}

.header-info .day-badge {
  background: var(--blue);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 12px;
}

.header-info .week-badge {
  background: var(--green);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 12px;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
}

.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover { background: var(--blue-dark); transform: translateY(-1px); }
.btn-success { background: var(--green); color: white; }
.btn-success:hover { background: var(--green-dark); }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #c00; }
.btn-outline { background: transparent; color: var(--blue); border: 1.5px solid var(--blue); }
.btn-outline:hover { background: var(--blue-light); }
.btn-dark { background: var(--gray-dark); color: white; }
.btn-dark:hover { background: #333; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 6px; }

/* === LAYOUT === */
.app-container {
  display: flex;
  height: calc(100vh - 64px);
}

.sidebar {
  width: 220px;
  background: var(--gray-light);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  flex-shrink: 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray);
  transition: all 0.2s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: 'Inter', sans-serif;
}

.nav-item:hover { background: var(--border); color: var(--black); }
.nav-item.active { background: var(--blue); color: white; }
.nav-item .nav-icon { font-size: 16px; width: 22px; text-align: center; }

.nav-section {
  padding: 12px 24px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #aab;
}

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: white;
}

/* === PANELS === */
.panel { display: none; }
.panel.active { display: block; }

/* === PROGRESS BAR === */
.progress-header {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--gray-light);
  border-radius: var(--radius);
  padding: 16px 20px;
  flex: 1;
  min-width: 140px;
  border: 1px solid var(--border);
}

.stat-card.blue { background: var(--blue-light); border-color: var(--blue); }
.stat-card.green { background: var(--green-light); border-color: var(--green); }
.stat-card.black { background: var(--black); color: white; }

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.65;
  margin-bottom: 6px;
}

.stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.stat-card.blue .stat-value { color: var(--blue); }
.stat-card.green .stat-value { color: var(--green-dark); }

/* === HOUR GROUPS === */
.hour-group {
  margin-bottom: 8px;
}

.hour-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hour-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--blue-light);
}

/* === TASK CARDS === */
.task-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  transition: all 0.2s;
  cursor: pointer;
  position: relative;
}

.task-card:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow);
}

.task-card.done {
  background: var(--green-light);
  border-color: var(--green);
}

.task-card.done .task-label {
  text-decoration: line-through;
  opacity: 0.6;
}

.task-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  margin-top: 1px;
}

.task-card.done .task-checkbox {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.task-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

.task-body { flex: 1; }

.task-label {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 6px;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 20px;
}

.cat-pesquisa { background: #fff3e0; color: #e65100; }
.cat-producao { background: #e3f2fd; color: #1565c0; }
.cat-redes { background: #f3e5f5; color: #6a1b9a; }
.cat-listagem { background: #e8f5e9; color: #1b5e20; }
.cat-marketplace { background: #fce4ec; color: #880e4f; }
.cat-cobranca { background: #e0f7fa; color: #006064; }
.cat-blog { background: #fff8e1; color: #f57f17; }
.cat-geral { background: #f5f5f5; color: #555; }

.task-links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.task-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  padding: 2px 8px;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.15s;
}

.task-link:hover {
  background: var(--blue);
  color: white;
}

.task-week-dots {
  display: flex;
  gap: 3px;
  margin-top: 5px;
}

.week-dot {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-light);
  color: var(--gray);
}

.week-dot.done { background: var(--green); color: white; }
.week-dot.today { border: 2px solid var(--blue); }
.week-dot.not-applicable { background: #f5f5f5; color: #ddd; }

.task-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.task-card:hover .task-actions { opacity: 1; }

.task-time {
  font-size: 11px;
  color: var(--gray);
  font-weight: 600;
}

/* === MODAL === */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

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

.modal {
  background: white;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.modal-title {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--gray-light);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover { background: var(--red); color: white; }

.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

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

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s;
  background: white;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--blue);
}

.form-textarea { resize: vertical; min-height: 80px; }

.days-selector {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.day-toggle {
  width: 40px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: white;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray);
  transition: all 0.2s;
  text-transform: uppercase;
}

.day-toggle.active {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

/* === LINKS EDITOR === */
.links-editor { display: flex; flex-direction: column; gap: 8px; }

.link-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.link-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
}

.link-row input:focus { outline: none; border-color: var(--blue); }

/* === REPORT === */
.report-section {
  margin-bottom: 24px;
}

.report-title {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-bar-wrap {
  background: var(--gray-light);
  border-radius: 20px;
  height: 12px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green));
  border-radius: 20px;
  transition: width 0.5s ease;
}

.report-task-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 4px;
  font-size: 13px;
}

.report-task-row.done { background: var(--green-light); }
.report-task-row.undone { background: #fff5f5; }

/* === SALES === */
.sale-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 16px;
  background: var(--gray-light);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.sale-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
}

.sale-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}

.sale-amount {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  color: var(--green-dark);
}

/* === FILTERS === */
.filters-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-btn {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: white;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
  color: var(--gray);
}

.filter-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.filter-btn:hover:not(.active) {
  border-color: var(--blue);
  color: var(--blue);
}

/* === TOAST === */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--black);
  color: white;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  animation: fadeInRight 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
  box-shadow: var(--shadow-lg);
}

.toast.success { background: var(--green-dark); }
.toast.error { background: var(--red); }
.toast.info { background: var(--blue); }

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray); }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { padding: 16px; }
  .progress-header { gap: 10px; }
  .stat-card { min-width: 100px; }
  .script-generator-grid { grid-template-columns: 1fr; }
  .script-hints { grid-template-columns: 1fr; }
}

/* === PAGE TITLE === */
.page-title {
  font-family: 'Syne', sans-serif;
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.page-subtitle {
  font-size: 13px;
  font-weight: 400;
  color: var(--gray);
  font-family: 'Inter', sans-serif;
}

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray);
}

.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--black); }

/* === SECTION CARD === */
.section-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

.section-card-title {
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* === SCRIPT GENERATOR === */
.script-generator-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.script-results {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.script-hints {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.script-hint-card {
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--gray-light);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.script-hint-card strong {
  font-size: 12px;
  color: var(--black);
}

.script-hint-card span {
  font-size: 12px;
  color: var(--gray);
  line-height: 1.5;
}

.script-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.script-output {
  min-height: 320px;
  line-height: 1.6;
}

.script-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
}

.script-preview-block {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: white;
}

.script-preview-block.cta {
  background: var(--blue-light);
  border-color: var(--blue);
}

.script-preview-label {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--black);
  color: white;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}

.script-preview-block p {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 8px;
}

.script-preview-block p:last-child {
  margin-bottom: 0;
}

/* === REPORT HISTORY === */
.report-history-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
}

.report-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.report-period {
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
}

.report-rate {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 800;
}

.report-rate.high { color: var(--green-dark); }
.report-rate.mid { color: var(--orange); }
.report-rate.low { color: var(--red); }

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: var(--gray);
  font-size: 14px;
  gap: 10px;
}

.spin {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
