/* Buttons */
.btn {
  padding:8px 16px;
  border-radius:40px;
  font-size:13px;
  font-weight:600;
  cursor:pointer;
  border:1px solid var(--border-strong);
  background:var(--surface);
  color:var(--text-primary);
  transition:all .2s;
}

.btn-primary {
  background:var(--accent);
  color:white;
  border:none;
  box-shadow:var(--shadow-sm);
}

.btn-primary:hover {
  background:var(--accent-dark);
  transform:translateY(-1px);
}

.btn-danger {
  background:var(--danger);
  color:white;
  border:none;
}

.btn-warn {
  background:var(--warn);
  color:white;
  border:none;
}

.btn-sm {
  padding:5px 12px;
  font-size:12px;
}

/* Search and filters */
.search-input,
.filter-select {
  padding:8px 14px;
  border:1px solid var(--border-strong);
  border-radius:40px;
  font-size:13px;
  background:var(--surface);
  font-family:inherit;
  outline:none;
}
.filter-date { padding:6px 10px; border-radius:8px; min-width:130px; }
.filter-date-label { font-size:12px; color:var(--text-muted,#6b7280); white-space:nowrap; }

.search-input:focus {
  border-color:var(--accent);
}

/* Core form controls */
.form-input,
.form-textarea,
.form-select,
.cal-month-select {
  width:100%;
  padding:11px 14px;
  border:1px solid var(--border-strong);
  border-radius:14px;
  font-size:14px;
  background:var(--surface);
  color:var(--text-primary);
  font-family:inherit;
}

.form-textarea {
  resize:vertical;
  min-height:100px;
}

.form-select {
  appearance:none;
  background-image:url('data:image/svg+xml,%3Csvg viewBox="0 0 10 6" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M0 0L5 6L10 0" fill="%2364748B"/%3E%3C/svg%3E');
  background-repeat:no-repeat;
  background-position:right 14px center;
  background-size:10px 6px;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus,
.cal-month-select:focus {
  outline:none;
  border-color:var(--accent);
  box-shadow:0 0 0 4px rgba(15,118,110,.12);
}

/* Checkbox */
.followup-switch input {
  width:16px;
  height:16px;
  accent-color:var(--accent);
}

/* Date picker and time controls */
.dp-wrapper {
  position:relative;
  width:100%;
}

.dp-input-row {
  display:flex;
  align-items:center;
  gap:8px;
}

.dp-trigger {
  min-width:44px;
  padding:10px 12px;
  border:1px solid var(--border-strong);
  border-radius:14px;
  background:var(--surface);
  cursor:pointer;
  font-size:16px;
}

.dp-popup {
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  /* fixed, readable size wherever the picker is used (toolbars, modal, dashboard): never tied to the input's width */
  width:300px;
  min-width:min(280px, calc(100vw - 16px));
  max-width:calc(100vw - 16px);
  box-sizing:border-box;
  display:none;
  z-index:100;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:0 20px 40px rgba(15,23,42,.12);
  overflow:hidden;
}

.dp-popup.open {
  display:block;
}

/* Header: [ prev ] [ month ] [ year ] [ next ] in one row; the controls never shrink or clip */
.dp-popup .dp-head { display:flex;align-items:center;justify-content:space-between;gap:6px;padding:10px 8px;border-bottom:1px solid var(--border); }
.dp-popup .dp-nav { flex:0 0 auto;width:36px;height:36px;min-width:36px;padding:0;display:inline-flex;align-items:center;justify-content:center;font-size:18px;line-height:1;border-radius:50%; }
.dp-popup .dp-select { flex:0 0 auto;width:auto;max-width:none;box-sizing:border-box;padding:6px 24px 6px 10px;font-size:13px;border-radius:10px;background-position:right 9px center; }
.dp-popup .dp-select-month { width:112px; }
.dp-popup .dp-select-year { width:78px; }
@media (max-width:768px), (pointer:coarse) {
  .dp-popup .dp-nav { width:44px;height:44px;min-width:44px; }
  .dp-popup .dp-select { min-height:44px; }
  .dp-popup .dp-head { padding:10px 6px;gap:4px; }
  .dp-popup .dp-select-month { width:110px; }
  .dp-popup .dp-select-year { width:72px; }
}

/* Toggle switch */
.toggle-wrap {
  display:flex;
  align-items:center;
  gap:8px;
}

.toggle {
  width:36px;
  height:20px;
  background:var(--border-strong);
  border-radius:10px;
  cursor:pointer;
  position:relative;
  transition:.2s;
}

.toggle.on {
  background:var(--accent);
}

.toggle::after {
  content:'';
  position:absolute;
  width:16px;
  height:16px;
  background:white;
  border-radius:50%;
  top:2px;
  left:2px;
  transition:.2s;
}

.toggle.on::after {
  left:18px;
}
