:root {
  color-scheme: light;
  --ink: #17201c;
  --muted: #657069;
  --line: #dfe6e1;
  --panel: #ffffff;
  --soft: #f4f7f4;
  --mint: #d9f4e3;
  --green: #2f8f58;
  --deep: #1f5f49;
  --coral: #e67a66;
  --gold: #d8a538;
  --blue: #3f78b5;
  --shadow: 0 16px 40px rgba(27, 48, 39, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

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

button {
  cursor: pointer;
}

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

.sidebar {
  background: #16231d;
  color: #fff;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

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

.mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--mint);
  color: var(--deep);
  border-radius: 8px;
  font-weight: 800;
}

.brand strong {
  display: block;
  font-size: 16px;
}

.brand span {
  color: #a8bbb1;
  font-size: 12px;
}

.tenant-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 18px;
}

.tenant-card label,
.field label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.tenant-card label {
  color: #a8bbb1;
}

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

.tenant-card select {
  background: #20332a;
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

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

.nav button {
  border: 0;
  background: transparent;
  color: #c9d8d0;
  padding: 11px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.nav button.active {
  background: #284437;
  color: #fff;
}

.main {
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 20px 28px;
  background: rgba(247, 248, 245, 0.92);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--line);
}

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

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

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

.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  min-height: 40px;
  padding: 9px 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.btn.primary {
  background: var(--deep);
  border-color: var(--deep);
  color: #fff;
}

.btn.warn {
  background: #fff4ed;
  border-color: #ffd7bd;
  color: #964315;
}

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

.content {
  padding: 26px 28px 44px;
}

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

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

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

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

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 0 rgba(20, 30, 25, 0.03);
}

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

.card h2 {
  font-size: 18px;
}

.card h3 {
  font-size: 15px;
}

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

.cloud-strip strong,
.cloud-strip span {
  display: block;
}

.metric {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.metric .value {
  font-size: 28px;
  font-weight: 800;
  margin-top: 8px;
}

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

.pill {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  background: var(--soft);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pill.ok {
  background: #e1f6e9;
  color: #237748;
}

.pill.alert {
  background: #fff2db;
  color: #966210;
}

.pill.danger {
  background: #ffe9e6;
  color: #a64336;
}

.bar {
  height: 8px;
  border-radius: 999px;
  background: #e9eee9;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--green);
}

.chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  align-items: end;
  height: 190px;
  padding-top: 12px;
}

.chart div {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.chart span {
  width: 100%;
  min-height: 22px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #3f9e6a, #98d4aa);
}

.list {
  display: grid;
  gap: 10px;
}

.row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  background: var(--soft);
  border-radius: 8px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green);
  font-weight: 800;
}

.calendar {
  display: grid;
  grid-template-columns: 82px repeat(5, minmax(120px, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.cell,
.headcell,
.timecell {
  min-height: 76px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px;
}

.headcell,
.timecell {
  background: #f3f6f3;
  color: var(--muted);
  font-size: 12px;
  min-height: auto;
}

.booking {
  border-left: 4px solid var(--green);
  background: #edf8f1;
  border-radius: 8px;
  padding: 8px;
  min-height: 58px;
  font-size: 12px;
}

.booking strong {
  display: block;
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  background: #f4f7f4;
}

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

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.tabs button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
}

.tabs button.active {
  background: var(--deep);
  color: #fff;
  border-color: var(--deep);
}

.public-preview {
  overflow: hidden;
  padding: 0;
}

.hero {
  min-height: 270px;
  background:
    linear-gradient(90deg, rgba(18, 32, 26, 0.88), rgba(18, 32, 26, 0.22)),
    url("https://images.unsplash.com/photo-1515377905703-c4788e51af15?auto=format&fit=crop&w=1600&q=80");
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero h2 {
  font-size: 34px;
  max-width: 560px;
  margin: 0 0 10px;
}

.hero p {
  max-width: 560px;
  margin: 0;
  color: #e7eee8;
}

.preview-body {
  padding: 18px;
}

.booking-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.flow-step {
  min-height: 58px;
  display: grid;
  place-items: center;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.flow-step.active {
  background: #eaf6ee;
  border-color: #bfe3cc;
  color: var(--deep);
}

.flow-step strong,
.flow-step span {
  display: block;
}

.steps {
  counter-reset: step;
  display: grid;
  gap: 10px;
}

.step {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  background: var(--soft);
  padding: 12px;
  border-radius: 8px;
}

.step::before {
  counter-increment: step;
  content: counter(step);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--deep);
  color: #fff;
  border-radius: 999px;
  font-weight: 800;
}

.modal-backdrop,
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 26, 21, 0.42);
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal {
  width: min(620px, 100%);
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.drawer-backdrop {
  place-items: stretch end;
  padding: 0;
}

.drawer {
  width: min(520px, 100%);
  background: #fff;
  height: 100%;
  padding: 20px;
  overflow-y: auto;
}

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

.field.full {
  grid-column: 1 / -1;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: #17201c;
  color: #fff;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 40;
}

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

.column {
  background: #eef3ee;
  border-radius: 8px;
  padding: 12px;
  min-height: 250px;
}

.column h3 {
  margin: 0 0 10px;
}

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

.rule-stack {
  display: grid;
  gap: 10px;
}

.rule {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--soft);
  border-radius: 8px;
  padding: 12px;
}

.rule p {
  margin: 4px 0 0;
}

.simulator {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.timeline {
  position: relative;
  height: 54px;
  border-radius: 8px;
  background: #eef3ee;
  overflow: hidden;
}

.timeline span {
  position: absolute;
  top: 9px;
  bottom: 9px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #cfeedd;
  color: #1f5f49;
  font-size: 12px;
  white-space: nowrap;
}

.timeline span.warn {
  background: #fff2db;
  color: #966210;
}

.merge-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.merge-card p {
  margin: 6px 0 12px;
}

.billing-timeline {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.billing-step {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  padding: 13px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.billing-step:last-child {
  border-bottom: 0;
}

.billing-step > span {
  color: var(--muted);
  font-size: 12px;
}

.billing-step.current {
  background: #fff8eb;
  box-shadow: inset 4px 0 0 var(--gold);
}

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

.policy-grid > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  background: var(--soft);
  border-radius: 8px;
  padding: 12px;
}

.footer-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 16px;
}

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

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

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

  .cols-4,
  .cols-3,
  .cols-2,
  .policy-grid,
  .booking-flow,
  .kanban {
    grid-template-columns: 1fr;
  }

  .calendar {
    grid-template-columns: 72px repeat(5, 180px);
    overflow-x: auto;
  }

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

@media (max-width: 640px) {
  .content,
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .nav {
    grid-template-columns: 1fr 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 24px;
  }

  .hero h2 {
    font-size: 27px;
  }
}
