/* Zoe Villa Tamu — warm hospitality console.
 * Palette (ui-ux-pro-max "warm ink + amber on cream"):
 * cream #FFFBEB bg · ink #0F172A · stone #78716C · amber #D97706 CTA */
:root {
  --bg: #fffbeb;
  --ink: #0f172a;
  --stone: #78716c;
  --stone-2: #a8a29e;
  --amber: #d97706;
  --amber-dark: #b45309;
  --card: #ffffff;
  --muted-bg: #f6f6f6;
  --border: #eeeded;
  --danger: #dc2626;
  --ok: #15803d;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Karla", system-ui, sans-serif;
  line-height: 1.5;
}
h1, h2 { font-family: "Playfair Display SC", serif; font-weight: 700; }
h1 { font-size: 1.6rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 0.5rem; }
a { color: var(--amber-dark); }
code { background: var(--muted-bg); padding: 0.1em 0.35em; border-radius: 4px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 1.2rem; background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5; flex-wrap: wrap; gap: 0.5rem;
}
.brand { font-family: "Playfair Display SC", serif; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.brand span { color: var(--amber); }
.topbar nav { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.topbar nav a {
  padding: 0.45rem 0.8rem; border-radius: 8px; text-decoration: none;
  color: var(--stone); font-weight: 600; transition: background 150ms, color 150ms;
}
.topbar nav a:hover { background: var(--muted-bg); }
.topbar nav a.on { background: var(--amber); color: #fff; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 1.2rem; }
.pagehead { display: flex; align-items: baseline; gap: 0.8rem; margin: 0.5rem 0 1rem; flex-wrap: wrap; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 1rem 1.2rem; margin-bottom: 1rem;
}
.card.center { text-align: center; }
.rowhead { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.muted { color: var(--stone); font-size: 0.9rem; }
.mono { font-variant-numeric: tabular-nums; white-space: nowrap; }
.flash {
  background: #ecfdf5; border: 1px solid #a7f3d0; color: var(--ok);
  padding: 0.6rem 0.9rem; border-radius: 8px;
}
.err {
  background: #fef2f2; border: 1px solid #fecaca; color: var(--danger);
  padding: 0.6rem 0.9rem; border-radius: 8px;
}

input, select, textarea {
  font: inherit; color: var(--ink);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 0.5rem 0.65rem; background: #fff; max-width: 100%;
}
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--amber); outline-offset: 1px;
}
textarea { width: 100%; resize: vertical; }
label { display: block; font-weight: 600; margin-bottom: 0.2rem; }
label input { display: block; width: 100%; margin-top: 0.3rem; font-weight: 400; }
.stack > * + * { margin-top: 0.9rem; }
.row-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.row-form input, .row-form select { flex: 1 1 160px; min-width: 0; }
.inline { display: inline-flex; }

button, .btn {
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
  background: var(--amber); color: #fff; border: none; border-radius: 8px;
  padding: 0.55rem 1rem; min-height: 44px; transition: background 150ms;
  display: inline-flex; align-items: center; justify-content: center;
}
button:hover, .btn:hover { background: var(--amber-dark); }
button.ghost { background: transparent; color: var(--stone); border: 1px solid var(--border); }
button.ghost:hover { background: var(--muted-bg); color: var(--ink); }
button.danger { background: var(--danger); }
button.danger:hover { background: #b91c1c; }

.tbl { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.tbl th {
  text-align: left; color: var(--stone); font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.4rem 0.5rem; border-bottom: 2px solid var(--border);
}
.tbl td { padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl input { width: 100%; min-width: 90px; }
.tbl .actions { white-space: nowrap; display: flex; gap: 0.35rem; align-items: center; }
tr.optout td { opacity: 0.45; }

.pill {
  display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px;
  font-size: 0.8rem; font-weight: 700; background: var(--muted-bg); color: var(--stone);
}
.pill.sending, .pill.queued, .pill.pending { background: #fef3c7; color: var(--amber-dark); }
.pill.done, .pill.sent, .pill.delivered, .pill.stayed { background: #dbeafe; color: #1d4ed8; }
.pill.read, .pill.rewarded { background: #dcfce7; color: var(--ok); }
.pill.failed, .pill.cancelled { background: #fee2e2; color: var(--danger); }

.preview { margin-bottom: 0.9rem; }
.preview-who { font-weight: 700; font-size: 0.85rem; margin-bottom: 0.25rem; }
.bubble {
  background: #dcf8c6; border-radius: 12px 12px 12px 2px;
  padding: 0.6rem 0.8rem; white-space: pre-wrap; max-width: 560px;
  font-size: 0.95rem; border: 1px solid #c8ecb0;
}
.qr { width: 280px; max-width: 90%; image-rendering: pixelated; border: 8px solid #fff; border-radius: 8px; }

/* chat (pesan) */
.backlink { text-decoration: none; font-weight: 600; white-space: nowrap; }
.convos { display: flex; flex-direction: column; }
.convo {
  display: flex; justify-content: space-between; align-items: center; gap: 0.8rem;
  padding: 0.65rem 0.5rem; border-bottom: 1px solid var(--border);
  text-decoration: none; color: var(--ink); transition: background 150ms;
}
.convo:hover { background: var(--muted-bg); }
.convo:last-child { border-bottom: none; }
.convo-main { min-width: 0; }
.convo-who { font-weight: 700; }
.convo-preview {
  color: var(--stone); font-size: 0.9rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.convo-side {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem;
  font-size: 0.8rem; white-space: nowrap; flex-shrink: 0;
}
.pill.unread { background: var(--amber); color: #fff; }

.chat { display: flex; flex-direction: column; gap: 0.45rem; }
.msg { display: flex; }
.msg.out { justify-content: flex-end; }
.bubble.in { background: #fff; border: 1px solid var(--border); border-radius: 12px 12px 12px 2px; }
.bubble.out { border-radius: 12px 12px 2px 12px; }
.bubble .time {
  display: block; font-size: 0.7rem; color: var(--stone-2);
  text-align: right; margin-top: 0.15rem;
}
.replybar {
  position: sticky; bottom: 0; display: flex; gap: 0.5rem;
  background: var(--bg); padding: 0.6rem 0; margin-bottom: 0.5rem;
}
.replybar input { flex: 1; background: #fff; min-width: 0; }

.login-body {
  min-height: 100vh; margin: 0; display: grid; place-items: center;
  background: var(--bg); font-family: "Karla", system-ui, sans-serif;
}
.login-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 2rem; width: min(360px, 90vw); text-align: center;
  display: flex; flex-direction: column; gap: 0.8rem;
}
.login-card h1 { font-family: "Playfair Display SC", serif; margin: 0; font-size: 1.5rem; }
.login-card h1 span { color: var(--amber); }
.login-card p { margin: 0; }

#importPreview table { margin-top: 0.8rem; }
#importPreview .impbar { display: flex; gap: 0.6rem; align-items: center; margin-top: 0.8rem; flex-wrap: wrap; }

@media (max-width: 720px) {
  .wrap { padding: 0.8rem; }
  .tbl { display: block; overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
