:root{
  --bg:#f7f8ff; --surface:#fff; --text:#071246; --muted:#63709a; --line:#e5e9f5;
  --blue:#4457ff; --purple:#7a5cff; --green:#16c784; --red:#ff5067; --yellow:#ffc433;
  --shadow:0 18px 45px rgba(28,45,110,.08);
}
*{box-sizing:border-box}
body{margin:0;font-family:Inter,Arial,sans-serif;background:radial-gradient(circle at 15% 15%,rgba(122,92,255,.11),transparent 32%),radial-gradient(circle at 85% 0%,rgba(68,87,255,.09),transparent 34%),linear-gradient(180deg,#fbfcff,var(--bg));color:var(--text)}
a{color:var(--blue);text-decoration:none}.layout{display:flex;min-height:100vh}
.sidebar{width:280px;position:fixed;top:0;bottom:0;left:0;background:rgba(255,255,255,.9);border-right:1px solid var(--line);padding:24px 18px;backdrop-filter:blur(18px)}
.logo{display:flex;align-items:center;gap:12px;margin-bottom:34px}.logo-icon{width:48px;height:48px;border-radius:18px;background:rgba(255,255,255,.65);display:grid;place-items:center;box-shadow:0 14px 32px rgba(68,87,255,.18);border:1px solid rgba(68,87,255,.08)}
.logo-title{font-size:20px;font-weight:900;letter-spacing:-.04em}.logo-sub{font-size:12px;color:var(--muted);margin-top:3px}
.nav a{display:flex;align-items:center;gap:12px;padding:14px 16px;color:var(--text);border-radius:14px;margin:6px 0;font-weight:700}.nav a:hover{background:linear-gradient(90deg,rgba(122,92,255,.14),rgba(15,235,190,.05));color:var(--blue);box-shadow:0 10px 26px rgba(68,87,255,.08)}
.side-card{position:absolute;left:22px;right:22px;bottom:74px;background:linear-gradient(135deg,#fff,#f3f0ff);border:1px solid var(--line);border-radius:16px;padding:18px;box-shadow:var(--shadow);font-size:13px}.side-footer{position:absolute;left:22px;right:22px;bottom:24px;color:var(--muted);font-size:12px}
.content{margin-left:280px;width:calc(100% - 280px);padding:0 34px 34px}.topbar{height:76px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);margin:0 -34px 28px;padding:0 34px;background:rgba(255,255,255,.45);backdrop-filter:blur(12px)}
.hamb{display:none}.userbox{display:flex;align-items:center;gap:14px}.usercircle{width:48px;height:48px;border-radius:18px;background:rgba(255,255,255,.7);display:grid;place-items:center;box-shadow:0 10px 24px rgba(68,87,255,.12);border:1px solid rgba(68,87,255,.08)}
h1{font-size:32px;margin:0 0 6px;letter-spacing:-.04em}.subtitle{color:var(--muted);font-size:15px}.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:28px}
.date-pill{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:14px 18px;font-weight:800;color:#18235b;box-shadow:var(--shadow)}
.kpi-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:18px;margin-bottom:22px}.card{background:rgba(255,255,255,.92);border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow)}
.kpi{padding:24px;display:flex;gap:18px;align-items:center;min-height:138px}.kpi-icon{width:58px;height:58px;border-radius:18px;display:grid;place-items:center;background:linear-gradient(135deg,rgba(68,87,255,.09),rgba(129,255,216,.12));box-shadow:inset 0 0 0 1px rgba(68,87,255,.08),0 12px 26px rgba(68,87,255,.12);flex:none}.kpi-icon.red{background:linear-gradient(135deg,rgba(255,80,103,.09),rgba(129,255,216,.1))}.kpi-icon.yellow{background:linear-gradient(135deg,rgba(255,196,51,.14),rgba(129,255,216,.12))}
.kpi-title{font-size:13px;color:#2c376b;margin-bottom:8px}.kpi-value{font-size:31px;font-weight:900;letter-spacing:-.04em}.kpi-note{font-size:13px;color:var(--green);font-weight:800;margin-top:10px}
.grid-main{display:grid;grid-template-columns:1fr 1.45fr;gap:20px;margin-bottom:20px}.grid-bottom{display:grid;grid-template-columns:1.25fr .9fr .8fr;gap:20px;margin-bottom:20px}.panel{padding:24px}.panel-title{font-size:17px;font-weight:900;margin-bottom:20px}
.account-box{display:flex;align-items:center;gap:28px}.donut{width:170px;height:170px;border-radius:50%;background:conic-gradient(var(--green) 0 88%,var(--red) 88% 100%);position:relative;flex:none}.donut:after{content:"";position:absolute;inset:22px;border-radius:50%;background:white}.donut-center{position:absolute;inset:0;display:grid;place-items:center;z-index:1;text-align:center;font-weight:900;font-size:30px}.donut-center span{display:block;font-size:12px;color:var(--muted);font-weight:600}
.legend{flex:1}.legend-row{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);padding:14px 0}.dot{width:12px;height:12px;border-radius:50%;display:inline-block;margin-right:10px;background:var(--green)}.dot.red{background:var(--red)}
.chart-placeholder{height:230px;border-radius:12px;background:linear-gradient(to right,transparent 0 14%,rgba(99,112,154,.12) 14% 14.5%,transparent 14.5% 100%),repeating-linear-gradient(0deg,transparent,transparent 45px,rgba(99,112,154,.14) 46px);position:relative}.chart-line{position:absolute;left:7%;right:5%;height:3px;background:linear-gradient(90deg,var(--blue),var(--green));border-radius:10px;top:52%;transform:rotate(-7deg)}.chart-line.two{background:linear-gradient(90deg,var(--green),var(--purple));top:66%;transform:rotate(2deg)}.chart-line.three{background:linear-gradient(90deg,var(--purple),var(--yellow));top:78%;transform:rotate(-2deg)}
.info-row{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.info-item{padding:16px;border-top:1px solid var(--line)}.info-label{color:var(--muted);font-size:13px}.info-value{font-size:18px;font-weight:900;margin-top:6px}
.bar-row{display:grid;grid-template-columns:120px 1fr 42px;align-items:center;gap:12px;margin:13px 0;font-size:13px}.bar{height:8px;border-radius:20px;background:#f0f2fa;overflow:hidden}.bar span{display:block;height:100%;background:linear-gradient(90deg,var(--purple),var(--blue));border-radius:20px}
.conv-row{display:flex;justify-content:space-between;align-items:center;padding:15px 0;font-size:16px}.conv-row:not(:last-child){border-bottom:1px solid var(--line)}.conv-row strong{font-size:18px}
.success-banner{display:grid;grid-template-columns:1.3fr 1fr 1fr 1fr;gap:20px;padding:22px 28px;align-items:center}.success-main{display:flex;align-items:center;gap:18px}.rocket{width:66px;height:66px;display:grid;place-items:center;flex:none}.success-title{font-size:20px;font-weight:900}.success-sub{color:var(--muted);margin-top:6px}
.table{width:100%;border-collapse:collapse;font-size:14px}.table th{text-align:left;color:var(--muted);padding:13px 10px;border-bottom:1px solid var(--line);font-size:12px;text-transform:uppercase}.table td{padding:13px 10px;border-bottom:1px solid var(--line);vertical-align:top}.table tr:hover td{background:#fafbff}
.badge{display:inline-block;padding:5px 10px;border-radius:999px;background:#f0edff;color:var(--purple);font-size:12px;font-weight:800}.badge.green{background:#e9fff5;color:var(--green)}.badge.red{background:#fff0f2;color:var(--red)}
.form{display:flex;gap:10px;flex-wrap:wrap;margin:0 0 18px}input,select,button,textarea{border:1px solid var(--line);border-radius:12px;padding:12px 14px;background:white;color:var(--text);font:inherit}textarea{width:100%;min-height:110px;resize:vertical}button{background:linear-gradient(135deg,var(--blue),var(--purple));color:white;font-weight:800;border:0;cursor:pointer}.btn-secondary{background:#f0edff;color:var(--purple)}
.cards{display:grid;grid-template-columns:repeat(2,1fr);gap:18px}.dialog-card{padding:20px}.message{max-width:920px;padding:14px 16px;border-radius:18px;margin:12px 0;white-space:pre-wrap;line-height:1.45}.message.user{background:#eff4ff;margin-right:auto}.message.assistant{background:#f1fff8;margin-left:48px}.meta{font-size:12px;color:var(--muted);margin-bottom:6px}.lead-head{display:grid;grid-template-columns:1.35fr .8fr;gap:20px;margin-bottom:20px}
.flash{padding:14px 18px;border-radius:14px;background:#f0edff;color:var(--purple);font-weight:800;margin-bottom:16px}.login-wrap{min-height:100vh;display:grid;place-items:center;padding:20px}.login{width:430px;max-width:100%;padding:32px}.error{color:var(--red);font-weight:800;margin:12px 0}.small{font-size:12px;color:var(--muted)}
@media(max-width:1200px){.kpi-grid{grid-template-columns:repeat(2,1fr)}.grid-main,.grid-bottom,.success-banner,.lead-head,.cards{grid-template-columns:1fr}.sidebar{position:static;width:100%;height:auto}.content{margin-left:0;width:100%}.layout{display:block}.side-card,.side-footer{position:static;margin-top:18px}}

select{min-width:210px}.badge{white-space:nowrap}


/* Gradient icons like the visual reference */
.gicon{--b:#5256f6;--m:#82ffd8;position:relative;display:inline-block;width:28px;height:28px;flex:0 0 28px;filter:drop-shadow(0 10px 14px rgba(68,87,255,.14))}
.gicon:before,.gicon:after{content:"";position:absolute;display:block}.small-icon{width:24px;height:24px;flex-basis:24px}.text-icon{width:20px;height:20px;vertical-align:-4px;margin-right:8px}.big-icon{width:58px;height:58px;flex-basis:58px}
.g-car:before{left:2px;right:2px;bottom:7px;height:12px;border-radius:7px;background:linear-gradient(135deg,var(--b),var(--m))}.g-car:after{left:7px;top:5px;width:14px;height:12px;border-radius:12px 12px 4px 4px;background:linear-gradient(180deg,var(--m),rgba(82,86,246,.85))}.g-car{border-bottom:4px solid transparent}.g-car i{display:none}
.g-dashboard:before{left:2px;bottom:3px;width:23px;height:18px;border-radius:7px;background:var(--b)}.g-dashboard:after{right:1px;top:2px;width:21px;height:21px;border-radius:7px;background:linear-gradient(180deg,var(--m),rgba(64,155,225,.65));box-shadow:-9px 9px 16px rgba(0,104,255,.25)}
.g-users:before{left:1px;bottom:4px;width:18px;height:18px;border-radius:50% 50% 6px 6px;background:var(--b)}.g-users:after{right:1px;top:2px;width:18px;height:18px;border-radius:50%;background:linear-gradient(180deg,var(--m),rgba(78,113,238,.75));box-shadow:-6px 10px 14px rgba(0,104,255,.22)}
.g-chat:before{left:1px;bottom:3px;width:19px;height:17px;border-radius:6px;background:var(--b)}.g-chat:after{right:1px;top:3px;width:20px;height:17px;border-radius:6px;background:linear-gradient(180deg,var(--m),rgba(72,149,221,.65));clip-path:polygon(0 0,100% 0,100% 78%,36% 78%,17% 100%,17% 78%,0 78%)}
.g-send:before{left:2px;top:3px;width:24px;height:22px;background:var(--b);clip-path:polygon(0 0,100% 50%,0 100%,25% 52%)}.g-send:after{left:2px;top:10px;width:18px;height:9px;background:linear-gradient(90deg,var(--m),rgba(68,87,255,.2));clip-path:polygon(0 25%,100% 0,86% 100%,8% 75%)}
.g-contacts:before{left:5px;bottom:4px;width:19px;height:15px;border-radius:8px 8px 4px 4px;background:var(--b)}.g-contacts:after{left:7px;top:2px;width:16px;height:16px;border-radius:50%;background:linear-gradient(180deg,var(--m),rgba(71,142,225,.72));box-shadow:0 10px 13px rgba(0,104,255,.2)}
.g-shield:before{left:4px;top:2px;width:20px;height:24px;border-radius:11px 11px 8px 8px;background:var(--b);clip-path:polygon(50% 0,94% 16%,88% 68%,50% 100%,12% 68%,6% 16%)}.g-shield:after{left:9px;top:7px;width:10px;height:14px;border-radius:8px;background:linear-gradient(180deg,var(--m),rgba(81,177,226,.7))}
.g-exit:before{left:3px;top:5px;width:16px;height:18px;border-radius:6px;background:var(--b)}.g-exit:after{right:1px;top:8px;width:18px;height:12px;background:linear-gradient(90deg,var(--m),rgba(68,87,255,.25));clip-path:polygon(0 34%,58% 34%,58% 0,100% 50%,58% 100%,58% 66%,0 66%)}
.g-bell:before{left:6px;top:4px;width:16px;height:18px;border-radius:10px 10px 6px 6px;background:linear-gradient(180deg,var(--m),var(--b))}.g-bell:after{left:10px;bottom:2px;width:8px;height:5px;border-radius:0 0 8px 8px;background:var(--b)}
.g-user:before{left:4px;bottom:3px;width:20px;height:15px;border-radius:10px 10px 4px 4px;background:var(--b)}.g-user:after{left:8px;top:2px;width:13px;height:13px;border-radius:50%;background:linear-gradient(180deg,var(--m),rgba(72,149,221,.65))}
.g-calendar:before{left:2px;top:5px;width:24px;height:20px;border-radius:6px;background:var(--b)}.g-calendar:after{left:6px;top:2px;width:16px;height:8px;border-radius:6px 6px 0 0;border:4px solid var(--m);border-bottom:0}.g-error:before{left:4px;top:4px;width:20px;height:20px;border-radius:50%;background:linear-gradient(135deg,#ff5067,var(--b))}.g-error:after{left:12px;top:8px;width:4px;height:12px;background:white;border-radius:3px;transform:rotate(45deg);box-shadow:0 0 0 0 white}.g-star:before{left:3px;top:2px;width:22px;height:22px;background:linear-gradient(135deg,#ffc433,var(--m));clip-path:polygon(50% 0,61% 35%,98% 35%,68% 56%,80% 94%,50% 72%,20% 94%,32% 56%,2% 35%,39% 35%)}.g-rocket:before{left:8px;top:2px;width:34px;height:44px;background:var(--b);clip-path:polygon(0 0,100% 50%,0 100%,28% 52%)}.g-rocket:after{left:7px;top:22px;width:34px;height:15px;background:linear-gradient(90deg,var(--m),rgba(68,87,255,.22));clip-path:polygon(0 25%,100% 0,86% 100%,8% 75%)}
.nav a:hover .gicon,.kpi:hover .gicon{transform:translateY(-1px);transition:.18s ease}

/* CRM polish fixes */
.side-footer{display:none!important}.side-card{bottom:24px}.topbar{display:none}.content{padding-top:28px}.page-head{align-items:center}
.form select[name="qualified"] option:first-child{font-size:0}.leads-panel{overflow-x:auto}.leads-table{table-layout:fixed;min-width:1120px}.leads-table th:nth-child(1),.leads-table td:nth-child(1){width:180px}.leads-table th:nth-child(2),.leads-table td:nth-child(2){width:110px}.leads-table th:nth-child(3),.leads-table td:nth-child(3){width:210px}.leads-table th:nth-child(4),.leads-table td:nth-child(4){width:180px}.leads-table th:nth-child(5),.leads-table td:nth-child(5){width:130px}.leads-table th:nth-child(6),.leads-table td:nth-child(6){width:190px}.leads-table th:nth-child(7),.leads-table td:nth-child(7){width:auto}.table td{line-height:1.28;word-break:normal;overflow-wrap:anywhere}.table th{white-space:nowrap}
.dashboard-kpis .kpi{min-height:150px;align-items:center;justify-content:flex-start}.dashboard-kpis .kpi>div:last-child{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;min-height:92px}.kpi-title{line-height:1.2}.kpi-value{line-height:1;margin:2px 0}.kpi-note{line-height:1.25}.red-note{color:var(--red)!important}.dashboard-main{grid-template-columns:1fr 1.55fr}.dashboard-bottom{grid-template-columns:1.25fr .9fr .85fr}.chart-title{display:flex;justify-content:space-between;align-items:center;gap:16px}.chart-legend{font-size:12px;font-weight:700;color:#3a4474;display:flex;gap:8px;align-items:center}.chart-legend i{width:20px;height:3px;border-radius:10px;display:inline-block}.chart-legend .blue{background:var(--blue)}.chart-legend .green{background:var(--green)}.chart-legend .purple{background:var(--purple)}.chart-reference{height:260px}.last-send-title{display:flex;align-items:center;justify-content:space-between}.last-send-title em{font-style:normal;font-size:12px;background:#dcfbea;color:var(--green);padding:7px 16px;border-radius:999px}.last-send-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}.last-send-grid .info-item{display:flex;align-items:center;gap:12px;border-top:1px solid var(--line);padding:16px 0}.last-send-grid .info-item:nth-child(n+3){border-top:1px solid var(--line)}.last-send-grid .info-item:nth-child(5){grid-column:1/-1}.date-pill{display:flex;align-items:center;gap:8px;white-space:nowrap}.account-box{min-height:230px}.legend-row b{text-align:right}.donut-center{line-height:1.1}.donut-center span{margin-top:4px}.bar-row{grid-template-columns:minmax(110px,150px) 1fr 42px}.conv-row span{color:var(--muted)}
@media(max-width:1400px){.dashboard-kpis{grid-template-columns:repeat(5,minmax(0,1fr))}.dashboard-main{grid-template-columns:1fr 1.45fr}.dashboard-bottom{grid-template-columns:1.25fr .9fr .85fr}}@media(max-width:1150px){.dashboard-kpis{grid-template-columns:repeat(2,1fr)}.dashboard-main,.dashboard-bottom{grid-template-columns:1fr}.last-send-grid{grid-template-columns:1fr 1fr}}@media(max-width:900px){.kpi-grid{grid-template-columns:1fr}.last-send-grid{grid-template-columns:1fr}.content{padding:24px 16px}.page-head{display:block}.date-pill{margin-top:16px;width:max-content}}


/* Final dashboard alignment fixes */
.content{padding:28px 26px 34px;}
.dashboard-kpis{grid-template-columns:repeat(5,minmax(0,1fr));gap:18px;}
.dashboard-kpis .kpi{padding:22px 18px;min-height:150px;display:grid;grid-template-columns:64px 1fr;gap:16px;align-items:center;}
.dashboard-kpis .kpi>div:last-child{align-items:flex-start;justify-content:center;min-height:auto;width:100%;}
.dashboard-kpis .kpi-title{min-height:32px;margin:0 0 8px;font-size:13px;line-height:1.15;color:#253060;}
.dashboard-kpis .kpi-value{font-size:34px;line-height:.95;margin:0 0 8px;letter-spacing:-.04em;}
.dashboard-kpis .kpi-note{font-size:13px;line-height:1.18;margin:0;}
.dashboard-kpis .kpi-icon{width:58px;height:58px;}
.dashboard-main{grid-template-columns:minmax(430px,1fr) minmax(620px,1.45fr);gap:20px;align-items:stretch;}
.dashboard-bottom{grid-template-columns:minmax(420px,1.25fr) minmax(320px,.9fr) minmax(270px,.8fr);gap:20px;align-items:stretch;}
.panel{padding:24px 28px;}
.account-box{display:grid;grid-template-columns:210px 1fr;align-items:center;gap:34px;min-height:240px;}
.donut{width:190px;height:190px;}
.donut:after{inset:28px;}
.donut-center{display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:34px;}
.donut-center span{font-size:12px;line-height:1.1;margin-top:10px;max-width:96px;}
.legend{width:100%;min-width:0;}
.legend-row{display:grid;grid-template-columns:1fr 58px;gap:18px;align-items:center;font-size:16px;min-height:54px;}
.legend-row span{display:flex;align-items:center;min-width:0;line-height:1.2;}
.legend-row b{justify-self:end;text-align:right;white-space:nowrap;font-size:16px;}
.chart-reference{height:260px;}
.last-send-grid{grid-template-columns:repeat(3,1fr);column-gap:22px;row-gap:8px;}
.last-send-grid .info-item{padding:16px 0;}
.last-send-grid .info-item:nth-child(1),.last-send-grid .info-item:nth-child(2){grid-column:auto;}
.last-send-grid .info-item:nth-child(5){grid-column:auto;}
.info-item{padding-left:0;padding-right:0;}
.info-value{font-size:16px;line-height:1.2;}
.bar-row{grid-template-columns:minmax(105px,145px) 1fr 40px;gap:12px;}
.conv-row{gap:18px;}
.conv-row strong{white-space:nowrap;}
@media(max-width:1500px){
  .content{padding-left:22px;padding-right:22px;}
  .dashboard-kpis .kpi{padding:20px 14px;grid-template-columns:58px 1fr;gap:12px;}
  .dashboard-kpis .kpi-value{font-size:31px;}
  .dashboard-kpis .kpi-title,.dashboard-kpis .kpi-note{font-size:12px;}
  .dashboard-main{grid-template-columns:minmax(410px,1fr) minmax(560px,1.4fr);}
  .account-box{grid-template-columns:190px 1fr;gap:26px;}
  .donut{width:175px;height:175px;}
  .legend-row{font-size:15px;grid-template-columns:1fr 48px;gap:12px;}
}
@media(max-width:1250px){
  .dashboard-kpis{grid-template-columns:repeat(2,1fr);}
  .dashboard-main,.dashboard-bottom{grid-template-columns:1fr;}
  .last-send-grid{grid-template-columns:repeat(2,1fr);}
}


/* V3 dashboard alignment fixes */
.content{max-width:none}.dashboard-kpis{grid-template-columns:repeat(5,minmax(180px,1fr));gap:20px}.dashboard-kpis .kpi{display:grid!important;grid-template-columns:64px 1fr;gap:18px;align-items:center!important;justify-content:initial!important;min-height:148px;padding:24px 24px}.dashboard-kpis .kpi>div:last-child{display:flex!important;flex-direction:column;justify-content:center!important;align-items:flex-start!important;min-height:86px;text-align:left}.kpi-title,.kpi-value,.kpi-note{width:100%}.kpi-title{min-height:32px;display:flex;align-items:flex-end}.kpi-value{font-size:32px;line-height:.95}.kpi-note{margin-top:9px;min-height:32px;display:flex;align-items:flex-start}
.account-box{display:grid;grid-template-columns:210px 1fr;align-items:center;gap:34px;min-height:250px}.donut{width:190px;height:190px}.donut-center{font-size:34px}.donut-center span{font-size:12px}.legend-row{display:grid;grid-template-columns:1fr auto;column-gap:22px;align-items:center;font-size:16px}.legend-row span{display:flex;align-items:center;min-width:0}.legend-row b{white-space:nowrap;text-align:right}.legend-row:nth-child(2) span{white-space:nowrap}.legend-row:nth-child(3){margin-top:12px;padding-top:18px}.legend-row:nth-child(3) span{font-size:14px;color:var(--muted);white-space:normal}.legend-row:nth-child(3) b{font-size:15px}
.chart-wrap{height:260px;padding:4px 6px 0}.line-chart{width:100%;height:100%;display:block}.grid-lines line{stroke:#e7ebf4;stroke-width:1}.axis-labels text{fill:#6c769c;font-size:12px;font-weight:700}.series{fill:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}.series.sent{stroke:var(--blue)}.series.replies{stroke:var(--green)}.series.leads{stroke:var(--purple)}.dots.sent circle{fill:var(--blue)}.dots.replies circle{fill:var(--green)}.dots.leads circle{fill:var(--purple)}.chart-placeholder{display:none}.panel{padding:26px}.grid-main{grid-template-columns:1fr 1.55fr}.grid-bottom{grid-template-columns:1.25fr .9fr .85fr}.bar-row{display:grid;grid-template-columns:minmax(120px,160px) 1fr 42px;gap:14px;align-items:center}.last-send-grid{grid-template-columns:repeat(3,1fr)}.last-send-grid .info-item:nth-child(5){grid-column:auto}
@media(max-width:1500px){.dashboard-kpis{grid-template-columns:repeat(5,minmax(150px,1fr));gap:16px}.dashboard-kpis .kpi{grid-template-columns:58px 1fr;padding:20px 18px}.kpi-title{font-size:12px}.kpi-value{font-size:29px}.kpi-note{font-size:12px}.account-box{grid-template-columns:190px 1fr}.donut{width:170px;height:170px}.legend-row{font-size:15px}}
@media(max-width:1250px){.dashboard-kpis{grid-template-columns:repeat(2,1fr)}.grid-main,.grid-bottom{grid-template-columns:1fr}.last-send-grid{grid-template-columns:repeat(2,1fr)}}

/* V4 safe — Telegram-like Liquid Glass without breaking layout */
:root{
  --glass-bg:rgba(255,255,255,.54);
  --glass-border:rgba(255,255,255,.78);
  --glass-shadow:0 22px 70px rgba(33,52,115,.12), inset 0 1px 0 rgba(255,255,255,.95), inset 0 -1px 0 rgba(255,255,255,.28);
  --glass-line:rgba(120,145,210,.22);
}
body{
  background:
    radial-gradient(circle at 22% 16%, rgba(104,126,255,.26), transparent 28%),
    radial-gradient(circle at 62% 8%, rgba(135,255,220,.23), transparent 27%),
    radial-gradient(circle at 87% 82%, rgba(255,205,118,.18), transparent 29%),
    linear-gradient(135deg,#fbfdff 0%,#edf4ff 43%,#f8f5ff 100%)!important;
  background-attachment:fixed!important;
  overflow-x:hidden;
}
body:before{content:"";position:fixed;inset:0;pointer-events:none;z-index:-1;background:linear-gradient(110deg,rgba(255,255,255,.7),rgba(255,255,255,0) 48%,rgba(255,255,255,.38));}
.sidebar,.card,.date-pill,.side-card,.flash,input,select,textarea{
  background:var(--glass-bg)!important;
  border:1px solid var(--glass-border)!important;
  box-shadow:var(--glass-shadow)!important;
  backdrop-filter:blur(24px) saturate(170%)!important;
  -webkit-backdrop-filter:blur(24px) saturate(170%)!important;
}
.sidebar{background:rgba(255,255,255,.58)!important;border-right:1px solid rgba(255,255,255,.7)!important;box-shadow:18px 0 70px rgba(25,54,115,.08), inset -1px 0 0 rgba(255,255,255,.78)!important;}
.card,.date-pill,.side-card,.nav a{position:relative;overflow:hidden;}
.card:before,.date-pill:before,.side-card:before,.nav a:hover:before{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:linear-gradient(135deg,rgba(255,255,255,.86),rgba(255,255,255,.18) 42%,rgba(255,255,255,.45) 72%,rgba(255,255,255,.12));opacity:.66;mix-blend-mode:screen;}
.card:after,.date-pill:after,.side-card:after{content:"";position:absolute;left:-22%;top:-55%;width:72%;height:130%;pointer-events:none;transform:rotate(17deg);background:linear-gradient(90deg,transparent,rgba(255,255,255,.44),transparent);opacity:.18;}
.card>* ,.date-pill>* ,.side-card>* ,.nav a>*{position:relative;z-index:1;}
.logo-icon,.kpi-icon,.usercircle,.info-item .text-icon,.small-icon{background:rgba(255,255,255,.42)!important;border:1px solid rgba(255,255,255,.76)!important;box-shadow:0 18px 42px rgba(67,87,255,.15), inset 0 1px 0 rgba(255,255,255,.9), inset 0 -1px 0 rgba(105,133,255,.12)!important;backdrop-filter:blur(18px) saturate(180%);-webkit-backdrop-filter:blur(18px) saturate(180%);}
.nav a{transition:transform .2s ease,box-shadow .2s ease,background .2s ease;border:1px solid transparent;}
.nav a:hover{background:rgba(255,255,255,.42)!important;border-color:rgba(255,255,255,.72)!important;box-shadow:0 18px 44px rgba(68,87,255,.12), inset 0 1px 0 rgba(255,255,255,.92)!important;transform:translateX(3px);}
.kpi-title,.subtitle,.info-label,.conv-row span,.small{color:rgba(7,18,70,.62)!important;}.kpi-value,.info-value,.panel-title,h1,.logo-title{color:#071246!important;text-shadow:0 1px 0 rgba(255,255,255,.55);}
.grid-lines line{stroke:rgba(116,135,185,.16)!important}.axis-labels text{fill:rgba(7,18,70,.52)!important}.legend-row,.conv-row,.last-send-grid .info-item{border-color:var(--glass-line)!important}.bar{background:rgba(103,119,180,.12)!important}.bar span{background:linear-gradient(90deg,#7d59ff,#3d63ff)!important;box-shadow:0 8px 18px rgba(86,93,255,.20)}
.line-chart .series{stroke-width:3.2;filter:drop-shadow(0 4px 8px rgba(68,87,255,.14));stroke-dasharray:900;stroke-dashoffset:900;animation:drawLine 1.25s cubic-bezier(.22,.9,.25,1) forwards}.line-chart .series.replies{animation-delay:.12s}.line-chart .series.leads{animation-delay:.24s}.dots circle{opacity:0;animation:popDot .4s ease forwards;animation-delay:.95s;filter:drop-shadow(0 3px 7px rgba(68,87,255,.20))}@keyframes drawLine{to{stroke-dashoffset:0}}@keyframes popDot{from{opacity:0;transform:scale(.4)}to{opacity:1;transform:scale(1)}}
.chart-wrap{position:relative;overflow:visible!important}.hover-zone{fill:transparent;cursor:pointer;pointer-events:all}.hover-line{stroke:rgba(78,101,180,.34);stroke-width:1.4;stroke-dasharray:3 4;opacity:0;transition:opacity .18s ease}.hover-line.show{opacity:1}.chart-tooltip{position:absolute;top:96px;z-index:20;min-width:176px;padding:14px 16px;border-radius:16px;background:rgba(255,255,255,.68);border:1px solid rgba(255,255,255,.86);box-shadow:0 22px 70px rgba(31,51,112,.20), inset 0 1px 0 rgba(255,255,255,.95);backdrop-filter:blur(24px) saturate(180%);-webkit-backdrop-filter:blur(24px) saturate(180%);opacity:0;transform:translateY(10px) scale(.98);pointer-events:none;transition:opacity .18s ease,transform .18s ease;color:#071246;font-size:13px}.chart-tooltip.show{opacity:1;transform:translateY(0) scale(1)}.chart-tooltip b{display:block;margin-bottom:10px;font-size:13px}.chart-tooltip div{display:grid;grid-template-columns:14px 1fr auto;gap:7px;align-items:center;margin:7px 0;color:#43507d}.chart-tooltip strong{color:#071246}.tt-dot{width:9px;height:9px;border-radius:50%;display:inline-block}.tt-dot.blue{background:var(--blue)}.tt-dot.green{background:var(--green)}.tt-dot.purple{background:var(--purple)}
.lead-head{align-items:start}.message{background-clip:padding-box}.message.user{background:rgba(239,244,255,.72)!important}.message.assistant{background:rgba(241,255,248,.72)!important}


/* Sidebar last-send card fix + accounts check button */
.sidebar{width:300px!important;padding-left:22px!important;padding-right:22px!important;}
.content{margin-left:300px!important;width:calc(100% - 300px)!important;}
.side-card{left:22px!important;right:22px!important;bottom:30px!important;width:auto!important;max-width:calc(100% - 44px)!important;overflow:hidden!important;padding:16px 18px!important;line-height:1.25!important;}
.side-card b,.side-card .small{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.accounts-head{align-items:center;}
.check-accounts-btn{display:inline-flex;align-items:center;gap:8px;min-height:48px;padding:14px 20px;border-radius:16px;white-space:nowrap;box-shadow:0 18px 44px rgba(68,87,255,.18), inset 0 1px 0 rgba(255,255,255,.5)!important;}
.check-accounts-btn .text-icon{margin-right:0;filter:none;}
.check-log-panel{margin-bottom:18px;padding:18px 22px;}
.check-log-panel .panel-title{margin-bottom:10px;}
.check-log{margin:0;max-height:260px;overflow:auto;white-space:pre-wrap;font:13px/1.45 ui-monospace,SFMono-Regular,Consolas,monospace;color:#26325f;background:rgba(255,255,255,.34);border:1px solid rgba(255,255,255,.62);border-radius:14px;padding:14px;}
.accounts-table-panel{overflow:auto;}
.accounts-table td:last-child{max-width:520px;word-break:break-word;}
@media(max-width:1200px){.sidebar{width:100%!important}.content{margin-left:0!important;width:100%!important}.side-card{max-width:none!important}}

/* Final sidebar compact card fix */
.sidebar{width:300px!important;padding:24px 20px!important;overflow:hidden!important;}
.content{margin-left:300px!important;width:calc(100% - 300px)!important;}
.nav{padding-bottom:128px!important;}
.side-card{
  position:absolute!important;
  left:30px!important;
  right:30px!important;
  bottom:24px!important;
  width:auto!important;
  max-width:none!important;
  min-height:auto!important;
  padding:14px 16px!important;
  border-radius:16px!important;
  line-height:1.22!important;
  background:rgba(255,255,255,.58)!important;
  box-shadow:0 18px 44px rgba(31,51,112,.10),inset 0 1px 0 rgba(255,255,255,.9)!important;
  backdrop-filter:blur(22px) saturate(180%)!important;
  -webkit-backdrop-filter:blur(22px) saturate(180%)!important;
  z-index:1!important;
}
.side-card b{font-size:13px!important;line-height:1.2!important;}
.side-card .small{font-size:11px!important;line-height:1.25!important;white-space:normal!important;word-break:break-word!important;color:#647098!important;}

/* Contacts page filters and state stats */
.contacts-filter{align-items:center;margin-bottom:18px;gap:12px;}
.contacts-filter input{min-width:260px;}
.contacts-filter select{min-width:260px;}
.contacts-grid{grid-template-columns:1.35fr 1fr .9fr!important;align-items:start;}
.contacts-list-card,.contacts-state-card{min-height:360px;}
.compact-table td:last-child{text-align:right;white-space:nowrap;}
.sources-table td:first-child{max-width:260px;word-break:break-word;}
.contacts-state-card .panel-title{margin-bottom:16px;}
.state-list{display:grid;gap:0;border-top:1px solid var(--glass-line, var(--line));}
.state-row{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:18px 0;border-bottom:1px solid var(--glass-line, var(--line));}
.state-row span{color:#58638d;font-size:15px;line-height:1.25;}
.state-row strong{font-size:30px;line-height:1;font-weight:900;letter-spacing:-.04em;color:#071246;white-space:nowrap;}
.contacts-updated{margin-top:22px;padding:14px 16px;border-radius:16px;background:rgba(255,255,255,.45);border:1px solid rgba(255,255,255,.68);color:#5f6b95;font-size:13px;font-weight:700;}
.contacts-table-panel{overflow:auto;}
.contacts-table-panel .table{min-width:900px;}
@media(max-width:1200px){.sidebar{width:100%!important}.content{margin-left:0!important;width:100%!important}.nav{padding-bottom:0!important}.side-card{position:static!important;margin:18px 10px 0!important}.contacts-grid{grid-template-columns:1fr!important}.contacts-filter input,.contacts-filter select{min-width:220px}}

.real-chart-wrap { height: 300px; position: relative; }
#projectDynamicsChart { width: 100% !important; height: 100% !important; }
.sidebar .mini-card, .mini-card {
  max-width: 215px;
  width: calc(100% - 28px);
  overflow: hidden;
  box-sizing: border-box;
}
.sidebar .mini-card * { overflow-wrap: anywhere; }

.dashboard-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.interactive-donut {
  position: relative;
  background:
    conic-gradient(#18c98b 0 calc(var(--alive) * 1%), #ff4f68 0 100%) !important;
  transition: transform .25s ease, filter .25s ease;
  cursor: pointer;
}

.interactive-donut:hover {
  transform: scale(1.035);
  filter: drop-shadow(0 18px 34px rgba(80, 100, 255, .18));
}

.interactive-donut .donut-hover {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -42%) scale(.96);
  min-width: 220px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, .95);
  box-shadow: 0 20px 48px rgba(30, 40, 100, .18);
  color: #06104a;
  font-size: 14px;
  line-height: 1.55;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  z-index: 10;
}

.interactive-donut:hover .donut-hover {
  opacity: 1;
  transform: translate(-50%, -54%) scale(1);
}

.interactive-donut .donut-hover strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.interactive-donut .donut-hover .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #18c98b;
  margin-right: 7px;
}

.interactive-donut .donut-hover .dot.red {
  background: #ff4f68;
}

/* Final dashboard layout fixes */
.dashboard-kpis {
  grid-template-columns: repeat(4, minmax(220px, 1fr)) !important;
  gap: 24px !important;
}

.dashboard-main {
  grid-template-columns: minmax(430px, .8fr) minmax(620px, 1.2fr) !important;
  align-items: stretch !important;
}

.account-box {
  display: grid !important;
  grid-template-columns: 220px minmax(260px, 1fr) !important;
  gap: 42px !important;
  align-items: center !important;
}

.account-box .legend {
  min-width: 260px !important;
}

.account-box .legend-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 18px !important;
  align-items: center !important;
  padding: 16px 0 !important;
}

.account-box .legend-row span {
  line-height: 1.25 !important;
  white-space: normal !important;
}

.account-box .legend-row b {
  white-space: nowrap !important;
  text-align: right !important;
}

.interactive-donut {
  width: 220px !important;
  height: 220px !important;
  flex: 0 0 220px !important;
}

.real-chart-wrap {
  height: 300px !important;
  min-height: 300px !important;
  position: relative !important;
  overflow: visible !important;
}

.real-svg-chart {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}

.chart-grid {
  stroke: rgba(6,16,74,.09);
  stroke-width: 1;
}

.chart-axis-label {
  fill: #5a6795;
  font-size: 12px;
  font-weight: 700;
}

.chart-line {
  fill: none;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: drawLine .9s ease forwards;
}

.chart-line.sent, .chart-dot.sent { stroke: #3f5cff; fill: #3f5cff; }
.chart-line.replies, .chart-dot.replies { stroke: #18c98b; fill: #18c98b; }
.chart-line.leads, .chart-dot.leads { stroke: #7b52ff; fill: #7b52ff; }

.chart-dot {
  stroke-width: 0;
  opacity: 0;
  animation: fadeDot .45s ease forwards .55s;
}

.chart-hover-line {
  stroke: rgba(75, 91, 255, .35);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  transition: opacity .15s ease;
}

.chart-hover-zone {
  fill: transparent;
  cursor: crosshair;
}

.real-chart-tooltip {
  position: absolute;
  width: 170px;
  padding: 13px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.84);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid rgba(255,255,255,.95);
  box-shadow: 0 18px 44px rgba(30,40,100,.18);
  color: #06104a;
  font-size: 13px;
  line-height: 1.55;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
  z-index: 10;
}

.real-chart-tooltip strong {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
}

.real-chart-tooltip div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.real-chart-tooltip span {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  display: inline-block;
  margin-right: 6px;
}

.real-chart-tooltip .blue { background: #3f5cff; }
.real-chart-tooltip .green { background: #18c98b; }
.real-chart-tooltip .purple { background: #7b52ff; }

.dashboard-bottom {
  grid-template-columns: minmax(430px, 1fr) minmax(320px, .8fr) minmax(300px, .7fr) !important;
  gap: 24px !important;
  align-items: stretch !important;
}

.last-send-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 18px 22px !important;
}

.last-send-grid .info-item {
  min-width: 0 !important;
  align-items: center !important;
}

@keyframes drawLine { to { stroke-dashoffset: 0; } }
@keyframes fadeDot { to { opacity: 1; } }

@media (max-width: 1300px) {
  .dashboard-main, .dashboard-bottom {
    grid-template-columns: 1fr !important;
  }
}


/* =========================
   MOBILE VERSION / ADAPTIVE
   ========================= */

@media (max-width: 900px) {
  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    font-size: 15px;
  }

  .app,
  .layout,
  .shell,
  .page,
  .main {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .sidebar {
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    z-index: 80 !important;
    padding: 12px 14px !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(255,255,255,.75) !important;
    background: rgba(255,255,255,.72) !important;
    backdrop-filter: blur(28px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
  }

  .brand,
  .logo-wrap,
  .sidebar-brand {
    margin: 0 0 10px 0 !important;
  }

  .brand h2,
  .sidebar h2,
  .logo-text h2 {
    font-size: 18px !important;
    line-height: 1.1 !important;
  }

  .brand p,
  .logo-text p {
    font-size: 11px !important;
  }

  .nav,
  .menu,
  .sidebar nav {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    overflow-x: auto !important;
    padding: 6px 0 2px 0 !important;
    scrollbar-width: none !important;
  }

  .nav::-webkit-scrollbar,
  .menu::-webkit-scrollbar,
  .sidebar nav::-webkit-scrollbar {
    display: none !important;
  }

  .nav a,
  .menu a,
  .sidebar nav a {
    flex: 0 0 auto !important;
    min-width: max-content !important;
    padding: 10px 12px !important;
    border-radius: 18px !important;
    font-size: 14px !important;
    white-space: nowrap !important;
  }

  .nav a .gicon,
  .menu a .gicon,
  .sidebar nav a .gicon {
    width: 24px !important;
    height: 24px !important;
    margin-right: 7px !important;
  }

  .sidebar .mini-card,
  .mini-card,
  .sidebar-footer,
  .copyright {
    display: none !important;
  }

  .content,
  .main,
  main {
    margin-left: 0 !important;
    padding: 18px 14px 88px 14px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .page-head {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
  }

  .page-head h1 {
    font-size: 30px !important;
    line-height: 1.05 !important;
  }

  .subtitle {
    font-size: 14px !important;
  }

  .date-pill {
    align-self: flex-start !important;
    padding: 12px 14px !important;
    font-size: 15px !important;
  }

  .dashboard-kpis,
  .kpi-grid,
  .grid-main,
  .dashboard-main,
  .grid-bottom,
  .dashboard-bottom,
  .contacts-grid,
  .lead-grid,
  .dialog-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    width: 100% !important;
  }

  .card,
  .panel,
  .kpi {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 24px !important;
    padding: 20px !important;
    box-sizing: border-box !important;
  }

  .kpi {
    display: grid !important;
    grid-template-columns: 54px 1fr !important;
    align-items: center !important;
    min-height: 112px !important;
  }

  .kpi-icon {
    width: 54px !important;
    height: 54px !important;
  }

  .kpi-title {
    font-size: 14px !important;
  }

  .kpi-value {
    font-size: 34px !important;
    line-height: 1 !important;
  }

  .kpi-note {
    font-size: 14px !important;
  }

  .account-box {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 18px !important;
    justify-items: center !important;
  }

  .interactive-donut,
  .donut {
    width: 210px !important;
    height: 210px !important;
  }

  .account-box .legend {
    width: 100% !important;
    min-width: 0 !important;
  }

  .account-box .legend-row {
    grid-template-columns: 1fr auto !important;
    gap: 12px !important;
    padding: 14px 0 !important;
  }

  .account-box .legend-row span,
  .account-box .legend-row b {
    font-size: 15px !important;
  }

  .real-chart-wrap,
  .chart-wrap {
    height: 260px !important;
    min-height: 260px !important;
    width: 100% !important;
  }

  .panel-title,
  .chart-title,
  .last-send-title {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    font-size: 18px !important;
  }

  .chart-legend {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    font-size: 12px !important;
  }

  .last-send-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .info-item {
    padding: 12px 0 !important;
    border-bottom: 1px solid rgba(6,16,74,.08) !important;
  }

  .bar-row {
    grid-template-columns: minmax(0, 1fr) 44px !important;
    gap: 10px !important;
  }

  .bar-row span {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .filters,
  .filter-row,
  form.contacts-filter,
  .form {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
  }

  input,
  select,
  textarea,
  button,
  .btn {
    width: 100% !important;
    min-height: 46px !important;
    font-size: 16px !important;
    border-radius: 16px !important;
    box-sizing: border-box !important;
  }

  table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .table,
  .table-wrap {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  th,
  td {
    padding: 12px 10px !important;
    font-size: 14px !important;
  }

  .lead-detail-grid,
  .lead-layout {
    grid-template-columns: 1fr !important;
  }

  .dialog-message,
  .message,
  .bubble {
    max-width: 100% !important;
    font-size: 15px !important;
  }
}

@media (max-width: 520px) {
  .page-head h1 {
    font-size: 26px !important;
  }

  .brand h2,
  .sidebar h2,
  .logo-text h2 {
    font-size: 16px !important;
  }

  .nav a,
  .menu a,
  .sidebar nav a {
    padding: 9px 10px !important;
    font-size: 13px !important;
  }

  .kpi-value {
    font-size: 30px !important;
  }

  .card,
  .panel,
  .kpi {
    padding: 16px !important;
    border-radius: 22px !important;
  }

  .interactive-donut,
  .donut {
    width: 190px !important;
    height: 190px !important;
  }

  .donut-center {
    font-size: 30px !important;
  }

  .real-chart-wrap,
  .chart-wrap {
    height: 230px !important;
  }

  .real-chart-tooltip {
    width: 150px !important;
    font-size: 12px !important;
  }
}

/* Chart emergency fix v2 */
.real-chart-wrap { height: 300px !important; min-height: 300px !important; position: relative !important; overflow: visible !important; }
.real-svg-chart { width: 100% !important; height: 100% !important; display: block !important; overflow: visible !important; }
.chart-grid { stroke: rgba(6,16,74,.10) !important; stroke-width: 1 !important; vector-effect: non-scaling-stroke; }
.chart-axis-label { fill: #5a6795 !important; font-size: 12px !important; font-weight: 700 !important; }
.chart-line { fill: none !important; stroke-width: 3.4 !important; stroke-linecap: round !important; stroke-linejoin: round !important; vector-effect: non-scaling-stroke; opacity: 1 !important; }
.chart-line.sent { stroke: #3f5cff !important; }
.chart-line.replies { stroke: #18c98b !important; }
.chart-line.leads { stroke: #7b52ff !important; }
.chart-dot { stroke-width: 0 !important; opacity: 1 !important; }
.chart-dot.sent { fill: #3f5cff !important; }
.chart-dot.replies { fill: #18c98b !important; }
.chart-dot.leads { fill: #7b52ff !important; }
.chart-hover-line { stroke: rgba(75,91,255,.42) !important; stroke-width: 1.5 !important; stroke-dasharray: 4 4 !important; vector-effect: non-scaling-stroke; transition: opacity .15s ease; }
.chart-hover-zone { fill: rgba(255,255,255,0) !important; cursor: crosshair; }
.real-chart-tooltip { position: absolute !important; width: 170px !important; padding: 13px 14px !important; border-radius: 16px !important; background: rgba(255,255,255,.88) !important; backdrop-filter: blur(22px) saturate(170%) !important; -webkit-backdrop-filter: blur(22px) saturate(170%) !important; border: 1px solid rgba(255,255,255,.95) !important; box-shadow: 0 18px 44px rgba(30,40,100,.18) !important; color: #06104a !important; font-size: 13px !important; line-height: 1.55 !important; opacity: 0; pointer-events: none !important; transition: opacity .15s ease; z-index: 20 !important; }
.real-chart-tooltip strong { display: block; margin-bottom: 7px; font-size: 14px; }
.real-chart-tooltip div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.real-chart-tooltip span { width: 8px; height: 8px; border-radius: 99px; display: inline-block; margin-right: 6px; }
.real-chart-tooltip .blue { background: #3f5cff; }
.real-chart-tooltip .green { background: #18c98b; }
.real-chart-tooltip .purple { background: #7b52ff; }

/* Account block text alignment fix */
.account-box { display: grid !important; grid-template-columns: 230px minmax(300px, 1fr) !important; gap: 44px !important; align-items: center !important; }
.account-box .legend { width: 100% !important; min-width: 300px !important; overflow: hidden !important; }
.account-box .legend-row { display: grid !important; grid-template-columns: minmax(0, 1fr) auto !important; align-items: center !important; gap: 16px !important; }
.account-box .legend-row span { min-width: 0 !important; overflow: hidden !important; text-overflow: ellipsis !important; }
.account-box .legend-row b { white-space: nowrap !important; text-align: right !important; }
@media (max-width: 900px) {
  .account-box { grid-template-columns: 1fr !important; }
  .account-box .legend { min-width: 0 !important; }
  .real-chart-wrap { height: 250px !important; }
}


.first-message-box{background:#fff8e8;border:1px solid #ffe1a6;border-radius:14px;padding:12px 14px;margin:12px 0;white-space:pre-wrap;line-height:1.45}
.dialogs-full{display:grid;grid-template-columns:1fr;gap:18px}
.dialog-full-card{overflow:hidden}
.dialog-full-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;flex-wrap:wrap}
.dialog-message-list{margin-top:12px}
.message.system{background:#f7f7fb;margin-right:auto}


/* Account management */
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(260px,1fr));gap:16px;margin-top:16px}
.form-grid label{display:flex;flex-direction:column;gap:8px;font-weight:800;color:var(--text)}
.form-grid .full{grid-column:1/-1}
.form-grid .hint{font-size:12px;color:var(--muted);font-weight:600}
.account-management-card{padding:24px;margin-bottom:20px}
.profile-table-card{padding:22px;margin-bottom:20px;overflow:auto}
.profile-table-card table{min-width:980px}
@media(max-width:900px){.form-grid{grid-template-columns:1fr}}


/* AI Agents page */
.agents-grid{grid-template-columns:1fr 1fr;gap:22px;margin-bottom:22px;align-items:start}.agents-kpis{grid-template-columns:repeat(4,minmax(160px,1fr));margin-bottom:22px}.form-grid{display:grid;gap:10px}.form-grid label{font-weight:800;color:#071246;margin-top:4px}.form-grid input,.form-grid select,.form-grid textarea{width:100%;padding:13px 14px;border-radius:14px;border:1px solid var(--line);font:inherit;color:#071246;outline:none}.form-grid textarea{resize:vertical}.btn{display:inline-flex;align-items:center;justify-content:center;min-height:46px;padding:12px 18px;border:0;border-radius:15px;background:linear-gradient(135deg,var(--blue),var(--purple));color:#fff;font-weight:800;cursor:pointer;box-shadow:0 18px 44px rgba(68,87,255,.18)}.info-list{display:grid;gap:12px;margin-bottom:18px}.hint-box{margin-top:16px;padding:14px 16px;border-radius:16px;background:rgba(239,244,255,.72);border:1px solid rgba(255,255,255,.72);color:#43507d;line-height:1.45}.hint-box code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;color:#071246}.test-result{margin-top:16px;border-radius:16px;padding:16px;border:1px solid rgba(255,255,255,.72);background:rgba(255,255,255,.45)}.test-result.ok{box-shadow:0 18px 44px rgba(22,199,132,.10)}.test-result.bad{box-shadow:0 18px 44px rgba(255,80,103,.12)}.test-result pre{white-space:pre-wrap;word-break:break-word;margin:10px 0 0;font:13px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;color:#26325f}.workflow-list{display:grid;gap:12px}.workflow-list div{padding:16px;border-radius:16px;background:rgba(255,255,255,.42);border:1px solid rgba(255,255,255,.65)}.workflow-list b{display:block;color:#071246;margin-bottom:5px}.workflow-list span{color:#63709a}@media(max-width:1100px){.agents-grid,.agents-kpis{grid-template-columns:1fr}}
