:root {
  --ink: #172033;
  --muted: #677189;
  --line: #dde5ef;
  --panel: #ffffff;
  --paper: #f7f9fd;
  --green: #21b573;
  --orange: #ff8a3d;
  --blue: #1f9cf0;
  --pink: #ec4899;
  --violet: #7c5cff;
  --red: #ef4444;
  --yellow: #f6c945;
  --radius: 8px;
  --shadow: 0 16px 40px rgba(23, 32, 51, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  font-weight: 400;
}

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

button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

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

a {
  color: var(--blue);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background:
    linear-gradient(135deg, rgba(33, 181, 115, 0.14), transparent 34%),
    linear-gradient(315deg, rgba(236, 72, 153, 0.13), transparent 38%),
    var(--paper);
}

.login-brand {
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-mark {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: white;
  font-size: 34px;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.login-brand h1 {
  font-size: 48px;
  line-height: 1;
  margin: 0;
}

.brand-title {
  display: flex;
  align-items: end;
  gap: 12px;
  margin: 24px 0 12px;
  flex-wrap: wrap;
}

.login-brand p {
  max-width: 460px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.login-card h2 {
  margin: 0 0 18px;
  font-size: 24px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: #ffffff;
  border-right: 1px solid var(--line);
  padding: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-top {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.sidebar .brand-mark {
  width: 42px;
  height: 42px;
  font-size: 20px;
  box-shadow: none;
}

.brand-name {
  font-weight: 900;
  font-size: 22px;
}

.brand-version {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

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

.nav button {
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  background: transparent;
  color: var(--muted);
}

.nav button.active {
  background: #ecfdf5;
  color: #047857;
}

.nav button:hover {
  background: #f0f6ff;
  color: var(--ink);
}

.user-box {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.user-box-profile,
.user-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-edit-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.user-edit-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 12px;
  background: #fbfdff;
}

.user-edit-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-edit-fields {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.user-edit-switch {
  align-self: end;
}

.user-edit-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.main {
  min-width: 0;
}

.topbar {
  background: rgba(247, 249, 253, 0.92);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  backdrop-filter: blur(16px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.topbar-brand .brand-mark {
  width: 38px;
  height: 38px;
  font-size: 18px;
  box-shadow: none;
}

.topbar-brand .brand-name {
  font-size: 18px;
  line-height: 1.1;
}

.topbar h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
}

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

.content {
  padding: 28px;
  display: grid;
  gap: 22px;
}

.section {
  display: grid;
  gap: 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 20px;
}

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.inline-title {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-title .btn {
  min-height: 34px;
  padding: 7px 12px;
}

.grid {
  display: grid;
  gap: 16px;
}

.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.daystart-grid,
.planning-grid,
.dashboard-grid,
.automation-grid,
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.day-card,
.planning-card,
.template-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #fff;
  display: grid;
  gap: 10px;
}

.day-card-head,
.planning-card-head,
.automation-head,
.calendar-date,
.kanban-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.danger-card {
  border-color: #fecaca;
  background: #fff7f7;
}

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

.mini-task {
  width: 100%;
  min-height: 0;
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 8px 9px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 650;
}

.mini-task small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.stat {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.stat strong {
  display: block;
  font-size: 28px;
}

.stat span {
  color: var(--muted);
}

.stat.stat-danger strong,
.stat.stat-danger span {
  color: var(--red);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(170px, 1fr) minmax(150px, 0.95fr) minmax(150px, 0.95fr) minmax(220px, 1.35fr);
  gap: 0;
  align-items: end;
  overflow: hidden;
  padding: 0;
}

.panel.toolbar {
  border-color: var(--line);
  background: white;
}

.toolbar .field {
  min-width: 0;
  gap: 5px;
  padding: 9px 12px 10px;
  border-right: 1px solid var(--line);
  background: #f8fbff;
}

.toolbar .field:last-child {
  border-right: 0;
}

.toolbar .field label {
  min-height: 15px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.toolbar .field input,
.toolbar .field select {
  min-height: 34px;
  border-color: #d7e2ef;
  border-radius: 7px;
  padding: 7px 9px;
  background: white;
  font-size: 13px;
  font-weight: 500;
}

.toolbar .field input:focus,
.toolbar .field select:focus {
  outline: 2px solid rgba(31, 156, 240, 0.18);
  border-color: var(--blue);
}

.field {
  display: grid;
  gap: 6px;
}

.field label,
.switch label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
  color: var(--ink);
}

.field textarea {
  resize: vertical;
  min-height: 88px;
}

.field select[multiple] {
  min-height: 120px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.required-task-fields {
  align-items: start;
}

.create-task-collapsed {
  display: flex;
  justify-content: flex-start;
}

.more-fields {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.more-fields summary {
  width: max-content;
  color: var(--blue);
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}

.more-fields summary::-webkit-details-marker {
  display: none;
}

.more-fields summary::after {
  content: " +";
}

.more-fields[open] summary {
  margin-bottom: 12px;
}

.more-fields[open] summary::after {
  content: " -";
}

.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

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

.task-card {
  background: white;
  border: 1px solid var(--line);
  border-left: 6px solid var(--blue);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.task-card.priority-Urgent {
  border-left-color: var(--red);
}

.task-card.priority-Hoog {
  border-left-color: var(--orange);
}

.task-card.priority-Normaal {
  border-left-color: var(--blue);
}

.task-card.priority-Laag {
  border-left-color: var(--green);
}

.task-list {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  align-self: start;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.department-task-groups {
  display: grid;
  gap: 16px;
}

.department-task-group {
  display: grid;
  gap: 10px;
  background: white;
  border: 1px solid var(--line);
  border-left: 6px solid var(--department-color, var(--blue));
  border-radius: var(--radius);
  padding: 14px;
}

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

.department-task-head h3 {
  margin: 0;
  font-size: 18px;
}

.department-task-head p {
  margin: 3px 0 0;
  color: var(--muted);
}

.department-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--department-color, var(--blue));
  flex: 0 0 auto;
}

.task-list-head,
.task-row {
  display: grid;
  grid-template-columns: 34px minmax(170px, 1.3fr) minmax(200px, 1.45fr) minmax(92px, 0.65fr) minmax(92px, 0.65fr) minmax(112px, 0.82fr) minmax(86px, 0.58fr) minmax(96px, 0.62fr) minmax(135px, 0.95fr);
  gap: 8px;
  align-items: center;
}

.task-list.no-department .task-list-head,
.task-list.no-department .task-row {
  grid-template-columns: 34px minmax(180px, 1.35fr) minmax(220px, 1.55fr) minmax(92px, 0.7fr) minmax(112px, 0.85fr) minmax(86px, 0.62fr) minmax(96px, 0.68fr) minmax(145px, 1fr);
}

.task-list-head {
  min-height: 32px;
  padding: 6px 12px;
  background: #f4f8fc;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.task-list-head span,
.task-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row {
  width: 100%;
  min-height: 36px;
  padding: 5px 12px;
  text-align: left;
  background: white;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
}

.task-row:last-child {
  border-bottom: 0;
}

.task-row:hover,
.task-row.selected,
.task-row.drag-over {
  background: #f0fdf4;
}

.task-row.dragging {
  opacity: 0.72;
  box-shadow: var(--shadow);
}

.task-row.drag-ready {
  cursor: grabbing;
}

.drag-handle {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  cursor: grab;
  font-size: 13px;
  line-height: 1;
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle:hover {
  background: #e0f2fe;
  color: var(--ink);
}

.task-row strong {
  display: block;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row small,
.task-description {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-title {
  font-size: 16px;
  font-weight: 900;
}

.task-meta,
.muted {
  color: var(--muted);
  font-size: 13px;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  background: #eef4fb;
}

.badge.status-Nieuw {
  background: #e0f2fe;
  color: #075985;
}

.badge.status-Bezig {
  background: #fff7ed;
  color: #9a3412;
}

.badge.status-Wacht {
  background: #fef9c3;
  color: #854d0e;
}

.badge.status-Klaar {
  background: #dcfce7;
  color: #166534;
}

.badge.status-Geblokkeerd {
  background: #fee2e2;
  color: #991b1b;
}

.avatar-stack {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.avatar {
  --avatar-color: var(--blue);
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--avatar-color);
  color: white;
  border: 2px solid white;
  object-fit: cover;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 0 1px rgba(23, 32, 51, 0.08);
  flex: 0 0 auto;
}

.avatar.sm {
  width: 26px;
  height: 26px;
}

.avatar.md {
  width: 38px;
  height: 38px;
  font-size: 13px;
}

.avatar.xl {
  width: 118px;
  height: 118px;
  font-size: 32px;
  border-width: 4px;
}

.avatar-stack .avatar + .avatar {
  margin-left: -8px;
}

.avatar.more {
  background: #e8eef6;
  color: var(--ink);
}

.profile-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.profile-photo-panel {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
}

.profile-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.badge.risk-high,
.risk-panel.risk-high {
  background: #fee2e2;
  color: #991b1b;
}

.badge.risk-medium,
.risk-panel.risk-medium {
  background: #fff7ed;
  color: #9a3412;
}

.badge.risk-low,
.risk-panel.risk-low {
  background: #dcfce7;
  color: #166534;
}

.risk-panel {
  border: 1px solid currentColor;
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.risk-panel .muted {
  color: inherit;
  opacity: 0.78;
}

.load-green {
  background: #dcfce7;
  color: #166534;
}

.load-orange {
  background: #fff7ed;
  color: #9a3412;
}

.load-red {
  background: #fee2e2;
  color: #991b1b;
}

.workload-bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.workload-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: currentColor;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  font-size: 12px;
}

.metric-row span {
  display: grid;
  gap: 2px;
}

.btn {
  min-height: 40px;
  padding: 10px 14px;
  background: var(--ink);
  color: white;
}

.btn.secondary {
  background: #e8eef6;
  color: var(--ink);
}

.btn.green {
  background: var(--green);
}

.btn.orange {
  background: var(--orange);
}

.btn.red {
  background: var(--red);
}

.btn.small {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 13px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.detail {
  position: static;
  width: 100%;
  display: grid;
  gap: 16px;
  scroll-margin-top: 96px;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.detail h3,
.panel h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.list {
  display: grid;
  gap: 10px;
}

.line-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.line-item:last-child {
  border-bottom: 0;
}

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

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 86px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.file-item:last-child {
  border-bottom: 0;
}

.file-thumb {
  position: relative;
  display: inline-grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.file-thumb img {
  width: 76px;
  height: 58px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  transition: transform 160ms ease, box-shadow 160ms ease;
  transform-origin: left center;
}

.file-thumb:hover img {
  width: min(50vw, 640px);
  height: min(50vh, 420px);
  object-fit: contain;
  transform: none;
  box-shadow: var(--shadow);
  z-index: 30;
}

.file-thumb span,
.file-link {
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-timestamp {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
  text-align: right;
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.view-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.view-tabs button {
  min-height: 36px;
  padding: 8px 12px;
  background: #e8eef6;
  color: var(--ink);
  white-space: nowrap;
}

.view-tabs button.active {
  background: var(--green);
  color: white;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 12px;
  overflow-x: auto;
}

.kanban-column {
  min-width: 220px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.kanban-card {
  display: grid;
  gap: 7px;
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  font-weight: 600;
}

.kanban-card span {
  color: var(--muted);
  font-size: 12px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.calendar-day {
  display: grid;
  gap: 8px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 2fr) 120px;
  gap: 12px;
  align-items: center;
  background: #fff;
  color: var(--ink);
  text-align: left;
  padding: 8px;
  font-weight: 650;
}

.timeline-track {
  height: 12px;
  background: #e8eef6;
  border-radius: 999px;
  overflow: hidden;
}

.timeline-track i,
.chart-row i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--blue), var(--orange));
  border-radius: inherit;
}

.inbox-list,
.gmail-actions {
  display: grid;
  gap: 14px;
}

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

.inbox-item h3 {
  margin: 3px 0 8px;
}

.inbox-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.automation-card {
  display: grid;
  gap: 10px;
}

.chart-card {
  display: grid;
  gap: 12px;
}

.chart-bars {
  display: grid;
  gap: 8px;
}

.chart-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(120px, 2fr) 44px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.chart-row div {
  height: 11px;
  background: #edf4fb;
  border-radius: 999px;
  overflow: hidden;
}

.template-card {
  align-content: start;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.switch {
  display: flex;
  align-items: center;
  gap: 10px;
}

.switch input {
  width: 18px;
  height: 18px;
}

.notice {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #fef9c3;
  color: #713f12;
  border: 1px solid #fde68a;
}

.error {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.success {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.empty {
  color: var(--muted);
  padding: 24px;
  text-align: center;
  background: white;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.mobile-nav {
  display: none;
}

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

  .login-brand {
    padding: 32px 28px 0;
  }

  .login-brand h1 {
    font-size: 40px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .mobile-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    background: white;
    position: sticky;
    top: 77px;
    z-index: 9;
  }

  .mobile-nav button {
    white-space: nowrap;
    background: #edf4fb;
    color: var(--ink);
    padding: 9px 12px;
  }

  .mobile-nav button.active {
    background: var(--green);
    color: white;
  }

  .topbar {
    top: 0;
    padding: 14px 16px;
    align-items: flex-start;
  }

  .topbar-left {
    align-items: flex-start;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .content {
    padding: 18px 16px 28px;
  }

  .stats,
  .form-grid,
  .split,
  .profile-layout,
  .profile-fields,
  .inbox-item,
  .inbox-fields,
  .toolbar {
    grid-template-columns: 1fr;
  }

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

  .toolbar .field:last-child {
    border-bottom: 0;
  }

  .task-list-head {
    display: none;
  }

  .task-row {
    grid-template-columns: 34px minmax(150px, 1.2fr) minmax(170px, 1.4fr) minmax(84px, 0.8fr) minmax(84px, 0.8fr) minmax(108px, 0.8fr) minmax(84px, 0.7fr) minmax(92px, 0.8fr) minmax(110px, 1fr);
    align-items: start;
    overflow-x: auto;
  }

  .task-list.no-department .task-row {
    grid-template-columns: 34px minmax(150px, 1.2fr) minmax(170px, 1.4fr) minmax(84px, 0.8fr) minmax(108px, 0.8fr) minmax(84px, 0.7fr) minmax(92px, 0.8fr) minmax(110px, 1fr);
  }

  .task-row span:first-child {
    grid-column: auto;
  }

  .task-description {
    grid-column: auto;
  }

  .detail {
    position: static;
  }
}

@media (max-width: 620px) {
  .login-panel {
    padding: 22px;
  }

  .login-card {
    padding: 20px;
  }

  .topbar {
    display: grid;
    gap: 12px;
  }

  .topbar-left {
    display: grid;
    gap: 10px;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .task-grid,
  .task-row {
    grid-template-columns: 34px minmax(130px, 1.2fr) minmax(150px, 1.4fr) minmax(80px, 0.8fr) minmax(80px, 0.8fr) minmax(104px, 0.8fr) minmax(80px, 0.7fr) minmax(90px, 0.8fr) minmax(108px, 1fr);
  }

  .task-list.no-department .task-row {
    grid-template-columns: 34px minmax(130px, 1.2fr) minmax(150px, 1.4fr) minmax(80px, 0.8fr) minmax(104px, 0.8fr) minmax(80px, 0.7fr) minmax(90px, 0.8fr) minmax(108px, 1fr);
  }

  .metric-row,
  .timeline-row {
    grid-template-columns: 1fr;
  }

  .section-head {
    display: grid;
  }
}
