/* Relay Cloud — design system
   Palette: ink #14201b · bg #f6f5f1 · sidebar #0f2a20 · accent #1f8a5b / #3ccf8e
   muted #5d6b64 · border #e4e2db · card #fff */

:root{
  --ink:#14201b; --bg:#f6f5f1; --muted:#5d6b64; --border:#e4e2db;
  --accent:#1f8a5b; --accent-dark:#156b45; --accent-bright:#3ccf8e;
  --sidebar:#0f2a20; --sidebar-text:#cfe0d7; --sidebar-muted:#86a597;
  --card:#fff; --soft:#faf9f6; --chip:#f1efe9; --mint:#e3f3ea; --mint-bg:#f4fbf7;
}

*{box-sizing:border-box}
body{margin:0;background:var(--bg);font-family:'Instrument Sans',system-ui,sans-serif;
  color:var(--ink);-webkit-font-smoothing:antialiased}
a{color:var(--accent);text-decoration:none}
a:hover{color:var(--accent-dark);text-decoration:underline}
input,textarea,select,button{font-family:inherit}
h1{margin:0;font-size:24px;font-weight:600;letter-spacing:-.01em}
h2{margin:0;font-size:16px;font-weight:600}
.mono{font-family:'JetBrains Mono',monospace}

/* App shell */
.app{display:flex;min-height:100vh;min-width:1040px;background:var(--bg)}
.main{flex:1;min-width:0;display:flex;flex-direction:column}
.page{padding:32px 40px;display:flex;flex-direction:column;gap:24px}
.page-full{flex:1;display:flex;flex-direction:column;height:100vh;min-height:0}

/* Sidebar */
.sidebar{width:232px;flex:none;background:var(--sidebar);color:var(--sidebar-text);
  display:flex;flex-direction:column;padding:20px 14px;gap:24px;position:sticky;top:0;height:100vh}
.brand{display:flex;align-items:center;gap:10px;padding:0 8px}
.brand .logo{width:30px;height:30px;border-radius:9px;background:var(--accent-bright);
  display:grid;place-items:center;color:var(--sidebar);font-weight:700;font-size:15px}
.brand .name{font-weight:600;font-size:15px;color:#fff}
.brand .sub{font-size:11px;color:var(--sidebar-muted)}
.nav{display:flex;flex-direction:column;gap:2px}
.nav a{display:flex;align-items:center;gap:11px;padding:9px 10px;border-radius:8px;
  color:#a9c2b6;font-size:13.5px;font-weight:500;text-decoration:none}
.nav a:hover{background:rgba(255,255,255,.06);color:#fff;text-decoration:none}
.nav a.active{background:rgba(60,207,142,.14);color:#fff}
.nav a svg{flex:none}
.nav a .label{flex:1}
.nav .badge{font-size:11px;font-weight:600;background:var(--accent-bright);color:var(--sidebar);
  border-radius:10px;padding:1px 7px}
.quota{margin-top:auto;display:flex;flex-direction:column;gap:10px;padding:12px;border-radius:10px;
  background:rgba(255,255,255,.05)}
.quota .num{display:flex;align-items:center;gap:8px;font-size:12px}
.quota .dot{width:7px;height:7px;border-radius:50%;background:var(--accent-bright)}
.quota .phone{color:#fff;font-weight:500}
.quota .meta{font-size:11.5px;color:var(--sidebar-muted);line-height:1.4}
.quota .bar{height:4px;border-radius:2px;background:rgba(255,255,255,.1)}
.quota .bar>div{height:100%;border-radius:2px;background:var(--accent-bright)}

/* Headers */
.page-head{display:flex;justify-content:space-between;align-items:flex-end}
.page-head p{margin:0;color:var(--muted);font-size:14px}
.sub{color:var(--muted);font-size:14px;margin:0}

/* Cards */
.card{background:var(--card);border:1px solid var(--border);border-radius:12px}
.card-pad{padding:22px}
.grid{display:grid;gap:12px}
.flex{display:flex}
.col{display:flex;flex-direction:column}
.gap-4{gap:4px}.gap-6{gap:6px}.gap-8{gap:8px}.gap-10{gap:10px}.gap-12{gap:12px}
.gap-14{gap:14px}.gap-16{gap:16px}.gap-18{gap:18px}.gap-20{gap:20px}.gap-24{gap:24px}

/* Stat cards */
.stat{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:16px;
  display:flex;flex-direction:column;gap:4px}
.stat .k{font-size:12px;color:var(--muted)}
.stat .v{font-size:24px;font-weight:600}

/* Buttons */
.btn{height:38px;padding:0 16px;border:0;border-radius:8px;font-size:13px;cursor:pointer;
  display:inline-flex;align-items:center;gap:6px;justify-content:center;text-decoration:none}
.btn:hover{text-decoration:none}
.btn-primary{background:var(--accent);color:#fff;font-weight:600}
.btn-primary:hover{background:var(--accent-dark);color:#fff}
.btn-dark{background:var(--ink);color:#fff;font-weight:500}
.btn-dark:hover{color:#fff;opacity:.92}
.btn-ghost{background:#fff;border:1px solid var(--border);color:var(--ink)}
.btn-ghost:hover{color:var(--ink);background:var(--soft)}
.btn-lg{height:42px;font-size:14px;padding:0 18px}
.btn-sm{height:34px;padding:0 12px}
.btn-block{width:100%}
.btn-dashed{height:38px;border:1px dashed #c9c6bc;border-radius:8px;background:transparent;
  font-size:13px;color:var(--muted);cursor:pointer;width:100%}

/* Forms */
label.field{display:flex;flex-direction:column;gap:6px;font-size:12.5px;color:var(--muted);font-weight:500}
.input{height:40px;border:1px solid var(--border);border-radius:8px;padding:0 12px;
  font-size:13.5px;color:var(--ink);width:100%;background:#fff}
.input:focus{outline:2px solid rgba(31,138,91,.25);border-color:var(--accent)}
.input-sm{height:38px;font-size:13px}
.input-mono{font-family:'JetBrains Mono',monospace;font-size:13px}
.input-ro{background:var(--soft)}
textarea.input{height:auto;padding:10px 12px;line-height:1.5;resize:vertical}
select.input{appearance:none;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235d6b64' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat:no-repeat;background-position:right 12px center;padding-right:30px}

/* Pills / chips / tags */
.pill{font-size:12px;font-weight:500;padding:3px 9px;border-radius:20px;display:inline-flex;align-items:center;gap:5px}
.chip{font-size:12.5px;padding:6px 10px;border-radius:7px;background:var(--chip)}
.tag{font-size:11.5px;padding:2px 8px;border-radius:5px;background:var(--chip)}
.badge-ok{background:var(--mint);color:var(--accent-dark)}
.subtle{color:var(--muted)}
.verified{font-size:12px;color:var(--accent);font-weight:500}

/* Tables */
.tbl{background:#fff;border:1px solid var(--border);border-radius:12px;overflow:hidden}
.tbl-head{font-size:11.5px;color:var(--muted);font-weight:600;text-transform:uppercase;
  letter-spacing:.04em;background:var(--soft);padding:10px 18px}
.tbl-row{padding:12px 18px;font-size:13px;border-top:1px solid #efede6;align-items:center}
.tbl-row:hover{background:var(--soft)}
.grid-row{display:grid;align-items:center}

/* Avatar */
.avatar{border-radius:50%;background:var(--mint);color:var(--accent-dark);
  display:grid;place-items:center;font-weight:600;flex:none}

/* Flash messages */
.flash-wrap{position:fixed;top:16px;right:16px;z-index:60;display:flex;flex-direction:column;gap:8px}
.flash{padding:12px 16px;border-radius:10px;font-size:13.5px;color:#fff;box-shadow:0 8px 24px rgba(0,0,0,.18);
  max-width:360px;animation:slideIn .25s ease}
.flash.ok{background:var(--accent)}
.flash.warn{background:#b7791f}
.flash.err{background:#c2410c}
@keyframes slideIn{from{transform:translateX(20px);opacity:0}to{transform:none;opacity:1}}

/* Modal */
.modal-bg{position:fixed;inset:0;background:rgba(15,42,32,.45);display:grid;place-items:center;z-index:50}
.modal{background:#fff;border-radius:14px;padding:26px;display:flex;flex-direction:column;gap:18px;
  box-shadow:0 20px 60px rgba(0,0,0,.25);max-height:90vh;overflow:auto}
.modal-x{border:0;background:none;font-size:22px;cursor:pointer;color:var(--muted);line-height:1}

/* Checkbox (styled) */
.chk{width:16px;height:16px;border-radius:4px;border:1.5px solid #c9c6bc;background:#fff;
  display:grid;place-items:center;font-size:11px;color:#fff;cursor:pointer}
.chk.on{background:var(--accent);border-color:var(--accent)}

/* Inbox */
.chat-bg{background:#efeae2}
.bubble{max-width:420px;display:flex;flex-direction:column;gap:4px}
.bubble .body{border-radius:10px;padding:8px 10px 6px;font-size:13.5px;line-height:1.45;
  box-shadow:0 1px 1px rgba(0,0,0,.06);display:flex;flex-direction:column;gap:4px}
.bubble.out .body{background:#d9fdd3}
.bubble.in .body{background:#fff}
.bubble .time{font-size:10.5px;color:#7d8a83;align-self:flex-end}

/* Flow (automations) */
.flow-canvas{flex:1;position:relative;overflow:auto;background-color:var(--bg);
  background-image:radial-gradient(#d8d5cc 1px,transparent 1px);background-size:18px 18px}
.node{position:absolute;background:#fff;border:1px solid var(--border);border-radius:10px;
  padding:12px 14px;display:flex;flex-direction:column;gap:4px;box-shadow:0 2px 6px rgba(0,0,0,.04)}
.node .kind{font-size:10.5px;font-weight:600;letter-spacing:.06em}
.node .title{font-size:13.5px;font-weight:600}
.node .desc{font-size:12px;color:var(--muted);line-height:1.4}
.node.sel{border:1.5px solid var(--accent);box-shadow:0 0 0 4px rgba(31,138,91,.12)}

.muted-head{font-size:11px;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:.05em}

/* Row delete affordances (always visible) */
.list-del{opacity:.55;transition:opacity .12s}
.list-row:hover .list-del{opacity:1}
.list-del:hover{text-decoration:none;filter:brightness(.85)}
.row-del{border:0;background:none;cursor:pointer;color:#c2410c;font-size:16px;line-height:1;padding:4px}
.row-del:hover{filter:brightness(.85)}
