/* ============================================================
   index.css — Kanban Board Styles
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Design tokens ── */
:root {
  --bg:             #f4f7fb;
  --bg-secondary:   #ffffff;
  --bg-tertiary:    #e5e7eb;

  --surface:        #ffffff;
  --surface-hover:  #f3f4f6;

  --surface-border: #d7deee;
  --surface-shadow: rgba(15, 23, 42, 0.05);
  --card-surface:   #ffffff;
  --card-surface-hover: #f8fafc;
  --card-surface-border: rgba(148, 163, 184, 0.34);
  --card-surface-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);

  --card-text:      #1f2937;
  --icon-muted:     rgba(75, 85, 99, 0.72);
  --icon-hover:     rgba(79, 70, 229, 0.12);
  --danger-surface: rgba(239, 68, 68, 0.14);

  --bg-notes-area:  #f8fafc;
  --bg-notes-font:  #1f2937;

  --text-primary:   #111827;
  --text-secondary: #374151;
  --text-tertiary:  #6b7280;
  --text-light:     #f8fafc;

  --accent:         #16a34a;
  --accent-hover:   #15803d;
  --accent-light:   rgba(22,163,74,0.12);
  --accent-secondary: #4f46e5;
  --accent-secondary-light: rgba(79,70,229,0.14);

  --border:         #d7deee;
  --border-focus:   #4f46e5;

  --glow-focus:     rgba(79,70,229,0.18);

  --danger:         #ef4444;
  --warning:        #f59e0b;
  --info:           #374151;
  --info-secondary: #4b5563;
  --column-width:   16%;

  --font-mono: 'SF Mono', ui-monospace, 'Cascadia Code',
               'Source Code Pro', 'Fira Mono', 'Courier New', monospace;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont,
               'Segoe UI', Roboto, sans-serif;
}

:root[data-theme="dark"] {
  --bg:             #111111;
  --bg-secondary:   #181818;
  --bg-tertiary:    #262626;

  --surface:        #202020;
  --surface-hover:  #2a2a2a;

  --surface-border: rgba(255, 255, 255, 0.12);
  --surface-shadow: rgba(0, 0, 0, 0.22);
  --card-surface:   #262626;
  --card-surface-hover: #303030;
  --card-surface-border: rgba(255, 255, 255, 0.11);
  --card-surface-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);

  --card-text:      #f4f4f5;
  --icon-muted:     rgba(244, 244, 245, 0.68);
  --icon-hover:     rgba(129, 140, 248, 0.18);
  --danger-surface: rgba(239, 68, 68, 0.28);

  --bg-notes-area:  #1f1f1f;
  --bg-notes-font:  #f4f4f5;

  --text-primary:   #f4f4f5;
  --text-secondary: rgba(244, 244, 245, 0.82);
  --text-tertiary:  rgba(244, 244, 245, 0.58);
  --text-light:     #f8fafc;

  --accent:         #16a34a;
  --accent-hover:   #22c55e;
  --accent-light:   rgba(22,163,74,0.12);
  --accent-secondary: #818cf8;
  --accent-secondary-light: rgba(129,140,248,0.16);

  --border:         rgba(255, 255, 255, 0.11);
  --border-focus:   #818cf8;

  --glow-focus:     rgba(129,140,248,0.28);

  --danger:         #f87171;
  --warning:        #facc15;
  --info:           #3a3a3a;
  --info-secondary: #4a4a4a;
}

:root[data-theme="matrix"] {
  --bg:             #030803;
  --bg-secondary:   #071007;
  --bg-tertiary:    rgba(28, 86, 42, 0.52);

  --surface:        #081308;
  --surface-hover:  #0d1d0d;

  --surface-border: rgba(99, 220, 132, 0.22);
  --surface-shadow: 0 14px 30px rgba(0, 0, 0, 0.52);
  --card-surface:   #0c1a0c;
  --card-surface-hover: #112411;
  --card-surface-border: rgba(79, 190, 111, 0.34);
  --card-surface-shadow: 0 16px 32px rgba(2, 12, 4, 0.58);

  --card-text:      #d8f5dc;
  --icon-muted:     rgba(153, 236, 173, 0.68);
  --icon-hover:     rgba(99, 220, 132, 0.16);
  --danger-surface: rgba(248, 113, 113, 0.28);

  --bg-notes-area:  #0a170a;
  --bg-notes-font:  #daf5dd;

  --text-primary:   #e1f8e3;
  --text-secondary: rgba(214, 246, 219, 0.82);
  --text-tertiary:  rgba(214, 246, 219, 0.56);
  --text-light:     #eaffef;

  --accent:         #22c55e;
  --accent-hover:   #4ade80;
  --accent-light:   rgba(34, 197, 94, 0.16);
  --accent-secondary: #86efac;
  --accent-secondary-light: rgba(134, 239, 172, 0.16);

  --border:         rgba(134, 239, 172, 0.18);
  --border-focus:   #86efac;

  --glow-focus:     rgba(134,239,172,0.24);

  --danger:         #f87171;
  --warning:        #facc15;
  --info:           rgba(34, 197, 94, 0.72);
  --info-secondary: rgba(134, 239, 172, 0.58);
}

/* ── Base ── */
html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.app-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.demo-banner {
  margin: 12px 16px 0;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.96) 0%, rgba(22, 163, 74, 0.96) 48%, rgba(245, 158, 11, 0.96) 100%);
  color: #ffffff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-shrink: 0;
}

.demo-banner[hidden] {
  display: none;
}

.demo-banner-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.demo-banner-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.84);
}

.demo-banner h2 {
  color: #ffffff;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 800;
}

.demo-banner p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  line-height: 1.4;
  max-width: 720px;
}

.demo-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.demo-banner-btn {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.demo-banner-btn.primary {
  border: 1px solid #ffffff;
  background: #ffffff;
  color: #0f172a;
}

.demo-banner-btn.secondary {
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.demo-banner-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.2);
}

.session-label {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sync-status {
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 1.35;
}

.sync-status.error {
  color: var(--danger);
}

.sync-status.saving {
  color: var(--accent-secondary);
}

.sync-status.saved {
  color: var(--accent);
}

.auth-shell {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: color-mix(in srgb, var(--bg) 84%, rgba(0, 0, 0, 0.62) 16%);
  backdrop-filter: blur(8px);
}

.auth-shell.active {
  display: flex;
}

.auth-panel {
  position: relative;
  width: min(420px, 100%);
  background: var(--bg-secondary);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  transition: background 0.18s ease, color 0.18s ease;
}

.auth-close:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.auth-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-copy h1 {
  color: var(--text-primary);
  font-size: 28px;
  line-height: 1.1;
  font-weight: 800;
}

.auth-copy p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.45;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field span {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.auth-field input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  padding: 9px 10px;
  outline: none;
}

.auth-field input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--glow-focus);
}

.auth-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.auth-actions .btn {
  flex: 1;
}

.auth-message {
  min-height: 18px;
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 1.35;
}

.auth-message.error {
  color: var(--danger);
}

.auth-message.success {
  color: var(--accent);
}

body[data-theme="matrix"] {
  background: var(--bg);
  color: var(--text-primary);
}

body[data-theme="matrix"]::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: repeating-linear-gradient(to bottom, rgba(134, 239, 172, 0.045) 0px, rgba(134, 239, 172, 0.045) 1px, transparent 1px, transparent 34px),
                    repeating-linear-gradient(to right, rgba(34, 197, 94, 0.032) 0px, rgba(34, 197, 94, 0.032) 1px, transparent 1px, transparent 34px);
  opacity: 0.45;
  pointer-events: none;
  z-index: -1;
}

/* ── Kanban Container ── */
.kanban-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  padding: 12px 16px;
  min-height: 0;
}

/* ── Sidebar Placeholder ── */
.column.placeholder {
  flex: 0 0 min(220px, 24vw);
  min-width: 220px;
  max-width: 320px;
  border: none;
  background: color-mix(in srgb, var(--surface) 82%, var(--bg) 18%);
  color: var(--text-primary);
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  border-radius: 8px;
  box-shadow: none;
}

.column.placeholder .column-header,
.column.placeholder .cards-container {
  display: none;
}

.placeholder-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  height: 100%;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  padding: 12px 4px 0;
  border-top: 1px solid color-mix(in srgb, var(--surface-border) 70%, transparent);
  margin-top: auto;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 4px 0;
  border-top: 1px solid color-mix(in srgb, var(--surface-border) 70%, transparent);
  margin-top: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
}

.sidebar-logo-mark {
  width: 28px;
  height: 28px;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
}

.sidebar-title {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
}

.sidebar-sync-status {
  padding: 8px 10px;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  background: var(--surface);
  min-height: 36px;
  display: flex;
  align-items: center;
}

.sidebar-sync-status .sync-status {
  display: block;
  width: 100%;
}

.sidebar-session {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.sidebar-session-status {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.sidebar-session-actions {
  display: flex;
  gap: 8px;
}

.sidebar-session-btn {
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.sidebar-session-btn:hover {
  border-color: var(--accent-secondary);
  color: var(--accent-secondary);
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-action {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 38px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.sidebar-action:hover {
  background: color-mix(in srgb, var(--text-primary) 8%, transparent);
}

.sidebar-action svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.btn-placeholder-trash {
  color: var(--danger);
}

.btn-placeholder-trash:hover {
  background: var(--danger-surface, rgba(239, 68, 68, 0.12));
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.placeholder-board-switcher {
  flex: 1;
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px;
}

.sidebar-section-title {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
}

.board-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}

.btn-board-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.btn-board-icon:hover {
  background: color-mix(in srgb, var(--text-primary) 8%, transparent);
  color: var(--text-primary);
}

.btn-board-icon.danger {
  color: var(--danger);
}

.btn-board-icon.danger:hover {
  background: var(--danger-surface);
}

.btn-board-icon:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-board-icon svg {
  width: 16px;
  height: 16px;
}

.board-tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.board-tabs::-webkit-scrollbar {
  width: 4px;
}

.board-tabs::-webkit-scrollbar-track {
  background: transparent;
}

.board-tabs::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.board-tab {
  display: block;
  width: 100%;
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.board-tab:hover {
  background: color-mix(in srgb, var(--text-primary) 8%, transparent);
  color: var(--text-primary);
}

.board-tab.active {
  background: color-mix(in srgb, var(--text-primary) 10%, transparent);
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Kanban Board ── */
.kanban-board {
  display: flex;
  gap: 14px;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  min-height: 0;
}

.kanban-board::-webkit-scrollbar {
  height: 8px;
}

.kanban-board::-webkit-scrollbar-track {
  background: transparent;
}

.kanban-board::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.kanban-board::-webkit-scrollbar-thumb:hover {
  background: var(--accent-secondary);
}

/* ── Column ── */
.column {
  flex: 0 0 var(--column-width, 16%);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  overflow: hidden;
  height: 100%;
  box-shadow: 0 4px 12px var(--surface-shadow);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.column.dragging {
  opacity: 0.7;
  transform: scale(0.98);
}

.column.column-drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: linear-gradient(135deg, var(--info) 0%, var(--info-secondary) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.column-header-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.column-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-transform: none;
  color: var(--text-light);
}

.column-count {
  font-size: 12px;
  color: rgba(248, 250, 252, 0.8);
  margin-left: 8px;
}

/* ── Column Notes Area ── */
.column-notes-area {
  position: relative;
  flex: 0 0 auto;
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--surface-border);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-notes-area);
  min-height: 140px;
  height: 140px;
  transition: height 0.25s ease;
}

.column-notes-area.expanded {
  overflow-y: auto;
  padding-bottom: 18px;
}

.column-notes-area.persist-open {
  box-shadow: inset 0 0 0 1px rgba(47, 42, 29, 0.08);
}

.column-notes-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--bg-notes-font);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.4;
  outline: none;
  resize: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  min-height: 100%;
}

.column-notes-input::placeholder {
  color: rgba(47, 42, 29, 0.35);
}

.column-notes-input::-webkit-scrollbar {
  width: 4px;
}

.column-notes-input::-webkit-scrollbar-track {
  background: transparent;
}

.column-notes-input::-webkit-scrollbar-thumb {
  background: #cccccc;
  border-radius: 2px;
}

.column-notes-input::-webkit-scrollbar-thumb:hover {
  background: #999999;
}

.column-actions {
  position: relative;
}

.btn-menu {
  background: transparent;
  border: none;
  color: rgba(248, 250, 252, 0.8);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.btn-menu svg {
  width: 18px;
  height: 18px;
}

.btn-menu:hover {
  background: rgba(15, 23, 42, 0.18);
  color: var(--text-light);
}

.menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  min-width: 140px;
  margin-top: 6px;
  display: none;
  flex-direction: column;
  z-index: 100;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18);
}

.menu-dropdown.active {
  display: flex;
}

.menu-item {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 12px 18px;
  text-align: left;
  font-size: 14px;
  transition: all 0.2s ease;
}

.menu-item:first-child {
  border-radius: 9px 9px 0 0;
}

.menu-item:last-child {
  border-radius: 0 0 9px 9px;
}

.menu-item:hover {
  background: var(--accent-secondary-light);
  color: var(--accent-secondary);
  padding-left: 18px;
}

.menu-item.delete {
  color: var(--danger);
}

.menu-item.delete:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  padding-left: 18px;
}

/* ── Cards Container ── */
.cards-container {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  position: relative;
  z-index: 0;
}

.cards-container > * {
  position: relative;
  z-index: 1;
}

.cards-container::before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: -1px;
  width: 1px;
  background: linear-gradient(180deg, rgba(209, 216, 230, 0) 0%, rgba(209, 216, 230, 0.7) 50%, rgba(209, 216, 230, 0) 100%);
  pointer-events: none;
}

.cards-container::-webkit-scrollbar {
  width: 6px;
}

.cards-container::-webkit-scrollbar-track {
  background: transparent;
}

.cards-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.cards-container.drag-over {
  background: var(--accent-secondary-light);
  border-radius: 10px;
}

/* ── Card ── */
.card {
  background: var(--card-surface);
  border: 1px solid var(--card-surface-border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: move;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  box-shadow: var(--card-surface-shadow);
  position: relative;
  animation: cardFadeIn 160ms ease;
}

.card.card-menu-active {
  z-index: 8;
}

.card.compact {
  padding: 8px 10px;
  gap: 6px;
}

.card-pinned {
  background: var(--accent-secondary-light);
  border-color: var(--accent-secondary);
}

.card-pinned .card-title {
  color: var(--accent-secondary);
}

.card-pinned .card-note {
  color: rgba(79, 70, 229, 0.78);
}

.card-pinned .btn-icon {
  color: var(--accent-secondary);
}

.card-pinned .btn-icon:hover {
  background: rgba(79, 70, 229, 0.15);
}

.card-done {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.45);
  opacity: 0.85;
}

.card-done .card-title {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

.card-done .card-note {
  color: rgba(148, 163, 184, 0.9);
}

.card-done .btn-icon {
  color: var(--text-tertiary);
}

.card:hover {
  background: var(--card-surface-hover);
  border-color: var(--accent);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.4), inset 0 0 0 1px rgba(22, 163, 74, 0.18);
}

.card-done:hover {
  background: rgba(148, 163, 184, 0.18);
  border-color: rgba(148, 163, 184, 0.6);
  box-shadow: none;
}

.card.dragging {
  opacity: 0.65;
  border-color: var(--accent);
  background: var(--card-surface-hover);
  box-shadow: 0 12px 28px rgba(22, 163, 74, 0.32);
}

.card-content {
  flex: 1;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--card-text, var(--text-light));
  word-break: break-word;
}

.card-note {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-tertiary);
  word-break: break-word;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  max-height: calc(1.45em * 3);
}


.card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 0.2s ease;
  position: relative;
}

.card-actions.menu-open,
.card:hover .card-actions {
  opacity: 1;
}

.card-menu-button {
  color: var(--icon-muted, var(--text-tertiary));
  padding: 4px;
  border-radius: 6px;
}

.card-menu-button:hover {
  color: var(--accent-secondary);
  background: var(--icon-hover, var(--accent-secondary-light));
}

.card-menu-dropdown {
  top: calc(100% + 6px);
  right: 0;
  min-width: 132px;
  z-index: 12;
}

.card-menu-dropdown .menu-item {
  font-size: 13px;
  padding: 10px 16px;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--icon-muted, var(--text-tertiary));
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  color: var(--accent-secondary);
  background: var(--icon-hover, var(--accent-secondary-light));
}

.btn-icon.delete:hover {
  color: var(--danger);
  background: var(--danger-surface, rgba(239, 68, 68, 0.2));
}

.btn-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.6;
}

/* ── Add Card Button ── */
.btn-add-card {
  width: 100%;
  background: rgba(99, 102, 241, 0.05);
  border: 1px dashed var(--surface-border);
  border-radius: 8px;
  padding: 9px;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-add-card::before {
  content: '+';
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-secondary);
}

.btn-add-card:hover {
  border-color: var(--accent-secondary);
  color: var(--accent-secondary);
  background: var(--accent-secondary-light);
  transform: translateY(-1px);
}

/* ── Modal ── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: min(400px, 90vw);
  max-width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.modal-content.settings {
  width: min(520px, 92vw);
}

.modal-content.trash {
  width: min(560px, 94vw);
  max-height: min(620px, 90vh);
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 24px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-close:hover {
  color: var(--text-primary);
}

.modal-input {
  display: block;
  width: 100%;
  padding: 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
}

.modal-input::placeholder {
  color: var(--text-tertiary);
}

.modal-textarea {
  width: 100%;
  resize: vertical;
  min-height: 96px;
  padding: 12px 16px 16px;
  border: none;
  border-top: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  outline: none;
}

.modal-textarea::placeholder {
  color: var(--text-tertiary);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.settings-body {
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 12px 14px;
  gap: 16px;
}

.settings-row .settings-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 65%;
}

.settings-row .settings-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.settings-row .settings-description {
  font-size: 13px;
  color: var(--text-tertiary);
}

.settings-row.settings-theme-select {
  align-items: center;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 180px;
}

.settings-select {
  appearance: none;
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.settings-select:focus {
  border-color: var(--accent-secondary);
  box-shadow: 0 0 0 3px var(--accent-secondary-light);
  outline: none;
}

.settings-row.settings-slider {
  align-items: center;
}

.settings-row.settings-slider .settings-info {
  max-width: 60%;
}

.settings-slider-control {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.settings-slider-control input[type="range"] {
  flex: 1;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-border);
  outline: none;
}

.settings-slider-control input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-border);
}

.settings-slider-control input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-secondary);
  box-shadow: 0 0 0 3px var(--accent-secondary-light);
  cursor: pointer;
}

.settings-slider-control input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-secondary);
  border: none;
  box-shadow: 0 0 0 3px var(--accent-secondary-light);
  cursor: pointer;
}

.slider-value {
  min-width: 42px;
  text-align: right;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-secondary);
}

.trash-body {
  padding: 18px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.trash-empty {
  padding: 18px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
}

.trash-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trash-section-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.trash-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  gap: 16px;
}

.trash-item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.trash-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.trash-item-meta {
  font-size: 12px;
  color: var(--text-tertiary);
}

.trash-item-note {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: pre-line;
}

.btn-restore {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: var(--accent-secondary);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-restore:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(79, 70, 229, 0.25);
}

.btn-restore:disabled {
  background: transparent;
  border: 1px solid var(--surface-border);
  color: var(--text-tertiary);
  cursor: not-allowed;
  box-shadow: none;
}

.toggle {
  position: relative;
  width: 46px;
  height: 26px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: rgba(99, 102, 241, 0.25);
  border-radius: 999px;
  transition: background 0.2s ease;
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
  transition: transform 0.2s ease;
}

.toggle input:checked + .toggle-track {
  background: var(--accent-secondary);
}

.toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(18px);
}

/* ── Buttons ── */
.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.btn-cancel:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-save {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  border: none;
  transition: all 0.2s ease;
  box-shadow: 0 0 8px rgba(0, 217, 255, 0.2);
}

.btn-save:hover {
  box-shadow: 0 0 16px rgba(0, 217, 255, 0.4);
  transform: translateY(-2px);
}

/* ── Utilities ── */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 760px) {
  .demo-banner {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .demo-banner-actions {
    width: 100%;
  }

  .demo-banner-btn {
    flex: 1;
  }
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
