:root {
  --ink: #1f2933;
  --muted: #627084;
  --line: #d9e1e8;
  --paper: #fbfcfd;
  --panel: #ffffff;
  --blue: #1b6fd8;
  --teal: #087f7a;
  --rose: #c53f5c;
  --gold: #c88719;
  --green: #2f7d4f;
  --shadow: 0 18px 45px rgba(28, 39, 55, 0.11);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(27, 111, 216, 0.07), rgba(8, 127, 122, 0.04) 34%, transparent 65%),
    #eef3f7;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  color: #f7fbff;
  background: #12324b;
}

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

.brand-mark {
  display: grid;
  width: 50px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: #12324b;
  background: #f7c45f;
  font-size: 13px;
  font-weight: 900;
}

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

.brand span,
.sidebar-card small {
  color: rgba(247, 251, 255, 0.72);
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: rgba(247, 251, 255, 0.78);
  background: transparent;
  text-align: left;
}

.nav-item:hover,
.nav-item.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.14);
}

.nav-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 800;
}

.sidebar-card {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
}

.workspace {
  min-width: 0;
  padding: 26px;
}

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

.topbar h1 {
  margin: 4px 0 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: 0;
}

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

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

.search {
  position: relative;
}

.search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.search input {
  width: min(32vw, 320px);
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--panel);
}

.primary-action,
.ghost-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius);
  font-weight: 800;
}

.primary-action {
  border: 1px solid #155db6;
  color: #fff;
  background: var(--blue);
}

.ghost-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.mobile-switcher {
  display: none;
}

.view {
  display: none;
}

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

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  min-height: 210px;
  padding: 26px;
  overflow: hidden;
  border: 1px solid #c9d9e7;
  border-radius: var(--radius);
  background:
    linear-gradient(110deg, #ffffff 0%, #f6fbff 50%, #e9f6f5 100%);
  box-shadow: var(--shadow);
}

.hero-band h2 {
  max-width: 720px;
  margin: 8px 0;
  font-size: clamp(25px, 3.6vw, 38px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-band p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.hero-art {
  position: relative;
  min-height: 170px;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #b7e0f2 0 56%, #73b99f 56% 100%);
  border: 1px solid #bdd2df;
  overflow: hidden;
}

.sun {
  position: absolute;
  right: 34px;
  top: 22px;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: #f7c45f;
}

.castle {
  position: absolute;
  left: 34px;
  bottom: 31px;
  display: flex;
  align-items: end;
  gap: 7px;
}

.castle span {
  display: block;
  width: 36px;
  height: 78px;
  background: #f6f8fb;
  border: 2px solid #7a99aa;
  border-radius: 8px 8px 0 0;
}

.castle span:nth-child(2) {
  height: 112px;
  background: #fff;
}

.coaster {
  position: absolute;
  right: 26px;
  bottom: 30px;
  width: 132px;
  height: 74px;
  border: 8px solid #17384f;
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 100px 100px 0 0;
  transform: rotate(-9deg);
}

.metric-grid,
.dashboard-grid,
.split-layout,
.builder-layout,
.portal-shell {
  display: grid;
  gap: 16px;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 16px 0;
}

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 8px 28px rgba(28, 39, 55, 0.06);
}

.metric {
  display: grid;
  gap: 8px;
  padding: 18px;
}

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

.metric strong {
  font-size: 30px;
  line-height: 1;
}

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

.panel {
  padding: 18px;
}

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

.panel h3 {
  margin: 4px 0 0;
  font-size: 20px;
  letter-spacing: 0;
}

.deadline-list,
.client-list,
.itinerary-list,
.document-list,
.template-list,
.compact-stack,
.reminder-table {
  display: grid;
  gap: 10px;
}

.deadline-item,
.client-card,
.stage-column,
.quote-row,
.itinerary-day,
.document-item,
.template-card,
.reminder-row,
.portal-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.deadline-item,
.client-card,
.quote-row,
.document-item,
.template-card,
.reminder-row {
  padding: 12px;
}

.deadline-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
}

.status-dot.high {
  background: var(--rose);
}

.status-dot.medium {
  background: var(--gold);
}

.deadline-item strong,
.client-card strong,
.document-item strong,
.template-card strong {
  display: block;
}

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

.stage-column {
  min-height: 180px;
  padding: 12px;
  background: #f8fafc;
}

.stage-column h4 {
  margin: 0 0 10px;
  font-size: 14px;
}

.stage-pill {
  margin: 8px 0;
  padding: 10px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid #e1e8ee;
}

.split-layout {
  grid-template-columns: 360px minmax(0, 1fr);
}

.client-list-panel {
  min-height: 620px;
}

.client-card {
  display: grid;
  gap: 6px;
  width: 100%;
  text-align: left;
  color: inherit;
}

.client-card.is-active {
  border-color: var(--blue);
  box-shadow: inset 3px 0 0 var(--blue);
}

.tag-row,
.detail-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: #1c435f;
  background: #eaf3fb;
  font-size: 12px;
  font-weight: 800;
}

.tag.green {
  color: #22593d;
  background: #e9f6ef;
}

.tag.gold {
  color: #6a4611;
  background: #fff4dc;
}

.tag.rose {
  color: #84223b;
  background: #fde9ef;
}

.client-detail {
  min-height: 620px;
}

.profile-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.profile-hero h2 {
  margin: 6px 0 6px;
  font-size: 30px;
  letter-spacing: 0;
}

.profile-actions {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.detail-grid {
  margin: 18px 0;
}

.detail-card {
  flex: 1 1 180px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f9fbfc;
}

.detail-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.notes-box {
  min-height: 92px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  resize: vertical;
}

.builder-layout {
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: start;
}

.quote-builder {
  display: grid;
  gap: 12px;
}

.quote-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 120px 120px 40px;
  gap: 10px;
  align-items: center;
}

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

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-weight: 900;
}

.price-total {
  margin: 10px 0;
  font-size: 38px;
  font-weight: 900;
}

.summary-panel {
  position: sticky;
  top: 18px;
}

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

.itinerary-day {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.itinerary-day header {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 10px;
}

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

.reminder-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 140px 120px 40px;
  gap: 10px;
  align-items: center;
}

.template-card {
  display: grid;
  gap: 8px;
}

.template-card textarea {
  width: 100%;
  min-height: 110px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  resize: vertical;
}

.portal-shell {
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: start;
}

.portal-preview {
  overflow: hidden;
  border: 1px solid #d3dfe9;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.portal-cover {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  padding: 26px;
  color: #fff;
  background:
    linear-gradient(115deg, rgba(18, 50, 75, 0.96), rgba(13, 116, 110, 0.9)),
    #12324b;
}

.portal-cover h2 {
  margin: 6px 0;
  font-size: 32px;
  letter-spacing: 0;
}

.portal-cover .eyebrow {
  color: #f7c45f;
}

.portal-scene {
  position: relative;
  min-height: 145px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #87c9eb 0 58%, #4fa075 58%);
  overflow: hidden;
}

.portal-scene:before {
  content: "";
  position: absolute;
  right: 20px;
  top: 18px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #f7c45f;
}

.portal-scene:after {
  content: "";
  position: absolute;
  left: 30px;
  bottom: 26px;
  width: 120px;
  height: 84px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, #fff 0 24%, #e8f0f6 24% 32%, #fff 32% 64%, #e8f0f6 64% 72%, #fff 72%);
  border: 2px solid #6e8fa4;
}

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

.portal-card {
  padding: 14px;
}

.portal-card.wide {
  grid-column: span 2;
}

.portal-card h4 {
  margin: 0 0 10px;
}

.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 340px;
  padding: 12px 14px;
  border: 1px solid #bdd2df;
  border-radius: var(--radius);
  color: #12324b;
  background: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

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

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

  .sidebar {
    display: none;
  }

  .workspace {
    padding: 18px;
  }

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

  .topbar-actions,
  .search input {
    width: 100%;
  }

  .mobile-switcher {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
  }

  .mobile-switcher button {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    background: #fff;
    font-weight: 800;
  }

  .mobile-switcher button.is-active {
    color: #fff;
    border-color: var(--blue);
    background: var(--blue);
  }

  .metric-grid,
  .dashboard-grid,
  .split-layout,
  .builder-layout,
  .portal-shell,
  .portal-body {
    grid-template-columns: 1fr 1fr;
  }

  .hero-band,
  .portal-cover {
    grid-template-columns: 1fr;
  }

  .summary-panel {
    position: static;
  }
}

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

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

  .topbar-actions,
  .profile-hero,
  .profile-actions {
    flex-direction: column;
  }

  .mobile-switcher {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric-grid,
  .dashboard-grid,
  .split-layout,
  .builder-layout,
  .portal-shell,
  .portal-body,
  .stage-board {
    grid-template-columns: 1fr;
  }

  .hero-band,
  .portal-cover {
    padding: 18px;
  }

  .quote-row,
  .reminder-row,
  .itinerary-day header {
    grid-template-columns: 1fr;
  }

  .portal-card.wide {
    grid-column: auto;
  }
}
