:root {
  --ink: #14213d;
  --paper: #ffffff;
  --wash: #f5f7f8;
  --line: #d8dde4;
  --action: #fca311;
  --teal: #2a9d8f;
  --muted: #617089;
  --shadow: 0 20px 70px rgba(20, 33, 61, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--wash);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(90deg, rgba(20, 33, 61, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(20, 33, 61, 0.06) 1px, transparent 1px),
    var(--wash);
  background-size: 44px 44px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 42px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--paper);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

button:hover {
  transform: translateY(-1px);
  background: var(--ink);
  color: var(--paper);
}

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

.rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-height: 100vh;
  padding: 24px;
  color: var(--paper);
  background: var(--ink);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--paper);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 26px;
  line-height: 1;
  text-decoration: none;
}

.brand img {
  flex: 0 0 auto;
}

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

.tab {
  width: 100%;
  text-align: left;
  color: var(--paper);
  border-color: rgba(255, 255, 255, 0.18);
  background: transparent;
}

.tab.is-active,
.tab:hover {
  color: var(--ink);
  border-color: var(--action);
  background: var(--action);
}

.rail-note {
  margin-top: auto;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  line-height: 1.45;
}

.signal {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 0 5px rgba(42, 157, 143, 0.18);
}

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

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(32px, 5vw, 62px);
  line-height: 0.96;
}

h2 {
  font-size: clamp(25px, 3vw, 42px);
  line-height: 1.04;
}

h3 {
  font-size: 20px;
}

.search {
  display: grid;
  gap: 7px;
  width: min(320px, 100%);
}

.search label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.search input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 13px;
  color: var(--ink);
  background: var(--paper);
  outline: none;
}

.search input:focus,
textarea:focus {
  border-color: var(--action);
  box-shadow: 0 0 0 4px rgba(252, 163, 17, 0.18);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 22px 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.metric {
  min-height: 98px;
  padding: 16px;
  background: var(--paper);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 14px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 32px;
}

.metric-accent strong {
  color: var(--action);
}

.metric-teal strong {
  color: var(--teal);
}

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

.phone-mirror {
  position: sticky;
  top: 22px;
  overflow: hidden;
  border: 8px solid var(--ink);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.phone-top {
  display: flex;
  justify-content: space-between;
  padding: 13px 16px;
  color: var(--paper);
  background: var(--ink);
  font-size: 12px;
  text-transform: uppercase;
}

.phone-card {
  padding: 22px;
}

.phone-card dl {
  display: grid;
  gap: 13px;
  margin: 20px 0;
}

.phone-card dl div {
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

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

dd {
  margin: 4px 0 0;
  font-weight: 700;
}

.phone-note {
  color: var(--muted);
  line-height: 1.5;
}

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

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--action));
  transition: width 300ms ease;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 16px 18px;
}

.quick-actions button:first-child,
.action-row button:first-child,
.report-screen button {
  border-color: var(--action);
  background: var(--action);
}

.console {
  min-width: 0;
}

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

.pipe-step {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 54px;
  border-bottom: 3px solid var(--ink);
  padding: 10px 0;
}

.pipe-index {
  color: var(--action);
  font-weight: 700;
}

.pipe-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.screen {
  min-height: 460px;
  padding: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.case-layout,
.record-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(250px, 0.65fr);
  gap: 24px;
}

.lead {
  max-width: 650px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 24px 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.case-grid div {
  min-height: 96px;
  padding: 14px;
  background: var(--paper);
}

.case-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.case-grid strong {
  display: block;
  margin-top: 10px;
  overflow-wrap: anywhere;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.task-list,
.record-layout aside {
  border-left: 3px solid var(--teal);
  padding-left: 18px;
}

.task-list ul,
.doc-list,
.calendar-screen ul,
.report-paper {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.task-list li,
.doc-list li,
.calendar-row,
.report-paper li {
  display: grid;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.task-list b,
.doc-list b,
.calendar-row b {
  color: var(--teal);
}

.task-list em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  text-transform: uppercase;
}

.media-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.media-strip span {
  display: grid;
  place-items: center;
  min-height: 96px;
  border: 1px dashed var(--ink);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(42, 157, 143, 0.08);
}

.calendar-row {
  grid-template-columns: 160px minmax(0, 1fr) 110px;
  align-items: center;
}

.calendar-row time {
  color: var(--muted);
  font-size: 13px;
}

.report-paper li {
  grid-template-columns: minmax(0, 1fr) auto;
}

.report-paper p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
}

.empty,
.skeleton {
  padding: 24px;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 44px));
  padding: 14px 16px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  color: var(--ink);
  background: var(--action);
  box-shadow: var(--shadow);
  transform: translateY(22px);
  opacity: 0;
  pointer-events: none;
  transition: transform 180ms ease, opacity 180ms ease;
}

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

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

  .rail {
    position: static;
    min-height: auto;
    padding: 16px;
  }

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

  .tab {
    text-align: center;
    padding-inline: 8px;
  }

  .rail-note {
    margin-top: 0;
  }

  .topbar,
  .board,
  .case-layout,
  .record-layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .phone-mirror {
    position: static;
    max-width: 420px;
  }
}

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

  .brand {
    font-size: 22px;
  }

  .tabs,
  .metrics,
  .pipeline,
  .case-grid,
  .media-strip {
    grid-template-columns: 1fr;
  }

  .screen {
    min-height: 0;
    padding: 18px;
  }

  .calendar-row,
  .report-paper li {
    grid-template-columns: 1fr;
  }
}

