/* ==================================================================
   JurisCRM v1.3 — Agenda, Audiências, Prioridades
   Mantém o tema navy (#0f2744) + gold (#e8c97e)
   ================================================================== */

/* ---------- View toggles (Mês/Semana/Lista) ---------- */
.agenda-view-toggle, .hw-toggle {
  display: inline-flex; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 2px; gap: 2px;
}
.av-btn, .hw-btn {
  border: none; background: transparent; padding: 6px 14px; border-radius: 6px;
  font-size: 13px; font-weight: 600; color: var(--text-muted); cursor: pointer;
  transition: all .15s;
}
.hw-btn { padding: 4px 10px; font-size: 11px; }
.av-btn:hover, .hw-btn:hover { color: var(--navy); }
.av-btn.active, .hw-btn.active { background: var(--navy); color: #fff; }

/* ---------- Agenda navigation bar ---------- */
.agenda-nav {
  display: flex; align-items: center; gap: 8px; padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.agenda-title { font-size: 16px; font-weight: 700; color: var(--navy); min-width: 200px; }
.agenda-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ---------- Month grid ---------- */
.agenda-month { padding: 12px 16px 16px; }
.agenda-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px;
}
.agenda-weekdays > div {
  text-align: center; font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px; padding: 4px;
}
.agenda-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.agenda-cell {
  min-height: 96px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; padding: 6px; cursor: pointer; transition: all .15s;
  display: flex; flex-direction: column; overflow: hidden;
}
.agenda-cell:hover { box-shadow: var(--shadow-md); border-color: var(--gold-dark); }
.agenda-cell.empty { background: transparent; border: none; cursor: default; }
.agenda-cell.today { border: 2px solid var(--navy); background: #f5f9ff; }
.cell-day { font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.agenda-cell.today .cell-day {
  background: var(--navy); color: #fff; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 11px;
}
.cell-events { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cell-event {
  font-size: 10px; color: #fff; padding: 2px 5px; border-radius: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4;
}
.cell-event b { font-weight: 700; }
.cell-more { font-size: 10px; color: var(--text-muted); font-weight: 600; padding: 1px 4px; }

/* ---------- Week view ---------- */
.agenda-week {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; padding: 16px;
}
.week-day {
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
  min-height: 280px; display: flex; flex-direction: column; overflow: hidden;
}
.week-day.today { border: 2px solid var(--navy); }
.week-day-head {
  padding: 8px; text-align: center; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .15s;
}
.week-day-head:hover { background: var(--bg); }
.week-day.today .week-day-head { background: var(--navy); color: #fff; }
.week-day-name { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.week-day-num { display: block; font-size: 20px; font-weight: 700; margin-top: 2px; }
.week-day-events { padding: 6px; display: flex; flex-direction: column; gap: 5px; overflow-y: auto; }
.week-empty { text-align: center; color: var(--text-light); font-size: 12px; padding: 16px 0; }
.week-event {
  background: var(--bg); border-radius: 6px; padding: 6px 8px; cursor: pointer;
  transition: all .15s;
}
.week-event:hover { background: #fff; box-shadow: var(--shadow); }
.we-time { font-size: 10px; font-weight: 700; color: var(--text-muted); }
.we-title { font-size: 12px; font-weight: 600; color: var(--navy); margin-top: 2px; line-height: 1.3; }
.we-loc { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* ---------- List view ---------- */
.agenda-list { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.agenda-list-item {
  display: flex; align-items: center; gap: 14px; padding: 12px;
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: all .15s;
}
.agenda-list-item:hover { box-shadow: var(--shadow-md); transform: translateX(2px); }
.ali-date {
  width: 50px; height: 50px; border-radius: 10px; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0;
}
.ali-day { font-size: 18px; font-weight: 800; line-height: 1; }
.ali-mon { font-size: 10px; text-transform: uppercase; }
.ali-body { flex: 1; }
.ali-title { font-size: 14px; font-weight: 600; color: var(--navy); }
.ali-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ali-loc { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.day-event-item {
  display: flex; gap: 10px; padding: 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); margin-bottom: 6px; transition: background .15s;
}
.day-event-item:hover { background: var(--bg); }

/* ---------- Hearings page ---------- */
.hearing-item {
  display: flex; align-items: center; gap: 16px; padding: 14px;
  border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px;
  cursor: pointer; transition: all .15s;
}
.hearing-item:hover { box-shadow: var(--shadow-md); border-color: var(--gold-dark); }
.hearing-item.past { opacity: .6; }
.hearing-date-box {
  width: 64px; flex-shrink: 0; background: var(--navy); color: #fff;
  border-radius: 10px; padding: 8px; text-align: center;
}
.hdb-day { font-size: 22px; font-weight: 800; line-height: 1; }
.hdb-mon { font-size: 11px; text-transform: uppercase; margin-top: 2px; }
.hdb-time { font-size: 11px; margin-top: 4px; background: rgba(255,255,255,.2); border-radius: 4px; padding: 1px 4px; }
.hearing-info { flex: 1; }
.hearing-title { font-size: 15px; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.hearing-meta { font-size: 12px; color: var(--text-muted); line-height: 1.6; }

/* ---------- Dashboard hearings widget ---------- */
.hw-list { display: flex; flex-direction: column; gap: 8px; }
.hw-item {
  display: flex; align-items: center; gap: 12px; padding: 10px;
  border-radius: 8px; cursor: pointer; transition: background .15s; border: 1px solid var(--border);
}
.hw-item:hover { background: var(--bg); }
.hw-date {
  width: 44px; height: 44px; background: var(--gold); color: var(--navy);
  border-radius: 8px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.hw-d { font-size: 16px; font-weight: 800; line-height: 1; }
.hw-m { font-size: 9px; text-transform: uppercase; }
.hw-info { flex: 1; min-width: 0; }
.hw-title { font-size: 13px; font-weight: 600; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hw-meta { font-size: 11px; color: var(--text-muted); }
.hw-client { font-size: 11px; color: var(--text-light); }

/* ---------- Priorities / Liminar / Sigilo ---------- */
.priority-tags-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px;
}
.priority-chip {
  display: flex; align-items: center; gap: 6px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
  font-size: 12px; transition: all .15s; background: #fff;
}
.priority-chip:hover { border-color: var(--chip); }
.priority-chip.selected { background: color-mix(in srgb, var(--chip) 12%, #fff); border-color: var(--chip); font-weight: 600; }
.priority-chip input { accent-color: var(--chip); }

.badge-sigilo {
  background: repeating-linear-gradient(45deg, #1a1a1a, #1a1a1a 6px, #2d2d2d 6px, #2d2d2d 12px);
  color: #fff; font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 6px;
  letter-spacing: .5px;
}
.badge-priority {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 6px; display: inline-block;
}

/* Destaque de processo em listas */
.case-highlighted { border-left: 4px solid var(--gold-dark) !important; }
.case-row-highlight { background: linear-gradient(90deg, rgba(232,201,126,0.08), transparent); }

.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }

/* Botões de financeiro (cancelar/excluir) */
.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { background: #b91c1c; }
.fin-actions { display: flex; gap: 6px; }
.badge-cancelled { background: var(--text-muted); color: #fff; text-decoration: line-through; }

/* Responsivo */
@media (max-width: 900px) {
  .agenda-week { grid-template-columns: 1fr; }
  .agenda-cell { min-height: 70px; }
  .priority-tags-grid { grid-template-columns: 1fr; }
}
