:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #f7faf8;
  --ink: #171918;
  --muted: #5e6863;
  --line: #dfe4df;
  --green: #174c3c;
  --green-soft: #e5f0ea;
  --blue: #2459a7;
  --blue-soft: #e7eefb;
  --red: #a33a32;
  --amber: #a66a12;
  --shadow: 0 18px 40px rgba(24, 31, 29, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
}

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

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

.loading-screen,
.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.auth-panel {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.auth-copy {
  padding: 48px;
  background: #16231f;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
}

.auth-copy h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.04;
  letter-spacing: 0;
}

.auth-copy p {
  color: #d9e3de;
  line-height: 1.7;
}

.auth-form {
  padding: 48px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px 1fr;
}

.sidebar {
  background: #17231f;
  color: #eef6f2;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-brand strong {
  display: block;
}

.sidebar-brand span {
  display: block;
  color: #b7c7c0;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  color: #d9e5df;
  background: transparent;
  text-align: left;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
  color: #b7c7c0;
  font-size: 13px;
  display: grid;
  gap: 10px;
}

.main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  min-height: 76px;
  padding: 18px 30px;
  background: rgba(246, 244, 239, 0.92);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
}

.content {
  padding: 30px;
  display: grid;
  gap: 24px;
  align-content: start;
}

.toolbar,
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar {
  justify-content: space-between;
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.card h2,
.card h3 {
  margin: 0 0 14px;
  letter-spacing: 0;
}

.metric {
  min-height: 112px;
  display: grid;
  align-content: space-between;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  font-size: 34px;
  letter-spacing: 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
}

.table th,
.table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 700;
}

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

.pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.stage {
  min-height: 260px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.stage h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0;
}

.deal-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  display: grid;
  gap: 8px;
}

.deal-card strong {
  line-height: 1.35;
}

.meta-list {
  display: grid;
  grid-template-columns: minmax(90px, 0.7fr) minmax(0, 1fr);
  gap: 10px 14px;
  align-items: start;
}

.meta-list span {
  color: var(--muted);
}

.meta-list strong {
  overflow-wrap: anywhere;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  width: fit-content;
}

.pill.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.pill.amber {
  background: #fbedd8;
  color: var(--amber);
}

.muted {
  color: var(--muted);
}

.empty {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
}

.btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

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

.btn.warn {
  background: var(--amber);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.field textarea {
  min-height: 116px;
  resize: vertical;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.notice {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.notice.error {
  border-color: #e3b8b3;
  color: var(--red);
  background: #fff6f5;
}

.notice.success {
  border-color: #b8d7c8;
  color: var(--green);
  background: #f2fbf6;
}

.booking-shell {
  min-height: 100vh;
  padding: 28px;
}

.booking-frame {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 360px 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.booking-aside {
  padding: 34px;
  background: #17231f;
  color: #fff;
  display: grid;
  gap: 22px;
  align-content: start;
}

.booking-aside p {
  color: #cfddd6;
  line-height: 1.65;
}

.booking-main {
  padding: 34px;
  display: grid;
  gap: 22px;
}

.booking-pages,
.slots {
  display: grid;
  gap: 10px;
}

.option-button,
.slot-button {
  width: 100%;
  min-height: 52px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
  padding: 12px;
}

.option-button.active,
.slot-button.active,
.option-button:hover,
.slot-button:hover {
  border-color: var(--green);
  background: var(--green-soft);
}

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

@media (max-width: 980px) {
  .layout,
  .auth-panel,
  .booking-frame {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .grid.two,
  .grid.three,
  .grid.four {
    grid-template-columns: 1fr;
  }

  .pipeline {
    grid-template-columns: repeat(4, 260px);
  }
}

@media (max-width: 640px) {
  .content,
  .topbar,
  .booking-main,
  .booking-aside,
  .auth-copy,
  .auth-form {
    padding: 22px;
  }

  .booking-shell {
    padding: 0;
  }

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