/* Workshop look in charcoal black. Loaded after charcoal.css; remove its link
   in index.php to go back. Dark-only, like charcoal.css: the light theme and
   all application behaviour are untouched.

   Colour only ever means something: a section, a status, or the one main
   button. Neutral greys for everything else, no purple, no pills. */
[data-theme="dark"] {
  --bg: #171717;
  --panel: #262626;
  --panel-2: #1f1f1f;
  --border: #383838;
  --text: #f0f0ee;
  --muted: #b0b0ad;
  --accent: #9dabf5;
  --accent-hover: #bcc6fa;
  --accent-soft: #252836;
  --accent-fill: #5062d6;
  --brand: #5062d6;
  --brand-hover: #5b6ee1;
  --brand-grad: #5b6ee1;
  --card-unread-bg: #272a38;
  --card-unread-edge: #5b6ee1;
  --radius: 4px;
  --radius-lg: 6px;
}

/* Chrome: one step darker than the page, and no accent bar on the active row. */
[data-theme="dark"] .topbar,
[data-theme="dark"] .sidebar { background: #121212; }
[data-theme="dark"] .side-nav a,
[data-theme="dark"] .side-proj { border-radius: 4px; }
[data-theme="dark"] .side-nav a.active,
[data-theme="dark"] .side-proj.active { background: #262626; box-shadow: none; }

/* Project header: Work Sans carries the weight, controls are plain and square. */
[data-theme="dark"] .proj-head-main .page-title {
  font-family: 'Work Sans', 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.02em;
}
[data-theme="dark"] .proj-dot { border-radius: 2px; }
[data-theme="dark"] .status-menu { border-radius: 3px; }
[data-theme="dark"] .status-menu.status-on_track { background: #24402f; color: #a6e0bd; }
[data-theme="dark"] .status-menu.status-at_risk { background: #4a3517; color: #f2c78f; }
[data-theme="dark"] .status-menu.status-off_track { background: #4a2020; color: #f2aaaa; }
[data-theme="dark"] .project-filter-bar { border-bottom: 0; padding-bottom: 0; margin-bottom: 14px; }
[data-theme="dark"] .fm-pop { border: 1px solid #454545; border-radius: 6px; }
[data-theme="dark"] .proj-member-more { background: #262626; }
[data-theme="dark"] .who-badge.proj-member { width: 26px; height: 26px; }
[data-theme="dark"] .proj-head-actions .btn:not(.btn-danger) { background: var(--brand); border-color: var(--brand); color: #ffffff; }
[data-theme="dark"] .proj-head-actions .btn:not(.btn-danger):hover { background: var(--brand-hover); border-color: var(--brand-hover); }
[data-theme="dark"] .btn,
[data-theme="dark"] .switcher-btn { border-radius: 4px; }

/* Sections: no box around them. Cards sit straight on the page. */
[data-theme="dark"] .board { gap: 14px; }
[data-theme="dark"] .board-col { background: none; border: 0; border-radius: 6px; padding: 2px; }
[data-theme="dark"] .board-col-head { padding: 2px 2px 12px; align-items: center; }
[data-theme="dark"] .board-col-label { align-items: center; gap: 9px; }
[data-theme="dark"] .board-col-label::before { width: 10px; height: 10px; border-radius: 0; }
[data-theme="dark"] .board-col-head h3 {
  font-family: 'Work Sans', 'Inter', sans-serif;
  font-size: 16px; font-weight: 600; letter-spacing: 0; line-height: 1.25;
}
[data-theme="dark"] .board-col-count {
  padding: 0; background: none;
  font-family: 'Work Sans', 'Inter', sans-serif; font-size: 14px; font-weight: 500;
  color: var(--muted);
}
[data-theme="dark"] .board-col-body { gap: 8px; }
[data-theme="dark"] .board-col.drag-over,
[data-theme="dark"] .board-col.col-drag-over { background: var(--accent-soft); outline-color: var(--accent); }

/* Cards: solid, with a real edge. */
[data-theme="dark"] .board-card {
  background: #262626; border: 1px solid #383838; border-radius: 6px;
  padding: 11px 12px 10px;
}
[data-theme="dark"] .board-card:hover { background: #2b2b2b; border-color: #5a5a5a; }
[data-theme="dark"] .board-card.is-unread { background: var(--card-unread-bg); border-color: var(--card-unread-edge); }
[data-theme="dark"] .board-card.is-unread:hover { background: #2d3041; }
[data-theme="dark"] .board-card-title { font-size: 14px; font-weight: 500; line-height: 1.4; }
[data-theme="dark"] .board-card-foot { margin-top: 9px; gap: 8px; }
[data-theme="dark"] .board-card.colored { padding-top: 16px; }
[data-theme="dark"] .board-card.state-busy,
[data-theme="dark"] .board-card.state-review { padding-top: 35px; }

/* Busy / Review: a solid block flush to the card, words only. */
[data-theme="dark"] .board-card-cover { height: 24px; font-size: 12px; font-weight: 600; letter-spacing: 0; }
[data-theme="dark"] .board-card.state-review .board-card-cover { background: #2c5a44; color: #d8f3e3; }
[data-theme="dark"] .board-card.state-busy .board-card-cover { background: #6b4a1c; color: #fbe3bd; }
[data-theme="dark"] .board-card-cover-icon { display: none; }

/* Who added it: a small squared tile, not another circle. */
[data-theme="dark"] .who-badge {
  width: 22px; height: 22px; border-radius: 3px;
  font-size: 10px; font-weight: 700;
  background: hsl(var(--who-h) 42% 72%); color: hsl(var(--who-h) 55% 14%);
}

/* Footer details are plain text; only the things that matter get colour. */
[data-theme="dark"] .board-card-foot .chip { padding: 0; background: none; font-size: 12px; }
[data-theme="dark"] .board-card-foot .prio-chip { font-weight: 600; }
[data-theme="dark"] .board-card-foot .prio-high { color: #f2aaaa; }
[data-theme="dark"] .board-card-foot .prio-medium { color: #eeb77e; }
[data-theme="dark"] .board-card-foot .prio-low { color: var(--muted); }
[data-theme="dark"] .board-card-foot .chip-icon { display: none; }
[data-theme="dark"] .board-card-foot .due-chip.due-overdue { padding: 1px 5px; border-radius: 3px; background: #4a2020; color: #f2aaaa; }
[data-theme="dark"] .board-card-foot .due-chip.due-today { padding: 1px 5px; border-radius: 3px; background: var(--accent-soft); color: var(--accent); }
[data-theme="dark"] .tag-pill { border-radius: 3px; }
[data-theme="dark"] .card-progress { height: 3px; border-radius: 0; }
[data-theme="dark"] .card-progress i { border-radius: 0; }

/* Add a card and empty sections match the cards they sit beside. */
[data-theme="dark"] .board-add input {
  min-height: 42px; border: 1px solid #383838; border-radius: 6px;
  background: none; text-align: center;
}
[data-theme="dark"] .board-add input:focus { background: #262626; text-align: left; }
[data-theme="dark"] .board-add input::placeholder { color: var(--muted); }
[data-theme="dark"] .col-empty { border-radius: 6px; border-color: #383838; }
[data-theme="dark"] .board-add-list-btn { border-radius: 6px; }
[data-theme="dark"] .col-menu { border-radius: 6px; }
[data-theme="dark"] .col-menu button { border-radius: 4px; }

/* Card window: square, solid, and the same quiet greys as the board. */
[data-theme="dark"] .drawer-backdrop { background: rgba(0, 0, 0, .65); }
[data-theme="dark"] .drawer.dw { background: #1f1f1f; border: 1px solid #383838; border-radius: 8px; overflow: hidden; }
[data-theme="dark"] .drawer .dw-side { background: #1a1a1a; border-left-color: #333333; border-radius: 0; }
[data-theme="dark"] .dw-list-pill,
[data-theme="dark"] .dw-chip {
  height: 32px; padding: 0 8px; border: 1px solid #454545; border-radius: 4px;
  background: #262626; color: var(--text); font-size: 13px; font-weight: 500; filter: none;
}
[data-theme="dark"] .dw-chip .due-chip { padding: 1px 5px; border-radius: 3px; }
[data-theme="dark"] .dw-chip-select.prio-high { color: #f2aaaa; }
[data-theme="dark"] .dw-chip-select.prio-medium { color: #eeb77e; }
[data-theme="dark"] .dw-states { border-color: #454545; border-radius: 4px; }
[data-theme="dark"] .dw-state + .dw-state { border-left-color: #454545; }
[data-theme="dark"] .dw-state { color: #d0d0cc; }
[data-theme="dark"] .dw-state:hover { background: #2b2b2b; }
[data-theme="dark"] .dw-state.on { background: #3a3a3a; color: #ffffff; }
[data-theme="dark"] .dw-state-busy.on { background: #6b4a1c; color: #fbe3bd; }
[data-theme="dark"] .dw-state-review.on { background: #2c5a44; color: #d8f3e3; }
[data-theme="dark"] .drawer .dw-title {
  font-family: 'Work Sans', 'Inter', sans-serif;
  font-size: 26px; font-weight: 600; line-height: 1.25; letter-spacing: 0;
  background: none; border-color: transparent; padding-left: 0; margin-left: 0;
}
[data-theme="dark"] .drawer .dw-title:hover { background: none; border-color: transparent; }
[data-theme="dark"] .drawer .dw-title:focus { background: #171717; border-color: #454545; padding-left: 8px; margin-left: -8px; box-shadow: none; }
[data-theme="dark"] .dw-meta-item h5 { font-size: 12px; font-weight: 400; color: var(--muted); }
[data-theme="dark"] .dw-avatar {
  width: 30px; height: 30px; border-radius: 3px;
  background: #3a3a3a; color: var(--text); font-size: 10px; font-weight: 700;
}
[data-theme="dark"] .dw-avatar-pick { opacity: 1; box-shadow: none; }
[data-theme="dark"] .dw-avatar-pick:hover { transform: none; background: #4a4a4a; opacity: 1; }
[data-theme="dark"] .dw-avatar-pick.on { background: var(--brand); color: #ffffff; box-shadow: none; }
[data-theme="dark"] .dw-square { width: 30px; height: 30px; border-radius: 3px; background: #3a3a3a; }
[data-theme="dark"] .dw-block-head h4,
[data-theme="dark"] .dw-addrow h4,
[data-theme="dark"] .dw-feed-head h4 { font-size: 13px; font-weight: 600; }
[data-theme="dark"] .drawer-desc { min-height: 96px; border-color: #333333; border-radius: 4px; background: #171717; font-size: 14px; }
[data-theme="dark"] .dw .attach-thumb { border: 1px solid #333333; border-radius: 4px; }
[data-theme="dark"] .dw-side .composer textarea { border-color: #333333; border-radius: 4px; background: #171717; }
[data-theme="dark"] .dw-side .avatar { border-radius: 3px; }
[data-theme="dark"] .dw-bubble { border-radius: 4px; }
[data-theme="dark"] .dw-pop { border: 1px solid #454545; border-radius: 6px; }

/* Date picker: matches the card window. */
[data-theme="dark"] .dp-pop { border: 1px solid #454545; border-radius: 6px; }
[data-theme="dark"] .dp-arrow:hover,
[data-theme="dark"] .dp-day:hover,
[data-theme="dark"] .dp-tab:hover { background: #333333; }
[data-theme="dark"] .dp-day.selected:hover { background: var(--brand-hover); }
[data-theme="dark"] .dp-tab { border-color: #454545; }
[data-theme="dark"] .dp-tab.on { border-color: var(--brand-hover); background: #2b2d3a; }
[data-theme="dark"] .dp-rows select { background: #1f1f1f; border-color: #454545; }

/* Floating view bar: the open view reads as a solid tile. */
@media (min-width: 761px) and (min-height: 501px) {
  [data-theme="dark"] body.tl-workspace .main { padding-bottom: 0; }
  [data-theme="dark"] body.tl-workspace .ws-dock { background: #1f1f1f; border-color: #383838; }
  [data-theme="dark"] body.tl-workspace .ws-dock-btn:hover { background: #2b2b2b; }
  [data-theme="dark"] body.tl-workspace .ws-dock-btn.on { background: #3a3a3a; color: #ffffff; }
  [data-theme="dark"] body.tl-workspace .ws-dock-sep { background: #383838; }
}

/* Sidebar: a quiet list. Text brightens on hover; the open row is a flat tile. */
[data-theme="dark"] .sidebar { padding: 14px 10px; border-right-color: #262626; }
[data-theme="dark"] .side-nav { gap: 1px; margin-bottom: 22px; }
[data-theme="dark"] .side-nav a,
[data-theme="dark"] .side-proj { padding: 7px 10px; color: var(--muted); }
[data-theme="dark"] .side-nav a:hover,
[data-theme="dark"] .side-proj:hover { background: #1f1f1f; color: var(--text); }
[data-theme="dark"] .side-nav a.active,
[data-theme="dark"] .side-proj.active { background: #262626; color: #ffffff; box-shadow: none; }
[data-theme="dark"] .side-projects { gap: 1px; }
[data-theme="dark"] .side-head { padding: 0 4px 6px 10px; font-size: 12px; font-weight: 600; letter-spacing: 0; }
[data-theme="dark"] .side-add { width: 26px; height: 26px; padding: 0; border-radius: 4px; }
[data-theme="dark"] .side-add:hover { background: #1f1f1f; }
[data-theme="dark"] .side-proj-grip { left: 7px; }

/* Top bar: the same dark as the sidebar, so the two read as one frame. */
[data-theme="dark"] .topbar { min-height: 52px; border-bottom-color: #262626; }
[data-theme="dark"] .switcher-btn { padding: 6px 8px; border: 0; background: none; font-size: 14px; }
[data-theme="dark"] .switcher-btn:hover { background: #1f1f1f; }
[data-theme="dark"] .search-box input {
  width: 220px; height: 34px; padding: 0 10px;
  border-color: transparent; border-radius: 4px; background: #1f1f1f;
}
[data-theme="dark"] .search-box input:hover { background: #262626; }
[data-theme="dark"] .search-box input:focus { width: 300px; background: #1f1f1f; border-color: #5a5a5a; box-shadow: none; }
[data-theme="dark"] .topbar .icon-btn { width: 34px; height: 34px; border-radius: 4px; color: var(--muted); }
[data-theme="dark"] .topbar .icon-btn:hover { background: #1f1f1f; color: var(--text); }
[data-theme="dark"] .notif-badge { top: 3px; right: 3px; border-radius: 3px; }
[data-theme="dark"] .topbar .user-menu .avatar { width: 30px; height: 30px; border-radius: 4px; background: #3a3a3a; color: var(--text); font-size: 11px; }
[data-theme="dark"] .topbar .user-menu .avatar:hover { background: #4a4a4a; }
[data-theme="dark"] .topbar .menu { border: 1px solid #454545; border-radius: 6px; }
/* The organisation name lines up with the left edge of the page below it. */
@media (min-width: 761px) {
  [data-theme="dark"] .topbar .brand { flex: none; width: 164px; }
}
@media (max-width: 760px) {
  /* A long organisation name gives way before the bar runs off the screen. */
  [data-theme="dark"] .topbar { gap: 6px; }
  [data-theme="dark"] .topbar .org-switcher { flex: 0 1 auto; min-width: 0; }
  [data-theme="dark"] .switcher-btn { max-width: 100%; padding: 6px 4px; }
}

/* Motion: the card makes room for its status strip smoothly. */
[data-theme="dark"] .board-card { transition: border-color .12s, background-color .12s, padding-top .18s cubic-bezier(.2,.8,.2,1); }

/* My Tasks: the same status tints as the board. */
[data-theme="dark"] .mt .page-title { font-family: 'Work Sans', 'Inter', sans-serif; font-size: 28px; letter-spacing: -.02em; }
[data-theme="dark"] .mt-sum-late,
[data-theme="dark"] .group-overdue .mt-group-name,
[data-theme="dark"] .mt-due.due-overdue,
[data-theme="dark"] .mt-prio.is-high { color: #f2aaaa; }
[data-theme="dark"] .mt-prio.is-medium { color: #eeb77e; }
[data-theme="dark"] .mt-state.is-busy { background: #4a3517; color: #f2c78f; }
[data-theme="dark"] .mt-state.is-review { background: #24402f; color: #a6e0bd; }
[data-theme="dark"] .mt-row:hover { background: #1f1f1f; }
