:root {
  --navy: #241b3f;
  --navy-light: #382a5e;
  --gold: #c9962f;
  --bg: #f4f5fa;
  --card: #ffffff;
  --border: #e3e5ee;
  --text: #23223a;
  --muted: #74748c;
  --danger: #c0392b;
  --danger-bg: #fdecea;
  --success: #1e8e5a;
  --success-bg: #e8f8f0;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; }

.muted { color: var(--muted); }

/* Topbar */
.topbar {
  background: var(--navy);
  color: #fff;
}
.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}
.brand-mark {
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  font-size: 14px;
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.brand-mark.large { width: 56px; height: 56px; font-size: 20px; margin: 0 auto 8px; }
.brand-text { font-weight: 600; font-size: 16px; }
.brand-text em { font-style: normal; color: #cfc4e8; font-weight: 400; }

.topnav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.topnav a { text-decoration: none; color: #e4dff5; font-size: 14px; }
.topnav a:hover { color: #fff; }
.who { font-size: 13px; color: #b7aed6; }
.link-btn {
  background: none; border: none; color: #e4dff5; cursor: pointer;
  font-size: 14px; padding: 0; font-family: inherit;
}
.link-btn:hover { color: #fff; text-decoration: underline; }
.inline-form { display: inline; }

/* Layout */
.page { max-width: 1400px; margin: 0 auto; padding: 28px 24px 60px; }
.page-narrow { max-width: 640px; }

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 16px; margin-bottom: 20px;
}
.page-header h1 { margin: 0 0 4px; font-size: 26px; }

.back-link { display: inline-block; margin-bottom: 16px; color: var(--muted); text-decoration: none; font-size: 14px; }
.back-link:hover { color: var(--text); }

.stats-row { display: flex; gap: 20px; flex-wrap: wrap; }
.stat { text-align: center; min-width: 64px; }
.stat-num { display: block; font-size: 22px; font-weight: 700; color: var(--navy); }
.stat-label { display: block; font-size: 12px; color: var(--muted); }

/* Filter tabs */
.filter-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tab {
  padding: 8px 16px; border-radius: 999px; font-size: 14px; text-decoration: none;
  background: #fff; border: 1px solid var(--border); color: var(--text);
}
.tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Kanban board */
.board {
  display: grid;
  grid-template-columns: repeat(6, minmax(220px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
}
.board-col {
  background: #eceef6;
  border-radius: var(--radius);
  min-width: 220px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 260px);
}
.board-col-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; font-weight: 600; font-size: 13px;
  text-transform: uppercase; letter-spacing: .03em; color: var(--navy);
}
.col-count {
  background: #d8dcee; color: var(--navy); font-size: 12px; font-weight: 700;
  border-radius: 999px; padding: 1px 8px;
}
.board-col-body {
  flex: 1; overflow-y: auto; padding: 0 10px 10px; display: flex; flex-direction: column; gap: 10px;
  min-height: 60px;
}
.board-col-body.drag-over { background: #dcd3f0; border-radius: 8px; }

.empty-col { font-size: 13px; color: var(--muted); padding: 10px; text-align: center; }

.card {
  background: var(--card);
  border-radius: 8px;
  padding: 12px;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(30,20,60,0.06);
  border: 1px solid var(--border);
  display: block;
  cursor: grab;
}
.card:active { cursor: grabbing; }
.card.dragging { opacity: 0.4; }
.card-top { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.card-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.card-sub { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.card-foot { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.assignee { font-weight: 600; color: var(--navy-light); }

.badge {
  display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .03em; padding: 3px 8px; border-radius: 999px;
}
.badge-website { background: #e6e1f7; color: var(--navy); }
.badge-seo { background: #dff3ea; color: var(--success); }
.badge-warn { background: #fbe9d5; color: #9a6316; }

/* Panels / forms */
.panel {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 18px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.panel-head h2 { margin: 0; font-size: 16px; }

.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } .board { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .board { grid-template-columns: 1fr; } }

.brief-text { white-space: pre-line; line-height: 1.55; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.stack label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--navy-light); }
.checkbox-label { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 500 !important; }

input[type=text], input[type=password], input[type=file], select, textarea {
  font: inherit; padding: 9px 11px; border-radius: 7px; border: 1px solid var(--border);
  background: #fbfbfe; color: var(--text);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--navy-light); outline-offset: 0; }

.btn {
  display: inline-block; padding: 10px 18px; border-radius: 7px; border: none;
  font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; text-align: center;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-light); }
.btn-secondary { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.btn-secondary:hover { background: #f1eefb; }
.btn-block { width: 100%; }

.status-select { padding: 10px 14px; font-weight: 600; border-radius: 7px; border: 1px solid var(--border); background: #fff; }

.hidden { display: none; }

.update-list { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.update-item { border-top: 1px solid var(--border); padding-top: 12px; }
.update-meta { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.update-message { font-size: 14px; white-space: pre-line; line-height: 1.5; }

.info-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; font-size: 13px; margin: 0; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; font-weight: 600; }

/* Auth page */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy);
  padding: 20px;
}
.auth-card {
  background: #fff; border-radius: 14px; padding: 36px; width: 100%; max-width: 380px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand h1 { margin: 0; font-size: 20px; color: var(--navy); }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-success { background: var(--success-bg); color: var(--success); }
