:root {
  --crm-brand: #16a34a;
  --crm-brand-dark: #14532d;
  --crm-page: #f8fafc;
  --crm-surface: #ffffff;
  --crm-border: #e2e8f0;
  --crm-text: #0f172a;
  --crm-muted: #64748b;
  --crm-subtle: #f1f5f9;
  --crm-shadow: 0 1px 2px rgb(15 23 42 / 0.06);
  --crm-focus: 0 0 0 3px rgb(22 163 74 / 0.2);
  --bg: var(--crm-page);
  --bg2: var(--crm-surface);
  --bg3: var(--crm-subtle);
  --bg4: #e2e8f0;
  --border: var(--crm-border);
  --text: var(--crm-text);
  --muted: var(--crm-muted);
  --accent: var(--crm-brand);
  --accent-hover: var(--crm-brand-dark);
  --field-bg: #fff;
  --field-border: #cbd5e1;
  --field-focus: var(--crm-brand);
  --field-shadow: var(--crm-focus);
}

html {
  background: var(--crm-page);
}

body {
  background: var(--crm-page);
  color: var(--crm-text);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

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

button,
a,
input,
select,
textarea,
[tabindex] {
  outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  box-shadow: var(--crm-focus);
}

.top-bar {
  min-height: 56px;
  padding: 8px 20px;
  gap: 12px;
  background: rgb(255 255 255 / 0.96);
  border-color: var(--crm-border);
  box-shadow: 0 1px 0 rgb(15 23 42 / 0.02);
  backdrop-filter: blur(12px);
}

.taskhub-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  color: var(--crm-text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.taskhub-brand::before {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--crm-brand);
  color: #fff;
  content: "TH";
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.service-nav {
  gap: 4px;
  max-width: min(760px, 58vw);
}

.service-link {
  min-height: 32px;
  padding: 6px 9px;
  border-color: transparent;
  border-radius: 6px;
  background: transparent;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}

.service-link:hover {
  border-color: var(--crm-border);
  background: var(--crm-subtle);
  color: var(--crm-text);
}

.service-link.active {
  border-color: #dcfce7;
  background: #f0fdf4;
  color: #15803d;
}

.service-code {
  min-width: 22px;
  height: 20px;
  border-radius: 5px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 10px;
}

.service-link.active .service-code {
  background: #dcfce7;
  color: #15803d;
}

.top-bar .user-info,
.top-bar .summary,
.top-bar button,
.top-bar a:not(.service-link) {
  color: var(--crm-muted);
  font-size: 12px;
}

.main-layout {
  width: min(100%, 1440px);
  max-width: 1440px;
  min-height: calc(100vh - 56px);
  margin: 0 auto;
}

.task-panel {
  max-width: none;
  padding: 24px;
}

.workspace {
  min-height: calc(100vh - 56px);
}

.board-shell {
  padding: 24px;
}

.taskhub-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.taskhub-page-heading {
  min-width: 0;
}

.taskhub-page-eyebrow {
  display: block;
  margin-bottom: 2px;
  color: var(--crm-brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.taskhub-page-heading h1 {
  margin: 0;
  color: var(--crm-text);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 32px;
}

.taskhub-page-heading p {
  max-width: 720px;
  margin-top: 3px;
  color: var(--crm-muted);
  font-size: 13px;
  line-height: 20px;
}

.taskhub-page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.taskhub-view-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--crm-border);
  border-radius: 8px;
  background: var(--crm-surface);
  box-shadow: var(--crm-shadow);
}

.taskhub-view-switch a {
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 6px;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
  text-decoration: none;
}

.taskhub-view-switch a:hover {
  background: var(--crm-subtle);
  color: var(--crm-text);
}

.taskhub-view-switch a.active {
  background: var(--crm-text);
  color: #fff;
}

.taskhub-secondary-action,
.ghost-btn {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--crm-border);
  border-radius: 6px;
  background: var(--crm-surface);
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.taskhub-secondary-action:hover,
.ghost-btn:hover {
  border-color: #cbd5e1;
  background: var(--crm-subtle);
  color: var(--crm-text);
}

.focus-row,
.starter-row,
.saved-view-row,
.create-bar,
.bulk-toolbar,
.new-task-bar,
.active-view-bar,
.advanced-panel {
  border-color: var(--crm-border);
  border-radius: 8px;
  background: var(--crm-surface);
  box-shadow: var(--crm-shadow);
}

.focus-row:empty,
.starter-row:empty,
.saved-view-row:empty,
.active-view-bar:empty {
  display: none;
}

.focus-row,
.starter-row,
.saved-view-row {
  gap: 6px;
  margin: 0 0 10px;
  padding: 10px 12px;
}

.focus-pill,
.starter-chip,
.saved-view-pill,
.chip {
  min-height: 32px;
  padding: 5px 10px;
  border-color: var(--crm-border);
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}

.focus-pill:hover,
.starter-chip:hover,
.saved-view-pill:hover,
.chip:hover {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.focus-pill.active,
.starter-chip.active,
.saved-view-pill.active,
.chip.active,
.scope-chip.active,
.entity-result.active,
.create-mode-card.active {
  border-color: #86efac;
  background: #f0fdf4;
  color: #15803d;
}

.list-topline {
  margin: 0 0 10px;
}

.active-view-bar {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.advanced-panel {
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
}

.advanced-panel[hidden] {
  display: none;
}

.advanced-panel .focus-row,
.advanced-panel .saved-view-row {
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.stat-row {
  gap: 8px;
  margin-bottom: 0;
}

.stat,
.mini-stat {
  padding: 10px 12px;
  border-color: var(--crm-border);
  border-radius: 8px;
  background: var(--crm-page);
}

.stat .num,
.mini-stat .num {
  color: var(--crm-text);
  font-size: 18px;
}

.stat .lbl,
.mini-stat .lbl {
  color: var(--crm-muted);
  font-size: 11px;
}

.filters {
  gap: 6px;
  margin-bottom: 0;
}

.work-filter-grid {
  gap: 8px;
  margin: 0;
}

.work-filter-grid label,
.field label,
.fg label,
.detail-field label,
.dp-field label {
  color: var(--crm-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.035em;
}

.work-filter-grid select,
.work-filter-grid input,
.field input,
.field select,
.field textarea,
.fg input,
.fg select,
.fg textarea,
.detail-field input,
.detail-field select,
.detail-field textarea,
.dp-field input,
.dp-field select,
.dp-field textarea,
.comment-form textarea {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: var(--crm-text);
  font-size: 13px;
  box-shadow: none;
}

.new-task-bar,
.create-bar {
  min-height: 58px;
  margin-bottom: 12px;
  padding: 9px 12px;
}

.new-task-bar input {
  min-height: 38px;
  color: var(--crm-text);
  font-size: 14px;
}

.new-task-bar button,
.create-bar .btn-primary,
.detail-actions .btn-primary,
.dp-actions .primary,
.comment-form button,
.modal-actions .btn-primary,
.bulk-actions .primary,
.md-actions .primary {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--crm-brand);
  border-radius: 6px;
  background: var(--crm-brand);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.new-task-bar button:hover,
.create-bar .btn-primary:hover,
.detail-actions .btn-primary:hover,
.dp-actions .primary:hover,
.comment-form button:hover,
.modal-actions .btn-primary:hover,
.bulk-actions .primary:hover,
.md-actions .primary:hover {
  border-color: var(--crm-brand-dark);
  background: var(--crm-brand-dark);
}

.task-list {
  gap: 8px;
}

.task-card,
.kcard {
  border: 1px solid var(--crm-border);
  border-radius: 8px;
  background: var(--crm-surface);
  box-shadow: var(--crm-shadow);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.task-card {
  gap: 12px;
  min-height: 64px;
  padding: 12px;
}

.task-card:hover,
.kcard:hover {
  border-color: #cbd5e1;
  box-shadow: 0 6px 16px rgb(15 23 42 / 0.08);
  transform: translateY(-1px);
}

.task-card.selected,
.kcard.selected {
  border-color: var(--crm-brand);
  box-shadow: var(--crm-focus);
}

.task-card.urgent,
.kcard.urgent {
  border-left: 4px solid #e11d48;
}

.task-card.high,
.kcard.high {
  border-left: 4px solid #f97316;
}

.task-check {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 2px solid #cbd5e1;
  font-size: 11px;
}

.task-check:hover {
  border-color: var(--crm-brand);
  background: #f0fdf4;
}

.task-check.done {
  border-color: var(--crm-brand);
  background: var(--crm-brand);
}

.task-title,
.k-title {
  color: var(--crm-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.task-title {
  margin-bottom: 4px;
}

.task-card:hover .task-title,
.kcard:hover .k-title {
  color: #15803d;
}

.task-meta,
.k-meta {
  gap: 5px 6px;
  color: var(--crm-muted);
  font-size: 12px;
  line-height: 18px;
}

.tag,
.k-tag,
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 14px;
}

.tag,
.k-tag {
  background: #f8fafc;
  color: #64748b;
}

.tag-kind-task,
.k-tag.kind-task {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #475569;
}

.tag-kind-step,
.k-tag.kind-step {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #4338ca;
}

.tag-kind-service,
.k-tag.kind-service {
  border-color: #a5f3fc;
  background: #ecfeff;
  color: #155e75;
}

.status-open {
  background: #f1f5f9;
  color: #334155;
}

.status-in-progress {
  background: #fef3c7;
  color: #92400e;
}

.status-blocked {
  background: #ffe4e6;
  color: #9f1239;
}

.status-waiting-info {
  background: #e0f2fe;
  color: #075985;
}

.status-deferred {
  background: #ede9fe;
  color: #5b21b6;
}

.status-ready-for-review {
  background: #e0e7ff;
  color: #3730a3;
}

.status-done {
  background: #d1fae5;
  color: #065f46;
}

.status-canceled,
.status-unknown {
  background: #e2e8f0;
  color: #475569;
}

.task-due,
.k-due {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  color: var(--crm-muted);
  font-size: 11px;
  font-weight: 600;
}

.task-due::before,
.k-due::before {
  margin-right: 4px;
  content: "◷";
}

.task-due.today,
.k-due.today {
  color: #b45309;
}

.task-due.overdue,
.k-due.overdue {
  color: #be123c;
}

.task-actions,
.k-actions {
  gap: 6px;
  margin-top: 8px;
}

.task-actions button,
.k-actions button,
.detail-actions button,
.detail-actions a,
.dp-actions button,
.bulk-actions button,
.md-actions button,
.md-item-side a,
.md-item-side button {
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid var(--crm-border);
  border-radius: 6px;
  background: #fff;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
}

.task-actions button:hover,
.k-actions button:hover,
.detail-actions button:hover,
.detail-actions a:hover,
.dp-actions button:hover,
.bulk-actions button:hover,
.md-actions button:hover,
.md-item-side a:hover,
.md-item-side button:hover {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.kanban {
  gap: 12px;
  min-height: calc(100vh - 235px);
  padding-bottom: 16px;
}

.col {
  min-width: 292px;
  max-width: 342px;
  border: 1px solid var(--crm-border);
  border-radius: 8px;
  background: #f1f5f9;
}

.col-head {
  gap: 8px;
  padding: 11px 12px 6px;
  border-bottom: 0;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.col-head .cnt {
  padding: 2px 7px;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
}

.col-note {
  min-height: 34px;
  padding: 0 12px 10px;
  color: var(--crm-muted);
  font-size: 11px;
  line-height: 16px;
}

.col-body {
  gap: 8px;
  padding: 8px;
}

.kcard {
  padding: 12px;
}

.kcard-head {
  gap: 8px;
}

.kcard-select input {
  width: 18px;
  height: 18px;
  accent-color: var(--crm-brand);
}

.k-title {
  margin-bottom: 4px;
}

.k-body {
  margin-bottom: 8px;
  color: var(--crm-muted);
  font-size: 12px;
  line-height: 18px;
}

.create-bar,
.bulk-toolbar {
  margin-bottom: 12px;
}

.bulk-toolbar {
  gap: 10px;
  padding: 12px;
}

.detail-panel,
.detail-shell {
  background: #fff;
  border-color: var(--crm-border);
  box-shadow: -12px 0 28px rgb(15 23 42 / 0.1);
}

.detail-panel {
  width: 480px;
  min-height: calc(100vh - 56px);
}

.detail-shell {
  top: 56px;
  width: min(640px, 96vw);
}

.dp-head,
.detail-head {
  min-height: 64px;
  padding: 14px 18px;
  border-color: var(--crm-border);
}

.dp-head h2,
.detail-head h2 {
  color: var(--crm-text);
  font-size: 17px;
  font-weight: 700;
  line-height: 24px;
}

.dp-body,
.detail-body {
  padding: 16px 18px 24px;
}

.detail-body {
  gap: 16px;
}

.dp-card,
.detail-card,
.md-section {
  border: 1px solid var(--crm-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--crm-shadow);
}

.dp-card,
.detail-card {
  padding: 12px;
}

.detail-card h3,
.dp-section h3 {
  margin-bottom: 8px;
  color: var(--crm-muted);
  font-size: 11px;
}

.detail-grid {
  gap: 12px;
}

.detail-field,
.dp-field {
  gap: 4px;
}

.detail-field .val,
.dp-field .val {
  color: var(--crm-text);
  font-size: 13px;
  line-height: 20px;
}

.modal-backdrop {
  padding: 20px;
  background: rgb(15 23 42 / 0.5);
  backdrop-filter: blur(2px);
}

.modal-card {
  width: min(980px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  border: 1px solid var(--crm-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 64px rgb(15 23 42 / 0.2);
}

.modal-head {
  padding: 14px 18px;
  border-color: var(--crm-border);
  background: #fff;
}

.modal-head h2 {
  color: var(--crm-text);
  font-size: 18px;
}

.modal-head p {
  color: var(--crm-muted);
  font-size: 12px;
}

.modal-body {
  gap: 14px;
  padding: 16px 18px;
}

.create-task-card {
  width: min(900px, calc(100vw - 40px));
}

.create-task-card .modal-head > div {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.create-task-card .modal-body {
  display: block;
}

.create-task-card #createAiStepCard,
.create-task-card #createModeStepCard,
.create-task-card #createEntityStepCard {
  width: 100%;
  min-width: 0;
  margin: 10px 0;
}

.create-task-card #createTaskDetailsStepCard {
  width: 100%;
  min-width: 0;
}

.create-task-card .create-step-card,
.create-task-card .detail-card.create-step-card {
  overflow: hidden;
  min-width: 0;
  padding: 0;
  border: 1px solid #dce5dd;
  border-radius: 8px;
  background: #fbfcf8;
  box-shadow: none;
}

.create-task-card .create-step-summary {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 9px 11px;
  color: var(--crm-text);
}

.create-task-card .create-step-copy {
  display: flex;
  min-width: 0;
  flex-direction: row;
  align-items: center;
  gap: 5px;
}

.create-task-card .create-step-label {
  flex: 0 0 auto;
  color: var(--crm-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.create-task-card .create-step-state {
  min-width: 0;
  overflow: hidden;
  color: var(--crm-text);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.create-task-card .create-step-summary::after {
  color: var(--crm-muted);
  font-size: 17px;
  font-weight: 700;
}

.create-task-card .create-step-body {
  padding: 12px;
  border-top: 1px solid #dce5dd;
  background: #fff;
}

.create-task-header-entity {
  display: inline-flex;
  min-width: 0;
  max-width: min(620px, 65vw);
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  color: #15803d;
  font-size: 12px;
  font-weight: 600;
}

.create-task-header-entity[hidden] {
  display: none;
}

.create-task-header-entity-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.create-task-header-entity-type {
  flex: 0 0 auto;
  color: #16a34a;
  font-weight: 500;
}

.create-kind-choice {
  grid-column: 1 / -1;
  padding: 11px;
  border: 1px solid var(--crm-border);
  border-radius: 8px;
  background: #f8fafc;
}

.create-kind-choice-label {
  margin-bottom: 7px;
  color: var(--crm-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.create-kind-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.create-kind-choice button {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--crm-border);
  border-radius: 6px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  text-align: left;
}

.create-kind-choice button:hover {
  border-color: #86efac;
}

.create-kind-choice button.active {
  border-color: var(--crm-brand);
  background: #f0fdf4;
  color: #15803d;
  box-shadow: 0 0 0 1px rgb(22 163 74 / 0.12);
}

.create-kind-choice button strong {
  display: block;
  font-size: 12px;
}

.create-kind-choice button span {
  display: block;
  margin-top: 2px;
  color: var(--crm-muted);
  font-size: 10px;
  line-height: 14px;
}

.create-kind-select {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.create-primary-fields {
  margin-top: 10px;
}

.create-primary-fields #createEntityStepCard {
  grid-column: 1 / -1;
  margin: 0;
}

.create-primary-fields .create-task-body-field {
  grid-column: 1 / -1;
}

.create-required-hint {
  margin-top: 5px;
  color: #be123c;
  font-size: 11px;
  font-weight: 600;
}

.create-required-picker .person-picker-shell {
  border-color: #fda4af;
  background: #fff1f2;
  box-shadow: 0 0 0 2px rgb(244 63 94 / 0.1);
}

.create-task-card .create-required-input {
  border-color: #fda4af;
  background: #fff1f2;
  box-shadow: 0 0 0 2px rgb(244 63 94 / 0.1);
}

.create-status-picker {
  display: flex;
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.create-status-picker-label {
  width: 100%;
  color: var(--crm-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.035em;
}

.create-status-picker button {
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--crm-border);
  border-radius: 999px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.create-status-picker button:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.create-status-picker button.active {
  border-color: #86efac;
  background: #f0fdf4;
  color: #15803d;
}

.create-status-select {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.create-task-card .ai-create-panel {
  border-color: #dce5dd;
  background: #fbfcf8;
}

.create-task-card .ai-create-panel[open] {
  border-color: #86efac;
}

.create-flow-linear #createTaskDetailsStepCard {
  overflow: visible;
  border: 0;
  background: transparent;
}

.create-flow-linear #createTaskDetailsStepCard > .create-step-summary {
  display: none;
}

.create-flow-linear #createTaskDetailsStepCard > .create-step-body {
  padding: 0;
  border: 0;
  background: transparent;
}

.create-flow-linear #createTaskDetailsSection {
  display: block;
}

.create-flow-linear #createTaskDetailsSection[hidden] {
  display: none;
}

.create-flow-linear #createModeStepCard {
  margin-top: 12px;
}

.modal-actions {
  gap: 8px;
  padding: 12px 18px;
  border-color: var(--crm-border);
  background: #fff;
}

.drawer {
  top: 56px;
  width: min(380px, 92vw);
  border-color: var(--crm-border);
  background: #fff;
}

.drawer-head {
  min-height: 58px;
  padding: 12px 16px;
  border-color: var(--crm-border);
}

.drawer-head h2 {
  color: var(--crm-text);
  font-size: 15px;
}

.drawer-body {
  gap: 14px;
  padding: 16px;
}

.drawer-tab,
.ai-ear {
  min-height: 44px;
  border-color: transparent;
  border-radius: 8px 0 0 8px;
  box-shadow: 0 4px 14px rgb(15 23 42 / 0.12);
}

.drawer-tab {
  top: 116px;
  background: #334155;
}

.ai-ear {
  top: 206px;
  background: #0f766e;
}

.md-header {
  padding: 0 0 10px;
}

.md-title h2 {
  color: var(--crm-text);
  font-size: 18px;
}

.md-title p,
.md-empty {
  color: var(--crm-muted);
  font-size: 12px;
  line-height: 18px;
}

.md-sections {
  gap: 10px;
}

.md-section-head {
  padding: 10px 12px;
  border-color: var(--crm-border);
  background: #f8fafc;
}

.md-section-head h3 {
  color: var(--crm-text);
  font-size: 13px;
}

.md-item {
  min-height: 58px;
  padding: 10px 12px;
  border-color: var(--crm-border);
}

.md-item:hover {
  background: #f8fafc;
}

.md-item-title {
  color: var(--crm-text);
  font-size: 13px;
}

.empty-card {
  padding: 28px 20px;
  border-color: #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

@media (max-width: 900px) {
  .top-bar {
    min-height: 52px;
    padding: 7px 12px;
    flex-wrap: wrap;
  }

  .taskhub-brand {
    margin-right: auto;
  }

  .service-nav {
    order: 3;
    width: 100%;
    max-width: none;
    padding-bottom: 2px;
  }

  .top-bar .spacer {
    display: none;
  }

  .main-layout {
    min-height: calc(100vh - 52px);
  }

  .task-panel,
  .board-shell {
    padding: 16px;
  }

  .taskhub-page-header {
    align-items: flex-start;
    gap: 12px;
  }

  .taskhub-page-heading h1 {
    font-size: 22px;
    line-height: 28px;
  }

  .detail-panel,
  .detail-shell {
    top: 52px;
  }

  .detail-panel {
    width: min(480px, 100%);
  }

  .create-task-card #createAiStepCard,
  .create-task-card #createModeStepCard,
  .create-task-card #createEntityStepCard,
  .create-task-card #createTaskDetailsStepCard {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .task-panel,
  .board-shell {
    padding: 12px;
  }

  .taskhub-page-header {
    flex-direction: column;
    margin-bottom: 14px;
  }

  .taskhub-page-actions,
  .taskhub-view-switch {
    width: 100%;
  }

  .taskhub-page-actions {
    flex-wrap: wrap;
  }

  .taskhub-view-switch {
    flex: 1 1 100%;
  }

  .taskhub-view-switch a {
    flex: 1;
    min-height: 40px;
    text-align: center;
  }

  .taskhub-secondary-action {
    flex: 1;
  }

  .task-card {
    gap: 10px;
    padding: 12px;
  }

  .task-check {
    width: 36px;
    height: 36px;
    margin-top: 0;
  }

  .task-title {
    white-space: normal;
  }

  .task-actions,
  .k-actions {
    gap: 6px;
  }

  .task-actions button,
  .k-actions button {
    min-height: 36px;
    padding: 7px 10px;
  }

  .col {
    min-width: min(84vw, 320px);
    max-width: min(84vw, 320px);
  }

  .kanban {
    min-height: calc(100vh - 260px);
  }

  .modal-backdrop {
    padding: 6px;
  }

  .modal-card {
    width: calc(100vw - 12px);
    max-height: calc(100vh - 12px);
  }

  .modal-head,
  .modal-body,
  .modal-actions {
    padding-right: 12px;
    padding-left: 12px;
  }

  .create-task-card .create-step-summary {
    grid-template-columns: minmax(92px, auto) minmax(0, 1fr) auto;
    gap: 7px;
  }

  .create-kind-choice-grid {
    grid-template-columns: 1fr;
  }

  .create-task-header-entity {
    max-width: calc(100vw - 92px);
  }

  .work-filter-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-field.full {
    grid-column: auto;
  }
}
