:root {
  --navy: #1f2937;
  --blue: #2563eb;
  --bg: #f3f4f6;
  --list: #e5e7eb;
  --ink: #111827;
  --muted: #6b7280;
  --line: #d1d5db;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--blue); text-decoration: none; }
h1, h2 { margin: 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
.error { color: #b91c1c; font-size: 13px; margin: 4px 0 8px; }

/* ---------- Inputs & buttons ---------- */
input[type="text"], input[type="password"], input[type="date"], input:not([type]) {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  background: #fff;
}
input:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: var(--blue); }
label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin: 14px 0 6px; }

.btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-danger { background: #fff; color: #b91c1c; border-color: #fecaca; margin-top: 16px; }
.btn-block { width: 100%; margin-top: 20px; padding: 12px; }
.btn-link { background: none; border: 0; color: #d1d5db; font: inherit; font-size: 13px; cursor: pointer; }

/* ---------- Nav ---------- */
.nav {
  display: flex; align-items: center; gap: 28px;
  height: 56px; padding: 0 24px;
  background: var(--navy);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 18px; }
.logo { display: flex; }
.nav-link { color: #fff; font-weight: 600; font-size: 14px; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--blue); color: #fff; font-size: 12px; font-weight: 600;
  border: 2px solid #fff;
}

/* ---------- Auth pages ---------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card {
  width: 100%; max-width: 420px;
  background: #fff; border-radius: 14px; padding: 36px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.15);
}
.auth-card h1 { font-size: 26px; text-align: center; }
.auth-card > .muted { text-align: center; margin: 6px 0 12px; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 14px; }
.auth-card .helptext, .auth-card ul { font-size: 12px; color: var(--muted); }

/* ---------- Boards dashboard ---------- */
.page { max-width: 1320px; margin: 0 auto; padding: 40px 24px; }
.page.narrow { max-width: 560px; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.page-header h1 { font-size: 28px; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { width: 260px; }

.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; margin-bottom: 40px; }
.board-tile { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); color: var(--ink); transition: transform .1s; }
.board-tile:hover { transform: translateY(-2px); }
.board-tile-top { height: 60px; }
.tile-blue { background: #2563eb; } .tile-purple { background: #7c3aed; }
.tile-green { background: #059669; } .tile-amber { background: #d97706; } .tile-pink { background: #db2777; }
.board-tile-body { padding: 16px; }
.board-tile-body h2 { font-size: 17px; margin-bottom: 6px; }
.board-tile-body p { margin: 0; font-size: 13px; }

.section-title { font-size: 18px; margin-bottom: 12px; }
.due-row {
  display: grid; grid-template-columns: 240px 1fr auto; align-items: center; gap: 16px;
  background: #fff; border-radius: var(--radius); padding: 12px 20px; margin-bottom: 10px;
  box-shadow: var(--shadow); color: var(--ink); font-size: 14px;
}

/* ---------- Due chips ---------- */
.chip { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 7px; border-radius: 4px; }
.chip-overdue { background: #fee2e2; color: #b91c1c; }
.chip-soon { background: #fef3c7; color: #92400e; }
.chip-normal { background: #f3f4f6; color: #4b5563; }

/* ---------- Board view ---------- */
.board-page { background: #dbeafe; min-height: 100vh; }
.board-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px; background: rgba(255, 255, 255, 0.55);
}
.board-header h1 { font-size: 22px; }

.lists { display: flex; align-items: flex-start; gap: 20px; padding: 24px 32px; overflow-x: auto; }
.list { flex: 0 0 300px; background: var(--bg); border-radius: 12px; padding: 12px 8px; }
.list-header { display: flex; align-items: center; gap: 8px; padding: 4px 8px 12px; }
.list-header h2 { font-size: 15px; }
.count { background: var(--list); color: var(--muted); font-size: 12px; font-weight: 600; border-radius: 10px; padding: 1px 8px; }

.card-stack { min-height: 12px; display: flex; flex-direction: column; gap: 10px; }
.card {
  background: #fff; border-radius: var(--radius); padding: 12px;
  box-shadow: var(--shadow); cursor: grab;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
}
.card-title { color: var(--ink); font-size: 14px; font-weight: 500; }
.card.dragging { opacity: 0.4; }
.card-placeholder { border: 2px dashed var(--blue); background: #dbeafe; border-radius: var(--radius); }

.add-card { padding: 10px 8px 2px; }
.add-card summary { color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; list-style: none; }
.add-card form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.list-new { background: rgba(255, 255, 255, 0.5); }
.list-new form { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Card edit ---------- */
.panel { background: #fff; border-radius: 14px; padding: 32px; box-shadow: 0 20px 48px rgba(0, 0, 0, 0.12); }
.panel h1 { font-size: 22px; }
.panel-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }

@media (max-width: 640px) {
  .inline-form { width: 100%; }
  .inline-form input { width: 100%; }
  .due-row { grid-template-columns: 1fr; gap: 4px; }
  .lists { padding: 16px; }
}
