/* ==========================================================================
   AMS HOLDING ENTERPRISE™ — DESIGN SYSTEM LIGHT LUXURY CORPORATE
   MODULO: AGENDA, CALENDARIO, NOTAS & PRODUTIVIDADE EXECUTIVA
   Conformidade: Norma Canônica 09, 5S (Seiton/Seiketsu) & Mobile-First
   ========================================================================== */

:root {
  --agenda-navy: var(--text-primary, #111827);
  --agenda-navy-light: #1F2937;
  --agenda-blue: #F97316;
  --agenda-blue-light: var(--accent-orange-soft, #FFF7ED);
  --agenda-gold: #EA580C;
  --agenda-gold-light: var(--accent-orange-soft, #FFF7ED);
  --agenda-orange: #F97316;
  --agenda-green: #EA580C;
  --agenda-green-light: var(--accent-orange-soft, #FFF7ED);
  --agenda-red: #1F2937;
  --agenda-red-light: var(--bg-app, #F3F4F6);
  --agenda-purple: #1F2937;
  --agenda-purple-light: var(--bg-app, #F3F4F6);
  --agenda-bg: var(--bg-app, #F3F4F6);
  --agenda-card: var(--bg-surface, #FFFFFF);
  --agenda-border: var(--border-light, #E5E7EB);
  --agenda-border-strong: var(--border-medium, #D1D5DB);
  --agenda-text: var(--text-primary, #111827);
  --agenda-muted: var(--text-muted, #6B7280);
  --agenda-radius-sm: 8px;
  --agenda-radius-md: 12px;
  --agenda-radius-lg: 16px;
  --agenda-shadow: var(--shadow-card, 0 1px 3px rgba(17, 24, 39, 0.06));
  --agenda-shadow-hover: 0 8px 22px rgba(17, 24, 39, 0.09);
}

/* ESTRUTURA GERAL DA PAGINA */
.agenda-viewport {
  display: flex;
  height: calc(100vh - 56px);
  width: 100%;
  overflow: hidden;
  background: var(--agenda-bg);
}

.agenda-main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px 24px;
  gap: 18px;
}

/* SELETOR MODULAR SUPERIOR (TABS DE PRODUTIVIDADE) */
.agenda-top-tabs {
  display: flex;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--agenda-border);
  border-radius: var(--agenda-radius-md);
  padding: 6px;
  box-shadow: var(--agenda-shadow);
  overflow-x: auto;
  white-space: nowrap;
}

.agenda-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-family: var(--font-display, 'Outfit', sans-serif);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--agenda-radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.agenda-tab-btn:hover {
  background: var(--bg-app);
  color: var(--text-primary);
}

.agenda-tab-btn.active {
  background: #1F2937;
  color: #FFFFFF;
  box-shadow: 0 4px 10px rgba(17, 24, 39, 0.15);
}

.agenda-tab-btn .badge-count {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: var(--font-mono, monospace);
  font-weight: 800;
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.agenda-tab-btn.active .badge-count {
  background: #F97316;
  color: #FFFFFF;
}

/* 4 KPIS NO TOPO */
.agenda-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.agenda-kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--agenda-border);
  border-radius: var(--agenda-radius-md);
  padding: 16px 18px;
  box-shadow: var(--agenda-shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.agenda-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--agenda-shadow-hover);
  border-color: var(--agenda-border-strong);
}

.agenda-kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
}

.agenda-kpi-card.kpi-blue::before { background: #F97316; }
.agenda-kpi-card.kpi-orange::before { background: #9CA3AF; }
.agenda-kpi-card.kpi-purple::before { background: #1F2937; }
.agenda-kpi-card.kpi-green::before { background: #EA580C; }

.agenda-kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.agenda-kpi-title {
  font-size: 11.5px;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  color: var(--agenda-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.agenda-kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.kpi-blue .agenda-kpi-icon { background: var(--accent-orange-soft); color: #F97316; border: 1px solid #FDBA74; }
.kpi-orange .agenda-kpi-icon { background: var(--bg-app); color: var(--text-secondary); border: 1px solid var(--border-medium); }
.kpi-purple .agenda-kpi-icon { background: #1F2937; color: #FFFFFF; }
.kpi-green .agenda-kpi-icon { background: var(--accent-orange-soft); color: #EA580C; border: 1px solid #FDBA74; }

.agenda-kpi-val {
  font-size: 24px;
  font-weight: 900;
  font-family: var(--font-display, 'Outfit', sans-serif);
  color: var(--agenda-navy);
  line-height: 1.1;
}

.agenda-kpi-sub {
  font-size: 11.5px;
  color: var(--agenda-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* GRID PRINCIPAL DO PAINEL INTEGRADO */
.agenda-cockpit-grid {
  display: grid;
  grid-template-columns: 340px 1fr 380px;
  gap: 16px;
  align-items: start;
}

/* CAIXAS E CARTOES */
.agenda-panel-box {
  background: var(--bg-surface);
  border: 1px solid var(--agenda-border);
  border-radius: var(--agenda-radius-lg);
  box-shadow: var(--agenda-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.agenda-panel-header {
  padding: 14px 18px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--agenda-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.agenda-panel-title {
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font-display, 'Outfit', sans-serif);
  color: var(--agenda-navy);
  display: flex;
  align-items: center;
  gap: 8px;
}

.agenda-panel-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* MINI CALENDARIO INTERATIVO */
.mini-cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.mini-cal-month-label {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--agenda-navy);
  font-family: var(--font-display, 'Outfit', sans-serif);
}

.mini-cal-nav-btns {
  display: flex;
  gap: 4px;
}

.mini-cal-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--agenda-border);
  background: var(--bg-surface);
  color: var(--agenda-navy);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: all 0.15s ease;
}

.mini-cal-btn:hover {
  background: var(--bg-app);
  border-color: var(--agenda-border-strong);
}

.mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.mini-cal-day-name {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  color: var(--agenda-muted);
  padding: 4px 0;
}

.mini-cal-day-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  color: var(--agenda-navy);
}

.mini-cal-day-cell:hover {
  background: var(--bg-app);
  border-color: var(--agenda-border);
}

.mini-cal-day-cell.other-month {
  color: var(--border-medium);
  cursor: default;
}

.mini-cal-day-cell.today {
  border-color: #F97316;
  color: #EA580C;
  font-weight: 800;
}

.mini-cal-day-cell.selected {
  background: #1F2937 !important;
  color: #FFFFFF !important;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(17, 24, 39, 0.2);
}

.mini-cal-day-cell .event-dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #F97316;
  position: absolute;
  bottom: 2px;
}

.mini-cal-day-cell.selected .event-dot {
  background: #F97316;
}

/* RASCUNHO INSTANTANEO (1 SEGUNDO) */
.scratchpad-area {
  width: 100%;
  height: 120px;
  border: 1px solid var(--border-medium);
  border-radius: var(--agenda-radius-sm);
  padding: 10px 12px;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  color: var(--agenda-navy);
  background: var(--bg-app);
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
  line-height: 1.5;
}

.scratchpad-area:focus {
  border-color: #F97316;
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.scratchpad-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--agenda-muted);
}

/* COMPROMISSOS DA AGENDA */
.agenda-events-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 250px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.agenda-event-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--agenda-border);
  border-radius: var(--agenda-radius-md);
  transition: all 0.15s ease;
  position: relative;
}

.agenda-event-item:hover {
  border-color: var(--agenda-border-strong);
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.05);
}

.agenda-event-item.completed {
  background: var(--bg-app);
  opacity: 0.75;
}

.agenda-event-item.completed .agenda-event-title {
  text-decoration: line-through;
  color: var(--agenda-muted);
}

.agenda-event-checkbox {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: #F97316;
  cursor: pointer;
}

.agenda-event-details {
  flex: 1;
  min-width: 0;
}

.agenda-event-time-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  color: #EA580C;
  background: var(--accent-orange-soft);
  border: 1px solid #FDBA74;
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 4px;
}

.agenda-event-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--agenda-navy);
  margin-bottom: 4px;
  word-break: break-word;
}

.agenda-event-desc {
  font-size: 12px;
  color: var(--agenda-muted);
  line-height: 1.4;
  margin-bottom: 6px;
  word-break: break-word;
}

.agenda-event-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.agenda-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-family: var(--font-mono, monospace);
}

.agenda-tag.cat-b2b,
.agenda-tag.cat-tech,
.agenda-tag.cat-fin,
.agenda-tag.cat-jur,
.agenda-tag.cat-pf {
  background: var(--bg-app);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}
.agenda-tag.cat-scott {
  background: #1F2937;
  color: #FFFFFF;
  border: 1px solid #1F2937;
}

.agenda-tag.prio-high { background: var(--accent-orange-soft); color: #EA580C; border: 1px solid #FDBA74; font-weight: 800; }
.agenda-tag.prio-med { background: var(--bg-app); color: var(--text-secondary); border: 1px solid var(--border-medium); }
.agenda-tag.prio-low { background: var(--bg-app); color: var(--text-muted); border: 1px solid var(--border-light); }

.agenda-event-actions {
  display: flex;
  gap: 4px;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.agenda-event-item:hover .agenda-event-actions {
  opacity: 1;
}

.agenda-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--agenda-border);
  background: var(--bg-app);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.15s ease;
}

.agenda-icon-btn:hover {
  background: #FFF7ED;
  color: #F97316;
  border-color: #FDBA74;
}

.agenda-icon-btn.btn-del:hover {
  background: #1F2937;
  color: #FFFFFF;
  border-color: #1F2937;
}

/* BLOCO DE NOTAS & CARDS */
.notes-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.note-card {
  background: var(--bg-surface);
  border: 1px solid var(--agenda-border);
  border-radius: var(--agenda-radius-md);
  padding: 12px 14px;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.note-card:hover {
  border-color: var(--agenda-border-strong);
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.06);
  transform: translateY(-1px);
}

.note-card.pinned {
  border-color: #FDBA74;
  background: var(--accent-orange-soft);
}

.note-card.pinned::after {
  content: "📌";
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 12px;
}

.note-card-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--agenda-navy);
  margin-bottom: 4px;
  padding-right: 20px;
}

.note-card-snippet {
  font-size: 12px;
  color: var(--agenda-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
  white-space: pre-wrap;
}

.note-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.5px;
  font-family: var(--font-mono, monospace);
  color: var(--text-muted);
  border-top: 1px solid var(--agenda-border);
  padding-top: 6px;
}

/* POMODORO & FOCO */
.pomodoro-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--agenda-border);
  border-radius: var(--agenda-radius-md);
}

.pomodoro-display {
  font-size: 44px;
  font-weight: 900;
  font-family: var(--font-mono, monospace);
  color: var(--agenda-navy);
  letter-spacing: 2px;
  margin: 10px 0;
}

.pomodoro-presets {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.pomodoro-preset-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--agenda-border);
  background: var(--bg-surface);
  font-size: 11px;
  font-weight: 700;
  color: var(--agenda-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pomodoro-preset-btn.active,
.pomodoro-preset-btn:hover {
  background: #1F2937;
  color: #FFFFFF;
  border-color: #1F2937;
}

.pomodoro-controls {
  display: flex;
  gap: 8px;
}

/* CHECKLIST DE ROTINA / HABITOS */
.habit-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}

.habit-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-app);
  border: 1px solid var(--agenda-border);
  transition: all 0.15s ease;
}

.habit-item:hover {
  background: var(--bg-surface);
  border-color: var(--agenda-border-strong);
}

.habit-item.done {
  background: var(--accent-orange-soft);
  border-color: #FDBA74;
}

.habit-item.done span {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* CALCULADORA EXECUTIVA */
.calc-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--agenda-border);
  border-radius: var(--agenda-radius-md);
  padding: 14px;
  max-width: 320px;
}

.calc-screen {
  background: #111827;
  color: #F97316;
  font-family: var(--font-mono, monospace);
  font-size: 24px;
  font-weight: 800;
  padding: 12px 14px;
  border-radius: 8px;
  text-align: right;
  margin-bottom: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.calc-btn {
  aspect-ratio: 1.2;
  border-radius: 6px;
  border: 1px solid var(--agenda-border);
  background: var(--bg-app);
  font-family: var(--font-mono, monospace);
  font-size: 14px;
  font-weight: 700;
  color: var(--agenda-navy);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.calc-btn:hover {
  background: var(--bg-subtle);
}

.calc-btn.op {
  background: var(--accent-orange-soft);
  color: #EA580C;
  border-color: #FDBA74;
}

.calc-btn.op:hover {
  background: #F97316;
  color: #FFFFFF;
}

.calc-btn.eq {
  background: #1F2937;
  color: #FFFFFF;
  border: none;
  grid-column: span 2;
  aspect-ratio: auto;
}

.calc-btn.quick-btn {
  background: var(--accent-orange-soft);
  color: #EA580C;
  border-color: #FDBA74;
  font-size: 11px;
}

/* RESPONSIVIDADE (MOBILE-FIRST - NORMA CANONICA 03) */
@media (max-width: 1200px) {
  .agenda-cockpit-grid {
    grid-template-columns: 320px 1fr;
  }
  .agenda-cockpit-grid > div:last-child {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .agenda-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .agenda-cockpit-grid {
    grid-template-columns: 1fr;
  }
  .agenda-cockpit-grid > div:last-child {
    grid-column: span 1;
  }
}

@media (max-width: 640px) {
  .agenda-kpi-grid {
    grid-template-columns: 1fr;
  }
  .agenda-top-tabs {
    padding: 4px;
  }
  .agenda-tab-btn {
    font-size: 12px;
    padding: 6px 10px;
  }
}
