:root {
  color-scheme: light;
  --ink: #16231d;
  --muted: #6b7a72;
  --line: #dce7df;
  --surface: #ffffff;
  --background: #f2f7f3;
  --green: #16824e;
  --green-dark: #0c663b;
  --green-soft: #e7f6ed;
  --warning: #9a5b00;
  --warning-bg: #fff4d9;
  --danger: #af2d3d;
  --danger-bg: #fff0f2;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at top, #e8f5eb, var(--background) 38rem); color: var(--ink); font: 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.page-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.app-card { width: min(100%, 720px); background: var(--surface); border: 1px solid rgba(22, 130, 78, .12); border-radius: 24px; box-shadow: 0 22px 70px rgba(28, 67, 45, .12); padding: clamp(22px, 5vw, 48px); }
.auth-card { max-width: 480px; }
.hero { display: flex; gap: 16px; align-items: center; margin-bottom: 34px; }
.dashboard-header { justify-content: space-between; align-items: center; margin-bottom: 26px; }
.hero-copy { flex: 1; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.user-pill { display: inline-flex; align-items: center; min-height: 38px; padding: 8px 12px; border-radius: 999px; background: var(--green-soft); color: var(--green-dark); font-size: 12px; font-weight: 700; }
.auth-form { display: block; }
.whatsapp-mark { display: grid; place-items: center; flex: 0 0 52px; height: 52px; border-radius: 16px; color: white; background: var(--green); font-size: 14px; font-weight: 800; letter-spacing: .08em; }
.eyebrow { margin: 0 0 4px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; } h1 { margin-bottom: 5px; font-size: clamp(25px, 5vw, 34px); line-height: 1.1; letter-spacing: -.03em; } h2 { margin-bottom: 0; font-size: 17px; }
.subtitle, .help-text { color: var(--muted); } .subtitle { margin-bottom: 0; font-size: 14px; }
.form-section, .preview-section { margin-top: 25px; } label { display: block; margin-bottom: 8px; font-weight: 700; }
input, select { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfb; color: var(--ink); padding: 12px 14px; font: inherit; outline: none; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(22, 130, 78, .12); } input[aria-invalid="true"] { border-color: var(--danger); }
.help-text { margin: 7px 0 0; font-size: 12px; } .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.pill { border-radius: 999px; padding: 4px 10px; background: var(--green-soft); color: var(--green-dark); font-size: 12px; font-weight: 700; }
.variable-field { margin-bottom: 16px; } .variable-field:last-child { margin-bottom: 0; }
.preview { min-height: 86px; white-space: pre-wrap; border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: #f7fbf8; } .preview.empty { color: var(--muted); }
.mode-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 5px; border-radius: 14px; background: #eef6f0; } .mode-tab { border: 0; border-radius: 10px; padding: 11px; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-weight: 700; } .mode-tab.active { background: white; color: var(--green-dark); box-shadow: 0 2px 8px rgba(22, 80, 45, .09); }
.bulk-preview { overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: #f7fbf8; } .bulk-preview table { width: 100%; border-collapse: collapse; font-size: 13px; } .bulk-preview th, .bulk-preview td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; } .bulk-preview th { color: var(--muted); font-size: 12px; } .bulk-preview td:last-child { min-width: 260px; white-space: pre-wrap; }
.bulk-summary { margin-top: 16px; color: var(--muted); font-size: 14px; } .cancel-button { width: 100%; margin-top: 10px; min-height: 44px; border: 1px solid #e2a9ae; border-radius: 12px; background: white; color: var(--danger); cursor: pointer; font: inherit; font-weight: 700; } .progress-track { height: 9px; margin-top: 18px; overflow: hidden; border-radius: 99px; background: #e4eee7; } .progress-bar { width: 0; height: 100%; border-radius: inherit; background: var(--green); transition: width .25s; } .bulk-results { margin-top: 16px; font-size: 14px; }
.mapping-row { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 12px; margin-bottom: 12px; } .mapping-row label { margin: 0; }
.inbox-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; } .inbox-toolbar h2 { margin-bottom: 0; } .small-button { border: 1px solid var(--line); border-radius: 10px; padding: 9px 13px; background: white; color: var(--green-dark); cursor: pointer; font: inherit; font-weight: 700; } .inbox-layout { display: grid; grid-template-columns: minmax(180px, 35%) 1fr; height: clamp(360px, 62vh, 560px); min-height: 360px; margin-top: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; } .conversation-list { border-right: 1px solid var(--line); background: #f7fbf8; overflow-y: auto; } .conversation-item { display: block; width: 100%; padding: 13px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; text-align: left; } .conversation-item.active { background: var(--green-soft); } .conversation-item strong, .conversation-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .conversation-item span { color: var(--muted); font-size: 12px; } .chat-panel { display: flex; min-width: 0; min-height: 0; flex-direction: column; } .chat-title { padding: 14px; border-bottom: 1px solid var(--line); font-weight: 800; } .message-list { display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; gap: 10px; padding: 14px; overflow-y: auto; overflow-x: hidden; } .message-bubble { max-width: 85%; padding: 10px 12px; border-radius: 12px; background: #edf3ef; white-space: pre-wrap; } .message-bubble.incoming { align-self: flex-start; } .message-bubble.outgoing { align-self: flex-end; background: var(--green-soft); } .message-meta { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.reply-composer { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: #fbfdfb; }
.reply-composer textarea { width: 100%; min-height: 84px; resize: vertical; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: white; color: var(--ink); font: inherit; }
.reply-composer textarea:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(22, 130, 78, .12); outline: none; }
.reply-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reply-error { color: var(--danger); font-size: 12px; min-height: 18px; }
.reply-send { min-width: 120px; min-height: 44px; border: 0; border-radius: 12px; background: var(--green); color: white; cursor: pointer; font: inherit; font-weight: 700; }
.reply-send:disabled { cursor: not-allowed; opacity: .5; }
@media (max-width: 560px) { .inbox-layout { grid-template-columns: 1fr; height: clamp(320px, 70vh, 480px); min-height: 320px; } .conversation-list { max-height: 180px; border-right: 0; border-bottom: 1px solid var(--line); overflow: auto; } }
.notice, .status { border-radius: 12px; padding: 12px 14px; font-size: 14px; } .notice { margin-top: 20px; } .warning { background: var(--warning-bg); color: var(--warning); } .status { margin-top: 14px; text-align: center; color: var(--muted); }
.status.success { background: var(--green-soft); color: var(--green-dark); } .status.error { background: var(--danger-bg); color: var(--danger); }
.send-button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; margin-top: 28px; border: 0; border-radius: 13px; background: var(--green); color: white; cursor: pointer; font: inherit; font-weight: 800; transition: background .2s, transform .2s; } .send-button:hover:not(:disabled) { background: var(--green-dark); transform: translateY(-1px); } .send-button:disabled { cursor: not-allowed; opacity: .5; }
.spinner { width: 17px; height: 17px; border: 2px solid rgba(255,255,255,.4); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; } .hidden { display: none !important; } @keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 520px) { .page-shell { padding: 12px; } .app-card { border-radius: 18px; padding: 22px 18px; } .hero { align-items: flex-start; } }
