/* DeepWorker SPA — WhatsApp-style, matched to the Flowtely User App. Built on COPIED Chatura tokens. */
:root{
  --hdr:#0A1628; --accent:#2E7DFF; --bubble-out:#E6EEFF; --pg:#F7FAFC;
  --ink:#0B141A; --gray:#667781; --muted:#8696A0; --line:#E9EDEF; --composer:#F0F2F5;
}
*{ box-sizing:border-box; }
html,body{ margin:0; height:100%; }
body{ font-family:"Chatura Display","Inter",var(--ft-font-sans,system-ui),-apple-system,sans-serif;
  color:var(--ink); background:#0A1628; -webkit-font-smoothing:antialiased; }
.boot{ padding:40px; color:#fff; }
a{ color:var(--accent); text-decoration:none; }
button{ font:inherit; }

/* frame: centered phone column */
.frame{ position:fixed; inset:0; display:flex; justify-content:center; background:rgba(0,0,0,.05); }
.col{ position:relative; display:flex; flex-direction:column; width:100%; max-width:480px;
  height:100dvh; overflow:hidden; background:var(--pg); }
@media (min-width:768px){ .col{ height:min(100dvh - 48px, 940px); margin-top:auto; margin-bottom:auto;
  border-radius:16px; box-shadow:0 24px 60px rgba(10,22,40,.28); } }

/* header — narrow, dark, matches user app (~64px content) */
.hdr{ flex:0 0 auto; display:flex; align-items:center; gap:8px; background:var(--hdr); color:#fff;
  padding:10px 12px; padding-top:calc(10px + env(safe-area-inset-top)); min-height:44px; }
.hdr .logo{ width:30px; height:30px; flex:0 0 auto; }
.hdr h1{ font-size:19px; font-weight:800; letter-spacing:-.02em; margin:0; }
.hdr .htitle{ display:flex; flex-direction:column; min-width:0; flex:1; }
.hdr .htitle .t{ font-size:17px; font-weight:600; letter-spacing:-.01em; white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; }
.hdr .htitle .s{ font-size:12px; color:rgba(255,255,255,.7); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.hdr .spacer{ flex:1; }
.iconbtn{ width:44px; height:44px; flex:0 0 auto; display:grid; place-items:center; background:transparent;
  border:0; color:#fff; cursor:pointer; border-radius:50%; }
.iconbtn:hover{ background:rgba(255,255,255,.1); }
.iconbtn svg{ width:24px; height:24px; }

/* avatar */
.avatar{ border-radius:50%; object-fit:cover; display:inline-block; flex:0 0 auto;
  background-size:cover; background-position:center; }
.avatar.ring{ box-shadow:0 0 0 2px rgba(255,255,255,.4); }
.ava-init{ border-radius:50%; display:grid; place-items:center; color:#fff; font-weight:600; flex:0 0 auto; }

/* body */
.body{ flex:1 1 auto; overflow-y:auto; background:var(--pg); }
.body.list{ background:#fff; }
.pad{ padding:16px; }

/* dropdown menu from avatar */
.scrim{ position:absolute; inset:0; z-index:20; background:transparent; }
.menu{ position:absolute; top:56px; right:10px; z-index:21; background:#fff; border:1px solid var(--line);
  border-radius:14px; box-shadow:0 16px 40px rgba(10,22,40,.22); min-width:220px; overflow:hidden; padding:6px; }
.menu .mi{ display:flex; align-items:center; gap:10px; width:100%; text-align:left; background:transparent;
  border:0; padding:11px 12px; border-radius:9px; cursor:pointer; font-size:14.5px; color:var(--ink); }
.menu .mi:hover{ background:#F1F5F9; }
.menu .mi svg{ width:19px; height:19px; color:var(--gray); flex:0 0 auto; }
.menu .mi.danger{ color:#E11D48; }
.menu .mi.danger svg{ color:#E11D48; }
.menu .sep{ height:1px; background:var(--line); margin:6px 4px; }
.menu .grouplabel{ font-size:11px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted);
  padding:8px 12px 4px; }
.menu .cur{ padding:10px 12px 4px; }
.menu .cur b{ font-size:14px; } .menu .cur small{ color:var(--gray); }

/* chat list rows (home) */
.rows{ }
.crow{ display:flex; align-items:center; gap:12px; padding:11px 14px; cursor:pointer; border-bottom:1px solid #F1F3F5; }
.crow:hover{ background:#F7FAFC; }
.crow .cmeta{ flex:1; min-width:0; }
.crow .cmeta .ct{ font-size:15.5px; font-weight:600; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.crow .cmeta .cp{ font-size:13px; color:var(--gray); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:1px; }
.crow .ctime{ font-size:11px; color:var(--muted); flex:0 0 auto; align-self:flex-start; margin-top:3px; }
.empty{ padding:48px 24px; text-align:center; color:var(--gray); }
.empty b{ display:block; color:var(--ink); margin-bottom:6px; font-size:16px; }

/* FAB */
.fab{ position:absolute; right:16px; bottom:20px; width:56px; height:56px; border-radius:50%;
  background:var(--accent); color:#fff; border:0; cursor:pointer; display:grid; place-items:center;
  box-shadow:0 10px 24px rgba(46,125,255,.4); z-index:15; }
.fab svg{ width:26px; height:26px; }

/* chat view (identical to user app) */
.chatbody{ flex:1 1 auto; overflow-y:auto; background:var(--pg); padding:12px; display:flex; flex-direction:column; gap:2px; }
.mrow{ display:flex; } .mrow.out{ justify-content:flex-end; } .mrow.in{ justify-content:flex-start; }
.bub{ position:relative; max-width:78%; padding:7px 11px; font-size:15px; line-height:20px;
  border-radius:16px; box-shadow:0 1px 1.5px rgba(11,20,26,.10); }
.bub.out{ background:var(--bubble-out); border-bottom-right-radius:6px; }
.bub.in{ background:#fff; border-bottom-left-radius:6px; }
.bub .who{ font-size:13px; font-weight:600; color:var(--hdr); margin-bottom:2px; }
.bub .mbody{ color:var(--ink); white-space:pre-wrap; word-break:break-word; }
.bub .att{ margin-top:5px; border-radius:8px; background:rgba(0,0,0,.06); padding:6px 8px; font-size:12.5px; color:var(--ink); }
.bub .rev{ margin-top:4px; font-size:11px; color:#0a8f7d; font-weight:600; }
.bub .tstamp{ margin-top:2px; text-align:right; font-size:10.5px; color:var(--gray); }
.bub .statusline{ font-size:10.5px; color:var(--gray); text-align:right; margin-top:1px; }
.daysep{ align-self:center; background:rgba(255,255,255,.75); color:#54656F; font-size:11px;
  border-radius:999px; padding:4px 10px; margin:6px 0; }

/* composer (identical to user app) */
.composer{ flex:0 0 auto; border-top:1px solid rgba(0,0,0,.06); background:var(--composer); padding:8px;
  padding-bottom:calc(8px + env(safe-area-inset-bottom)); }
.composer .crow2{ display:flex; align-items:flex-end; gap:4px; }
.composer .cbtn{ width:44px; height:44px; flex:0 0 auto; display:grid; place-items:center; border:0;
  background:transparent; color:#54656F; cursor:pointer; border-radius:50%; }
.composer .cbtn:hover{ background:rgba(0,0,0,.05); }
.composer .cbtn svg{ width:22px; height:22px; }
.composer textarea{ flex:1; resize:none; border:1px solid var(--line); background:#fff; border-radius:22px;
  padding:10px 14px; font-size:16px; line-height:1.35; max-height:40vh; box-shadow:0 1px 2px rgba(0,0,0,.05);
  font-family:inherit; }
.composer textarea:focus{ outline:none; border-color:#cdd7e3; }
.composer .send{ background:var(--accent); color:#fff; }
.composer .send:hover{ background:var(--accent); filter:brightness(1.05); }
.composer .send:disabled{ opacity:.4; cursor:default; }

/* generic screens (profile, admin) inside the frame */
.screen{ padding:16px; }
.screen h2{ font-size:16px; margin:18px 0 8px; }
.card{ background:#fff; border:1px solid var(--line); border-radius:14px; padding:16px; margin-bottom:14px; box-shadow:0 1px 2px rgba(10,22,40,.05); }
.card h3{ margin:0 0 4px; font-size:15px; } .card .hint{ color:var(--gray); font-size:13px; margin:0 0 12px; }
label{ display:block; font-size:13px; font-weight:600; margin:10px 0 6px; }
input,select,textarea.f{ width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:10px; font:inherit; color:var(--ink); background:#fff; }
input:focus{ outline:2px solid var(--accent); border-color:var(--accent); }
.btn{ display:inline-flex; align-items:center; gap:8px; cursor:pointer; font-weight:600; padding:10px 16px;
  border-radius:10px; border:1px solid transparent; background:var(--accent); color:#fff; }
.btn.ghost{ background:#fff; color:var(--ink); border-color:var(--line); }
.btn.sm{ padding:7px 12px; font-size:13px; } .btn.danger{ background:#E11D48; }
.btn:disabled{ opacity:.5; cursor:default; }
.row{ display:flex; gap:10px; flex-wrap:wrap; } .row>*{ flex:1; min-width:150px; }
table{ width:100%; border-collapse:collapse; font-size:13.5px; } th,td{ text-align:left; padding:9px 6px; border-bottom:1px solid var(--line); }
th{ font-size:11px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); }
.pill{ display:inline-block; padding:2px 9px; border-radius:999px; font-size:11.5px; font-weight:600; }
.pill.A,.pill.open{ background:rgba(46,125,255,.12); color:var(--accent); }
.pill.B{ background:rgba(15,201,176,.14); color:#0a8f7d; }
.pill.on,.pill.answered,.pill.done{ background:rgba(15,201,176,.14); color:#0a8f7d; }
.pill.off{ background:#EEF2F6; color:var(--gray); } .pill.in_progress{ background:rgba(110,92,255,.14); color:#6E5CFF; }
.seg{ display:inline-flex; border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.seg button{ border:0; background:#fff; padding:8px 16px; cursor:pointer; font-weight:600; color:var(--gray); }
.seg button.active{ background:var(--accent); color:#fff; }
.cite{ display:inline-block; background:rgba(46,125,255,.1); color:var(--accent); border-radius:4px; padding:0 6px; font-size:12px; margin:2px 4px 0 0; }

/* login */
.login-wrap{ min-height:100dvh; display:grid; place-items:center; background:var(--hdr); }
.login-card{ background:#fff; border-radius:20px; padding:36px; width:min(400px,92vw); box-shadow:0 24px 60px rgba(0,0,0,.35); }
.login-card .lbrand{ display:flex; align-items:center; justify-content:center; gap:10px; margin-bottom:14px; }
.login-card .lbrand img{ width:34px; height:34px; } .login-card .lbrand b{ font-size:19px; }
.login-card h1{ text-align:center; font-size:21px; margin:0 0 4px; } .login-card .sub{ text-align:center; color:var(--gray); font-size:14px; margin:0 0 18px; }
.divider{ text-align:center; color:var(--muted); font-size:12px; margin:16px 0; display:flex; align-items:center; gap:10px; }
.divider::before,.divider::after{ content:""; flex:1; height:1px; background:var(--line); }

.toast{ position:fixed; bottom:24px; left:50%; transform:translateX(-50%); background:var(--hdr); color:#fff;
  padding:11px 18px; border-radius:10px; box-shadow:0 12px 30px rgba(0,0,0,.3); font-size:14px; z-index:60; }
.toast.err{ background:#E11D48; }
