/*
 * CardWall - Base Application Styles
 *
 * Color palette and theme support with CSS custom properties.
 * Defaults to system preference, user can override via theme toggle.
 */

/* ===== Light Theme (default) ===== */
:root {
  /* Primary - Purple */
  --color-primary: #7C3AED;
  --color-primary-hover: #6D28D9;
  --color-primary-light: #EDE9FE;
  --color-primary-text: #FFFFFF;

  /* Neutrals */
  --color-bg: #FFFFFF;
  --color-bg-secondary: #F9FAFB;
  --color-bg-tertiary: #F3F4F6;
  --color-surface: #FFFFFF;
  --color-border: #E5E7EB;
  --color-border-light: #F3F4F6;

  /* Text */
  --color-text: #111827;
  --color-text-secondary: #6B7280;
  --color-text-muted: #9CA3AF;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

  /* Overlay */
  --color-overlay: rgba(0, 0, 0, 0.5);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Lane Colors */
  --lane-coral: #F97066;
  --lane-amber: #F59E0B;
  --lane-emerald: #10B981;
  --lane-sky: #0EA5E9;
  --lane-pink: #EC4899;
  --lane-teal: #14B8A6;
}

/* ===== Dark Theme ===== */
[data-theme="dark"] {
  --color-primary: #A78BFA;
  --color-primary-hover: #C4B5FD;
  --color-primary-light: #2E1065;
  --color-primary-text: #111827;

  --color-bg: #111827;
  --color-bg-secondary: #1F2937;
  --color-bg-tertiary: #374151;
  --color-surface: #1F2937;
  --color-border: #374151;
  --color-border-light: #1F2937;

  --color-text: #F9FAFB;
  --color-text-secondary: #D1D5DB;
  --color-text-muted: #6B7280;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);

  --color-overlay: rgba(0, 0, 0, 0.7);
}

/* System preference: auto-detect dark mode when no explicit theme is set */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-primary: #A78BFA;
    --color-primary-hover: #C4B5FD;
    --color-primary-light: #2E1065;
    --color-primary-text: #111827;

    --color-bg: #111827;
    --color-bg-secondary: #1F2937;
    --color-bg-tertiary: #374151;
    --color-surface: #1F2937;
    --color-border: #374151;
    --color-border-light: #1F2937;

    --color-text: #F9FAFB;
    --color-text-secondary: #D1D5DB;
    --color-text-muted: #6B7280;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);

    --color-overlay: rgba(0, 0, 0, 0.7);
  }
}

/* ===== Base Reset & Typography ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
}

/* Scrollbar styling — webkit rules handle Chromium/Safari,
   scrollbar-width/color handle Firefox (which ignores webkit rules) */
@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
  }
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background-color: var(--color-border);
  border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-text-muted);
}

*::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

/* Ensure the hidden attribute always works, even when a class sets display */
[hidden] {
  display: none !important;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-primary-text);
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  text-decoration: none;
}

.btn-secondary {
  background-color: var(--color-bg-secondary);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background-color: var(--color-bg-tertiary);
  text-decoration: none;
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-text-secondary);
  border-color: transparent;
}

.btn-ghost:hover {
  background-color: var(--color-bg-secondary);
  color: var(--color-text);
  text-decoration: none;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border: none;
  background: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s, color 0.15s;
}

.btn-icon:hover {
  background-color: var(--color-bg-tertiary);
  color: var(--color-text);
}

.btn-icon svg {
  fill: currentColor;
}

.sidebar-toggle {
  padding: 0;
}

.sidebar-toggle .icon-sm {
  width: 24px;
  height: 24px;
}

.sidebar-toggle .icon-sm svg {
  width: 24px;
  height: 24px;
}

/* ===== Forms ===== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.field {
  margin-bottom: 1rem;
}

/* ===== Utility Classes ===== */
.text-secondary {
  color: var(--color-text-secondary);
}

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

.text-sm {
  font-size: 0.875rem;
}

.text-xs {
  font-size: 0.75rem;
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Crouton dark mode overrides ===== */
[data-theme="dark"] .crouton-toast--notice {
  --crouton-notice-bg: #14532D;
  --crouton-notice-border: #166534;
  --crouton-notice-color: #86EFAC;
}

[data-theme="dark"] .crouton-toast--alert {
  --crouton-alert-bg: #451A1A;
  --crouton-alert-border: #7F1D1D;
  --crouton-alert-color: #FCA5A5;
}

[data-theme="dark"] .crouton-toast {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ===== Auth Pages ===== */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-logo {
  display: block;
  height: 240px;
  width: auto;
  margin: 1rem auto;
}

.auth-card h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.auth-card > p {
  margin: 0 0 1.5rem;
}

.auth-errors {
  background-color: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.auth-errors p {
  margin: 0;
  font-size: 0.875rem;
  color: #DC2626;
}

[data-theme="dark"] .auth-errors {
  background-color: #451A1A;
  border-color: #7F1D1D;
}

[data-theme="dark"] .auth-errors p {
  color: #FCA5A5;
}

.auth-notice {
  background-color: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.auth-notice p {
  margin: 0;
  font-size: 0.875rem;
  color: #16A34A;
}

[data-theme="dark"] .auth-notice {
  background-color: #14532D;
  border-color: #166534;
}

[data-theme="dark"] .auth-notice p {
  color: #86EFAC;
}

/* ===== Template Selector ===== */
.template-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.template-option {
  position: relative;
  cursor: pointer;
}

.template-radio {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.template-option-content {
  display: flex;
  flex-direction: column;
  padding: 0.625rem 0.75rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color 0.15s, background-color 0.15s;
}

.template-radio:checked + .template-option-content {
  border-color: var(--color-primary);
  background-color: var(--color-primary-light);
}

.template-option:hover .template-option-content {
  border-color: var(--color-primary);
}

.template-option-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
}

.template-option-desc {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  margin-top: 0.125rem;
}

/* ===== Form Pages (new/edit) ===== */
.form-container {
  display: flex;
  justify-content: center;
  padding: 3rem 2rem;
}

.form-card {
  width: 100%;
  max-width: 400px;
}

.form-card h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.form-card > p {
  margin: 0 0 1.5rem;
}

/* ===== Profile Page ===== */
.profile-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 3rem;
}

.profile-avatar {
  margin: 0 0 1.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-avatar-btn {
  position: relative;
  display: block;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  border-radius: var(--radius-full);
}

.profile-avatar-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.avatar-xl {
  width: 96px;
  height: 96px;
}

.profile-avatar-btn svg,
.profile-avatar-btn img {
  display: block;
  border-radius: var(--radius-full);
}

.profile-avatar-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background-color: rgba(0, 0, 0, 0.4);
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s;
}

.profile-avatar-btn:hover .profile-avatar-overlay {
  opacity: 1;
}

.profile-remove-photo {
  display: block;
  margin-top: 0.5rem;
  text-align: center;
}

.profile-remove-photo button,
.profile-remove-photo input[type="submit"] {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  cursor: pointer;
}

.profile-remove-photo button:hover,
.profile-remove-photo input[type="submit"]:hover {
  color: #DC2626;
}

[data-theme="dark"] .profile-remove-photo button:hover,
[data-theme="dark"] .profile-remove-photo input[type="submit"]:hover {
  color: #FCA5A5;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  cursor: pointer;
  outline: none;
}

.profile-name.editing {
  text-decoration: underline;
  text-decoration-color: var(--color-primary);
  text-underline-offset: 3px;
  cursor: text;
}

.profile-email {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* ===== App Layout ===== */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.app-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

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

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.375rem 1rem;
  background-color: var(--color-surface);
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 0;
}

.app-header-title-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: 3rem;
}

.board-action-link {
  display: flex;
  align-items: center;
  color: var(--color-text-muted);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.board-action-link:hover {
  color: var(--color-text);
  background-color: var(--color-bg-secondary);
}

.wall-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.wall-title {
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.wall-title-edit-icon {
  color: var(--color-text-muted);
  opacity: 0;
  transition: opacity 0.15s ease;
  flex-shrink: 0;
}

.wall-title-wrapper:hover .wall-title-edit-icon {
  opacity: 1;
}

.wall-title-editing {
  text-decoration: underline;
  text-decoration-color: var(--color-primary);
  text-underline-offset: 3px;
  cursor: text;
  overflow: visible;
  max-width: none;
}

.wall-title-editing + .wall-title-edit-icon {
  display: none;
}

.app-header-center {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0 1.5rem;
}

.app-search {
  width: 100%;
  max-width: 640px;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  background-color: var(--color-bg-secondary);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.app-search:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 25%, transparent);
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-content {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.app-content-board {
  display: flex;
  flex-direction: column;
  padding: 0 1rem 0.5rem;
  overflow: hidden;
  min-height: 0;
}

/* ===== Sidebar ===== */
.sidebar {
  width: 240px;
  background-color: var(--color-bg-secondary);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.2s ease, opacity 0.2s ease;
  overflow: hidden;
}

.sidebar-collapsed {
  width: 0;
}

/* Prevent flash of expanded sidebar on page load */
.sidebar-start-collapsed .sidebar {
  width: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  margin: 0;
  padding: 0.25rem 0.5rem;
  color: var(--color-primary);
  text-decoration: none;
}

.sidebar-logo {
  height: 36px;
  width: auto;
}

.sidebar-brand span {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 1.125rem;
}

.sidebar-brand:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.375rem;
}

.sidebar-footer {
  padding: 0.375rem;
  border-top: 1px solid var(--color-border);
}

.sidebar-section {
  margin-bottom: 1rem;
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.5rem;
  margin-bottom: 0.25rem;
}

.sidebar-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  text-decoration: none;
}

.sidebar-add-btn:hover {
  color: var(--color-primary);
  background-color: var(--color-bg-tertiary);
  text-decoration: none;
}

.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-item {
  display: flex;
  align-items: center;
  position: relative;
  padding: 0.375rem 0.25rem;
  border-radius: var(--radius-md);
  transition: background-color 0.1s ease;
}

.sidebar-item:hover {
  background-color: var(--color-bg-tertiary);
}

.sidebar-item-active {
  background-color: var(--color-primary-light);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
}

.sidebar-item:hover .sidebar-link {
  color: var(--color-text);
  text-decoration: none;
}

.sidebar-item-active .sidebar-link {
  color: var(--color-primary);
  font-weight: 500;
}

.sidebar-link-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-item .sidebar-link {
  flex: 1;
  min-width: 0;
}

.sidebar-dropdown {
  position: relative;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.1s;
}

.sidebar-item:hover .sidebar-dropdown {
  opacity: 1;
}

/* ===== Profile Dropdown ===== */
.profile-dropdown {
  position: relative;
}

.profile-dropdown-trigger {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  border-radius: var(--radius-full);
}

.profile-dropdown-trigger:hover {
  opacity: 0.8;
}

.avatar {
  border-radius: var(--radius-full);
  object-fit: cover;
}

.avatar-sm {
  width: 32px;
  height: 32px;
}

.profile-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  width: 220px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 0.375rem;
  z-index: 50;
}

.profile-dropdown-header {
  padding: 0.5rem 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.profile-dropdown-header strong {
  font-size: 0.875rem;
}

.profile-dropdown-divider {
  height: 1px;
  background-color: var(--color-border);
  margin: 0.375rem 0;
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.625rem;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  background: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  text-align: left;
}

.profile-dropdown-item:hover {
  background-color: var(--color-bg-secondary);
  color: var(--color-text);
  text-decoration: none;
}

.profile-dropdown-item-danger:hover {
  background-color: #FEF2F2;
  color: #DC2626;
}

[data-theme="dark"] .profile-dropdown-item-danger:hover {
  background-color: #451A1A;
  color: #FCA5A5;
}

/* ===== Walls Grid ===== */
.walls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.wall-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--color-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  text-align: center;
}

.wall-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.wall-card-icon {
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.wall-card-name {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.wall-card-meta {
  margin: 0;
}

.wall-card-new {
  border-style: dashed;
  color: var(--color-text-muted);
}

.wall-card-new .wall-card-icon {
  color: var(--color-text-muted);
}

.wall-card-new:hover {
  color: var(--color-primary);
}

.wall-card-new:hover .wall-card-icon {
  color: var(--color-primary);
}

/* ===== Board / Kanban ===== */
.board {
  display: flex;
  flex: 1;
  min-height: 0;
  gap: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1rem 0;
  align-items: flex-start;
}

.lane {
  flex: 0 0 280px;
  background-color: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: 100%;
  overflow: hidden;
}

.lane-header {
  padding: 0.75rem 0.75rem 0.625rem;
  border-top: 4px solid var(--lane-coral);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
}

.lane-title {
  flex: 1;
  min-width: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.5rem;
  margin: 0;
  cursor: pointer;
  outline: none;
  text-align: center;
}

.lane-dropdown {
  position: relative;
  flex-shrink: 0;
}

.lane-dropdown-color {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: var(--radius-md);
}

.lane-dropdown-color:hover {
  background-color: var(--color-bg-secondary);
  color: var(--color-text);
}

.lane-dropdown-color input[type="color"] {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: none;
}

.lane-title-editing {
  text-decoration: underline;
  text-decoration-color: var(--color-primary);
  text-underline-offset: 3px;
  cursor: text;
}


.lane-cards {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 0.5rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 2rem;
}

.lane-footer {
  padding: 0.5rem;
  flex-shrink: 0;
}

.lane-new {
  background: none;
  border: 2px dashed var(--color-border);
  flex: 0 0 280px;
  padding: 0.75rem;
  display: flex;
  align-items: flex-start;
}

.inline-create-input {
  width: 100%;
  padding: 0.5rem 0.625rem;
  font-size: 0.8125rem;
  font-family: var(--font-sans);
  background-color: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.inline-create-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 25%, transparent);
}

/* ===== Card Tile ===== */
.card-tile {
  display: block;
  flex-shrink: 0;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 0.625rem 0.75rem;
  text-decoration: none;
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  min-width: 0;
  overflow: hidden;
}

.card-tile:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border);
  text-decoration: none;
}

.card-tile-title {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
}

.card-tile-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.card-tile-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  font-size: 0.6875rem;
  color: var(--color-text-muted);
}

.card-tile-badge svg {
  width: 12px;
  height: 12px;
}

/* ===== Tags ===== */
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  border-radius: var(--radius-full);
  background-color: var(--color-bg-tertiary);
  color: var(--color-text);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-pill[style*="background-color"] {
  color: #fff;
}

.tag-pill-sm {
  padding: 0.0625rem 0.375rem;
  font-size: 0.6875rem;
}

.tag-pill-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1;
  width: 1rem;
  height: 1rem;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.tag-pill-remove:hover {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.15);
}

.card-tile-tag-indicators {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  margin-left: auto;
}

.tag-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.tag-indicator svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Tag list in modal */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.tag-list:not(:empty) {
  margin-bottom: 0.5rem;
}

/* Tag autocomplete input */
.tag-input-wrapper {
  position: relative;
}

.tag-input {
  width: 100%;
  padding: 0.375rem 0.5rem;
  font-size: 0.8125rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  color: var(--color-text);
  outline: none;
}

.tag-input::placeholder {
  color: var(--color-text-muted);
}

.tag-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 25%, transparent);
}

/* Tag autocomplete dropdown */
.tag-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  margin-top: 0.25rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 12rem;
  overflow-y: auto;
}

.tag-autocomplete-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  font-size: 0.8125rem;
  color: var(--color-text);
  cursor: pointer;
}

.tag-autocomplete-item:hover,
.tag-autocomplete-item-active {
  background-color: var(--color-bg-secondary);
}

.tag-autocomplete-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.tag-autocomplete-create {
  color: var(--color-primary);
  font-weight: 500;
}

.card-tile-link-preview {
  display: block;
  min-width: 0;
  overflow: hidden;
}

.card-tile-link-preview .link-info {
  gap: 0.5rem;
}

.card-tile-link-preview .link-thumb {
  width: 36px;
  height: 36px;
}

.card-tile-link-preview .link-details {
  width: 0;
  flex: 1;
  overflow: hidden;
}

.card-tile-link-preview .link-url {
  font-size: 0.8125rem;
}

.card-tile-link-domain {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-tile-link-pending {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text-muted);
}

.card-tile-link-pending .icon-sm {
  flex-shrink: 0;
}

.card-tile-link-pending-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.card-tile-link-pending .card-tile-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-tile-link-pending-status {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ===== Empty State ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.empty-state .icon-lg {
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.empty-state h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.empty-state p {
  margin: 0 0 1.5rem;
}

/* ===== SVG Icon Sizing ===== */
.icon-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.icon-md {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-md svg {
  width: 20px;
  height: 20px;
}

.icon-lg svg {
  width: 24px;
  height: 24px;
}

/* ===== Modal Overlay ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--color-overlay);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 1rem;
  z-index: 100;
  overflow-y: auto;
}

.modal-container {
  width: 100%;
  max-width: 720px;
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 6rem);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-meta {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 1.25rem;
}

/* ===== Modal Sections ===== */
.modal-section {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--color-border-light);
}

.modal-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.modal-section-title {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
}

.modal-section-title-muted {
  color: var(--color-text-muted);
}

.modal-section-title .badge {
  font-size: 0.6875rem;
  font-weight: 500;
  background-color: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
  padding: 0.0625rem 0.375rem;
  border-radius: var(--radius-full);
}

.modal-description {
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Editable modal title (contenteditable) */
.modal-title[contenteditable] {
  outline: none;
  cursor: text;
}

.modal-title[contenteditable]:focus {
  text-decoration: underline;
  text-decoration-color: var(--color-primary);
  text-underline-offset: 3px;
}

/* Click-to-edit description view */
.modal-description-view {
  cursor: pointer;
  border-radius: var(--radius-md);
  padding: 0.5rem;
  margin: -0.5rem;
  transition: background-color 0.15s;
}

.modal-description-view:hover {
  background-color: var(--color-bg-secondary);
}

/* Placeholder when no description */
.modal-description-placeholder {
  color: var(--color-text-muted);
  font-style: italic;
  font-size: 0.875rem;
}

/* Save / Cancel button row */
.modal-description-actions {
  display: flex;
  flex-direction: row-reverse;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* Compact Trix toolbar inside the modal */
.modal-section trix-toolbar .trix-button-row {
  justify-content: flex-start;
  gap: 0.25rem;
}

.modal-section trix-toolbar .trix-button-group {
  margin-bottom: 0;
  border: none;
  border-radius: var(--radius-sm);
}

.modal-section trix-toolbar .trix-button {
  border: none;
  border-radius: var(--radius-sm);
  background: none;
}

.modal-section trix-toolbar .trix-button:not(:first-child) {
  border-left: none;
}

.modal-section trix-toolbar .trix-button:not(:disabled):hover {
  background-color: var(--color-bg-tertiary);
}

.modal-section trix-toolbar .trix-button.trix-active {
  background-color: var(--color-primary-light);
}

.modal-section trix-toolbar .trix-button--icon {
  width: 1.5em;
  height: 1.5em;
  max-width: none;
}

.modal-section trix-toolbar .trix-button--icon::before {
  opacity: 0.8;
}

[data-theme="dark"] .modal-section trix-toolbar .trix-button--icon::before {
  filter: invert(1);
}

.modal-section trix-toolbar .trix-button--icon.trix-active::before {
  opacity: 1;
}

/* Hide file attach button — attachments have their own section */
.modal-section trix-toolbar .trix-button-group--file-tools {
  display: none;
}

.modal-section trix-editor {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  color: var(--color-text);
  padding: 0.5rem 0.75rem;
  min-height: 5rem;
}

/* Danger actions at bottom of modal */
/* ===== Card Actions (move + delete) ===== */
.modal-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border-light);
}

.move-card-wrapper {
  position: relative;
}

.move-card-panel {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 0.5rem;
  width: 280px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 0.75rem;
  z-index: 50;
}

.move-card-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.move-card-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.move-card-select {
  width: 100%;
  padding: 0.375rem 0.5rem;
  font-size: 0.8125rem;
  font-family: inherit;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  color: var(--color-text);
}

.move-card-lane-select {
  border-left: 3px solid transparent;
}

.move-card-buttons {
  display: flex;
  gap: 0.5rem;
}

/* Text-style link button */
.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.15s;
}

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

.btn-link-danger {
  color: var(--color-text-muted);
  transition: color 0.15s;
}

.btn-link-danger:hover {
  color: #DC2626;
}

[data-theme="dark"] .btn-link-danger:hover {
  color: #FCA5A5;
}

/* ===== Attachment List (in modal) ===== */
.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.625rem;
  background-color: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  transition: background-color 0.1s;
}

.attachment-item:hover {
  background-color: var(--color-bg-tertiary);
}

.attachment-info {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  flex: 1;
}

.attachment-preview-link {
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: block;
}

.attachment-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: block;
}

.attachment-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-bg-tertiary);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  color: var(--color-text-muted);
}

.attachment-icon-file-pdf { color: #DC2626; }
.attachment-icon-file-video { color: var(--color-primary); }
.attachment-icon-file-image { color: #10B981; }
.attachment-icon-file-text { color: #6B7280; }

.attachment-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.attachment-name {
  font-size: 0.8125rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text);
  text-decoration: none;
}

.attachment-name:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.attachment-meta {
  font-size: 0.6875rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.attachment-meta-sep {
  opacity: 0.5;
}

.attachment-actions {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  flex-shrink: 0;
}

/* ===== Attachment Upload (drop zone style) ===== */
.attachment-drop-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}

.attachment-drop-zone:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background-color: var(--color-bg-secondary);
}

.attachment-drop-text {
  font-size: 0.8125rem;
  font-weight: 500;
}

/* ===== Link List (in modal) ===== */
.link-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.link-list-description {
  border-left: 2px dashed var(--color-border);
  padding-left: 0.75rem;
}

.link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.625rem;
  background-color: var(--color-bg-secondary);
  border-radius: var(--radius-md);
}

.link-item-description {
  background: none;
  padding: 0.375rem 0;
}

.link-info {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  flex: 1;
}

.link-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.link-thumb-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background-color: var(--color-bg-tertiary);
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.link-thumb-fallback svg {
  width: 20px;
  height: 20px;
}

.card-tile-link-preview .link-thumb-fallback {
  width: 36px;
  height: 36px;
}

.card-tile-link-preview .link-thumb-fallback svg {
  width: 18px;
  height: 18px;
}

.link-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.link-url {
  font-size: 0.8125rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-description {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Inline Forms (attachment upload, add link) ===== */
.inline-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.inline-form .file-input {
  flex: 1;
  font-size: 0.8125rem;
}

.inline-form .link-input {
  flex: 1;
  font-size: 0.8125rem;
  padding: 0.375rem 0.625rem;
}

/* ===== Danger button variant ===== */
.btn-danger {
  color: var(--color-text-muted);
}

.btn-danger:hover {
  color: #DC2626;
  background-color: #FEF2F2;
}

[data-theme="dark"] .btn-danger:hover {
  color: #FCA5A5;
  background-color: #451A1A;
}

/* ===== Drag Handles ===== */
.lane-drag-handle,
.drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  color: var(--color-text-muted);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

.lane-drag-handle svg circle {
  fill: var(--color-text-muted);
}

[data-theme="dark"] .lane-drag-handle svg circle {
  fill: var(--color-text);
}

.lane-drag-handle {
  position: relative;
  width: 24px;
  height: 24px;
}

.lane-drag-handle:active,
.drag-handle:active {
  cursor: grabbing;
}

.lane:hover .lane-drag-handle,
.attachment-item:hover .drag-handle,
.link-item:hover .drag-handle {
  opacity: 1;
}

/* ===== Sortable Ghost & Chosen States ===== */
.lane-ghost {
  opacity: 0.4;
}

.lane-chosen {
  box-shadow: var(--shadow-lg);
}

.card-tile-ghost {
  opacity: 0.4;
}

.card-tile-chosen {
  box-shadow: var(--shadow-lg);
  transform: rotate(2deg);
}

.sortable-ghost {
  opacity: 0.4;
}

.sortable-chosen {
  background-color: var(--color-bg-tertiary);
}

/* ===== Sidebar Categories ===== */
.sidebar-category {
  margin-bottom: 0.25rem;
}

.sidebar-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.5rem;
  cursor: grab;
  border-radius: var(--radius-sm);
  position: relative;
  z-index: 1;
}

.sidebar-category-header:active {
  cursor: grabbing;
}

.sidebar-category-header:hover {
  background-color: var(--color-bg-tertiary);
}

.sidebar-category-name {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  cursor: pointer;
  outline: none;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-title-editing {
  text-decoration: underline;
  text-decoration-color: var(--color-primary);
  text-underline-offset: 3px;
  cursor: text;
}

.sidebar-category-header .sidebar-dropdown {
  opacity: 0;
}

.sidebar-category-header:hover .sidebar-dropdown {
  opacity: 1;
}

.sidebar-wall-list {
  min-height: 4px;
}

.sidebar-category-create {
  margin-top: 0.5rem;
  padding: 0 0.25rem;
}

/* ===== Category Sections (Index) ===== */
.category-section {
  margin-bottom: 2rem;
}

.category-section-header {
  margin-bottom: 0.75rem;
}

.category-section-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

/* ===== Admin Pages ===== */
.admin-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.admin-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.admin-header h1 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.admin-table {
  overflow-x: auto;
}

.admin-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.admin-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}

.admin-table td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background-color: var(--color-bg-secondary);
}

.admin-table-avatar {
  width: 40px;
  padding-right: 0;
}

.admin-table-row {
  cursor: pointer;
}

.admin-user-name {
  font-weight: 500;
}

.badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-full);
}

.badge-user {
  background-color: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
}

.badge-admin {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

/* Admin user header */
.admin-user-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.admin-user-header-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-user-avatar {
  flex-shrink: 0;
}

.admin-user-header-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.admin-user-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Admin detail page */
.admin-detail-section {
  margin-bottom: 2rem;
}

.admin-detail-row {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  gap: 1rem;
}

.admin-detail-label {
  width: 120px;
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.admin-role-select {
  width: auto;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.admin-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  cursor: pointer;
}

.admin-checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}

/* Admin invitations */
.admin-invite-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background-color: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-family: monospace;
  word-break: break-all;
}

/* ===== Search Autocomplete ===== */
.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 640px;
  display: flex;
  align-items: center;
}

.search-wrapper .app-search {
  padding-right: 2rem;
}

/* Hide the native browser clear button on search inputs */
.search-wrapper .app-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.search-clear {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.125rem;
  color: var(--color-text-muted);
}

.search-clear:hover {
  color: var(--color-text);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.25rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  z-index: 60;
}

.search-empty {
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-align: center;
}

.search-group-label {
  padding: 0.375rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.search-group-divider {
  height: 1px;
  background-color: var(--color-border);
  margin: 0.25rem 0;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  color: var(--color-text);
  transition: background-color 0.1s;
  cursor: pointer;
}

.search-result:hover,
.search-result-active {
  background-color: var(--color-bg-secondary);
  text-decoration: none;
}

.search-result-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background-color: var(--color-bg-tertiary);
  border-radius: var(--radius-sm);
  color: var(--color-primary);
  flex-shrink: 0;
}

.search-result-icon-wall {
  color: var(--lane-sky);
}

.search-result-icon-category {
  color: var(--lane-amber);
}

.search-result-icon-lane {
  color: var(--lane-emerald);
}

.search-result-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.search-result-title {
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.search-result-meta {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Tag Management ===== */
.tag-manage-row {
  cursor: default;
}

.tag-manage-color {
  width: 48px;
}

.tag-color-picker {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.tag-color-swatch {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.tag-color-picker input[type="color"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 24px;
  height: 24px;
  opacity: 0;
  cursor: pointer;
}

.tag-manage-name {
  cursor: text;
  padding: 0.125rem 0.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.tag-manage-name:hover {
  border-color: var(--color-border);
}

.tag-manage-name.editing {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 2px var(--color-primary-light);
}

.tag-manage-actions {
  width: 48px;
  text-align: right;
}

.tag-manage-create {
  margin-top: 1.5rem;
}

.tag-create-input {
  flex: 1;
  min-width: 0;
}

/* ===== Trash Page ===== */
.trash-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.5rem;
}

.trash-section {
  margin-bottom: 2rem;
}

.trash-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin: 0 0 0.75rem;
}

.trash-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

.trash-item-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.trash-item-color {
  width: 4px;
  height: 2rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.trash-item-details {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.trash-item-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trash-item-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ===== Button Variants ===== */
.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline:hover {
  background-color: var(--color-primary);
  color: var(--color-primary-text);
  text-decoration: none;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

/* ===== Landing Page ===== */
.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 2rem;
}

.landing-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4rem 0 3rem;
  max-width: 600px;
}

.landing-logo {
  height: 120px;
  width: auto;
  margin-bottom: 1.5rem;
}

.landing-hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
  background: linear-gradient(135deg, var(--color-primary), #EC4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-tagline {
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  margin: 0 0 0.25rem;
}

.landing-subtitle {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin: 0 0 2rem;
}

.landing-actions {
  display: flex;
  gap: 1rem;
}

.landing-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 800px;
  width: 100%;
  padding: 3rem 0;
}

@media (max-width: 640px) {
  .landing-features {
    grid-template-columns: 1fr;
  }
}

.landing-feature {
  text-align: center;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
}

.landing-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-full);
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.landing-feature-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.landing-feature h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.landing-feature p {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.5;
}

.landing-footer {
  padding: 2rem 0;
  margin-top: auto;
}

.landing-footer p {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* Member management */
.member-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.member-actions {
  text-align: right;
}

.badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-owner {
  background-color: var(--color-primary-bg);
  color: var(--color-primary);
}

.badge-editor {
  background-color: var(--color-bg-tertiary);
  color: var(--color-text);
}

.badge-viewer {
  background-color: var(--color-bg-secondary);
  color: var(--color-text-muted);
}

.member-pending-header {
  margin-top: 2rem;
}

.member-invite-form {
  margin-top: 2rem;
}

.member-invite-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.member-invite-email {
  width: auto;
  flex: 1;
  min-width: 0;
  padding: 0.375rem 0.625rem;
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-bg);
  color: var(--color-text);
}

.member-invite-email:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: -1px;
  border-color: var(--color-primary);
}

.member-invite-role {
  width: auto;
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-bg);
  color: var(--color-text);
  flex-shrink: 0;
}

/* Viewer mode: hide mutation controls when user is a viewer */
[data-wall-role="viewer"] .lane-add-card,
[data-wall-role="viewer"] .lane-options-btn,
[data-wall-role="viewer"] .new-lane-placeholder,
[data-wall-role="viewer"] .card-tile-actions,
[data-wall-role="viewer"] .sortable-handle {
  display: none;
}


