:root {
  --right-now: #d9481f;    /* red-orange */
  --ready: #f7941d;        /* orange */
  --pending: #fbc02d;      /* yellow */
  --done: #2e9e44;         /* green */
  --archived: #1b5d82;     /* dark blue */
  --parking-lot: #00a99d;  /* teal */
  --btn-yellow: #fbc02d;   /* same yellow, used for buttons */
  --btn-red: #d9481f;      /* same red, used for the + button */
  --btn-blue: #3a86ff;     /* used for the quick-task toggle when active */
  --btn-violet: #8338ec;   /* used for the dependency link toggle when active */
  --card-bg: #ffffff;
  --page-bg: #ffffff;
  --text-dark: #323338;
  --text-gray: #676879;
}
* { box-sizing: border-box; }
body {
  margin: 0; padding: 24px 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-dark); background: var(--page-bg);
}

.page {
  width: 100%;
  max-width: 1000px;
  min-width: 0;
  margin: 0 auto;
}
@media (min-width: 900px) {
  .page { width: 34%; min-width: 620px; max-width: 1000px; }
}

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; gap: 10px; flex-wrap: wrap;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 8px; }
.icon-btn-lg {
  width: 34px; height: 34px; border-radius: 10px; border: none;
  background: var(--btn-red); color: #fff; font-size: 20px; font-weight: 700; cursor: pointer; line-height: 1;
}
.icon-btn-lg:hover { opacity: 0.88; }
.tag-filter, select {
  border: 1px solid #ddd; border-radius: 8px; padding: 7px 10px; font-size: 13px;
  background: #fff; color: var(--text-dark);
}
.btn-plain {
  border: none; border-radius: 8px; padding: 7px 12px; font-size: 12.5px;
  background: var(--btn-yellow); color: #fff; text-decoration: none; cursor: pointer; font-weight: 600;
}
.btn-plain:hover { opacity: 0.85; }

.board { display: flex; flex-direction: column; gap: 14px; }

.section {
  background: #ffffff10; border-radius: 12px;
}
.section-header {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 10px 14px; border-radius: 12px; color: #fff; font-weight: 700; font-size: 13.5px;
  user-select: none;
}
.section-header.no-collapse { cursor: default; }
.section-header .chevron { font-size: 11px; transition: transform 0.15s; }
.section-header .chevron.collapsed { transform: rotate(-90deg); }
.section-header .count { background: rgba(255,255,255,0.35); border-radius: 10px; padding: 1px 8px; font-size: 11.5px; margin-left: auto; }
/* Light-background headers (yellow) need dark text for contrast instead of the default white. */
.section-header.dark-text { color: var(--text-dark); }
.section-header.dark-text .count { background: rgba(50,51,56,0.15); }

.section-body {
  padding: 10px 0 2px 0; display: flex; flex-direction: column; gap: 10px;
  min-height: 12px;
}
.section-body.collapsed { display: none; }
.section-body.drag-over { background: #eee; border-radius: 10px; }
.empty-hint { color: var(--text-gray); font-size: 12px; text-align: center; padding: 8px 0 4px 0; }

.card {
  background: var(--card-bg); border-radius: 12px; padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.07); cursor: grab; width: 100%;
}
.card.dragging { opacity: 0.4; }

.card-row1 { display: flex; align-items: flex-start; gap: 8px; }
.card-title {
  flex: 1; font-weight: 600; font-size: 14px; line-height: 1.35;
  border-radius: 4px; padding: 1px 3px; margin: -1px -3px;
}
.card-title:hover { background: #f5f5f8; cursor: text; }
.card-title:focus { background: #fff; outline: 1px dashed #8aa8e0; cursor: text; }

.icon-cluster { display: flex; align-items: center; gap: 3px; flex-shrink: 0; }
.icon-toggle {
  background: none; border: none; cursor: pointer; font-size: 15px;
  width: 22px; height: 22px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  line-height: 1; opacity: 0.35; border-radius: 6px;
}
.icon-toggle.active { opacity: 1; background: #eee; }
.icon-toggle:hover { background: #f0f0f0; opacity: 0.8; }
.icon-toggle.active:hover { opacity: 1; }
.icon-toggle.star.active { background: #fff6d9; color: var(--btn-yellow); }
.icon-toggle.urgent.active { background: #fce6e2; color: var(--btn-red); }
.icon-toggle.quick.active { background: #e3edff; color: var(--btn-blue); }
.icon-toggle.parking.active { background: #d9f5f2; }
.icon-toggle.link.active { background: #f3ecfd; color: var(--btn-violet); }

.menu-wrap { position: relative; }
.menu-btn {
  background: none; border: none; cursor: pointer; font-size: 16px; padding: 2px 5px;
  color: #b8bcc4; line-height: 1;
}
.menu-btn:hover { color: var(--text-dark); }
.menu-dropdown {
  display: none; position: absolute; right: 0; top: 24px; background: #fff; border: 1px solid #ddd;
  border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,0.12); z-index: 10; min-width: 120px; overflow: hidden;
}
.menu-dropdown.show { display: block; }
.menu-dropdown button {
  display: block; width: 100%; text-align: left; padding: 8px 12px; border: none; background: none;
  cursor: pointer; font-size: 12.5px; color: var(--text-dark);
}
.menu-dropdown button:hover { background: #f5f5f8; }
.menu-dropdown button.danger { color: #a02c1f; }

.card-row2 {
  display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap;
}
.stale-flag { font-size: 11px; color: #b26a00; }

.notes-toggle {
  font-size: 10.5px; color: var(--text-gray); background: none; border: none; cursor: pointer;
  padding: 0; margin-top: 6px; text-decoration: underline; text-underline-offset: 2px;
}
.notes-body { margin-top: 6px; }
.note-entry {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 6px;
  font-size: 10.5px; color: var(--text-gray); margin-bottom: 3px; line-height: 1.3;
}
.note-entry .note-text { flex: 1; }
.note-entry .note-date { color: #2a6ebb; font-weight: 600; }
.note-delete-btn {
  background: none; border: none; cursor: pointer; font-size: 13px; color: #b8bcc4;
  line-height: 1; padding: 0 2px; flex-shrink: 0;
}
.note-delete-btn:hover { color: #a02c1f; }
.add-note-row { display: flex; gap: 4px; margin-top: 4px; }
.add-note-row input { flex: 1; font-size: 10.5px; padding: 3px 6px; border: 1px solid #ddd; border-radius: 5px; }
.add-note-row button { font-size: 10.5px; padding: 3px 8px; border: none; border-radius: 5px; background: var(--btn-yellow); color: #fff; font-weight: 600; cursor: pointer; }

.card-footer {
  display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 10px; color: #b0b3ba;
}
.footer-right { display: flex; align-items: center; gap: 8px; }
.status-select {
  font-size: 10.5px; padding: 2px 6px; border-radius: 6px; border: 1px solid #e2e2e6;
  background: #f6f7fb; color: var(--text-dark); cursor: pointer;
}
.status-select:disabled { opacity: 0.6; cursor: not-allowed; }
.status-label { font-weight: 700; font-size: 11px; color: var(--text-dark); text-transform: uppercase; letter-spacing: 0.02em; }

.dependency-banner {
  font-size: 11px; font-weight: 600; color: var(--btn-violet); background: #f3ecfd;
  border-radius: 6px; padding: 4px 8px; margin-bottom: 8px;
}

.modal-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  align-items: center; justify-content: center; z-index: 30; padding: 20px;
}
.modal-backdrop.show { display: flex; }
.modal { background: #fff; border-radius: 12px; padding: 20px; width: 380px; max-width: 100%; }
.modal h2 { font-size: 15px; margin: 0 0 10px 0; }
.modal label { font-size: 12px; color: var(--text-gray); display: block; margin-top: 10px; }
.modal input { width: 100%; padding: 7px 9px; font-size: 13px; border: 1px solid #ddd; border-radius: 7px; margin-top: 3px; }
.modal select { width: 100%; margin-top: 3px; }
.split-hint { font-size: 11.5px; color: var(--text-gray); margin-top: 4px; }
.status-options { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.status-options button {
  padding: 9px 12px; font-size: 13px; font-weight: 600; border-radius: 8px; border: none;
  background: #f6f7fb; color: var(--text-dark); cursor: pointer; text-align: left;
}
.status-options button:hover { background: #ececf2; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.modal-actions button { padding: 7px 13px; font-size: 12.5px; border-radius: 7px; border: 1px solid #ddd; cursor: pointer; background: #fff; }
.modal-actions .primary { background: var(--btn-yellow); color: #fff; border: none; }

.login-wrap {
  min-height: 80vh; display: flex; align-items: center; justify-content: center;
}
.login-box {
  background: #fff; border-radius: 12px; padding: 28px 26px; width: 300px; max-width: 100%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.login-box h2 { margin: 0 0 14px 0; font-size: 17px; }
.login-box label { font-size: 12px; color: var(--text-gray); display: block; margin-top: 12px; }
.login-box input {
  width: 100%; padding: 8px 10px; font-size: 13px; border: 1px solid #ddd; border-radius: 7px; margin-top: 4px;
}
.login-box button {
  width: 100%; margin-top: 18px; padding: 9px; font-size: 13px; border-radius: 8px;
  border: none; background: var(--btn-yellow); color: #fff; font-weight: 600; cursor: pointer;
}
.login-box button:hover { opacity: 0.85; }
.login-error {
  background: #fdecea; border: 1px solid #f5b8b1; color: #a02c1f;
  font-size: 12px; padding: 7px 10px; border-radius: 7px; margin-top: 10px;
}
