:root {
  color-scheme: light;
  --bg: #f5f7f3;
  --surface: #ffffff;
  --surface-strong: #fbfbf7;
  --ink: #192326;
  --muted: #687376;
  --line: #dde4dd;
  --asphalt: #263236;
  --asphalt-2: #334348;
  --teal: #0f8c86;
  --teal-dark: #0b625d;
  --amber: #e7a326;
  --green: #3d9559;
  --red: #c94b42;
  --violet: #6d62b7;
  --blue: #3377b9;
  --shadow: 0 24px 70px rgba(31, 44, 43, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(15, 140, 134, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(51, 67, 72, 0.04) 1px, transparent 1px),
    var(--bg);
  background-size: 36px 36px;
}

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

button {
  cursor: pointer;
}

img {
  max-width: 100%;
  display: block;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 10;
  background: var(--asphalt);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 12px;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(210px, 0.9fr) auto minmax(230px, 0.8fr);
  gap: 18px;
  align-items: center;
  padding: 14px clamp(16px, 3vw, 34px);
  background: rgba(245, 247, 243, 0.92);
  border-bottom: 1px solid rgba(38, 50, 54, 0.12);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 42%),
    var(--asphalt);
  box-shadow: inset 0 -4px 0 rgba(231, 163, 38, 0.78);
}

.brand-title,
.brand-subtitle,
.section-kicker,
.eyebrow,
.chip,
.mini-label {
  margin: 0;
}

.brand-title {
  font-weight: 800;
  line-height: 1.05;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 3px;
}

.view-tabs {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.tab-button,
.icon-button,
.primary-button,
.secondary-button,
.ghost-button {
  min-height: 40px;
  border: 0;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.tab-button {
  padding: 9px 12px;
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
}

.tab-button.is-active {
  color: #fff;
  background: var(--asphalt);
  box-shadow: 0 10px 20px rgba(38, 50, 54, 0.16);
}

.tab-button svg,
.primary-button svg,
.secondary-button svg,
.icon-button svg,
.ghost-button svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

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

.icon-button {
  width: 40px;
  padding: 0;
  color: var(--asphalt);
  background: #fff;
  border: 1px solid var(--line);
}

.primary-button {
  padding: 10px 15px;
  color: #fff;
  background: var(--teal-dark);
  box-shadow: 0 14px 30px rgba(15, 140, 134, 0.22);
}

.secondary-button,
.ghost-button {
  padding: 10px 14px;
  color: var(--asphalt);
  background: #fff;
  border: 1px solid var(--line);
}

.ghost-button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.86rem;
}

.primary-button:hover,
.secondary-button:hover,
.icon-button:hover,
.ghost-button:hover,
.tab-button:hover {
  transform: translateY(-1px);
}

main {
  width: min(1480px, calc(100% - clamp(24px, 5vw, 68px)));
  margin: 0 auto;
  padding: 26px 0 54px;
}

.view-panel {
  display: none;
}

.view-panel.is-active {
  display: block;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  align-items: stretch;
  min-height: 360px;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(231, 163, 38, 0.22), transparent 34%),
    var(--asphalt);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 4vw, 56px);
  color: #fff;
}

.eyebrow,
.section-kicker,
.mini-label {
  color: var(--teal-dark);
  text-transform: uppercase;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.hero-copy .eyebrow {
  color: #d9f4f0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--amber);
  box-shadow: 0 0 0 6px rgba(231, 163, 38, 0.18);
}

.hero-copy h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 680px;
  margin: 20px 0 26px;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(1rem, 1.6vw, 1.16rem);
  line-height: 1.6;
}

.hero-copy .secondary-button {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
}

.hero-visual {
  position: relative;
  min-height: 320px;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, var(--asphalt) 0%, rgba(38, 50, 54, 0.62) 18%, rgba(38, 50, 54, 0) 48%);
}

.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.kpi-card,
.project-card,
.alert-card,
.meeting-card,
.workload-card,
.template-card,
.letter-card,
.project-detail,
.table-shell {
  border: 1px solid rgba(38, 50, 54, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 40px rgba(31, 44, 43, 0.07);
}

.kpi-card {
  padding: 18px;
}

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

.kpi-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--asphalt);
}

.kpi-card strong {
  display: block;
  margin-top: 16px;
  font-size: 2rem;
  line-height: 1;
}

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

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 30px 0 14px;
}

.inline-heading {
  align-items: center;
}

.section-heading h2 {
  margin: 4px 0 0;
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  letter-spacing: 0;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.38fr);
  gap: 18px;
}

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

.alert-card {
  min-height: 192px;
  padding: 16px;
}

.alert-card h3,
.meeting-card h3,
.letter-card h3,
.template-card h3,
.project-card h3 {
  margin: 0;
  font-size: 1rem;
}

.alert-list {
  display: grid;
  gap: 10px;
  margin-top: 13px;
}

.alert-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--surface-strong);
  border: 1px solid rgba(38, 50, 54, 0.08);
}

.alert-item strong,
.task-title,
.letter-card strong {
  display: block;
  overflow-wrap: anywhere;
}

.task-title-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: start;
  gap: 8px;
}

.task-edit-button {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 8px;
}

.task-edit-button svg {
  width: 16px;
  height: 16px;
}

.alert-item span,
.muted,
.task-meta,
.dependency-note {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.meeting-panel {
  min-width: 0;
}

.meeting-list,
.project-list {
  display: grid;
  gap: 12px;
}

.meeting-card,
.workload-card,
.template-card,
.letter-card,
.project-card {
  padding: 16px;
}

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

.progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ece7;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--green));
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--asphalt);
  background: #eef3ee;
  border: 1px solid rgba(38, 50, 54, 0.08);
  white-space: nowrap;
}

.chip[data-tone="green"] {
  color: #1f5d36;
  background: #e6f4e8;
}

.chip[data-tone="red"] {
  color: #8d2b25;
  background: #fde9e6;
}

.chip[data-tone="amber"] {
  color: #7b520b;
  background: #fff1d4;
}

.chip[data-tone="blue"] {
  color: #174d7e;
  background: #e2f0fb;
}

.chip[data-tone="violet"] {
  color: #43398c;
  background: #eeeafd;
}

.chip[data-tone="teal"] {
  color: #0b625d;
  background: #dff4f1;
}

.project-layout {
  display: grid;
  grid-template-columns: minmax(270px, 0.32fr) minmax(0, 1fr);
  gap: 18px;
}

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

.project-card.is-selected {
  border-color: rgba(15, 140, 134, 0.45);
  box-shadow: 0 16px 42px rgba(15, 140, 134, 0.14);
}

.project-detail {
  min-width: 0;
  padding: 20px;
}

.detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.detail-head h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.3vw, 2.2rem);
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.stat-box {
  padding: 13px;
  border-radius: var(--radius);
  background: var(--surface-strong);
  border: 1px solid rgba(38, 50, 54, 0.08);
}

.stat-box strong {
  display: block;
  margin-top: 5px;
  font-size: 1.28rem;
}

.timeline {
  position: relative;
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.timeline-scale {
  position: relative;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
  color: var(--muted);
  font-size: 0.78rem;
}

.timeline-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 58px;
}

.timeline-info {
  min-width: 0;
}

.timeline-info strong {
  display: block;
  overflow-wrap: anywhere;
}

.timeline-track {
  position: relative;
  height: 34px;
  overflow: hidden;
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(90deg, rgba(38, 50, 54, 0.08) 0 1px, transparent 1px 10%),
    #edf2ed;
}

.timeline-bar {
  position: absolute;
  top: 6px;
  height: 22px;
  min-width: 8px;
  border-radius: 6px;
  background: var(--blue);
  box-shadow: 0 6px 14px rgba(38, 50, 54, 0.16);
}

.timeline-bar[data-tone="green"] {
  background: var(--green);
}

.timeline-bar[data-tone="red"] {
  background: var(--red);
}

.timeline-bar[data-tone="amber"] {
  background: var(--amber);
}

.timeline-bar[data-tone="violet"] {
  background: var(--violet);
}

.timeline-bar[data-tone="teal"] {
  background: var(--teal);
}

.today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--red);
  z-index: 1;
}

.contract-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--asphalt);
  opacity: 0.8;
}

.table-shell {
  overflow-x: auto;
}

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

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(38, 50, 54, 0.09);
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.76);
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.status-select,
.control-select,
input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

.status-select {
  min-width: 165px;
}

.person-select {
  min-width: 190px;
  font-weight: 800;
  color: var(--asphalt);
  background: #f8fbf8;
}

.critical-toggle,
.complete-toggle {
  display: grid;
  grid-template-columns: 18px auto;
  align-items: center;
  gap: 8px;
  min-width: 86px;
  font-weight: 800;
}

.critical-toggle input,
.complete-toggle input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
}

.dependency-section {
  margin-top: 18px;
}

.dependency-map {
  display: grid;
  gap: 14px;
}

.dependency-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dependency-empty,
.dependency-card {
  border: 1px solid rgba(38, 50, 54, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 40px rgba(31, 44, 43, 0.07);
}

.dependency-empty {
  padding: 18px;
}

.dependency-empty p {
  margin: 8px 0 0;
  color: var(--muted);
}

.critical-path {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.critical-node {
  min-height: 104px;
  padding: 14px;
  border: 1px solid rgba(208, 74, 60, 0.25);
  border-radius: var(--radius);
  background: #fff8f6;
}

.critical-node strong,
.critical-node span {
  display: block;
}

.critical-node strong {
  margin-top: 8px;
  font-size: 0.95rem;
}

.critical-node span:not(.critical-index) {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.critical-index {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--red);
  font-weight: 900;
  font-size: 0.8rem;
}

.critical-arrow {
  color: var(--muted);
  display: grid;
  place-items: center;
}

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

.dependency-card {
  padding: 16px;
}

.dependency-card.is-critical {
  border-color: rgba(208, 74, 60, 0.32);
}

.dependency-card h3 {
  margin: 0;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.dependency-block {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.dependency-pill {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) 26px;
  align-items: center;
  gap: 6px;
  padding: 8px 8px 8px 10px;
  border-radius: 8px;
  background: #f6f2ff;
  border: 1px solid rgba(109, 86, 173, 0.18);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.86rem;
}

.dependency-pill.is-child {
  display: inline-block;
  background: #eef8f4;
  border-color: rgba(27, 117, 94, 0.18);
}

.dependency-pill button {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: var(--red);
  background: rgba(208, 74, 60, 0.1);
  cursor: pointer;
}

.dependency-pill svg {
  width: 15px;
  height: 15px;
}

.assignment-panel {
  display: grid;
  grid-template-columns: minmax(220px, 320px);
  gap: 10px;
  margin: 18px 0;
}

.assignment-panel label {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(38, 50, 54, 0.1);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.complete-toggle,
.critical-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--asphalt);
  background: #fff;
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
}

.complete-toggle input,
.critical-toggle input,
.checkbox-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal-dark);
}

.control-select {
  width: auto;
  min-width: 190px;
}

.letter-grid,
.template-grid,
.notification-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.letter-card,
.template-card,
.notification-card,
.notification-settings {
  display: grid;
  gap: 12px;
}

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

.notification-settings,
.notification-card {
  padding: 16px;
  border: 1px solid rgba(38, 50, 54, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 40px rgba(31, 44, 43, 0.07);
}

.notification-settings {
  align-content: start;
}

.notification-settings label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.notification-summary {
  margin-bottom: 14px;
}

.notification-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0;
}

.notification-list {
  display: grid;
  gap: 14px;
}

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

.notification-metrics div {
  padding: 12px;
  border: 1px solid rgba(38, 50, 54, 0.08);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.notification-metrics strong {
  display: inline-block;
  margin-top: 4px;
  font-size: 1.6rem;
  line-height: 1;
}

.notification-metrics small {
  margin-left: 4px;
  color: var(--muted);
  font-weight: 700;
}

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

.email-address {
  font-size: clamp(1rem, 1.8vw, 1.35rem) !important;
  overflow-wrap: anywhere;
}

.email-preview {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.email-preview-subject {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(38, 50, 54, 0.1);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.email-preview pre {
  max-height: 46vh;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border-radius: var(--radius);
  background: #192326;
  color: #f5f7f3;
  white-space: pre-wrap;
  font: 0.88rem/1.55 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.letter-card.is-late {
  border-color: rgba(201, 75, 66, 0.35);
}

.template-card ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.app-dialog {
  width: min(760px, calc(100% - 28px));
  border: 0;
  padding: 0;
  border-radius: var(--radius);
  background: transparent;
}

.app-dialog::backdrop {
  background: rgba(25, 35, 38, 0.56);
  backdrop-filter: blur(4px);
}

.dialog-card {
  padding: 20px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dialog-header h2 {
  margin: 3px 0 0;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

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

.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.form-grid .checkbox-field {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 140, 134, 0.22);
  border-radius: var(--radius);
  color: var(--asphalt);
  background: #eff8f6;
}

.span-2 {
  grid-column: 1 / -1;
}

select[multiple] {
  min-height: 104px;
}

.empty-state {
  padding: 20px;
  color: var(--muted);
  border: 1px dashed rgba(38, 50, 54, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.6);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(360px, calc(100% - 36px));
  padding: 12px 14px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--asphalt);
  box-shadow: var(--shadow);
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .view-tabs {
    justify-content: flex-start;
    overflow-x: auto;
  }

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

  .dashboard-hero,
  .dashboard-layout,
  .project-layout,
  .notification-layout,
  .dependency-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 260px;
  }

  .hero-visual::before {
    background: linear-gradient(180deg, var(--asphalt) 0%, rgba(38, 50, 54, 0) 42%);
  }

  .kpi-grid,
  .notification-kpis,
  .workload-grid,
  .letter-grid,
  .template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  main {
    width: min(100% - 24px, 1480px);
    padding-top: 16px;
  }

  .brand-subtitle {
    display: none;
  }

  .tab-button span {
    display: none;
  }

  .top-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .dashboard-hero {
    min-height: 0;
  }

  .hero-copy {
    padding: 24px;
  }

  .hero-controls,
  .toolbar,
  .inline-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .kpi-grid,
  .notification-kpis,
  .workload-grid,
  .alert-grid,
  .letter-grid,
  .template-grid,
  .notification-metrics,
  .detail-stats,
    .form-grid {
    grid-template-columns: 1fr;
  }

  .critical-path {
    grid-auto-flow: row;
    grid-auto-columns: auto;
  }

  .critical-arrow {
    transform: rotate(90deg);
  }

  .detail-head,
  .timeline-row,
  .timeline-scale {
    grid-template-columns: 1fr;
  }

  .timeline-row {
    gap: 6px;
  }

  .control-select {
    width: 100%;
  }
}
