@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&display=swap");

:root {
  color-scheme: light;
  --page: oklch(0.955 0.004 120);
  --surface: oklch(0.988 0.003 120);
  --panel: oklch(0.997 0.002 120);
  --panel-soft: oklch(0.94 0.006 120);
  --ink: oklch(0.18 0.006 120);
  --ink-soft: oklch(0.29 0.006 120);
  --muted: oklch(0.52 0.006 120);
  --line: oklch(0.89 0.006 120);
  --line-strong: oklch(0.8 0.008 120);
  --lime: oklch(0.82 0.165 132);
  --lime-soft: oklch(0.92 0.075 132);
  --lime-ink: oklch(0.21 0.03 132);
  --warning: oklch(0.5 0.14 65);
  --warning-soft: oklch(0.94 0.06 82);
  --danger: oklch(0.49 0.17 30);
  --danger-soft: oklch(0.93 0.055 30);
  --shadow: 0 24px 70px oklch(0.18 0.006 120 / 0.08);
  font-family: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

button:hover {
  border-color: var(--ink);
  box-shadow: 0 10px 28px oklch(0.18 0.006 120 / 0.08);
}

button:active {
  transform: translateY(1px);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid oklch(0.82 0.165 132 / 0.3);
  outline-offset: 2px;
}

.sidebar {
  min-height: 100vh;
  background: var(--panel);
  color: var(--ink);
  padding: 28px 18px;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 10px 28px;
  margin-bottom: 20px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--lime);
  color: var(--ink);
  border-radius: 12px;
  font-weight: 900;
  font-size: 13px;
}

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

.brand small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
  font-size: 12px;
}

nav {
  display: grid;
  gap: 8px;
}

.nav-button {
  width: 100%;
  min-height: 48px;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  display: grid;
  gap: 1px;
  align-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: none;
}

.nav-button span {
  font-weight: 900;
  font-size: 13px;
}

.nav-button small {
  color: var(--muted);
  font-size: 11px;
}

.nav-button.active,
.nav-button:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
  box-shadow: none;
}

.nav-button.active small,
.nav-button:hover small {
  color: oklch(0.82 0.02 120);
}

.app {
  min-width: 0;
  padding: 30px clamp(18px, 3vw, 42px) 46px;
}

.topbar,
.panel-head,
.actions,
.topbar-actions,
.mini-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.topbar {
  margin-bottom: 22px;
}

.topbar-copy {
  min-width: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.02;
  font-weight: 800;
  max-width: 840px;
}

h2 {
  font-size: 22px;
  line-height: 1.18;
  font-weight: 800;
}

h3 {
  font-size: 15px;
  font-weight: 800;
}

p {
  line-height: 1.65;
}

.topbar p,
.panel p,
label,
td,
th {
  color: var(--muted);
}

.eyebrow,
.section-kicker {
  display: inline-block;
  color: var(--lime-ink);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.signal,
.badge {
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.signal {
  background: var(--panel);
  color: var(--muted);
  border: 1px solid var(--line);
}

.badge.success {
  background: var(--lime-soft);
  color: var(--lime-ink);
}

.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}

.primary:hover {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--ink);
}

.ghost {
  background: var(--panel);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.metric-card,
.panel,
.subpanel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 18px;
  min-height: 138px;
  display: grid;
  align-content: space-between;
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  content: "↗";
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  position: absolute;
  right: 16px;
  bottom: 16px;
  border-radius: 50%;
  background: oklch(0.9 0.004 120);
  color: var(--ink);
  font-weight: 900;
}

.metric-card:first-child {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}

.metric-card:first-child span,
.metric-card:first-child small {
  color: oklch(0.82 0.018 120);
}

.metric-card:first-child::after {
  background: oklch(0.34 0.006 120);
  color: var(--surface);
}

.metric-card.urgent {
  background: var(--panel);
}

.metric-card.paused {
  background: var(--lime);
  color: var(--ink);
  border-color: var(--lime);
}

.metric-card.paused::after {
  background: oklch(0.92 0.085 132);
}

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

.metric-card strong {
  display: block;
  font-size: 42px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0;
}

.panel {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.panel.narrow {
  max-width: 760px;
}

.overview-grid,
.facebook-layout,
.conversation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 14px;
}

.status-panel {
  min-height: 252px;
}

.command-panel {
  align-content: start;
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}

.command-panel p,
.command-panel .section-kicker {
  color: oklch(0.82 0.018 120);
}

.command-panel h2 {
  color: var(--surface);
}

.command-panel .ghost {
  background: var(--surface);
}

.check-grid,
.health-list {
  display: grid;
  gap: 10px;
}

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

.check-item,
.health-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 13px 14px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
}

.check-item:first-child {
  background: var(--lime);
  border-color: var(--lime);
}

.health-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.health-item span:last-child {
  color: var(--lime-ink);
}

.compact {
  margin-bottom: 8px;
}

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

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

.subpanel {
  padding: 16px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: inset 0 1px 0 oklch(0.18 0.006 120 / 0.03);
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

input::placeholder,
textarea::placeholder {
  color: oklch(0.62 0.006 120);
}

.stack {
  display: grid;
  gap: 12px;
}

.wide-stack {
  gap: 14px;
}

.editor-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  display: grid;
  gap: 12px;
  background: var(--surface);
}

.villa-preview {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: var(--panel);
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 13px 12px;
  white-space: nowrap;
}

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

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

td .status-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.status-pill.pending_payment {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-pill.confirmed {
  background: var(--lime-soft);
  color: var(--lime-ink);
}

.danger {
  color: var(--danger);
  border-color: var(--danger-soft);
  background: oklch(0.98 0.015 30);
}

.danger:hover {
  border-color: var(--danger);
  box-shadow: 0 8px 24px oklch(0.49 0.17 30 / 0.1);
}

.reply-panel textarea,
.connection-panel textarea {
  min-height: 260px;
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}

.legal-page {
  display: block;
  min-height: 100vh;
  padding: clamp(24px, 5vw, 64px);
  background: var(--page);
}

.legal-document {
  width: min(760px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(24px, 5vw, 48px);
  box-shadow: var(--shadow);
}

.legal-document a {
  color: var(--lime-ink);
  font-weight: 800;
}

.legal-document h1 {
  font-size: clamp(34px, 6vw, 58px);
}

.legal-document h2 {
  margin-top: 14px;
}

@media (max-width: 1080px) {
  body {
    grid-template-columns: 1fr;
    overflow-x: hidden;
  }

  .sidebar {
    min-height: auto;
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 14px;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
  }

  .brand {
    padding: 0 8px 14px;
    margin-bottom: 10px;
  }

  nav {
    display: flex;
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 4px;
  }

  .nav-button {
    min-width: 154px;
  }

  .app {
    max-width: 100vw;
    overflow-x: hidden;
  }
}

@media (max-width: 860px) {
  .topbar,
  .panel-head,
  .topbar-actions,
  .actions,
  .mini-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid,
  .overview-grid,
  .facebook-layout,
  .conversation-layout,
  .split,
  .form-grid,
  .editor-grid,
  .check-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 128px;
  }
}
