/* ImmediCare Portal — portal.css — matches main site tokens (Fraunces + DM Sans, brand purple) */
@font-face{font-family:'Fraunces';font-style:normal;font-weight:400 600;font-display:swap;src:url('https://immedicaresolutions.com/assets/fonts/Fraunces.woff2') format('woff2')}
@font-face{font-family:'DMSans';font-style:normal;font-weight:300 400 500 600 700;font-display:swap;src:url('https://immedicaresolutions.com/assets/fonts/DMSans.woff2') format('woff2')}

:root{
  --ink:#1B1330;--plum:#341552;--brand:#7E2BB5;--brand2:#9B30C9;
  --lilac:#F6F2FB;--line:#E9E1F2;--em:#0E8A5F;--muted:#6B6280;--white:#fff;
  --amber:#B7791F;--red:#C0392B;--blue:#2563EB;
  --d:'Fraunces',Georgia,serif;--b:'DMSans',system-ui,sans-serif;
  --shadow:0 20px 48px -10px rgba(52,21,82,.18);
  --shadow-sm:0 2px 8px rgba(52,21,82,.06);
}
*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{font-family:var(--b);color:var(--ink);line-height:1.6;background:var(--lilac);-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
h1,h2,h3{font-weight:700;line-height:1.15;letter-spacing:-.01em}

/* BUTTONS */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;background:var(--brand);color:#fff;font-weight:600;font-size:15px;padding:12px 20px;border-radius:10px;border:none;cursor:pointer;font-family:var(--b);transition:.18s}
.btn:hover{background:var(--brand2);transform:translateY(-1px)}
.btn.ghost{background:transparent;color:var(--brand);border:1px solid var(--line)}
.btn.ghost:hover{border-color:var(--brand);background:var(--lilac)}
.btn.block{width:100%}
.btn.sm{padding:8px 14px;font-size:13.5px}
.btn:disabled{opacity:.5;cursor:not-allowed;transform:none}

/* ---------- AUTH SCREENS ---------- */
.auth-wrap{min-height:100vh;display:grid;grid-template-columns:1fr;place-items:center;padding:32px 20px}
@media(min-width:900px){.auth-wrap{grid-template-columns:1.05fr .95fr;gap:0;padding:0}}
.auth-aside{display:none}
@media(min-width:900px){.auth-aside{display:flex;flex-direction:column;justify-content:space-between;height:100vh;background:linear-gradient(165deg,#341552 0%,#4d1f73 55%,#7E2BB5 100%);color:#fff;padding:48px}}
.auth-aside .brandmark{font-size:21px;font-weight:700}
.auth-aside h2{font-size:34px;line-height:1.15;margin-bottom:16px;max-width:420px}
.auth-aside p{color:rgba(255,255,255,.78);font-size:16px;max-width:400px}
.auth-aside ul{list-style:none;margin-top:24px;display:flex;flex-direction:column;gap:12px}
.auth-aside li{display:flex;align-items:center;gap:10px;font-size:14.5px;color:rgba(255,255,255,.9)}
.auth-aside li svg{flex:none}
.auth-foot{font-size:13px;color:rgba(255,255,255,.6)}
.auth-card-col{width:100%;display:flex;align-items:center;justify-content:center;padding:32px 20px}
.auth-card{width:100%;max-width:410px;background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);padding:36px 32px}
.auth-logo{font-family:var(--d);font-size:22px;font-weight:600;color:var(--brand);margin-bottom:6px}
.auth-card h1{font-size:24px;margin-bottom:6px}
.auth-card .sub{color:var(--muted);font-size:14.5px;margin-bottom:24px}
.field{margin-bottom:16px}
.field label{display:block;font-size:13px;font-weight:600;color:var(--ink);margin-bottom:6px}
.field input,.field select{width:100%;padding:12px 14px;border:1px solid var(--line);border-radius:10px;font-family:var(--b);font-size:15px;color:var(--ink);background:#fff;transition:.15s}
.field input:focus,.field select:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px rgba(126,43,181,.12)}
.field .hint{font-size:12px;color:var(--muted);margin-top:5px}
.auth-alt{text-align:center;margin-top:20px;font-size:14px;color:var(--muted)}
.auth-alt a{color:var(--brand);font-weight:600}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:12px}

/* ALERTS */
.alert{padding:12px 14px;border-radius:10px;font-size:14px;margin-bottom:18px;border:1px solid}
.alert.ok{background:#E9F8F1;border-color:#BBE7D3;color:#0E6B49}
.alert.err{background:#FBECEA;border-color:#F2C9C3;color:#A5281B}
.alert.info{background:var(--lilac);border-color:var(--line);color:var(--plum)}

/* ---------- APP SHELL ---------- */
.shell{display:grid;grid-template-columns:1fr;min-height:100vh}
@media(min-width:880px){.shell{grid-template-columns:248px 1fr}}
.sidebar{background:var(--plum);color:#fff;padding:22px 16px;display:none;flex-direction:column;gap:6px;position:sticky;top:0;height:100vh}
@media(min-width:880px){.sidebar{display:flex}}
.sb-logo{font-family:var(--d);font-size:19px;font-weight:600;color:#fff;padding:6px 10px 18px;display:flex;align-items:center;gap:8px}
.sb-sec{font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:rgba(255,255,255,.45);padding:14px 12px 6px}
.sb-link{display:flex;align-items:center;gap:11px;padding:10px 12px;border-radius:9px;color:rgba(255,255,255,.82);font-size:14.5px;font-weight:500;transition:.15s}
.sb-link svg{flex:none;opacity:.85}
.sb-link:hover{background:rgba(255,255,255,.08);color:#fff}
.sb-link.active{background:var(--brand);color:#fff}
.sb-link.active svg{opacity:1}
.sb-foot{margin-top:auto;padding-top:14px;border-top:1px solid rgba(255,255,255,.12)}
.sb-user{display:flex;align-items:center;gap:10px;padding:8px 10px}
.sb-avatar{width:34px;height:34px;border-radius:50%;background:var(--brand);display:grid;place-items:center;font-weight:700;font-size:14px;flex:none}
.sb-user-meta{min-width:0}
.sb-user-meta strong{display:block;font-size:13.5px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sb-user-meta span{font-size:11.5px;color:rgba(255,255,255,.55);text-transform:capitalize}

/* TOPBAR (mobile) */
.topbar{display:flex;align-items:center;justify-content:space-between;background:var(--plum);color:#fff;padding:12px 16px;position:sticky;top:0;z-index:50}
@media(min-width:880px){.topbar{display:none}}
.topbar .tb-logo{font-family:var(--d);font-size:17px;font-weight:600}

/* MAIN */
.main{padding:28px 24px 56px;max-width:1120px;width:100%}
@media(min-width:880px){.main{padding:34px 40px 56px}}
.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:26px}
.page-head h1{font-size:26px;margin-bottom:4px}
.page-head .ph-sub{color:var(--muted);font-size:14.5px}

/* CARDS / STATS */
.grid-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:16px;margin-bottom:28px}
.stat{background:#fff;border:1px solid var(--line);border-radius:14px;padding:18px 20px;box-shadow:var(--shadow-sm)}
.stat .lbl{font-size:13px;color:var(--muted);font-weight:500;display:flex;align-items:center;gap:7px}
.stat .lbl svg{color:var(--brand)}
.stat .val{font-size:30px;font-weight:700;color:var(--ink);margin-top:8px;letter-spacing:-.02em}
.stat .val.serif{font-family:var(--d);font-weight:600}

.card{background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow-sm);overflow:hidden}
.card-head{padding:18px 22px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.card-head h2{font-size:17px}
.card-body{padding:22px}
.card-pad{padding:22px}

/* TABLE */
.tbl{width:100%;border-collapse:collapse;font-size:14px}
.tbl th{text-align:left;font-size:11.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);font-weight:600;padding:12px 16px;border-bottom:1px solid var(--line);background:#FBFAFD}
.tbl td{padding:14px 16px;border-bottom:1px solid var(--line);vertical-align:middle}
.tbl tr:last-child td{border-bottom:none}
.tbl tr:hover td{background:#FCFBFE}
.tbl .doc-name{display:flex;align-items:center;gap:10px;font-weight:500}
.file-ic{width:34px;height:34px;border-radius:8px;background:var(--lilac);display:grid;place-items:center;color:var(--brand);flex:none;font-size:11px;font-weight:700;text-transform:uppercase}

/* BADGES */
.badge{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:600;padding:4px 10px;border-radius:20px;white-space:nowrap}
.badge.uploaded{background:#EAF1FE;color:#2563EB}
.badge.in_review{background:#FCF3E3;color:#B7791F}
.badge.processed{background:#E9F8F1;color:#0E8A5F}
.badge.pending{background:#FCF3E3;color:#B7791F}
.badge.active{background:#E9F8F1;color:#0E8A5F}
.badge.suspended{background:#FBECEA;color:#C0392B}
.badge.cat{background:var(--lilac);color:var(--plum)}
.badge.private{background:#F0EEF4;color:#6B6280}
.badge.shared_with_staff{background:#EAF1FE;color:#2563EB}

/* EMPTY STATE */
.empty{text-align:center;padding:54px 24px;color:var(--muted)}
.empty .ic{width:64px;height:64px;border-radius:16px;background:var(--lilac);display:grid;place-items:center;color:var(--brand);margin:0 auto 16px}
.empty h3{font-size:17px;color:var(--ink);margin-bottom:6px}
.empty p{font-size:14px;max-width:340px;margin:0 auto}

/* UPLOAD DROP */
.drop{border:2px dashed var(--line);border-radius:14px;padding:40px 24px;text-align:center;transition:.18s;background:#FCFBFE;cursor:pointer}
.drop:hover,.drop.drag{border-color:var(--brand);background:var(--lilac)}
.drop .ic{width:56px;height:56px;border-radius:14px;background:var(--lilac);display:grid;place-items:center;color:var(--brand);margin:0 auto 14px}
.drop h3{font-size:16px;margin-bottom:4px}
.drop p{font-size:13.5px;color:var(--muted)}
.drop input[type=file]{display:none}

/* FLASH (toast) */
.flashes{position:fixed;top:18px;right:18px;z-index:200;display:flex;flex-direction:column;gap:10px;max-width:360px}
.toast{padding:13px 16px;border-radius:11px;font-size:14px;box-shadow:var(--shadow);border:1px solid;animation:slidein .25s ease}
.toast.ok{background:#fff;border-color:#BBE7D3;color:#0E6B49}
.toast.err{background:#fff;border-color:#F2C9C3;color:#A5281B}
@keyframes slidein{from{transform:translateX(20px);opacity:0}to{transform:translateX(0);opacity:1}}

.muted{color:var(--muted)}
.mono{font-variant-numeric:tabular-nums}
.right{text-align:right}
.nowrap{white-space:nowrap}
.flex{display:flex;align-items:center;gap:10px}
.gap6{gap:6px}
.mt8{margin-top:8px}.mt16{margin-top:16px}.mt24{margin-top:24px}

/* ---------- ANIMATIONS (added for new features) ---------- */
@keyframes fadein{from{opacity:0}to{opacity:1}}
@keyframes risein{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
@keyframes scalein{from{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.55}}

.animate-in{animation:risein .35s cubic-bezier(.22,1,.36,1)}
.fade-in{animation:fadein .25s ease}
.modal-pop{animation:scalein .22s cubic-bezier(.22,1,.36,1)}
.stagger>*{animation:risein .35s cubic-bezier(.22,1,.36,1) both}
.stagger>*:nth-child(1){animation-delay:.02s}
.stagger>*:nth-child(2){animation-delay:.06s}
.stagger>*:nth-child(3){animation-delay:.10s}
.stagger>*:nth-child(4){animation-delay:.14s}
.stagger>*:nth-child(5){animation-delay:.18s}
.stagger>*:nth-child(n+6){animation-delay:.20s}

.spinner{width:16px;height:16px;border:2px solid rgba(255,255,255,.4);border-top-color:#fff;border-radius:50%;animation:spin .7s linear infinite;display:inline-block}
.spinner.dark{border:2px solid var(--line);border-top-color:var(--brand)}
.skel{background:linear-gradient(90deg,var(--lilac) 25%,#EFE8F7 37%,var(--lilac) 63%);background-size:400% 100%;animation:skel-shine 1.4s ease infinite;border-radius:8px}
@keyframes skel-shine{0%{background-position:100% 0}100%{background-position:0 0}}

/* ---------- TOGGLE SWITCH ---------- */
.toggle{position:relative;display:inline-block;width:44px;height:25px;flex-shrink:0}
.toggle input{opacity:0;width:0;height:0}
.toggle .track{position:absolute;inset:0;background:var(--line);border-radius:999px;cursor:pointer;transition:.2s}
.toggle .track:before{content:'';position:absolute;width:19px;height:19px;left:3px;top:3px;background:#fff;border-radius:50%;transition:.2s cubic-bezier(.22,1,.36,1);box-shadow:0 1px 3px rgba(0,0,0,.2)}
.toggle input:checked+.track{background:var(--brand)}
.toggle input:checked+.track:before{transform:translateX(19px)}
.toggle-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 0;border-bottom:1px solid var(--line)}
.toggle-row:last-child{border-bottom:none}
.toggle-row .tr-label{font-size:14.5px;font-weight:600;color:var(--ink)}
.toggle-row .tr-sub{font-size:13px;color:var(--muted);margin-top:2px}

/* ---------- MODAL (generic, used by 2FA setup / preview) ---------- */
.modal-overlay{position:fixed;inset:0;background:rgba(27,19,48,.65);z-index:999;display:flex;align-items:center;justify-content:center;padding:24px;animation:fadein .18s ease}
.modal-box{background:#fff;border-radius:16px;width:100%;max-width:480px;box-shadow:var(--shadow);overflow:hidden}
.modal-box.wide{max-width:640px}
.modal-head{display:flex;align-items:center;justify-content:space-between;padding:18px 22px;border-bottom:1px solid var(--line)}
.modal-head strong{font-size:15.5px}
.modal-close{background:none;border:none;cursor:pointer;font-size:20px;line-height:1;color:var(--muted);padding:4px}
.modal-body{padding:22px;max-height:70vh;overflow-y:auto}

/* ---------- DOCUMENT COMMENTS ---------- */

/* ======================================================
   ANIMATIONS
====================================================== */
@keyframes fadein{from{opacity:0}to{opacity:1}}
@keyframes risein{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@keyframes scalein{from{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes skel-shine{0%{background-position:100% 0}100%{background-position:0 0}}
@keyframes bubble-in-left{from{opacity:0;transform:translateX(-12px) scale(.97)}to{opacity:1;transform:translateX(0) scale(1)}}
@keyframes bubble-in-right{from{opacity:0;transform:translateX(12px) scale(.97)}to{opacity:1;transform:translateX(0) scale(1)}}

.animate-in{animation:risein .35s cubic-bezier(.22,1,.36,1)}
.fade-in{animation:fadein .25s ease}
.modal-pop{animation:scalein .22s cubic-bezier(.22,1,.36,1)}
.stagger>*{animation:risein .35s cubic-bezier(.22,1,.36,1) both}
.stagger>*:nth-child(1){animation-delay:.02s}
.stagger>*:nth-child(2){animation-delay:.06s}
.stagger>*:nth-child(3){animation-delay:.10s}
.stagger>*:nth-child(4){animation-delay:.14s}
.stagger>*:nth-child(5){animation-delay:.18s}
.stagger>*:nth-child(n+6){animation-delay:.20s}
.spinner{width:16px;height:16px;border:2px solid rgba(255,255,255,.4);border-top-color:#fff;border-radius:50%;animation:spin .7s linear infinite;display:inline-block}
.spinner.dark{border:2px solid var(--line);border-top-color:var(--brand)}
.skel{background:linear-gradient(90deg,var(--lilac) 25%,#EFE8F7 37%,var(--lilac) 63%);background-size:400% 100%;animation:skel-shine 1.4s ease infinite;border-radius:8px}

/* ======================================================
   TOGGLE SWITCH
====================================================== */
.toggle{position:relative;display:inline-block;width:44px;height:25px;flex-shrink:0}
.toggle input{opacity:0;width:0;height:0}
.toggle .track{position:absolute;inset:0;background:var(--line);border-radius:999px;cursor:pointer;transition:.2s}
.toggle .track:before{content:'';position:absolute;width:19px;height:19px;left:3px;top:3px;background:#fff;border-radius:50%;transition:.2s cubic-bezier(.22,1,.36,1);box-shadow:0 1px 3px rgba(0,0,0,.2)}
.toggle input:checked+.track{background:var(--brand)}
.toggle input:checked+.track:before{transform:translateX(19px)}
.toggle-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 0;border-bottom:1px solid var(--line)}
.toggle-row:last-child{border-bottom:none}
.toggle-row .tr-label{font-size:14.5px;font-weight:600;color:var(--ink)}
.toggle-row .tr-sub{font-size:13px;color:var(--muted);margin-top:2px}

/* ======================================================
   MODAL
====================================================== */
.modal-overlay{position:fixed;inset:0;background:rgba(27,19,48,.65);z-index:999;display:flex;align-items:center;justify-content:center;padding:24px;animation:fadein .18s ease}
.modal-box{background:#fff;border-radius:16px;width:100%;max-width:480px;box-shadow:var(--shadow);overflow:hidden}
.modal-box.wide{max-width:640px}
.modal-head{display:flex;align-items:center;justify-content:space-between;padding:18px 22px;border-bottom:1px solid var(--line)}
.modal-head strong{font-size:15.5px}
.modal-close{background:none;border:none;cursor:pointer;font-size:20px;line-height:1;color:var(--muted);padding:4px}
.modal-body{padding:22px;max-height:70vh;overflow-y:auto}

/* ======================================================
   FORM ELEMENTS — polished selects
====================================================== */
select{padding:10px 14px;border:1px solid var(--line);border-radius:10px;font-family:var(--b);font-size:14.5px;color:var(--ink);background:#fff;cursor:pointer;transition:.15s;-webkit-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B6280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;padding-right:36px}
select:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px rgba(126,43,181,.1)}

/* ======================================================
   STATUS ACTION BAR
====================================================== */
.status-action-bar{display:flex;align-items:center;gap:10px;padding:16px 22px;border-top:1px solid var(--line)}
.status-action-bar select{font-size:13.5px;padding:8px 32px 8px 12px}

/* ======================================================
   CHAT / MESSAGES — proper bubble UI
====================================================== */

/* The scrollable thread container */
.chat-thread{
  display:flex;
  flex-direction:column;
  gap:4px;
  padding:20px;
  background:#F9F7FC;
  min-height:220px;
  max-height:480px;
  overflow-y:auto;
  scroll-behavior:smooth;
}

/* Date divider */
.chat-date-sep{
  display:flex;
  align-items:center;
  gap:10px;
  margin:12px 0 8px;
  color:var(--muted);
  font-size:11.5px;
  font-weight:600;
  letter-spacing:.05em;
  text-transform:uppercase;
}
.chat-date-sep::before,.chat-date-sep::after{content:'';flex:1;height:1px;background:var(--line)}

/* Individual message row */
.msg{
  display:flex;
  gap:8px;
  max-width:82%;
  margin-bottom:2px;
  animation:bubble-in-left .22s cubic-bezier(.22,1,.36,1);
}
/* "Mine" — flip to right */
.msg.mine{
  flex-direction:row-reverse;
  margin-left:auto;
  animation-name:bubble-in-right;
}

/* Avatar circle */
.msg-av{
  width:32px;height:32px;
  border-radius:50%;
  background:var(--plum);
  color:#fff;
  display:flex;align-items:center;justify-content:center;
  font-size:12px;font-weight:700;
  flex-shrink:0;
  margin-top:auto; /* stick to bottom of group */
}
/* Billing/admin = deep plum, doctors/staff = brand purple */
.msg-av.pract{background:var(--brand)}
.msg-av.hidden{visibility:hidden} /* for consecutive messages same sender */

/* The bubble itself */
.msg-bubble{
  display:flex;
  flex-direction:column;
  max-width:100%;
}
/* "Theirs" bubble */
.msg-content{
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px 18px 18px 4px;
  padding:10px 14px;
  font-size:14px;
  line-height:1.55;
  color:var(--ink);
  box-shadow:0 1px 3px rgba(52,21,82,.06);
  word-break:break-word;
  white-space:pre-wrap;
}
/* "Mine" bubble — brand colour */
.mine .msg-content{
  background:var(--brand);
  color:#fff;
  border-color:var(--brand);
  border-radius:18px 18px 4px 18px;
  box-shadow:0 2px 8px rgba(126,43,181,.25);
}

/* Meta line (name + time) */
.msg-meta{
  display:flex;
  align-items:center;
  gap:6px;
  margin-top:4px;
  padding:0 4px;
}
.mine .msg-meta{justify-content:flex-end}
.msg-sender{font-size:11.5px;font-weight:700;color:var(--ink)}
.msg-role{font-size:10.5px;font-weight:600;padding:1px 6px;border-radius:999px;background:var(--lilac);color:var(--muted)}
.msg-role.billing_team,.msg-role.admin{background:#EAF1FE;color:#2563EB}
.msg-role.doctor{background:#EDE6FA;color:var(--brand)}
.mine .msg-sender,.mine .msg-role{display:none} /* no need — bubble colour already says "me" */
.msg-time{font-size:11px;color:var(--muted)}
.mine .msg-time{color:rgba(107,98,128,.7)}

/* Empty chat state */
.chat-empty{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:32px 20px;
  text-align:center;
  gap:10px;
  color:var(--muted);
}
.chat-empty svg{opacity:.3}
.chat-empty p{font-size:14px;max-width:280px;line-height:1.5}

/* Compose bar */
.chat-compose{
  border-top:1.5px solid var(--line);
  padding:14px 16px;
  display:flex;
  gap:10px;
  align-items:flex-end;
  background:#fff;
}
.chat-compose-input{
  flex:1;
  border:1.5px solid var(--line);
  border-radius:22px;
  padding:10px 16px;
  font-family:var(--b);
  font-size:14px;
  color:var(--ink);
  background:#FAFAFA;
  resize:none;
  min-height:42px;
  max-height:160px;
  line-height:1.5;
  overflow-y:auto;
  transition:border-color .15s,background .15s,box-shadow .15s;
  outline:none;
}
.chat-compose-input:focus{
  border-color:var(--brand);
  background:#fff;
  box-shadow:0 0 0 3px rgba(126,43,181,.1);
}
.chat-compose-input:empty:before{
  content:attr(data-placeholder);
  color:var(--muted);
  pointer-events:none;
}
.chat-send-btn{
  width:42px;height:42px;
  border-radius:50%;
  background:var(--brand);
  border:none;
  color:#fff;
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;
  flex-shrink:0;
  transition:.18s;
}
.chat-send-btn:hover{background:var(--brand2);transform:scale(1.05)}
.chat-send-btn:disabled{opacity:.4;transform:none;cursor:not-allowed}
.chat-char-count{font-size:11.5px;color:var(--muted);padding:0 4px 2px;align-self:flex-end}

/* ======================================================
   ACTIVITY TIMELINE
====================================================== */
.activity-row{display:flex;align-items:flex-start;gap:14px;padding:13px 22px;border-bottom:1px solid var(--line);position:relative}
.activity-row:last-child{border-bottom:none}
.activity-icon{width:30px;height:30px;border-radius:50%;background:var(--lilac);display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--muted)}
.activity-icon.uploaded{background:#EDE6FA;color:var(--brand)}
.activity-icon.status_changed{background:#E9F8F1;color:#0E8A5F}
.activity-icon.replied{background:#EAF1FE;color:#2563EB}
.activity-icon.downloaded{background:#FCF3E3;color:#B7791F}
.activity-icon.viewed_inline{background:#F0EEF4;color:var(--muted)}
.activity-content{flex:1;min-width:0}
.activity-who{font-size:13.5px;font-weight:600;color:var(--ink)}
.activity-what{font-size:13px;color:var(--muted);margin-top:1px}
.activity-when{font-size:11.5px;color:var(--muted);white-space:nowrap;padding-top:3px;flex-shrink:0}

/* ======================================================
   STAT CARDS accent
====================================================== */
.stat{position:relative;overflow:hidden}
.stat::before{content:'';position:absolute;left:0;top:20%;bottom:20%;width:3px;border-radius:0 3px 3px 0;background:var(--brand);opacity:.2}
.stat .lbl{font-size:12px;text-transform:uppercase;letter-spacing:.06em;font-weight:600}
.page-head h1{font-family:var(--d);font-weight:600}
.card-head h2{font-size:15px;font-weight:700;letter-spacing:-.01em}

/* ======================================================
   MULTI-FILE UPLOAD
====================================================== */
.file-queue{display:flex;flex-direction:column;gap:8px;margin-top:14px}
.file-row{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#FCFBFE;animation:risein .2s ease both}
.file-row .fr-icon{width:32px;height:32px;border-radius:8px;background:var(--lilac);color:var(--brand);display:flex;align-items:center;justify-content:center;font-size:10.5px;font-weight:700;flex-shrink:0}
.file-row .fr-name{flex:1;font-size:13.5px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.file-row .fr-size{font-size:12px;color:var(--muted);flex-shrink:0}
.file-row .fr-status{font-size:11px;font-weight:700;padding:2px 8px;border-radius:999px;flex-shrink:0}
.file-row .fr-status.pending{background:var(--lilac);color:var(--muted)}
.file-row .fr-status.done{background:#E3F6EC;color:#0E8A5F}
.file-row .fr-status.failed{background:#FBE9E7;color:#C0392B}

/* ======================================================
   BADGES (extras)
====================================================== */
.badge.pending_2fa,.badge.warn{background:#FDF2D8;color:var(--amber)}
.badge.ok{background:#E9F8F1;color:#0E8A5F}

/* ======================================================
   2FA
====================================================== */
.totp-secret{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:17px;letter-spacing:1.5px;background:var(--lilac);padding:14px 16px;border-radius:10px;text-align:center;word-break:break-all;border:1px solid var(--line)}
.recovery-codes{display:grid;grid-template-columns:1fr 1fr;gap:8px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13.5px}
.recovery-codes div{background:var(--lilac);padding:9px 12px;border-radius:8px;text-align:center;letter-spacing:.5px}
.otp-input-row{display:flex;gap:8px;justify-content:center;margin:18px 0}
.otp-input-row input{width:44px;height:54px;text-align:center;font-size:22px;font-weight:700;border:1.5px solid var(--line);border-radius:10px;font-family:var(--b);transition:.15s}
.otp-input-row input:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px rgba(126,43,181,.12)}

/* ======================================================
   REDUCE MOTION
====================================================== */
@media (prefers-reduced-motion: reduce){
  .animate-in,.fade-in,.modal-pop,.stagger>*,.msg,.file-row,.toast{animation:none!important}
  .spinner{animation-duration:1.2s}
}
