:root {
  --bg: #f7f8f4;
  --surface: #ffffff;
  --surface-soft: #eef5ef;
  --ink: #1d2528;
  --muted: #637174;
  --line: #d8ded9;
  --teal: #176b63;
  --teal-dark: #104d48;
  --blue: #2c5f9e;
  --amber: #b56a1d;
  --red: #b73b3b;
  --green: #277348;
  --shadow: 0 14px 36px rgba(35, 50, 45, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #edf2ee;
}

.auth-panel {
  width: min(100%, 420px);
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.auth-panel h2,
.auth-panel p {
  margin-top: 0;
}

.auth-brand {
  margin-bottom: 4px;
}

.auth-message {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 0.86rem;
}

.auth-message[data-tone="success"] {
  color: var(--green);
}

.auth-message[data-tone="info"] {
  color: var(--blue);
}

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

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

.sidebar {
  border-right: 1px solid var(--line);
  background: #fbfcf8;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 8px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--teal);
  color: white;
  font-weight: 800;
}

.brand h1,
.topbar h2,
.panel h3,
.advance-box h4 {
  margin: 0;
}

.brand h1 {
  font-size: 1.12rem;
}

.brand p,
.subtle {
  color: var(--muted);
}

.brand p {
  margin: 3px 0 0;
  font-size: 0.86rem;
}

.field-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.control,
.text-input,
.text-area {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 11px;
}

.text-area {
  min-height: 88px;
  resize: vertical;
}

.control:disabled,
.text-input:disabled,
.text-area:disabled {
  background: #f1f2ef;
  color: #7b8587;
}

.sidebar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.button {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 700;
  min-height: 42px;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button.primary {
  background: var(--teal);
  color: white;
}

.button.primary:hover:not(:disabled) {
  background: var(--teal-dark);
}

.button.secondary,
.button.ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.button.secondary.active {
  border-color: var(--teal);
  color: var(--teal-dark);
  background: var(--surface-soft);
}

.button.danger {
  background: #fff5f3;
  color: var(--red);
  border-color: #e6c4bf;
}

.stage-nav {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.stage-button {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
  cursor: pointer;
}

.stage-button.active {
  border-color: var(--teal);
  background: var(--surface-soft);
}

.stage-button.complete-state {
  border-color: #b8ddc4;
  background: #edf8f0;
}

.stage-button.pending-state {
  border-color: #e8c48e;
  background: #fff7e8;
}

.stage-button.overdue-state {
  border-color: #e2aaa6;
  background: #fff1f0;
}

.stage-button.locked-state {
  color: #8b9393;
  background: #f1f2ef;
}

.stage-button.locked {
  color: #8b9393;
  background: #f1f2ef;
}

.stage-number {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e6ebe5;
  font-weight: 800;
  font-size: 0.82rem;
}

.stage-button.active .stage-number {
  background: var(--teal);
  color: white;
}

.stage-button.complete-state .stage-number {
  background: var(--green);
  color: white;
}

.stage-button.pending-state .stage-number {
  background: var(--amber);
  color: white;
}

.stage-button.overdue-state .stage-number {
  background: var(--red);
  color: white;
}

.stage-button.locked-state .stage-number {
  background: #e6ebe5;
  color: #8b9393;
}

.stage-button.active.complete-state,
.stage-button.active.pending-state,
.stage-button.active.overdue-state {
  box-shadow: inset 0 0 0 2px rgba(23, 107, 99, 0.18);
}

.stage-name {
  font-weight: 800;
  font-size: 0.88rem;
}

.stage-state {
  color: var(--muted);
  font-size: 0.78rem;
}

.main-panel {
  padding: 28px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.topbar h2 {
  font-size: 1.65rem;
}

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

.account-control {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.sync-status {
  color: var(--muted);
}

.sync-status[data-tone="success"] {
  color: var(--green);
}

.sync-status[data-tone="error"] {
  color: var(--red);
}

.sync-status[data-tone="info"] {
  color: var(--blue);
}

.system-clock {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcf8;
  color: var(--teal-dark);
  padding: 10px 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

.sla-timer {
  grid-column: 1 / -1;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  box-shadow: var(--shadow);
}

.sla-timer h3,
.sla-timer p {
  margin: 0;
}

.sla-timer strong {
  color: var(--teal-dark);
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sla-timer.overdue {
  border-color: #e2aaa6;
  background: #fff1f0;
}

.sla-timer.overdue .eyebrow,
.sla-timer.overdue strong {
  color: var(--red);
}

.sla-timer.ready {
  border-color: #b8ddc4;
  background: #e8f5ed;
}

.dashboard-view {
  display: grid;
  gap: 18px;
}

.overview-view {
  display: grid;
  gap: 18px;
}

.range-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.calendar-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.compact-control {
  width: auto;
  min-width: 132px;
  min-height: 34px;
  padding: 6px 10px;
}

.month-calendar {
  display: grid;
  gap: 8px;
}

.month-weekdays,
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
}

.month-weekdays span {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.month-grid {
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  min-width: 1120px;
}

.month-cell {
  min-height: 178px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 9px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
}

.month-cell.outside {
  background: #f3f5f1;
  color: #8b9495;
}

.month-cell.today {
  box-shadow: inset 0 0 0 2px rgba(23, 107, 99, 0.28);
}

.month-cell-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.month-cell-head strong {
  font-size: 0.9rem;
}

.month-cell-head span {
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--teal-dark);
  padding: 2px 7px;
  font-size: 0.72rem;
  font-weight: 800;
}

.month-events {
  display: grid;
  align-content: start;
  gap: 5px;
  max-height: 132px;
  overflow-y: auto;
}

.month-event {
  border: 0;
  border-left: 5px solid var(--event-color);
  border-radius: 5px;
  background: #f7faf8;
  padding: 6px 7px;
  display: grid;
  gap: 2px;
  text-align: left;
  cursor: pointer;
}

.month-event span {
  color: var(--event-color);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.month-event strong {
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1.2;
}

.month-event em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.calendar-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
  min-height: 220px;
  overflow: hidden;
}

.calendar-day-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  background: #f3f5f1;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}

.calendar-day-head strong {
  color: var(--ink);
}

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

.calendar-events {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.calendar-event {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
  display: grid;
  gap: 8px;
  text-align: left;
  cursor: pointer;
}

.calendar-event:hover {
  border-color: var(--teal);
}

.calendar-event > span {
  width: fit-content;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--teal-dark);
  padding: 3px 8px;
  font-size: 0.74rem;
  font-weight: 800;
}

.calendar-event strong {
  color: var(--ink);
}

.calendar-event dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 10px;
  margin: 0;
}

.calendar-event dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-event dd {
  margin: 1px 0 0;
  color: var(--ink);
  font-size: 0.82rem;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.dashboard-card {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
  cursor: pointer;
}

.dashboard-card.active {
  border-color: var(--teal);
  box-shadow:
    inset 0 0 0 2px rgba(23, 107, 99, 0.12),
    var(--shadow);
}

.dashboard-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.dashboard-card strong {
  font-size: 2rem;
  line-height: 1;
}

.dashboard-card span {
  color: var(--muted);
  font-size: 0.86rem;
}

.dashboard-card.good {
  border-color: #b8ddc4;
}

.dashboard-card.warn {
  border-color: #e8c48e;
}

.dashboard-card.bad {
  border-color: #e2aaa6;
}

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

.todo-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.todo-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcf8;
  display: grid;
  gap: 12px;
}

.todo-item.overdue {
  border-color: #e2aaa6;
  background: #fff8f7;
}

.todo-item h4 {
  margin: 0 0 5px;
}

.todo-item p {
  margin: 0;
  color: var(--muted);
}

.todo-item dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.todo-item dt,
.overview-table th {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
}

.todo-item dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 0.86rem;
}

.overview-table-wrap {
  overflow-x: auto;
}

.overview-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

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

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

.mini-task {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcf8;
  padding: 9px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 3px;
}

.mini-task.overdue {
  border-color: #e2aaa6;
  background: #fff8f7;
}

.mini-task strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.mini-task span,
.mini-task em {
  color: var(--muted);
  font-size: 0.8rem;
  font-style: normal;
}

.chat-panel {
  display: grid;
  gap: 16px;
}

.chat-messages {
  max-height: 520px;
  overflow-y: auto;
  display: grid;
  gap: 12px;
  padding-right: 4px;
}

.chat-message {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.chat-message-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}

.chat-message-meta strong {
  color: var(--ink);
}

.chat-message-meta span,
.chat-message-meta time {
  color: var(--muted);
  font-size: 0.82rem;
}

.chat-message p {
  margin: 0;
  white-space: pre-wrap;
}

.mention {
  color: var(--blue);
  font-weight: 800;
}

.chat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-files {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.chat-files li {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 8px 10px;
  color: var(--ink);
  font-size: 0.86rem;
}

.chat-files span {
  color: var(--muted);
  margin-left: 6px;
}

.chat-composer {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: grid;
  gap: 12px;
}

.chat-composer-row,
.chat-composer-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.chat-composer label {
  display: grid;
  gap: 6px;
}

.chat-composer label span {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.dashboard-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.gantt-board {
  min-width: 1180px;
  display: grid;
  gap: 12px;
}

.gantt-header,
.gantt-row {
  display: grid;
  grid-template-columns: 280px minmax(860px, 1fr);
  gap: 12px;
  align-items: stretch;
}

.gantt-order-head,
.gantt-stage-head {
  background: #f3f5f1;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.gantt-stage-heads,
.gantt-stage-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}

.gantt-stage-head {
  display: grid;
  gap: 5px;
  min-height: 64px;
}

.gantt-stage-head span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e5ebe5;
  color: var(--ink);
}

.gantt-stage-head strong {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.25;
  text-transform: none;
}

.gantt-rows {
  display: grid;
  gap: 12px;
}

.gantt-order-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcf8;
  display: grid;
  gap: 10px;
}

.gantt-order-card strong {
  display: block;
  line-height: 1.3;
}

.gantt-order-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.gantt-order-card dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.gantt-detail {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 8px;
}

.gantt-order-card dt {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
}

.gantt-order-card dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.82rem;
}

.gantt-stage {
  position: relative;
  min-height: 176px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f4f6f2;
  color: #7a8586;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 8px;
}

.gantt-stage::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -8px;
  right: -8px;
  height: 3px;
  background: #dfe5df;
  z-index: 0;
}

.gantt-stage > * {
  position: relative;
  z-index: 1;
}

.gantt-stage span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e5ebe5;
  color: var(--muted);
  font-weight: 900;
}

.gantt-stage strong {
  color: inherit;
  font-size: 0.82rem;
  line-height: 1.25;
}

.gantt-stage small {
  width: fit-content;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.72);
  font-weight: 800;
  font-size: 0.72rem;
}

.gantt-stage em {
  align-self: end;
  color: inherit;
  font-style: normal;
  font-size: 0.72rem;
  line-height: 1.35;
}

.gantt-stage.complete {
  background: #e8f5ed;
  border-color: #b8ddc4;
  color: var(--green);
}

.gantt-stage.complete::before {
  background: #8fcaa3;
}

.gantt-stage.complete span {
  background: var(--green);
  color: white;
}

.gantt-stage.current {
  background: var(--surface-soft);
  border-color: var(--teal);
  color: var(--teal-dark);
  box-shadow: inset 0 0 0 2px rgba(23, 107, 99, 0.1);
}

.gantt-stage.current::before {
  background: var(--teal);
}

.gantt-stage.current span {
  background: var(--teal);
  color: white;
}

.gantt-stage.current.due-soon {
  background: #fff7e8;
  border-color: #e8c48e;
  color: var(--amber);
}

.gantt-stage.current.due-soon::before,
.gantt-stage.current.due-soon span {
  background: var(--amber);
}

.gantt-stage.current.overdue {
  background: #fff1f0;
  border-color: #e2aaa6;
  color: var(--red);
}

.gantt-stage.current.overdue::before,
.gantt-stage.current.overdue span {
  background: var(--red);
}

.gantt-stage.current.due-soon span,
.gantt-stage.current.overdue span {
  color: white;
}

.gantt-stage.locked {
  opacity: 0.72;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1040px;
}

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

.dashboard-table th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.dashboard-table td {
  color: var(--ink);
  font-size: 0.9rem;
}

.sla-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.sla-pill.ok {
  background: #e8f5ed;
  color: var(--green);
}

.sla-pill.due-soon {
  background: #fff0e1;
  color: var(--amber);
}

.sla-pill.overdue {
  background: #fff1f0;
  color: var(--red);
}

.sla-pill.neutral {
  background: #edf2f7;
  color: var(--blue);
}

.sla-pill.completed {
  background: #e8f5ed;
  color: var(--green);
}

.button.compact {
  min-height: 34px;
  padding: 6px 10px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
  min-width: 0;
}

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

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.status-pill,
.task-status,
.metric,
.role-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.ready,
.task-status.done {
  background: #e8f5ed;
  color: var(--green);
}

.status-pill.blocked,
.task-status.blocked {
  background: #fff0e1;
  color: var(--amber);
}

.metric,
.role-chip {
  background: #edf2f7;
  color: var(--blue);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.save-bar {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.save-bar .subtle {
  margin: 0;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-field label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 7px;
}

.lock-hint {
  color: #8a9292;
  font-weight: 600;
}

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

.task-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.task-row.done {
  border-color: #b8ddc4;
  background: #fbfffc;
}

.task-main {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.task-main h4 {
  margin: 0 0 4px;
}

.task-main p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.task-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.task-owner {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.advance-box {
  margin-top: 18px;
  padding: 16px;
  border-radius: 8px;
  background: #f5f7f3;
  border: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.activity-log {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
}

.activity-log li {
  color: var(--muted);
}

.activity-log strong {
  color: var(--ink);
}

.admin-view {
  max-width: 1180px;
}

.admin-note {
  margin-top: -8px;
  margin-bottom: 18px;
}

.admin-section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 18px;
}

.admin-section h4 {
  margin: 0 0 12px;
}

.sla-setting-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
  padding: 14px;
  margin-bottom: 14px;
  display: grid;
  gap: 8px;
}

.sla-setting-row label {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(120px, 180px);
  gap: 12px;
  align-items: center;
}

.sla-setting-row label span {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.82rem;
}

.sla-setting-row p {
  margin: 0;
}

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

.worker-role-row {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(260px, 1fr);
  gap: 12px;
  align-items: start;
}

.worker-role-row > span {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #f3f5f1;
  font-weight: 800;
}

.worker-role-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.worker-role-row textarea {
  min-height: 70px;
}

.matrix {
  display: grid;
  gap: 8px;
}

.matrix-row {
  display: grid;
  grid-template-columns: minmax(180px, 260px) repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
  align-items: stretch;
}

.matrix-cell {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  min-height: 48px;
  display: flex;
  align-items: center;
}

.matrix-cell.header {
  background: #f3f5f1;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.78rem;
}

.matrix-cell label {
  display: flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 28px;
  text-align: center;
  background: #fbfcf8;
}

.hidden {
  display: none;
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

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

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

  .month-weekdays,
  .month-grid {
    grid-template-columns: repeat(7, minmax(130px, 1fr));
  }
}

@media (max-width: 680px) {
  .main-panel,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .panel-header,
  .advance-box,
  .sla-timer,
  .save-bar,
  .task-main {
    flex-direction: column;
    align-items: stretch;
  }

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

  .matrix-row {
    grid-template-columns: 1fr;
  }

  .sla-setting-row label {
    grid-template-columns: 1fr;
  }

  .worker-role-row,
  .chat-composer-row,
  .chat-composer-actions {
    grid-template-columns: 1fr;
  }

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

  .calendar-controls {
    justify-content: flex-start;
  }

  .account-control {
    width: 100%;
    border-left: 0;
    padding-left: 0;
    justify-content: space-between;
  }
}
