:root{
  --brand:#25D366;--brand-dark:#128C7E;--ink:#12212f;--muted:#6b7b8c;--bg:#f4f7fb;--card:#ffffff;--line:#e6ebf1;--nav:#0f1f2e;--danger:#ef4444;--warning:#f59e0b;--info:#3b82f6;
}
*{box-sizing:border-box} body{font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:var(--bg);color:var(--ink);margin:0}.app{min-height:100vh}.sidebar{width:268px;position:fixed;inset:0 auto 0 0;background:linear-gradient(180deg,#0d1b29,#13283b);color:#d9e5ef;padding:22px 16px;z-index:1040;overflow-y:auto}.brand{display:flex;align-items:center;gap:12px;padding:0 10px 22px}.brand-mark{width:44px;height:44px;border-radius:14px;background:linear-gradient(135deg,var(--brand),#65e890);display:grid;place-items:center;color:#063c24;font-size:22px;box-shadow:0 8px 22px rgba(37,211,102,.25)}.brand h1{font-size:16px;margin:0;color:#fff;font-weight:800}.brand small{color:#89a1b5}.nav-section{font-size:10px;text-transform:uppercase;letter-spacing:.13em;color:#6f879a;margin:18px 12px 8px}.sidebar .nav-link{display:flex;align-items:center;gap:12px;color:#b8c9d7;padding:11px 12px;border-radius:12px;margin:3px 0;font-size:14px}.sidebar .nav-link:hover,.sidebar .nav-link.active{color:#fff;background:rgba(255,255,255,.08)}.sidebar .nav-link.active{box-shadow:inset 3px 0 var(--brand)}.sidebar .badge{margin-left:auto}.main{margin-left:268px}.topbar{height:76px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 26px;position:sticky;top:0;z-index:1030}.page{padding:26px}.page-title h2{font-size:24px;font-weight:800;margin:0}.page-title p{color:var(--muted);margin:4px 0 0}.cardx{background:var(--card);border:1px solid var(--line);border-radius:18px;box-shadow:0 5px 18px rgba(26,52,77,.04)}.metric{padding:20px}.metric .icon{width:46px;height:46px;border-radius:14px;display:grid;place-items:center;background:#eefcf4;color:#11904c;font-size:22px}.metric .value{font-size:28px;font-weight:800;margin-top:12px}.metric .label{color:var(--muted);font-size:13px}.metric .trend{font-size:12px}.table>thead th{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:#8091a2;border-bottom-color:var(--line);white-space:nowrap}.table>tbody td{vertical-align:middle;border-color:#eef1f5}.avatar{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:#e9f7ef;color:#107744;font-weight:800}.status{display:inline-flex;align-items:center;gap:6px;padding:6px 9px;border-radius:999px;font-size:11px;font-weight:700}.status.new{background:#eaf3ff;color:#2563eb}.status.pending{background:#fff4dd;color:#a85b00}.status.approved{background:#e8faef;color:#14804a}.status.failed{background:#feecec;color:#b42318}.status.followup{background:#f2ebff;color:#6d28d9}.btn-brand{background:var(--brand-dark);border-color:var(--brand-dark);color:#fff}.btn-brand:hover{background:#0d7569;color:#fff}.soft{background:#f7fafc}.chat-layout{display:grid;grid-template-columns:340px 1fr 320px;min-height:calc(100vh - 128px);overflow:hidden}.chat-list{border-right:1px solid var(--line);background:#fff}.chat-list .person{padding:14px 16px;border-bottom:1px solid #f0f3f6;display:flex;gap:11px;cursor:pointer}.chat-list .person.active{background:#edf9f3}.chat-window{display:flex;flex-direction:column;background:#eef3f5}.chat-head{background:#fff;border-bottom:1px solid var(--line);padding:12px 18px}.messages{padding:22px;overflow:auto;flex:1;min-height:520px}.bubble{max-width:72%;padding:11px 13px;border-radius:14px;margin:8px 0;box-shadow:0 1px 2px rgba(0,0,0,.04);font-size:14px}.bubble.in{background:#fff;border-top-left-radius:4px}.bubble.out{background:#d9fdd3;margin-left:auto;border-top-right-radius:4px}.bubble.ai{background:#f2ebff;border:1px solid #dfd1ff}.bubble small{display:block;text-align:right;color:#7b8a99;margin-top:5px}.composer{background:#fff;border-top:1px solid var(--line);padding:12px;display:flex;gap:10px}.customer-panel{background:#fff;border-left:1px solid var(--line);padding:18px}.kv{display:flex;justify-content:space-between;gap:15px;padding:9px 0;border-bottom:1px dashed #e9edf2;font-size:13px}.kv span:first-child{color:var(--muted)}.ai-box{background:linear-gradient(135deg,#f7f1ff,#f0f8ff);border:1px solid #e5d8ff;border-radius:16px;padding:18px}.approval-card{border-left:4px solid var(--warning)}.attachment{display:flex;align-items:center;gap:12px;border:1px solid var(--line);border-radius:14px;padding:12px}.attachment .fileicon{width:42px;height:42px;border-radius:12px;background:#fff0ef;color:#dc2626;display:grid;place-items:center}.timeline{position:relative;padding-left:24px}.timeline:before{content:"";position:absolute;left:7px;top:6px;bottom:6px;width:2px;background:#e5eaf0}.timeline-item{position:relative;margin-bottom:18px}.timeline-item:before{content:"";position:absolute;left:-21px;top:4px;width:10px;height:10px;border-radius:50%;background:var(--brand-dark);box-shadow:0 0 0 4px #e8f8f4}.log-row{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.setting-card{padding:20px}.integration-logo{width:52px;height:52px;border-radius:14px;background:#f3f6f9;display:grid;place-items:center;font-size:24px}.mobile-toggle{display:none}.overlay{display:none}
@media(max-width:1199px){.chat-layout{grid-template-columns:300px 1fr}.customer-panel{display:none}}
@media(max-width:991px){.sidebar{transform:translateX(-100%);transition:.25s}.sidebar.show{transform:translateX(0)}.main{margin-left:0}.mobile-toggle{display:inline-flex}.overlay.show{display:block;position:fixed;inset:0;background:rgba(6,18,31,.45);z-index:1035}.page{padding:18px}.topbar{padding:0 16px}.chat-layout{grid-template-columns:1fr}.chat-list{display:none}}
@media(max-width:575px){.page-title h2{font-size:21px}.topbar{height:68px}.page{padding:14px}.metric{padding:16px}.bubble{max-width:88%}.d-xs-none{display:none!important}.cardx{border-radius:15px}}

/* Enterprise UI refresh */
:root{--brand:#16a36a;--brand-dark:#0d7653;--brand-deep:#07513b;--brand-soft:#eaf7f1;--ink:#17252f;--muted:#6e7e88;--bg:#f3f5f6;--card:#fff;--line:#dfe5e7;--line-soft:#edf1f2;--nav:#10241f;--radius:12px;--sidebar:248px}
html{min-width:320px;background:var(--bg)}body{overflow-x:hidden;font-family:Inter,"Segoe UI",Roboto,Arial,sans-serif;font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased}.sidebar{width:var(--sidebar);padding:18px 12px;background:var(--nav);border-right:1px solid rgba(255,255,255,.055)}.brand{gap:11px;min-height:54px;margin-bottom:16px;padding:5px 9px 15px;border-bottom:1px solid rgba(255,255,255,.08)}.brand-mark{flex:0 0 36px;width:36px;height:36px;border-radius:9px;background:var(--brand);color:#fff;font-size:17px;box-shadow:none}.brand h1{font-size:15px;font-weight:750}.brand small{display:block;margin-top:1px;color:#94aaa3;font-size:10.5px}.nav-section{margin:19px 11px 7px;color:#718980;font-size:9.5px;font-weight:700;letter-spacing:.14em}
.sidebar .nav-link{gap:11px;min-height:40px;margin:2px 0;padding:9px 11px;border-radius:8px;color:#afc1bb;font-size:13px;font-weight:500;transition:.16s ease}.sidebar .nav-link>i{width:18px;color:#829991;font-size:15px;text-align:center}.sidebar .nav-link:hover{background:rgba(255,255,255,.055);color:#fff}.sidebar .nav-link.active{background:#1d3b32;color:#fff;box-shadow:inset 2px 0 var(--brand)}.sidebar .nav-link.active>i{color:#59d69d}.sidebar .badge{padding:3px 6px;background:#f3c76d!important;color:#513600!important;font-size:9px}.main{min-width:0;margin-left:var(--sidebar)}
.topbar{height:70px;padding:0 28px;background:rgba(255,255,255,.96);backdrop-filter:blur(10px)}.page{width:100%;max-width:1600px;margin:0 auto;padding:24px 28px 36px}.page-title h2{font-size:20px;font-weight:750;letter-spacing:-.025em}.page-title p{margin-top:2px;font-size:12px}.topbar>.d-flex:last-child{gap:10px!important}.topbar .btn-light{width:36px;height:36px;padding:0;border:1px solid var(--line);background:#fff;color:#344652}.topbar .bg-danger{min-width:17px;padding:3px 5px;background:#c23b3b!important;border:2px solid #fff;font-size:9px}.avatar{flex:0 0 36px;width:36px;height:36px;background:#dcefe7;color:var(--brand-deep);font-size:11px;font-weight:750}

/* Refined shared components */
.cardx{border:1px solid var(--line);border-radius:var(--radius);box-shadow:0 1px 2px rgba(21,36,43,.04),0 4px 12px rgba(21,36,43,.03)}.cardx h5,.cardx h6{color:var(--ink);letter-spacing:-.012em}.cardx h5{font-size:15px}.cardx h6{font-size:13px}.text-secondary{color:var(--muted)!important}hr{margin:18px 0;color:var(--line);opacity:1}
.btn{min-height:38px;padding:7px 13px;border-radius:8px;font-size:12.5px;font-weight:650;box-shadow:none!important;transition:transform .12s ease,background-color .15s ease,border-color .15s ease}.btn:active{transform:translateY(1px)}.btn-sm{min-height:32px;padding:5px 9px;border-radius:7px;font-size:11.5px}.btn-brand{background:var(--brand-dark);border-color:var(--brand-dark)}.btn-brand:hover,.btn-brand:focus{background:var(--brand-deep);border-color:var(--brand-deep)}.btn-light{background:#f6f8f8;border-color:var(--line);color:#344652}.btn-light:hover{background:#edf1f2;border-color:#d2dbde;color:var(--ink)}.btn-outline-secondary{border-color:#cbd4d7;color:#344652}.btn-outline-danger{border-color:#e0b7b7;color:#c23b3b}
.form-control,.form-select{min-height:40px;border:1px solid #ccd6d9;border-radius:8px;background-color:#fff;color:var(--ink);font-size:13px;box-shadow:none}.form-control::placeholder{color:#94a1a9}.form-control:hover,.form-select:hover{border-color:#aebdc2}.form-control:focus,.form-select:focus{border-color:var(--brand);box-shadow:0 0 0 3px rgba(22,163,106,.11)}textarea.form-control{padding:11px 12px;line-height:1.55;resize:vertical}.form-label{margin-bottom:6px;color:#344652;font-size:11.5px;font-weight:650}.form-text{font-size:11px}.form-check-input{border-color:#afbdc2;box-shadow:none!important}.form-check-input:checked{background-color:var(--brand-dark);border-color:var(--brand-dark)}.form-switch .form-check-input{width:34px;height:18px;margin-right:8px}.form-check-label{color:#344652;font-size:12.5px}
.status{gap:5px;width:fit-content;padding:4px 8px;border:1px solid transparent;border-radius:999px;font-size:10px;line-height:1.25;white-space:nowrap}.status i.bi-circle-fill{font-size:5px}.status.new{background:#edf5fd;border-color:#d7e7f6;color:#286493}.status.pending{background:#fff7e7;border-color:#f2dfba;color:#8a590d}.status.approved{background:#ebf7f1;border-color:#d1ebdf;color:#126443}.status.failed{background:#fff0f0;border-color:#f2d1d1;color:#a73333}.status.followup{background:#f4effa;border-color:#e3d7f0;color:#68468e}
.table{--bs-table-bg:transparent;color:#344652;font-size:12.5px}.table>thead th{padding:10px 12px;background:#f7f9f9;color:#687982;border-top:1px solid var(--line-soft);border-bottom:1px solid var(--line);font-size:9.5px;font-weight:750;letter-spacing:.075em}.table>tbody td{padding:13px 12px;border-color:var(--line-soft)}.table>tbody tr{transition:background-color .14s ease}.table>tbody tr:hover{background:#fafcfc}.table b{color:var(--ink);font-weight:650}.table small{margin-top:2px;font-size:10.5px}

/* Dashboard, data and conversation workspaces */
.metric{position:relative;min-height:152px;padding:18px;overflow:hidden}.metric .icon{position:absolute;top:18px;right:18px;width:32px;height:32px;border:1px solid #d9ebe3;border-radius:8px;background:var(--brand-soft);color:var(--brand-dark);font-size:15px}.metric .value{margin-top:25px;color:var(--ink);font-size:26px;font-weight:760;letter-spacing:-.035em;line-height:1.1}.metric .label{position:absolute;top:19px;left:18px;max-width:calc(100% - 65px);font-size:11px;font-weight:600}.metric .trend{padding-top:9px;font-size:10.5px}.timeline{padding-left:24px}.timeline:before{top:5px;bottom:6px;left:6px;width:1px;background:#dce4e6}.timeline-item{margin-bottom:18px;font-size:12.5px}.timeline-item:last-child{margin-bottom:0}.timeline-item:before{top:5px;left:-21px;width:7px;height:7px;background:var(--brand-dark);box-shadow:0 0 0 3px #e8f5ef}.timeline-item small{margin-top:3px;font-size:10.5px;line-height:1.45}.kv{align-items:center;min-height:38px;padding:8px 0;border-bottom:1px solid var(--line-soft);font-size:11.5px}.kv:last-child{border-bottom:0}.kv b{color:#344652;font-weight:650;text-align:right}
.chat-layout{grid-template-columns:290px minmax(360px,1fr) 280px;min-height:calc(100vh - 130px);max-height:calc(100vh - 130px);border-radius:var(--radius)}.chat-list{overflow-y:auto}.chat-list>.p-3{position:sticky;top:0;z-index:2;padding:14px!important;background:#fff}.chat-list .person{align-items:center;min-height:72px;padding:13px 14px;border-bottom:1px solid var(--line-soft);transition:background-color .14s ease}.chat-list .person:hover{background:#f7f9f9}.chat-list .person.active{background:#edf7f2;box-shadow:inset 3px 0 var(--brand-dark)}.chat-list .person b{font-size:12.5px;font-weight:700}.chat-list .person small{max-width:180px;margin-top:2px;overflow:hidden;font-size:10.5px;text-overflow:ellipsis;white-space:nowrap}
.chat-window{min-width:0;background:#eef2f1}.chat-head{min-height:63px;padding:10px 17px}.chat-head b{font-size:13px}.chat-head small{margin-top:2px;font-size:10.5px}.messages{min-height:0;padding:22px 24px;background-color:#f1f4f3;background-image:radial-gradient(#dce4e1 .65px,transparent .65px);background-size:15px 15px}.bubble{width:fit-content;max-width:70%;margin:9px 0;padding:10px 12px;border:1px solid rgba(91,111,105,.10);border-radius:10px;color:#26383f;box-shadow:0 1px 2px rgba(24,42,36,.045);font-size:12.5px;line-height:1.5}.bubble.in{border-top-left-radius:3px}.bubble.out{background:#dff3e8;border-color:#cde9dc;border-top-right-radius:3px}.bubble.ai{max-width:78%;padding:12px 13px;background:#f4f0f8;border-color:#e0d6e9;color:#4f3e63}.bubble small{margin-top:5px;font-size:9.5px}
.composer{align-items:center;gap:8px;padding:11px 13px}.composer .form-control{background:#f8f9f9;border-color:#dce3e5}.composer .btn{flex:0 0 40px;width:40px;height:40px;padding:0}.customer-panel{overflow-y:auto;padding:19px 17px}.customer-panel>h6:first-child{padding-bottom:12px;border-bottom:1px solid var(--line)}.ai-box{padding:14px;background:#f5f3f7;border:1px solid #e3dce8;border-radius:9px;color:#52495a;line-height:1.8}

/* Workflow-specific surfaces */
.approval-card{position:relative;overflow:hidden;border-left:3px solid #d2922e}.approval-card textarea{background:#fbfcfc}.approval-card .approval-status{display:flex;align-items:center;gap:7px}.approval-card .approval-status:before{width:7px;height:7px;border-radius:50%;background:#d2922e;content:""}.attachment{min-width:0;padding:11px;border-radius:9px;transition:border-color .15s ease,box-shadow .15s ease}.attachment:hover{border-color:#cbd5d8;box-shadow:0 3px 10px rgba(21,36,43,.04)}.attachment .flex-grow-1{min-width:0}.attachment b{display:block;overflow:hidden;color:var(--ink);font-size:12px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.attachment small{font-size:10.5px}.attachment .fileicon{flex:0 0 38px;width:38px;height:38px;border-radius:8px;background:#fff1f0;color:#b63c36;font-size:17px}.attachment .bi-file-earmark-image{color:#356c9d}.list-group-item{background:transparent;border-color:var(--line-soft)}.list-group-item b{color:var(--ink);font-size:12.5px}.list-group-item p{margin-top:3px}.list-group-item>small:last-child{color:#91a0a9;font-size:10px}.alert{border-radius:8px}.alert-info{background:#eef6fb;border-color:#d2e5f1;color:#365b70}.log-row{font-family:"SFMono-Regular",Consolas,monospace;font-size:11px}.log-row td:nth-child(2),.log-row td:nth-child(3){font-family:Inter,"Segoe UI",sans-serif}.setting-card{padding:20px}.setting-card>h5{margin-bottom:15px}.integration-logo{flex:0 0 40px;width:40px;height:40px;border:1px solid #dde6e3;border-radius:9px;background:#eef6f2;color:var(--brand-dark);font-size:18px}

@media(max-width:1199.98px){.chat-layout{grid-template-columns:270px minmax(0,1fr)}}
@media(max-width:991.98px){.sidebar{width:var(--sidebar);box-shadow:0 10px 30px rgba(21,36,43,.16);transition:transform .2s ease}.main{margin-left:0}.overlay.show{background:rgba(8,22,18,.48);backdrop-filter:blur(2px)}.topbar{padding:0 20px}.page{padding:20px 20px 30px}.chat-layout{grid-template-columns:230px minmax(0,1fr);min-height:calc(100vh - 112px);max-height:calc(100vh - 112px)}}
@media(max-width:767.98px){.topbar{height:64px}.page{padding:16px}.page-title h2{font-size:18px}.cardx.p-4,.cardx.p-md-4{padding:17px!important}.metric{min-height:138px}.chat-layout{display:flex;max-height:none;min-height:calc(100vh - 96px);flex-direction:column;overflow:visible}.chat-list{display:block;max-height:235px;flex:0 0 235px;border-right:0;border-bottom:1px solid var(--line)}.chat-list>.p-3{padding:10px!important}.chat-list .person{min-height:64px;padding:10px 13px}.chat-list .person small{max-width:calc(100vw - 115px)}.chat-window{min-height:560px}.messages{padding:16px}.bubble,.bubble.ai{max-width:88%}.chat-head{align-items:flex-start!important;gap:7px}.chat-head .status{white-space:normal;text-align:center}.approval-card .d-flex.justify-content-between:last-child{align-items:stretch;flex-direction:column}.approval-card .d-flex.justify-content-between:last-child>.d-flex{display:grid!important;grid-template-columns:1fr 1fr}.approval-card [data-approve]{grid-column:1/-1}}
@media(max-width:575.98px){body{font-size:13px}.topbar{padding:0 12px}.topbar>.d-flex:first-child{gap:9px!important}.topbar>.d-flex:last-child .avatar{display:none}.page{padding:12px}.page>.d-flex:first-child{margin-bottom:14px!important}.page>.d-flex:first-child>.d-flex{width:100%}.page>.d-flex:first-child>.d-flex .btn{flex:1}.metric{min-height:130px;padding:14px}.metric .label{top:15px;left:14px}.metric .icon{top:14px;right:14px}.metric .value{margin-top:29px;font-size:23px}.cardx{border-radius:10px}.cardx.p-3,.cardx.p-4,.cardx.p-md-4,.setting-card{padding:14px!important}.table{min-width:640px}.chat-layout{border-right:0;border-left:0;border-radius:0}.chat-window{min-height:520px}.chat-head{padding:9px 12px}.messages{padding:13px 11px}.bubble,.bubble.ai{max-width:92%;font-size:12px}.composer{position:sticky;bottom:0;z-index:2;padding:9px}.composer .btn{flex-basis:38px;width:38px;height:38px}.setting-card .attachment{align-items:flex-start;flex-wrap:wrap}.setting-card .attachment .status{margin-left:49px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition-duration:.01ms!important;animation-duration:.01ms!important}}
