@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

/* ══════════════════════════════════════════
   DARK THEME (default)
══════════════════════════════════════════ */
:root,
[data-theme="dark"] {
  --bg-base: #0f0d17;
  --bg-surface: #1a1726;
  --bg-card: #211e30;
  --bg-card-hover: #271f38;
  --bg-input: #17142200;
  --border: rgba(139, 92, 246, 0.15);
  --border-strong: rgba(139, 92, 246, 0.32);
  --accent: #8b5cf6;
  --accent-2: #7c3aed;
  --accent-glow: rgba(139, 92, 246, 0.28);
  --accent-light: rgba(139, 92, 246, 0.12);
  --text-primary: #f1eeff;
  --text-secondary: #a89ec8;
  --text-muted: #6b6285;
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.12);
  --green-border: rgba(34, 197, 94, 0.28);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.1);
  --prio-high: #f43f5e;
  --prio-high-bg: rgba(244, 63, 94, 0.13);
  --prio-med: #f59e0b;
  --prio-med-bg: rgba(245, 158, 11, 0.13);
  --prio-low: #22c55e;
  --prio-low-bg: rgba(34, 197, 94, 0.13);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.28);
  --radius: 14px;
  --radius-sm: 9px;
  --radius-xs: 6px;
  --sidebar-w: 248px;
  --header-h: 58px;
  --scrollbar: #2e2845;
}

/* ══════════════════════════════════════════
   LIGHT THEME
══════════════════════════════════════════ */
[data-theme="light"] {
  --bg-base: #f3f0ff;
  --bg-surface: #ede8ff;
  --bg-card: #ffffff;
  --bg-card-hover: #f9f7ff;
  --bg-input: #f3f0ff;
  --border: rgba(109, 40, 217, 0.12);
  --border-strong: rgba(109, 40, 217, 0.28);
  --accent: #7c3aed;
  --accent-2: #6d28d9;
  --accent-glow: rgba(109, 40, 217, 0.2);
  --accent-light: rgba(109, 40, 217, 0.08);
  --text-primary: #1a0d33;
  --text-secondary: #5b3fa8;
  --text-muted: #9a7fcc;
  --green: #16a34a;
  --green-bg: rgba(22, 163, 74, 0.1);
  --green-border: rgba(22, 163, 74, 0.25);
  --red: #dc2626;
  --red-bg: rgba(220, 38, 38, 0.08);
  --prio-high: #e11d48;
  --prio-high-bg: rgba(225, 29, 72, 0.09);
  --prio-med: #d97706;
  --prio-med-bg: rgba(217, 119, 6, 0.09);
  --prio-low: #16a34a;
  --prio-low-bg: rgba(22, 163, 74, 0.09);
  --shadow: 0 4px 24px rgba(109, 40, 217, 0.1);
  --shadow-sm: 0 2px 8px rgba(109, 40, 217, 0.08);
  --scrollbar: #d4c8f8;
}

/* ══════════════════════════════════════════
   BASE
══════════════════════════════════════════ */
html,
body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px
}

::-webkit-scrollbar-track {
  background: transparent
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar);
  border-radius: 4px
}

.page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden
}

.main {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ══════════════════════════════════════════
   HEADER
══════════════════════════════════════════ */
.pageHeader {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  z-index: 20;
  position: relative;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px
}

.logo-orb {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 14px var(--accent-glow);
}

.logo-orb .fa {
  color: #fff;
  font-size: 14px
}

.logo-text {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.4px
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px
}

.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--accent-light);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background .15s, transform .1s;
}

.theme-toggle:hover {
  background: var(--accent);
  color: #fff
}

.theme-toggle:active {
  transform: scale(.94)
}

.userPanel {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  position: relative;
  transition: background .15s;
}

.userPanel:hover {
  background: var(--bg-card-hover)
}

.user-initials {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 8px var(--accent-glow);
}

.username {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary)
}

.userPanel .fa-chevron-down {
  font-size: 10px;
  color: var(--text-muted)
}

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 5px;
  box-shadow: var(--shadow);
  z-index: 100;
}

.user-dropdown.open {
  display: block
}

.user-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 500;
  color: var(--red);
  text-decoration: none;
  transition: background .12s;
}

.user-dropdown a:hover {
  background: var(--red-bg)
}

/* ══════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════ */
.nav {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 10px;
  overflow-y: auto;
}

.searchbox {
  margin-bottom: 18px
}

.searchbox>div {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  transition: border-color .2s;
}

.searchbox>div:focus-within {
  border-color: var(--accent)
}

.searchbox .fa {
  color: var(--text-muted);
  font-size: 12px
}

.searchbox input {
  background: none;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
  width: 100%
}

.searchbox input::placeholder {
  color: var(--text-muted)
}

.menu {
  flex: 1;
  display: flex;
  flex-direction: column
}

.menu>.title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 8px;
  margin-bottom: 7px
}

.menu ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px
}

.menu ul li {
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
  transition: background .15s
}

.menu ul li:hover {
  background: var(--accent-light)
}

.menu ul li.active-folder {
  background: var(--accent-light);
  border: 1px solid var(--border-strong)
}

.menu ul li.active-folder a:first-child {
  color: var(--accent) !important
}

.menu ul li a:first-child {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color .15s;
  min-width: 0;
}

.menu ul li a:first-child .fa {
  font-size: 13px;
  flex-shrink: 0
}

.menu ul li a:first-child span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.menu ul li a:first-child:hover {
  color: var(--text-primary)
}

.folder-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: transparent;
  margin-right: 5px;
  text-decoration: none !important;
  transition: color .15s, background .15s;
}

.menu ul li:hover .folder-delete-btn {
  color: var(--text-muted)
}

.folder-delete-btn:hover {
  color: var(--red) !important;
  background: var(--red-bg)
}

.add-folder-form {
  margin-top: 14px
}

.add-folder-form .form-row {
  display: flex;
  gap: 6px
}

.add-folder-form input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
  transition: border-color .2s;
  min-width: 0;
}

.add-folder-form input::placeholder {
  color: var(--text-muted)
}

.add-folder-form input:focus {
  border-color: var(--accent)
}

.add-folder-form button {
  background: var(--accent);
  border: none;
  border-radius: var(--radius-xs);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 0 10px var(--accent-glow);
  transition: opacity .15s, transform .1s;
}

.add-folder-form button:hover {
  opacity: .88
}

.add-folder-form button:active {
  transform: scale(.95)
}

/* ══════════════════════════════════════════
   MAIN VIEW
══════════════════════════════════════════ */
.view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.viewHeader {
  padding: 20px 22px 0
}

.viewHeader .title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.5px
}

.stats-bar {
  display: flex;
  gap: 16px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted)
}

.stats-bar strong {
  color: var(--text-primary)
}

.stats-bar .stat-done {
  color: var(--green)
}

.stats-bar .stat-pend {
  color: var(--accent)
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px
}

/* ══════════════════════════════════════════
   ADD TASK FORM
══════════════════════════════════════════ */
.add-task-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm)
}

.add-task-row {
  display: flex;
  gap: 8px;
  align-items: center
}

.add-task-row input[type="text"] {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color .2s;
}

.add-task-row input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light)
}

.add-task-row input[type="text"]::placeholder {
  color: var(--text-muted)
}

.add-task-row input[type="text"]:disabled {
  opacity: .4;
  cursor: not-allowed
}

.btn-expand {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background .15s, color .15s;
}

.btn-expand:hover,
.btn-expand.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent)
}

.btn-expand.disabled {
  opacity: .35;
  cursor: not-allowed;
  pointer-events: none
}

.btn-add-task {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 0 14px var(--accent-glow);
  transition: opacity .15s, transform .1s;
}

.btn-add-task:hover:not(:disabled) {
  opacity: .88
}

.btn-add-task:active:not(:disabled) {
  transform: scale(.97)
}

.btn-add-task:disabled {
  opacity: .35;
  cursor: not-allowed;
  box-shadow: none
}

/* Options panel — priority only */
.task-options {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease, padding .3s ease;
  margin-top: 0
}

.task-options.open {
  max-height: 120px;
  padding-top: 14px
}

.task-options-grid {
  display: flex;
}

.opt-group {
  display: flex;
  flex-direction: column;
  gap: 7px
}

.opt-group>label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px
}

.opt-group>label .fa {
  font-size: 12px;
  color: var(--accent)
}

/* Priority pills in form */
.priority-select {
  display: flex;
  gap: 6px;
  flex-wrap: wrap
}

.prio-opt {
  cursor: pointer
}

.prio-opt input[type="radio"] {
  display: none
}

.prio-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all .15s
}

.prio-pill.high {
  background: var(--prio-high-bg);
  color: var(--prio-high)
}

.prio-pill.medium {
  background: var(--prio-med-bg);
  color: var(--prio-med)
}

.prio-pill.low {
  background: var(--prio-low-bg);
  color: var(--prio-low)
}

.prio-opt input:checked+.prio-pill.high {
  border-color: var(--prio-high);
  box-shadow: 0 0 8px var(--prio-high)
}

.prio-opt input:checked+.prio-pill.medium {
  border-color: var(--prio-med);
  box-shadow: 0 0 8px var(--prio-med)
}

.prio-opt input:checked+.prio-pill.low {
  border-color: var(--prio-low);
  box-shadow: 0 0 8px var(--prio-low)
}

/* ══════════════════════════════════════════
   TASK LIST
══════════════════════════════════════════ */
.list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm)
}

.list-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}

.list ul li:last-child,
.list ul li.empty-li {
  border-radius: 0 0 var(--radius) var(--radius);
}

.list-header .title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .9px;
  text-transform: uppercase;
  color: var(--text-muted)
}

.list-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic
}

.list ul {
  list-style: none
}

.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 12px 22px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
  position: relative;
  min-height: 56px;
}

.task-item:last-child {
  border-bottom: none
}

.task-item:hover {
  background: var(--bg-card-hover)
}

.empty-li {
  border: none !important
}

/* Priority bar — left edge stripe */
.prio-bar {
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%
}

.prio-bar-high {
  background: var(--prio-high)
}

.prio-bar-medium {
  background: var(--prio-med)
}

.prio-bar-low {
  background: var(--prio-low)
}

/* Checkbox */
.task-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 7px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 18px;
  transition: color .15s, transform .15s;
}

.task-check:hover {
  color: var(--accent);
  transform: scale(1.1)
}

.task-item.checked .task-check {
  color: var(--green)
}

/* Task body */
.task-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0
}

.task-title {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 450;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .2s
}

.task-item.checked .task-title {
  text-decoration: line-through;
  color: var(--text-muted)
}

/* Task controls */
.task-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0
}

/* Priority selector on task row */
.prio-selector {
  position: relative
}

.prio-current {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: background .15s;
}

.prio-current.prio-high {
  color: var(--prio-high);
  background: var(--prio-high-bg);
  border-color: var(--prio-high)
}

.prio-current.prio-medium {
  color: var(--prio-med);
  background: var(--prio-med-bg);
  border-color: var(--prio-med)
}

.prio-current.prio-low {
  color: var(--prio-low);
  background: var(--prio-low-bg);
  border-color: var(--prio-low)
}

.prio-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 5px;
  box-shadow: var(--shadow);
  z-index: 50;
  min-width: 90px;
}

.prio-menu.open {
  display: block
}

.prio-opt-link {
  display: block;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background .12s;
  margin-bottom: 2px
}

.prio-opt-link:last-child {
  margin-bottom: 0
}

.prio-opt-link.high {
  color: var(--prio-high)
}

.prio-opt-link.high:hover,
.prio-opt-link.high.active {
  background: var(--prio-high-bg)
}

.prio-opt-link.medium {
  color: var(--prio-med)
}

.prio-opt-link.medium:hover,
.prio-opt-link.medium.active {
  background: var(--prio-med-bg)
}

.prio-opt-link.low {
  color: var(--prio-low)
}

.prio-opt-link.low:hover,
.prio-opt-link.low.active {
  background: var(--prio-low-bg)
}

/* Status badge */
.status-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: .2px;
  white-space: nowrap
}

.status-badge.pending {
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--border-strong)
}

.status-badge.completed {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border)
}

/* Delete btn */
.task-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: transparent;
  text-decoration: none;
  font-size: 13px;
  transition: color .15s, background .15s
}

.task-item:hover .task-delete-btn {
  color: var(--text-muted)
}

.task-delete-btn:hover {
  color: var(--red) !important;
  background: var(--red-bg)
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  gap: 10px
}

.empty-icon {
  font-size: 34px;
  color: var(--text-muted)
}

.empty-state p {
  font-size: 14px;
  color: var(--text-secondary)
}

.empty-state small {
  font-size: 12px;
  color: var(--text-muted)
}

/* Flash messages */
.flash {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin: 10px 22px 0
}

.flash-error {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, .25)
}

/* ══════════════════════════════════════════
   AUTH PAGES
══════════════════════════════════════════ */
body.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  height: auto;
  background: var(--bg-base)
}

body.auth-body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at 20% 20%, rgba(139, 92, 246, .2) 0%, transparent 55%), radial-gradient(ellipse at 80% 80%, rgba(124, 58, 237, .15) 0%, transparent 55%), var(--bg-base);
}

.auth-wrap {
  width: 100%;
  max-width: 400px;
  padding: 24px 16px
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 34px 30px;
  box-shadow: var(--shadow)
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px
}

.auth-logo-orb {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 14px var(--accent-glow)
}

.auth-logo-orb .fa {
  color: #fff;
  font-size: 15px
}

.auth-logo span {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.4px
}

.auth-heading {
  margin-bottom: 22px
}

.auth-heading h1 {
  font-size: 21px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.4px;
  margin-bottom: 4px
}

.auth-heading p {
  font-size: 13px;
  color: var(--text-secondary)
}

.auth-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--red-bg);
  border: 1px solid rgba(239, 68, 68, .25);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 13px;
  color: var(--red);
  margin-bottom: 16px
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px
}

.auth-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: .2px
}

.auth-input-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  transition: border-color .2s
}

.auth-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light)
}

.auth-input-wrap .fa {
  color: var(--text-muted);
  font-size: 14px;
  width: 15px;
  text-align: center
}

.auth-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary)
}

.auth-input-wrap input::placeholder {
  color: var(--text-muted)
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  margin-top: 4px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 0 18px var(--accent-glow);
  transition: opacity .15s, transform .1s
}

.auth-btn:hover {
  opacity: .88
}

.auth-btn:active {
  transform: scale(.98)
}

.auth-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary)
}

.auth-footer a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none
}

.auth-footer a:hover {
  text-decoration: underline
}

/* ══════════════════════════════════════════
   MOBILE RESPONSIVE
   Sidebar becomes a horizontal folder-chip bar,
   task rows wrap instead of overflowing, and
   tap targets grow for fingers.
══════════════════════════════════════════ */
@media (max-width: 760px) {

  .pageHeader {
    padding: 0 14px;
  }

  .username {
    display: none;
  }

  /* Sidebar → horizontal scroll strip above the task list */
  .main {
    flex-direction: column;
  }

  .nav {
    width: 100%;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
  }

  .searchbox {
    margin-bottom: 0;
    flex-shrink: 0;
    width: 130px;
  }

  .menu {
    flex-direction: row;
    align-items: center;
    flex: none;
  }

  .menu>.title {
    display: none;
  }

  .menu ul {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .menu ul li {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .menu ul li a:first-child {
    padding: 8px 10px;
  }

  .menu ul li a:first-child span {
    max-width: 90px;
  }

  .add-folder-form {
    margin-top: 0;
    flex-shrink: 0;
  }

  .add-folder-form .form-row input {
    width: 100px;
  }

  /* Main content area */
  .viewHeader {
    padding: 14px 14px 0;
  }

  .viewHeader .title {
    font-size: 19px;
  }

  .stats-bar {
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .content {
    padding: 12px 14px 20px;
  }

  /* Add-task row: input on its own line if it gets tight */
  .add-task-row {
    flex-wrap: wrap;
  }

  .add-task-row input[type="text"] {
    flex: 1 1 100%;
    min-width: 0;
  }

  .task-options-grid {
    max-width: none;
  }

  /* Task rows wrap so controls don't get crushed */
  .task-item {
    flex-wrap: wrap;
    padding: 12px 12px 12px 18px;
  }

  .task-body {
    flex: 1 1 auto;
    min-width: 120px;
  }

  .task-title {
    white-space: normal;
    word-break: break-word;
  }

  .task-controls {
    flex-shrink: 0;
  }

  /* Bigger tap targets for touch */
  .task-check {
    width: 28px;
    height: 28px;
    font-size: 20px;
  }

  .prio-current,
  .task-delete-btn,
  .folder-delete-btn {
    width: 32px;
    height: 32px;
  }

  .task-delete-btn,
  .folder-delete-btn {
    color: var(--text-muted);
  }
}

@media (max-width: 420px) {

  .logo-text {
    display: none;
  }

  .status-badge {
    display: none;
  }

  /* Stack controls onto their own row under the title when space is tightest */
  .task-item {
    align-items: flex-start;
  }

  .task-controls {
    flex: 1 1 100%;
    justify-content: flex-end;
    margin-top: 6px;
  }
}