:root {
  color-scheme: light;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background: #f4f7fb;
  color: #162033;
}
body {
  margin: 0;
  background: linear-gradient(180deg, #f5f8fc 0%, #edf3fb 100%);
  color: #162033;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: linear-gradient(90deg, #17233f, #264b7b);
  color: white;
  box-shadow: 0 10px 24px rgba(16, 37, 63, 0.14);
}
.topbar h1 { margin: 0; font-size: 1.3rem; }
.layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  padding: 16px;
}
.panel {
  background: white;
  border: 1px solid #dfe8f2;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.06);
}
.stack { display: flex; flex-direction: column; gap: 8px; }
input, textarea, select, button {
  font: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #ced8e5;
}
button {
  cursor: pointer;
  background: linear-gradient(90deg, #1d4ed8, #2563eb);
  color: white;
  border: none;
  font-weight: 700;
}
button.secondary { background: #64748b; }
button.secondary.small { background: #64748b; }
ul { padding-inline-start: 18px; }
li { margin-bottom: 6px; }
.item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.item-row.done {
  opacity: 0.7;
}
.muted { color: #6b7280; font-size: 0.9rem; }
.small { padding: 6px 10px; font-size: 0.9rem; }
.pill {
  background: #e8f0ff;
  color: #1d4ed8;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.85rem;
}
.status {
  font-size: 0.95rem;
  background: rgba(255,255,255,0.14);
  padding: 6px 10px;
  border-radius: 999px;
}
#login-msg { min-height: 1.2em; color: #b91c1c; }
.hero-panel { background: linear-gradient(135deg, #f2f7ff 0%, #ffffff 100%); }
.dashboard-grid { display: flex; flex-direction: column; gap: 12px; }
.dashboard-header h3 { margin: 0; font-size: 1.15rem; }
.dashboard-header p { margin: 4px 0 0; color: #60708a; }
.dashboard-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.dashboard-card { background: #f8fbff; border: 1px solid #dfe8f3; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.dashboard-card strong { font-size: 1.25rem; color: #1d4ed8; }
.dashboard-card span { color: #5d6b7b; font-size: 0.95rem; }
.dashboard-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.dashboard-lists h4 { margin: 0 0 8px; }
.dashboard-lists ul { margin: 0; padding-inline-start: 18px; }
.pipeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.pipeline-column {
  background: #f8fbff;
  border: 1px solid #dfe8f2;
  border-radius: 14px;
  padding: 10px;
}
.pipeline-column h4 { margin: 0 0 8px; font-size: 0.95rem; }
.pipeline-items { display: flex; flex-direction: column; gap: 8px; }
.pipeline-item {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
}
.pipeline-item select { width: 100%; margin-top: 6px; }
.pipeline-column.stage-in_progress {
  border-color: #0f766e;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.15);
}
.pipeline-item.is-in-progress {
  border-color: #14b8a6;
  background: #ecfdf5;
}
.calendar-view {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.calendar-day {
  background: #f8fbff;
  border: 1px solid #dfe8f2;
  border-radius: 12px;
  padding: 10px;
}
.calendar-day h4 { margin: 0 0 6px; }
.calendar-day ul { margin: 0; padding-inline-start: 18px; }
.calendar-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.calendar-day {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
  min-height: 110px;
}
.calendar-day.has-events { border-color: #1d4ed8; }
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.kpi-card {
  background: #f8fbff;
  border: 1px solid #dfe8f2;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi-card strong { font-size: 1.2rem; color: #1d4ed8; }
.kpi-card span { color: #5d6b7b; font-size: 0.9rem; }
.documents-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.documents-grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.document-section {
  background: #f8fbff;
  border: 1px solid #dfe8f2;
  border-radius: 12px;
  padding: 10px;
}
.document-section h4 { margin: 0 0 8px; }
.document-total { font-weight: 700; color: #1d4ed8; }
.case-section {
  background: #f8fbff;
  border: 1px solid #dfe8f2;
  border-radius: 12px;
  padding: 10px;
}
.case-section h4 { margin: 0 0 8px; }
.reminder-section {
  background: #f8fbff;
  border: 1px solid #dfe8f2;
  border-radius: 12px;
  padding: 10px;
}
.reminder-section h4 { margin: 0 0 8px; }
.lead-item {
  background: #f8fbff;
  border: 1px solid #dfe8f2;
  border-radius: 12px;
  padding: 10px;
}
.lead-head {
  font-size: 0.98rem;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.lead-status-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.8rem;
  font-weight: 700;
}
.lead-status-in_progress {
  background: #ccfbf1;
  color: #115e59;
}
.lead-status-new {
  background: #dbeafe;
  color: #1e40af;
}
.lead-status-consultation,
.lead-status-contacted {
  background: #fef3c7;
  color: #92400e;
}
.lead-status-won {
  background: #dcfce7;
  color: #166534;
}
.lead-status-lost {
  background: #fee2e2;
  color: #991b1b;
}
.lead-rec {
  margin-top: 6px;
  color: #1d4ed8;
  font-weight: 700;
}
.lead-refund {
  margin-top: 6px;
  color: #107548;
  font-weight: 700;
}
.lead-due {
  margin-top: 6px;
  color: #7c3aed;
  font-weight: 700;
}
.lead-docs {
  margin-top: 6px;
}
.lead-docs ul {
  margin: 6px 0 0;
  padding-inline-start: 18px;
}
.lead-docs a {
  color: #1d4ed8;
  text-decoration: none;
}
.lead-docs a:hover {
  text-decoration: underline;
}
.lead-actions {
  margin-top: 8px;
}
.lead-actions button {
  background: #0f766e;
}
.lead-tools {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.lead-tools button.active {
  background: #0f766e;
}
.lead-filter-count {
  color: #475569;
  font-size: 0.9rem;
}
.lead-tools select {
  min-width: 150px;
  background: #fff;
}
.hidden {
  display: none !important;
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(7, 18, 35, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-card {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 14px;
  border: 1px solid #dbe5f1;
  padding: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
}
.modal-card h3 {
  margin: 0 0 8px;
}
.modal-actions {
  display: flex;
  gap: 8px;
}
