:root {
  --bg: #f2f2f0;
  --panel: #ffffff;
  --ink: #171717;
  --muted: #77736d;
  --line: #e5e1dc;
  --soft: #f7f4ef;
  --soft-warm: #fff0e8;
  --accent: #ff6a00;
  --accent-dark: #b04a00;
  --green: #2e8f5b;
  --red: #d62d2d;
  --blue: #0b82a5;
  --shadow: 0 18px 45px rgba(22, 22, 22, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex: 0 0 auto;
}

.tiny {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  color: var(--accent-dark);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-shell {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(330px, 430px) 1fr;
  gap: 24px;
  align-items: stretch;
}

.login-panel,
.login-preview,
.panel,
.metric-card,
.stat-wide,
.action-card,
.analytics-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel {
  padding: 36px;
}

.brand-chip {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 24px;
  font-weight: 900;
}

.brand-chip.small {
  width: 48px;
  height: 48px;
  font-size: 17px;
}

.eyebrow,
.muted,
.form-message,
.side-brand span,
.page-heading p,
small {
  color: var(--muted);
}

.eyebrow {
  margin-top: 24px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login-panel h1 {
  margin: 10px 0;
  font-size: 38px;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 30px;
}

.login-form label,
.assign-form label {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

input,
select,
textarea {
  min-height: 48px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
}

textarea {
  min-height: 132px;
  padding-top: 12px;
  resize: vertical;
}

.login-preview {
  position: relative;
  min-height: 510px;
  overflow: hidden;
  background: var(--soft);
}

.preview-map,
.map-panel {
  background:
    linear-gradient(rgba(247, 244, 239, 0.62), rgba(247, 244, 239, 0.62)),
    repeating-linear-gradient(0deg, transparent 0 38px, rgba(65, 60, 55, 0.12) 39px),
    repeating-linear-gradient(90deg, transparent 0 38px, rgba(65, 60, 55, 0.12) 39px),
    #e8dfd6;
}

.preview-map {
  position: absolute;
  inset: 0;
}

.pin,
.map-pin {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 5px solid var(--accent-dark);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: #fff;
}

.pin::after,
.map-pin::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.pin-one { left: 28%; top: 35%; }
.pin-two { left: 58%; top: 24%; border-color: #8d7f77; }
.pin-three { left: 72%; top: 65%; border-color: #8d7f77; }

.preview-card {
  position: absolute;
  right: 28px;
  bottom: 28px;
  width: 260px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

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

.preview-card strong {
  margin: 8px 0;
  font-size: 34px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 32px;
  padding: 30px;
  border-right: 1px solid var(--line);
  background: #efede9;
}

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

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

.side-brand strong {
  font-size: 22px;
}

.nav-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.nav-btn,
.soft-btn,
.primary-btn,
.import-btn,
.date-btn,
.icon-btn,
.avatar-btn,
.top-actions button,
.pager button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 8px;
  white-space: nowrap;
}

.nav-btn {
  justify-content: flex-start;
  padding: 0 14px;
  background: transparent;
  color: var(--ink);
  font-weight: 850;
  font-size: 22px;
}

.nav-btn.active {
  color: var(--accent-dark);
  background: #fff;
  box-shadow: inset 4px 0 0 var(--accent-dark), inset 0 0 0 1px var(--line);
}

.primary-btn,
.import-btn {
  padding: 0 20px;
  color: #fff;
  background: var(--accent);
  font-weight: 900;
}

.import-btn {
  background: var(--accent-dark);
}

.workspace {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 100px;
  gap: 24px;
  padding: 20px 40px;
  border-bottom: 1px solid var(--line);
  background: rgba(242, 242, 240, 0.86);
}

.global-search,
.field-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  border: 1px solid #d9b9a8;
  border-radius: 28px;
  background: #fff;
  padding: 0 16px;
}

.global-search {
  width: min(560px, 44vw);
}

.global-search input,
.field-search input {
  border: 0;
  min-height: 0;
  padding: 0;
  outline: 0;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-actions button {
  background: transparent;
  color: var(--ink);
  font-weight: 850;
}

.icon-btn,
.avatar-btn {
  width: 46px;
  padding: 0;
}

.avatar-btn {
  border-radius: 50%;
  background: var(--accent) !important;
  color: #fff !important;
}

.view {
  display: none;
  padding: 40px;
}

.view.active {
  display: grid;
  gap: 28px;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.page-heading h1 {
  margin: 0;
  font-size: 52px;
  letter-spacing: 0;
}

.page-heading p {
  margin: 10px 0 0;
  font-size: 18px;
}

.date-btn,
.soft-btn {
  border: 1px solid #d9b9a8;
  background: #fff;
  color: var(--ink);
  padding: 0 18px;
  font-weight: 850;
}

.accent-text {
  color: var(--accent-dark);
}

.metric-grid,
.appointment-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 28px;
}

.metric-card {
  display: grid;
  align-content: end;
  min-height: 230px;
  padding: 28px;
  border-left: 4px solid #b98255;
}

.metric-card.red { border-left-color: var(--red); }
.metric-card.orange { border-left-color: var(--accent); }
.metric-card.neutral { border-left-color: #8d7f77; }

.metric-icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f3ded4;
  color: var(--accent-dark);
  margin-bottom: 34px;
}

.metric-card span {
  color: #55413a;
}

.metric-card strong {
  margin-top: 12px;
  font-size: 44px;
  line-height: 1;
}

.analytics-panel {
  min-height: 320px;
  display: grid;
  place-items: center;
}

.chart-loader {
  display: grid;
  justify-items: center;
  gap: 16px;
  color: #9b8d86;
}

.chart-loader span {
  width: 46px;
  height: 46px;
  background:
    linear-gradient(var(--soft-warm), var(--soft-warm)) 10px 25px / 8px 21px no-repeat,
    linear-gradient(var(--soft-warm), var(--soft-warm)) 22px 14px / 8px 32px no-repeat,
    linear-gradient(var(--soft-warm), var(--soft-warm)) 34px 28px / 8px 18px no-repeat;
}

.assign-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  min-height: calc(100vh - 100px);
  margin: -40px;
}

.map-panel {
  position: relative;
  min-height: 720px;
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.map-panel::before,
.map-panel::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  height: 150px;
  background: rgba(23, 23, 23, 0.72);
}

.map-panel::before { top: 0; }
.map-panel::after { bottom: 0; }

.map-top {
  position: relative;
  z-index: 1;
  padding: 24px;
}

.map-pin.primary { left: 30%; top: 42%; }
.map-pin.secondary { right: 22%; top: 28%; border-color: #8d7f77; }
.map-pin.muted-pin { right: 32%; bottom: 29%; border-color: #8d7f77; }

.assign-panel {
  display: grid;
  align-content: start;
  gap: 24px;
  padding: 40px;
}

.alert-strip,
.notice {
  border-left: 4px solid var(--ink);
  background: #fff1e8;
}

.alert-strip {
  padding: 20px 24px;
}

.lead-summary h1 {
  margin: 12px 0 8px;
  font-size: 30px;
}

.lead-summary p {
  display: flex;
  gap: 8px;
  margin: 0;
  color: #4b3931;
}

.tag,
.hot {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.tag {
  color: #70645d;
  background: #e5dfda;
}

.hot {
  color: var(--accent-dark);
}

.assign-form {
  display: grid;
  gap: 18px;
  padding: 26px;
}

.compact-table {
  padding: 22px;
}

.compact-table h2 {
  margin-top: 0;
}

.notice {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
}

.notice span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

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

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.field-search {
  width: 320px;
  border-radius: 8px;
}

.data-table {
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 30px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 24px 30px;
  text-align: left;
  border-bottom: 1px solid #ead5ca;
}

th {
  background: #fff0e8;
  font-size: 20px;
}

td small {
  display: block;
  margin-top: 4px;
}

.warn-row {
  background: #fff0e8;
}

.pill,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 850;
}

.pill.warning,
.status.pending {
  border: 1px solid #d8b9aa;
  background: #f6dfd4;
  color: #78432d;
}

.pill.orange {
  background: var(--accent);
  color: #fff;
}

.status.active {
  border: 2px solid var(--blue);
  background: #caedf5;
  color: #176178;
}

.status.draft {
  border: 2px solid #77736d;
  background: #f3f0ee;
  color: #555;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 30px;
  background: #fff0e8;
}

.pager {
  display: flex;
  gap: 8px;
}

.pager button {
  min-width: 38px;
  border: 1px solid #d9b9a8;
  background: #fff;
}

.pager .active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.appointment-stats {
  grid-template-columns: 1fr 1fr 1fr;
}

.stat-wide,
.action-card {
  min-height: 178px;
  padding: 30px;
}

.stat-wide span,
.action-card span {
  display: block;
  font-size: 24px;
  font-weight: 850;
  color: #4c352c;
}

.stat-wide strong,
.action-card strong {
  display: block;
  margin-top: 22px;
  font-size: 52px;
}

.stat-wide em {
  float: right;
  padding: 8px 12px;
  border-radius: 8px;
  background: #cdeeff;
  color: #087ba0;
  font-style: normal;
}

.action-card {
  position: relative;
  overflow: hidden;
  background: #13a9d0;
  color: #06323d;
}

.action-card::after {
  content: "";
  position: absolute;
  right: -38px;
  top: -38px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(0, 122, 160, 0.25);
}

.action-card a {
  color: #06323d;
  font-weight: 900;
}

.danger-text {
  color: var(--red);
}

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

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

  .assign-layout,
  .metric-grid,
  .appointment-stats,
  .login-shell {
    grid-template-columns: 1fr;
  }

  .assign-layout {
    margin: 0;
  }
}
