/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-jamie:      #7A8C5A;
  --color-joshua:     #C0533A;
  --color-bg:         #2C2B28;
  --color-surface:    #3A3A35;
  --color-text:       #F0EDE6;
  --color-text-muted: #9A9488;
  --color-stripe:     #3A3A3A;
  --font-mono: 'Source Code Pro', 'Courier New', monospace;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-mono);
  min-height: 100vh;
}

/* ── Login Page ── */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.login-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 380px;
}

/* ── Site Header (top-left of form) ── */
.site-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 16px 4px;
}

.site-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 7px;
}

.site-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--color-text);
  letter-spacing: 0.02em;
}

.login-form {
  background-color: var(--color-surface);
  padding: 40px 44px;
  border-radius: 10px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-form h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.04em;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field input {
  background-color: var(--color-bg);
  border: 1px solid #4A4A44;
  border-radius: 6px;
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s;
}

.field input:focus {
  border-color: var(--color-jamie);
}

.error-message {
  font-size: 0.82rem;
  color: var(--color-joshua);
  background-color: rgba(192, 83, 58, 0.12);
  border-radius: 5px;
  padding: 8px 12px;
}

button[type="submit"] {
  background-color: var(--color-jamie);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 11px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: opacity 0.15s;
}

button[type="submit"]:hover {
  opacity: 0.88;
}

button[type="submit"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ════════════════════════════════════════
   TASKS PAGE
   ════════════════════════════════════════ */

/* ── Top Bar ── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background-color: var(--color-surface);
  border-bottom: 1px solid #4A4A44;
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-bar-center {
  display: flex;
  gap: 4px;
}

.top-bar-right {
  display: flex;
  gap: 8px;
}

.tab-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 5px 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.tab-btn.active {
  border-color: var(--color-jamie);
  color: var(--color-text);
}

.tab-btn:hover {
  color: var(--color-text);
}

.completed-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background-color: #4A9A4A;
  border-radius: 50%;
  color: #fff;
  font-size: 0.7rem;
  margin-right: 4px;
}

.undo-btn {
  background: none;
  border: 1px solid #4A4A44;
  border-radius: 6px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.undo-btn:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.undo-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ── New Task Bar ── */
.new-task-bar {
  padding: 10px 20px 10px calc(32px + 20px);
  background-color: var(--color-bg);
  border-bottom: 1px solid #3A3A35;
}

.new-task-input-wrap {
  position: relative;
}

.new-task-input {
  width: 100%;
  background-color: var(--color-surface);
  border: 1px solid #4A4A44;
  border-radius: 6px;
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  padding: 8px 12px;
  resize: none;
  overflow: hidden;
  outline: none;
  line-height: 1.5;
  transition: border-color 0.15s;
}

.new-task-input:focus {
  border-color: var(--color-jamie);
}

/* ── Main Task Area ── */
.task-area {
  display: flex;
  min-height: calc(100vh - 100px);
}

/* ── Timeline Stripe ── */
.timeline-stripe {
  width: 32px;
  min-width: 32px;
  background-color: var(--color-stripe);
  position: relative;
  flex-shrink: 0;
}

.stripe-month {
  position: absolute;
  left: 0;
  width: 32px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  pointer-events: none;
  padding-bottom: 4px;
}

.stripe-date {
  position: absolute;
  left: 0;
  width: 32px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  pointer-events: none;
  line-height: 1;
}

/* ── Task List ── */
.task-list {
  flex: 1;
  padding: 0;
}

/* ── Section ── */
.task-section {
  position: relative;
}

.task-section-header {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 8px 16px 4px 16px;
}

/* ── Insert Row ── */
.insert-row {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  position: relative;
}

.insert-row:hover,
.insert-row.keyboard-focus {
  opacity: 1;
}

.insert-row-inner {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  border: 1px dashed #4A4A44;
  border-radius: 4px;
  padding: 2px 14px;
  letter-spacing: 0.06em;
  pointer-events: none;
}

/* ── Task Item ── */
.task-item {
  display: flex;
  align-items: flex-start;
  padding: 6px 16px 6px 8px;
  border-radius: 5px;
  cursor: default;
  position: relative;
  user-select: none;
}

.task-item:hover,
.task-item.selected {
  background-color: rgba(255,255,255,0.05);
}

.task-item.selected {
  outline: 1px solid rgba(255,255,255,0.12);
}

/* ── Left Icons (up/calendar/down) ── */
.task-left-icons {
  width: 20px;
  min-width: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.12s;
  margin-right: 6px;
  align-self: center;
}

.task-item:hover .task-left-icons,
.task-item.selected .task-left-icons,
.task-item.arrows-pinned .task-left-icons {
  opacity: 1;
}

.task-icon-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 1px 3px;
  border-radius: 3px;
  line-height: 1;
  transition: color 0.1s, background-color 0.1s;
}

.task-icon-btn:hover {
  color: var(--color-text);
  background-color: rgba(255,255,255,0.1);
}

/* ── Checkboxes ── */
.task-checkboxes {
  display: flex;
  gap: 5px;
  align-items: center;
  margin-right: 10px;
  align-self: flex-start;
  padding-top: 2px;
}

.task-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 2px solid;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.15s;
}

.task-checkbox.jamie {
  border-color: var(--color-jamie);
}

.task-checkbox.jamie.checked {
  background-color: var(--color-jamie);
}

.task-checkbox.joshua {
  border-color: var(--color-joshua);
}

.task-checkbox.joshua.checked {
  background-color: var(--color-joshua);
}

.task-checkbox-check {
  color: #fff;
  font-size: 0.65rem;
  line-height: 1;
  display: none;
}

.task-checkbox.checked .task-checkbox-check {
  display: block;
}

/* ── Task Text ── */
.task-text {
  flex: 1;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--color-text);
  word-break: break-word;
}

.task-text-input {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 1px solid var(--color-jamie);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.5;
  outline: none;
  resize: none;
  overflow: hidden;
  width: 100%;
  padding: 0;
}

/* ── Assignment Picker ── */
.picker-overlay {
  position: sticky;
  top: 100px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  background-color: var(--color-surface);
  border-top: 1px solid #4A4A44;
  border-bottom: 1px solid #4A4A44;
}

.picker-label {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.picker-squares {
  display: flex;
  gap: 12px;
}

.assign-square {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.12s, transform 0.1s;
  color: #fff;
}

.assign-square:focus,
.assign-square.focused {
  border-color: #fff;
  outline: none;
  transform: scale(1.05);
}

.assign-square.vermilion  { background-color: var(--color-joshua); }
.assign-square.brown      { background-color: #7A5C3A; }
.assign-square.green      { background-color: var(--color-jamie); }
.assign-square.red-x      { background-color: #8A3A2A; font-size: 1.1rem; }
.assign-square.calendar   { background-color: var(--color-surface); border: 2px solid #4A4A44; font-size: 1.2rem; }

.picker-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-style: italic;
}

/* ── Hidden date input ── */
.hidden-date-picker {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
