/*
  Theme overrides for CalmBoard.
  Edit only this file to customize colors, spacing, radii, and layout.
*/
:root {
  --s-3: 0.75rem;
  /* Colors (same palette) */
  --theme-bg: #f8fafc;
  --theme-surface: #ffffff;
  --theme-surface-muted: #f8fafc;
  --theme-border: #e2e8f0;
  --theme-border-strong: #cbd5f5;
  --theme-text: #0f172a;
  --theme-text-muted: #64748b;
  --theme-text-soft: #94a3b8;
  --theme-primary: #4f46e5;
  --theme-primary-hover: #4338ca;
  --theme-danger: #e11d48;
  --theme-overlay: rgba(15, 23, 42, 0.5);

  /* Layout */
  --theme-radius-card: 10px;
  --theme-radius-pill: 8px;
  --theme-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  --theme-shadow-soft: 0 8px 18px rgba(15, 23, 42, 0.05);
  --theme-gap: 14px;

  /* Board */
  --theme-column-bg: #ffffff;
  --theme-column-border: #dbe4f3;
  --theme-insight-bg: #fef9c3;
  --theme-sprint-bg: #dbeafe;
  --theme-bg-gradient-start: #f8fafc;
  --theme-bg-gradient-mid: #eef2ff;
  --theme-bg-gradient-end: #f8fafc;
  --theme-header-bg: rgba(255, 255, 255, 0.85);
  --theme-header-border: #e2e8f0;
}

body {
  background: linear-gradient(
    160deg,
    var(--theme-bg-gradient-start) 0%,
    var(--theme-bg-gradient-mid) 60%,
    var(--theme-bg-gradient-end) 100%
  );
  color: var(--theme-text);
}

header {
  background: var(--theme-header-bg);
  border-bottom: 1px solid var(--theme-header-border);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

body.page-dashboard header,
body.page-admin header,
body.page-board header {
  position: sticky;
  top: 0;
  z-index: 240;
}

:where(
  a[href],
  button,
  input,
  select,
  textarea,
  summary,
  [tabindex]:not([tabindex="-1"]),
  [role="button"],
  [role="link"],
  [contenteditable="true"]
):focus-visible {
  outline: 2px solid #1A7F8E !important;
  outline-offset: 2px;
}

:root[data-theme="dark"] {
  --theme-bg: #0b1220;
  --theme-surface: #111a2e;
  --theme-surface-muted: #0f172a;
  --theme-border: #2b3a55;
  --theme-border-strong: #415472;
  --theme-text: #e2e8f0;
  --theme-text-muted: #a7b3c7;
  --theme-text-soft: #7f8ea8;
  --theme-primary: #7d93cf;
  --theme-primary-hover: #6b82be;
  --theme-danger: #fb7185;
  --theme-overlay: rgba(2, 6, 23, 0.75);
  --theme-shadow: 0 12px 28px rgba(2, 6, 23, 0.45);
  --theme-shadow-soft: 0 8px 18px rgba(2, 6, 23, 0.32);
  --theme-column-bg: #111a2e;
  --theme-column-border: #2b3a55;
  --theme-insight-bg: #2a1f0a;
  --theme-sprint-bg: #17233a;
  --theme-bg-gradient-start: #0b1220;
  --theme-bg-gradient-mid: #374368;
  --theme-bg-gradient-end: #0b1220;
  --theme-header-bg: rgba(11, 18, 32, 0.88);
  --theme-header-border: rgba(65, 84, 114, 0.7);
}

/* Public pages: match base.css public header style */
body:not(.page-dashboard):not(.page-board):not(.page-admin) header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: transparent;
  border-bottom: none;
  box-shadow: none;
}
body:not(.page-dashboard):not(.page-board):not(.page-admin) .brand {
  font-weight: 800;
  letter-spacing: -0.02em;
}
body:not(.page-dashboard):not(.page-board):not(.page-admin) .logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  box-shadow: var(--theme-shadow-soft);
}

.card {
  background: var(--theme-surface);
  border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius-card);
  box-shadow: var(--theme-shadow-soft);
}

.modal,
.modal-backdrop {
  background: var(--theme-overlay);
  backdrop-filter: blur(6px);
}

.modal-card {
  border-radius: calc(var(--theme-radius-card) - 6px);
  border: 1px solid var(--theme-border);
  box-shadow: var(--theme-shadow);
}

.shortcuts-modal-card {
  width: min(92vw, 560px);
}

.shortcuts-list {
  display: grid;
  gap: 12px;
}

.shortcuts-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--theme-border);
  border-radius: calc(var(--theme-radius-card) - 10px);
  background: color-mix(in srgb, var(--theme-surface-secondary) 76%, white 24%);
}

.shortcuts-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.shortcuts-copy strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--theme-text);
}

.shortcuts-copy span {
  font-size: 13px;
  line-height: 1.5;
  color: var(--theme-muted);
}

.shortcut-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 8px 12px;
  border: 1px solid var(--theme-border);
  border-radius: 12px;
  background: var(--theme-surface);
  color: var(--theme-text);
  font-size: 13px;
  font-weight: 700;
  box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.08);
}

@media (max-width: 640px) {
  .shortcuts-item {
    flex-direction: column;
    align-items: flex-start;
  }
}

.gantt-stat-card {
  display: flex;
  flex-direction: column;
}

.gantt-stat-heading {
  flex: 0 0 auto;
}

.gantt-stat-surface {
  min-height: 220px;
  padding: 12px;
}

.gantt-stat-chart-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
}

.gantt-stat-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.gantt-stat-chart-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--theme-text);
}

.gantt-stat-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  font-size: 11px;
  color: var(--theme-text-muted);
}

.gantt-stat-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gantt-stat-legend-swatch {
  display: inline-block;
  width: 14px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.gantt-stat-legend-swatch.is-dashed {
  width: 16px;
  height: 0;
  border-radius: 0;
  border-top: 2px dashed currentColor;
  background: transparent !important;
}

.gantt-stat-chart-layout {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
  flex: 1 1 auto;
}

.gantt-stat-chart-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.gantt-stat-plot {
  position: relative;
  flex: 1 1 auto;
  min-height: 120px;
  display: flex;
  align-items: stretch;
}

.gantt-stat-axis {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--theme-text-muted);
}

.gantt-stat-axis-y {
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: center;
}

.gantt-stat-axis-x {
  padding-top: 8px;
  text-align: center;
}

.gantt-stat-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 120px;
  text-align: center;
  font-size: 12px;
  color: var(--theme-text-muted);
}

.gantt-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
  height: 100%;
}

.gantt-bar-item {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.gantt-bar {
  width: 100%;
  min-height: 6px;
  border-radius: 10px 10px 6px 6px;
}

.gantt-bar-label {
  font-size: 10px;
  line-height: 1.25;
  text-align: center;
  color: var(--theme-text-muted);
  word-break: break-word;
}

#credits-modal {
  z-index: 200;
}

#toast {
  z-index: 300 !important;
}

#admin-toast,
#board-toast {
  z-index: 300 !important;
}

.btn {
  border-radius: var(--theme-radius-pill);
  border-color: var(--theme-border);
  color: var(--theme-text-muted);
  background: #ffffff;
}

.btn-primary {
  background: var(--theme-primary);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 10px 16px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
  background: var(--theme-primary-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--theme-text-soft);
}

/* Remove borders from modal close buttons */
.modal .btn-ghost[aria-label="Close"],
.modal-card .btn[id$="-close"] {
  border-color: transparent;
  box-shadow: none;
}

/* Public pages: align buttons with signed-in button styles */
body:not(.page-dashboard):not(.page-board):not(.page-admin) button.rounded-full,
body:not(.page-dashboard):not(.page-board):not(.page-admin) a.rounded-full {
  border-radius: var(--theme-radius-pill) !important;
  border: 1px solid var(--theme-border);
  background: #ffffff;
  color: var(--theme-text);
  box-shadow: var(--theme-shadow-soft);
}
body:not(.page-dashboard):not(.page-board):not(.page-admin) button.rounded-full.bg-brand-primary,
body:not(.page-dashboard):not(.page-board):not(.page-admin) a.rounded-full.bg-brand-primary,
body:not(.page-dashboard):not(.page-board):not(.page-admin) button.rounded-full.bg-slate-900,
body:not(.page-dashboard):not(.page-board):not(.page-admin) a.rounded-full.bg-slate-900 {
  background: var(--theme-primary) !important;
  border-color: transparent !important;
  color: #ffffff !important;
  box-shadow: 0 12px 20px rgba(79, 70, 229, 0.2);
}
body:not(.page-dashboard):not(.page-board):not(.page-admin) button.rounded-full.border,
body:not(.page-dashboard):not(.page-board):not(.page-admin) a.rounded-full.border {
  background: transparent !important;
  color: var(--theme-text) !important;
  box-shadow: none;
}

/* Signed-in pages: normalize inline rounded buttons to match new button layout */
body.page-dashboard button.rounded-full,
body.page-dashboard a.rounded-full,
body.page-admin button.rounded-full,
body.page-admin a.rounded-full {
  border-radius: var(--theme-radius-pill);
  border: 1px solid var(--theme-border);
  background: #f1f5f9;
  color: var(--theme-text);
  box-shadow: var(--theme-shadow-soft);
}
body.page-dashboard button.rounded-full:hover,
body.page-dashboard a.rounded-full:hover,
body.page-admin button.rounded-full:hover,
body.page-admin a.rounded-full:hover {
  border-color: transparent;
  background: #e2e8f0;
  color: var(--theme-text);
}
body.page-dashboard button.rounded-full.bg-brand-primary,
body.page-dashboard a.rounded-full.bg-brand-primary,
body.page-admin button.rounded-full.bg-brand-primary,
body.page-admin a.rounded-full.bg-brand-primary,
body.page-dashboard button.rounded-full.bg-slate-900,
body.page-dashboard a.rounded-full.bg-slate-900,
body.page-admin button.rounded-full.bg-slate-900,
body.page-admin a.rounded-full.bg-slate-900 {
  background: var(--theme-primary);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 12px 20px rgba(79, 70, 229, 0.2);
}
body.page-dashboard button.rounded-full.bg-brand-primary:hover,
body.page-dashboard a.rounded-full.bg-brand-primary:hover,
body.page-admin button.rounded-full.bg-brand-primary:hover,
body.page-admin a.rounded-full.bg-brand-primary:hover,
body.page-dashboard button.rounded-full.bg-slate-900:hover,
body.page-dashboard a.rounded-full.bg-slate-900:hover,
body.page-admin button.rounded-full.bg-slate-900:hover,
body.page-admin a.rounded-full.bg-slate-900:hover {
  background: var(--theme-primary-hover);
}
body.page-dashboard button.rounded-full.border-rose-200,
body.page-dashboard a.rounded-full.border-rose-200,
body.page-admin button.rounded-full.border-rose-200,
body.page-admin a.rounded-full.border-rose-200 {
  border-color: rgba(225, 29, 72, 0.2);
  background: rgba(225, 29, 72, 0.08);
  color: var(--theme-danger);
  box-shadow: none;
}

/* Dashboard typography scale:
   H1 32px, H2 24px, H3 18px, body 15px, caption 13px */
.page-dashboard {
  font-size: 15px;
  line-height: 1.5;
}

.page-dashboard h1 {
  font-size: 32px !important;
  line-height: 1.2;
}

.page-dashboard h2 {
  font-size: 24px !important;
  line-height: 1.3;
}

.page-dashboard h3 {
  font-size: 18px !important;
  line-height: 1.35;
}

.page-dashboard .text-sm,
.page-dashboard .text-base {
  font-size: 15px;
}

.page-dashboard .text-xs,
.page-dashboard small,
.page-dashboard .muted,
.page-dashboard .hint {
  font-size: 13px;
}

/* Admin typography scale:
   H1 32px, H2 24px, H3 18px, body 15px, caption 13px */
.page-admin {
  font-size: 15px;
  line-height: 1.5;
}

.page-admin h1 {
  font-size: 32px !important;
  line-height: 1.2;
}

.page-admin h2 {
  font-size: 24px !important;
  line-height: 1.3;
}

.page-admin h3 {
  font-size: 18px !important;
  line-height: 1.35;
}

.page-admin .text-sm,
.page-admin .text-base {
  font-size: 15px;
}

.page-admin .text-xs,
.page-admin small,
.page-admin .muted,
.page-admin .hint {
  font-size: 13px;
}

.board-assistant-chat {
  display: grid;
  gap: var(--s-3);
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 4px;
}

.board-assistant-card {
  width: min(92vw, 960px);
  max-height: 90vh;
}

.page-dashboard #dashboard-header .nav,
.page-admin #admin-header .nav,
.page-board #board-header .nav,
.page-dashboard #settings-header .nav {
  position: relative;
}

.page-board #board-header .mobile-header-toggle,
.page-dashboard #dashboard-header .mobile-header-toggle,
.page-admin #admin-header .mobile-header-toggle,
.page-dashboard #settings-header .mobile-header-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-right: var(--s-2);
  border-color: transparent;
  box-shadow: none;
}

.page-dashboard #dashboard-header .nav-actions,
.page-admin #admin-header .nav-actions,
.page-board #board-header .nav-actions,
.page-dashboard #settings-header .nav-actions {
  display: none !important;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  left: auto;
  z-index: 260;
  width: min(320px, calc(100vw - 32px));
  flex-direction: column;
  align-items: stretch;
  gap: var(--s-3);
  padding: 12px;
  border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius-card);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--theme-shadow-soft);
}

.page-dashboard #dashboard-header.mobile-menu-open .nav-actions,
.page-admin #admin-header.mobile-menu-open .nav-actions,
.page-board #board-header.mobile-menu-open .nav-actions,
.page-dashboard #settings-header.mobile-menu-open .nav-actions {
  display: flex !important;
}

.page-dashboard #dashboard-header .nav-actions > .btn,
.page-dashboard #dashboard-header .nav-actions > a.btn,
.page-admin #admin-header .nav-actions > .btn,
.page-admin #admin-header .nav-actions > a.btn,
.page-board #board-header .nav-actions > .btn,
.page-board #board-header .nav-actions > a.btn,
.page-dashboard #settings-header .nav-actions > .btn,
.page-dashboard #settings-header .nav-actions > a.btn {
  width: 100%;
  justify-content: center;
}

.page-board #board-header .nav-actions > .flex.items-center.gap-3.rounded-full {
  width: 100%;
  justify-content: space-between;
  border-radius: var(--theme-radius-card);
}

.page-board #task-form-preview-content a.task-desc-link,
.page-board #task-desc-value a.task-desc-link,
.page-board #task-desc-improve-value a.task-desc-link,
.page-board #task-form-comments .comment-markdown a.task-desc-link {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
  word-break: break-word;
}

.page-board #task-form-preview-content a.task-desc-link:hover,
.page-board #task-desc-value a.task-desc-link:hover,
.page-board #task-desc-improve-value a.task-desc-link:hover,
.page-board #task-form-comments .comment-markdown a.task-desc-link:hover {
  color: #1d4ed8;
}

.page-board #task-form-preview-content blockquote,
.page-board #task-desc-value blockquote,
.page-board #task-desc-improve-value blockquote,
.page-board #task-form-comments .comment-markdown blockquote {
  margin: 0.6rem 0;
  padding: 0.55rem 0.75rem;
  border-left: 3px solid #93c5fd;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 0.5rem;
}

.page-board #task-form-preview-content blockquote blockquote,
.page-board #task-desc-value blockquote blockquote,
.page-board #task-desc-improve-value blockquote blockquote,
.page-board #task-form-comments .comment-markdown blockquote blockquote {
  margin: 0.5rem 0 0.2rem;
  border-left-color: #60a5fa;
  background: #dbeafe;
}

.page-board #task-form-preview-content blockquote p,
.page-board #task-desc-value blockquote p,
.page-board #task-desc-improve-value blockquote p,
.page-board #task-form-comments .comment-markdown blockquote p {
  margin: 0.25rem 0;
}

.page-board #task-form-preview-content ul,
.page-board #task-desc-value ul,
.page-board #task-desc-improve-value ul,
.page-board #task-form-comments .comment-markdown ul {
  list-style: disc;
  margin: 0.35rem 0 0.35rem 1.1rem;
  padding-left: 0.5rem;
}

.page-board #task-form-preview-content ol,
.page-board #task-desc-value ol,
.page-board #task-desc-improve-value ol,
.page-board #task-form-comments .comment-markdown ol {
  list-style: decimal;
  margin: 0.35rem 0 0.35rem 1.1rem;
  padding-left: 0.5rem;
}

.page-board #task-form-preview-content li,
.page-board #task-desc-value li,
.page-board #task-desc-improve-value li,
.page-board #task-form-comments .comment-markdown li {
  margin: 0.15rem 0;
}

.page-board #task-form-preview-content blockquote ul,
.page-board #task-form-preview-content blockquote ol,
.page-board #task-desc-value blockquote ul,
.page-board #task-desc-value blockquote ol,
.page-board #task-desc-improve-value blockquote ul,
.page-board #task-desc-improve-value blockquote ol,
.page-board #task-form-comments .comment-markdown blockquote ul,
.page-board #task-form-comments .comment-markdown blockquote ol {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

.page-board #task-form-comments .comment-markdown > :first-child {
  margin-top: 0;
}

.page-board #task-form-comments .comment-markdown > :last-child {
  margin-bottom: 0;
}

.page-dashboard #coaching-list .coaching-markdown > :first-child {
  margin-top: 0;
}

.page-dashboard #coaching-list .coaching-markdown > :last-child {
  margin-bottom: 0;
}

.page-dashboard #coaching-list .coaching-markdown h1,
.page-dashboard #coaching-list .coaching-markdown h2,
.page-dashboard #coaching-list .coaching-markdown h3,
.page-dashboard #coaching-list .coaching-markdown h4 {
  margin: 0.4rem 0;
  font-weight: 700;
  color: var(--theme-text);
}

.page-dashboard #coaching-list .coaching-markdown p {
  margin: 0.35rem 0;
}

.page-dashboard #coaching-list .coaching-markdown ul {
  list-style: disc;
  margin: 0.35rem 0 0.35rem 1.1rem;
  padding-left: 0.5rem;
}

.page-dashboard #coaching-list .coaching-markdown ol {
  list-style: decimal;
  margin: 0.35rem 0 0.35rem 1.1rem;
  padding-left: 0.5rem;
}

.page-dashboard #coaching-list .coaching-markdown li {
  margin: 0.12rem 0;
}

.page-dashboard #coaching-list .coaching-markdown blockquote {
  margin: 0.5rem 0;
  padding: 0.45rem 0.7rem;
  border-left: 3px solid #93c5fd;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 0.5rem;
}

.page-dashboard #coaching-list .coaching-markdown code {
  padding: 0.08rem 0.32rem;
  border-radius: 0.3rem;
  background: #e2e8f0;
  color: #0f172a;
}

.page-dashboard #coaching-list .coaching-markdown pre {
  margin: 0.45rem 0;
  overflow-x: auto;
  border-radius: 0.5rem;
  background: #e2e8f0;
  padding: 0.6rem 0.7rem;
}

.page-dashboard #coaching-list .coaching-markdown a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

.page-board #insight-detail-body > :first-child {
  margin-top: 0;
}

.page-board #insight-detail-body > :last-child {
  margin-bottom: 0;
}

.page-board #insight-detail-body h1,
.page-board #insight-detail-body h2,
.page-board #insight-detail-body h3,
.page-board #insight-detail-body h4 {
  margin: 0.4rem 0;
  font-weight: 700;
  color: var(--theme-text);
}

.page-board #insight-detail-body p {
  margin: 0.35rem 0;
}

.page-board #insight-detail-body ul {
  list-style: disc;
  margin: 0.35rem 0 0.35rem 1.1rem;
  padding-left: 0.5rem;
}

.page-board #insight-detail-body ol {
  list-style: decimal;
  margin: 0.35rem 0 0.35rem 1.1rem;
  padding-left: 0.5rem;
}

.page-board #insight-detail-body li {
  margin: 0.12rem 0;
}

.page-board #insight-detail-body blockquote {
  margin: 0.5rem 0;
  padding: 0.45rem 0.7rem;
  border-left: 3px solid #93c5fd;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 0.5rem;
}

.page-board #insight-detail-body blockquote blockquote {
  margin-top: 0.35rem;
  background: rgba(255, 255, 255, 0.6);
}

.page-board #insight-detail-body blockquote p {
  margin: 0.2rem 0;
}

.page-board #insight-detail-body blockquote ul,
.page-board #insight-detail-body blockquote ol {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

.page-board #insight-detail-body code {
  padding: 0.08rem 0.32rem;
  border-radius: 0.3rem;
  background: #e2e8f0;
  color: #0f172a;
}

.page-board #insight-detail-body pre {
  margin: 0.45rem 0;
  overflow-x: auto;
  border-radius: 0.5rem;
  background: #e2e8f0;
  padding: 0.6rem 0.7rem;
}

.page-board #insight-detail-body a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

@media (max-width: 640px) {
  .page-board .container {
    padding-left: 0;
    padding-right: 0;
  }

  .page-board main > .container {
    width: 100vw;
    max-width: 100vw;
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 768px) {
  .page-dashboard main.main-container {
    padding-left: var(--s-3);
    padding-right: var(--s-3);
    overflow-x: hidden;
  }

  .page-dashboard main.main-container > .container {
    padding-left: 0;
    padding-right: 0;
  }

  .page-dashboard main.main-container > .container > section.grid > * {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .page-dashboard main.main-container > .container > section.grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-dashboard main.main-container > .container > section.grid > .card,
  .page-dashboard main.main-container > .container > section.grid > .boards {
    box-sizing: border-box;
  }

  .page-dashboard #dashboard-header > .container,
  .page-admin #admin-header > .container {
    padding-left: var(--s-3);
    padding-right: var(--s-3);
  }

  .page-board #board-header > .container {
    padding-left: var(--s-3);
    padding-right: var(--s-3);
  }

  .page-dashboard #dashboard-header .nav-actions,
  .page-admin #admin-header .nav-actions,
  .page-board #board-header .nav-actions,
  .page-dashboard #settings-header .nav-actions {
    left: 0;
    right: 0;
    width: auto;
  }

  .page-board #gantt-modal #gantt-axis-labels {
    display: none;
  }

  .page-board #board-header .brand span:first-of-type {
    display: none;
  }

  .page-board #board-header .board-name {
    display: inline-block;
    max-width: 56vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

}

.board-assistant-message {
  padding: 12px 14px;
  border-radius: var(--theme-radius-card);
  border: 1px solid var(--theme-border);
  background: var(--theme-surface);
  color: var(--theme-text);
  box-shadow: var(--theme-shadow-soft);
  max-width: 85%;
  white-space: pre-wrap;
}

.board-assistant-message.user {
  margin-left: auto;
  background: var(--theme-primary);
  border-color: transparent;
  color: #ffffff;
}

.board-assistant-message.thinking {
  border-style: dashed;
  background: rgba(148, 163, 184, 0.08);
  color: rgba(30, 41, 59, 0.75);
  font-style: italic;
}

.board-assistant-input {
  display: grid;
  gap: var(--s-3);
}

.board-assistant-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-3);
}

.dashboard-empty-state {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  align-items: center;
  gap: 32px;
  margin-top: 2rem;
}

.dashboard-empty-art {
  max-width: 320px;
  justify-self: center;
}

.dashboard-empty-art svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 18px 36px rgba(79, 70, 229, 0.12));
}

.dashboard-empty-copy {
  display: grid;
  gap: 12px;
  max-width: 640px;
}

.dashboard-empty-eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(79, 70, 229, 0.08);
  color: var(--theme-primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-empty-copy h2 {
  margin: 0;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--theme-text);
}

.dashboard-empty-copy p {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--theme-text-muted);
}

.dashboard-empty-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}

.dashboard-project-item {
  display: grid;
  gap: 12px;
}

.dashboard-project-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-project-meta {
  min-width: 0;
}

.dashboard-project-meta strong,
.dashboard-project-meta small {
  overflow-wrap: anywhere;
}

.dashboard-project-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.dashboard-project-board-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-project-board-actions .btn {
  max-width: 100%;
}

.dashboard-tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.dashboard-tour-card {
  width: min(100%, 520px);
  border: 1px solid var(--theme-border);
  border-radius: 24px;
  padding: 20px;
  background: var(--theme-surface);
  box-shadow: var(--theme-shadow);
  color: var(--theme-text);
}

.dashboard-tour-step {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--theme-primary);
}

.dashboard-tour-card h3 {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.2;
  color: var(--theme-text);
}

.dashboard-tour-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--theme-text-muted);
}

.dashboard-tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.dashboard-tour-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-tour-target {
  position: relative;
  z-index: 230;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.18), 0 22px 44px rgba(15, 23, 42, 0.16);
  transition: box-shadow 160ms ease;
}

.board-empty-state {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  margin: 0 0 24px;
  padding: 28px;
  border: 1px solid var(--theme-border);
  border-radius: 24px;
  background: var(--theme-surface);
  box-shadow: var(--theme-shadow-soft);
}

.board-empty-art {
  max-width: 320px;
  justify-self: center;
}

.board-empty-art svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 18px 36px rgba(79, 70, 229, 0.12));
}

.board-empty-copy {
  display: grid;
  gap: 12px;
  max-width: 640px;
}

.board-empty-eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(79, 70, 229, 0.08);
  color: var(--theme-primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.board-empty-copy h2 {
  margin: 0;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--theme-text);
}

.board-empty-copy p {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--theme-text-muted);
}

.board-empty-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}

.board-tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.board-tour-card {
  width: min(100%, 520px);
  border: 1px solid var(--theme-border);
  border-radius: 24px;
  padding: 20px;
  background: var(--theme-surface);
  box-shadow: var(--theme-shadow);
  color: var(--theme-text);
}

.board-tour-step {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--theme-primary);
}

.board-tour-card h3 {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.2;
  color: var(--theme-text);
}

.board-tour-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--theme-text-muted);
}

.board-tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.board-tour-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.board-tour-target {
  position: relative;
  z-index: 220;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.18), 0 22px 44px rgba(15, 23, 42, 0.16);
  transition: box-shadow 160ms ease;
}

.btn-danger {
  border-color: rgba(225, 29, 72, 0.2);
  background: rgba(225, 29, 72, 0.08);
  color: var(--theme-danger);
}

.brand {
  color: var(--theme-text-muted);
  letter-spacing: 0.02em;
}

.nav .logo {
  border-radius: 8px;
}

.column {
  background: var(--theme-column-bg);
  border-color: var(--theme-column-border);
  box-shadow: var(--theme-shadow-soft);
}

.column-header {
  border-bottom: 1px dashed var(--theme-border);
  padding-bottom: 6px;
}

.task {
  border: 1px solid var(--theme-border);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
}

.insight-tile,
.insight-empty {
  background: var(--theme-insight-bg);
  border: 1px solid var(--theme-border);
  box-shadow: var(--theme-shadow-soft);
}

.sprint-item {
  background: var(--theme-sprint-bg);
}

.agent-card {
  background: var(--theme-sprint-bg);
}

.insight-dismiss {
  background: transparent;
  border-color: transparent;
}

.board-progress .progress-bar span,
.progress-bar span {
  background: linear-gradient(90deg, #4f46e5 0%, #6366f1 100%);
}

.agent-star {
  border: none;
}

.rounded-sm {
  border-radius: var(--theme-radius-pill)
}

html[data-theme="dark"] body {
  color: var(--theme-text);
}

html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-white\/80,
html[data-theme="dark"] .bg-white\/90,
html[data-theme="dark"] .bg-white\/95 {
  background-color: #111a2e !important;
}

html[data-theme="dark"] .bg-slate-50,
html[data-theme="dark"] .bg-slate-100,
html[data-theme="dark"] .bg-slate-200 {
  background-color: #0f172a !important;
}

html[data-theme="dark"] .dashboard-empty-eyebrow {
  background: rgba(125, 147, 207, 0.12);
  color: var(--theme-primary);
}

html[data-theme="dark"] .dashboard-tour-backdrop {
  background: rgba(2, 6, 23, 0.68);
}

html[data-theme="dark"] .board-empty-state {
  background: var(--theme-surface);
  border-color: var(--theme-border);
}

html[data-theme="dark"] .board-empty-eyebrow {
  background: rgba(125, 147, 207, 0.12);
  color: var(--theme-primary);
}

html[data-theme="dark"] .board-tour-backdrop {
  background: rgba(2, 6, 23, 0.68);
}

@media (max-width: 768px) {
  .dashboard-empty-state {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 20px;
  }

  .dashboard-empty-copy h2 {
    font-size: 26px;
  }

  .dashboard-tour-backdrop {
    padding: 16px;
  }

  .dashboard-tour-card {
    padding: 18px;
  }

  .dashboard-tour-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-tour-actions-right {
    justify-content: stretch;
  }

  .dashboard-tour-actions-right .btn,
  .dashboard-tour-actions > .btn {
    width: 100%;
    justify-content: center;
  }

  .dashboard-project-row {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-project-actions {
    justify-content: flex-start;
  }

  .board-empty-state {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 20px;
  }

  .board-empty-copy h2 {
    font-size: 26px;
  }

  .board-tour-backdrop {
    padding: 16px;
  }

  .board-tour-card {
    padding: 18px;
  }

  .board-tour-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .board-tour-actions-right {
    justify-content: stretch;
  }

  .board-tour-actions-right .btn,
  .board-tour-actions > .btn {
    width: 100%;
    justify-content: center;
  }
}

html[data-theme="dark"] .bg-indigo-50 {
  background-color: #374368 !important;
}

html[data-theme="dark"] .bg-background-subtle {
  background-color: #374368 !important;
}

html[data-theme="dark"] .bg-indigo-200\/70,
html[data-theme="dark"] .bg-indigo-200\/80,
html[data-theme="dark"] .bg-emerald-200\/60 {
  opacity: 0.2;
}

html[data-theme="dark"] .border-slate-200,
html[data-theme="dark"] .border-slate-300,
html[data-theme="dark"] .border-indigo-200,
html[data-theme="dark"] .border-dashed {
  border-color: var(--theme-border) !important;
}

html[data-theme="dark"] .text-slate-900,
html[data-theme="dark"] .text-slate-800,
html[data-theme="dark"] .text-slate-700 {
  color: var(--theme-text) !important;
}

html[data-theme="dark"] .text-slate-600,
html[data-theme="dark"] .text-slate-500,
html[data-theme="dark"] .text-slate-400 {
  color: var(--theme-text-muted) !important;
}

html[data-theme="dark"] .btn {
  background: #0f172a;
  color: var(--theme-text);
  border-color: var(--theme-border);
}

html[data-theme="dark"] .btn-ghost {
  background: transparent;
  color: var(--theme-text-muted);
}

html[data-theme="dark"] .btn-ghost:hover {
  background: #162033;
  border-color: var(--theme-border);
  color: var(--theme-text);
}

html[data-theme="dark"] .btn-primary {
  background: var(--theme-primary);
  color: #ffffff;
  border-color: transparent;
}

html[data-theme="dark"] .btn-primary:hover {
  background: var(--theme-primary-hover);
}

html[data-theme="dark"] .input,
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background: #0f172a !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-text) !important;
}

html[data-theme="dark"] .modal,
html[data-theme="dark"] .modal-backdrop {
  background: rgba(2, 6, 23, 0.72);
}

html[data-theme="dark"] .modal-card {
  background: #111a2e !important;
  border-color: var(--theme-border) !important;
}

html[data-theme="dark"] .preview,
html[data-theme="dark"] .list-item,
html[data-theme="dark"] .log-box,
html[data-theme="dark"] .daily-item,
html[data-theme="dark"] .attachment-item {
  background: #0f172a !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-text) !important;
}

html[data-theme="dark"] .comment-box {
  background: #0f172a !important;
  border-color: var(--theme-border) !important;
}

html[data-theme="dark"] .preview code {
  background: #1e293b;
  color: #dbeafe;
}

html[data-theme="dark"] .preview pre {
  background: #0b1220;
  border-color: var(--theme-border);
  color: var(--theme-text);
}

html[data-theme="dark"] .board-progress .progress-bar span,
html[data-theme="dark"] .progress-bar span {
  background: linear-gradient(90deg, #7d93cf 0%, #9db2e5 100%);
}

html[data-theme="dark"] #toast,
html[data-theme="dark"] #board-toast,
html[data-theme="dark"] #admin-toast {
  background: #111a2e !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-text) !important;
}

html[data-theme="dark"] .task,
html[data-theme="dark"] .filters-toggle,
html[data-theme="dark"] .floating-menu-toggle,
html[data-theme="dark"] .insight-card,
html[data-theme="dark"] .insight-tile,
html[data-theme="dark"] .agent-card,
html[data-theme="dark"] #filters-panel-modal,
html[data-theme="dark"] .fixed-card-item,
html[data-theme="dark"] .panel-section,
html[data-theme="dark"] .ai-settings-section {
  background: #a0b6fa !important;
}

html[data-theme="dark"] #filters-panel-modal,
html[data-theme="dark"] .fixed-card-item,
html[data-theme="dark"] .panel-section,
html[data-theme="dark"] .ai-settings-section {
  background: #28314e !important;
  color: #ffffff !important;
  border: none !important;
  border-color: transparent !important;
}

html[data-theme="dark"] #filters-panel-modal *,
html[data-theme="dark"] .fixed-card-item *,
html[data-theme="dark"] .panel-section *,
html[data-theme="dark"] .ai-settings-section * {
  color: #ffffff !important;
}

html[data-theme="dark"] .panel-section .usage-item,
html[data-theme="dark"] .panel-section .usage-item * {
  --tw-text-opacity: 1;
  color: rgb(30 41 59 / var(--tw-text-opacity, 1)) !important;
}

html[data-theme="dark"] #panel-insights-list .insight-tile,
html[data-theme="dark"] #panel-insights-list .insight-tile * {
  --tw-text-opacity: 1;
  color: rgb(71 85 105 / var(--tw-text-opacity, 1)) !important;
}

html[data-theme="dark"] .insights-panel .insight-card,
html[data-theme="dark"] .insights-panel .insight-card * {
  --tw-text-opacity: 1;
  color: rgb(71 85 105 / var(--tw-text-opacity, 1)) !important;
}

html[data-theme="dark"] .gantt-card {
  background: #111a2e !important;
  border: 1px solid var(--theme-border) !important;
  border-radius: 16px;
  color: var(--theme-text) !important;
  padding: 16px;
  box-shadow: var(--theme-shadow-soft);
}

html[data-theme="dark"] .gantt-card .gantt-row,
html[data-theme="dark"] .gantt-card .gantt-task-list li {
  background: #0f172a !important;
  border: 1px dashed var(--theme-border) !important;
  border-radius: 12px;
  color: var(--theme-text) !important;
}

html[data-theme="dark"] .gantt-card .gantt-row {
  padding: 10px 12px;
}

html[data-theme="dark"] .gantt-card .gantt-task-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

html[data-theme="dark"] .gantt-card .gantt-task-list li {
  padding: 8px 10px;
  font-size: 12px;
}

html[data-theme="dark"] .gantt-card .gantt-label strong {
  color: var(--theme-text) !important;
}

html[data-theme="dark"] .gantt-card .gantt-meta {
  color: var(--theme-text-muted) !important;
}

html[data-theme="dark"] .gantt-stat-surface {
  background: #0f172a !important;
  border-color: var(--theme-border) !important;
}

html[data-theme="dark"] .gantt-stat-chart-title {
  color: var(--theme-text) !important;
}

html[data-theme="dark"] .gantt-stat-legend,
html[data-theme="dark"] .gantt-stat-axis,
html[data-theme="dark"] .gantt-bar-label,
html[data-theme="dark"] .gantt-stat-empty {
  color: var(--theme-text-muted) !important;
}

html[data-theme="dark"] #board-container > #insights-area {
  background: var(--theme-column-bg) !important;
  border: 1px solid var(--theme-column-border) !important;
  color: var(--theme-text) !important;
}

html[data-theme="dark"] #board-container > #insights-area strong {
  color: var(--theme-text) !important;
}

html[data-theme="dark"] #board-container > #insights-area .muted,
html[data-theme="dark"] #board-container > #insights-area #insights-open-ai,
html[data-theme="dark"] #board-container > #insights-area #insights-collapse {
  color: var(--theme-text-muted) !important;
}

html[data-theme="dark"] .page-dashboard #dashboard-header .nav-actions,
html[data-theme="dark"] .page-admin #admin-header .nav-actions,
html[data-theme="dark"] .page-board #board-header .nav-actions,
html[data-theme="dark"] .page-dashboard #settings-header .nav-actions {
  background: rgba(11, 18, 32, 0.98);
  border-color: var(--theme-border);
}
