/* Modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148, 163, 184, 0.3);
  max-width: 720px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.modal-body {
  padding: 12px 16px 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  overflow-y: auto;
}

.modal-footer {
  padding: 10px 16px 12px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
}

.modal-section h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.modal-help {
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Tasks modal and cards */

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

.tasks-add-form {
  border-radius: 10px;
  border: 1px dashed #e5e7f3;
  padding: 8px 10px;
  background: #f9fafb;
  margin-bottom: 6px;
  font-size: 0.8rem;
}

.tasks-add-form h3 {
  margin: 0 0 4px;
  font-size: 0.82rem;
}

.tasks-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

/* base input styling comes from shared input rules */
.tasks-add-row input[type="text"],
.tasks-add-row input[type="date"] {
  flex: 1 1 140px;
  min-width: 0;
  font-size: 0.78rem;
}

.tasks-add-actions {
  display: flex;
  justify-content: flex-end;
}

.tasks-add-actions button {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent-soft);
  background: var(--accent-soft);
  color: var(--accent-text);
  cursor: pointer;
}

.tasks-add-actions button:hover {
  border-color: var(--accent);
}

.task-item-card {
  border-radius: 10px;
  border: 1px solid #e5e7f3;
  padding: 6px 8px;
  background: #ffffff;
  font-size: 0.8rem;
}

.task-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.task-item-name {
  font-weight: 600;
}

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

.task-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  font-size: 0.7rem;
  margin-left: 4px;
}

.task-badge.done {
  border-color: #16a34a33;
  color: #15803d;
  background: #ecfdf5;
}

.task-badge.overdue {
  border-color: #dc262633;
  color: #b91c1c;
  background: #fef2f2;
}

/* Settings list */

.settings-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  border-radius: 10px;
  border: 1px solid #e5e7f3;
  max-height: 180px;
  overflow-y: auto;
}

.settings-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 0.85rem;
  border-bottom: 1px solid #edf0f7;
}

.settings-list-item:last-child {
  border-bottom: none;
}

.settings-list-item span {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-add-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* base styling from shared input rules */
.settings-input {
  flex: 1;
}

/* ===========================
   Task Action Icons — Dark Mode
   =========================== */

:root[data-theme="dark"] .task-done-btn,
:root[data-theme="dark"] .task-delete-btn,
:root[data-theme="dark"] .task-link-btn,
:root[data-theme="dark"] .copy-btn,
:root[data-theme="dark"] .task-icon,
:root[data-theme="dark"] .done-btn {
  color: #ffffff !important; /* force visible in dark mode */
  opacity: 0.9;
}

:root[data-theme="dark"] .task-done-btn:hover,
:root[data-theme="dark"] .task-delete-btn:hover,
:root[data-theme="dark"] .task-link-btn:hover,
:root[data-theme="dark"] .copy-btn:hover,
:root[data-theme="dark"] .task-icon:hover,
:root[data-theme="dark"] .done-btn:hover {
  opacity: 1;
}
