:root {
  --app: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #fafbff;
  --surface-tint: #f6f3ff;
  --ink: #1e2128;
  --muted: #5c636f;
  --soft: #68717c;
  --line: rgba(13, 16, 23, 0.12);
  --line-soft: rgba(13, 16, 23, 0.07);
  --rail: #080a12;
  --rail-text: #a7aec0;
  --rail-strong: #f6f8ff;
  --violet: #6d35f5;
  --purple: #5b21d6;
  --cyan: #00a9d6;
  --cyan-ink: #006b82;
  --magenta: #d81b7d;
  --success: #3e9e72;
  --success-ink: #276b4b;
  --warning: #c9892a;
  --warning-ink: #7c4c00;
  --danger: #ce4c46;
  --danger-ink: #a23b37;
  --focus: #006b82;
  --shadow: 0 1px 2px rgba(13, 18, 31, 0.06);
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --z-drawer: 30;
  --z-backdrop: 20;
  --z-toast: 40;
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--app);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

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

button { cursor: pointer; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

body.nav-open,
body.drawer-open { overflow: hidden; }

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 20px 14px 16px;
  background: var(--rail);
  color: var(--rail-text);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 22px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(114, 220, 255, 0.42);
  border-radius: 8px;
  color: var(--rail-strong);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: -0.08em;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  color: var(--rail-strong);
  font-size: 14px;
  font-weight: 600;
}

.brand span {
  margin-top: 3px;
  color: #8d96aa;
  font-size: 11px;
  line-height: 1.25;
}

.profile-control {
  margin: 0 2px 22px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.profile-control label,
.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 600;
}

.profile-control label { color: #a7aec0; }

.profile-control select {
  width: 100%;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: #111421;
  color: var(--rail-strong);
  font-size: 12px;
}

.primary-nav {
  display: grid;
  gap: 4px;
}

.sidebar-close-button {
  display: none;
  width: 100%;
  min-height: 34px;
  margin: -8px 0 14px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: transparent;
  color: var(--rail-strong);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}

.sidebar-close-button:hover { background: rgba(255, 255, 255, 0.06); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--rail-text);
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  transition: background-color 160ms ease, color 160ms ease;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--rail-strong); }
.nav-item.is-active { background: rgba(109, 53, 245, 0.28); color: var(--rail-strong); }
.nav-icon { width: 18px; color: #8f98ad; text-align: center; font-size: 18px; line-height: 1; }
.nav-item.is-active .nav-icon { color: #a98cff; }

.sidebar-spacer { flex: 1; min-height: 24px; }

.demo-box {
  margin: 0 2px 16px;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.demo-box h2 {
  margin: 0;
  color: var(--rail-strong);
  font-size: 12px;
  font-weight: 600;
}

.demo-box p {
  margin: 5px 0 10px;
  color: #8d96aa;
  font-size: 11px;
  line-height: 1.4;
}

.current-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.current-user strong,
.current-user small { display: block; }
.current-user strong { color: var(--rail-strong); font-size: 12px; font-weight: 600; }
.current-user small { margin-top: 3px; color: #8d96aa; font-size: 11px; }

.avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
}

.avatar-violet { background: rgba(109, 53, 245, 0.22); color: #b9aaff; }
.avatar-cyan { background: rgba(0, 169, 214, 0.14); color: #007fa0; }
.avatar-magenta { background: rgba(216, 27, 125, 0.13); color: #ad145f; }

.main-content { min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line-soft);
}

.breadcrumb {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar .mobile-menu-button { display: none; }

.page-content {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 16px 24px 8px;
}

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

.page-context {
  margin: 0 0 4px;
  color: var(--violet);
  font-size: 12px;
  font-weight: 600;
}

h1,
h2,
h3,
p { text-wrap: pretty; }

h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.page-description {
  max-width: 65ch;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.button,
.link-button {
  border: 0;
  border-radius: 7px;
  font-weight: 600;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, opacity 160ms ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 13px;
  white-space: nowrap;
}

.button-primary { background: var(--violet); color: #fff; }
.button-primary:hover { background: var(--purple); }
.button-primary:active { background: #4f1cc0; }
.button-secondary { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.button-secondary:hover { background: var(--surface-tint); border-color: rgba(109, 53, 245, 0.32); }
.button-secondary:active { background: #efebff; border-color: var(--violet); }
.button-danger { background: var(--danger-ink); color: #fff; }
.button:disabled { cursor: not-allowed; opacity: 0.45; }

.link-button {
  padding: 0;
  background: transparent;
  color: var(--violet);
  font-size: 12px;
}

.link-button:hover { color: var(--purple); text-decoration: underline; }

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

.dashboard-tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 150px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow);
  transition: border-color 160ms ease, background-color 160ms ease;
}

.dashboard-tile:hover { border-color: rgba(109, 53, 245, 0.45); }
.dashboard-tile:active { border-color: var(--violet); background: var(--surface-tint); }
.dashboard-tile:focus-visible { border-color: var(--violet); }
.dashboard-tile--wide { grid-column: span 7; min-height: 180px; }
.dashboard-tile--medium { grid-column: span 5; }
.dashboard-tile--small { grid-column: span 4; }
.dashboard-tile--large { grid-column: span 12; min-height: 180px; }

.tile-header,
.tile-footer,
.tile-value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tile-header { align-items: flex-start; }
.tile-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.tile-value { margin: 10px 0 3px; font-size: 28px; line-height: 1; letter-spacing: -0.035em; font-weight: 700; }
.tile-helper { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }

.tile-list {
  display: grid;
  gap: 4px;
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
}

.tile-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px;
  line-height: 1.2;
}

.tile-list li span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-list li span:last-child { flex: 0 0 auto; color: var(--muted); }
.tile-footer { margin-top: auto; padding-top: 10px; color: var(--violet); font-size: 11.5px; font-weight: 600; }

.tile-accent { color: var(--violet); }
.tile-warning { color: var(--warning-ink); }
.tile-danger { color: var(--danger-ink); }
.tile-success { color: var(--success-ink); }

.workload-meter { display: flex; flex: 0 0 132px; gap: 4px; margin: 10px 0 0; }
.workload-meter span { height: 7px; flex: 1; border-radius: 2px; background: #e2e5ec; }
.workload-meter span.is-active { background: var(--cyan); }

.kanban-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
}

.tab-list { display: flex; align-items: stretch; gap: 2px; }
.tab-button {
  min-height: 36px;
  padding: 0 13px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.tab-button:hover { color: var(--ink); }
.tab-button:active { color: var(--purple); }
.tab-button.is-active { border-bottom-color: var(--violet); color: var(--violet); }
.toolbar-meta { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 12px; }

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.filter-placeholder { color: var(--muted); font-size: 12px; }

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(109, 53, 245, 0.28);
  border-radius: 6px;
  background: var(--surface-tint);
  color: var(--purple);
  font-size: 12px;
  font-weight: 600;
}

.filter-chip:hover { border-color: var(--violet); }
.filter-chip:active { background: #efebff; }

.kanban-board {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 460px;
  padding: 4px 2px 18px;
  overflow-x: auto;
}

.kanban-scroll-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  padding: 0 2px;
  color: var(--muted);
  font-size: 11px;
}

.kanban-scroll-hint span:last-child { color: var(--violet); font-size: 16px; }

.kanban-column {
  display: flex;
  flex: 0 0 246px;
  flex-direction: column;
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.54);
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line-soft);
}

.column-name { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; }
.column-marker { width: 8px; height: 8px; border-radius: 2px; background: var(--violet); }
.kanban-column[data-column="in-progress"] .column-marker { background: var(--cyan); }
.kanban-column[data-column="review"] .column-marker,
.kanban-column[data-column="pending"] .column-marker,
.kanban-column[data-column="proposal"] .column-marker,
.kanban-column[data-column="negotiation"] .column-marker { background: var(--warning); }
.kanban-column[data-column="blocked"] .column-marker,
.kanban-column[data-column="lost"] .column-marker { background: var(--danger); }
.kanban-column[data-column="won"] .column-marker,
.kanban-column[data-column="ready"] .column-marker,
.kanban-column[data-column="transferred"] .column-marker,
.kanban-column[data-column="completed"] .column-marker { background: var(--success); }
.column-count { color: var(--soft); font-family: var(--font-mono); font-size: 11px; }
.column-body { display: grid; align-content: start; gap: 8px; min-height: 380px; padding: 10px; transition: background-color 160ms ease; }
.column-body.is-drag-over { background: var(--surface-tint); }
.column-empty { padding: 18px 7px; color: var(--soft); font-size: 12px; text-align: center; }

.work-card {
  display: block;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: grab;
  box-shadow: var(--shadow);
  transition: border-color 160ms ease, opacity 160ms ease;
}

.work-card:hover { border-color: rgba(109, 53, 245, 0.42); }
.work-card:active { border-color: var(--violet); background: var(--surface-tint); cursor: grabbing; }
.work-card.is-dragging { opacity: 0.45; }
.work-card-ref { color: var(--soft); font-family: var(--font-mono); font-size: 10px; }
.work-card-title { margin: 5px 0 8px; font-size: 13px; line-height: 1.3; font-weight: 650; }
.work-card-meta { display: grid; gap: 4px; color: var(--muted); font-size: 11px; line-height: 1.3; }
.work-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--line-soft); }
.work-card-owner { display: inline-flex; align-items: center; gap: 5px; min-width: 0; color: var(--muted); font-size: 11px; }
.work-card-owner span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-card-status { color: var(--violet); font-size: 10px; font-weight: 700; }
.status-label { display: inline-flex; align-items: center; min-height: 22px; padding: 0 6px; border: 1px solid currentColor; border-radius: 5px; font-size: 10px; font-weight: 700; }
.status-label.status-danger { color: var(--danger-ink); }
.status-label.status-warning { color: var(--warning-ink); }
.status-label.status-success { color: var(--success-ink); }
.status-label.status-info { color: var(--cyan-ink); }

.empty-state {
  max-width: 520px;
  margin: 50px auto;
  padding: 30px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: center;
}

.empty-state h2 { margin: 0; font-size: 17px; }
.empty-state p { margin: 8px auto 18px; color: var(--muted); line-height: 1.45; }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 18, 0.46);
  z-index: var(--z-backdrop);
}

.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 18, 0.42);
  z-index: 24;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(620px, calc(100vw - 32px));
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -4px 0 8px rgba(13, 18, 31, 0.14);
  z-index: var(--z-drawer);
  overflow-y: auto;
}

.drawer-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line-soft);
  z-index: 1;
}

.drawer-context { margin: 0 0 5px; color: var(--violet); font-size: 12px; font-weight: 600; }
.drawer-header h2 { max-width: 450px; margin: 0; font-size: 20px; line-height: 1.18; letter-spacing: -0.02em; }
.drawer-subtitle { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.drawer-close { width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted); font-size: 18px; line-height: 1; }
.drawer-close:hover { color: var(--ink); background: var(--surface-tint); }
.drawer-body { padding: 16px 24px 24px; }

.detail-summary,
.detail-section {
  margin-bottom: 10px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
}

.detail-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.detail-summary-item span,
.detail-row dt { display: block; margin-bottom: 4px; color: var(--soft); font-size: 11px; }
.detail-summary-item strong,
.detail-row dd { margin: 0; color: var(--ink); font-size: 13px; font-weight: 600; }
.detail-summary-item strong.is-danger { color: var(--danger-ink); }

.progress-path {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 14px;
  padding: 0 2px;
  color: var(--soft);
  font-size: 11px;
  white-space: nowrap;
  overflow-x: auto;
}

.progress-path span.is-current { color: var(--violet); font-weight: 700; }
.progress-path i { color: #b1b5be; font-style: normal; }

.detail-tabs {
  display: flex;
  gap: 2px;
  margin: 18px 0 14px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.detail-tab {
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.detail-tab:hover { color: var(--ink); }
.detail-tab.is-active { border-bottom-color: var(--violet); color: var(--violet); }
.detail-panel { min-width: 0; }

.detail-section h3,
.detail-section summary { margin: 0; color: var(--ink); font-size: 14px; font-weight: 700; }
.detail-section summary { cursor: pointer; list-style: none; }
.detail-section summary::-webkit-details-marker { display: none; }
.detail-section summary::after { float: right; content: "+"; color: var(--soft); font-weight: 400; }
.detail-section[open] summary::after { content: "−"; }
.detail-section p { margin: 9px 0 0; color: var(--muted); line-height: 1.5; }
.detail-rows { display: grid; gap: 12px; margin: 14px 0 0; }
.detail-row { display: grid; grid-template-columns: 115px minmax(0, 1fr); gap: 14px; margin: 0; }
.detail-row dt { margin: 0; }
.detail-row dd { line-height: 1.4; white-space: pre-wrap; }
.detail-row-note { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 400; }

.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.drawer-actions .button { min-height: 34px; font-size: 12px; }
.field { display: block; margin-top: 12px; }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}

.field textarea { min-height: 88px; padding-top: 9px; padding-bottom: 9px; resize: vertical; line-height: 1.4; }
.field input::placeholder,
.field textarea::placeholder { color: #717984; }
.field-optional { color: var(--muted); font-size: 11px; font-weight: 400; }
.field small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line-soft); }

.assignment-list { display: grid; gap: 9px; margin-top: 13px; }
.assignment-person { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.assignment-person-info { display: flex; align-items: center; gap: 8px; min-width: 0; }
.assignment-person-info span:last-child { min-width: 0; }
.assignment-person-info strong,
.assignment-person-info small { display: block; }
.assignment-person-info strong { font-size: 12px; }
.assignment-person-info small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.shared-label { color: var(--cyan-ink); font-size: 11px; font-weight: 700; }
.assignment-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.assignment-controls select { min-height: 32px; flex: 1 1 180px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 12px; }
.assignment-controls .button { min-height: 32px; font-size: 12px; }

.relation-path { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.relation-button { padding: 0; border: 0; background: transparent; color: var(--violet); text-align: left; font-size: 12px; font-weight: 600; }
.relation-button:hover { text-decoration: underline; }
.relation-arrow { color: var(--soft); }

.activity-list { display: grid; gap: 0; margin: 13px 0 0; padding: 0; list-style: none; }
.activity-item { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 10px; padding: 0 0 15px; }
.activity-line { position: relative; width: 8px; }
.activity-line::before { content: ""; position: absolute; top: 3px; left: 2px; width: 4px; height: 4px; border-radius: 50%; background: var(--violet); }
.activity-line::after { content: ""; position: absolute; top: 10px; bottom: -2px; left: 3px; width: 2px; background: #dcdfea; }
.activity-item:last-child .activity-line::after { display: none; }
.activity-item strong { display: block; font-size: 12px; line-height: 1.35; }
.activity-item span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; }

.toast-region {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  z-index: var(--z-toast);
}

.toast {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--rail);
  color: var(--rail-strong);
  box-shadow: 0 2px 8px rgba(13, 18, 31, 0.18);
  font-size: 12px;
  line-height: 1.4;
}

.toast.is-error { border-color: rgba(206, 76, 70, 0.65); }
.toast.is-success { border-color: rgba(62, 158, 114, 0.65); }

.mobile-menu-button { min-width: 52px; }

@media (max-width: 1100px) {
  .dashboard-tile--wide,
  .dashboard-tile--large { grid-column: span 6; }
  .dashboard-tile--medium,
  .dashboard-tile--small { grid-column: span 6; }
}

@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(280px, calc(100vw - 48px));
    min-height: 0;
    transform: translateX(-100%);
    transition: transform 180ms ease;
    z-index: 25;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .nav-backdrop { display: block; }
  .sidebar-close-button { display: block; }
  .topbar .mobile-menu-button { display: inline-flex; }
  .topbar { padding: 0 18px; }
  .page-content { padding: 22px 18px; }
  .page-header { align-items: flex-start; }
}

@media (max-width: 640px) {
  .topbar-actions .button-primary { padding: 0 9px; font-size: 12px; }
  .page-header { display: block; margin-bottom: 18px; }
  .page-header .button-secondary { margin-top: 14px; }
  h1 { font-size: 22px; }
  .dashboard-grid { display: grid; grid-template-columns: 1fr; }
  .dashboard-tile--wide,
  .dashboard-tile--medium,
  .dashboard-tile--small,
  .dashboard-tile--large { grid-column: auto; min-height: 170px; }
  .kanban-toolbar { align-items: flex-start; flex-direction: column; padding-right: 0; }
  .toolbar-meta { width: 100%; justify-content: space-between; }
  .tab-list { width: 100%; overflow-x: auto; }
  .tab-button { flex: 0 0 auto; padding: 0 10px; }
  .drawer { width: calc(100vw - 12px); }
  .drawer-header,
  .drawer-body { padding-left: 16px; padding-right: 16px; }
  .detail-summary,
  .form-grid { grid-template-columns: 1fr; }
  .detail-row { grid-template-columns: 1fr; gap: 4px; }
  .toast-region { right: 16px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
