header {
  position: relative;
  z-index: 10;
  padding: 28px 25px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(124,106,247,0.06) 0%, transparent 100%);
}

header h1 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  color: var(--text);
  cursor: pointer;
  transition: opacity 0.15s;
}

header h1:hover { opacity: 0.8; }

header h1 span { color: var(--accent); }

.title-char        { color: var(--text); }
.title-char-accent { color: var(--accent); }

@keyframes charFlash {
  0%, 20%, 100% { filter: brightness(1); }
  8%            { filter: brightness(3.5); }
}

#appTitle.has-updates .title-char {
  animation: charFlash 1.6s linear infinite;
}

@media (max-width: 500px) {
  header h1 { font-size: 1.2rem; }
  header { padding: 12px 12px 10px; }
  #overview, #inboxView { padding: 24px 12px; }
  .inbox-form { padding: 16px; }
  .board-wrapper { padding: 0 4px; }
}

@media (max-height: 640px) {
  header h1 { font-size: 1.2rem; }
  header { padding-top: 14px; padding-bottom: 10px; }
}

/* Header menu */
.header-menu { position: relative; display: flex; gap: 6px; align-items: center; }

.header-menu-btn {
  font-family: 'DM Mono', monospace;
  font-size: 1rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
}

.header-menu-btn:hover,
.header-menu-btn.open {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-glow);
}

.header-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  overflow: hidden;
  min-width: 160px;
  z-index: 200;
}

.header-dropdown.open { display: block; }

.header-dd-item {
  display: block;
  width: 100%;
  text-align: left;
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.header-dd-item:hover {
  background: var(--accent-glow);
  color: var(--accent);
}

.header-dd-separator {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.header-dd-logout:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Buttons */
.btn {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: #c4baff;
}

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: #6b58e8;
  border-color: #6b58e8;
  color: #fff;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-danger:hover {
  border-color: var(--danger);
  background: rgba(240,79,106,0.15);
  color: var(--danger);
}

/* Save indicator */
.save-indicator {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.3s;
}

.save-indicator.show  { opacity: 1; }
.save-indicator.saved { color: #10b981; }
.save-indicator.saving { color: var(--accent); }
.save-indicator.save-error { color: #ef4444; }

/* Board */
.board-wrapper {
  flex: 1;
  min-height: 0;
  position: relative;
  z-index: 1;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 28px 25px;
}

.board {
  display: flex;
  gap: 18px;
  align-items: stretch;
  min-width: max-content;
  height: 100%;
}

/* Inbox view */
#inboxView {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 48px 36px;
  overflow-y: auto;
}

.inbox-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-top: 12px;
}

.inbox-select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  padding: 10px 12px;
  outline: none;
  cursor: pointer;
  appearance: none;
  transition: border-color 0.15s;
}

.inbox-select:focus { border-color: var(--accent); }

.inbox-msg { font-size: 0.8rem; min-height: 1.2em; margin-bottom: 8px; }
.inbox-msg-ok    { color: #10b981; }
.inbox-msg-error { color: var(--danger); }

/* Overview */
#overview {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  padding: 48px 36px;
}

.overview-inner {
  width: 100%;
  max-width: 760px;
}

.overview-hint {
  font-size: 0.82rem;
  color: var(--danger);
  margin-bottom: 20px;
}

.overview-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.board-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  animation: fadeInUp 0.25s ease both;
}

.board-card:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.board-card-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  overflow: hidden;
}

.board-card-name {
  font-family: 'Syne', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-card-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-card-counts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.board-card-count {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  text-transform: lowercase;
}

.board-card-count-inbox      { background: rgba(124,106,247,0.15); color: #7c6af7; }
.board-card-count-inprogress { background: rgba(249,115,22,0.15); color: #f97316; }
.board-card-count-todo       { background: rgba(180,30,30,0.18);  color: #c94040; }
.board-card-count-tracked    { background: rgba(144,144,176,0.15); color: var(--text-muted); }

.board-card-arrow {
  color: var(--accent);
  flex-shrink: 0;
  margin-left: 12px;
}

.board-grid-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.new-board-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 20px;
  grid-column: 1 / -1;
}

.new-board-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.new-board-input {
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s;
  flex: 1;
  min-width: 0;
}

.new-board-input:focus { border-color: var(--accent); }
.new-board-input::placeholder { color: var(--text-muted); }

.new-board-error {
  font-size: 0.75rem;
  color: var(--danger);
}
