:root {
  color-scheme: dark;
  --bg: #08080b;
  --bg-soft: #101015;
  --panel: #17171d;
  --panel-soft: #202029;
  --panel-lift: #2c2b36;
  --ink: #f7f5fa;
  --muted: #aaa5b8;
  --line: #363541;
  --line-soft: rgba(255, 255, 255, 0.08);
  --accent: #a65fb0;
  --accent-strong: #8160b3;
  --accent-soft: rgba(166, 95, 176, 0.18);
  --accent-glow: rgba(166, 95, 176, 0.32);
  --coral: #a65fb0;
  --gold: #8160b3;
  --blue: #8160b3;
  --danger: #e07171;
  --good: #4fbf9f;
  --warn: #d5a24c;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(166, 95, 176, 0.08), transparent 260px),
    radial-gradient(circle at top right, rgba(79, 191, 159, 0.08), transparent 320px),
    var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  display: grid;
  grid-template-columns: 284px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, #050507 0%, #0e0d12 100%);
  color: var(--ink);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 100vh;
  border-right: 1px solid var(--line-soft);
}

.brand-block {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(166, 95, 176, 0.55);
  background: linear-gradient(145deg, rgba(166, 95, 176, 0.28), rgba(129, 96, 179, 0.16));
  border-radius: 8px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.sidebar .eyebrow {
  color: #c7b1d0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.brand-block h1 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.2;
}

.sidebar-actions {
  display: grid;
  gap: 10px;
}

.workspace-switcher {
  border-color: rgba(166, 95, 176, 0.42);
  background: rgba(166, 95, 176, 0.12);
  color: var(--ink);
  font-weight: 800;
}

.primary-button,
.ghost-button,
.plain-button,
.tab,
.icon-button,
.inline-form button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  min-height: 38px;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-weight: 750;
  padding: 0 16px;
  box-shadow: 0 10px 22px rgba(129, 96, 179, 0.24);
}

.primary-button:hover {
  background: var(--accent-strong);
}

.ghost-button {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  text-decoration: none;
  padding: 0 14px;
  font-weight: 700;
}

.sidebar .ghost-button {
  color: var(--ink);
  border-color: rgba(166, 95, 176, 0.42);
  background: rgba(166, 95, 176, 0.12);
}

.plain-button {
  color: var(--muted);
  background: transparent;
  padding: 0 8px;
}

.topbar-asset-link {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

.plain-button:hover {
  color: var(--ink);
  background: var(--panel-soft);
}

.board-list {
  display: grid;
  gap: 8px;
}

.board-nav-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  padding: 10px;
}

.board-nav-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
}

.board-nav-main {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  padding: 0;
  cursor: pointer;
}

.board-admin-actions {
  display: flex;
  gap: 4px;
  opacity: 0.82;
}

.board-admin-button {
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 0 7px;
  font-size: 0.68rem;
  font-weight: 850;
  cursor: pointer;
}

.board-admin-button:hover {
  color: var(--ink);
  border-color: rgba(166, 95, 176, 0.52);
}

.board-admin-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.action-menu {
  position: relative;
  display: inline-block;
}

.action-menu summary {
  width: 28px;
  min-height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  list-style: none;
}

.action-menu summary::-webkit-details-marker {
  display: none;
}

.action-menu summary:hover,
.action-menu[open] summary {
  color: var(--ink);
  background: var(--panel-soft);
  border-color: rgba(166, 95, 176, 0.42);
}

.action-menu-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 5px);
  z-index: 40;
  min-width: 112px;
  display: none;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #202029;
  box-shadow: var(--shadow-soft);
}

.action-menu[open] .action-menu-popover {
  display: grid;
  gap: 4px;
}

.action-menu-popover button {
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  padding: 0 8px;
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
}

.action-menu-popover button:hover {
  background: var(--accent-soft);
}

.action-menu-popover button:disabled {
  cursor: not-allowed;
  color: var(--muted);
  opacity: 0.55;
}

.board-nav-item.is-active,
.board-nav-item:hover {
  background: var(--accent-soft);
  border-color: rgba(166, 95, 176, 0.5);
}

.board-nav-title {
  display: block;
  font-weight: 800;
  margin-bottom: 3px;
}

.board-nav-meta {
  color: #c7b1d0;
  font-size: 0.78rem;
}

.member-strip {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.avatar {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  border: 2px solid rgba(244, 244, 247, 0.7);
}

.avatar-photo {
  overflow: hidden;
  background: var(--panel-lift);
}

.avatar-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 28px 16px;
  background: rgba(18, 18, 24, 0.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.board-heading {
  min-width: 0;
}

.board-heading h2 {
  margin: 0 0 5px;
  font-size: clamp(1.45rem, 2vw, 2.2rem);
  line-height: 1.05;
}

.board-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel-soft);
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: capitalize;
  cursor: pointer;
}

.mini-profile-avatar {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 900;
}

.role-dot {
  color: var(--ink);
}

.control-band {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
  padding: 14px 28px;
  background: rgba(18, 18, 24, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 83px;
  z-index: 19;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  overflow: visible;
}

.tab {
  display: inline-grid;
  place-items: center;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  text-decoration: none;
  white-space: nowrap;
}

.tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 8px 18px rgba(129, 96, 179, 0.24);
}

.filters {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(150px, 180px) minmax(150px, 180px);
  gap: 8px;
  width: min(100%, 560px);
  justify-self: end;
  order: -1;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #17171d;
  min-height: 38px;
  padding: 8px 10px;
}

select {
  color-scheme: dark;
}

option,
optgroup {
  color: var(--ink);
  background: #202029;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.status-line {
  min-height: 37px;
  padding: 10px 28px 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.view-host {
  min-height: 0;
  flex: 1;
  padding: 14px 28px 28px;
  overflow: auto;
}

.board-view {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  align-items: stretch;
  min-height: 68vh;
}

.list-column {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-top: 3px solid var(--list-accent, var(--accent));
  border-radius: 8px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 220px;
  max-height: calc(100vh - 230px);
  box-shadow: var(--shadow-soft);
}

.list-column[draggable="true"] {
  cursor: grab;
}

.list-column.is-dragging-list {
  opacity: 0.62;
}

.list-column.is-list-drag-over {
  border-color: rgba(166, 95, 176, 0.72);
  box-shadow: inset 0 0 0 1px rgba(166, 95, 176, 0.28), var(--shadow-soft);
}

.list-column.is-locked {
  border-color: rgba(166, 95, 176, 0.28);
  opacity: 0.86;
}

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
}

.list-head h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.list-color-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--list-accent, var(--accent));
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.list-head-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.list-admin-actions {
  display: flex;
  gap: 4px;
}

.list-admin-button {
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 0 7px;
  font-size: 0.68rem;
  font-weight: 850;
  cursor: pointer;
}

.list-admin-button:hover {
  color: var(--ink);
  border-color: rgba(166, 95, 176, 0.52);
}

.list-admin-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.list-add-column {
  min-height: 120px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.025);
  border-style: dashed;
}

.add-list-board-button {
  width: calc(100% - 24px);
  min-height: 42px;
  border: 1px dashed rgba(166, 95, 176, 0.58);
  border-radius: 8px;
  background: rgba(166, 95, 176, 0.1);
  color: var(--ink);
  font-weight: 850;
  cursor: pointer;
}

.count-pill {
  min-width: 28px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 800;
  font-size: 0.74rem;
}

.card-stack {
  overflow-y: auto;
  padding: 0 10px 10px;
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 120px;
}

.task-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.028));
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.26);
  cursor: grab;
}

.task-card:focus,
.task-card:hover {
  outline: 2px solid rgba(166, 95, 176, 0.32);
}

.task-card h4 {
  margin: 8px 0;
  line-height: 1.25;
  font-size: 0.96rem;
}

.task-title-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 0;
}

.task-title-line h4 {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.task-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.task-status-icon {
  position: relative;
  width: 14px;
  height: 14px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
}

.status-completed {
  background: rgba(78, 159, 143, 0.18);
  color: #8ef1c5;
}

.status-completed .task-status-icon {
  background: #2fa36f;
}

.status-completed .task-status-icon::before {
  content: "";
  width: 7px;
  height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

.status-in-progress {
  background: rgba(63, 131, 204, 0.18);
  color: #add0ff;
}

.status-in-progress .task-status-icon {
  border: 2px solid #4d9be8;
}

.status-in-progress .task-status-icon::before,
.status-in-progress .task-status-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: #add0ff;
  transform-origin: left center;
}

.status-in-progress .task-status-icon::before {
  width: 2px;
  height: 5px;
  transform: translate(-50%, -100%);
}

.status-in-progress .task-status-icon::after {
  width: 5px;
  height: 2px;
  transform: translateY(-50%) rotate(35deg);
}

.status-overdue {
  background: rgba(217, 154, 61, 0.18);
  color: #ffd08a;
}

.status-overdue .task-status-icon {
  background: #d99a3d;
  color: #1b1308;
}

.status-overdue .task-status-icon::before {
  content: "!";
  font-size: 0.72rem;
  font-weight: 1000;
  line-height: 1;
}

.label-row,
.card-meta,
.avatar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.label-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  max-width: 100%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.label-chip.has-text {
  min-height: 20px;
  padding: 0 8px;
}

.label-chip.is-color-only {
  width: 38px;
  min-width: 38px;
  height: 10px;
  min-height: 10px;
  padding: 0;
  color: transparent;
}

.card-meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.76rem;
}

.priority {
  font-weight: 850;
}

.priority.High {
  color: var(--danger);
}

.priority.Medium {
  color: var(--gold);
}

.priority.Low {
  color: var(--accent);
}

.score-badge {
  display: inline-grid;
  place-items: center;
  min-width: 46px;
  min-height: 22px;
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(166, 95, 176, 0.22);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
}

.score-badge.early {
  background: rgba(166, 95, 176, 0.34);
}

.score-badge.on-time {
  background: rgba(129, 96, 179, 0.3);
}

.score-badge.late {
  background: rgba(110, 110, 120, 0.38);
}

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

.list-foot {
  padding: 0 10px 10px;
}

.locked-note {
  display: grid;
  place-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
}

.add-card-button {
  width: 100%;
  background: var(--panel);
  color: var(--muted);
  border: 1px dashed #595964;
  border-radius: 8px;
  min-height: 38px;
  cursor: pointer;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.data-table th,
.data-table td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0;
  background: rgba(255, 255, 255, 0.055);
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.table-title {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.calendar-year-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.calendar-year-head h3 {
  margin: 0;
  font-size: 1.55rem;
}

.calendar-toolbar-actions {
  display: flex;
  gap: 8px;
}

.calendar-nav-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
}

.calendar-nav-button:hover {
  border-color: rgba(166, 95, 176, 0.72);
  color: var(--accent);
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 14px;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  display: inline-block;
  border-radius: 3px;
}

.legend-swatch.friday {
  background: rgba(166, 95, 176, 0.22);
}

.legend-swatch.govt {
  background: rgba(129, 96, 179, 0.38);
}

.calendar-month {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.calendar-month-single {
  min-width: 0;
}

.calendar-month-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.calendar-month-head h3 {
  margin: 0;
  font-size: 1rem;
}

.calendar-month-head span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
}

.calendar-weekdays span {
  padding: 7px 4px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.calendar-day {
  min-height: 118px;
  background: rgba(18, 18, 24, 0.94);
  padding: 6px;
  min-width: 0;
  overflow: hidden;
}

.calendar-day.is-muted {
  background: #111117;
  color: #7d7d88;
}

.calendar-day.is-friday {
  background: rgba(166, 95, 176, 0.12);
}

.calendar-day.is-holiday {
  box-shadow: inset 0 0 0 1px rgba(129, 96, 179, 0.42);
}

.calendar-day.is-today {
  background: linear-gradient(180deg, rgba(79, 191, 159, 0.16), rgba(18, 18, 24, 0.96));
  box-shadow: inset 0 0 0 2px rgba(79, 191, 159, 0.66);
}

.calendar-day.is-calendar-drag-over {
  background: rgba(166, 95, 176, 0.18);
  box-shadow: inset 0 0 0 2px rgba(166, 95, 176, 0.72);
}

.day-number {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  font-weight: 850;
  margin-bottom: 5px;
  font-size: 0.74rem;
}

.holiday-dot {
  color: var(--accent);
  font-size: 0.58rem;
  font-weight: 900;
}

.today-dot {
  color: #8ee6cf;
  font-size: 0.58rem;
  font-weight: 950;
}

.holiday-label {
  margin-bottom: 5px;
  border-radius: 5px;
  background: rgba(129, 96, 179, 0.24);
  color: #eee8f4;
  padding: 3px 4px;
  font-size: 0.58rem;
  font-weight: 850;
  line-height: 1.15;
}

.mini-card {
  position: relative;
  overflow: hidden;
  border-left: 3px solid var(--task-label-accent, var(--accent));
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 5px;
  margin-bottom: 5px;
  font-size: 0.68rem;
  cursor: pointer;
}

.mini-card[draggable="true"] {
  cursor: grab;
}

.mini-card.is-calendar-dragging {
  opacity: 0.55;
}

.mini-card-label-strip {
  height: 4px;
  margin: -5px -5px 5px;
  background: var(--task-label-strip, var(--task-label-accent, var(--accent)));
}

.mini-card-title {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.mini-card-title > span:last-child {
  flex: 1;
  min-width: 0;
}

.mini-card .task-status-badge {
  min-height: 18px;
  padding: 0;
  background: transparent;
}

.mini-card .task-status-badge > span:not(.task-status-icon) {
  display: none;
}

.calendar-card-assignees {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 5px;
}

.mini-assignee {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 0.52rem;
  font-weight: 900;
}

.timeline-view {
  display: grid;
  gap: 12px;
}

.timeline-scale {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 12px;
  align-items: stretch;
}

.timeline-axis {
  min-height: 42px;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.timeline-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  transform: translateX(-1px);
}

.timeline-tick i,
.timeline-gridline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(244, 244, 247, 0.14);
}

.timeline-tick b {
  position: absolute;
  top: 8px;
  left: 6px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  white-space: nowrap;
}

.timeline-tick:last-child b {
  left: auto;
  right: 6px;
}

.timeline-row {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  align-items: center;
  gap: 12px;
}

.timeline-title {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font-weight: 800;
}

.timeline-title strong,
.timeline-title span {
  display: block;
}

.timeline-title span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.timeline-track {
  min-height: 54px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.timeline-gridline {
  z-index: 0;
}

.timeline-bar {
  position: absolute;
  top: 8px;
  bottom: 8px;
  min-width: 24px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 0 10px;
  font-size: 0.75rem;
  font-weight: 800;
  overflow: hidden;
  white-space: nowrap;
  z-index: 1;
}

.timeline-bar small {
  margin-top: 2px;
  font-size: 0.62rem;
  font-weight: 750;
  opacity: 0.9;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
}

.attendance-view {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
  width: 100%;
}

.attendance-panel {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
}

.attendance-report-panel {
  grid-template-columns: minmax(240px, 0.8fr) minmax(320px, 1.2fr);
  align-items: end;
}

.attendance-report-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  align-items: end;
}

.attendance-filter-controls {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.attendance-filter-controls input[type="datetime-local"] {
  min-width: 0;
  font-size: 0.82rem;
}

.attendance-filter-controls .primary-button {
  min-height: 42px;
  white-space: normal;
  line-height: 1.15;
}

.attendance-table-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.attendance-table-scroll {
  width: 100%;
  overflow: auto;
  max-height: min(760px, 72vh);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.attendance-table {
  width: 100%;
  min-width: 1120px;
  border: 0;
  border-radius: 0;
}

.attendance-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.attendance-review-cell {
  display: grid;
  gap: 7px;
  min-width: 230px;
}

.attendance-review-cell select,
.attendance-review-cell textarea {
  width: 100%;
}

.attendance-review-cell textarea {
  min-height: 48px;
  resize: vertical;
}

.attendance-review-readonly {
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.attendance-review-readonly p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.panel-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.compact-table th,
.compact-table td {
  padding: 9px 10px;
  font-size: 0.78rem;
}

.attendance-pill {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 850;
  white-space: nowrap;
}

.attendance-pill.good {
  background: rgba(129, 96, 179, 0.3);
}

.attendance-pill.warn {
  background: rgba(166, 95, 176, 0.24);
}

.attendance-pill.late {
  background: rgba(216, 90, 90, 0.2);
  color: #ffb7b7;
}

.attendance-pill.overtime {
  background: rgba(166, 95, 176, 0.3);
}

.attendance-pill.corrected {
  background: rgba(78, 159, 143, 0.28);
}

.attendance-pill.reviewed {
  background: rgba(78, 159, 143, 0.28);
}

.member-management {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 440px);
  gap: 14px;
  align-items: start;
}

.activity-view,
.automation-view {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 14px;
  align-items: start;
}

.activity-feed {
  grid-column: 1 / -1;
}

.activity-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.activity-item.is-automated {
  border-color: rgba(129, 96, 179, 0.5);
}

.activity-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.activity-line strong {
  font-size: 0.82rem;
}

.activity-line span,
.activity-item > div > span {
  color: var(--muted);
  font-size: 0.72rem;
}

.activity-item p {
  margin: 5px 0 0;
  font-size: 0.86rem;
}

.activity-badge {
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(129, 96, 179, 0.24);
  color: var(--ink) !important;
  font-weight: 850;
}

.activity-card-link {
  display: block;
  margin-top: 7px;
  color: var(--accent);
}

.empty-note {
  margin: 0;
  color: var(--muted);
}

.automation-list,
.automation-form {
  display: grid;
  gap: 12px;
}

.automation-rule {
  display: grid;
  grid-template-columns: 1fr 28px;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.automation-rule.is-disabled {
  opacity: 0.62;
}

.automation-toggle {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
}

.automation-toggle input {
  width: 18px;
  min-height: 18px;
}

.automation-toggle strong,
.automation-toggle em {
  display: block;
}

.automation-toggle em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.76rem;
  margin-top: 3px;
}

.automation-rule p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.member-admin-list,
.member-create-form,
.label-admin-list {
  display: grid;
  gap: 12px;
}

.label-admin-row {
  display: grid;
  grid-template-columns: 52px minmax(90px, 0.7fr) minmax(140px, 1fr) 58px minmax(140px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.label-admin-row > span:not(.label-chip) {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.label-preview-chip.is-color-only {
  height: 14px;
}

.label-admin-row input[type="color"] {
  width: 48px;
  min-width: 48px;
  min-height: 38px;
  padding: 2px;
}

.member-admin-card {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.member-admin-card.is-selected {
  border-color: rgba(166, 95, 176, 0.72);
  box-shadow: inset 0 0 0 1px rgba(166, 95, 176, 0.26);
}

.member-admin-card strong,
.member-admin-card span {
  display: block;
}

.member-admin-card span {
  color: var(--muted);
  margin-top: 3px;
  font-size: 0.8rem;
}

.member-edit-button {
  width: fit-content;
  min-height: 32px;
  margin-top: 9px;
  font-size: 0.76rem;
}

.metric-card,
.chart-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.metric-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
  line-height: 1;
}

.chart-panel {
  grid-column: span 2;
  display: grid;
  gap: 12px;
}

.member-management .chart-panel {
  grid-column: auto;
}

.member-management .chart-panel:first-child {
  grid-row: span 2;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 160px) 1fr 34px;
  gap: 10px;
  align-items: center;
}

.score-row {
  display: grid;
  grid-template-columns: 32px minmax(130px, 1fr) minmax(110px, 0.8fr) 48px;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.score-row strong,
.score-row span {
  display: block;
}

.score-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.score-row b {
  text-align: right;
  font-size: 0.86rem;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: var(--panel-soft);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--accent);
}

.login-overlay,
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
}

.login-overlay {
  z-index: 120;
  background:
    linear-gradient(180deg, rgba(166, 95, 176, 0.1), transparent 300px),
    radial-gradient(circle at top right, rgba(79, 191, 159, 0.08), transparent 320px),
    var(--bg);
}

.modal-backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.login-panel {
  width: min(420px, 100%);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
  display: grid;
  gap: 14px;
}

.profile-editor {
  width: min(520px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.profile-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.profile-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.profile-avatar {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
}

.profile-preview strong,
.profile-preview span {
  display: block;
}

.profile-preview span {
  color: var(--muted);
  margin-top: 3px;
  font-size: 0.82rem;
}

.login-panel h1 {
  margin-bottom: 0;
}

.login-error {
  min-height: 20px;
  color: var(--danger);
  margin: 0;
}

.card-editor {
  width: min(1040px, 100%);
  max-height: min(850px, calc(100vh - 36px));
  overflow: auto;
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 18px;
  background: rgba(23, 23, 30, 0.96);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.title-input {
  min-height: 44px;
  font-size: 1.25rem;
  font-weight: 850;
}

.icon-button {
  background: var(--panel-soft);
  color: var(--ink);
  font-weight: 850;
}

.close-modal-button {
  padding: 0 14px;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  padding: 18px;
}

.editor-main,
.editor-side {
  display: grid;
  gap: 16px;
  align-content: start;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.custom-fields {
  display: grid;
  gap: 10px;
}

.choice-list {
  display: grid;
  gap: 8px;
}

.choice {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  font-weight: 700;
}

.choice input {
  width: 18px;
  min-height: 18px;
}

.delivery-score-card {
  display: grid;
  gap: 5px;
  min-height: 74px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.delivery-score-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.delivery-score-number {
  color: var(--ink);
  font-size: 1.42rem;
  line-height: 1;
}

.checklist,
.comments {
  display: grid;
  gap: 8px;
}

.check-item,
.comment {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 9px;
  align-items: start;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
}

.check-item {
  display: grid;
  grid-template-columns: 20px 1fr 28px;
  gap: 8px;
  align-items: center;
}

.check-item input {
  width: 18px;
  min-height: 18px;
}

.remove-mini {
  min-width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: var(--panel);
  color: var(--danger);
  cursor: pointer;
}

.comment strong {
  display: block;
  font-size: 0.8rem;
}

.comment span {
  color: var(--muted);
  font-size: 0.72rem;
}

.comment p {
  margin: 5px 0 0;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.comment-form {
  display: grid;
  gap: 8px;
}

.comment-form input[type="file"] {
  min-height: 36px;
  font-size: 0.76rem;
}

.inline-form button {
  padding: 0 12px;
  background: var(--accent-strong);
  color: #fff;
}

.comment-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.comment-attachment {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  color: var(--ink);
  background: var(--panel);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 750;
}

.comment-attachment img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
}

.attachment-icon {
  display: grid;
  place-items: center;
  min-height: 54px;
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--accent);
  font-weight: 900;
}

.assistant-view {
  display: grid;
  grid-template-columns: minmax(320px, 0.86fr) minmax(360px, 1.14fr);
  gap: 14px;
  align-items: start;
}

.assistant-input-panel,
.assistant-drafts,
.assistant-draft-form {
  display: grid;
  gap: 14px;
}

.assistant-input-panel {
  grid-column: auto;
  position: sticky;
  top: 0;
}

.assistant-panel-head,
.assistant-draft-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.assistant-panel-head h3,
.assistant-draft-head strong {
  margin: 0;
}

.assistant-actions {
  display: grid;
  grid-template-columns: minmax(108px, 132px) auto auto auto;
  gap: 8px;
  align-items: center;
}

.assistant-actions .plain-button {
  min-height: 38px;
}

.assistant-drafts {
  min-width: 0;
}

.assistant-draft-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.assistant-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.assistant-choice-grid h3 {
  margin-bottom: 8px;
  font-size: 0.86rem;
}

.assistant-empty {
  min-height: 160px;
  align-content: start;
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: static;
    padding: 14px;
  }

  .member-strip {
    margin-top: 0;
  }

  .topbar,
  .control-band {
    flex-direction: column;
    align-items: stretch;
    position: static;
  }

  .filters {
    min-width: 0;
    width: 100%;
    justify-self: stretch;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .filters > * {
    min-width: 0;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .activity-view,
  .automation-view,
  .assistant-view {
    grid-template-columns: 1fr;
  }

  .attendance-report-panel,
  .attendance-report-controls {
    grid-template-columns: 1fr;
  }

  .assistant-input-panel {
    position: static;
  }

  .member-management {
    grid-template-columns: 1fr;
  }

  .label-admin-row {
    grid-template-columns: 52px minmax(120px, 1fr) 58px;
  }

  .label-admin-row input[data-label-name],
  .label-admin-row input[data-label-text] {
    grid-column: 1 / -1;
  }

  .editor-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-shell,
  .sidebar,
  .main {
    min-width: 0;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .sidebar {
    gap: 12px;
  }

  .brand-block {
    align-items: flex-start;
  }

  .brand-block h1 {
    font-size: 1.04rem;
  }

  .board-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .board-nav-item {
    flex: 0 0 min(230px, 82vw);
  }

  .member-strip {
    max-height: 38px;
    overflow: hidden;
  }

  .topbar,
  .control-band,
  .view-host,
  .status-line {
    padding-left: 14px;
    padding-right: 14px;
    width: 100vw;
    max-width: 100vw;
    min-width: 0;
  }

  .topbar {
    gap: 12px;
  }

  .board-heading h2 {
    font-size: 1.48rem;
  }

  .topbar-actions {
    justify-content: flex-start;
    gap: 6px;
  }

  .user-badge {
    max-width: 100%;
  }

  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: -14px;
    padding-inline: 14px;
    padding-bottom: 4px;
    width: 100vw;
    max-width: 100vw;
    -webkit-overflow-scrolling: touch;
  }

  .tab {
    flex: 0 0 auto;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .board-view {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .list-column {
    max-height: none;
  }

  .calendar-year-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .calendar-toolbar-actions {
    width: 100%;
  }

  .calendar-nav-button {
    flex: 1;
  }

  .calendar-legend {
    gap: 8px;
  }

  .calendar-weekdays {
    display: none;
  }

  .calendar-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    background: transparent;
    padding: 8px;
  }

  .calendar-day {
    min-height: 72px;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .calendar-day.is-muted {
    display: none;
  }

  .day-number {
    font-size: 0.84rem;
  }

  .mini-card {
    padding: 8px;
    font-size: 0.78rem;
  }

  .calendar-card-assignees {
    margin-top: 8px;
  }

  .timeline-row,
  .score-row,
  .field-row,
  .assistant-choice-grid,
  .assistant-actions {
    grid-template-columns: 1fr;
  }

  .score-row b {
    text-align: left;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .chart-panel {
    grid-column: auto;
  }

  .data-table {
    min-width: 680px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .attendance-panel,
  .chart-panel {
    overflow-x: auto;
  }

  .attendance-report-controls {
    grid-template-columns: 1fr;
  }

  .attendance-report-controls label,
  .attendance-report-controls .primary-button {
    min-width: 0;
    width: 100%;
  }

  .attendance-table {
    min-width: 1120px;
  }

  .attendance-table-scroll {
    max-height: 70vh;
  }

  .modal-panel {
    width: min(100%, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
  }

  .modal-backdrop {
    align-items: start;
    padding: 8px;
    overflow: auto;
  }

  .card-editor,
  .profile-editor,
  .login-panel {
    width: 100%;
  }

  .card-editor {
    max-height: calc(100vh - 16px);
  }
}
