/* Daily Ledger v0.1.0 — mobile-first */

:root {
  --bg: #0a0e1a;
  --bg-elevated: #131825;
  --bg-row: #1a2030;
  --border: #232a3d;
  --text: #e8ecf4;
  --text-dim: #8b94a8;
  --text-faint: #5a6378;
  --accent: #4f8aff;
  --accent-dim: #2c4d8a;
  --done: #4ade80;
  --pushed: #f59e0b;
  --danger: #ef4444;
  --radius: 10px;
  --gap: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  min-height: 100vh;
}

button,
input {
  font: inherit;
  color: inherit;
}

/* Header */

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  padding: env(safe-area-inset-top, 0) 16px 12px;
  padding-top: max(env(safe-area-inset-top, 0px), 12px);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.nav-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--bg-row);
  color: var(--text);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-btn:active {
  background: var(--accent-dim);
}

.date-display {
  flex: 1;
  text-align: center;
}

.day-name {
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.day-date {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 1px;
}

/* Main */

.main {
  padding: 16px;
  max-width: 720px;
  margin: 0 auto;
}

/* Sections */

.section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 10px 4px;
}

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.task-list:empty {
  display: none;
}

/* Task rows */

.task {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}

.task:last-child {
  border-bottom: none;
}

.task:active {
  background: var(--bg-row);
}

.task-check {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border: 2px solid var(--text-faint);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  transition: all 0.15s;
}

.task--done .task-check {
  background: var(--done);
  border-color: var(--done);
}

.task--done .task-check::after {
  content: "✓";
  color: var(--bg);
  font-size: 14px;
  font-weight: 700;
}

.task--pushed .task-check {
  background: transparent;
  border-color: var(--pushed);
}

.task--pushed .task-check::after {
  content: "▷";
  color: var(--pushed);
  font-size: 12px;
}

.task-body {
  flex: 1;
  min-width: 0;
}

.task-text {
  font-size: 15px;
  word-wrap: break-word;
}

.task--done .task-text {
  color: var(--text-dim);
  text-decoration: line-through;
}

.task--pushed .task-text {
  color: var(--text-dim);
}

.task-meta {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 3px;
}

.task-menu {
  border: none;
  background: transparent;
  color: var(--text-faint);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.task-menu:active {
  background: var(--bg-row);
}

/* Add form */

.add-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.add-input {
  flex: 1;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  outline: none;
}

.add-input:focus {
  border-color: var(--accent);
}

.add-input::placeholder {
  color: var(--text-faint);
}

.add-btn {
  width: 46px;
  height: 46px;
  border: 1px solid var(--accent-dim);
  background: var(--accent);
  color: white;
  border-radius: var(--radius);
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
}

.add-btn:active {
  background: var(--accent-dim);
}

/* Toast */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-row);
  color: var(--text);
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  font-size: 14px;
  z-index: 20;
  animation: toast-in 0.2s ease-out;
}

.toast--error {
  border-color: var(--danger);
  color: var(--danger);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Loading state */

.loading {
  text-align: center;
  padding: 32px;
  color: var(--text-dim);
  font-size: 14px;
}
