/* Markday — monday.com-style layout with a purple theme. */
:root {
  --primary: #5048d8;
  --primary-hover: #3f37bf;
  --primary-soft: #eeedfc;
  --text: #323338;
  --muted: #676879;
  --border: #d0d4e4;
  --line: #e6e9ef;
  --bg: #f1f2f8;
  --surface: #ffffff;
  --hover: #f5f6f8;
  --selected: #e3e1fa;
  --danger: #d83a52;
  --ok: #00854d;
  --radius: 8px;
  --topbar: 52px;
  --sidebar: 248px;
  --shadow: 0 6px 20px rgba(0, 0, 0, .12);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Figtree", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; font-weight: 600; margin: 0 0 4px; }
h2 { font-size: 18px; font-weight: 600; margin: 0; }
p { margin: 0 0 10px; }
code { background: var(--hover); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pad { padding: 8px 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; min-width: 0; }
.ok-text { color: var(--ok); }

/* ---------------------------------------------------------------- buttons and form controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 4px; border: 1px solid transparent;
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none !important;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; position: relative;
  width: 36px; height: 36px; border: 0; border-radius: 4px; background: transparent;
  color: var(--muted); font-size: 17px; cursor: pointer; text-decoration: none !important; list-style: none;
}
.icon-btn:hover, .icon-btn.active { background: var(--hover); color: var(--text); }
.icon-btn.small { width: 26px; height: 26px; font-size: 15px; }
.icon-btn.tiny { width: 24px; height: 24px; font-size: 14px; }
summary.icon-btn::-webkit-details-marker { display: none; }
button.link { background: none; border: 0; color: var(--primary); cursor: pointer; font: inherit; padding: 0; }

input, select, textarea {
  font: inherit; color: var(--text); background: #fff;
  border: 1px solid var(--border); border-radius: 4px; padding: 8px 10px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--primary); margin: 0; }
textarea { resize: vertical; }
label { display: block; font-weight: 500; }
label > input, label > select, label > textarea, label > .pw-wrap { margin-top: 6px; font-weight: 400; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 500; padding: 0; margin-bottom: 6px; }
.choice label { display: flex; gap: 8px; align-items: baseline; font-weight: 400; padding: 4px 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 64px; margin-top: 0; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; color: var(--primary); cursor: pointer; font: inherit; font-size: 12px; padding: 4px 6px;
}

.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; background: #e6f6ee; color: #0b5a36; border: 1px solid #b6e3cb; }
.flash.error { background: #fde8eb; color: #9e1c31; border-color: #f6c1ca; }
.flash.info { background: #f5f6f8; color: var(--muted); border-color: var(--line); }
.tag { display: inline-block; font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 10px; background: var(--hover); color: var(--muted); vertical-align: middle; }
.tag.ok { background: #d6f5e6; color: #0b5a36; }
.tag.warn { background: #fff0d6; color: #8a5300; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }

/* ---------------------------------------------------------------- avatars */
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 600;
  border: 2px solid #fff; letter-spacing: .2px; user-select: none; list-style: none;
}
.avatar.lg { width: 34px; height: 34px; cursor: pointer; }
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.avatar.xs { width: 20px; height: 20px; font-size: 8px; border-width: 1px; }
.avatar.empty { background: #c5c7d0; font-size: 12px; }
.avatar.more { background: #676879; }
.avatar.gone { opacity: .45; }
.avatars { display: inline-flex; }
.avatars .avatar + .avatar { margin-left: -8px; }
.avatars .avatar.xs + .avatar.xs { margin-left: -5px; }
summary.avatar::-webkit-details-marker { display: none; }

/* ---------------------------------------------------------------- menus and popups */
details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; }
.menu-pop {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 190px;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px;
}
.menu-pop.right { left: auto; right: 0; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; }
.menu-head span { color: var(--muted); font-size: 12px; }
.menu-pop a, .menu-item {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 4px;
  background: none; font: inherit; color: var(--text); cursor: pointer; text-decoration: none;
}
.menu-pop a:hover, .menu-item:hover { background: var(--hover); text-decoration: none; }
.menu-item.danger { color: var(--danger); }
.swatches { display: grid; grid-template-columns: repeat(6, 22px); gap: 6px; padding: 6px 10px 10px; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 0; cursor: pointer; }
.swatch:hover { transform: scale(1.15); }

.pop {
  position: absolute; z-index: 60; background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 10px;
}
.pop.labels { display: flex; flex-direction: column; gap: 6px; width: 190px; }
.label-opt {
  height: 34px; border: 0; border-radius: 3px; color: #fff; font: inherit; font-weight: 500; cursor: pointer;
}
.label-opt:hover { filter: brightness(.92); }
.label-opt.current { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--text); }
.label-opt.blank { background: #fff; color: var(--muted); border: 1px dashed var(--border); }
.pop.people { width: 260px; }
.people-list { max-height: 280px; overflow-y: auto; margin-top: 8px; }
.person-opt {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 4px;
  background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer;
}
.person-opt:hover { background: var(--hover); }
.person-opt.on { background: var(--selected); }
.person-opt .pname { flex: 1; }
.person-opt .tick { color: var(--primary); font-weight: 700; }

dialog.modal { border: 0; border-radius: 12px; padding: 28px; width: min(480px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog.modal::backdrop { background: rgba(41, 47, 76, .55); }
dialog.modal form { display: flex; flex-direction: column; gap: 18px; }

/* ---------------------------------------------------------------- app layout: top bar, sidebar, content */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--topbar); z-index: 40;
  display: flex; align-items: center; gap: 8px; padding: 0 16px; background: var(--bg);
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand.big { font-size: 34px; flex-direction: column; gap: 6px; margin-bottom: 22px; width: 100%; }
.logo { flex: none; }
.wm { font-family: "Open Sans", "Segoe UI", sans-serif; font-weight: 800; font-size: 26px; white-space: nowrap; }
.wm-k { display: inline-block; height: .76em; width: .56em; margin-left: .07em; vertical-align: baseline; }
.brand.big .wm { font-size: 34px; }
.wm-mark { color: #4466a1; }
.wm-day { color: #ef5728; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.bell .badge {
  position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
}
.menu-toggle { display: none; }

.shell { display: flex; padding-top: var(--topbar); min-height: 100vh; }
.sidebar {
  position: fixed; top: var(--topbar); bottom: 0; left: 0; width: var(--sidebar); z-index: 35;
  overflow-y: auto; padding: 8px 10px 20px; background: var(--bg);
}
.side-link {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 4px; color: var(--text);
  text-decoration: none !important; font-size: 14px;
}
.side-link:hover { background: #e3e4ef; }
.side-link.active { background: var(--selected); color: #343090; font-weight: 500; }
.side-link .ico { width: 18px; text-align: center; flex: none; color: var(--muted); }
.side-section {
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px 0 6px; padding: 0 4px 0 10px; color: var(--muted); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
}
.side-search { margin-bottom: 6px; padding: 6px 10px; font-size: 13px; background: #fff; }
.content {
  flex: 1; min-width: 0; margin-left: var(--sidebar); background: var(--surface);
  border-radius: 12px 0 0 0; padding: 24px 32px 80px; min-height: calc(100vh - var(--topbar));
  box-shadow: 0 0 0 1px var(--line);
}
.page.narrow { max-width: 680px; }

body.plain { background: linear-gradient(160deg, #f3f3fd 0%, #ffffff 60%); }
.center-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: min(420px, 100%); background: #fff; border-radius: 12px; padding: 32px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 20px; text-align: center; margin-bottom: 18px; }
.auth-card > .muted { text-align: center; }

/* ---------------------------------------------------------------- board header, views and toolbar */
.board-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 8px; flex-wrap: wrap; }
.board-title { min-width: 0; }
.views { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.view-tab { padding: 8px 12px; color: var(--text); border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none !important; }
.view-tab:hover { background: var(--hover); border-radius: 4px 4px 0 0; }
.view-tab.active { border-bottom-color: var(--primary); font-weight: 500; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.search-box { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; border-radius: 4px; padding: 0 8px; font-weight: 400; margin-bottom: 12px; }
.toolbar .search-box { margin-bottom: 0; }
.search-box:focus-within, .search-box:hover { border-color: var(--border); }
.search-box input { border: 0; padding: 7px 0; width: 160px; box-shadow: none; }
.tool-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 0; border-radius: 4px;
  background: none; font: inherit; color: var(--text); cursor: pointer;
}
.tool-btn:hover { background: var(--hover); }
.tool-btn.on { background: var(--selected); color: #343090; }
.filter-avatar { cursor: pointer; padding: 0; transition: opacity .15s; }
.filter-avatar.on { box-shadow: 0 0 0 2px var(--primary); }
.filter-avatar.dim { opacity: .35; }
.toolbar #new-group-btn { margin-left: auto; }

/* Toolbar and column popups */
.pop.tool-pop { width: 300px; max-width: calc(100vw - 16px); max-height: 70vh; overflow-y: auto; }
.tool-pop h3 { margin: 0 0 10px; font-size: 15px; }
.tool-head { display: flex; justify-content: space-between; align-items: baseline; }
.person-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.filter-section { margin-bottom: 12px; }
.filter-title { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 14px; border: 1px solid var(--border);
  background: #fff; font: inherit; font-size: 13px; cursor: pointer;
}
.chip .dot { width: 10px; height: 10px; border-radius: 50%; }
.chip.on { background: var(--selected); border-color: var(--primary); }
.sort-col { margin-bottom: 10px; }
.sort-dir { display: flex; gap: 16px; margin-bottom: 8px; }
.sort-dir label { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.hide-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.col-menu { width: 220px; padding: 6px; }
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.type-opt {
  display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; font: inherit; cursor: pointer; text-align: left;
}
.type-opt:hover { border-color: var(--primary); background: var(--primary-soft); }
.type-ico { width: 22px; text-align: center; font-weight: 700; color: var(--muted); }

/* Column headings */
.col-head { gap: 4px; position: relative; padding: 0 22px 0 8px; }
.col-title { cursor: text; border-radius: 3px; padding: 1px 3px; }
.col-title:hover { background: var(--hover); }
.col-info { color: var(--muted); cursor: help; font-size: 13px; }
.col-menu-btn { position: absolute; right: 2px; opacity: 0; }
.col-head:hover .col-menu-btn { opacity: 1; }
.row.header .c-fill { justify-content: flex-start; }
.add-col-btn { color: var(--muted); }

/* Extra column cells */
.c-people { cursor: pointer; }
.c-text, .c-link { justify-content: flex-start; cursor: text; font-size: 13px; }
.c-number { cursor: text; font-variant-numeric: tabular-nums; }
.c-check input { width: 18px; height: 18px; cursor: pointer; }
.c-files { cursor: pointer; }
.file-chip { background: var(--hover); border-radius: 10px; padding: 1px 8px; font-size: 12px; }
.add-file { color: #c3c6d4; opacity: 0; }
.row.item:hover .add-file { opacity: 1; }
.updates-btn .plus { font-size: 10px; font-weight: 700; margin-left: -4px; margin-top: 8px; }
.range-pill { background: var(--primary); color: #fff; border-radius: 12px; padding: 2px 10px; font-size: 12px; white-space: nowrap; }
.sum { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.summary .cell .bar { width: 100%; }
.pop.files-pop { width: 320px; max-width: calc(100vw - 16px); }
.files-pop h3 { margin: 0 0 8px; font-size: 15px; }
.file-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; max-height: 240px; overflow-y: auto; }
.file-line { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 6px; }
.file-line a { grid-column: 1; }
.file-line span { grid-column: 1; }
.file-line button { grid-column: 2; grid-row: 1 / 3; }
.upload-btn { width: 100%; margin-bottom: 6px; cursor: pointer; }
.add-group-bottom { margin-top: -12px; }

/* ---------------------------------------------------------------- groups and the item table */
.group { margin-bottom: 36px; --gc: #579bfc; }
.group-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; min-height: 32px; }
.group-head .collapse { color: var(--gc); transition: transform .15s; }
.group.collapsed .collapse { transform: rotate(-90deg); }
.group.collapsed .grid .rows, .group.collapsed .add-row, .group.collapsed .summary { display: none; }
.group-name { color: var(--gc); cursor: text; padding: 2px 4px; border-radius: 4px; border: 1px solid transparent; }
.group-name:hover:not(.static) { border-color: var(--border); }
.group-name.static { cursor: default; color: var(--text); }
.group-menu { opacity: 0; }
.group-head:hover .group-menu, .group-menu[open] { opacity: 1; }

.groups-scroll { overflow-x: auto; padding-bottom: 4px; }
.groups-scroll .group { width: max-content; min-width: 100%; }   /* so the sticky group name has room to stay */
.groups-scroll .group-head { position: sticky; left: 0; width: max-content; }
/* The item name column stays put while the other columns scroll, like monday. */
.groups-scroll .row > .cell:first-child { position: sticky; left: 0; z-index: 2; background: #fff; }
/* An open ⋯ menu must sit above the rows below it. */
.groups-scroll .row > .cell:first-child:has(details[open]) { z-index: 30; }
.groups-scroll .row.item:hover > .cell:first-child { background: var(--hover); }
.groups-scroll .row.item.selected > .cell:first-child { background: var(--selected); }
.groups-scroll .row.summary > .cell:first-child { background: #fff; }
.grid-wrap { overflow: visible; }
.mywork .grid-wrap { overflow-x: auto; }
/* Each board sets its own columns in --cols (see grid_template in app.py); --first is the item column. */
.grid { --first: minmax(260px, 420px); min-width: 100%; width: max-content; }
.row {
  display: grid; grid-template-columns: var(--cols, var(--first) 120px 150px 130px 140px minmax(0, 1fr));
  min-height: 38px; background: #fff;
}
.cell {
  display: flex; align-items: center; justify-content: center; min-width: 0; padding: 0 8px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.row .cell:first-child { justify-content: flex-start; border-left: 6px solid var(--gc); }
.row.header .cell { color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.row.header .cell:first-child { border-top-left-radius: 6px; font-weight: 500; color: var(--text); }
.row .c-fill { border-right: 0; }
.row.header .c-fill { border-top: 1px solid var(--line); }
.row.item:hover .cell { background: var(--hover); }
.row.item.selected .cell { background: var(--selected); }
.row.item .pill-cell, .row.item:hover .pill-cell, .row.item.selected .pill-cell {
  color: #fff; font-weight: 500; cursor: pointer; border-right: 1px solid #fff; text-align: center; line-height: 1.2;
}
.row.item .pill-cell:hover { filter: brightness(.94); }
.row.item [data-action="owners"], .row.item [data-action="date"] { cursor: pointer; }

.c-item { gap: 4px; }
.handle { cursor: grab; color: #c3c6d4; font-size: 12px; letter-spacing: -2px; padding: 4px 2px; opacity: 0; user-select: none; }
.row-menu { opacity: 0; }
.row.item:hover .handle, .row.item:hover .row-menu, .row-menu[open] { opacity: 1; }
.c-item .name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 3px 6px; border: 1px solid transparent; border-radius: 4px; cursor: text;
}
.row.item:hover .c-item .name { border-color: var(--border); }
.inline-edit { padding: 3px 6px; height: 28px; }
.updates-btn {
  flex: none; display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; cursor: pointer;
  font-size: 15px; color: #c3c6d4; padding: 4px 6px; border-radius: 4px; opacity: .6; filter: grayscale(1);
}
.row.item:hover .updates-btn, .updates-btn.has { opacity: 1; }
.updates-btn.has { filter: none; }
.updates-btn:hover { background: #e6e9ef; }
.updates-btn .count {
  background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px;
  border-radius: 8px; padding: 0 4px; line-height: 16px;
}
.c-date { gap: 6px; position: relative; font-size: 13px; }
.c-date input[type="date"] { position: absolute; inset: auto 0 0 0; height: 1px; opacity: 0; pointer-events: none; padding: 0; border: 0; }
.c-date.editing input[type="date"] { position: static; height: 28px; opacity: 1; pointer-events: auto; }
.c-date.editing > span { display: none; }
.due-flag {
  display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
}
.due-done { color: var(--ok); font-weight: 700; }
.c-date.overdue { color: var(--danger); }
.c-date.overdue span:last-of-type { text-decoration: line-through; text-decoration-color: rgba(216, 58, 82, .5); }
.c-date.overdue .due-flag { text-decoration: none; }
.c-date.today { color: var(--primary); font-weight: 600; }

.add-row .cell:first-child { border-bottom-left-radius: 6px; border-left-color: color-mix(in srgb, var(--gc) 45%, #fff); }
.add-row .c-rest { grid-column: 2 / -1; border-right: 0; }
.add-item { border: 1px solid transparent; padding: 5px 8px; margin-left: 20px; }
.add-item:hover { border-color: var(--border); }
.summary .cell { border: 0; min-height: 40px; }
.summary .cell:first-child { border-left: 0; }
.bar { display: flex; width: 100%; height: 26px; gap: 1px; }
.bar span { min-width: 4px; }
.bar span:first-child { border-radius: 2px 0 0 2px; }
.bar span:last-child { border-radius: 0 2px 2px 0; }

.row.item.dragging { opacity: .5; }
.row.item.dragging .cell { background: var(--selected); }

/* My work: whole rows are links. */
.mywork .row { grid-template-columns: minmax(260px, 1fr) 200px 150px 130px 140px; }
.mywork.with-owner .row { grid-template-columns: minmax(260px, 1fr) 200px 120px 150px 130px 140px; }
.mywork .c-owner { justify-content: center; }
.mywork.late { --gc: var(--danger); }
.link-row { color: var(--text); text-decoration: none !important; }
.link-row .c-board { flex-direction: column; align-items: flex-start; justify-content: center; }
.mywork .row .cell:last-child { border-right: 0; }

/* ---------------------------------------------------------------- Kanban */
.kanban { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding-bottom: 12px; }
.kcol { flex: 0 0 270px; background: var(--hover); border-radius: var(--radius); }
.kcol header {
  display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 8px 8px 0 0;
  background: var(--kc); color: #fff; font-weight: 600;
}
.kcol[data-status=""] header { color: var(--text); }
.kcount { background: rgba(255, 255, 255, .35); border-radius: 10px; padding: 0 8px; font-size: 12px; }
.kcards { display: flex; flex-direction: column; gap: 8px; padding: 10px; min-height: 80px; }
.kcol.over { box-shadow: 0 0 0 2px var(--primary); }
.kcard {
  background: #fff; border-radius: 6px; padding: 12px; box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
  cursor: pointer; border-left: 4px solid var(--kc);
}
.kcard:hover { box-shadow: 0 3px 10px rgba(0, 0, 0, .12); }
.kcard.dragging { opacity: .5; }
.kname { font-weight: 500; margin-bottom: 8px; word-break: break-word; }
.kmeta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kdate { font-size: 12px; color: var(--muted); }
.kdate.overdue { color: var(--danger); font-weight: 600; }
.kprio { color: #fff; font-size: 11px; border-radius: 10px; padding: 1px 8px; }

/* ---------------------------------------------------------------- item panel */
.panel-overlay { position: fixed; inset: 0; z-index: 45; background: rgba(41, 47, 76, .25); }
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(620px, 100vw);
  background: #fff; box-shadow: -8px 0 24px rgba(0, 0, 0, .12); display: flex; flex-direction: column;
  animation: slide-in .18s ease-out;
}
@keyframes slide-in { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.panel-head { padding: 16px 24px 0; border-bottom: 1px solid var(--line); }
.panel-head .icon-btn { float: right; margin: -4px -8px 0 0; }
.panel-title { font-size: 22px; padding: 2px 6px; margin: 0 0 2px -6px; border: 1px solid transparent; border-radius: 4px; cursor: text; word-break: break-word; }
.panel-title:hover { border-color: var(--border); }
.panel-head > .muted { margin-bottom: 12px; }
.tabs { display: flex; gap: 4px; }
.tab { border: 0; background: none; font: inherit; padding: 8px 12px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--text); }
.tab.active { border-bottom-color: var(--primary); font-weight: 500; }
.panel-body { flex: 1; overflow-y: auto; padding: 20px 24px 40px; background: #fafbfc; }
.update-form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin-bottom: 18px; }
.update-form textarea { border: 0; padding: 4px; box-shadow: none; }
.update { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.update header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.update header time { margin-left: auto; }
.update p { white-space: pre-wrap; word-break: break-word; margin: 0; }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: grid; grid-template-columns: 54px 24px 100px 1fr; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.activity li > span:only-of-type, .activity li > span:nth-child(3):last-child { grid-column: 3 / -1; }
.act-field { font-weight: 500; }
.act-change .old { color: var(--muted); }
.empty-state { text-align: center; padding: 36px 16px; }
.empty-state.big { padding: 64px 16px; }
.empty-ico { font-size: 40px; margin-bottom: 8px; }

/* ---------------------------------------------------------------- notifications, people, settings */
.notif { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px; color: var(--text); border-bottom: 1px solid var(--line); text-decoration: none !important; }
.notif:last-child { border-bottom: 0; }
.notif:hover { background: var(--hover); }
.notif.unread { background: #f6f6fe; }
.notif.unread .notif-text { font-weight: 500; }
.notif-text { flex: 1; white-space: pre-line; word-break: break-word; }
.notif time { flex: none; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 500; color: var(--muted); font-size: 13px; background: #fafbfc; }
td .avatar { vertical-align: middle; margin-right: 6px; }
tr.inactive td { color: var(--muted); }
tbody tr:hover td { background: var(--hover); }

.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 12px; margin-top: 10px; max-height: 300px; overflow-y: auto; }
.members > input[type="search"] { margin-top: 4px; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-color: #f6c1ca; }

/* ---------------------------------------------------------------- board info popup (click the board name) */
.board-info > summary { cursor: pointer; border-radius: 4px; padding: 0 6px; margin-left: -6px; display: inline-block; }
.board-info > summary:hover, .board-info[open] > summary { background: var(--hover); }
.board-info h1 { display: inline; }
.caret { font-size: 18px; color: var(--muted); }
.info-pop { width: min(380px, calc(100vw - 32px)); padding: 20px; }
.info-pop h2 { font-size: 20px; margin-bottom: 6px; word-break: break-word; }
.info-pop h3 { font-size: 15px; margin: 0 0 10px; }
.info-pop hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.info-pop dl { display: grid; grid-template-columns: 110px 1fr; gap: 12px 8px; margin: 0 0 16px; align-items: center; }
.info-pop dt { color: var(--muted); }
.info-pop dd { margin: 0; display: flex; align-items: center; gap: 6px; }
.info-pop a { display: inline; width: auto; padding: 0; }
.info-pop a:hover { background: none; text-decoration: underline; }
.info-pop .person-link { display: inline-flex; align-items: center; gap: 6px; }
.info-pop a.btn { display: flex; padding: 0 16px; width: 100%; border: 1px solid var(--border); justify-content: center; }
.info-pop a.btn:hover { background: var(--hover); text-decoration: none; }
.board-title > .tag { vertical-align: super; }

/* ---------------------------------------------------------------- profile */
.person-link { color: var(--text); }
.avatar.xl { width: 132px; height: 132px; font-size: 48px; border-width: 4px; letter-spacing: 1px; }
.profile-page { max-width: 1040px; }
.profile-hero { display: flex; gap: 28px; align-items: center; padding: 28px; }
.hero-main { flex: 1; min-width: 0; }
.hero-main h1 { font-size: 30px; }
.hero-title { color: var(--muted); font-size: 15px; margin-bottom: 8px; }
.hero-tags { margin: 6px 0 14px; }
.tag.role { background: var(--primary-soft); color: #343090; }
.hero-stats { display: flex; gap: 28px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 22px; line-height: 1.1; }
.hero-actions { display: flex; flex-direction: column; gap: 8px; align-self: flex-start; }
.hero-fields { flex: 1; min-width: 0; max-width: 460px; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.profile-grid .card { margin-bottom: 0; }
.profile-grid h2 { font-size: 16px; margin-bottom: 12px; }
.profile-grid h2.mt { margin-top: 22px; }
.info-row { display: flex; gap: 12px; padding: 9px 0; }
.info-ico { width: 22px; text-align: center; flex: none; }
.info-label { font-weight: 600; font-size: 13px; }
.profile-form > .actions { margin-top: 16px; }

/* ---------------------------------------------------------------- side menu folders */
.add-menu .menu-pop { min-width: 160px; }
.folder { margin-top: 2px; border-radius: 6px; }
.folder-head { display: flex; align-items: center; }
.folder-toggle {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 7px 10px; border: 0; background: none;
  font: inherit; font-weight: 600; color: var(--text); cursor: pointer; border-radius: 4px; text-align: left;
}
.folder-toggle:hover { background: #e3e4ef; }
.folder-toggle .caret { font-size: 11px; color: var(--muted); transition: transform .15s; }
.folder.closed .caret { transform: rotate(-90deg); }
.folder.closed:not(.searching) .folder-boards { display: none; }
.folder-boards { padding-left: 14px; }
.folder-menu { opacity: 0; }
.folder-head:hover .folder-menu, .folder-menu[open] { opacity: 1; }
.folder-empty { padding: 4px 10px; margin: 0; }
.drop-here { background: var(--selected); outline: 2px dashed var(--primary); outline-offset: -2px; }
.board-list { min-height: 30px; border-radius: 6px; padding-bottom: 8px; }

/* ---------------------------------------------------------------- label picker and editor */
.edit-labels { border: 0; border-top: 1px solid var(--line); background: none; margin-top: 4px; padding: 8px 0 2px; color: var(--muted); font: inherit; cursor: pointer; }
.edit-labels:hover { color: var(--primary); }
.pop.label-editor { width: 400px; max-width: calc(100vw - 16px); max-height: 70vh; overflow-y: auto; }
.label-editor h3 { margin: 0 0 10px; font-size: 15px; }
.le-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 4px 0; }
.le-color { width: 26px; height: 26px; border-radius: 4px; border: 0; cursor: pointer; flex: none; }
.le-name { flex: 1; min-width: 120px; padding: 5px 8px; }
.le-done { display: flex; align-items: center; gap: 4px; font-weight: 400; font-size: 12px; color: var(--muted); white-space: nowrap; }
.le-palette { flex-basis: 100%; display: grid; grid-template-columns: repeat(10, 22px); gap: 5px; padding: 6px 0 4px 32px; }
.le-add { border: 1px dashed var(--border); background: none; border-radius: 4px; width: 100%; padding: 7px; margin: 8px 0 12px; font: inherit; color: var(--muted); cursor: pointer; }
.le-add:hover { color: var(--primary); border-color: var(--primary); }

/* ---------------------------------------------------------------- Kanban (monday-style cards) */
.kcol header .kcount { background: none; padding: 0; font-size: inherit; }
.kdone { background: rgba(255, 255, 255, .3); border-radius: 50%; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.kcol header { color: var(--kink, #fff); }
.ktop { display: flex; align-items: flex-start; gap: 4px; }
.ktop .kname { flex: 1; min-width: 0; }
.kupdates { position: relative; font-size: 15px; opacity: .45; filter: grayscale(1); padding: 0 2px; }
.kupdates.has { opacity: 1; filter: none; }
.kupdates .count {
  position: absolute; right: -4px; bottom: -4px; background: var(--primary); color: #fff; font-size: 9px; font-weight: 700;
  min-width: 14px; height: 14px; border-radius: 7px; line-height: 14px; text-align: center; padding: 0 3px;
}
.kmenu > summary { width: 22px; height: 22px; }
.kadd { display: block; width: calc(100% - 20px); margin: 0 10px 10px; border: 1px dashed transparent; background: transparent; padding: 7px 8px; }
.kadd:hover, .kadd:focus { border-color: var(--border); background: #fff; }
.kcol-add {
  flex: 0 0 160px; height: 44px; border: 1px dashed var(--border); border-radius: var(--radius); background: none;
  font: inherit; color: var(--muted); cursor: pointer;
}
.kcol-add:hover { color: var(--primary); border-color: var(--primary); }

/* ---------------------------------------------------------------- schedule: hours per day */
.sched-title { font-size: 15px; margin-bottom: 14px; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; background: var(--hover); border-radius: var(--radius); padding: 10px; }
.day-card { background: #fff; border-radius: 6px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.day-card.off { background: transparent; }
.day-toggle { display: flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; }
.day-hours { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.day-hours input, .day-hours select { padding: 4px 6px; font-size: 13px; }
.time-input { width: 100%; text-align: center; font-variant-numeric: tabular-nums; cursor: pointer; }
@media (max-width: 860px) { .time-input { width: 80px; } }
/* Time picker: two columns that scroll normally, one value at a time (no snapping). */
.time-picker {
  position: absolute; z-index: 70; display: flex; gap: 4px; padding: 6px; background: #fff;
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.tp-col { display: flex; flex-direction: column; width: 52px; height: 220px; overflow-y: auto; overscroll-behavior: contain; }
.tp-col button {
  flex: none; height: 30px; border: 0; border-radius: 4px; background: none; font: inherit;
  font-variant-numeric: tabular-nums; cursor: pointer; color: var(--text);
}
.tp-col button:hover { background: var(--hover); }
.tp-col button.on { background: var(--primary); color: #fff; font-weight: 600; }
.day-hours .muted { display: none; }
.day-card.off .day-hours { display: none; }
.day-off { display: none; }
.day-card.off .day-off { display: block; }
.sched-actions { margin-top: 14px; justify-content: space-between; }
.hours-list { list-style: none; margin: 0 0 8px; padding: 0; }
.hours-list li { display: flex; justify-content: space-between; padding: 3px 0; font-size: 13px; }
@media (max-width: 860px) {
  .week-grid { grid-template-columns: 1fr; }
  .day-card { flex-direction: row; align-items: center; justify-content: space-between; }
  .day-hours { flex-direction: row; align-items: center; }
  .day-hours .muted { display: inline; }
}

.danger-text { color: var(--danger) !important; }

/* Subitems: shown under their parent when it's open */
.row.sub, .row.add-sub { display: none; }
.row.sub.shown, .row.add-sub.shown { display: grid; }
.row.sub .cell { background: #fbfbfd; }
.row.sub .cell:first-child { padding-left: 46px; border-left-color: color-mix(in srgb, var(--gc) 35%, #fff); }
.row.sub .cell:first-child::before { content: "↳"; color: #c3c6d4; margin-right: 2px; }
.add-sub .cell:first-child { padding-left: 46px; border-left-color: color-mix(in srgb, var(--gc) 35%, #fff); }
.add-sub .c-rest { grid-column: 2 / -1; border-right: 0; }
.add-subitem { border: 1px solid transparent; padding: 4px 8px; font-size: 13px; }
.add-subitem:hover, .add-subitem:focus { border-color: var(--border); }
.sub-toggle {
  flex: none; display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; cursor: pointer;
  color: #c3c6d4; padding: 2px 4px; border-radius: 4px; font: inherit; font-size: 12px; opacity: 0;
}
.sub-toggle.has { opacity: 1; color: var(--muted); }
.row.item:hover .sub-toggle { opacity: 1; }
.sub-toggle:hover { background: #e6e9ef; }
.sub-toggle .caret { display: inline-block; font-size: 15px; transition: transform .15s; }
.row.item.open .sub-toggle .caret { transform: rotate(90deg); }
.sub-count { background: var(--hover); border-radius: 8px; padding: 0 5px; font-size: 11px; }
.ksubs { font-size: 12px; color: var(--muted); }

/* Dropdown, tags, dependency and formula cells */
.c-chips { justify-content: flex-start; gap: 4px; overflow: hidden; cursor: pointer; flex-wrap: nowrap; }
.chip-tag { display: inline-block; border-radius: 10px; padding: 1px 8px; font-size: 12px; white-space: nowrap; background: var(--hover); }
.chip-tag.hash { color: #343090; background: var(--primary-soft); }
.chip-tag.dep { border: 1px solid var(--line); background: #fff; }
.chip-tag.dep.done { text-decoration: line-through; color: var(--muted); }
.c-chips.blocked { box-shadow: inset 3px 0 0 var(--danger); }
.dep-flag { font-size: 12px; }
.dep-ok { color: var(--ok); font-weight: 700; }
.c-formula { color: #343090; font-weight: 500; cursor: default; }
.formula-error { color: var(--danger); }
.pop.dd-pop { width: 240px; }
.dd-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.dd-opt { padding: 4px 6px; border-radius: 4px; }
.dd-opt:hover { background: var(--hover); }
.pop.formula-pop { width: 380px; }
.formula-text { font-family: ui-monospace, Consolas, monospace; font-size: 13px; margin-bottom: 6px; }
.formula-cols { margin-bottom: 8px; }

/* Required columns */
.req { color: var(--danger); font-weight: 700; }
.row.item .cell.missing { box-shadow: inset 0 0 0 1px rgba(216, 58, 82, .55); }
.row.item .pill-cell.missing { box-shadow: inset 0 0 0 2px rgba(216, 58, 82, .7); }

/* Teams */
.team-card { display: flex; flex-direction: column; gap: 10px; margin-bottom: 0; }
.team-head { display: flex; align-items: center; gap: 8px; }
.team-head h3 { margin: 0; font-size: 16px; flex: 1; }
.team-dot { width: 12px; height: 12px; border-radius: 50%; }
.team-people { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.team-people .person-link { display: flex; align-items: center; gap: 6px; }
.team-card .btn { align-self: flex-start; }
.person-opt.team .avatar { border-radius: 6px; }
.people-section { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 6px 8px 2px; }

/* Inbox */
.inbox-page { max-width: 760px; }
.feed-item { display: block; color: var(--text); text-decoration: none !important; padding: 14px 18px; margin-bottom: 10px; }
.feed-item:hover { border-color: var(--border); box-shadow: 0 2px 8px rgba(0, 0, 0, .06); }
.feed-item header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.feed-item header time { margin-left: auto; white-space: nowrap; }
.feed-body { white-space: pre-wrap; word-break: break-word; margin: 0; }
.feed-quote { border-left: 3px solid var(--line); padding-left: 8px; margin-bottom: 6px; }

/* Undo message */
.undo-toast {
  position: fixed; left: 24px; bottom: 24px; z-index: 95; display: flex; align-items: center; gap: 10px;
  background: #323338; color: #fff; padding: 10px 12px 10px 16px; border-radius: 8px; box-shadow: var(--shadow);
}
.undo-btn { border: 0; background: none; color: #c9bcff; font: inherit; font-weight: 600; cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.undo-btn:hover { background: rgba(255, 255, 255, .12); }
.undo-x { color: #c3c6d4; }
body:has(.batch-bar:not([hidden])) .undo-toast { bottom: 90px; }

/* Templates */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-bottom: 10px; }
.tpl { display: flex; flex-direction: column; gap: 6px; margin-bottom: 0; }
.tpl h3 { margin: 0; font-size: 16px; }
.tpl-icon { font-size: 28px; }
.tpl-cols { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; align-content: flex-start; }
.tpl .btn { align-self: flex-start; }
.tpl-actions { display: flex; gap: 6px; align-items: center; }

/* Dashboard */
.dash-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 18px; }
.dash-filter .chip input { display: none; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; }
.tile-num { font-size: 32px; font-weight: 700; line-height: 1.1; color: var(--text); }
.tile-label { color: var(--muted); font-size: 13px; }
.tile.bad { border-left: 4px solid var(--danger); }
.tile.bad .tile-label { color: var(--danger); }
.tile.good { border-left: 4px solid var(--ok); }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dash-grid .card { margin-bottom: 0; }
.dash-h { font-size: 15px; margin-bottom: 14px; }
.pad-h { padding: 16px 18px 0; }
.sb-row { display: grid; grid-template-columns: 150px 1fr 70px; gap: 10px; align-items: center; margin-bottom: 10px; }
.sb-name { color: var(--text); font-size: 13px; }
.sb-bar { display: flex; gap: 2px; height: 20px; }
.sb-bar span { min-width: 4px; border-radius: 2px; }
.sb-bar span:first-child { border-radius: 4px 2px 2px 4px; }
.sb-bar span:last-child { border-radius: 2px 4px 4px 2px; }
.sb-pct { font-size: 12px; color: var(--muted); text-align: right; }
.dash-table summary { cursor: pointer; color: var(--primary); margin-top: 6px; }
.dash-table table { margin-top: 8px; }
.legend { display: flex; gap: 14px; color: var(--muted); margin-bottom: 10px; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }
.sw.open, .wl-bar { background: var(--primary); }
.sw.late, .wl-late { background: var(--danger); }
.wl-row { display: grid; grid-template-columns: 170px 1fr 90px; gap: 10px; align-items: center; margin-bottom: 8px; }
.wl-name { color: var(--text); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.wl-track { height: 16px; }
.wl-bar { height: 100%; border-radius: 0 4px 4px 0; display: flex; justify-content: flex-end; overflow: hidden; min-width: 4px; }
.wl-late { height: 100%; border-left: 2px solid #fff; }
.wl-num { font-size: 13px; font-variant-numeric: tabular-nums; }
.late-text { color: var(--danger); }
.chart-tip { position: absolute; z-index: 90; background: #323338; color: #fff; font-size: 12px; padding: 5px 9px; border-radius: 4px; pointer-events: none; white-space: nowrap; }
@media (max-width: 860px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .sb-row { grid-template-columns: 100px 1fr 60px; }
  .wl-row { grid-template-columns: 120px 1fr 70px; }
}

/* Import */
.import-page { max-width: 900px; }
.or { text-align: center; color: var(--muted); position: relative; }
.or::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line); }
.or span { background: #fff; padding: 0 10px; position: relative; }
.map-table td, .map-table th { white-space: normal; vertical-align: middle; }
.map-table select { min-width: 220px; }
.import-page .choice { margin: 14px 0 6px; }
.import-page .choice select { width: auto; margin-left: 6px; }

/* Automations */
.board-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.auto-page { max-width: 900px; }
.rule { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; padding: 14px 18px; margin-bottom: 10px; }
.rule.off { opacity: .55; }
.rule-text { font-size: 15px; }
.rule-when { font-weight: 600; color: #343090; }
.rule-then { font-weight: 600; }
.rule-meta { grid-column: 1; }
.rule-actions { grid-column: 2; grid-row: 1 / 3; display: flex; gap: 6px; align-items: center; }
.switch { width: 40px; height: 22px; border-radius: 11px; border: 0; background: #c5c7d0; position: relative; cursor: pointer; }
.switch span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on { background: var(--ok); }
.switch.on span { left: 21px; }
.rule-builder { border-style: dashed; }
.sentence { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.sentence select, .sentence input { width: auto; max-width: 100%; }
.sentence .then { font-weight: 600; }
.days-input { width: 70px !important; }
.name-input { width: 260px !important; }
.avatar.system { background: var(--primary); font-size: 16px; }

/* Search everything and favorites */
.top-search {
  flex: 0 1 420px; margin: 0 auto; display: flex; align-items: center; gap: 8px; background: #fff;
  border: 1px solid var(--line); border-radius: 18px; padding: 0 14px; height: 36px;
}
.top-search input { border: 0; padding: 0; box-shadow: none !important; height: 34px; }
.top-actions { margin-left: 0; }
.search-page { max-width: 860px; }
.search-big { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 0 14px; margin-bottom: 14px; }
.search-big input { border: 0; font-size: 17px; padding: 12px 0; box-shadow: none !important; }
.result { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none !important; }
.result:last-child { border-bottom: 0; }
.result:hover { background: var(--hover); }
.result .dot-color { margin-top: 6px; }
.result-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
mark { background: #fff1a8; color: inherit; border-radius: 2px; padding: 0 1px; }
.fav-star { border: 0; background: none; font-size: 22px; color: #c3c6d4; cursor: pointer; vertical-align: middle; padding: 0 4px; line-height: 1; }
.fav-star:hover { color: #ffcb00; }
.fav-star.on { color: #ffcb00; }
.fav-list { margin-bottom: 4px; }
.mobile-only { display: none; }
@media (max-width: 860px) {
  .mobile-only { display: block; }
  .top-search { display: none; }
  .top-actions { margin-left: auto; }
}

/* Group by: the groups are views, so no adding or dragging into them */
.groups-scroll.grouped .add-row, .groups-scroll.grouped .handle, .groups-scroll.grouped + .add-group-bottom { display: none; }
.board:has(.groups-scroll.grouped) #new-item-btn, .board:has(.groups-scroll.grouped) #new-group-btn { display: none; }

/* Timeline column */
.c-timeline { cursor: pointer; }
.tl-pill { background: var(--primary); color: #fff; border-radius: 12px; padding: 2px 10px; font-size: 12px; white-space: nowrap; }
.tl-empty { color: #c3c6d4; }
.pop.tl-pop { width: 300px; }
.tl-fields { display: flex; gap: 8px; }
.tl-fields label { flex: 1; font-size: 13px; }

/* Gantt view */
.gantt-hint { margin: -8px 0 12px; }
.gantt { --day: 30px; --name: 240px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.g-head { position: sticky; top: 0; z-index: 3; background: #fff; display: grid; grid-template-columns: var(--name) max-content; }
.g-name-head { position: sticky; left: 0; background: #fff; z-index: 2; padding: 6px 10px; font-weight: 500; border-right: 1px solid var(--line); }
.g-track { display: grid; grid-template-columns: repeat(var(--days), var(--day)); position: relative; }
.g-month { font-size: 12px; font-weight: 600; padding: 6px 6px 2px; border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.g-day { font-size: 11px; color: var(--muted); text-align: center; padding: 2px 0 6px; border-bottom: 1px solid var(--line); }
.g-day.weekend { background: #f7f7fa; }
.g-day.today { color: #fff; background: var(--danger); border-radius: 10px 10px 0 0; font-weight: 700; }
.g-group { border-top: 1px solid var(--line); }
.g-group-name { position: sticky; left: 0; padding: 10px; color: var(--gc); font-weight: 600; background: #fff; width: max-content; }
.g-row { display: grid; grid-template-columns: var(--name) max-content; min-height: 36px; }
.g-row:hover { background: var(--hover); }
.g-name {
  position: sticky; left: 0; z-index: 1; background: inherit; background-color: #fff; padding: 8px 10px;
  border-right: 1px solid var(--line); border-left: 4px solid var(--gc); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; cursor: pointer; font-size: 13px;
}
.g-row:hover .g-name { background-color: var(--hover); }
.g-row.sub .g-name { padding-left: 24px; color: var(--muted); }
.g-row .g-track { align-items: center; background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); background-size: var(--day) 100%; }
.g-bar {
  grid-row: 1; height: 24px; border-radius: 12px; background: var(--bar); color: #fff; font-size: 12px; font-weight: 500;
  display: flex; align-items: center; padding: 0 10px; overflow: hidden; white-space: nowrap; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}
.g-bar:hover { filter: brightness(.93); }
.g-today { grid-row: 1; justify-self: center; width: 2px; height: 100%; background: var(--danger); opacity: .5; }
.g-nodates { grid-column: 1 / span 6; grid-row: 1; padding-left: 8px; }

/* Calendar view */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-head h2 { min-width: 180px; text-align: center; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-wd { padding: 8px; font-size: 12px; font-weight: 600; color: var(--muted); background: #fafbfc; border-bottom: 1px solid var(--line); }
.cal-day { min-height: 110px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.other { background: #fafbfc; }
.cal-day.other .cal-num { color: #c3c6d4; }
.cal-num { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.cal-day.today .cal-num { background: var(--danger); color: #fff; border-radius: 10px; width: 22px; text-align: center; }
.cal-item {
  display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--bar); background: color-mix(in srgb, var(--bar) 14%, #fff);
  border-radius: 3px; padding: 2px 6px; font: inherit; font-size: 12px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-item.range { border-left-style: dashed; }
.cal-item:hover { background: color-mix(in srgb, var(--bar) 26%, #fff); }
.cal-more { padding-left: 6px; }
@media (max-width: 860px) {
  .cal-day { min-height: 70px; padding: 3px; }
  .cal-item { font-size: 10px; padding: 1px 3px; }
  .gantt { --name: 140px; }
}

/* Selecting rows (batch actions) */
.row-check { width: 15px; height: 15px; flex: none; margin: 0 2px 0 0; opacity: 0; cursor: pointer; }
.row.item:hover .row-check, .row-check:checked, body.selecting .row-check { opacity: 1; }
.row.item:has(.row-check:checked) .cell { background: var(--selected); }
.batch-bar {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 55;
  display: flex; align-items: center; gap: 4px; padding: 8px 10px; background: #fff;
  border-radius: 12px; box-shadow: 0 8px 28px rgba(0, 0, 0, .2); max-width: calc(100vw - 32px); flex-wrap: wrap;
}
.batch-count { padding: 0 12px 0 6px; border-right: 1px solid var(--line); margin-right: 4px; white-space: nowrap; }
.batch-count strong { color: var(--primary); }
.pop.move-pop { width: 280px; }
.move-pop label { display: block; margin-bottom: 8px; }
.move-groups { max-height: 260px; overflow-y: auto; }
.dup-board-btn { margin-top: 6px; border: 1px solid var(--border) !important; justify-content: center; }

/* Item panel: description, threads, mentions */
.description { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 16px; }
.desc-head { display: flex; justify-content: space-between; margin-bottom: 6px; }
.desc-text { border: 0; padding: 4px 0; box-shadow: none !important; min-height: 44px; }
.thread { margin-bottom: 14px; }
.thread .update { margin-bottom: 6px; }
.update.reply { margin-left: 28px; background: #fbfbfd; }
.reply-btn { margin-left: 28px; font-size: 13px; }
.reply-form { margin: 6px 0 0 28px; }
.update-form .actions { align-items: center; }
.update-form .actions .muted { margin-right: auto; }
.mention { background: var(--primary-soft); color: #343090; border-radius: 4px; padding: 0 3px; font-weight: 500; }
.pop.mention-pop { width: 240px; padding: 6px; z-index: 80; }
.dot-color { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }

/* ---------------------------------------------------------------- people directory and invitations */
tr.clickable { cursor: pointer; }
.section-title { font-size: 16px; margin: 28px 0 10px; }
.row-actions { text-align: right; }
.row-actions form { display: inline-flex; gap: 6px; margin-left: 6px; }
.invite-links { border-color: var(--primary); background: var(--primary-soft); }
.invite-link-row { display: grid; grid-template-columns: 220px 1fr auto; gap: 8px; align-items: center; margin-top: 8px; }
.invite-link-row input { font-size: 12px; padding: 6px 8px; }
.invite-box { display: flex; gap: 8px; align-items: flex-start; margin-top: 6px; }
.invite-box textarea { flex: 1; }
.invite-box select { width: 120px; }
@media (max-width: 860px) {
  .invite-link-row { grid-template-columns: 1fr auto; }
  .invite-link-row span { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------- profile settings area */
.profile-shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 32px; max-width: 1180px; }
.profile-shell.solo { grid-template-columns: minmax(0, 1fr); max-width: 1040px; }
.profile-nav { position: sticky; top: calc(var(--topbar) + 12px); align-self: start; display: flex; flex-direction: column; gap: 2px; }
.profile-main > h1 { margin-bottom: 6px; }
.profile-main > p.muted { margin-bottom: 18px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.narrow-form { max-width: 460px; }
.profile-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Working status: a small round icon on the corner of a picture. */
.avatar-wrap { position: relative; display: inline-flex; flex: none; vertical-align: middle; }
summary.avatar-wrap { cursor: pointer; list-style: none; }
summary.avatar-wrap::-webkit-details-marker { display: none; }
.status-dot {
  display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid #fff; font-size: 9px; line-height: 1; flex: none;
}
.avatar-wrap > .status-dot { position: absolute; right: -4px; bottom: -3px; }
.status-dot.sm { width: 14px; height: 14px; font-size: 7px; border-width: 1.5px; right: -3px; bottom: -2px; }
.status-dot.xl { width: 38px; height: 38px; font-size: 18px; border-width: 4px; right: 2px; bottom: 2px; }
.status-tag { background: var(--hover); color: var(--text) !important; text-decoration: none !important; }
a.status-tag[href]:hover { background: var(--selected); }
.status-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 18px; }
.status-opt { display: flex; align-items: center; gap: 10px; font-weight: 400; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.status-opt:hover { background: var(--hover); }
.status-opt:has(input:checked) { background: var(--selected); }
.status-opt .status-dot { width: 26px; height: 26px; font-size: 13px; border: 0; }
.until { max-width: 280px; }

/* Schedule */
.day-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.day-chip input { position: absolute; opacity: 0; pointer-events: none; }
.day-chip span {
  display: inline-block; padding: 8px 14px; border-radius: 20px; border: 1px solid var(--border);
  cursor: pointer; font-weight: 500; user-select: none;
}
.day-chip input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.day-chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.hours { display: flex; gap: 16px; flex-wrap: wrap; }
.hours label { width: 160px; }
.mini-week { display: flex; gap: 4px; margin-bottom: 10px; }
.mini-week span { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; background: var(--hover); color: var(--muted); }
.mini-week span.on { background: var(--primary); color: #fff; font-weight: 600; }

/* Notifications table */
.notif-table td, .notif-table th { white-space: normal; }
.notif-table th.ch, .notif-table td.ch { text-align: center; width: 130px; }
.notif-table .ev { display: flex; gap: 12px; align-items: flex-start; }
.ev-ico { width: 22px; text-align: center; font-size: 16px; }
.notif-table input[type="checkbox"] { width: 18px; height: 18px; }
.pad-actions { padding: 14px 18px; }
.small-btn { height: 30px; padding: 0 12px; font-size: 13px; }

/* ---------------------------------------------------------------- phones and small screens */
@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); background: #fff; }
  body.nav-open .sidebar { transform: none; }
  .content { margin-left: 0; border-radius: 0; padding: 16px 16px 60px; }
  .toolbar #new-group-btn { margin-left: 0; }
  .search-box input { width: 120px; }
  .danger-zone { flex-direction: column; align-items: flex-start; }
  .panel-head, .panel-body { padding-left: 16px; padding-right: 16px; }
  .handle { display: none; }
  .profile-hero { flex-direction: column; align-items: flex-start; padding: 20px; }
  .avatar.xl { width: 96px; height: 96px; font-size: 34px; }
  .hero-actions { flex-direction: row; flex-wrap: wrap; }
  .hero-fields { max-width: none; width: 100%; }
  .profile-grid, .profile-grid.three { grid-template-columns: 1fr; }
  .profile-shell { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .profile-nav { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .profile-nav .side-link { white-space: nowrap; flex: none; }
  .notif-table th.ch, .notif-table td.ch { width: 70px; }
  .grid { --first: 200px; }
  .mywork .grid { min-width: 720px; }
  .mywork .row { grid-template-columns: 200px 150px 130px 110px 120px; }
  .mywork.with-owner .grid { min-width: 840px; }
  .mywork.with-owner .row { grid-template-columns: 200px 150px 110px 130px 110px 120px; }
  .row-menu, .group-menu { opacity: 1; }
}

/* "by mark-iT-ing" under the Markday wordmark, in plain black. */
.brand-text { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.by { margin-top: 2px; font-size: 12px; font-weight: 500; color: #000; }
.brand.big .brand-text { align-items: center; }
.brand.big .by { font-size: 14px; margin-top: 8px; }
