:root {
  --ink: #10241c;
  --ink-soft: #3d564a;
  --paper: #f7f3ea;
  --paper-2: #fffdf8;
  --brand: #0b3d2e;
  --brand-2: #146049;
  --line: rgba(16, 36, 28, 0.12);
  --whatsapp: #1faa59;
  --whatsapp-ink: #06361c;
  --email: #2a6fdb;
  --email-ink: #0c2d66;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(11, 61, 46, 0.12);
  --radius: 18px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(20, 96, 73, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(201, 162, 39, 0.16), transparent 50%),
    linear-gradient(180deg, #eef5f0 0%, var(--paper) 42%, #ebe4d6 100%);
  line-height: 1.45;
}

.bg-wash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(11, 61, 46, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 61, 46, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 75%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  backdrop-filter: blur(14px);
  background: rgba(247, 243, 234, 0.82);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.brand-mark {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.85rem;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--brand), var(--brand-2));
  color: #f4efe4;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

.brand-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-sub {
  margin: 0.1rem 0 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.top-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.shell {
  width: min(760px, calc(100% - 2rem));
  margin: 1.5rem auto 3rem;
}

.hero-panel,
.list-panel {
  background: color-mix(in srgb, var(--paper-2) 92%, white);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 1.6rem 1.4rem 1.5rem;
  animation: rise 0.45s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero-panel h1,
.list-head h2,
.sheet-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.65rem;
}

.hero-panel h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  max-width: 16ch;
  line-height: 1.15;
}

.hero-panel > p {
  margin: 0 0 1.2rem;
  color: var(--ink-soft);
  max-width: 42ch;
}

.steps {
  margin: 0 0 1.4rem;
  padding-left: 1.15rem;
  color: var(--ink-soft);
}

.steps li + li {
  margin-top: 0.35rem;
}

.list-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.day-filter {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.day-filter input,
.settings input,
.settings textarea {
  font: inherit;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  background: #fff;
}

.status-line {
  min-height: 1.4rem;
  margin-bottom: 0.75rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.event-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fffefb, #f6f1e6);
  border-radius: var(--radius);
  padding: 1rem 1.05rem;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  font: inherit;
  color: inherit;
}

.event-card:hover,
.event-card:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
  box-shadow: 0 12px 28px rgba(11, 61, 46, 0.1);
  outline: none;
}

.event-card .when {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-2);
  margin-bottom: 0.25rem;
}

.event-card .name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.event-card .contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(11, 61, 46, 0.07);
}

.chip.missing {
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

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

.btn.primary {
  background: var(--brand);
  color: #f6f1e5;
}

.btn.primary.lg {
  padding: 0.9rem 1.35rem;
  font-size: 1.02rem;
}

.btn.ghost {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--line);
}

.btn.whatsapp {
  background: var(--whatsapp);
  color: #fff;
  flex: 1;
  min-height: 3.1rem;
  border-radius: 14px;
}

.btn.email {
  background: var(--email);
  color: #fff;
  flex: 1;
  min-height: 3.1rem;
  border-radius: 14px;
}

.hint {
  margin: 1rem 0 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.sheet {
  border: 0;
  padding: 0;
  width: min(560px, 100%);
  max-height: min(92vh, 860px);
  border-radius: 24px 24px 0 0;
  margin: auto auto 0;
  background: var(--paper-2);
  box-shadow: var(--shadow);
}

.sheet::backdrop {
  background: rgba(10, 28, 20, 0.45);
  backdrop-filter: blur(4px);
}

.sheet-inner {
  display: flex;
  flex-direction: column;
  max-height: min(92vh, 860px);
}

.sheet-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem 0.7rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--paper-2);
}

.sheet-head h2 {
  font-size: 1.15rem;
  margin: 0;
}

.sheet-body {
  padding: 1.1rem 1.15rem 1.5rem;
  overflow: auto;
}

.client-name {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  margin: 0 0 1rem;
  line-height: 1.15;
}

.meta {
  margin: 0 0 1.1rem;
  display: grid;
  gap: 0.85rem;
}

.meta dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.meta dd {
  margin: 0.15rem 0 0;
  font-weight: 600;
}

.preview {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.7rem 0.85rem;
  margin-bottom: 1.1rem;
  background: #f3eee3;
}

.preview summary {
  cursor: pointer;
  font-weight: 600;
}

.preview pre {
  white-space: pre-wrap;
  margin: 0.7rem 0 0;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.cta-row {
  display: flex;
  gap: 0.7rem;
}

.settings {
  display: grid;
  gap: 1rem;
}

.settings label {
  display: grid;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.92rem;
}

.field-hint {
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.settings textarea {
  resize: vertical;
  min-height: 7rem;
}

.empty {
  padding: 1.4rem 0.4rem;
  color: var(--ink-soft);
  text-align: center;
}

@media (min-width: 720px) {
  .sheet {
    border-radius: 24px;
    margin: auto;
  }

  .topbar {
    padding-inline: 1.75rem;
  }
}

/* —— Landing —— */
.landing {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1.75rem;
  padding: 2rem 1.25rem 3rem;
  position: relative;
  z-index: 1;
  animation: rise 0.5s ease both;
}

.logo-hit {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  padding: 0.5rem;
  color: inherit;
  transition: transform 0.2s ease;
}

.logo-hit:active {
  transform: scale(0.97);
}

.logo-svg {
  filter: drop-shadow(0 16px 28px rgba(11, 61, 46, 0.28));
  animation: logo-in 0.7s ease both;
}

@keyframes logo-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.logo-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-sub {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-top: -0.25rem;
}

.landing-actions {
  width: min(320px, 100%);
  display: grid;
  gap: 0.85rem;
}

.landing-foot {
  min-height: 1.25rem;
  color: var(--ink-soft);
  font-size: 0.88rem;
  text-align: center;
  margin: 0;
}

.suspended-msg {
  margin: 0;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: rgba(180, 35, 24, 0.1);
  border: 1px solid rgba(180, 35, 24, 0.35);
  color: var(--danger);
  text-align: center;
  font-weight: 600;
  line-height: 1.4;
}

.suspend-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f3eee3;
}

.btn.danger {
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  white-space: nowrap;
}

.btn.ok {
  background: var(--brand-2);
  color: #fff;
  border-radius: 999px;
  white-space: nowrap;
}

#screen-app[hidden],
#screen-landing[hidden],
[hidden] {
  display: none !important;
}

.list-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.65rem;
  justify-content: flex-end;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 520px) {
  .list-head {
    flex-direction: column;
    align-items: stretch;
  }

  .list-tools {
    justify-content: stretch;
  }

  .list-tools .btn.primary {
    width: 100%;
  }

  .field-row {
    grid-template-columns: 1fr;
  }
}

.import-hint {
  margin: 0;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  background: #f3eee3;
  border: 1px solid var(--line);
  white-space: pre-wrap;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

.settings-section {
  margin: 0.6rem 0 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
}
