:root{--sidebar-width:250px;--bg:#f4f7fb;--card-radius:1rem}
html,body{height:100%}
body{background:var(--bg);color:#1f2937;min-height:100vh;display:flex;flex-direction:column}
.auth-body{min-height:100vh;display:flex;align-items:center;background:linear-gradient(135deg,#0d6efd 0%,#0a58ca 55%,#071c3f 100%)}
.auth-body .card{border-radius:1.25rem}
.app-shell{min-height:100vh;display:flex;flex:1}.sidebar{width:var(--sidebar-width);min-height:100vh;position:sticky;top:0;padding-top:1.25rem}
.sidebar-brand{font-weight:700;font-size:1.25rem;padding:0 1rem 1rem;display:flex;flex-direction:column;align-items:flex-start;gap:.5rem}
.sidebar-brand img{max-height:58px;max-width:180px;border-radius:8px;background:#fff;padding:.25rem}
.sidebar .nav-link{border-radius:.75rem;margin-bottom:.35rem}
.sidebar .nav-link:hover{background:rgba(255,255,255,.12)}
.app-main{flex:1;min-width:0;display:flex;flex-direction:column;min-height:0}.topbar{position:sticky;top:0;z-index:20}.app-content{flex:1 0 auto;display:block}.portal-footer{margin-top:auto}.client-dashboard-page{padding-bottom:2rem}.client-dashboard-form textarea{resize:vertical;min-height:140px}
.card{border:0;border-radius:var(--card-radius)}
.stat-card{background:#fff;border-radius:var(--card-radius);padding:1.25rem;box-shadow:0 .5rem 1.5rem rgba(15,23,42,.06);height:100%}
.stat-label{font-size:.875rem;color:#6b7280;margin-bottom:.35rem}.stat-value{font-size:2rem;font-weight:700;line-height:1.1}
.conversation-list{max-height:600px;overflow:auto}.table>:not(caption)>*>*{padding:.9rem}
@media (max-width:991px){.sidebar{display:none}}
.marketing-body{background:#fff;color:#1f2937}.marketing-hero{background:radial-gradient(circle at top left,rgba(13,110,253,.45),transparent 35%),linear-gradient(135deg,#071c3f 0%,#0a58ca 48%,#0d6efd 100%)}
.py-lg-6{padding-top:6rem!important;padding-bottom:6rem!important}.glass-card{background:rgba(255,255,255,.12);backdrop-filter:blur(10px);border:1px solid rgba(255,255,255,.18);border-radius:1.5rem;box-shadow:0 1rem 3rem rgba(0,0,0,.15)}
.metric-card{background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.1);border-radius:1rem;padding:1rem;height:100%}.marketing-copy{max-width:760px}.featured-plan{outline:2px solid rgba(13,110,253,.18)}.marketing-cta{background:linear-gradient(135deg,#071c3f 0%,#0d6efd 100%)}.topbar-notifications{min-width:104px}

.sidebar-brand span{display:block}

.min-w-0{min-width:0}
.sidebar-offcanvas{max-width:min(86vw,320px)}
.sidebar-offcanvas .offcanvas-body{background:transparent}
.chat-message-list{min-height:320px;max-height:60vh;overflow-y:auto;scroll-behavior:smooth}
.chat-thread-link.active{border-left:4px solid var(--brand-primary)}
.chat-unread-badge{min-width:1.6rem}
.chat-layout .card{height:100%}
.chat-search{position:sticky;top:0;z-index:2;background:#fff}
@media (max-width:991px){
  .sidebar-desktop{display:none!important}
  .app-shell{display:block}
  .app-main{min-height:100vh}
  .topbar-notifications{min-width:auto}
  .chat-layout .chat-col{margin-bottom:1rem}
  .chat-message-list{max-height:45vh}
}
@media (min-width:992px){
  .sidebar-offcanvas{display:none!important}
}


.sidebar-mobile-content{display:block!important;width:100%!important;min-height:auto!important;position:static!important;top:auto!important;padding-top:1rem!important}
.sidebar-mobile-content .nav{padding-bottom:1rem}
.sidebar-offcanvas .offcanvas-body{background:#212529!important;color:#fff}
.sidebar-offcanvas .offcanvas-header{background:#212529;color:#fff}
@media (max-width:991px){.sidebar:not(.sidebar-mobile-content){display:none!important}}

.chat-widget{box-shadow:0 1rem 3rem rgba(15,23,42,.28);border:1px solid rgba(15,23,42,.08);border-radius:1rem;background:#fff}
.chat-widget-header{display:flex;align-items:center;gap:.75rem;padding:.75rem 1rem;color:#fff}
.chat-widget-status{font-size:.8rem;opacity:.92}
.chat-widget-hidden{display:none!important}
.chat-widget-launcher{border-radius:999px;box-shadow:0 .75rem 1.75rem rgba(15,23,42,.24)}
.chat-widget-tabs{display:flex}
.chat-widget-tab{flex:1;border:0;background:#fff;padding:.75rem 1rem;font-weight:600;color:#4b5563}
.chat-widget-tab.active{background:#eef4ff;color:#0d6efd}
.chat-widget-list{overflow:auto;flex:1 1 auto;min-height:0}
.chat-widget-list-view,.chat-widget-chat-view{display:flex;flex-direction:column;min-height:0;flex:1 1 auto}
.chat-widget-item{border-left:0;border-right:0}
.chat-widget-item.active{background:#eef4ff}
.chat-widget-messages{flex:1 1 auto;overflow:auto;padding:.75rem;background:#f8fafc;min-height:220px}
.chat-widget-empty{color:#6b7280;font-size:.92rem}
.chat-widget-footer{padding:.625rem;border-top:1px solid #e5e7eb;background:#fff}
.chat-bubble-row{display:flex;margin-bottom:.5rem}
.chat-bubble-row.mine{justify-content:flex-end}
.chat-bubble{max-width:80%;padding:.45rem .7rem;border-radius:1rem;box-shadow:0 .14rem .34rem rgba(15,23,42,.06);white-space:pre-wrap;word-break:break-word;line-height:1.28;display:inline-flex;flex-direction:column;gap:.2rem}
.chat-bubble.theirs{background:#fff;color:#111827;border:1px solid #e5e7eb;border-bottom-left-radius:.38rem}
.chat-bubble.mine{background:#0d6efd;color:#fff;border-bottom-right-radius:.38rem}
.chat-bubble-head{display:flex;align-items:center;justify-content:space-between;gap:.5rem}
.chat-bubble-meta{font-size:.68rem;font-weight:700;margin:0;opacity:.82;line-height:1}
.chat-bubble-time{display:block;font-size:.64rem;opacity:.72;margin:0;line-height:1;white-space:nowrap}
.chat-bubble-text{margin:0;line-height:1.28;font-size:.95rem}
.chat-thread-message{display:flex;margin-bottom:.5rem}
.chat-thread-message.mine{justify-content:flex-end}
.chat-thread-bubble{max-width:78%;padding:.45rem .7rem;border-radius:1rem;line-height:1.28;box-shadow:0 .14rem .34rem rgba(15,23,42,.06)}
.chat-thread-bubble.mine{background:#0d6efd;color:#fff;border-bottom-right-radius:.4rem}
.chat-thread-bubble.theirs{background:#fff;color:#111827;border:1px solid #e5e7eb;border-bottom-left-radius:.4rem}
.chat-thread-name{font-size:.68rem;font-weight:700;margin-bottom:.1rem;opacity:.82;line-height:1}
.chat-thread-text{margin:0;white-space:pre-wrap;word-break:break-word;line-height:1.3}
.chat-thread-time{font-size:.64rem;margin-top:.12rem;opacity:.72;line-height:1}

.chat-widget-item .btn{pointer-events:none}
