:root {
  --ink: #111617;
  --muted: #667171;
  --line: #ded8cf;
  --soft: #f7f5f1;
  --panel: #ffffff;
  --nav: #020303;
  --nav-2: #0a1717;
  --teal: #004d49;
  --teal-soft: #e5f0ee;
  --gold: #e8b064;
  --gold-soft: #f8ead6;
  --accent: var(--teal);
  --accent-dark: #003f3b;
  --warning: #c77825;
  --danger: #b5473f;
  --success: #2f8651;
  --shadow: 0 18px 45px rgba(20, 35, 48, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(232, 176, 100, 0.09) 0, rgba(232, 176, 100, 0) 320px),
    var(--soft);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.login-screen {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(0, 77, 73, 0.94), rgba(2, 3, 3, 0.98)),
    var(--nav);
  display: grid;
  gap: 34px;
  grid-template-columns: minmax(260px, 460px) minmax(320px, 440px);
  min-height: 100vh;
  padding: clamp(24px, 5vw, 72px);
}

.login-screen[hidden],
.app-shell[hidden] {
  display: none;
}

.login-brand {
  align-items: center;
  display: flex;
  min-width: 0;
}

.login-brand img {
  display: block;
  max-width: min(100%, 420px);
  width: 100%;
}

.login-panel {
  background: #fff;
  border: 1px solid rgba(232, 176, 100, 0.36);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  display: grid;
  gap: 16px;
  padding: clamp(22px, 4vw, 34px);
}

.login-panel h1 {
  font-size: 34px;
  letter-spacing: 0;
  line-height: 1;
  margin: 6px 0 0;
}

.login-panel label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 7px;
}

.login-panel input {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 44px;
  padding: 0 12px;
}

.login-panel input:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(0, 77, 73, 0.12);
}

.login-panel .primary-button {
  min-height: 44px;
}

.login-error {
  background: #fff1f0;
  border: 1px solid rgba(181, 71, 63, 0.24);
  border-radius: 8px;
  color: var(--danger);
  font-size: 13px;
  margin: 0;
  padding: 10px 12px;
}

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

.sidebar {
  background:
    radial-gradient(circle at 18px 18px, rgba(232, 176, 100, 0.18), transparent 28px),
    linear-gradient(180deg, var(--nav), var(--nav-2));
  color: #ecfbf8;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  align-items: center;
  display: flex;
  gap: 12px;
  min-height: 54px;
  min-width: 0;
}

.brand-logo {
  display: block;
  height: auto;
  max-height: 46px;
  object-fit: contain;
  object-position: left center;
  width: 205px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: rgba(236, 251, 248, 0.82);
  display: flex;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  text-align: left;
}

.nav-item span {
  align-items: center;
  display: inline-flex;
  font-size: 18px;
  justify-content: center;
  width: 22px;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
}

.nav-item.active {
  box-shadow: inset 3px 0 0 var(--gold);
}

.sidebar-card {
  border: 1px solid rgba(232, 176, 100, 0.34);
  border-radius: 8px;
  margin-top: auto;
  padding: 16px;
}

.sidebar-card strong {
  display: block;
  font-size: 28px;
  margin: 6px 0;
}

.sidebar-card small {
  color: rgba(236, 251, 248, 0.72);
}

.workspace {
  min-width: 0;
  padding: 22px 28px 42px;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 26px;
}

.search-wrap {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  max-width: 620px;
  min-height: 44px;
  padding: 0 14px;
  width: min(100%, 620px);
}

.search-wrap span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.search-wrap input {
  border: 0;
  color: var(--ink);
  min-width: 0;
  outline: 0;
  width: 100%;
}

.topbar-actions,
.modal-actions,
.pipeline-toolbar,
.project-toolbar,
.task-toolbar {
  align-items: center;
  display: flex;
  gap: 10px;
}

.create-menu {
  position: relative;
}

.create-menu-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  min-width: 210px;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
}

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

.create-menu-panel button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  min-height: 38px;
  padding: 0 10px;
  text-align: left;
}

.create-menu-panel button:hover {
  background: var(--gold-soft);
}

.task-link-label {
  overflow: visible;
}

.task-link-combobox {
  position: relative;
}

.task-link-combobox input {
  width: 100%;
}

.task-link-menu {
  left: 0;
  max-height: 260px;
  overflow: auto;
  right: auto;
  top: calc(100% + 8px);
  width: 100%;
}

.task-link-menu button {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-link-empty {
  color: var(--muted);
  display: block;
  font-size: 13px;
  padding: 10px;
}

.user-button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: inline-flex;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px 0 8px;
}

.user-button:hover,
.user-button:focus-visible {
  border-color: var(--teal);
  outline: 0;
}

.user-avatar {
  align-items: center;
  background: var(--teal);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.user-meta {
  display: grid;
  gap: 1px;
  text-align: left;
}

.user-meta strong {
  font-size: 13px;
  line-height: 1.1;
}

.user-meta small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
}

.primary-button,
.ghost-button,
.danger-button,
.icon-button,
.segmented,
.import-button {
  border-radius: 8px;
  min-height: 38px;
}

.primary-button {
  background: var(--gold);
  border: 1px solid var(--gold);
  color: #070707;
  font-weight: 750;
  padding: 0 16px;
}

.primary-button:hover {
  background: #d99e55;
}

.ghost-button,
.danger-button,
.segmented,
.import-button {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0 12px;
}

.danger-button {
  border-color: rgba(181, 71, 63, 0.38);
  color: var(--danger);
  padding: 0 12px;
}

.danger-button:hover {
  background: #fff1f0;
  border-color: var(--danger);
}

.ghost-button:hover,
.segmented:hover,
.segmented.active,
.import-button:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.ghost-button.connected {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--teal);
}

.import-button {
  align-items: center;
  display: inline-flex;
  font-weight: 750;
  gap: 8px;
  white-space: nowrap;
}

.import-button input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.icon-button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  display: inline-flex;
  font-size: 22px;
  height: 38px;
  justify-content: center;
  padding: 0;
  width: 38px;
}

.icon-button:hover {
  border-color: var(--gold);
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.notice {
  background: #fff;
  border: 1px solid rgba(232, 176, 100, 0.62);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  color: var(--ink);
  margin-bottom: 18px;
  padding: 12px 14px;
}

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

.page-heading h1 {
  font-size: 34px;
  line-height: 1.08;
  margin: 4px 0 0;
}

.page-heading p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
  max-width: 560px;
}

.eyebrow {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.metric-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(17, 22, 23, 0.05);
}

.metric {
  position: relative;
  overflow: hidden;
}

.metric::before {
  background: var(--gold);
  content: "";
  height: 4px;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
}

.metric {
  min-height: 126px;
  padding: 18px;
}

.metric span,
.metric small {
  color: var(--muted);
}

.metric strong {
  display: block;
  font-size: 30px;
  margin: 9px 0 2px;
}

.dashboard-grid,
.reports-grid,
.split-layout {
  display: grid;
  gap: 18px;
}

.contact-directory-layout {
  display: grid;
  gap: 18px;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
}

.split-layout {
  grid-template-columns: minmax(340px, 0.9fr) minmax(0, 1.2fr);
}

.reports-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.7fr);
}

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

.settings-card {
  align-content: space-between;
  display: grid;
  gap: 18px;
  min-height: 220px;
}

.settings-card h2 {
  font-size: 20px;
  margin: 6px 0 8px;
}

.settings-card p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.settings-status {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 750;
  margin-top: 12px;
  min-height: 28px;
  padding: 5px 10px;
  width: fit-content;
}

.settings-status.connected {
  background: var(--teal-soft);
  border-color: rgba(0, 77, 73, 0.24);
  color: var(--teal);
}

.settings-import-button {
  justify-content: center;
  width: fit-content;
}

.profile-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
}

.profile-card {
  align-items: center;
  display: flex;
  gap: 18px;
}

.profile-avatar-large {
  align-items: center;
  background: var(--teal);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 76px;
  font-size: 24px;
  font-weight: 850;
  height: 76px;
  justify-content: center;
  width: 76px;
}

.profile-card h2 {
  font-size: 28px;
  margin: 4px 0 6px;
}

.profile-card p {
  color: var(--muted);
  margin: 0;
}

.calendar-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.7fr);
}

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

.calendar-grid {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-top: 14px;
  overflow: hidden;
}

.calendar-weekday {
  background: var(--teal);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  padding: 10px;
  text-align: center;
}

.calendar-day {
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
  min-height: 126px;
  padding: 9px;
}

.calendar-day.muted {
  background: #f4f1eb;
  color: var(--muted);
}

.calendar-day.today {
  box-shadow: inset 0 0 0 2px var(--gold);
}

.calendar-day-number {
  align-items: center;
  background: var(--teal-soft);
  border-radius: 8px;
  color: var(--teal);
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.calendar-day-events {
  display: grid;
  gap: 5px;
}

.calendar-event {
  background: #f8f6f1;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  display: grid;
  gap: 2px;
  padding: 6px;
  text-align: left;
  width: 100%;
}

.calendar-event span,
.calendar-event small {
  color: var(--muted);
  font-size: 11px;
}

.calendar-event strong {
  font-size: 12px;
  line-height: 1.25;
}

.calendar-event-project {
  background: var(--gold-soft);
  cursor: pointer;
}

.calendar-event-project:hover,
.calendar-event-project:focus-visible {
  border-color: var(--gold);
  outline: none;
}

.montage-summary {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

#montage-view {
  background:
    linear-gradient(180deg, rgba(2, 3, 3, 0.96) 0, rgba(10, 23, 23, 0.94) 310px, rgba(247, 245, 241, 0) 310px),
    var(--soft);
  border-radius: 8px;
  margin: -16px;
  min-height: calc(100vh - 104px);
  padding: 22px 16px 16px;
}

#montage-view .page-heading {
  color: #ffffff;
  margin: 0 0 22px;
}

#montage-view .page-heading .eyebrow {
  color: var(--gold);
}

#montage-view .page-heading h1 {
  color: #ffffff;
}

#montage-view .page-heading p {
  color: rgba(236, 251, 248, 0.78);
}

#montage-view .metric {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(232, 176, 100, 0.3);
  box-shadow: none;
  color: #ffffff;
}

#montage-view .metric::before {
  background: var(--gold);
}

#montage-view .metric span,
#montage-view .metric small {
  color: rgba(236, 251, 248, 0.72);
}

.montage-board {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.montage-card {
  align-content: start;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 250, 247, 0.98));
  border-color: rgba(232, 176, 100, 0.34);
  border-top: 4px solid var(--gold);
  box-shadow: 0 18px 36px rgba(2, 3, 3, 0.12);
  display: grid;
  gap: 16px;
  overflow: hidden;
}

.montage-card-header {
  align-items: start;
  background: #fffaf2;
  border: 1px solid rgba(232, 176, 100, 0.22);
  border-radius: 8px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 13px;
}

.montage-card-header h2 {
  font-size: 20px;
  margin: 4px 0;
}

.montage-card-header p {
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
}

.montage-status {
  border: 1px solid transparent;
}

.montage-status-niet-gepland {
  background: #edf2f6;
  color: #425466;
}

.montage-status-gepland {
  background: var(--teal-soft);
  color: var(--teal);
}

.montage-status-onderweg {
  background: #eaf3ff;
  color: #2b5f9f;
}

.montage-status-bezig {
  background: var(--gold-soft);
  border-color: rgba(232, 176, 100, 0.52);
  color: #8b591f;
}

.montage-status-afgerond {
  background: #e6f4eb;
  color: var(--success);
}

.montage-status-probleem {
  background: #f8e7e4;
  color: var(--danger);
}

.montage-fields {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.montage-fields label,
.montage-checklist {
  display: grid;
  gap: 7px;
}

.montage-fields label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.montage-fields select,
.montage-note-input textarea {
  background: #ffffff;
  border-color: rgba(0, 77, 73, 0.18);
}

.montage-fields select:focus,
.montage-note-input textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232, 176, 100, 0.16);
  outline: none;
}

.montage-contact {
  background: var(--teal);
  border: 1px solid rgba(0, 77, 73, 0.18);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.montage-contact span {
  color: rgba(236, 251, 248, 0.88);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.montage-checklist .panel-header,
.montage-notes .panel-header,
.montage-files .panel-header {
  margin-bottom: 6px;
}

.montage-checklist h3,
.montage-notes h3,
.montage-files h3 {
  font-size: 15px;
  margin: 0;
}

.check-row {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  gap: 9px;
  min-height: 38px;
  padding: 8px 10px;
}

.check-row:hover {
  border-color: rgba(232, 176, 100, 0.72);
  box-shadow: 0 8px 18px rgba(20, 35, 48, 0.06);
}

.check-row input {
  accent-color: var(--teal);
  cursor: pointer;
  margin: 0;
}

.montage-note-list {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.montage-note-list p {
  background: #fffaf2;
  border: 1px solid rgba(232, 176, 100, 0.24);
  border-radius: 8px;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
  padding: 10px;
}

.montage-note-list strong {
  color: var(--ink);
  font-size: 12px;
}

.montage-note-input {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.montage-upload {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(0, 77, 73, 0.06), rgba(232, 176, 100, 0.08)),
    #fffaf2;
  border: 1px dashed rgba(232, 176, 100, 0.72);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 4px;
  justify-items: center;
  margin-bottom: 10px;
  min-height: 94px;
  padding: 16px;
  text-align: center;
}

.montage-upload:hover {
  background: #fff5e7;
  border-color: var(--gold);
}

.montage-upload input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.montage-upload span {
  color: var(--teal);
  font-weight: 850;
}

.montage-upload small {
  color: var(--muted);
}

.montage-attachment-grid {
  display: grid;
  gap: 8px;
}

.montage-attachment {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  padding: 8px;
}

.montage-attachment img,
.montage-file-icon {
  aspect-ratio: 1;
  border-radius: 6px;
  height: 58px;
  object-fit: cover;
  width: 58px;
}

.montage-file-icon {
  align-items: center;
  background: var(--teal-soft);
  color: var(--teal);
  display: flex;
  font-size: 11px;
  font-weight: 850;
  justify-content: center;
}

.montage-attachment a {
  color: var(--ink);
  display: block;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.montage-attachment small {
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.form-grid-two {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.project-toolbar {
  margin-bottom: 14px;
}

.pipeline-settings-button {
  margin-left: auto;
}

.project-card {
  align-content: start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(20, 35, 48, 0.06);
  cursor: pointer;
  display: grid;
  gap: 12px;
  margin-bottom: 10px;
  outline: 0;
  padding: 13px;
}

.project-card:hover,
.project-card:focus-visible {
  border-color: rgba(232, 176, 100, 0.72);
  box-shadow: 0 10px 22px rgba(20, 35, 48, 0.1);
}

.project-card-header {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.project-card h2 {
  font-size: 18px;
  margin: 4px 0 0;
}

.project-card p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.project-card.dragging {
  opacity: 0.5;
}

.closed-projects {
  margin-top: 18px;
}

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

.closed-project-grid .project-card {
  margin-bottom: 0;
}

.project-date-row {
  align-items: center;
  background: #fbfaf7;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 10px;
}

.project-date-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.project-date-row strong {
  color: var(--teal);
  font-size: 13px;
}

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

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

.panel-header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel h2,
.panel-header h2 {
  font-size: 18px;
  margin: 0;
}

.timeline,
.task-stack,
.recent-montage-list,
.contact-list,
.tasks-board {
  display: grid;
  gap: 10px;
}

.timeline-item,
.task-item,
.contact-row,
.linked-row,
.detail-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
}

.timeline-item {
  display: grid;
  gap: 4px;
}

.recent-montage-row {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 64px;
  padding: 12px;
  text-align: left;
  width: 100%;
}

.recent-montage-row:hover,
.recent-montage-row:focus-visible {
  border-color: rgba(232, 176, 100, 0.72);
  box-shadow: 0 8px 18px rgba(12, 25, 32, 0.08);
  outline: none;
}

.recent-montage-row strong,
.recent-montage-row span,
.recent-montage-row small {
  display: block;
}

.recent-montage-row span,
.recent-montage-row small {
  color: var(--muted);
  margin-top: 3px;
}

.recent-montage-meta {
  text-align: right;
  white-space: nowrap;
}

.recent-montage-meta span {
  color: var(--teal);
  font-weight: 850;
}

.timeline-item > div {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.undo-button {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--teal);
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 750;
  min-height: 30px;
  padding: 0 9px;
  white-space: nowrap;
}

.undo-button:hover {
  border-color: var(--gold);
  color: var(--ink);
}

.timeline-item small,
.task-meta,
.contact-row small,
.detail-muted {
  color: var(--muted);
}

.task-item {
  align-items: start;
  cursor: pointer;
  display: grid;
  gap: 8px;
  grid-template-columns: auto 1fr auto;
}

.task-item input {
  cursor: pointer;
  margin-top: 3px;
}

.task-item:hover,
.task-item:focus-visible {
  border-color: rgba(232, 176, 100, 0.72);
  box-shadow: 0 8px 18px rgba(12, 25, 32, 0.08);
  outline: none;
}

.task-item.done {
  opacity: 0.58;
}

.task-item.done strong {
  text-decoration: line-through;
}

.status-pill,
.count-pill,
.tag {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 750;
  min-height: 24px;
  padding: 4px 9px;
  white-space: nowrap;
}

.count-pill {
  background: var(--teal-soft);
  color: var(--teal);
}

.status-pill {
  background: #edf2f6;
  color: #425466;
}

.status-pill.hot {
  background: var(--gold-soft);
  color: #8b591f;
}

.status-pill.won {
  background: #e6f4eb;
  color: var(--success);
}

.tag {
  background: var(--teal-soft);
  color: var(--teal);
}

.contact-row {
  background: #fff;
  text-align: left;
  width: 100%;
}

.linked-row {
  background: #fff;
  display: block;
  margin-top: 10px;
  text-align: left;
  width: 100%;
}

.contact-row:hover,
.contact-row.active,
.linked-row:hover {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232, 176, 100, 0.18);
}

.contact-row strong,
.contact-row span,
.contact-row small,
.linked-row strong,
.linked-row span {
  display: block;
}

.contact-row span {
  margin: 4px 0;
}

.linked-row span {
  color: var(--muted);
  margin-top: 4px;
}

.detail-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

.contact-detail-page {
  display: grid;
  gap: 14px;
}

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

.avatar {
  align-items: center;
  background: var(--gold);
  border-radius: 8px;
  color: #172326;
  display: inline-flex;
  font-size: 18px;
  font-weight: 850;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.kanban {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.stage {
  background: #ece8e0;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 510px;
  padding: 12px;
}

.stage-header {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stage-header h2 {
  font-size: 15px;
  margin: 0;
}

.deal-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(20, 35, 48, 0.06);
  cursor: pointer;
  display: grid;
  gap: 9px;
  margin-bottom: 10px;
  outline: 0;
  padding: 13px;
}

.deal-card:hover,
.deal-card:focus-visible {
  border-color: rgba(232, 176, 100, 0.72);
  box-shadow: 0 10px 22px rgba(20, 35, 48, 0.1);
}

.deal-card.dragging {
  opacity: 0.5;
}

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

.deal-value {
  color: var(--teal);
  font-weight: 850;
}

.deal-margin {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.deal-footer {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.deal-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

.deal-outcome {
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  min-height: 32px;
}

.deal-outcome.won {
  background: #e6f4eb;
  color: var(--success);
}

.deal-outcome.lost {
  background: #fff1f0;
  color: var(--danger);
}

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

.contact-toolbar,
.export-row,
.target-setting-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contact-toolbar {
  margin: 0 0 10px;
}

.contact-toolbar select,
.target-setting-row input {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 34px;
  padding: 0 10px;
}

.target-setting-row input {
  min-width: 170px;
}

.report-goals-panel {
  grid-column: span 2;
}

.goals-form {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  margin-bottom: 14px;
}

.goals-form label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 850;
  gap: 6px;
  text-transform: uppercase;
}

.goals-form input {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 36px;
  padding: 0 10px;
}

.goals-form input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232, 176, 100, 0.16);
  outline: none;
}

.goals-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.goal-card {
  background: #fbfaf7;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.target-summary {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.target-summary span,
.target-label,
.recur-badge {
  color: var(--muted);
  font-size: 12px;
}

.target-track {
  background: var(--line);
  border-radius: 999px;
  height: 8px;
  margin-top: 8px;
  overflow: hidden;
}

.target-fill {
  background: linear-gradient(90deg, var(--teal), var(--gold));
  height: 100%;
}

.target-label {
  margin: 6px 0 0;
}

.export-row {
  margin-top: 14px;
}

.task-column {
  display: grid;
  gap: 10px;
}

.tasks-list {
  display: grid;
  gap: 18px;
}

.task-list-panel {
  display: grid;
  gap: 0;
}

.task-filter-bar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.task-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-filter-group .segmented {
  border-width: 1px;
  font-weight: 800;
}

.task-filter-open {
  background: var(--teal-soft);
  border-color: rgba(0, 77, 73, 0.2);
  color: var(--teal);
}

.task-filter-overdue {
  background: #f8e7e4;
  border-color: rgba(181, 71, 63, 0.24);
  color: var(--danger);
}

.task-filter-today {
  background: var(--gold-soft);
  border-color: rgba(232, 176, 100, 0.34);
  color: #8b591f;
}

.task-filter-upcoming {
  background: #eaf3ff;
  border-color: rgba(43, 95, 159, 0.22);
  color: #2b5f9f;
}

.task-filter-completed {
  background: #e6f4eb;
  border-color: rgba(47, 134, 81, 0.22);
  color: var(--success);
}

.task-filter-all {
  background: #edf2f6;
  border-color: rgba(66, 84, 102, 0.18);
  color: #425466;
}

.task-filter-group .segmented.active {
  box-shadow: inset 0 0 0 2px currentColor;
}

.task-filter-group .segmented:hover {
  filter: brightness(0.98);
}

.task-assignee-filter {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 850;
  gap: 8px;
  text-transform: uppercase;
}

.task-assignee-filter select {
  min-height: 38px;
  min-width: 190px;
  text-transform: none;
}

.completed-tasks {
  margin-top: 18px;
}

.collapse-button {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 850;
  gap: 8px;
  padding: 0;
}

.collapse-button:hover,
.collapse-button:focus-visible {
  color: var(--teal);
  outline: none;
}

.collapse-arrow {
  display: inline-grid;
  font-size: 22px;
  line-height: 1;
  place-items: center;
  width: 18px;
}

.task-list-header,
.task-list-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1.4fr) minmax(150px, 1fr) minmax(110px, 0.65fr) minmax(140px, 0.75fr) auto;
}

.task-list-header {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  padding: 12px 12px 10px;
  text-transform: uppercase;
}

.task-list-row {
  border-top: 1px solid var(--line);
  cursor: pointer;
  min-height: 58px;
  padding: 11px 12px;
}

.task-list-row:hover,
.task-list-row:focus-visible {
  background: #fbfaf7;
  outline: none;
}

.task-list-title {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.task-list-title input {
  cursor: pointer;
  flex: 0 0 auto;
}

.task-title-button {
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  padding: 0;
  text-align: left;
}

.task-title-button:hover,
.task-title-button:focus-visible {
  color: var(--teal);
  outline: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.task-relation-button {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--teal);
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  padding: 0;
  text-align: left;
}

.task-relation-button:hover,
.task-relation-button:focus-visible {
  outline: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.task-assignee {
  color: var(--muted);
  font-weight: 750;
}

.task-list-row.done {
  opacity: 0.58;
}

.task-list-row.done .task-title-button,
.task-item.done .task-title-button {
  text-decoration: line-through;
}

.empty-state {
  border-top: 1px solid var(--line);
  color: var(--muted);
  margin: 0;
  padding: 16px 12px;
}

.bar-chart {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.bar-row {
  display: grid;
  gap: 8px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
}

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

.bar-fill {
  background: linear-gradient(90deg, var(--teal), var(--gold));
  height: 100%;
}

.report-summary {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.modal {
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-width: 640px;
  padding: 0;
  width: calc(100% - 32px);
}

.modal::backdrop {
  background: rgba(12, 25, 32, 0.4);
}

.modal form {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.modal-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.modal-header h2 {
  margin: 0;
}

.modal label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 6px;
}

.modal input,
.modal textarea,
.modal select,
.link-select {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 40px;
  padding: 0 11px;
}

.create-fields,
.edit-fields {
  display: none;
  gap: 14px;
}

.create-fields.active,
.edit-fields.active {
  display: grid;
}

.stage-settings-list {
  display: grid;
  gap: 10px;
}

.stage-settings-row {
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  padding: 12px;
}

.stage-settings-row.dragging {
  opacity: 0.54;
}

.stage-order {
  align-items: center;
  background: var(--teal-soft);
  border-radius: 999px;
  color: var(--teal);
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.stage-drag-handle {
  align-items: center;
  color: var(--muted);
  cursor: grab;
  display: inline-flex;
  font-size: 18px;
  height: 28px;
  justify-content: center;
  user-select: none;
  width: 20px;
}

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

.stage-add-row {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.link-select {
  background: #fff;
  margin-top: 10px;
  width: 100%;
}

.modal textarea {
  line-height: 1.5;
  min-height: 130px;
  padding: 10px 11px;
  resize: vertical;
}

.modal-copy {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.contact-actions .primary-button,
.contact-actions .ghost-button,
.contact-actions .danger-button {
  align-items: center;
  display: inline-flex;
}

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

.activity-form {
  background: #fbfaf7;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 13px;
}

.activity-form label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 6px;
}

.activity-form input,
.activity-form select,
.activity-form textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 40px;
  padding: 0 11px;
}

.activity-form textarea {
  line-height: 1.5;
  min-height: 100px;
  padding: 10px 11px;
  resize: vertical;
}

.activity-input-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 160px minmax(0, 1fr);
}

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

.activity-item {
  border-left: 3px solid var(--gold);
  display: grid;
  gap: 6px;
  padding: 8px 0 8px 12px;
}

.activity-item div {
  align-items: baseline;
  display: flex;
  gap: 10px;
}

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

.activity-item p {
  line-height: 1.5;
  margin: 0;
}

.email-modal {
  max-width: 680px;
}

.modal-actions {
  justify-content: end;
  margin-top: 4px;
}

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

  .login-brand {
    justify-content: center;
  }

  .login-brand img {
    max-width: 340px;
  }

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

  .sidebar {
    height: auto;
    position: static;
  }

  .nav-list {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .nav-item {
    justify-content: center;
  }

  .nav-item span {
    display: none;
  }

  .sidebar-card {
    display: none;
  }

  .metric-grid,
  .montage-summary,
  .dashboard-grid,
  .split-layout,
  .reports-grid,
  .project-grid,
  .settings-grid,
  .tasks-board {
    grid-template-columns: 1fr 1fr;
  }

  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .report-goals-panel {
    grid-column: auto;
  }

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

@media (max-width: 680px) {
  .workspace {
    padding: 18px 14px 34px;
  }

  .topbar,
  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .user-button {
    flex: 1 1 180px;
  }

  .nav-list,
  .metric-grid,
  .montage-summary,
  .dashboard-grid,
  .split-layout,
  .reports-grid,
  .montage-board,
  .profile-layout,
  .montage-fields,
  .project-grid,
  .settings-grid,
  .activity-input-grid,
  .calendar-layout,
  .form-grid-two,
  .montage-note-input,
  .task-list-header,
  .task-list-row,
  .stage-settings-row,
  .stage-add-row,
  .tasks-board {
    grid-template-columns: 1fr;
  }

  .calendar-grid {
    overflow-x: auto;
  }

  .calendar-weekday,
  .calendar-day {
    min-width: 112px;
  }

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

  .task-filter-bar,
  .task-assignee-filter {
    align-items: stretch;
    flex-direction: column;
  }

  .task-filter-group,
  .task-assignee-filter select {
    width: 100%;
  }

  .task-filter-group .segmented {
    flex: 1 1 120px;
  }

  .pipeline-settings-button {
    margin-left: 0;
  }

  .nav-item {
    justify-content: start;
  }

  .nav-item span {
    display: inline-flex;
  }

  .page-heading h1 {
    font-size: 28px;
  }

  .kanban {
    grid-template-columns: repeat(4, minmax(240px, 82vw));
  }
}
