@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;800;900&family=Roboto+Slab:wght@500;700&display=swap");

:root {
  color-scheme: light;
  --brand: #e1251b;
  --brand-dark: #a91d17;
  --ink: #202226;
  --muted: #60646b;
  --line: #dedede;
  --panel: #fff;
  --page: #f5f5f2;
  --steel: #4f5965;
  --good: #2f855a;
  --blue: #177ea8;
  --gold: #b7791f;
  --shadow: 0 18px 42px rgba(32, 34, 38, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-family: Roboto, Arial, sans-serif;
}

button,
input {
  font: inherit;
}

select {
  font: inherit;
}

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

.role-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(18px, 4vw, 44px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

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

.brand-lockup img {
  width: 76px;
  height: auto;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  color: var(--steel);
  font-family: "Roboto Slab", Georgia, serif;
  font-size: clamp(1.15rem, 2vw, 1.65rem);
}

h2 {
  color: var(--brand);
  font-size: clamp(1.55rem, 3vw, 2.5rem);
  font-weight: 900;
}

h3 {
  color: var(--steel);
  font-size: 1.02rem;
  font-weight: 900;
}

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

.status-pill,
.domain-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  color: var(--steel);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.domain-pill {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand-dark);
}

.role-main {
  display: grid;
  gap: 22px;
  padding: 28px clamp(18px, 4vw, 44px) 44px;
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 24px;
  align-items: end;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-copy p:last-child {
  max-width: 780px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.sync-panel {
  display: grid;
  gap: 10px;
  padding: 18px;
  background: #f9faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sync-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.sync-line strong {
  color: var(--ink);
}

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

.metric-card,
.work-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(32, 34, 38, 0.06);
}

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

.metric-value {
  margin: 8px 0 4px;
  color: var(--ink);
  font-size: clamp(1.45rem, 2.7vw, 2.2rem);
  font-weight: 900;
}

.metric-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.metric-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  padding-top: 8px;
  border-top: 1px solid #ececec;
}

.metric-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.metric-name {
  color: var(--steel);
  font-size: 0.9rem;
  font-weight: 800;
}

.metric-amount {
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 900;
  white-space: nowrap;
}

.metric-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

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

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

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.count-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  color: var(--brand-dark);
  background: #ffe6e5;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

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

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

th,
td {
  padding: 13px 10px;
  text-align: left;
  border-bottom: 1px solid #ececec;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

td {
  color: var(--ink);
  font-size: 0.92rem;
}

.person-cell {
  font-weight: 900;
}

.money {
  color: var(--good);
  font-weight: 900;
}

.attention-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.attention-item {
  padding: 14px;
  background: #fafafa;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
}

.attention-item strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
}

.attention-item span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.split-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

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

.estimator-list-panel {
  align-self: start;
}

.estimator-select {
  display: grid;
  gap: 7px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.estimator-select select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
  text-transform: none;
}

.estimate-list {
  display: grid;
  gap: 10px;
  max-height: 540px;
  overflow: auto;
  padding-right: 4px;
}

.estimate-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 13px;
  background: #fafafa;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
}

.estimate-list-side {
  display: grid;
  gap: 8px;
  justify-items: end;
  text-align: right;
}

.estimate-list-side strong {
  color: var(--good);
  white-space: nowrap;
}

.item-title,
.item-reference,
.item-meta,
.item-notes {
  margin: 0;
}

.item-title {
  color: var(--ink);
  font-weight: 900;
}

.item-meta,
.item-reference,
.item-notes,
.muted-text {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.item-reference {
  margin-top: 3px;
  color: var(--steel);
  font-weight: 800;
}

.item-notes {
  margin-top: 5px;
}

.phone-link {
  color: var(--blue);
  font-size: 0.9rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.phone-link:hover {
  text-decoration: underline;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  justify-content: flex-end;
}

.text-link {
  color: var(--good);
}

.empty-state {
  padding: 16px;
  color: var(--muted);
  background: #fafafa;
  border: 1px dashed #d8d8d8;
  border-radius: 8px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.mini-card {
  min-height: 96px;
  padding: 14px;
  background: #f9faf9;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
}

.mini-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--steel);
}

.mini-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

@media (max-width: 980px) {
  .hero-band,
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .sales-lists-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .role-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .hero-band,
  .work-panel {
    padding: 18px;
  }

  .metric-grid,
  .split-list {
    grid-template-columns: 1fr;
  }

  .estimate-list-item {
    grid-template-columns: 1fr;
  }

  .estimate-list-side {
    justify-items: start;
    text-align: left;
  }

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