.toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Calendar button – base pill styling from shared rule */

.calendar-btn {
  border: 1px solid var(--border-subtle);
  background: #f8fafc;
  padding: 4px 8px;
  font-size: 0.78rem;
  gap: 4px;
}

.calendar-btn:hover:not(:disabled) {
  border-color: var(--accent-soft);
  color: var(--accent-text);
}

.calendar-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.calendar-modal-controls {
  padding: 10px 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-view-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.calendar-range-toggle {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.range-btn {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: #f9fafb;
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
}

.range-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-text);
}

.calendar-modal-body {
  padding: 8px 16px 12px;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Each month card */
.calendar-month-card {
  border-radius: 12px;
  border: 1px solid #e5e7f3;
  padding: 8px 10px 10px;
  background: #fdfdfd;
}

.calendar-month-card h3 {
  margin: 0 0 6px;
  font-size: 0.9rem;
}

/* Calendar grid: 7 columns (Sun–Sat) */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  font-size: 0.75rem;
}

/* Weekday header row */
.calendar-weekday-header {
  text-align: center;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0;
}

/* Day cells */
.calendar-cell {
  min-height: 64px;
  border-radius: 6px;
  border: 1px solid #e5e7f3;
  background: #ffffff;
  padding: 2px 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calendar-cell.empty {
  background: #f9fafb;
  border-style: dashed;
  border-color: #e5e7f3;
}

.calendar-day-number {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-main);
}

/* Event text inside a cell */
.calendar-event {
  font-size: 0.72rem;
  line-height: 1.2;
  word-wrap: break-word;
}

.calendar-event + .calendar-event {
  margin-top: 2px;
}

.calendar-event-pill {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--accent-soft);
  font-size: 0.65rem;
  color: var(--accent-text);
  background: #f3f4ff;
}

/* Completed task rows */

.row-done {
  opacity: 0.7;
}

.row-done td.cell {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Overdue tasks (due date in the past, not done) */

.row-overdue {
  background: #fff5f5;          /* soft red-tinted background */
}

.row-overdue td.cell {
  color: #b91c1c;               /* darker red text */
}

.row-overdue.row-done {
  /* If somehow both classes ever apply, "done" styling should win */
  background: inherit;
  color: inherit;
}

.overdue-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.overdue-toggle input[type="checkbox"] {
  cursor: pointer;
}

/* Contact cells & copy tooltip */

.contact-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.contact-cell .sms-link {
  font-size: 0.7rem;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 1px 6px;
}

.contact-cell .sms-link:hover {
  border-color: var(--accent);
}

.icon-btn.copy-btn {
  font-size: 0.75rem;
}

.copy-tooltip {
  position: fixed;
  padding: 4px 8px;
  border-radius: 999px;
  background: #111827;
  color: #f9fafb;
  font-size: 0.7rem;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.3);
  opacity: 0;
  transform: translate(-50%, -4px);
  pointer-events: none;
  transition: opacity 0.15s ease-out, transform 0.15s ease-out;
  z-index: 9999;
}

.copy-tooltip.visible {
  opacity: 1;
  transform: translate(-50%, -8px);
}

/* Code/info styles */

.code-like {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8rem;
  background: #f3f4f6;
  border-radius: 6px;
  padding: 6px 8px;
  white-space: pre-wrap;
}

.info-banner {
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  font-size: 0.78rem;
  color: #111827;
}

.info-banner code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
  font-size: 0.78rem;
  background: #e5e7eb;
  border-radius: 4px;
  padding: 1px 4px;
}

/* Dashboard layout */

.dashboard-wrapper {
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Rows on the dashboard */
.dashboard-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Top metrics row: small flexible cards */
.metrics-row .dashboard-card {
  flex: 1 1 160px;   /* min width ~160px, grow as space allows */
}

/* Two-panel rows (charts, lists) */
.charts-row .dashboard-panel,
.lists-row .dashboard-panel {
  flex: 1 1 260px;   /* min width ~260px */
}

.dashboard-card {
  border-radius: 12px;
  border: 1px solid #e5e7f3;
  background: #ffffff;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
}

.dashboard-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: #eef2ff;
}

.dashboard-metric-main {
  display: flex;
  flex-direction: column;
}

.dashboard-metric-value {
  font-size: 1.2rem;
  font-weight: 600;
}

.dashboard-metric-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.dashboard-panel {
  border-radius: 12px;
  border: 1px solid #e5e7f3;
  background: #ffffff;
  padding: 10px 12px;
}

.dashboard-section-title {
  margin: 0 0 6px;
  font-size: 0.9rem;
}

.dashboard-panel canvas {
  width: 100%;
  height: 180px;
  display: block;
}

/* Dashboard lists */
.dashboard-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.8rem;
}

.dashboard-list li {
  padding: 4px 0;
  border-bottom: 1px dashed #e5e7f3;
}

.dashboard-list li:last-child {
  border-bottom: none;
}

.dashboard-list .list-label {
  font-weight: 500;
}

.dashboard-list .list-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Re-use calendar grid style for events heatmap, if desired */
.dashboard-calendar {
  margin-top: 4px;
}

/* Dark mode – dashboard & calendar */

:root[data-theme="dark"] .dashboard-wrapper {
  background: #020617;
}

:root[data-theme="dark"] .dashboard-card,
:root[data-theme="dark"] .dashboard-panel {
  background: #020617;
  border-color: #1f2937;
}

:root[data-theme="dark"] .dashboard-card-icon {
  background: rgba(37, 99, 235, 0.25); /* soft blue glow */
}

:root[data-theme="dark"] .dashboard-section-title,
:root[data-theme="dark"] .dashboard-metric-value {
  color: var(--text-main);
}

:root[data-theme="dark"] .dashboard-metric-label,
:root[data-theme="dark"] .dashboard-list .list-meta {
  color: var(--text-muted);
}

:root[data-theme="dark"] .dashboard-list li {
  border-bottom-color: #1f2937;
}

/* Calendar controls & day cells */

:root[data-theme="dark"] .calendar-btn {
  background: #020617;
  border-color: #1f2937;
  color: var(--text-main);
}

:root[data-theme="dark"] .calendar-popup {
  background: #020617;
  border-color: #1f2937;
}

:root[data-theme="dark"] .calendar-grid .calendar-day {
  background: #020617;
  border-color: #1f2937;
}

:root[data-theme="dark"] .calendar-grid .calendar-day:hover {
  background: rgba(15, 23, 42, 0.9);
}
