
/* Final Nexora logo treatment: transparent original mark, no tile, no blur */
.brand img{width:29px!important;height:29px!important;object-fit:contain!important;filter:none!important}
.hero img{width:67px!important;height:67px!important;object-fit:contain!important;filter:drop-shadow(0 0 14px rgba(50,255,70,.16))!important}
.botmark img{width:30px!important;height:30px!important;object-fit:contain!important;filter:none!important}

.workspace-title{display:flex;flex-direction:column;gap:2px}.eyebrow{font-size:9px;letter-spacing:.15em;color:#4f8e59;font-weight:800}.workspace-name{font-size:14px;font-weight:650}.top-actions{display:flex;align-items:center;gap:12px}.status{font-size:10px;color:#727b75;display:flex;align-items:center;gap:6px}.status i{width:6px;height:6px;border-radius:50%;background:#4dff68;box-shadow:0 0 9px #4dff68;display:inline-block}.nav.active{background:#171c18;color:#f0f2f0}.newchat .plus{font-size:18px;color:#63ff73}.item.selected{background:#171c18;color:#f2f4f2;box-shadow:inset 2px 0 #45f75b}
.welcome{justify-content:center;align-items:stretch;width:min(900px,calc(100% - 64px));padding-bottom:145px}.welcome-head{display:flex;align-items:center;gap:24px;margin-bottom:48px;padding-left:10px}.welcome-head .hero{flex:none;margin:0;width:76px;height:76px;border:1px solid #273028;border-radius:22px;background:linear-gradient(145deg,#151b16,#0e120f);box-shadow:inset 0 0 25px #4cff6810,0 15px 40px #0005}.welcome-head .hero img{width:52px;height:52px;filter:drop-shadow(0 0 12px #46ff5828)}.welcome-kicker{font-size:10px;letter-spacing:.14em;color:#4f8e59;font-weight:800;margin-bottom:8px}.welcome h1{text-align:left;font-size:clamp(38px,4vw,56px);margin:0;letter-spacing:-.055em}.welcome .sub{text-align:left;margin:9px 0 0;font-size:15px}.section-label{font-size:10px;letter-spacing:.12em;font-weight:800;color:#59635c;margin:0 0 11px 4px}.cards{width:100%;gap:10px}.card{position:relative;min-height:102px;border-radius:13px;padding:18px 42px 18px 17px;background:#101411;border:1px solid #202720}.card:hover{border-color:#364038;background:#151a16;transform:none}.cardicon{background:#192019;color:#b8c1ba;font-size:15px}.card strong{font-size:13px}.card span{max-width:250px}.card b{position:absolute;right:17px;top:50%;transform:translateY(-50%);font-size:18px;color:#4d5750;font-weight:400;transition:.15s}.card:hover b{color:#73ff82;right:14px}.hint{margin-top:15px;padding:12px 14px;border-left:2px solid #315e39;background:#0f1310;color:#626b64;font-size:11px}.hint span{font-weight:800;color:#4c8e56;letter-spacing:.1em;margin-right:8px}

/* Nexora dark scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: #303530 #0b0d0c;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: #0b0d0c;
}
*::-webkit-scrollbar-thumb {
  background: #303530;
  border: 2px solid #0b0d0c;
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover {
  background: #414841;
}

#controlViews{position:absolute;inset:58px 0 0;overflow:auto;padding:0 0 115px;display:none;background:radial-gradient(800px 550px at 57% 45%,#101510 0%,#0b0d0c 60%)}
.control-view{width:min(980px,calc(100% - 56px));margin:0 auto;padding:40px 0 60px;display:none}
.control-view.is-active{display:block}
.panel-head{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;margin-bottom:24px}
.panel-copy h2{font-size:32px;letter-spacing:-.04em;margin:0 0 8px}.panel-copy p{color:#7e8781;font-size:13px;line-height:1.6;max-width:650px;margin:0}
.panel-actions{display:flex;gap:8px;align-items:center}.panel-actions.end{justify-content:flex-end}.primary,.secondary{border-radius:10px;padding:11px 15px;font-weight:650;font-size:12px}.primary{background:#e9eee9;color:#111}.secondary{background:#1b211d;border:1px solid #303830;color:#dfe4df}
.calendar-layout,.email-layout{display:grid;grid-template-columns:1.3fr .7fr;gap:14px}.email-layout{grid-template-columns:.8fr 1.2fr}
.calendar-card,.event-card,.email-card,.files-card{border:1px solid #252d27;background:#111512;border-radius:16px;padding:18px}
.calendar-toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}.calendar-toolbar button{width:34px;height:34px;border-radius:9px;background:#1b211d;color:#fff;font-size:21px}.month-center{text-align:center;display:flex;flex-direction:column;gap:3px}.month-center span{font-size:9px;color:#59635c}.weekdays,.days{display:grid;grid-template-columns:repeat(7,1fr);gap:5px}.weekdays span{font-size:9px;text-align:center;color:#59635c;padding-bottom:7px}.day{min-height:54px;border:1px solid #1e251f;background:#0e120f;border-radius:8px;padding:7px;font-size:11px;color:#aeb6b0;text-align:left}.day:hover{border-color:#465348}.day.muted{opacity:.3}.day.today{border-color:#4dff68}.day.has-event{background:#152017}.day b{display:block;font-size:10px}.dot{width:5px;height:5px;border-radius:50%;background:#5dff70;display:inline-block;margin-top:8px}.event-item{padding:11px 0;border-bottom:1px solid #222922}.event-item:last-child{border-bottom:0}.event-item strong{font-size:12px}.event-item span{display:block;color:#727b74;font-size:10px;margin-top:4px}
.field{margin-bottom:13px}.field label{display:block;font-size:10px;color:#69736c;text-transform:uppercase;letter-spacing:.1em;margin-bottom:7px}.field input,.field textarea{width:100%;border:1px solid #293129;background:#0d110e;color:#eee;border-radius:10px;padding:12px;outline:none}.field input:focus,.field textarea:focus{border-color:#465248}
.agent-list{display:grid;grid-template-columns:1fr 1fr;gap:10px}.agent-control{border:1px solid #252d27;background:#111512;border-radius:14px;padding:17px;display:flex;gap:13px;align-items:flex-start;text-align:left;color:#eee}.agent-control:hover{border-color:#3a453c;background:#161b17}.agent-no{font-size:11px;color:#4f8e59;font-weight:800}.agent-control strong{font-size:13px}.agent-control p{font-size:11px;color:#737c75;line-height:1.5;margin:7px 0}.launch{font-size:11px;color:#7dff89;font-weight:700}
.agent-toggle{display:flex;gap:10px;align-items:flex-start;padding:11px;border:1px solid #222a24;border-radius:10px;background:#0e120f;margin-bottom:8px}.agent-toggle input{margin-top:2px;accent-color:#54ff69}.agent-toggle strong{font-size:12px}.agent-toggle span{display:block;color:#6f7871;font-size:10px;margin-top:3px;line-height:1.45}.auto-row{display:flex;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid #222922;font-size:11px}.auto-row input{accent-color:#54ff69}.file-btn{display:inline-flex;align-items:center;cursor:pointer}.file-row{display:flex;justify-content:space-between;padding:12px;border-bottom:1px solid #222922;font-size:12px}.file-row small{color:#68716b}.empty{color:#626b64;font-size:12px;padding:30px;text-align:center}
.modal{position:fixed;inset:0;z-index:60;background:rgba(0,0,0,.67);display:grid;place-items:center;padding:20px}.modal.hidden{display:none}.modal-box{width:min(520px,100%);border:1px solid #2b342d;background:#111512;border-radius:16px;padding:20px;box-shadow:0 30px 90px #000b}.modal-head{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:15px}.modal-head h3{margin:0;font-size:22px}
@media(max-width:820px){.calendar-layout,.email-layout,.agent-list{grid-template-columns:1fr}.control-view{width:calc(100% - 28px)}.panel-head{flex-direction:column}.panel-actions{width:100%}}

.gate-logo{width:82px;height:82px;object-fit:contain;display:block;margin:0 auto 10px}
#nexora-key-box:before{content:"";display:block}

/* Nexora: email agent selector */
.email-agent-grid{display:grid;gap:8px}
.email-agent-toggle{position:relative;display:flex;align-items:center;gap:11px;padding:12px 13px;border:1px solid #252d27;background:#0f140f;border-radius:12px;cursor:pointer;transition:.15s ease}
.email-agent-toggle:hover{border-color:#3b473d;background:#141a15}
.email-agent-toggle input{position:absolute;opacity:0;pointer-events:none}
.email-agent-check{width:20px;height:20px;border-radius:6px;border:1px solid #465048;background:#0b0f0c;display:grid;place-items:center;flex:none;transition:.15s}
.email-agent-check:after{content:'✓';font-size:12px;font-weight:900;opacity:0}
.email-agent-toggle.selected{border-color:#397e45;background:linear-gradient(145deg,#132018,#101611);box-shadow:inset 0 0 0 1px rgba(77,255,104,.12)}
.email-agent-toggle.selected .email-agent-check{background:#4dff68;border-color:#4dff68;color:#081008;box-shadow:0 0 12px rgba(77,255,104,.18)}
.email-agent-toggle.selected .email-agent-check:after{opacity:1}
.email-agent-copy{flex:1;min-width:0}
.email-agent-copy strong{display:block;font-size:12px;color:#e7ebe8}
.email-agent-copy span{display:block;color:#6f7871;font-size:10px;margin-top:4px;line-height:1.45}
.email-agent-state{font-size:9px;color:#69736c;letter-spacing:.08em;font-weight:800}
.email-agent-toggle.selected .email-agent-state{color:#67ff78}
.email-selected-note{margin-top:11px;color:#69736c;font-size:10px}

/* Nexora: sessions */
.session-sidebar-row{display:flex;align-items:center;gap:3px;margin:1px 0;border-radius:8px}
.session-sidebar-row.selected{background:#171c18}
.session-sidebar-row .item{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.session-mini{width:27px;height:27px;border-radius:7px;background:transparent;color:#68716b;flex:none;font-size:12px}
.session-mini:hover{background:#232a24;color:#fff}
.session-mini.danger:hover{background:#2a1c1c;color:#ff9898}
.session-empty{font-size:10px;color:#5e665f;padding:9px 10px}
.sessions-toolbar{margin-bottom:12px}
.sessions-toolbar input{width:min(520px,100%);border:1px solid #293129;background:#0d110e;color:#eee;border-radius:10px;padding:11px 12px;outline:0}
.sessions-toolbar input:focus{border-color:#465248}
.session-page-list{display:grid;gap:8px}
.session-page-item{border:1px solid #252d27;background:#111512;border-radius:13px;padding:14px;display:flex;align-items:center;gap:9px;transition:.15s}
.session-page-item:hover,.session-page-item.active{border-color:#3a453c;background:#161b17}
.session-main{flex:1;min-width:0;cursor:pointer}
.session-title{font-size:13px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.session-meta{font-size:10px;color:#68716b;margin-top:4px}
.session-action{border:1px solid #2c352e;border-radius:8px;background:#1a211c;color:#9aa49d;padding:7px 9px;font-size:10px}
.session-action:hover{background:#252d26;color:#fff}
.session-action.delete:hover{background:#2b1b1b;border-color:#4b2828;color:#ff9898}
@media(max-width:820px){.session-page-item{flex-wrap:wrap}.email-agent-state{display:none}}

/* Nexora mini mail inbox */
.mail-shell{display:grid;grid-template-columns:340px minmax(0,1fr);gap:12px;min-height:610px}
.mail-list-panel,.mail-thread-panel{border:1px solid #252d27;background:#111512;border-radius:16px;overflow:hidden}
.mail-list-panel{display:flex;flex-direction:column}
.mail-list-top{display:flex;align-items:center;justify-content:space-between;padding:16px 16px 12px;border-bottom:1px solid #202720}
.mail-list-top strong{display:block;font-size:13px}.mail-list-top span{display:block;font-size:10px;color:#68716b;margin-top:3px}
.mail-icon-btn{width:32px;height:32px;border-radius:9px;background:#192019;color:#9ba59d;font-size:16px}.mail-icon-btn:hover{background:#222b24;color:#fff}
.mail-search-wrap{display:flex;align-items:center;gap:8px;margin:12px;border:1px solid #283029;background:#0d110e;border-radius:10px;padding:0 10px;color:#626b64}
.mail-search-wrap input{width:100%;height:38px;border:0;outline:0;background:transparent;color:#eee;font-size:12px}
.mail-inbox-list{overflow:auto;max-height:520px;padding:0 8px 10px}
.mail-item{width:100%;display:flex;gap:10px;padding:12px 10px;border-radius:11px;background:transparent;text-align:left;color:#dfe4e0;border:1px solid transparent;margin-bottom:4px}
.mail-item:hover{background:#171c18}.mail-item.active{background:#172019;border-color:#334038}
.mail-avatar{width:34px;height:34px;border-radius:10px;background:#1f2721;display:grid;place-items:center;flex:none;font-size:11px;font-weight:800;color:#aeb8b0}
.mail-item.unread .mail-avatar{background:#203225;color:#75ff84}
.mail-item-body{min-width:0;flex:1}.mail-item-row{display:flex;align-items:center;gap:7px}.mail-item-row strong{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1}
.mail-time{font-size:9px;color:#616a63;flex:none}.mail-subject{font-size:11px;color:#a8b0aa;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:5px}
.mail-preview{font-size:10px;color:#646d66;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:4px}
.mail-status{display:inline-flex;align-items:center;gap:4px;font-size:8px;font-weight:800;letter-spacing:.06em;margin-top:7px;padding:4px 6px;border-radius:999px;background:#1b211d;color:#758079}
.mail-status.ai{background:#142418;color:#66ff78}.mail-status.waiting{background:#251f15;color:#e7bb63}.mail-status.unread{background:#17221a;color:#9fb7a4}
.mail-thread-panel{position:relative;min-width:0}.mail-empty-state{min-height:600px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:#667068}
.mail-empty-state strong{font-size:14px;color:#c8cec9;margin-top:10px}.mail-empty-state span{font-size:11px;margin-top:5px}.mail-empty-icon{width:52px;height:52px;border-radius:15px;background:#172019;display:grid;place-items:center;font-size:22px;color:#6cff7b}
.mail-thread{min-height:600px;display:flex;flex-direction:column}.mail-thread-head{display:flex;justify-content:space-between;gap:16px;padding:20px;border-bottom:1px solid #202720}
.mail-thread-kicker{font-size:9px;color:#5e9367;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.mail-thread-head h3{font-size:20px;letter-spacing:-.03em;margin:5px 0 5px}.mail-thread-meta{font-size:10px;color:#667068}
.mail-thread-actions{display:flex;align-items:flex-start;gap:8px}.mail-ai-badge{font-size:8px;font-weight:900;letter-spacing:.08em;padding:7px 9px;border-radius:999px;background:#142418;color:#6cff7b;border:1px solid #294f30}
.mail-conversation{flex:1;overflow:auto;padding:20px;display:flex;flex-direction:column;gap:15px;max-height:360px}
.mail-message{display:flex;gap:10px;align-items:flex-start}.mail-message.outgoing{justify-content:flex-end}
.mail-message-avatar{width:30px;height:30px;border-radius:9px;background:#202620;display:grid;place-items:center;font-size:10px;font-weight:800;flex:none}
.mail-message.outgoing .mail-message-avatar{order:2;background:#17301d;color:#65ff76}
.mail-bubble{max-width:78%;border:1px solid #273028;background:#0e120f;border-radius:14px;padding:12px 13px}
.mail-message.outgoing .mail-bubble{background:#182019;border-color:#324135}
.mail-bubble-head{display:flex;justify-content:space-between;gap:15px;margin-bottom:7px}.mail-bubble-head strong{font-size:10px}.mail-bubble-head span{font-size:9px;color:#626c64}
.mail-bubble p{font-size:12px;color:#c6ccc8;line-height:1.58;margin:0;white-space:pre-wrap}
.mail-reply-box{border-top:1px solid #202720;padding:15px 18px 18px;background:#0f130f}.mail-reply-label{font-size:9px;font-weight:800;color:#59635c;letter-spacing:.1em;margin-bottom:8px}
.mail-reply-box textarea{width:100%;border:1px solid #293129;background:#0b0f0c;color:#eee;border-radius:11px;padding:12px;outline:none;resize:vertical;min-height:90px}
.mail-reply-box textarea:focus{border-color:#435048}.mail-reply-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:10px}
@media(max-width:900px){.mail-shell{grid-template-columns:1fr}.mail-list-panel{max-height:360px}.mail-inbox-list{max-height:270px}.mail-thread,.mail-empty-state{min-height:520px}}

/* Finance */
.finance-demo-note{border-left:2px solid #315e39;background:#0f1310;color:#667068;padding:10px 12px;font-size:10px;margin-bottom:14px}
.finance-kpis,.trend-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:14px}
.finance-kpi,.trend-kpi{border:1px solid #252d27;background:#111512;border-radius:14px;padding:15px}
.finance-kpi span,.trend-kpi span{display:block;font-size:9px;color:#69736c;text-transform:uppercase;letter-spacing:.08em}
.finance-kpi strong,.trend-kpi strong{display:block;font-size:22px;letter-spacing:-.03em;margin-top:8px}
.finance-kpi small,.trend-kpi small{display:block;font-size:9px;color:#667068;margin-top:6px}.finance-kpi.alert strong{color:#f0c46c}.trend-kpi small.up{color:#70ef7e}
.finance-grid,.trend-layout{display:grid;grid-template-columns:1.05fr .95fr;gap:12px;margin-bottom:12px}
.finance-card,.trend-card{border:1px solid #252d27;background:#111512;border-radius:16px;padding:17px}
.finance-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}.finance-card-head h3{font-size:15px;margin:0}.finance-count{min-width:28px;height:28px;border-radius:9px;background:#241f16;color:#efc56c;display:grid;place-items:center;font-size:10px;font-weight:800}
.invoice-list{display:grid;gap:7px}.invoice-row{border:1px solid #242c26;background:#0e120f;border-radius:11px;padding:11px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center}
.invoice-main{min-width:0}.invoice-main strong{display:block;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.invoice-main span{display:block;font-size:9px;color:#69736c;margin-top:4px}.invoice-amount{text-align:right}.invoice-amount strong{display:block;font-size:12px}.invoice-amount small{font-size:8px;color:#da9d55;display:block;margin-top:3px}.invoice-actions{display:flex;gap:5px;justify-content:flex-end;margin-top:7px}.invoice-actions button{padding:5px 7px;border-radius:7px;background:#1a211c;color:#88928b;font-size:8px}.invoice-actions button:hover{background:#223026;color:#70ef7e}.invoice-actions button.delete:hover{background:#2b1b1b;color:#ff9898}
.finance-chart{height:220px;display:flex;align-items:flex-end;gap:13px;padding:16px 5px 2px;border-bottom:1px solid #273028}.finance-month{flex:1;min-width:0;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:5px}.finance-bars{height:175px;width:100%;display:flex;align-items:flex-end;justify-content:center;gap:4px}.finance-bar{width:28%;min-width:10px;border-radius:5px 5px 2px 2px;background:#315f3b}.finance-bar.cost{background:#4b3f2b}.finance-month label{font-size:8px;color:#657068}.finance-legend{display:flex;gap:15px;margin-top:10px;font-size:9px;color:#69736c}.finance-legend i{display:inline-block;width:7px;height:7px;border-radius:2px;margin-right:5px;background:#315f3b}.finance-legend i.cost{background:#4b3f2b}
.finance-summary-card{margin-top:12px}.finance-summary-table{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.finance-summary-item{border:1px solid #222a24;background:#0e120f;border-radius:10px;padding:11px}.finance-summary-item span{display:block;font-size:9px;color:#657068}.finance-summary-item strong{display:block;font-size:13px;margin-top:5px}
/* Trends */
.trend-card select{border:1px solid #2c352e;background:#0d110e;color:#cfd5d0;border-radius:8px;padding:7px 9px;font-size:10px}
.trend-product{display:grid;grid-template-columns:minmax(0,1fr) 90px 70px;gap:10px;align-items:center;padding:11px 0;border-bottom:1px solid #222922}.trend-product:last-child{border-bottom:0}.trend-product-info strong{display:block;font-size:11px}.trend-product-info span{display:block;font-size:9px;color:#68716b;margin-top:4px}.trend-meter{height:6px;border-radius:999px;background:#202620;overflow:hidden}.trend-meter i{display:block;height:100%;border-radius:999px;background:#4b9c58}.trend-change{text-align:right;font-size:10px;font-weight:800;color:#68ef77}.trend-change.down{color:#e78c77}
.trend-ai-output{min-height:280px}.trend-ai-placeholder{height:280px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:#68716b}.trend-ai-placeholder strong{font-size:13px;color:#c7cdc8;margin:8px 0 4px}.trend-ai-placeholder span{font-size:10px;max-width:280px;line-height:1.5}.trend-ai-icon{width:46px;height:46px;border-radius:14px;background:#152218;color:#68ff79;display:grid;place-items:center;font-size:18px}.trend-ai-text{font-size:12px;line-height:1.7;color:#c9d0cb;white-space:pre-wrap;border-left:2px solid #356a3f;padding-left:13px}
.trend-signals{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}.trend-signal{display:flex;gap:10px;border:1px solid #252d27;background:#0e120f;border-radius:11px;padding:12px}.trend-signal>span{width:26px;height:26px;border-radius:8px;display:grid;place-items:center;background:#172119;color:#6cff7c;flex:none}.trend-signal.negative>span{background:#241a18;color:#f19a83}.trend-signal strong{display:block;font-size:10px}.trend-signal small{display:block;color:#657068;font-size:9px;line-height:1.45;margin-top:4px}
@media(max-width:900px){.finance-kpis,.trend-kpis{grid-template-columns:1fr 1fr}.finance-grid,.trend-layout{grid-template-columns:1fr}.finance-summary-table,.trend-signals{grid-template-columns:1fr 1fr}}
@media(max-width:620px){.finance-kpis,.trend-kpis,.finance-summary-table,.trend-signals{grid-template-columns:1fr}.trend-product{grid-template-columns:minmax(0,1fr) 70px 55px}}

/* Social Media */
.social-source-row{display:flex;align-items:center;gap:9px;border:1px solid #222922;background:#0e120f;border-radius:11px;padding:10px 12px;margin-bottom:12px;font-size:10px;color:#68716b}
.social-source-badge{font-size:8px;font-weight:900;letter-spacing:.08em;padding:5px 7px;border-radius:999px;background:#231f15;color:#d9b866;border:1px solid #453a25}.social-source-badge.api{background:#142418;color:#68ff79;border-color:#285031}.social-updated{margin-left:auto;color:#59635c}
.social-platform-tabs{display:flex;gap:7px;overflow:auto;padding-bottom:9px;margin-bottom:5px}.social-platform-tab{flex:none;display:flex;align-items:center;gap:7px;border:1px solid #283029;background:#0e120f;color:#8c968f;border-radius:999px;padding:8px 11px;font-size:10px}.social-platform-tab:hover{border-color:#3b463e;color:#dfe4df}.social-platform-tab.active{background:#182019;border-color:#3b7445;color:#75ff84}.social-platform-dot{width:7px;height:7px;border-radius:50%;background:#59635c}.social-platform-tab.active .social-platform-dot{background:#62ff74;box-shadow:0 0 8px #62ff7466}
.social-kpis{display:grid;grid-template-columns:repeat(5,1fr);gap:9px;margin-bottom:12px}.social-kpi{border:1px solid #252d27;background:#111512;border-radius:14px;padding:14px}.social-kpi>span{display:block;font-size:9px;color:#69736c;text-transform:uppercase;letter-spacing:.07em}.social-kpi strong{display:block;font-size:20px;letter-spacing:-.03em;margin-top:8px}.social-kpi small{display:block;font-size:9px;color:#667068;margin-top:5px}.social-kpi small.up{color:#70ef7e}.social-kpi small.down{color:#e58d78}
.social-grid{display:grid;grid-template-columns:1.1fr .9fr;gap:12px;margin-bottom:12px}.social-card{border:1px solid #252d27;background:#111512;border-radius:16px;padding:17px}.social-period-label{font-size:9px;color:#68716b}
.social-chart{height:250px;display:flex;align-items:flex-end;gap:8px;padding:18px 4px 3px;border-bottom:1px solid #273028}.social-week{height:100%;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:5px}.social-week-bar{width:56%;min-width:12px;border-radius:6px 6px 2px 2px;background:linear-gradient(180deg,#49a65a,#2f6e3b);position:relative}.social-week-bar:hover{filter:brightness(1.15)}.social-week label{font-size:8px;color:#606a63}.social-week-value{font-size:7px;color:#657068;white-space:nowrap}
.social-ai-output{min-height:250px}.social-ai-output .trend-ai-placeholder{height:250px}.social-ai-text{font-size:12px;line-height:1.7;color:#c9d0cb;white-space:pre-wrap;border-left:2px solid #356a3f;padding-left:13px}
.social-posts-card{margin-bottom:12px}.social-post-filter select{border:1px solid #2c352e;background:#0d110e;color:#cfd5d0;border-radius:8px;padding:7px 9px;font-size:10px}.social-post-list{display:grid;gap:7px}
.social-post{display:grid;grid-template-columns:42px minmax(0,1fr) 88px 88px 74px;gap:10px;align-items:center;border:1px solid #242c26;background:#0e120f;border-radius:11px;padding:10px}.social-post-icon{width:36px;height:36px;border-radius:10px;background:#182019;display:grid;place-items:center;font-size:10px;font-weight:900;color:#76ff84}.social-post-main{min-width:0}.social-post-main strong{display:block;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.social-post-main span{display:block;font-size:9px;color:#68716b;margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.social-post-stat{text-align:right}.social-post-stat span{display:block;font-size:8px;color:#626c64}.social-post-stat strong{display:block;font-size:10px;margin-top:3px}.social-post-eng{font-size:10px;font-weight:900;color:#70ef7e;text-align:right}
.social-bottom-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.social-channel-row{display:grid;grid-template-columns:90px minmax(0,1fr) 70px;gap:9px;align-items:center;padding:9px 0;border-bottom:1px solid #222922}.social-channel-row:last-child{border-bottom:0}.social-channel-name{font-size:10px;font-weight:700}.social-channel-meter{height:6px;background:#202620;border-radius:999px;overflow:hidden}.social-channel-meter i{display:block;height:100%;background:#4c9a59;border-radius:999px}.social-channel-value{text-align:right;font-size:9px;color:#7e8880}
.social-signal{display:flex;gap:10px;padding:10px 0;border-bottom:1px solid #222922}.social-signal:last-child{border-bottom:0}.social-signal-icon{width:28px;height:28px;border-radius:8px;background:#172119;color:#6cff7c;display:grid;place-items:center;flex:none}.social-signal.warn .social-signal-icon{background:#261f16;color:#e6ba61}.social-signal.bad .social-signal-icon{background:#241917;color:#ed977f}.social-signal strong{display:block;font-size:10px}.social-signal span{display:block;font-size:9px;color:#667068;line-height:1.45;margin-top:3px}
@media(max-width:1050px){.social-kpis{grid-template-columns:repeat(3,1fr)}}
@media(max-width:900px){.social-grid,.social-bottom-grid{grid-template-columns:1fr}.social-post{grid-template-columns:42px minmax(0,1fr) 70px 70px}.social-post .social-post-stat:nth-of-type(3){display:none}}
@media(max-width:650px){.social-kpis{grid-template-columns:1fr 1fr}.social-source-row{flex-wrap:wrap}.social-updated{margin-left:0;width:100%}.social-post{grid-template-columns:36px minmax(0,1fr) 58px}.social-post .social-post-stat{display:none}.social-post-eng{display:block}}

/* Invoice tabs */
.invoice-card-head{margin-bottom:10px}
.invoice-tabs{display:flex;gap:6px;padding:4px;background:#0d110e;border:1px solid #222922;border-radius:11px;margin-bottom:10px}
.invoice-tab{flex:1;display:flex;align-items:center;justify-content:center;gap:6px;min-height:36px;border-radius:8px;background:transparent;color:#737d75;font-size:10px;font-weight:700}
.invoice-tab:hover{background:#151a16;color:#dce2dd}
.invoice-tab.active{background:#1a221c;color:#f0f4f0;box-shadow:inset 0 0 0 1px #314036}
.invoice-tab span{min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:#202720;display:grid;place-items:center;font-size:8px;color:#8d978f}
.invoice-tab.active span{background:#28422e;color:#71ff81}
.invoice-toolbar{margin-bottom:10px}.invoice-search{display:flex;align-items:center;gap:7px;border:1px solid #293129;background:#0d110e;border-radius:10px;padding:0 10px;color:#626b64}
.invoice-search input{width:100%;height:36px;border:0;outline:0;background:transparent;color:#eee;font-size:10px}
.invoice-row.paid{opacity:.72}.invoice-row.paid .invoice-amount small{color:#69e778}.invoice-paid-badge{display:inline-flex;align-items:center;gap:4px;margin-top:5px;padding:3px 6px;border-radius:999px;background:#142418;color:#68ff79;font-size:7px;font-weight:900;letter-spacing:.06em}
.invoice-unpaid-badge{display:inline-flex;align-items:center;gap:4px;margin-top:5px;padding:3px 6px;border-radius:999px;background:#251f15;color:#e9bd66;font-size:7px;font-weight:900;letter-spacing:.06em}
.invoice-empty{padding:28px 12px;text-align:center;color:#616b64;font-size:10px}

.sidebar{overflow-y:auto}.navgroup-label{font-size:8px;font-weight:900;letter-spacing:.13em;color:#465049;padding:11px 10px 5px}.navs .nav{min-height:37px;height:37px}
.biz-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;margin-bottom:12px}.biz-kpi{border:1px solid #252d27;background:#111512;border-radius:14px;padding:14px}.biz-kpi span{display:block;font-size:9px;color:#69736c;text-transform:uppercase;letter-spacing:.07em}.biz-kpi strong{display:block;font-size:20px;letter-spacing:-.03em;margin-top:8px}.biz-kpi small{display:block;font-size:9px;color:#667068;margin-top:5px}.biz-kpi .good{color:#6eee7a}.biz-kpi .warn{color:#e6b85f}
.biz-two{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:12px}.biz-card{border:1px solid #252d27;background:#111512;border-radius:16px;padding:17px;margin-bottom:12px}.biz-card-head{display:flex;justify-content:space-between;gap:12px;margin-bottom:13px}.biz-card-head h3{font-size:15px;margin:0}.biz-line{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid #222922}.biz-line:last-child{border-bottom:0}.biz-line-icon{width:28px;height:28px;border-radius:8px;background:#172019;display:grid;place-items:center;color:#6cff7c;flex:none}.biz-line.warn .biz-line-icon{background:#261f16;color:#e8bb61}.biz-line.bad .biz-line-icon{background:#241917;color:#ed977f}.biz-line div{flex:1}.biz-line strong{display:block;font-size:10px}.biz-line small{display:block;font-size:9px;color:#667068;margin-top:3px}.biz-ai-placeholder{min-height:90px;color:#68716b;font-size:11px;line-height:1.7;white-space:pre-wrap}
.module-toolbar{display:flex;gap:8px;align-items:center;margin-bottom:12px}.module-toolbar select,.module-search{border:1px solid #293129;background:#0d110e;color:#cdd3ce;border-radius:10px;font-size:10px}.module-toolbar select{height:39px;padding:0 10px}.module-search{display:flex;align-items:center;gap:7px;padding:0 10px;flex:1}.module-search input{border:0;outline:0;background:transparent;color:#eee;width:100%;height:38px;font-size:10px}
.customer-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}.customer-card{border:1px solid #252d27;background:#111512;border-radius:14px;padding:14px}.customer-top{display:flex;align-items:flex-start;gap:10px}.customer-avatar{width:36px;height:36px;border-radius:11px;background:#182019;display:grid;place-items:center;color:#70ff80;font-size:10px;font-weight:900}.customer-main{min-width:0;flex:1}.customer-main strong{display:block;font-size:12px}.customer-main span{display:block;font-size:9px;color:#69736c;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.customer-status{font-size:8px;font-weight:800;padding:5px 7px;border-radius:999px;background:#1a211c;color:#869088}.customer-status.lead{background:#251f15;color:#e6bb64}.customer-status.customer{background:#142418;color:#69ff79}.customer-status.vip{background:#202039;color:#b5b1ff}.customer-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;margin-top:12px}.customer-metric{background:#0e120f;border-radius:8px;padding:8px}.customer-metric span{display:block;font-size:8px;color:#626b64}.customer-metric strong{display:block;font-size:10px;margin-top:3px}
.customer-card-actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.customer-edit-grid select{width:100%;min-height:40px;border:1px solid var(--border,#293129);border-radius:10px;background:var(--input-bg,#0d110e);color:inherit;padding:0 10px}
.data-table-wrap{border:1px solid #252d27;border-radius:14px;overflow:auto;background:#111512}.data-table{width:100%;border-collapse:collapse;min-width:760px}.data-table th{font-size:8px;color:#616b64;text-align:left;padding:11px 12px;background:#0e120f;letter-spacing:.08em;text-transform:uppercase}.data-table td{font-size:10px;padding:12px;border-top:1px solid #222922;color:#c8cec9}.data-table td small{display:block;color:#657068;font-size:8px;margin-top:3px}.tag{display:inline-flex;padding:4px 7px;border-radius:999px;background:#192019;color:#9ba59d;font-size:8px}.tag.green{background:#142418;color:#68ff79}.tag.yellow{background:#251f15;color:#e6bb64}.tag.red{background:#291918;color:#ef9580}.source-tag{display:inline-flex;padding:4px 7px;border-radius:999px;background:#182019;color:#83e991;font-size:8px;font-weight:800}
.task-columns{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.task-column{border:1px solid #252d27;background:#0e120f;border-radius:14px;padding:10px;min-height:350px}.task-column-head{font-size:8px;font-weight:900;color:#657068;letter-spacing:.08em;padding:5px 4px 10px}.task-card{border:1px solid #283029;background:#141914;border-radius:11px;padding:11px;margin-bottom:7px}.task-card strong{font-size:10px;display:block}.task-card span{font-size:8px;color:#68716b;display:block;margin-top:5px}.task-actions{display:flex;gap:5px;margin-top:9px}.task-actions button,.switch-btn{padding:6px 8px;border-radius:8px;background:#1b221c;color:#909991;font-size:8px}.task-actions button:hover,.switch-btn:hover{color:#68ff79}.switch-btn.on{background:#17301d;color:#68ff79}
.alerts-list,.approval-list,.knowledge-list{display:grid;gap:8px}.alert-card,.approval-card,.knowledge-item{border:1px solid #252d27;background:#111512;border-radius:13px;padding:13px;display:flex;gap:11px;align-items:flex-start}.alert-dot{width:9px;height:9px;border-radius:50%;background:#e1ad53;margin-top:4px}.alert-card.critical .alert-dot{background:#ee7e6a}.alert-card.done{opacity:.55}.alert-main,.approval-main,.knowledge-main{flex:1}.alert-main strong,.approval-main strong,.knowledge-main strong{font-size:11px}.alert-main p,.approval-main p,.knowledge-main p{font-size:9px;line-height:1.5;color:#68716b;margin:5px 0 0}.mini-actions{display:flex;gap:5px}.mini-actions button{padding:6px 8px;border-radius:8px;background:#1b221c;color:#8e9890;font-size:8px}.mini-actions button.accept:hover{color:#70ff80}.mini-actions button.reject:hover{color:#f49a86}
.offer-grid,.competition-grid,.users-grid,.automation-grid,.integration-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}.offer-card,.competition-card,.user-card,.automation-card,.integration-card{border:1px solid #252d27;background:#111512;border-radius:14px;padding:14px}.offer-card strong,.competition-card strong,.user-card strong,.automation-card strong,.integration-card strong{font-size:11px}.offer-card p,.competition-card p,.user-card p,.automation-card p,.integration-card p{font-size:9px;color:#68716b;line-height:1.5;margin:5px 0}.offer-bottom,.integration-bottom{display:flex;justify-content:space-between;gap:8px;align-items:center;margin-top:12px}.offer-amount{font-size:14px;font-weight:800}.price-row{display:flex;justify-content:space-between;align-items:center;margin-top:9px;padding-top:9px;border-top:1px solid #222922;font-size:9px}.price-up{color:#e5a55e}.price-down{color:#68e978}
.comm-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin-bottom:12px}.comm-card{border:1px solid #252d27;background:#111512;border-radius:14px;padding:15px;color:#eee;display:flex;align-items:center;gap:11px;text-align:left}.comm-card:hover{border-color:#3d4a40;background:#161c17}.comm-icon{width:34px;height:34px;border-radius:10px;background:#182019;display:grid;place-items:center;color:#71ff82}.comm-card div{flex:1}.comm-card strong{font-size:11px}.comm-card small{display:block;font-size:8px;color:#68716b;margin-top:3px}
.content-week{display:grid;grid-template-columns:repeat(7,minmax(140px,1fr));gap:7px;overflow:auto}.content-day{border:1px solid #252d27;background:#0e120f;border-radius:12px;padding:9px;min-height:300px}.content-day-head{font-size:8px;font-weight:900;color:#657068;margin-bottom:9px}.content-item{border:1px solid #283029;background:#151a16;border-radius:9px;padding:9px;margin-bottom:6px}.content-item strong{font-size:9px;display:block}.content-item span{display:block;font-size:8px;color:#68716b;margin-top:4px}.content-platform{color:#70ef7e!important;font-weight:800}
.report-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin-bottom:12px}.report-card{border:1px solid #252d27;background:#111512;border-radius:14px;padding:16px;color:#eee;text-align:left}.report-card span{font-size:8px;color:#4f8e59;font-weight:900;letter-spacing:.1em}.report-card strong{display:block;font-size:13px;margin-top:8px}.report-card small{display:block;font-size:9px;color:#68716b;margin-top:5px}
.automation-status{display:flex;align-items:center;gap:6px;font-size:8px;color:#69736c;margin-top:10px}.automation-status i{width:7px;height:7px;border-radius:50%;background:#5dff70}.automation-status.off i{background:#5d655f}
.integration-note{border-left:2px solid #315e39;background:#0f1310;color:#667068;padding:11px 13px;font-size:10px;margin-bottom:12px}.integration-card.primary-source{border-color:#407c49;box-shadow:inset 0 0 0 1px #315e39}.integration-logo{width:38px;height:38px;border-radius:12px;background:#182019;color:#70ff80;display:grid;place-items:center;font-size:11px;font-weight:900;margin-bottom:10px}.integration-flow{display:flex;align-items:center;justify-content:center;gap:15px;flex-wrap:wrap;padding:17px}.integration-flow span{border:1px solid #293129;background:#0e120f;border-radius:10px;padding:10px 13px;font-size:10px}
@media(max-width:1100px){.customer-grid,.offer-grid,.competition-grid,.users-grid,.automation-grid,.integration-grid{grid-template-columns:1fr 1fr}.biz-kpis{grid-template-columns:1fr 1fr}}
@media(max-width:850px){.biz-two,.task-columns{grid-template-columns:1fr}.comm-grid,.report-grid{grid-template-columns:1fr}.module-toolbar{flex-wrap:wrap}.customer-grid,.offer-grid,.competition-grid,.users-grid,.automation-grid,.integration-grid{grid-template-columns:1fr}}
@media(max-width:620px){.biz-kpis{grid-template-columns:1fr}}

/* Sidebar v2: navigation no longer stretches / breaks the layout */
.sidebar{overflow:hidden!important}
.sidebar .brandrow,.sidebar .newchat,.sidebar .bottom{flex:none}
.sidebar .navs{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:8px 2px 8px 0;margin-top:4px}
.sidebar .navs::-webkit-scrollbar{width:4px}.sidebar .navs::-webkit-scrollbar-thumb{background:#263029;border-radius:10px}
.sidebar .navgroup-label{padding:12px 10px 5px;font-size:7px;white-space:nowrap}
.sidebar .nav{height:35px!important;min-height:35px!important;padding:0 10px!important;gap:9px!important;font-size:11px!important;white-space:nowrap;overflow:hidden}
.sidebar .nav span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sidebar .history{flex:none;max-height:135px;overflow:auto;border-top:1px solid #202720;margin-top:4px}
.sidebar .history .label{padding:8px 9px 4px;font-size:8px}.sidebar .history .item{height:30px;font-size:10px}
.sidebar .bottom{margin-top:5px!important}

/* Customer contacts */
.customer-contact{display:flex;flex-direction:column;gap:5px;margin-top:10px;padding-top:10px;border-top:1px solid #222922}
.customer-contact a,.customer-contact span{font-size:9px;color:#909b93;text-decoration:none;display:flex;align-items:center;gap:6px;min-width:0}
.customer-contact a:hover{color:#70ff80}.customer-contact b{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.contact-icon{width:20px;height:20px;border-radius:6px;background:#182019;color:#68ef78;display:grid;place-items:center;flex:none;font-size:8px}

/* Orders */
.orders-table tbody tr{cursor:pointer;transition:.12s}.orders-table tbody tr:hover{background:#151b16}.orders-table tbody tr:focus{outline:1px solid #3e7848;outline-offset:-1px}
.order-package-cell{font-size:9px;color:#8e9890}.order-package-cell strong{display:block;color:#c9d0ca;font-size:9px}.order-package-cell span{display:block;color:#626c64;font-size:8px;margin-top:3px}
.order-drawer-backdrop{position:fixed;inset:0;z-index:80;background:rgba(0,0,0,.58);display:flex;justify-content:flex-end}.order-drawer-backdrop.hidden{display:none}
.order-drawer{width:min(560px,100%);height:100%;overflow:auto;background:#0d110e;border-left:1px solid #2a332c;box-shadow:-30px 0 80px rgba(0,0,0,.38);padding:20px}
.order-drawer-head{display:flex;justify-content:space-between;align-items:flex-start;gap:15px;padding-bottom:17px;border-bottom:1px solid #222922}.order-drawer-head h3{font-size:24px;margin:4px 0 3px}.order-panel-sub{font-size:10px;color:#657068}
.order-status-strip{display:flex;gap:6px;flex-wrap:wrap;padding:13px 0}.order-panel-section{border:1px solid #242c26;background:#111512;border-radius:14px;padding:14px;margin-bottom:10px}.order-detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}.order-detail{background:#0d110e;border:1px solid #222a24;border-radius:9px;padding:10px}.order-detail.wide{grid-column:1/-1}.order-detail span{display:block;font-size:8px;color:#626c64;text-transform:uppercase;letter-spacing:.07em}.order-detail strong{display:block;font-size:10px;margin-top:5px;line-height:1.45}.order-panel-actions{display:flex;gap:7px;margin-top:10px;flex-wrap:wrap}
.order-customer-card{display:flex;align-items:center;gap:10px;margin-top:10px}.order-customer-copy{display:flex;flex-direction:column;gap:3px}.order-customer-copy strong{font-size:11px}.order-customer-copy span{font-size:9px;color:#68716b}
.order-items{display:grid;gap:6px;margin-top:9px}.order-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;padding:9px;border:1px solid #222a24;background:#0d110e;border-radius:9px}.order-item strong{display:block;font-size:10px}.order-item span{display:block;font-size:8px;color:#68716b;margin-top:3px}.order-item-price{text-align:right;font-size:10px;font-weight:700}
.order-total-row{display:flex;justify-content:space-between;align-items:center;padding:14px 3px 2px}.order-total-row span{font-size:10px;color:#68716b}.order-total-row strong{font-size:20px}

/* Automations v2 */
.automation-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:12px}.automation-summary-card{border:1px solid #252d27;background:#111512;border-radius:12px;padding:12px}.automation-summary-card span{display:block;font-size:8px;color:#657068;text-transform:uppercase;letter-spacing:.07em}.automation-summary-card strong{display:block;font-size:17px;margin-top:6px}.automation-summary-card small{display:block;color:#68716b;font-size:8px;margin-top:4px}
.automation-list{display:grid;gap:7px}.automation-row{border:1px solid #252d27;background:#111512;border-radius:13px;padding:12px 13px;display:grid;grid-template-columns:42px minmax(0,1fr) 150px 118px 54px;gap:11px;align-items:center}.automation-row:hover{border-color:#364139;background:#141a15}
.automation-icon{width:38px;height:38px;border-radius:11px;background:#172019;display:grid;place-items:center;color:#6cff7b;font-size:13px}.automation-copy{min-width:0}.automation-copy strong{display:block;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.automation-copy p{font-size:8px;color:#68716b;margin:4px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.automation-meta span{display:block;font-size:8px;color:#68716b}.automation-meta strong{display:block;font-size:9px;margin-top:3px}.automation-last{font-size:8px;color:#68716b;text-align:right}
.auto-switch{position:relative;width:44px;height:24px;border-radius:999px;background:#252d27;border:1px solid #343e36;cursor:pointer;transition:.15s}.auto-switch::after{content:'';position:absolute;width:18px;height:18px;border-radius:50%;background:#7b857d;left:2px;top:2px;transition:.15s}.auto-switch.on{background:#1b4925;border-color:#367b43}.auto-switch.on::after{left:22px;background:#6cff7b;box-shadow:0 0 10px #6cff7b55}
.automation-empty{padding:40px;text-align:center;color:#626c64;font-size:10px;border:1px dashed #2a332c;border-radius:13px}
@media(max-width:980px){.automation-row{grid-template-columns:38px minmax(0,1fr) 110px 54px}.automation-last{display:none}.automation-summary{grid-template-columns:1fr 1fr}}
@media(max-width:680px){.order-detail-grid{grid-template-columns:1fr}.order-detail.wide{grid-column:auto}.automation-row{grid-template-columns:38px minmax(0,1fr) 48px}.automation-meta{display:none}.automation-summary{grid-template-columns:1fr 1fr}.sidebar{overflow:auto!important}}

/* Knowledge modal fix */
.knowledge-modal-box{width:min(620px,calc(100vw - 30px))}
.knowledge-modal-box .field select{width:100%;height:42px;border:1px solid #293129;background:#0d110e;color:#e8ece9;border-radius:10px;padding:0 11px;outline:none}
.knowledge-modal-box .field textarea{min-height:170px;resize:vertical}
.knowledge-form-hint{font-size:9px;color:#657068;border-left:2px solid #315e39;background:#0f1310;padding:9px 11px;margin-top:4px}
.knowledge-item{transition:.12s}.knowledge-item:hover{border-color:#344039;background:#141915}
.knowledge-item .tag{margin-bottom:1px}
.knowledge-item-date{display:block;font-size:8px;color:#525c55;margin-top:7px}
.knowledge-empty{padding:35px;text-align:center;border:1px dashed #283029;border-radius:12px;color:#626c64;font-size:10px}

/* Single commerce integration */
.integration-grid-single{grid-template-columns:repeat(3,minmax(0,1fr))}
.integration-active-bar{border:1px solid #2b352d;background:#101611;border-radius:13px;padding:12px 14px;margin-bottom:12px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.integration-active-left{display:flex;align-items:center;gap:10px}.integration-active-icon{width:34px;height:34px;border-radius:10px;background:#17301d;color:#6cff7b;display:grid;place-items:center;font-size:10px;font-weight:900}
.integration-active-left strong{display:block;font-size:11px}.integration-active-left span{display:block;font-size:9px;color:#68716b;margin-top:3px}.integration-active-pill{font-size:8px;font-weight:900;letter-spacing:.08em;padding:6px 8px;border-radius:999px;background:#142418;color:#6cff7b;border:1px solid #2d5a35}
.integration-card{position:relative}.integration-card.connected{border-color:#3e7848;box-shadow:inset 0 0 0 1px #315e39}.integration-card .integration-badge{position:absolute;right:12px;top:12px;font-size:7px;font-weight:900;letter-spacing:.08em;padding:5px 7px;border-radius:999px;background:#142418;color:#68ff79}.integration-card .integration-desc{min-height:42px}
.integration-card .integration-features{display:flex;flex-wrap:wrap;gap:5px;margin-top:10px}.integration-feature{font-size:7px;color:#879188;background:#171d18;border:1px solid #252d27;border-radius:999px;padding:4px 6px}
.integration-connect-btn{width:100%;height:34px;border-radius:9px;background:#1a211c;color:#a9b2ab;font-size:9px;font-weight:800;margin-top:12px;border:1px solid #2c352e}.integration-connect-btn:hover{background:#213025;color:#70ff80;border-color:#36553d}.integration-connect-btn.connected{background:#17301d;color:#70ff80;border-color:#376f41;cursor:default}
.integration-api{font-size:8px;color:#526058;margin-top:7px;display:block}
@media(max-width:1000px){.integration-grid-single{grid-template-columns:1fr 1fr}}
@media(max-width:650px){.integration-grid-single{grid-template-columns:1fr}.integration-active-bar{align-items:flex-start;flex-direction:column}}

/* AI Agent Control Center */
.automation-subtabs{display:flex;gap:6px;background:#0d110e;border:1px solid #252d27;border-radius:12px;padding:4px;margin-bottom:12px}
.automation-subtab{flex:1;min-height:38px;border-radius:9px;background:transparent;color:#77817a;font-size:10px;font-weight:800;display:flex;align-items:center;justify-content:center;gap:7px}
.automation-subtab:hover{background:#151a16;color:#dce1dd}.automation-subtab.active{background:#19211a;color:#f0f4f0;box-shadow:inset 0 0 0 1px #314038}
.automation-subtab span{min-width:21px;height:21px;padding:0 6px;border-radius:999px;background:#251f15;color:#e9bd66;display:grid;place-items:center;font-size:8px}
.ai-control-hero{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;border:1px solid #2a342c;background:linear-gradient(135deg,#121812,#0e120f);border-radius:16px;padding:17px;margin-bottom:12px}
.ai-control-hero h3{font-size:18px;margin:4px 0 5px}.ai-control-hero p{font-size:10px;color:#68716b;max-width:650px;line-height:1.5;margin:0}
.ai-control-master{min-width:240px}.ai-control-master label{display:block;font-size:8px;color:#657068;margin-bottom:6px;text-transform:uppercase;letter-spacing:.08em}.ai-control-master select,.approval-filter-row select{width:100%;height:38px;border:1px solid #2b352d;background:#0d110e;color:#e0e5e1;border-radius:9px;padding:0 10px;font-size:10px}
.ai-control-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:12px}.ai-control-kpi{border:1px solid #252d27;background:#111512;border-radius:12px;padding:12px}.ai-control-kpi span{display:block;font-size:8px;color:#657068;text-transform:uppercase;letter-spacing:.07em}.ai-control-kpi strong{display:block;font-size:17px;margin-top:6px}.ai-control-kpi small{display:block;font-size:8px;color:#68716b;margin-top:4px}
.ai-control-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}.ai-control-toolbar strong{display:block;font-size:12px}.ai-control-toolbar span{display:block;font-size:9px;color:#68716b;margin-top:3px}
.ai-policy-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:18px}
.ai-policy-card{border:1px solid #252d27;background:#111512;border-radius:13px;padding:12px;display:grid;grid-template-columns:38px minmax(0,1fr) 170px;gap:10px;align-items:center}
.ai-policy-icon{width:36px;height:36px;border-radius:10px;background:#172019;color:#6cff7b;display:grid;place-items:center;font-size:13px}.ai-policy-copy{min-width:0}.ai-policy-copy strong{display:block;font-size:10px}.ai-policy-copy p{font-size:8px;color:#68716b;line-height:1.45;margin:4px 0 0}
.ai-policy-select{height:34px;border:1px solid #2b352d;background:#0d110e;color:#dfe4df;border-radius:8px;padding:0 8px;font-size:9px}.ai-policy-card.mode-auto{border-color:#315e39}.ai-policy-card.mode-approval{border-color:#51472d}.ai-policy-card.mode-blocked{border-color:#55302c}
.ai-approval-queue-head{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;margin:4px 0 9px}.ai-approval-queue-head h3{font-size:14px;margin:2px 0 0}.approval-filter-row{width:170px}
.ai-approval-queue{display:grid;gap:7px}.ai-approval-item{border:1px solid #252d27;background:#111512;border-radius:13px;padding:12px;display:grid;grid-template-columns:38px minmax(0,1fr) auto;gap:10px;align-items:flex-start}.ai-approval-item.approved{opacity:.72;border-color:#2f5036}.ai-approval-item.rejected{opacity:.62;border-color:#50302d}
.ai-approval-item-icon{width:36px;height:36px;border-radius:10px;background:#251f15;color:#e6bb64;display:grid;place-items:center;font-size:13px}.ai-approval-item.approved .ai-approval-item-icon{background:#142418;color:#68ff79}.ai-approval-item.rejected .ai-approval-item-icon{background:#281918;color:#ef957f}
.ai-approval-copy strong{display:block;font-size:10px}.ai-approval-copy p{font-size:9px;color:#68716b;margin:4px 0 0;line-height:1.45}.ai-approval-meta{display:flex;gap:7px;flex-wrap:wrap;margin-top:7px}.ai-approval-meta span{font-size:7px;padding:4px 6px;border-radius:999px;background:#181e19;color:#7e8981}
.ai-approval-actions{display:flex;gap:6px;align-items:center}.ai-approval-actions button{height:30px;padding:0 9px;border-radius:8px;background:#1a211c;color:#959f97;font-size:8px}.ai-approval-actions .approve:hover{background:#17301d;color:#6cff7b}.ai-approval-actions .reject:hover{background:#291a18;color:#ef957f}
.ai-control-empty{padding:34px;text-align:center;color:#626c64;border:1px dashed #2a332c;border-radius:12px;font-size:10px}
@media(max-width:1050px){.ai-policy-list{grid-template-columns:1fr}.ai-control-kpis{grid-template-columns:1fr 1fr}}
@media(max-width:720px){.ai-control-hero,.ai-control-toolbar,.ai-approval-queue-head{flex-direction:column;align-items:stretch}.ai-control-master{min-width:0}.ai-policy-card{grid-template-columns:36px minmax(0,1fr)}.ai-policy-select{grid-column:1/-1}.ai-approval-item{grid-template-columns:36px minmax(0,1fr)}.ai-approval-actions{grid-column:1/-1}.approval-filter-row{width:100%}.ai-control-kpis{grid-template-columns:1fr 1fr}}

/* AI approval detail / editable email */
.ai-approval-item{cursor:pointer;transition:.12s}.ai-approval-item:hover{border-color:#3b473e;background:#151a16}.ai-approval-item[data-ai-open]:focus{outline:1px solid #3d7546;outline-offset:-1px}
.ai-approval-open-hint{font-size:7px!important;color:#5c685f!important;background:#151b16!important}
.ai-action-detail-backdrop{position:fixed;inset:0;z-index:110;background:rgba(0,0,0,.62);display:flex;justify-content:flex-end}.ai-action-detail-backdrop.hidden{display:none}
.ai-action-detail{width:min(680px,100%);height:100%;overflow:auto;background:#0d110e;border-left:1px solid #2a332c;box-shadow:-30px 0 90px rgba(0,0,0,.45);padding:20px}
.ai-action-detail-head{display:flex;align-items:flex-start;justify-content:space-between;gap:15px;border-bottom:1px solid #222922;padding-bottom:15px;margin-bottom:12px}.ai-action-detail-head h3{font-size:21px;margin:4px 0 3px}.ai-action-detail-sub{font-size:9px;color:#677169}
.ai-email-recipient{display:flex;align-items:center;gap:10px;border:1px solid #252d27;background:#111512;border-radius:13px;padding:12px;margin-bottom:10px}.ai-email-recipient>div:last-child{display:flex;flex-direction:column;gap:3px;min-width:0}.ai-email-recipient strong{font-size:11px}.ai-email-recipient span{font-size:9px;color:#69736c;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ai-action-detail-section{border:1px solid #252d27;background:#111512;border-radius:14px;padding:14px;margin-bottom:10px}
.ai-email-history{display:flex;flex-direction:column;gap:8px;margin-top:10px;max-height:330px;overflow:auto;padding-right:3px}
.ai-email-history-row{display:flex}.ai-email-history-row.outgoing{justify-content:flex-end}.ai-email-history-bubble{max-width:84%;border-radius:12px;padding:10px 11px;background:#171d18;border:1px solid #273029}.ai-email-history-row.outgoing .ai-email-history-bubble{background:#142219;border-color:#285133}
.ai-email-history-bubble strong{display:block;font-size:9px}.ai-email-history-bubble span{display:block;font-size:7px;color:#627067;margin-top:3px}.ai-email-history-bubble p{font-size:10px;line-height:1.55;color:#cdd3ce;white-space:pre-wrap;margin:7px 0 0}
.ai-editor-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start;margin-bottom:10px}.ai-editor-head>div>span{font-size:8px;color:#68716b}.ai-editor-head .secondary{padding:7px 9px;font-size:8px}
.ai-email-editor{width:100%;min-height:210px;resize:vertical;border:1px solid #2b352d;background:#0c100d;color:#e6ebe7;border-radius:11px;padding:12px;outline:none;font-size:11px;line-height:1.6}.ai-email-editor:focus{border-color:#3c7045;box-shadow:0 0 0 2px rgba(84,196,98,.07)}
.ai-email-editor-meta{display:flex;justify-content:space-between;gap:10px;margin-top:7px;font-size:8px;color:#626d65}.ai-email-editor-meta .edited{color:#e5b761}
.ai-action-detail-actions{display:flex;justify-content:flex-end;gap:8px;position:sticky;bottom:-20px;background:linear-gradient(180deg,rgba(13,17,14,0),#0d110e 28%);padding:24px 0 4px}.danger-soft:hover{background:#281b19!important;color:#ee9783!important}
.generic-action-box{margin-top:9px;background:#0d110e;border:1px solid #222a24;border-radius:10px;padding:12px}.generic-action-box strong{font-size:11px}.generic-action-box p{font-size:9px;color:#68716b;line-height:1.5}.generic-action-box span{font-size:8px;color:#879188}
@media(max-width:680px){.ai-action-detail{padding:15px}.ai-editor-head{flex-direction:column}.ai-action-detail-actions{flex-direction:column-reverse}.ai-action-detail-actions button{width:100%}}

/* =========================
   Nexora theme system
   ========================= */
:root{
  --theme-bg:#0b0d0c;
  --theme-side:#0d100e;
  --theme-surface:#111512;
  --theme-surface-2:#151a16;
  --theme-line:#252d27;
  --theme-text:#f4f5f4;
  --theme-muted:#858d87;
  --theme-accent:#68ff79;
  --theme-accent-soft:#17301d;
  --theme-accent-contrast:#081009;
}
html,body{background:var(--theme-bg)!important;color:var(--theme-text)!important}
body{background:var(--theme-bg)!important}
.app{background:radial-gradient(900px 600px at 57% 45%,var(--theme-surface-2) 0%,var(--theme-bg) 65%)!important}
.sidebar{background:var(--theme-side)!important;border-color:var(--theme-line)!important}
.top{border-color:var(--theme-line)!important}
.control-view,.scroll{color:var(--theme-text)}
.biz-card,.finance-card,.trend-card,.social-card,.customer-card,.task-column,.offer-card,.competition-card,.user-card,.automation-card,.integration-card,.settings-card,.ai-control-hero,.ai-action-detail-section,.ai-email-recipient,.knowledge-item,.alert-card,.approval-card{background:var(--theme-surface)!important;border-color:var(--theme-line)!important}
.module-search,.module-toolbar select,.settings-select,.hex-input,.ai-policy-select,.ai-control-master select,.approval-filter-row select,.invoice-tabs,.invoice-search,.order-detail,.order-item,.generic-action-box{background:var(--theme-bg)!important;border-color:var(--theme-line)!important;color:var(--theme-text)!important}
.nav:hover,.item:hover,.profile:hover{background:var(--theme-surface-2)!important}
.nav.active,.automation-subtab.active{background:var(--theme-accent-soft)!important;color:var(--theme-accent)!important}
.primary{background:var(--theme-accent)!important;color:var(--theme-accent-contrast)!important}
.primary:hover{filter:brightness(.94)}
.status i,.automation-status i,.social-platform-tab.active .social-platform-dot{background:var(--theme-accent)!important}
.welcome-kicker,.section-label,.launch,.content-platform,.price-down,.theme-preview-kicker{color:var(--theme-accent)!important}
.source-tag,.tag.green,.integration-active-pill,.integration-badge,.invoice-paid-badge{background:var(--theme-accent-soft)!important;color:var(--theme-accent)!important}
.customer-avatar,.integration-logo,.automation-icon,.biz-line-icon,.comm-icon,.ai-policy-icon{background:var(--theme-accent-soft)!important;color:var(--theme-accent)!important}
.auto-switch.on{background:var(--theme-accent-soft)!important;border-color:var(--theme-accent)!important}.auto-switch.on::after{background:var(--theme-accent)!important}
.sidebar .navgroup-label,.section-label,.label{color:var(--theme-muted)!important}
.panel-copy p,.sub,.biz-card small,.settings-card p{color:var(--theme-muted)!important}

/* =========================
   Customer base alignment fix
   ========================= */
.customer-grid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:12px!important;
  align-items:stretch!important;
}
.customer-card{
  min-width:0;
  min-height:265px;
  padding:15px!important;
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden;
}
.customer-top{
  display:grid!important;
  grid-template-columns:42px minmax(0,1fr) auto!important;
  align-items:start!important;
  gap:10px!important;
  min-height:52px;
}
.customer-avatar{
  width:42px!important;
  height:42px!important;
  border-radius:12px!important;
  flex:none;
}
.customer-main{
  min-width:0!important;
  padding-top:1px;
}
.customer-main strong{
  display:block!important;
  font-size:12px!important;
  line-height:1.35!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.customer-main span{
  display:block!important;
  margin-top:4px!important;
  font-size:9px!important;
  color:var(--theme-muted)!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.customer-status{
  justify-self:end;
  align-self:start;
  white-space:nowrap;
}
.customer-contact{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:6px!important;
  margin:12px 0 0!important;
  padding:11px 0!important;
  border-top:1px solid var(--theme-line)!important;
  border-bottom:1px solid var(--theme-line)!important;
  min-height:75px;
}
.customer-contact a{
  width:100%;
  min-width:0;
  height:27px;
  margin:0!important;
  display:grid!important;
  grid-template-columns:24px minmax(0,1fr)!important;
  align-items:center!important;
  gap:7px!important;
}
.customer-contact b{
  width:100%;
  min-width:0;
  font-size:9px!important;
  font-weight:500!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.contact-icon{
  width:24px!important;
  height:24px!important;
  margin:0!important;
}
.customer-metrics{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:6px!important;
  margin:11px 0 0!important;
}
.customer-metric{
  min-width:0;
  min-height:52px;
  padding:8px!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:space-between!important;
  background:var(--theme-bg)!important;
  border:1px solid var(--theme-line);
  border-radius:9px!important;
}
.customer-metric span{
  font-size:7px!important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.customer-metric strong{
  margin-top:5px!important;
  font-size:9px!important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.customer-card .price-row{
  margin-top:auto!important;
  padding-top:11px!important;
  min-height:43px;
}
.customer-card .price-row>span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.customer-card .switch-btn{
  flex:none;
}

/* =========================
   Settings / theme editor
   ========================= */
.settings-layout{display:grid;grid-template-columns:1.2fr .8fr;gap:12px}
.settings-card{border:1px solid var(--theme-line);border-radius:16px;padding:17px}
.settings-card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:13px}.settings-card-head h3{font-size:15px;margin:2px 0 0}
.theme-current-badge{font-size:8px;font-weight:900;padding:6px 8px;border-radius:999px;background:var(--theme-accent-soft);color:var(--theme-accent)}
.theme-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}
.theme-option{position:relative;border:1px solid var(--theme-line);background:var(--theme-bg);border-radius:12px;padding:10px;text-align:left;color:var(--theme-text);min-height:92px}
.theme-option:hover{border-color:var(--theme-accent)}.theme-option.active{box-shadow:inset 0 0 0 1px var(--theme-accent);border-color:var(--theme-accent)}
.theme-swatch{display:flex;height:30px;border-radius:8px;overflow:hidden;border:1px solid rgba(127,127,127,.18);margin-bottom:8px}.theme-swatch i{flex:1}.theme-option strong{display:block;font-size:10px}.theme-option span{display:block;font-size:8px;color:var(--theme-muted);margin-top:3px}
.theme-check{position:absolute;right:9px;top:9px;width:20px;height:20px;border-radius:50%;display:grid;place-items:center;background:var(--theme-accent);color:var(--theme-accent-contrast);font-size:10px;font-weight:900}
.color-setting-row{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:13px 0;border-bottom:1px solid var(--theme-line)}.color-setting-row>div:first-child{min-width:0}.color-setting-row strong{display:block;font-size:10px}.color-setting-row span{display:block;font-size:8px;color:var(--theme-muted);margin-top:4px;line-height:1.4}
.color-control{display:flex;align-items:center;gap:7px;flex:none}.color-control input[type=color]{width:40px;height:40px;padding:3px;background:var(--theme-bg);border:1px solid var(--theme-line);border-radius:9px;cursor:pointer}.hex-input{width:84px;height:38px;border-radius:9px;padding:0 9px;font-size:9px;text-transform:uppercase}
.settings-select{height:38px;border-radius:9px;padding:0 10px;font-size:9px;min-width:125px}
.theme-custom-actions{display:flex;justify-content:flex-end;gap:7px;margin-top:14px}
.theme-preview-card{grid-column:1/-1}.theme-preview{height:280px;border:1px solid var(--theme-line);border-radius:14px;overflow:hidden;display:grid;grid-template-columns:190px 1fr;background:var(--theme-bg)}
.theme-preview-sidebar{background:var(--theme-side);padding:14px;border-right:1px solid var(--theme-line)}.theme-preview-logo{font-size:11px;font-weight:800;display:flex;align-items:center;gap:7px;margin-bottom:16px}.theme-preview-logo img{width:19px;height:19px}.theme-preview-nav{height:31px;border-radius:8px;padding:8px;color:var(--theme-muted);font-size:9px;margin-bottom:4px}.theme-preview-nav.active{background:var(--theme-accent-soft);color:var(--theme-accent)}
.theme-preview-main{padding:22px;background:radial-gradient(500px 260px at 50% 20%,var(--theme-surface-2),var(--theme-bg));display:flex;flex-direction:column;align-items:flex-start}.theme-preview-main>strong{font-size:22px;margin-top:5px}.theme-preview-cards{display:grid;grid-template-columns:1fr 1fr;gap:8px;width:100%;margin:18px 0}.theme-preview-cards>div{background:var(--theme-surface);border:1px solid var(--theme-line);border-radius:10px;padding:11px}.theme-preview-cards span{display:block;color:var(--theme-muted);font-size:8px}.theme-preview-cards b{display:block;font-size:13px;margin-top:5px}.theme-preview-main button{background:var(--theme-accent);color:var(--theme-accent-contrast);padding:9px 12px;border-radius:8px;font-size:9px;font-weight:800}

@media(max-width:1150px){.customer-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:900px){.settings-layout{grid-template-columns:1fr}.theme-preview-card{grid-column:auto}}
@media(max-width:650px){.customer-grid{grid-template-columns:1fr!important}.settings-layout{grid-template-columns:1fr}.theme-grid{grid-template-columns:1fr}.color-setting-row{align-items:flex-start;flex-direction:column}.theme-preview{grid-template-columns:110px 1fr}.theme-preview-sidebar{padding:10px}.theme-preview-main{padding:14px}}

/* =========================================================
   NEXORA THEME SYSTEM v2
   - every main surface uses theme variables
   - typography is normalized
   - logo is embedded and follows --theme-accent
   ========================================================= */
:root{
  --theme-bg:#0B0D0C;
  --theme-side:#0D100E;
  --theme-surface:#111512;
  --theme-surface-2:#151A16;
  --theme-surface-3:#1A201B;
  --theme-line:#252D27;
  --theme-text:#F4F5F4;
  --theme-muted:#858D87;
  --theme-accent:#68FF79;
  --theme-accent-soft:#17301D;
  --theme-accent-contrast:#071009;
  --theme-input:#0D110E;
  --theme-hover:#171D18;
  --theme-shadow:rgba(0,0,0,.32);
}

/* Typography normalization — keeps font sizing stable across themes */
html,body,button,input,textarea,select{
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif!important;
  font-variant-numeric:tabular-nums;
}
html,body{color:var(--theme-text)!important;background:var(--theme-bg)!important}
body{font-size:14px;line-height:1.45}
button,input,textarea,select{font-size:inherit;color:var(--theme-text)}
input,textarea,select{caret-color:var(--theme-accent)}
input::placeholder,textarea::placeholder{color:var(--theme-muted)!important;opacity:.72}
h1,h2,h3,h4,h5,h6,strong,b,.brand,.workspace-name,.title{color:var(--theme-text)!important}
p,small,label,.sub,.pc span,.panel-copy p{color:var(--theme-muted)!important}
a{color:var(--theme-accent)}

/* Main app shell */
.app{
  color:var(--theme-text)!important;
  background:
    radial-gradient(900px 600px at 57% 44%,var(--theme-surface-2) 0%,var(--theme-bg) 68%)!important;
}
.sidebar{background:var(--theme-side)!important;border-color:var(--theme-line)!important}
.top{background:color-mix(in srgb,var(--theme-bg) 88%,transparent)!important;border-color:var(--theme-line)!important}
.scroll,.main,#controlViews,.control-view{color:var(--theme-text)!important}
.bottom,.history{border-color:var(--theme-line)!important}

/* Navigation */
.nav,.item,.profile,.smallbtn{
  color:color-mix(in srgb,var(--theme-text) 78%,var(--theme-muted))!important;
}
.nav:hover,.item:hover,.profile:hover,.smallbtn:hover{
  background:var(--theme-hover)!important;color:var(--theme-text)!important;
}
.nav.active,#settingsNavBtn.active{
  background:var(--theme-accent-soft)!important;
  color:var(--theme-accent)!important;
}
.navgroup-label,.label,.section-label,.eyebrow{
  color:var(--theme-muted)!important;
}
.newchat{
  background:var(--theme-surface-2)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
}
.newchat:hover{background:var(--theme-hover)!important;border-color:color-mix(in srgb,var(--theme-accent) 34%,var(--theme-line))!important}
.plus,.launch,.welcome-kicker{color:var(--theme-accent)!important}

/* Generic controls */
.primary{
  background:var(--theme-accent)!important;
  color:var(--theme-accent-contrast)!important;
  border-color:var(--theme-accent)!important;
}
.primary:hover{filter:brightness(.94)}
.secondary,.switch-btn,.task-actions button,.mini-actions button{
  background:var(--theme-surface-2)!important;
  border:1px solid var(--theme-line)!important;
  color:var(--theme-text)!important;
}
.secondary:hover,.switch-btn:hover,.task-actions button:hover,.mini-actions button:hover{
  background:var(--theme-hover)!important;
  border-color:color-mix(in srgb,var(--theme-accent) 34%,var(--theme-line))!important;
  color:var(--theme-accent)!important;
}
input,textarea,select,
.module-search,.invoice-search,.settings-select,.hex-input,
.ai-policy-select,.ai-control-master select,.approval-filter-row select{
  background:var(--theme-input)!important;
  border-color:var(--theme-line)!important;
  color:var(--theme-text)!important;
}
input:focus,textarea:focus,select:focus{
  outline:none!important;
  border-color:color-mix(in srgb,var(--theme-accent) 62%,var(--theme-line))!important;
  box-shadow:0 0 0 2px color-mix(in srgb,var(--theme-accent) 10%,transparent)!important;
}
input[type="checkbox"],input[type="radio"]{accent-color:var(--theme-accent)!important}

/* Universal surfaces */
.card,.calendar-card,.event-card,.email-card,.files-card,
.mail-list,.mail-thread,.mail-thread-card,.mail-item,.mail-reply-box,
.finance-card,.finance-kpi,.trend-kpi,.trend-card,.trend-product,
.social-card,.social-kpi,.social-post,.social-channel,.social-signal,
.biz-card,.biz-kpi,.customer-card,.task-column,.task-card,
.offer-card,.competition-card,.user-card,.automation-card,.automation-row,
.integration-card,.settings-card,.report-card,.content-day,.content-item,
.alert-card,.approval-card,.knowledge-item,.ai-control-hero,.ai-control-kpi,
.ai-policy-card,.ai-approval-item,.ai-action-detail-section,.ai-email-recipient,
.order-panel-section,.order-detail,.order-item,.modal-box,.data-table-wrap{
  background:var(--theme-surface)!important;
  border-color:var(--theme-line)!important;
  color:var(--theme-text)!important;
}
.card:hover,.mail-item:hover,.customer-card:hover,.automation-row:hover,
.report-card:hover,.content-item:hover,.integration-card:hover{
  background:var(--theme-surface-2)!important;
  border-color:color-mix(in srgb,var(--theme-accent) 25%,var(--theme-line))!important;
}

/* Chat */
.user .bubble{
  background:var(--theme-surface-2)!important;
  border-color:var(--theme-line)!important;
  color:var(--theme-text)!important;
}
.bot .bubble,.bubble{color:var(--theme-text)!important}
.composer{
  background:color-mix(in srgb,var(--theme-surface-2) 96%,transparent)!important;
  border-color:var(--theme-line)!important;
}
.composer:focus-within{border-color:color-mix(in srgb,var(--theme-accent) 48%,var(--theme-line))!important}
.composer textarea{background:transparent!important;color:var(--theme-text)!important}
.actions button{color:var(--theme-muted)!important}
.actions button:hover{background:var(--theme-hover)!important;color:var(--theme-text)!important}

/* Tables */
.data-table{background:var(--theme-surface)!important;color:var(--theme-text)!important}
.data-table th{background:var(--theme-bg)!important;color:var(--theme-muted)!important;border-color:var(--theme-line)!important}
.data-table td{color:var(--theme-text)!important;border-color:var(--theme-line)!important}
.data-table tbody tr:hover{background:var(--theme-surface-2)!important}

/* Cards internals */
.customer-metric,.finance-summary-item,.order-detail,.order-item,.generic-action-box,
.theme-option,.theme-preview-cards>div,.automation-summary-card{
  background:var(--theme-bg)!important;
  border-color:var(--theme-line)!important;
}
.customer-contact,.price-row,.biz-line,.file-row,.trend-product,
.mail-item,.finance-summary-item{border-color:var(--theme-line)!important}
.customer-main span,.customer-contact a,.customer-contact b,
.customer-metric span,.customer-metric strong,.order-package-cell span,
.automation-copy p,.automation-meta span,.automation-last,
.ai-approval-copy p,.ai-approval-meta span,.knowledge-item-date,
.order-panel-sub,.order-customer-copy span,.order-detail span,
.theme-option span,.color-setting-row span{color:var(--theme-muted)!important}

/* Accent-linked components */
.customer-avatar,.contact-icon,.integration-logo,.automation-icon,.biz-line-icon,
.comm-icon,.ai-policy-icon,.ai-approval-item-icon,.integration-active-icon{
  background:var(--theme-accent-soft)!important;
  color:var(--theme-accent)!important;
}
.source-tag,.tag.green,.integration-active-pill,.integration-badge,
.invoice-paid-badge,.customer-status.customer{
  background:var(--theme-accent-soft)!important;color:var(--theme-accent)!important;
}
.status i,.automation-status i{background:var(--theme-accent)!important}
.auto-switch.on{background:var(--theme-accent-soft)!important;border-color:var(--theme-accent)!important}
.auto-switch.on::after{background:var(--theme-accent)!important;box-shadow:0 0 10px color-mix(in srgb,var(--theme-accent) 38%,transparent)!important}
.trend-meter i,.social-channel-bar i,.finance-bar.rev,.theme-preview-main button{
  background:var(--theme-accent)!important;
}
.theme-preview-nav.active{
  background:var(--theme-accent-soft)!important;color:var(--theme-accent)!important;
}
.theme-check{background:var(--theme-accent)!important;color:var(--theme-accent-contrast)!important}

/* Modal/drawer */
.modal{background:rgba(0,0,0,.66)!important}
.order-drawer,.ai-action-detail{
  background:var(--theme-bg)!important;
  border-color:var(--theme-line)!important;
  color:var(--theme-text)!important;
}
.order-drawer-head,.ai-action-detail-head{border-color:var(--theme-line)!important}
.ai-email-history-bubble{
  background:var(--theme-surface-2)!important;border-color:var(--theme-line)!important;
}
.ai-email-history-row.outgoing .ai-email-history-bubble{
  background:var(--theme-accent-soft)!important;
  border-color:color-mix(in srgb,var(--theme-accent) 30%,var(--theme-line))!important;
}
.ai-email-history-bubble p{color:var(--theme-text)!important}

/* Calendar and email */
.calendar-toolbar button{
  background:var(--theme-surface-2)!important;color:var(--theme-text)!important;
}
.day,.calendar-day{border-color:var(--theme-line)!important}
.day:hover,.calendar-day:hover{background:var(--theme-surface-2)!important}
.day.today,.calendar-day.today{box-shadow:inset 0 0 0 1px var(--theme-accent)!important}
.mail-list,.mail-thread{background:var(--theme-surface)!important}
.mail-inbox-item,.mail-thread-message{border-color:var(--theme-line)!important}

/* Theme editor itself */
.theme-preview{background:var(--theme-bg)!important;border-color:var(--theme-line)!important}
.theme-preview-sidebar{background:var(--theme-side)!important;border-color:var(--theme-line)!important}
.theme-preview-main{
  background:radial-gradient(500px 260px at 50% 20%,var(--theme-surface-2),var(--theme-bg))!important;
}
.color-control input[type=color]{background:var(--theme-input)!important;border-color:var(--theme-line)!important}
.theme-current-badge{background:var(--theme-accent-soft)!important;color:var(--theme-accent)!important}

/* Light theme contrast guard */
html[data-theme-light="true"] .sidebar,
html[data-theme-light="true"] .top{
  box-shadow:none!important;
}
html[data-theme-light="true"] .secondary,
html[data-theme-light="true"] .switch-btn{
  color:var(--theme-text)!important;
}
html[data-theme-light="true"] .modal{
  background:rgba(20,24,22,.38)!important;
}

/* Real vector Nexora logo */
.nexora-logo-svg{
  display:inline-block;
  flex:none;
  color:var(--theme-accent);
  overflow:visible;
  filter:drop-shadow(0 0 8px color-mix(in srgb,var(--theme-accent) 32%,transparent));
  transition:color .18s ease,filter .18s ease;
}
.nexora-logo-svg use{fill:currentColor}
.brand-logo{width:22px;height:22px}
.hero-logo{width:34px;height:34px}
.bot-logo{width:24px;height:24px}
.preview-logo{width:19px;height:19px}

/* Disable the old raster-mask rendering if an old class remains anywhere */
/* Real isolated theme preview */
.theme-preview{
  --preview-bg:var(--theme-bg);
  --preview-side:var(--theme-side);
  --preview-surface:var(--theme-surface);
  --preview-surface2:var(--theme-surface-2);
  --preview-line:var(--theme-line);
  --preview-text:var(--theme-text);
  --preview-muted:var(--theme-muted);
  --preview-accent:var(--theme-accent);
  --preview-accent-soft:var(--theme-accent-soft);
  --preview-accent-contrast:var(--theme-accent-contrast);
  background:var(--preview-bg)!important;
  color:var(--preview-text)!important;
  border-color:var(--preview-line)!important;
}
.theme-preview-sidebar{
  background:var(--preview-side)!important;
  border-color:var(--preview-line)!important;
  color:var(--preview-text)!important;
}
.theme-preview-logo{color:var(--preview-text)!important}
.theme-preview .nexora-logo-svg{
  color:var(--preview-accent)!important;
  filter:drop-shadow(0 0 8px color-mix(in srgb,var(--preview-accent) 35%,transparent))!important;
}
.theme-preview-nav{color:var(--preview-muted)!important}
.theme-preview-nav.active{
  background:var(--preview-accent-soft)!important;
  color:var(--preview-accent)!important;
}
.theme-preview-main{
  background:radial-gradient(500px 260px at 50% 20%,var(--preview-surface2),var(--preview-bg))!important;
  color:var(--preview-text)!important;
}
.theme-preview-main>strong,.theme-preview-cards b{color:var(--preview-text)!important}
.theme-preview-kicker{color:var(--preview-accent)!important}
.theme-preview-cards>div{
  background:var(--preview-surface)!important;
  border-color:var(--preview-line)!important;
}
.theme-preview-cards span{color:var(--preview-muted)!important}
.theme-preview-main button{
  background:var(--preview-accent)!important;
  color:var(--preview-accent-contrast)!important;
}
.theme-preview-state{
  display:inline-flex;
  margin-top:7px;
  font-size:8px;
  font-weight:800;
  letter-spacing:.05em;
  color:var(--theme-muted);
}
.theme-preview-state.unsaved{color:#e7b75f}
.theme-preview-card.preview-flash{animation:previewFlash .5s ease}
@keyframes previewFlash{
  0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--theme-accent) 0%,transparent)}
  45%{box-shadow:0 0 0 3px color-mix(in srgb,var(--theme-accent) 24%,transparent)}
  100%{box-shadow:0 0 0 0 color-mix(in srgb,var(--theme-accent) 0%,transparent)}
}

/* Nexora logo — w 100% zapisane w tym pliku HTML */
.nexora-logo-svg{
  display:inline-block;
  flex:none;
  color:var(--theme-accent);
  overflow:visible;
  transition:color .18s ease,filter .18s ease;
  filter:drop-shadow(0 0 8px color-mix(in srgb,var(--theme-accent) 32%,transparent));
}
.nexora-logo-svg path{fill:currentColor}
.brand-logo{width:22px;height:22px}
.hero-logo{width:34px;height:34px}
.bot-logo{width:24px;height:24px}
.preview-logo{width:19px;height:19px}

/* =========================================================
   LIGHT MODE — deterministic contrast pass
   ========================================================= */
html[data-theme-light="true"],
html[data-theme-light="true"] body{
  background:var(--theme-bg)!important;
  color:var(--theme-text)!important;
}
html[data-theme-light="true"] .app{
  background:radial-gradient(900px 600px at 57% 44%,var(--theme-surface-2) 0%,var(--theme-bg) 72%)!important;
}
html[data-theme-light="true"] .sidebar,
html[data-theme-light="true"] .top,
html[data-theme-light="true"] .order-drawer,
html[data-theme-light="true"] .ai-action-detail{
  background:var(--theme-side)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme-light="true"] .top{
  background:color-mix(in srgb,var(--theme-side) 94%,transparent)!important;
}
html[data-theme-light="true"] .card,
html[data-theme-light="true"] .calendar-card,
html[data-theme-light="true"] .event-card,
html[data-theme-light="true"] .email-card,
html[data-theme-light="true"] .files-card,
html[data-theme-light="true"] .mail-list,
html[data-theme-light="true"] .mail-thread,
html[data-theme-light="true"] .mail-thread-card,
html[data-theme-light="true"] .mail-item,
html[data-theme-light="true"] .mail-reply-box,
html[data-theme-light="true"] .finance-card,
html[data-theme-light="true"] .finance-kpi,
html[data-theme-light="true"] .trend-kpi,
html[data-theme-light="true"] .trend-card,
html[data-theme-light="true"] .social-card,
html[data-theme-light="true"] .social-kpi,
html[data-theme-light="true"] .social-post,
html[data-theme-light="true"] .social-channel,
html[data-theme-light="true"] .social-signal,
html[data-theme-light="true"] .biz-card,
html[data-theme-light="true"] .biz-kpi,
html[data-theme-light="true"] .customer-card,
html[data-theme-light="true"] .task-column,
html[data-theme-light="true"] .task-card,
html[data-theme-light="true"] .offer-card,
html[data-theme-light="true"] .competition-card,
html[data-theme-light="true"] .user-card,
html[data-theme-light="true"] .automation-card,
html[data-theme-light="true"] .automation-row,
html[data-theme-light="true"] .integration-card,
html[data-theme-light="true"] .settings-card,
html[data-theme-light="true"] .report-card,
html[data-theme-light="true"] .content-day,
html[data-theme-light="true"] .content-item,
html[data-theme-light="true"] .alert-card,
html[data-theme-light="true"] .approval-card,
html[data-theme-light="true"] .knowledge-item,
html[data-theme-light="true"] .ai-control-hero,
html[data-theme-light="true"] .ai-control-kpi,
html[data-theme-light="true"] .ai-policy-card,
html[data-theme-light="true"] .ai-approval-item,
html[data-theme-light="true"] .ai-action-detail-section,
html[data-theme-light="true"] .ai-email-recipient,
html[data-theme-light="true"] .order-panel-section,
html[data-theme-light="true"] .data-table-wrap,
html[data-theme-light="true"] .modal-box{
  background:var(--theme-surface)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
  box-shadow:none!important;
}
html[data-theme-light="true"] h1,
html[data-theme-light="true"] h2,
html[data-theme-light="true"] h3,
html[data-theme-light="true"] h4,
html[data-theme-light="true"] strong,
html[data-theme-light="true"] b,
html[data-theme-light="true"] .brand,
html[data-theme-light="true"] .workspace-name,
html[data-theme-light="true"] .title,
html[data-theme-light="true"] .bubble{
  color:var(--theme-text)!important;
}
html[data-theme-light="true"] p,
html[data-theme-light="true"] small,
html[data-theme-light="true"] label,
html[data-theme-light="true"] .sub,
html[data-theme-light="true"] .panel-copy p,
html[data-theme-light="true"] .pc span{
  color:var(--theme-muted)!important;
}
html[data-theme-light="true"] input,
html[data-theme-light="true"] textarea,
html[data-theme-light="true"] select,
html[data-theme-light="true"] .module-search,
html[data-theme-light="true"] .invoice-search,
html[data-theme-light="true"] .composer{
  background:var(--theme-input)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme-light="true"] .secondary,
html[data-theme-light="true"] .switch-btn,
html[data-theme-light="true"] .task-actions button,
html[data-theme-light="true"] .mini-actions button{
  background:var(--theme-surface-2)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme-light="true"] .nav,
html[data-theme-light="true"] .item,
html[data-theme-light="true"] .profile,
html[data-theme-light="true"] .smallbtn{
  color:color-mix(in srgb,var(--theme-text) 74%,var(--theme-muted))!important;
}
html[data-theme-light="true"] .nav:hover,
html[data-theme-light="true"] .item:hover,
html[data-theme-light="true"] .profile:hover,
html[data-theme-light="true"] .smallbtn:hover{
  background:var(--theme-hover)!important;
  color:var(--theme-text)!important;
}
html[data-theme-light="true"] .nav.active,
html[data-theme-light="true"] #settingsNavBtn.active{
  background:var(--theme-accent-soft)!important;
  color:var(--theme-accent)!important;
}
html[data-theme-light="true"] .data-table th{
  background:var(--theme-surface-2)!important;
  color:var(--theme-muted)!important;
}
html[data-theme-light="true"] .data-table td{
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme-light="true"] .user .bubble{
  background:var(--theme-surface-2)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme-light="true"] .ai-email-history-bubble{
  background:var(--theme-surface-2)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme-light="true"] .modal{
  background:rgba(40,46,42,.34)!important;
}
html[data-theme-light="true"] .theme-preview{
  box-shadow:none!important;
}

/* =========================================================
   LIGHT MODE v2 — final consistency pass
   ========================================================= */
html[data-theme-light="true"]{
  --theme-bg:#F4F6F5;
  --theme-side:#FFFFFF;
  --theme-surface:#FFFFFF;
  --theme-surface-2:#EEF2EF;
  --theme-surface-3:#E7ECE8;
  --theme-line:#D7DED9;
  --theme-text:#151A17;
  --theme-muted:#68726B;
  --theme-input:#FBFCFB;
  --theme-hover:#E9EEEA;
  --theme-shadow:rgba(34,46,38,.10);
}

/* Shell + navigation */
html[data-theme-light="true"] .app,
html[data-theme-light="true"] .main,
html[data-theme-light="true"] .scroll,
html[data-theme-light="true"] #controlViews,
html[data-theme-light="true"] .control-view{
  background:var(--theme-bg)!important;
  color:var(--theme-text)!important;
}
html[data-theme-light="true"] .sidebar,
html[data-theme-light="true"] .top,
html[data-theme-light="true"] .bottom,
html[data-theme-light="true"] .history{
  background:var(--theme-side)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme-light="true"] .newchat,
html[data-theme-light="true"] .nav,
html[data-theme-light="true"] .item,
html[data-theme-light="true"] .profile,
html[data-theme-light="true"] .smallbtn,
html[data-theme-light="true"] .mobilemenu{
  color:var(--theme-text)!important;
}
html[data-theme-light="true"] .newchat{
  background:var(--theme-surface-2)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme-light="true"] .newchat:hover,
html[data-theme-light="true"] .nav:hover,
html[data-theme-light="true"] .item:hover,
html[data-theme-light="true"] .profile:hover,
html[data-theme-light="true"] .smallbtn:hover,
html[data-theme-light="true"] .mobilemenu:hover{
  background:var(--theme-hover)!important;
  color:var(--theme-text)!important;
}
html[data-theme-light="true"] .nav.active,
html[data-theme-light="true"] .item.selected,
html[data-theme-light="true"] #settingsNavBtn.active{
  background:var(--theme-accent-soft)!important;
  color:var(--theme-accent)!important;
}
html[data-theme-light="true"] .avatar{
  background:var(--theme-surface-2)!important;
  color:var(--theme-text)!important;
}

/* Workspace / chat / quick cards */
html[data-theme-light="true"] .welcome,
html[data-theme-light="true"] .messages{
  color:var(--theme-text)!important;
}
html[data-theme-light="true"] .card{
  background:var(--theme-surface)!important;
  border-color:var(--theme-line)!important;
  box-shadow:0 6px 20px var(--theme-shadow)!important;
}
html[data-theme-light="true"] .card:hover{
  background:var(--theme-surface-2)!important;
}
html[data-theme-light="true"] .cardicon,
html[data-theme-light="true"] .cb{
  background:var(--theme-surface-2)!important;
  color:var(--theme-accent)!important;
}
html[data-theme-light="true"] .hint{
  background:var(--theme-surface-2)!important;
  border-color:var(--theme-line)!important;
  color:var(--theme-muted)!important;
}
html[data-theme-light="true"] .user .bubble{
  background:var(--theme-surface-2)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme-light="true"] .bot .bubble{
  color:var(--theme-text)!important;
}
html[data-theme-light="true"] .composer{
  background:var(--theme-surface)!important;
  border-color:var(--theme-line)!important;
  box-shadow:0 10px 30px var(--theme-shadow)!important;
}
html[data-theme-light="true"] .composer textarea{
  background:transparent!important;
  color:var(--theme-text)!important;
}
html[data-theme-light="true"] .send{
  background:var(--theme-accent)!important;
  color:var(--theme-accent-contrast)!important;
}
html[data-theme-light="true"] .actions button:hover{
  background:var(--theme-hover)!important;
  color:var(--theme-text)!important;
}

/* Every common panel/surface still used by legacy modules */
html[data-theme-light="true"] .calendar-card,
html[data-theme-light="true"] .event-card,
html[data-theme-light="true"] .email-card,
html[data-theme-light="true"] .files-card,
html[data-theme-light="true"] .mail-inbox,
html[data-theme-light="true"] .mail-list,
html[data-theme-light="true"] .mail-thread,
html[data-theme-light="true"] .mail-thread-card,
html[data-theme-light="true"] .mail-reply-box,
html[data-theme-light="true"] .mail-item,
html[data-theme-light="true"] .finance-card,
html[data-theme-light="true"] .finance-kpi,
html[data-theme-light="true"] .trend-card,
html[data-theme-light="true"] .trend-kpi,
html[data-theme-light="true"] .social-card,
html[data-theme-light="true"] .social-kpi,
html[data-theme-light="true"] .social-post,
html[data-theme-light="true"] .social-channel,
html[data-theme-light="true"] .social-signal,
html[data-theme-light="true"] .biz-card,
html[data-theme-light="true"] .biz-kpi,
html[data-theme-light="true"] .customer-card,
html[data-theme-light="true"] .task-column,
html[data-theme-light="true"] .task-card,
html[data-theme-light="true"] .offer-card,
html[data-theme-light="true"] .competition-card,
html[data-theme-light="true"] .user-card,
html[data-theme-light="true"] .automation-card,
html[data-theme-light="true"] .automation-row,
html[data-theme-light="true"] .automation-summary-card,
html[data-theme-light="true"] .integration-card,
html[data-theme-light="true"] .settings-card,
html[data-theme-light="true"] .report-card,
html[data-theme-light="true"] .content-day,
html[data-theme-light="true"] .content-item,
html[data-theme-light="true"] .alert-card,
html[data-theme-light="true"] .approval-card,
html[data-theme-light="true"] .knowledge-item,
html[data-theme-light="true"] .ai-control-hero,
html[data-theme-light="true"] .ai-control-kpi,
html[data-theme-light="true"] .ai-policy-card,
html[data-theme-light="true"] .ai-approval-item,
html[data-theme-light="true"] .ai-action-detail-section,
html[data-theme-light="true"] .ai-email-recipient,
html[data-theme-light="true"] .order-panel-section,
html[data-theme-light="true"] .order-detail,
html[data-theme-light="true"] .order-item,
html[data-theme-light="true"] .generic-action-box,
html[data-theme-light="true"] .data-table-wrap,
html[data-theme-light="true"] .modal-box,
html[data-theme-light="true"] .theme-option,
html[data-theme-light="true"] .theme-preview-cards>div{
  background:var(--theme-surface)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
  box-shadow:none!important;
}

/* Secondary/inset surfaces */
html[data-theme-light="true"] .customer-metric,
html[data-theme-light="true"] .invoice-tabs,
html[data-theme-light="true"] .invoice-search,
html[data-theme-light="true"] .finance-summary-item,
html[data-theme-light="true"] .order-detail,
html[data-theme-light="true"] .order-item,
html[data-theme-light="true"] .generic-action-box,
html[data-theme-light="true"] .automation-subtabs,
html[data-theme-light="true"] .automation-subtab,
html[data-theme-light="true"] .theme-swatch,
html[data-theme-light="true"] .content-item,
html[data-theme-light="true"] .ai-email-history-bubble{
  background:var(--theme-surface-2)!important;
  border-color:var(--theme-line)!important;
}

/* Inputs, tables, buttons */
html[data-theme-light="true"] input,
html[data-theme-light="true"] textarea,
html[data-theme-light="true"] select,
html[data-theme-light="true"] .module-search,
html[data-theme-light="true"] .invoice-search,
html[data-theme-light="true"] .settings-select,
html[data-theme-light="true"] .hex-input,
html[data-theme-light="true"] .ai-policy-select{
  background:var(--theme-input)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme-light="true"] .secondary,
html[data-theme-light="true"] .switch-btn,
html[data-theme-light="true"] .task-actions button,
html[data-theme-light="true"] .mini-actions button{
  background:var(--theme-surface-2)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme-light="true"] .data-table,
html[data-theme-light="true"] .data-table tbody,
html[data-theme-light="true"] .data-table tr{
  background:var(--theme-surface)!important;
}
html[data-theme-light="true"] .data-table th{
  background:var(--theme-surface-2)!important;
  color:var(--theme-muted)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme-light="true"] .data-table td{
  background:transparent!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme-light="true"] .data-table tbody tr:hover{
  background:var(--theme-hover)!important;
}

/* Drawers + modal overlays */
html[data-theme-light="true"] .order-drawer,
html[data-theme-light="true"] .ai-action-detail{
  background:var(--theme-side)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme-light="true"] .modal{
  background:rgba(48,58,51,.28)!important;
}

/* Text hierarchy */
html[data-theme-light="true"] h1,
html[data-theme-light="true"] h2,
html[data-theme-light="true"] h3,
html[data-theme-light="true"] h4,
html[data-theme-light="true"] strong,
html[data-theme-light="true"] b,
html[data-theme-light="true"] .workspace-name,
html[data-theme-light="true"] .brand,
html[data-theme-light="true"] .title{
  color:var(--theme-text)!important;
}
html[data-theme-light="true"] p,
html[data-theme-light="true"] small,
html[data-theme-light="true"] label,
html[data-theme-light="true"] .sub,
html[data-theme-light="true"] .panel-copy p,
html[data-theme-light="true"] .customer-main span,
html[data-theme-light="true"] .customer-contact b,
html[data-theme-light="true"] .automation-copy p,
html[data-theme-light="true"] .order-panel-sub{
  color:var(--theme-muted)!important;
}

/* Scrollbars were still black in Light */
html[data-theme-light="true"] *{
  scrollbar-color:#BCC7BF #EDF1EE;
}
html[data-theme-light="true"] *::-webkit-scrollbar-track{
  background:#EDF1EE!important;
}
html[data-theme-light="true"] *::-webkit-scrollbar-thumb{
  background:#BCC7BF!important;
  border-color:#EDF1EE!important;
}
html[data-theme-light="true"] *::-webkit-scrollbar-thumb:hover{
  background:#A8B6AC!important;
}

/* Always-visible new-session action */
.top-new-session{
  height:34px;
  padding:0 11px;
  border-radius:9px;
  display:flex;
  align-items:center;
  gap:6px;
  background:var(--theme-surface-2);
  border:1px solid var(--theme-line);
  color:var(--theme-text);
  font-size:10px;
  font-weight:750;
  white-space:nowrap;
}
.top-new-session:hover{
  background:var(--theme-accent-soft);
  border-color:color-mix(in srgb,var(--theme-accent) 35%,var(--theme-line));
  color:var(--theme-accent);
}
html[data-theme-light="true"] .top-new-session{
  background:var(--theme-surface-2)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme-light="true"] .top-new-session:hover{
  background:var(--theme-accent-soft)!important;
  color:var(--theme-accent)!important;
}
@media(max-width:720px){
  .top-new-session span{display:none}
  .top-new-session{width:34px;padding:0;justify-content:center}
}

/* =========================================================
   NEXORA UI POLISH v3
   ========================================================= */
:root{
  --font-ui:ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI Variable","Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --radius-sm:9px;
  --radius-md:12px;
  --radius-lg:16px;
  --radius-xl:20px;
}
html,body,button,input,textarea,select{
  font-family:var(--font-ui)!important;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
body{
  font-size:14px;
  letter-spacing:-.005em;
}
h1{
  font-size:clamp(34px,3.4vw,46px)!important;
  line-height:1.02!important;
  letter-spacing:-.045em!important;
  font-weight:720!important;
}
h2{
  font-size:28px!important;
  line-height:1.08!important;
  letter-spacing:-.035em!important;
  font-weight:700!important;
}
h3{
  font-size:16px!important;
  line-height:1.2!important;
  letter-spacing:-.018em!important;
  font-weight:680!important;
}
.panel-copy p{
  font-size:12px!important;
  line-height:1.55!important;
  max-width:720px!important;
}
.section-label,.navgroup-label,.label,.eyebrow,.welcome-kicker{
  font-size:8.5px!important;
  letter-spacing:.105em!important;
  font-weight:800!important;
}
.nav{
  font-size:11.5px!important;
  font-weight:560!important;
  letter-spacing:-.005em;
}
.newchat,.top-new-session{
  font-weight:650!important;
}
.primary,.secondary{
  min-height:38px;
  border-radius:var(--radius-sm)!important;
  font-size:11px!important;
  font-weight:650!important;
  letter-spacing:-.006em;
}
.card,.biz-card,.customer-card,.finance-card,.trend-card,.social-card,
.offer-card,.competition-card,.settings-card,.integration-card,
.automation-row,.task-column,.report-card,.content-day,.knowledge-item{
  border-radius:var(--radius-lg)!important;
}
.card{
  min-height:100px!important;
  padding:18px!important;
}
.card strong{
  font-size:12px!important;
  font-weight:650!important;
}
.card span{
  font-size:10.5px!important;
  line-height:1.5!important;
}
.data-table th{
  font-size:8.5px!important;
  font-weight:800!important;
  letter-spacing:.08em!important;
}
.data-table td{
  font-size:10.5px!important;
  line-height:1.42!important;
}
.customer-main strong{
  font-size:11.5px!important;
  font-weight:680!important;
}
.customer-main span,.customer-contact b{
  font-size:9px!important;
}
.customer-metric span{
  font-size:7.5px!important;
  font-weight:700!important;
  letter-spacing:.035em;
}
.customer-metric strong{
  font-size:10px!important;
  font-weight:680!important;
}
.module-search input,.module-toolbar select,
input,textarea,select{
  font-size:10.5px!important;
}
.composer{
  border-radius:18px!important;
}
.composer textarea,.bubble{
  font-size:13.5px!important;
}
.bubble{
  line-height:1.62!important;
}
.status{
  font-size:9.5px!important;
  font-weight:650!important;
}

/* =========================================================
   LIGHT MODE v3
   Important: no fixed white/gray palette here.
   It uses the currently selected theme colors. Only typography
   and contrast become dark.
   ========================================================= */
html[data-theme-light="true"]{
  color-scheme:light;
}

/* Text is dark in Light, but the rest stays theme-driven */
html[data-theme-light="true"] body,
html[data-theme-light="true"] .app,
html[data-theme-light="true"] .main,
html[data-theme-light="true"] .scroll,
html[data-theme-light="true"] #controlViews,
html[data-theme-light="true"] .control-view{
  color:var(--theme-text)!important;
  background:var(--theme-bg)!important;
}
html[data-theme-light="true"] h1,
html[data-theme-light="true"] h2,
html[data-theme-light="true"] h3,
html[data-theme-light="true"] h4,
html[data-theme-light="true"] h5,
html[data-theme-light="true"] h6,
html[data-theme-light="true"] strong,
html[data-theme-light="true"] b,
html[data-theme-light="true"] .brand,
html[data-theme-light="true"] .workspace-name,
html[data-theme-light="true"] .title,
html[data-theme-light="true"] .bubble{
  color:var(--theme-text)!important;
}
html[data-theme-light="true"] p,
html[data-theme-light="true"] small,
html[data-theme-light="true"] label,
html[data-theme-light="true"] .sub,
html[data-theme-light="true"] .panel-copy p,
html[data-theme-light="true"] .pc span,
html[data-theme-light="true"] .customer-main span,
html[data-theme-light="true"] .customer-contact b,
html[data-theme-light="true"] .automation-copy p,
html[data-theme-light="true"] .order-panel-sub{
  color:var(--theme-muted)!important;
}

/* Every shell surface stays inside the selected theme */
html[data-theme-light="true"] .sidebar,
html[data-theme-light="true"] .top,
html[data-theme-light="true"] .bottom,
html[data-theme-light="true"] .history,
html[data-theme-light="true"] .order-drawer,
html[data-theme-light="true"] .ai-action-detail{
  background:var(--theme-side)!important;
  border-color:var(--theme-line)!important;
  color:var(--theme-text)!important;
}
html[data-theme-light="true"] .top{
  background:color-mix(in srgb,var(--theme-side) 95%,transparent)!important;
}

/* Primary cards */
html[data-theme-light="true"] :is(
  .card,.calendar-card,.event-card,.email-card,.files-card,
  .mail-list,.mail-thread,.mail-thread-card,.mail-reply-box,.mail-item,
  .finance-card,.finance-kpi,.trend-card,.trend-kpi,
  .social-card,.social-kpi,.social-post,.social-channel,.social-signal,
  .biz-card,.biz-kpi,.customer-card,.task-column,.task-card,
  .offer-card,.competition-card,.user-card,.automation-card,.automation-row,
  .automation-summary-card,.integration-card,.settings-card,.report-card,
  .content-day,.content-item,.alert-card,.approval-card,.knowledge-item,
  .ai-control-hero,.ai-control-kpi,.ai-policy-card,.ai-approval-item,
  .ai-action-detail-section,.ai-email-recipient,.order-panel-section,
  .data-table-wrap,.modal-box,.theme-option
){
  background:var(--theme-surface)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
  box-shadow:none!important;
}

/* Inset / secondary surfaces */
html[data-theme-light="true"] :is(
  .customer-metric,.invoice-tabs,.invoice-search,.finance-summary-item,
  .order-detail,.order-item,.generic-action-box,.automation-subtabs,
  .automation-subtab,.theme-swatch,.ai-email-history-bubble,
  .cardicon,.cb,.avatar
){
  background:var(--theme-surface-2)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
}

/* Keep accent personality */
html[data-theme-light="true"] :is(
  .nav.active,#settingsNavBtn.active,.source-tag,.tag.green,
  .integration-active-pill,.integration-badge,.invoice-paid-badge,
  .customer-status.customer,.theme-current-badge
){
  background:var(--theme-accent-soft)!important;
  color:var(--theme-accent)!important;
}
html[data-theme-light="true"] :is(
  .customer-avatar,.contact-icon,.integration-logo,.automation-icon,
  .biz-line-icon,.comm-icon,.ai-policy-icon,.integration-active-icon
){
  background:var(--theme-accent-soft)!important;
  color:var(--theme-accent)!important;
}

/* Controls */
html[data-theme-light="true"] input,
html[data-theme-light="true"] textarea,
html[data-theme-light="true"] select,
html[data-theme-light="true"] .module-search,
html[data-theme-light="true"] .settings-select,
html[data-theme-light="true"] .hex-input,
html[data-theme-light="true"] .ai-policy-select,
html[data-theme-light="true"] .composer{
  background:var(--theme-input)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme-light="true"] input::placeholder,
html[data-theme-light="true"] textarea::placeholder{
  color:var(--theme-muted)!important;
}
html[data-theme-light="true"] :is(.secondary,.switch-btn,.task-actions button,.mini-actions button,.newchat,.top-new-session){
  background:var(--theme-surface-2)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme-light="true"] :is(.secondary,.switch-btn,.task-actions button,.mini-actions button,.newchat,.top-new-session):hover{
  background:var(--theme-hover)!important;
  color:var(--theme-accent)!important;
  border-color:color-mix(in srgb,var(--theme-accent) 30%,var(--theme-line))!important;
}

/* Navigation */
html[data-theme-light="true"] :is(.nav,.item,.profile,.smallbtn,.mobilemenu){
  color:var(--theme-text)!important;
}
html[data-theme-light="true"] :is(.nav,.item,.profile,.smallbtn,.mobilemenu):hover{
  background:var(--theme-hover)!important;
  color:var(--theme-text)!important;
}

/* Workspace + chat */
html[data-theme-light="true"] .user .bubble{
  background:var(--theme-surface-2)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme-light="true"] .composer{
  box-shadow:0 12px 32px var(--theme-shadow)!important;
}
html[data-theme-light="true"] .hint{
  background:var(--theme-surface-2)!important;
  border-color:var(--theme-line)!important;
  color:var(--theme-muted)!important;
}

/* Tables */
html[data-theme-light="true"] .data-table,
html[data-theme-light="true"] .data-table tbody,
html[data-theme-light="true"] .data-table tr{
  background:var(--theme-surface)!important;
}
html[data-theme-light="true"] .data-table th{
  background:var(--theme-surface-2)!important;
  color:var(--theme-muted)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme-light="true"] .data-table td{
  background:transparent!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme-light="true"] .data-table tbody tr:hover{
  background:var(--theme-hover)!important;
}

/* Calendar legacy colors */
html[data-theme-light="true"] .day{
  background:var(--theme-surface)!important;
  color:var(--theme-text)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme-light="true"] .day:hover,
html[data-theme-light="true"] .day.has-event{
  background:var(--theme-surface-2)!important;
}
html[data-theme-light="true"] .day.today{
  border-color:var(--theme-accent)!important;
}
html[data-theme-light="true"] .dot{
  background:var(--theme-accent)!important;
}

/* Scrollbars also follow the current theme */
html[data-theme-light="true"] *{
  scrollbar-color:color-mix(in srgb,var(--theme-muted) 38%,var(--theme-surface-2)) var(--theme-bg);
}
html[data-theme-light="true"] *::-webkit-scrollbar-track{
  background:var(--theme-bg)!important;
}
html[data-theme-light="true"] *::-webkit-scrollbar-thumb{
  background:color-mix(in srgb,var(--theme-muted) 38%,var(--theme-surface-2))!important;
  border-color:var(--theme-bg)!important;
}
html[data-theme-light="true"] *::-webkit-scrollbar-thumb:hover{
  background:color-mix(in srgb,var(--theme-muted) 52%,var(--theme-surface-2))!important;
}

/* Nowa sesja — zawsze pobiera kolor z aktywnego motywu */
.newchat,
.top-new-session{
  background:var(--theme-accent-soft)!important;
  color:var(--theme-accent)!important;
  border-color:color-mix(in srgb,var(--theme-accent) 38%,var(--theme-line))!important;
}
.newchat .plus,
.top-new-session{
  color:var(--theme-accent)!important;
}
.newchat:hover,
.top-new-session:hover{
  background:color-mix(in srgb,var(--theme-accent) 22%,var(--theme-surface))!important;
  color:var(--theme-accent)!important;
  border-color:color-mix(in srgb,var(--theme-accent) 60%,var(--theme-line))!important;
}
html[data-theme-light="true"] .newchat,
html[data-theme-light="true"] .top-new-session{
  background:var(--theme-accent-soft)!important;
  color:var(--theme-accent)!important;
  border-color:color-mix(in srgb,var(--theme-accent) 38%,var(--theme-line))!important;
}
html[data-theme-light="true"] .newchat:hover,
html[data-theme-light="true"] .top-new-session:hover{
  background:color-mix(in srgb,var(--theme-accent) 18%,var(--theme-surface))!important;
  color:var(--theme-accent)!important;
}

/* Aktywna sesja — kolor zawsze z aktualnego motywu */
.session-sidebar-row.selected{
  background:var(--theme-accent-soft)!important;
  border:1px solid color-mix(in srgb,var(--theme-accent) 22%,var(--theme-line))!important;
}
.session-sidebar-row.selected .item.selected,
.item.selected{
  background:transparent!important;
  color:var(--theme-text)!important;
  box-shadow:inset 3px 0 0 var(--theme-accent)!important;
}
.session-sidebar-row.selected .session-mini{
  color:var(--theme-accent)!important;
}
.session-sidebar-row.selected .session-mini:hover{
  background:color-mix(in srgb,var(--theme-accent) 14%,transparent)!important;
  color:var(--theme-accent)!important;
}

/* etykieta aktywnej sesji i drobne akcenty też śledzą motyw */
.history .label:first-child{
  color:var(--theme-accent)!important;
}
.status i{
  background:var(--theme-accent)!important;
  box-shadow:0 0 9px color-mix(in srgb,var(--theme-accent) 70%,transparent)!important;
}

/* =========================================================
   NEXORA TYPOGRAPHY v4 — czytelniejszy interfejs
   ========================================================= */
:root{
  --font-ui:Inter,"Segoe UI Variable","Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --font-size-ui:14px;
  --font-size-small:12px;
  --font-size-micro:10.5px;
}
html{
  font-size:16px;
}
html,body,button,input,textarea,select{
  font-family:var(--font-ui)!important;
  font-feature-settings:"kern" 1,"liga" 1,"calt" 1;
  font-kerning:normal;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
}
body{
  font-size:var(--font-size-ui)!important;
  line-height:1.5!important;
  letter-spacing:0!important;
}

/* Nagłówki */
h1{
  font-size:clamp(36px,3.4vw,48px)!important;
  line-height:1.05!important;
  letter-spacing:-.038em!important;
  font-weight:700!important;
}
h2{
  font-size:30px!important;
  line-height:1.12!important;
  letter-spacing:-.028em!important;
  font-weight:700!important;
}
h3{
  font-size:17px!important;
  line-height:1.3!important;
  letter-spacing:-.012em!important;
  font-weight:650!important;
}

/* Sidebar */
.brand{
  font-size:15px!important;
  font-weight:700!important;
  letter-spacing:-.01em!important;
}
.nav{
  font-size:12.5px!important;
  line-height:1.25!important;
  font-weight:600!important;
}
.navgroup-label,
.label{
  font-size:10px!important;
  line-height:1.25!important;
  letter-spacing:.08em!important;
  font-weight:800!important;
}
.item{
  font-size:12px!important;
  line-height:1.3!important;
  font-weight:500!important;
}
.pc strong{
  font-size:11.5px!important;
  font-weight:650!important;
}
.pc span{
  font-size:10px!important;
}

/* Główne etykiety */
.eyebrow,
.welcome-kicker,
.section-label{
  font-size:10px!important;
  line-height:1.25!important;
  letter-spacing:.08em!important;
  font-weight:800!important;
}
.workspace-name{
  font-size:13px!important;
  font-weight:650!important;
}
.panel-copy p,
.sub{
  font-size:13px!important;
  line-height:1.6!important;
}

/* Przyciski */
button,
.primary,
.secondary,
.switch-btn,
.top-new-session,
.newchat{
  font-weight:600!important;
}
.primary,
.secondary{
  font-size:12px!important;
  line-height:1.2!important;
}
.newchat{
  font-size:13px!important;
}
.top-new-session{
  font-size:11px!important;
}

/* Karty */
.card strong,
.biz-card strong,
.customer-main strong,
.task-card strong,
.offer-card strong,
.competition-card strong,
.user-card strong,
.integration-card strong,
.automation-copy strong{
  font-weight:650!important;
}
.card strong{
  font-size:13px!important;
}
.card span{
  font-size:11.5px!important;
  line-height:1.55!important;
}
.customer-main strong{
  font-size:12.5px!important;
  line-height:1.35!important;
}
.customer-main span,
.customer-contact b{
  font-size:10.5px!important;
  line-height:1.4!important;
}
.customer-metric span{
  font-size:9px!important;
  letter-spacing:.04em!important;
  font-weight:700!important;
}
.customer-metric strong{
  font-size:11px!important;
  font-weight:650!important;
}

/* Formularze */
input,
textarea,
select{
  font-size:12px!important;
  line-height:1.45!important;
}
input::placeholder,
textarea::placeholder{
  font-size:12px!important;
}
.field label,
.ai-control-master label{
  font-size:10px!important;
  line-height:1.3!important;
  letter-spacing:.06em!important;
}

/* Tabele */
.data-table th{
  font-size:9.5px!important;
  line-height:1.25!important;
  font-weight:800!important;
  letter-spacing:.06em!important;
}
.data-table td{
  font-size:11.5px!important;
  line-height:1.45!important;
}
.data-table td small{
  font-size:9.5px!important;
  line-height:1.35!important;
}

/* Chat */
.bubble,
.composer textarea{
  font-size:14px!important;
  line-height:1.65!important;
}
.note{
  font-size:10.5px!important;
  line-height:1.35!important;
}
.actions button{
  font-size:12px!important;
}

/* Automatyzacje / AI */
.automation-copy p,
.ai-approval-copy p,
.ai-policy-copy p,
.order-panel-sub,
.knowledge-item-date{
  font-size:10.5px!important;
  line-height:1.5!important;
}
.automation-meta span,
.ai-approval-meta span,
.integration-feature,
.tag,
.source-tag{
  font-size:9px!important;
  line-height:1.25!important;
}
.ai-control-kpi span,
.biz-kpi span,
.finance-kpi span,
.trend-kpi span{
  font-size:9.5px!important;
  letter-spacing:.05em!important;
}
.ai-control-kpi strong,
.biz-kpi strong,
.finance-kpi strong,
.trend-kpi strong{
  font-weight:700!important;
}

/* Lepszy kontrast tekstów pomocniczych bez psucia motywu */
.panel-copy p,
.sub,
.card span,
.customer-main span,
.customer-contact b,
.data-table td small,
.automation-copy p,
.ai-approval-copy p,
.ai-policy-copy p,
.order-panel-sub,
.pc span{
  color:color-mix(in srgb,var(--theme-text) 62%,var(--theme-muted))!important;
}

/* W Light ciemny tekst ma zostać czytelny */
html[data-theme-light="true"] .panel-copy p,
html[data-theme-light="true"] .sub,
html[data-theme-light="true"] .card span,
html[data-theme-light="true"] .customer-main span,
html[data-theme-light="true"] .customer-contact b,
html[data-theme-light="true"] .data-table td small,
html[data-theme-light="true"] .automation-copy p,
html[data-theme-light="true"] .ai-approval-copy p,
html[data-theme-light="true"] .ai-policy-copy p,
html[data-theme-light="true"] .order-panel-sub,
html[data-theme-light="true"] .pc span{
  color:var(--theme-muted)!important;
}

/* Mobilnie nie zmniejszamy tekstu za mocno */
@media(max-width:720px){
  .nav{font-size:13px!important}
  .item{font-size:12.5px!important}
  .panel-copy p,.sub{font-size:12.5px!important}
  .data-table td{font-size:11.5px!important}
}

/* =========================================================
   AUTH / LOGIN — neutral, independent from company theme
   ========================================================= */
.login-screen{
  position:fixed;
  inset:0;
  z-index:9999;
  display:grid;
  place-items:center;
  padding:24px;
  background:#111315;
  color:#f3f4f5;
  font-family:Inter,"Segoe UI Variable","Segoe UI",Arial,sans-serif;
}
.login-screen.hidden{display:none!important}
.auth-locked{display:none!important}
.login-card{
  width:min(420px,100%);
  border:1px solid #30343a;
  background:#191c20;
  border-radius:18px;
  padding:30px;
  box-shadow:0 30px 90px rgba(0,0,0,.35);
}
.login-brand{
  font-size:13px;
  font-weight:800;
  letter-spacing:.16em;
  color:#e4e6e8;
}
.login-kicker{
  margin-top:28px;
  font-size:9px;
  font-weight:800;
  letter-spacing:.12em;
  color:#8b929a;
}
.login-card h1{
  margin:6px 0 7px!important;
  font-size:31px!important;
  line-height:1.08!important;
  letter-spacing:-.035em!important;
  color:#fff!important;
}
.login-card>p{
  margin:0 0 24px;
  color:#a4abb2!important;
  font-size:12px!important;
  line-height:1.55!important;
}
.login-card form{display:grid;gap:8px}
.login-card label{
  margin-top:8px;
  color:#c5c9ce!important;
  font-size:10px!important;
  font-weight:650;
}
.login-card input{
  width:100%;
  height:44px;
  border-radius:10px;
  border:1px solid #373c43!important;
  background:#121417!important;
  color:#f4f5f6!important;
  padding:0 12px;
  outline:0;
  font-size:13px!important;
  box-shadow:none!important;
}
.login-card input:focus{border-color:#747c86!important}
.login-password-row{position:relative}
.login-password-row input{padding-right:48px}
.login-eye{
  position:absolute;
  right:6px;
  top:5px;
  width:34px;
  height:34px;
  border-radius:8px;
  background:transparent;
  color:#939aa2;
}
.login-eye:hover{background:#23272c;color:#fff}
.login-submit{
  height:44px;
  margin-top:12px;
  border-radius:10px;
  background:#f0f2f4;
  color:#151719;
  font-size:12px;
  font-weight:750!important;
}
.login-submit:hover{background:#fff}
.login-error,.form-error{
  padding:9px 10px;
  border-radius:9px;
  border:1px solid #5b3333;
  background:#2b1d1d;
  color:#e9a3a3;
  font-size:10px;
}
.login-foot{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-top:24px;
  padding-top:14px;
  border-top:1px solid #2a2e33;
  color:#757d85;
  font-size:9px;
}

/* =========================================================
   Layout alignment v5
   ========================================================= */
.app{
  width:100vw!important;
  height:100vh!important;
  overflow:hidden!important;
}
.sidebar{
  width:264px!important;
  min-width:264px!important;
  padding:14px 14px 12px!important;
  overflow:hidden!important;
}
.sidebar .brandrow{padding:0 4px 8px!important}
.sidebar .navs{
  padding:8px 4px 8px 0!important;
  margin:4px 0 0!important;
}
.sidebar .navgroup-label{
  padding:12px 10px 5px!important;
  font-size:9px!important;
}
.sidebar .nav{
  width:100%!important;
  height:36px!important;
  min-height:36px!important;
  padding:0 11px!important;
  gap:9px!important;
  font-size:12px!important;
}
.sidebar .history{
  max-height:150px!important;
  margin-top:5px!important;
}
.sidebar .history .label{
  padding:9px 10px 4px!important;
  font-size:9px!important;
}
.sidebar .history .item{
  height:32px!important;
  font-size:11px!important;
  padding:0 10px!important;
}
.main{
  min-width:0!important;
  overflow:hidden!important;
}
.top{
  height:64px!important;
  min-height:64px!important;
  padding:0 26px!important;
}
#controlViews{
  inset:64px 0 0!important;
  padding:0 0 48px!important;
}
.control-view{
  width:min(1220px,calc(100% - 48px))!important;
  padding:30px 0 60px!important;
}
.panel-head{
  margin-bottom:20px!important;
}
.module-toolbar,.team-toolbar{
  min-height:44px;
  align-items:stretch!important;
}
.module-search{
  min-height:44px!important;
}
.module-search input{
  height:42px!important;
}
.module-toolbar select,.team-toolbar select{
  height:44px!important;
}

/* Hide chat composer in business modules — it was covering cards */
.app.module-view .composerwrap{display:none!important}
.app.module-view #sessionList{display:none!important}
.app:not(.module-view) .composerwrap{display:block}

/* Customer page alignment */
.customer-grid{
  grid-template-columns:repeat(3,minmax(290px,1fr))!important;
  gap:14px!important;
}
.customer-card{
  min-height:338px!important;
  padding:16px!important;
}
.customer-top{
  grid-template-columns:44px minmax(0,1fr) auto!important;
  min-height:55px!important;
}
.customer-avatar{
  width:44px!important;
  height:44px!important;
}
.customer-contact{
  min-height:78px!important;
  padding:12px 0!important;
}
.customer-metrics{
  grid-template-columns:.82fr 1.08fr 1.12fr!important;
  gap:7px!important;
}
.customer-metric{
  min-height:60px!important;
  padding:9px!important;
}
.customer-metric span{
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  line-height:1.25!important;
}
.customer-metric strong{
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  line-height:1.3!important;
}
.customer-card .price-row{
  min-height:46px!important;
  align-items:center!important;
}

/* Bottom authenticated profile */
.auth-profile{
  position:relative;
  border:1px solid transparent;
}
.auth-profile:hover{
  border-color:var(--theme-line)!important;
  background:var(--theme-surface-2)!important;
}
.profile-logout{
  width:31px;
  height:31px;
  border-radius:8px;
  background:transparent;
  color:var(--theme-muted);
  font-size:15px;
}
.profile-logout:hover{
  background:var(--theme-hover);
  color:var(--theme-accent);
}

/* =========================================================
   Users & roles
   ========================================================= */
.access-mode-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  padding:17px 18px;
  margin-bottom:12px;
  border:1px solid var(--theme-line);
  border-radius:15px;
  background:var(--theme-surface);
}
.access-mode-copy{max-width:760px}
.access-mode-copy strong{
  display:block;
  margin-top:3px;
  font-size:14px!important;
}
.access-mode-copy p{
  margin:5px 0 0;
  color:var(--theme-muted)!important;
  font-size:11px!important;
  line-height:1.5!important;
}
.big-switch{
  flex:none;
  width:50px;
  height:28px;
  position:relative;
}
.big-switch input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.big-switch span{
  position:absolute;
  inset:0;
  border-radius:999px;
  border:1px solid var(--theme-line);
  background:var(--theme-surface-2);
  cursor:pointer;
  transition:.15s;
}
.big-switch span:after{
  content:"";
  position:absolute;
  width:20px;
  height:20px;
  top:3px;
  left:4px;
  border-radius:50%;
  background:var(--theme-muted);
  transition:.15s;
}
.big-switch input:checked + span{
  background:var(--theme-accent-soft);
  border-color:var(--theme-accent);
}
.big-switch input:checked + span:after{
  left:24px;
  background:var(--theme-accent);
}
.team-summary{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:9px;
  margin-bottom:12px;
}
.team-summary-card{
  border:1px solid var(--theme-line);
  background:var(--theme-surface);
  border-radius:12px;
  padding:12px 13px;
}
.team-summary-card span{
  display:block;
  color:var(--theme-muted);
  font-size:9px;
  text-transform:uppercase;
  letter-spacing:.06em;
}
.team-summary-card strong{
  display:block;
  margin-top:5px;
  font-size:17px!important;
}
.team-toolbar{
  display:flex;
  gap:8px;
  margin-bottom:12px;
}
.team-toolbar .module-search{flex:1}
.team-toolbar select{
  min-width:190px;
  border:1px solid var(--theme-line);
  border-radius:10px;
  background:var(--theme-input);
  color:var(--theme-text);
  padding:0 10px;
}
.users-grid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:12px!important;
}
.user-card{
  min-width:0;
  padding:15px!important;
  display:flex;
  flex-direction:column;
  gap:11px;
}
.user-card-head{
  display:grid;
  grid-template-columns:42px minmax(0,1fr) auto;
  gap:10px;
  align-items:start;
}
.user-card-login{
  margin-top:4px;
  color:var(--theme-muted);
  font-size:10px;
}
.user-card-meta{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:7px;
}
.user-meta-box{
  min-width:0;
  border:1px solid var(--theme-line);
  background:var(--theme-bg);
  border-radius:9px;
  padding:9px;
}
.user-meta-box span{
  display:block;
  font-size:8px;
  color:var(--theme-muted);
  text-transform:uppercase;
  letter-spacing:.05em;
}
.user-meta-box strong{
  display:block;
  margin-top:4px;
  font-size:10px!important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.user-role-select{
  width:100%;
  height:36px;
  border:1px solid var(--theme-line);
  background:var(--theme-input);
  color:var(--theme-text);
  border-radius:8px;
  padding:0 9px;
  font-size:10px!important;
}
.user-card-actions{
  display:flex;
  justify-content:space-between;
  gap:7px;
  margin-top:auto;
  padding-top:4px;
}
.user-card-actions>div{display:flex;gap:6px}
.user-card-actions button{
  min-height:31px;
  padding:0 9px;
  border-radius:8px;
  background:var(--theme-surface-2);
  color:var(--theme-text);
  border:1px solid var(--theme-line);
  font-size:9px;
}
.user-card-actions button:hover{
  color:var(--theme-accent);
  border-color:color-mix(in srgb,var(--theme-accent) 35%,var(--theme-line));
}
.user-card-actions .danger-user:hover{
  color:#e98d80;
  border-color:#71413b;
}
.user-card-actions .protected-user{
  color:var(--theme-muted);
  cursor:default;
}
.user-status-dot{
  display:inline-flex;
  align-items:center;
  gap:5px;
  font-size:9px;
  color:var(--theme-muted);
}
.user-status-dot:before{
  content:"";
  width:6px;
  height:6px;
  border-radius:50%;
  background:#6c756e;
}
.user-status-dot.active:before{background:var(--theme-accent)}
.user-modal-box{width:min(620px,100%)!important}
.user-form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:0 12px;
}
.user-form-wide{grid-column:1/-1}
.user-form-note{
  margin:2px 0 13px;
  padding:9px 10px;
  border-left:2px solid var(--theme-line);
  background:var(--theme-surface-2);
  color:var(--theme-muted);
  font-size:9px;
  line-height:1.45;
}

/* Better responsive behavior */
@media(max-width:1180px){
  .customer-grid,.users-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:760px){
  .sidebar{width:280px!important;min-width:280px!important}
  .control-view{width:calc(100% - 28px)!important}
  .customer-grid,.users-grid,.team-summary{grid-template-columns:1fr!important}
  .team-toolbar,.access-mode-card{flex-direction:column;align-items:stretch}
  .team-toolbar select{min-width:0}
  .user-form-grid{grid-template-columns:1fr}
  .user-form-wide{grid-column:auto}
}

.access-hidden{display:none!important}
html[data-theme-light="true"] .access-mode-card,
html[data-theme-light="true"] .team-summary-card,
html[data-theme-light="true"] .user-card,
html[data-theme-light="true"] .user-meta-box,
html[data-theme-light="true"] .user-form-note{
  background:var(--theme-surface)!important;
  border-color:var(--theme-line)!important;
  color:var(--theme-text)!important;
}
html[data-theme-light="true"] .user-meta-box,
html[data-theme-light="true"] .user-form-note{
  background:var(--theme-surface-2)!important;
}

/* =========================================================
   Integracje — panel konfiguracji API
   ========================================================= */
.integration-security-note{
  display:flex;
  gap:11px;
  align-items:flex-start;
  margin-bottom:12px;
  padding:12px 13px;
  border:1px solid var(--theme-line);
  border-radius:12px;
  background:var(--theme-surface);
}
.integration-security-icon{
  width:32px;
  height:32px;
  flex:none;
  display:grid;
  place-items:center;
  border-radius:9px;
  background:var(--theme-accent-soft);
  color:var(--theme-accent);
  font-size:14px;
}
.integration-security-note strong{
  display:block;
  font-size:11px!important;
}
.integration-security-note span{
  display:block;
  margin-top:3px;
  color:var(--theme-muted);
  font-size:9.5px;
  line-height:1.45;
}
.integration-workspace{
  display:grid;
  grid-template-columns:350px minmax(0,1fr);
  gap:12px;
  align-items:start;
}
.integration-picker-panel,
.integration-config-panel{
  border:1px solid var(--theme-line);
  border-radius:16px;
  background:var(--theme-surface);
}
.integration-picker-panel{
  padding:13px;
  position:sticky;
  top:14px;
}
.integration-picker-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding:3px 3px 12px;
}
.integration-picker-head>div>strong{
  display:block;
  margin-top:2px;
  font-size:13px!important;
}
.integration-single-badge{
  flex:none;
  padding:5px 7px;
  border-radius:999px;
  background:var(--theme-accent-soft);
  color:var(--theme-accent);
  font-size:8px;
  font-weight:800;
}
.integration-active-bar{
  margin-bottom:9px!important;
  padding:10px!important;
}
.integration-picker-list{
  display:grid;
  gap:7px;
}
.integration-picker-item{
  width:100%;
  min-width:0;
  display:grid;
  grid-template-columns:38px minmax(0,1fr) auto;
  gap:9px;
  align-items:center;
  padding:9px;
  border:1px solid var(--theme-line);
  border-radius:11px;
  background:var(--theme-bg);
  color:var(--theme-text);
  text-align:left;
}
.integration-picker-item:hover{
  background:var(--theme-surface-2);
  border-color:color-mix(in srgb,var(--theme-accent) 28%,var(--theme-line));
}
.integration-picker-item.selected{
  background:var(--theme-accent-soft);
  border-color:color-mix(in srgb,var(--theme-accent) 52%,var(--theme-line));
}
.integration-picker-item .integration-logo{
  width:38px!important;
  height:38px!important;
  margin:0!important;
}
.integration-picker-copy{
  min-width:0;
}
.integration-picker-copy strong{
  display:block;
  font-size:10.5px!important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.integration-picker-copy span{
  display:block;
  margin-top:3px;
  color:var(--theme-muted);
  font-size:8.5px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.integration-picker-state{
  min-width:68px;
  text-align:right;
}
.integration-picker-state b{
  display:block;
  color:var(--theme-muted);
  font-size:7.5px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.05em;
}
.integration-picker-state b.active{color:var(--theme-accent)}
.integration-picker-state small{
  display:block;
  margin-top:3px;
  color:var(--theme-muted);
  font-size:7.5px;
}
.integration-config-panel{
  min-height:600px;
  overflow:hidden;
}
.integration-config-empty{
  min-height:600px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:40px;
  text-align:center;
}
.integration-config-empty-icon{
  width:52px;
  height:52px;
  display:grid;
  place-items:center;
  margin-bottom:12px;
  border-radius:15px;
  background:var(--theme-surface-2);
  color:var(--theme-accent);
  font-size:21px;
}
.integration-config-empty strong{
  font-size:14px!important;
}
.integration-config-empty span{
  max-width:360px;
  margin-top:6px;
  color:var(--theme-muted);
  font-size:10px;
  line-height:1.55;
}
#integrationConfigForm{
  padding:17px;
}
.integration-config-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:15px;
  padding-bottom:14px;
  border-bottom:1px solid var(--theme-line);
}
.integration-config-title{
  display:flex;
  gap:11px;
  align-items:center;
}
.integration-config-logo{
  width:44px!important;
  height:44px!important;
  margin:0!important;
}
.integration-config-title h3{
  margin:2px 0 2px!important;
}
.integration-config-title>div>span{
  color:var(--theme-muted);
  font-size:9px;
}
.integration-config-state{
  padding:6px 8px;
  border-radius:999px;
  background:var(--theme-surface-2);
  color:var(--theme-muted);
  font-size:8px;
  font-weight:800;
}
.integration-config-state.configured{
  background:var(--theme-accent-soft);
  color:var(--theme-accent);
}
.integration-form-section{
  padding:16px 0;
  border-bottom:1px solid var(--theme-line);
}
.integration-form-section:last-of-type{
  border-bottom:0;
}
.integration-form-section-head{
  margin-bottom:12px;
}
.integration-form-section-head strong{
  display:block;
  font-size:12px!important;
}
.integration-form-section-head span{
  display:block;
  margin-top:3px;
  color:var(--theme-muted);
  font-size:9px;
}
.integration-form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:0 10px;
}
.integration-form-wide{
  grid-column:1/-1;
}
.integration-form-grid .field{
  margin-bottom:11px!important;
}
.integration-form-grid .field label{
  margin-bottom:6px!important;
}
.integration-form-grid input,
.integration-form-grid select,
.integration-form-grid textarea{
  width:100%;
  border:1px solid var(--theme-line)!important;
  background:var(--theme-input)!important;
  color:var(--theme-text)!important;
  border-radius:9px!important;
}
.integration-form-grid input,
.integration-form-grid select{
  height:40px!important;
  padding:0 10px!important;
}
.integration-form-grid textarea{
  padding:10px!important;
  resize:vertical;
  min-height:76px;
}
.secret-input-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 58px;
  gap:5px;
}
.secret-input-row button{
  border:1px solid var(--theme-line);
  border-radius:8px;
  background:var(--theme-surface-2);
  color:var(--theme-muted);
  font-size:8px;
}
.secret-input-row button:hover{
  color:var(--theme-accent);
  border-color:color-mix(in srgb,var(--theme-accent) 35%,var(--theme-line));
}
.integration-scope-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:7px;
}
.integration-scope{
  min-width:0;
  position:relative;
  display:grid;
  grid-template-columns:30px minmax(0,1fr);
  gap:8px;
  align-items:center;
  min-height:62px;
  padding:9px;
  border:1px solid var(--theme-line);
  border-radius:10px;
  background:var(--theme-bg);
  cursor:pointer;
}
.integration-scope:hover{
  background:var(--theme-surface-2);
}
.integration-scope input{
  position:absolute;
  right:7px;
  top:7px;
  width:auto!important;
  height:auto!important;
  accent-color:var(--theme-accent);
}
.integration-scope>span{
  width:30px;
  height:30px;
  display:grid;
  place-items:center;
  border-radius:8px;
  background:var(--theme-surface-2);
  color:var(--theme-accent);
}
.integration-scope strong{
  display:block;
  font-size:9.5px!important;
}
.integration-scope small{
  display:block;
  margin-top:2px;
  color:var(--theme-muted);
  font-size:7.5px;
  line-height:1.3;
}
.integration-form-message{
  margin-top:12px;
  padding:9px 10px;
  border-radius:9px;
  border:1px solid var(--theme-line);
  background:var(--theme-surface-2);
  color:var(--theme-muted);
  font-size:9px;
}
.integration-form-message.ok{
  border-color:color-mix(in srgb,var(--theme-accent) 35%,var(--theme-line));
  color:var(--theme-accent);
}
.integration-form-message.error{
  border-color:#653d37;
  color:#e99b8d;
}
.integration-config-actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:9px;
  padding-top:14px;
}
.integration-config-actions>div{
  display:flex;
  gap:7px;
}
html[data-theme-light="true"] .integration-security-note,
html[data-theme-light="true"] .integration-picker-panel,
html[data-theme-light="true"] .integration-config-panel,
html[data-theme-light="true"] .integration-picker-item,
html[data-theme-light="true"] .integration-scope{
  border-color:var(--theme-line)!important;
}
@media(max-width:1050px){
  .integration-workspace{grid-template-columns:1fr}
  .integration-picker-panel{position:static}
  .integration-picker-list{grid-template-columns:repeat(2,minmax(0,1fr))}
  .integration-config-empty{min-height:260px}
  .integration-config-panel{min-height:0}
}
@media(max-width:700px){
  .integration-picker-list{grid-template-columns:1fr}
  .integration-form-grid,.integration-scope-grid{grid-template-columns:1fr}
  .integration-form-wide{grid-column:auto}
  .integration-config-actions{flex-direction:column;align-items:stretch}
  .integration-config-actions>div{display:grid;grid-template-columns:1fr}
  .integration-config-actions button{width:100%}
}

/* Admin: loginy i hasła użytkowników */
.user-credentials{
  display:grid;
  gap:6px;
  padding:9px 10px;
  border:1px solid var(--theme-line);
  border-radius:10px;
  background:var(--theme-bg);
}
.credential-row{
  min-width:0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.credential-row>span{
  flex:none;
  color:var(--theme-muted);
  font-size:8px;
  font-weight:800;
  letter-spacing:.06em;
}
.credential-value{
  min-width:0;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:5px;
}
.credential-value code{
  max-width:150px;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--theme-text);
  font-family:ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace;
  font-size:9px;
}
.credential-value button{
  width:27px;
  height:27px;
  flex:none;
  border:1px solid var(--theme-line);
  border-radius:7px;
  background:var(--theme-surface-2);
  color:var(--theme-muted);
  font-size:10px;
}
.credential-value button:hover{
  color:var(--theme-accent);
  border-color:color-mix(in srgb,var(--theme-accent) 35%,var(--theme-line));
}
html[data-theme-light="true"] .user-credentials{
  background:var(--theme-surface-2)!important;
  border-color:var(--theme-line)!important;
}

/* =========================================================
   Zadania — pełny panel dodawania i zarządzania
   ========================================================= */
.task-overview{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin-bottom:10px;
}
.task-overview-card{
  padding:11px 12px;
  border:1px solid var(--theme-line);
  border-radius:11px;
  background:var(--theme-surface);
}
.task-overview-card span{
  display:block;
  color:var(--theme-muted);
  font-size:8.5px;
  font-weight:800;
  letter-spacing:.055em;
  text-transform:uppercase;
}
.task-overview-card strong{
  display:block;
  margin-top:5px;
  font-size:17px!important;
}
.task-overview-card small{
  display:block;
  margin-top:3px;
  color:var(--theme-muted);
  font-size:8.5px;
}
.task-toolbar{
  display:flex;
  gap:8px;
  align-items:stretch;
  margin-bottom:11px;
}
.task-toolbar .module-search{flex:1}
.task-toolbar select{
  min-width:165px;
  height:44px;
  padding:0 10px;
  border:1px solid var(--theme-line);
  border-radius:10px;
  background:var(--theme-input);
  color:var(--theme-text);
}
.task-columns{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:10px!important;
}
.task-column{
  min-width:0;
  min-height:470px!important;
  padding:10px!important;
  background:var(--theme-surface)!important;
  border:1px solid var(--theme-line)!important;
  border-radius:14px!important;
}
.task-column-head{
  display:flex!important;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:4px 4px 10px!important;
  color:var(--theme-muted)!important;
  font-size:9px!important;
  font-weight:800!important;
  letter-spacing:.07em!important;
}
.task-column-head b{
  min-width:22px;
  height:22px;
  padding:0 6px;
  display:grid;
  place-items:center;
  border-radius:999px;
  background:var(--theme-surface-2);
  color:var(--theme-text);
  font-size:9px;
}
.task-list{
  display:grid;
  gap:7px;
}
.task-card{
  margin:0!important;
  padding:12px!important;
  border:1px solid var(--theme-line)!important;
  border-radius:11px!important;
  background:var(--theme-bg)!important;
}
.task-card:hover{
  border-color:color-mix(in srgb,var(--theme-accent) 28%,var(--theme-line))!important;
}
.task-card-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
}
.task-card-title{
  min-width:0;
}
.task-card-title strong{
  display:block;
  font-size:11px!important;
  line-height:1.4!important;
}
.task-card-title p{
  display:-webkit-box;
  margin:5px 0 0;
  overflow:hidden;
  color:var(--theme-muted)!important;
  font-size:9px!important;
  line-height:1.45!important;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
}
.task-priority{
  flex:none;
  padding:4px 6px;
  border-radius:999px;
  font-size:7.5px;
  font-weight:800;
}
.task-priority.high{background:#2b1918;color:#f09a86}
.task-priority.medium{background:#282116;color:#e7ba61}
.task-priority.low{background:var(--theme-accent-soft);color:var(--theme-accent)}
.task-card-meta{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  margin-top:9px;
}
.task-card-meta span{
  display:inline-flex;
  align-items:center;
  min-height:23px;
  padding:3px 6px;
  border-radius:7px;
  background:var(--theme-surface-2);
  color:var(--theme-muted)!important;
  font-size:8px!important;
}
.task-card-meta span.overdue{
  background:#2b1918;
  color:#ef9885!important;
}
.task-card-actions{
  display:flex;
  justify-content:space-between;
  gap:6px;
  margin-top:10px;
  padding-top:9px;
  border-top:1px solid var(--theme-line);
}
.task-card-actions>div{
  display:flex;
  gap:5px;
}
.task-card-actions button{
  min-height:29px;
  padding:0 8px;
  border:1px solid var(--theme-line);
  border-radius:7px;
  background:var(--theme-surface-2);
  color:var(--theme-text);
  font-size:8px;
}
.task-card-actions button:hover{
  color:var(--theme-accent);
  border-color:color-mix(in srgb,var(--theme-accent) 34%,var(--theme-line));
}
.task-card-actions .task-delete:hover{
  color:#ee9381;
  border-color:#693b35;
}
.task-empty{
  padding:28px 10px;
  text-align:center;
  color:var(--theme-muted);
  font-size:9px;
  border:1px dashed var(--theme-line);
  border-radius:10px;
}
.task-modal-box{
  width:min(650px,100%)!important;
}
.task-form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:0 12px;
}
.task-form-wide{grid-column:1/-1}
.task-form-note{
  margin:2px 0 13px;
  padding:9px 10px;
  border-left:2px solid var(--theme-accent);
  background:var(--theme-surface-2);
  color:var(--theme-muted);
  font-size:9px;
  line-height:1.45;
}
html[data-theme-light="true"] .task-column,
html[data-theme-light="true"] .task-overview-card{
  background:var(--theme-surface)!important;
}
html[data-theme-light="true"] .task-card{
  background:var(--theme-bg)!important;
}
@media(max-width:1050px){
  .task-columns{grid-template-columns:1fr 1fr!important}
  .task-column:last-child{grid-column:1/-1}
  .task-overview{grid-template-columns:1fr 1fr}
}
@media(max-width:720px){
  .task-toolbar{flex-direction:column}
  .task-toolbar select{min-width:0}
  .task-columns,.task-overview{grid-template-columns:1fr!important}
  .task-column:last-child{grid-column:auto}
  .task-form-grid{grid-template-columns:1fr}
  .task-form-wide{grid-column:auto}
}

/* Wyrównanie ikon email / telefon w kartach klientów */
.customer-contact{
  display:grid !important;
  gap:8px !important;
  margin-top:12px !important;
  padding-top:12px !important;
}
.customer-contact a,
.customer-contact span{
  min-width:0;
  display:grid !important;
  grid-template-columns:28px minmax(0,1fr);
  align-items:center !important;
  column-gap:8px !important;
  line-height:1.2 !important;
}
.customer-contact b{
  display:block !important;
  min-width:0;
  margin:0 !important;
  line-height:1.2 !important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.contact-icon{
  width:28px !important;
  height:28px !important;
  border-radius:8px !important;
  display:grid !important;
  place-items:center !important;
  align-self:center !important;
  justify-self:start !important;
  font-size:10px !important;
}

/* =========================================================
   Akceptacje — podgląd zasad i kolejki
   ========================================================= */
.approval-overview-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin-bottom:11px;
}
.approval-overview-card{
  padding:12px 13px;
  border:1px solid var(--theme-line);
  border-radius:12px;
  background:var(--theme-surface);
}
.approval-overview-card span{
  display:block;
  color:var(--theme-muted);
  font-size:8.5px;
  font-weight:800;
  letter-spacing:.055em;
  text-transform:uppercase;
}
.approval-overview-card strong{
  display:block;
  margin-top:5px;
  font-size:18px!important;
}
.approval-overview-card small{
  display:block;
  margin-top:3px;
  color:var(--theme-muted);
  font-size:8.5px;
}
.approval-settings-card{
  margin-bottom:11px;
  padding:15px;
  border:1px solid var(--theme-line);
  border-radius:15px;
  background:var(--theme-surface);
}
.approval-settings-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:11px;
}
.approval-settings-head h3{
  margin:2px 0 0!important;
}
.approval-settings-head p{
  margin:4px 0 0;
  color:var(--theme-muted)!important;
  font-size:9.5px!important;
  line-height:1.45!important;
}
.approval-settings-head select{
  min-width:155px;
  height:38px;
  padding:0 9px;
  border:1px solid var(--theme-line);
  border-radius:9px;
  background:var(--theme-input);
  color:var(--theme-text);
}
.approval-policy-count{
  min-width:30px;
  height:30px;
  padding:0 8px;
  display:grid;
  place-items:center;
  border-radius:999px;
  background:var(--theme-accent-soft);
  color:var(--theme-accent);
  font-size:10px;
  font-weight:800;
}
.approval-policy-preview{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
}
.approval-preview-item{
  min-width:0;
  display:grid;
  grid-template-columns:36px minmax(0,1fr) auto;
  gap:9px;
  align-items:center;
  padding:10px;
  border:1px solid var(--theme-line);
  border-radius:11px;
  background:var(--theme-bg);
}
.approval-preview-icon{
  width:36px;
  height:36px;
  display:grid;
  place-items:center;
  border-radius:9px;
  background:var(--theme-accent-soft);
  color:var(--theme-accent);
  font-size:11px;
  font-weight:800;
}
.approval-preview-copy{
  min-width:0;
}
.approval-preview-copy strong{
  display:block;
  font-size:10.5px!important;
}
.approval-preview-copy span{
  display:block;
  margin-top:3px;
  color:var(--theme-muted);
  font-size:8.5px;
  line-height:1.35;
}
.approval-preview-badge{
  padding:5px 7px;
  border-radius:999px;
  background:#2a2114;
  color:#e7b95e;
  font-size:7.5px;
  font-weight:800;
  white-space:nowrap;
}
.approval-policy-empty,
.approval-page-empty{
  padding:28px 16px;
  border:1px dashed var(--theme-line);
  border-radius:11px;
  text-align:center;
  color:var(--theme-muted);
  font-size:9.5px;
}
.approval-page-queue{
  display:grid;
  gap:7px;
}
.approval-page-item{
  width:100%;
  display:grid;
  grid-template-columns:38px minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  padding:11px;
  border:1px solid var(--theme-line);
  border-radius:11px;
  background:var(--theme-bg);
  color:var(--theme-text);
  text-align:left;
  cursor:pointer;
}
.approval-page-item:hover{
  background:var(--theme-surface-2);
  border-color:color-mix(in srgb,var(--theme-accent) 30%,var(--theme-line));
}
.approval-page-item.approved{opacity:.72}
.approval-page-item.rejected{opacity:.64}
.approval-page-icon{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:var(--theme-surface-2);
  color:var(--theme-accent);
  font-size:12px;
}
.approval-page-copy{
  min-width:0;
}
.approval-page-copy strong{
  display:block;
  font-size:10.5px!important;
}
.approval-page-copy p{
  margin:4px 0 0;
  color:var(--theme-muted)!important;
  font-size:9px!important;
  line-height:1.4!important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.approval-page-copy small{
  display:block;
  margin-top:5px;
  color:var(--theme-muted);
  font-size:8px;
}
.approval-page-status{
  padding:5px 7px;
  border-radius:999px;
  background:#2a2114;
  color:#e7b95e;
  font-size:7.5px;
  font-weight:800;
  white-space:nowrap;
}
.approval-page-status.approved{
  background:var(--theme-accent-soft);
  color:var(--theme-accent);
}
.approval-page-status.rejected{
  background:#2b1918;
  color:#ee9582;
}
html[data-theme-light="true"] .approval-overview-card,
html[data-theme-light="true"] .approval-settings-card{
  background:var(--theme-surface)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme-light="true"] .approval-preview-item,
html[data-theme-light="true"] .approval-page-item{
  background:var(--theme-bg)!important;
  border-color:var(--theme-line)!important;
}
@media(max-width:900px){
  .approval-overview-grid{grid-template-columns:1fr 1fr}
  .approval-policy-preview{grid-template-columns:1fr}
}
@media(max-width:620px){
  .approval-overview-grid{grid-template-columns:1fr}
  .approval-settings-head{flex-direction:column}
  .approval-settings-head select{width:100%;min-width:0}
  .approval-page-item{grid-template-columns:36px minmax(0,1fr)}
  .approval-page-status{grid-column:1/-1;justify-self:start}
}

/* =========================================================
   Dostawy
   ========================================================= */
.delivery-ai-strip{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:13px 14px;
  margin-bottom:10px;
  border:1px solid var(--theme-line);
  border-radius:13px;
  background:var(--theme-surface);
}
.delivery-ai-copy{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.delivery-ai-icon{
  width:36px;
  height:36px;
  flex:none;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:var(--theme-accent-soft);
  color:var(--theme-accent);
  font-size:9px;
  font-weight:900;
}
.delivery-ai-copy strong{
  display:block;
  font-size:11px!important;
}
.delivery-ai-copy span{
  display:block;
  margin-top:3px;
  color:var(--theme-muted);
  font-size:9px;
  line-height:1.45;
}
.delivery-overview{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin-bottom:10px;
}
.delivery-overview-card{
  padding:11px 12px;
  border:1px solid var(--theme-line);
  border-radius:11px;
  background:var(--theme-surface);
}
.delivery-overview-card span{
  display:block;
  color:var(--theme-muted);
  font-size:8.5px;
  font-weight:800;
  letter-spacing:.055em;
  text-transform:uppercase;
}
.delivery-overview-card strong{
  display:block;
  margin-top:5px;
  font-size:17px!important;
}
.delivery-overview-card small{
  display:block;
  margin-top:3px;
  color:var(--theme-muted);
  font-size:8.5px;
}
.delivery-toolbar{
  display:flex;
  gap:8px;
  align-items:stretch;
  margin-bottom:10px;
}
.delivery-toolbar .module-search{flex:1}
.delivery-toolbar select{
  min-width:155px;
  height:44px;
  padding:0 10px;
  border:1px solid var(--theme-line);
  border-radius:10px;
  background:var(--theme-input);
  color:var(--theme-text);
}
.delivery-ai-message{
  margin-bottom:10px;
  padding:10px 11px;
  border:1px solid var(--theme-line);
  border-radius:10px;
  background:var(--theme-surface-2);
  color:var(--theme-muted);
  font-size:9px;
}
.delivery-ai-message.ok{
  color:var(--theme-accent);
  border-color:color-mix(in srgb,var(--theme-accent) 34%,var(--theme-line));
}
.delivery-ai-message.error{
  color:#ed9887;
  border-color:#694038;
}
.delivery-list{
  display:grid;
  gap:8px;
}
.delivery-card{
  display:grid;
  grid-template-columns:58px minmax(0,1.4fr) minmax(170px,.7fr) minmax(150px,.65fr) auto;
  gap:12px;
  align-items:center;
  padding:12px;
  border:1px solid var(--theme-line);
  border-radius:13px;
  background:var(--theme-surface);
}
.delivery-datebox{
  width:58px;
  min-height:58px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  border-radius:11px;
  background:var(--theme-bg);
  border:1px solid var(--theme-line);
}
.delivery-datebox strong{
  font-size:18px!important;
  line-height:1!important;
}
.delivery-datebox span{
  margin-top:3px;
  color:var(--theme-muted);
  font-size:8px;
  text-transform:uppercase;
}
.delivery-main{
  min-width:0;
}
.delivery-main strong{
  display:block;
  font-size:11px!important;
}
.delivery-main p{
  margin:4px 0 0;
  color:var(--theme-muted)!important;
  font-size:9px!important;
  line-height:1.4!important;
}
.delivery-tags{
  display:flex;
  gap:5px;
  flex-wrap:wrap;
  margin-top:7px;
}
.delivery-tags span{
  padding:4px 6px;
  border-radius:999px;
  background:var(--theme-surface-2);
  color:var(--theme-muted);
  font-size:7.5px;
}
.delivery-tags .ai{
  background:var(--theme-accent-soft);
  color:var(--theme-accent);
}
.delivery-logistics strong,
.delivery-quantity strong{
  display:block;
  font-size:10px!important;
}
.delivery-logistics span,
.delivery-quantity span{
  display:block;
  margin-top:3px;
  color:var(--theme-muted);
  font-size:8px;
}
.delivery-status{
  display:inline-flex;
  justify-content:center;
  min-width:88px;
  padding:6px 8px;
  border-radius:999px;
  font-size:8px;
  font-weight:800;
}
.delivery-status.planned{background:var(--theme-surface-2);color:var(--theme-muted)}
.delivery-status.confirmed{background:#19273b;color:#82b6ff}
.delivery-status.transit{background:#262116;color:#e7bb62}
.delivery-status.delayed{background:#2c1918;color:#ee9481}
.delivery-status.received{background:var(--theme-accent-soft);color:var(--theme-accent)}
.delivery-actions{
  display:flex;
  gap:5px;
  justify-content:flex-end;
}
.delivery-actions button{
  min-height:30px;
  padding:0 8px;
  border:1px solid var(--theme-line);
  border-radius:8px;
  background:var(--theme-surface-2);
  color:var(--theme-text);
  font-size:8px;
}
.delivery-actions button:hover{
  color:var(--theme-accent);
  border-color:color-mix(in srgb,var(--theme-accent) 35%,var(--theme-line));
}
.delivery-actions .danger:hover{
  color:#ee9582;
  border-color:#6a3d36;
}
.delivery-empty{
  padding:36px 16px;
  border:1px dashed var(--theme-line);
  border-radius:12px;
  text-align:center;
  color:var(--theme-muted);
  font-size:10px;
}
.delivery-modal-box{
  width:min(690px,100%)!important;
}
.delivery-form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:0 12px;
}
.delivery-form-wide{grid-column:1/-1}
html[data-theme-light="true"] .delivery-ai-strip,
html[data-theme-light="true"] .delivery-overview-card,
html[data-theme-light="true"] .delivery-card{
  background:var(--theme-surface)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme-light="true"] .delivery-datebox{
  background:var(--theme-bg)!important;
}
@media(max-width:1050px){
  .delivery-card{
    grid-template-columns:58px minmax(0,1fr) auto;
  }
  .delivery-logistics,.delivery-quantity{grid-column:2}
  .delivery-actions{grid-column:3;grid-row:1/4;flex-direction:column}
  .delivery-overview{grid-template-columns:1fr 1fr}
}
@media(max-width:700px){
  .delivery-ai-strip,.delivery-toolbar{flex-direction:column;align-items:stretch}
  .delivery-toolbar select{min-width:0}
  .delivery-overview{grid-template-columns:1fr}
  .delivery-card{grid-template-columns:50px minmax(0,1fr)}
  .delivery-actions{grid-column:1/-1;grid-row:auto;flex-direction:row;justify-content:flex-start}
  .delivery-logistics,.delivery-quantity{grid-column:2}
  .delivery-form-grid{grid-template-columns:1fr}
  .delivery-form-wide{grid-column:auto}
}

/* Kalendarz demo — dostawy, odbiory i inne typy wpisów */
.event-item-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
}
.event-source-badge{
  flex:none;
  padding:4px 6px;
  border-radius:999px;
  background:var(--theme-surface-2);
  color:var(--theme-muted)!important;
  font-size:7.5px!important;
  font-weight:800;
}
.event-source-delivery .event-source-badge{
  background:var(--theme-accent-soft);
  color:var(--theme-accent)!important;
}
.event-source-pickup .event-source-badge{
  background:#262116;
  color:#e7bb62!important;
}
.event-source-meeting .event-source-badge{
  background:#1c2440;
  color:#9db6ff!important;
}
.event-source-finance .event-source-badge{
  background:#291c2b;
  color:#d7a3e7!important;
}
.day.has-delivery{
  box-shadow:inset 0 -2px 0 var(--theme-accent);
}
.day.has-pickup{
  outline:1px solid color-mix(in srgb,#e7bb62 50%,transparent);
  outline-offset:-3px;
}

/* =========================================================
   Integracje usług: Gmail / Google / Outlook / IMAP
   ========================================================= */
.service-integrations-card{
  margin-top:12px;
  padding:15px;
  border:1px solid var(--theme-line);
  border-radius:16px;
  background:var(--theme-surface);
}
.service-integrations-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom:12px;
}
.service-integrations-head h3{margin:2px 0 0!important}
.service-integrations-head p{
  margin:4px 0 0;
  color:var(--theme-muted);
  font-size:9.5px;
}
.service-vps-badge{
  flex:none;
  padding:6px 8px;
  border-radius:999px;
  background:var(--theme-accent-soft);
  color:var(--theme-accent);
  font-size:7.5px;
  font-weight:900;
  letter-spacing:.05em;
}
.service-integration-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
}
.service-integration-card{
  min-width:0;
  padding:11px;
  border:1px solid var(--theme-line);
  border-radius:12px;
  background:var(--theme-bg);
}
.service-integration-top{
  display:flex;
  align-items:flex-start;
  gap:9px;
}
.service-integration-icon{
  width:38px;
  height:38px;
  flex:none;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:var(--theme-surface-2);
  color:var(--theme-accent);
  font-size:9px;
  font-weight:900;
}
.service-integration-copy{
  min-width:0;
  flex:1;
}
.service-integration-copy strong{
  display:block;
  font-size:10.5px!important;
}
.service-integration-copy span{
  display:block;
  margin-top:3px;
  color:var(--theme-muted);
  font-size:8.5px;
  line-height:1.35;
}
.service-integration-state{
  flex:none;
  padding:4px 6px;
  border-radius:999px;
  background:var(--theme-surface-2);
  color:var(--theme-muted);
  font-size:7px;
  font-weight:900;
}
.service-integration-state.on{
  background:var(--theme-accent-soft);
  color:var(--theme-accent);
}
.service-integration-features{
  display:flex;
  flex-wrap:wrap;
  gap:4px;
  margin:10px 0;
}
.service-integration-features span{
  padding:4px 6px;
  border-radius:999px;
  background:var(--theme-surface-2);
  color:var(--theme-muted);
  font-size:7.5px;
}
.service-integration-meta{
  min-height:32px;
  padding:7px 8px;
  margin-bottom:8px;
  border:1px solid var(--theme-line);
  border-radius:8px;
  color:var(--theme-muted);
  font-size:8px;
  line-height:1.35;
}
.service-integration-card button{
  width:100%;
  min-height:32px;
  border:1px solid var(--theme-line);
  border-radius:8px;
  background:var(--theme-surface-2);
  color:var(--theme-text);
  font-size:8.5px;
}
.service-integration-card button:hover{
  color:var(--theme-accent);
  border-color:color-mix(in srgb,var(--theme-accent) 35%,var(--theme-line));
}
.service-integration-modal-box{
  width:min(660px,100%)!important;
}
.service-secret-note{
  margin-bottom:12px;
  padding:10px 11px;
  border-left:2px solid var(--theme-accent);
  border-radius:8px;
  background:var(--theme-surface-2);
}
.service-secret-note strong{
  display:block;
  font-size:10px!important;
}
.service-secret-note span{
  display:block;
  margin-top:4px;
  color:var(--theme-muted);
  font-size:8.5px;
  line-height:1.45;
}
.service-form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:0 10px;
}
.service-form-wide{grid-column:1/-1}
.service-enable-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px;
  margin:3px 0 13px;
  padding:10px;
  border:1px solid var(--theme-line);
  border-radius:10px;
  background:var(--theme-bg);
}
.service-enable-row strong{
  display:block;
  font-size:10px!important;
}
.service-enable-row > div > span{
  display:block;
  margin-top:3px;
  color:var(--theme-muted);
  font-size:8px;
}
.service-enable-row .big-switch{
  display:block;
  width:50px;
  height:28px;
  margin:0;
  flex:0 0 50px;
  align-self:center;
}
.service-enable-row .big-switch > span{
  display:block;
  margin:0;
  color:inherit;
  font-size:0;
}
html[data-theme-light="true"] .service-integrations-card{background:var(--theme-surface)!important}
html[data-theme-light="true"] .service-integration-card,
html[data-theme-light="true"] .service-enable-row{background:var(--theme-bg)!important}
@media(max-width:1050px){
  .service-integration-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:700px){
  .service-integration-grid,.service-form-grid{grid-template-columns:1fr}
  .service-form-wide{grid-column:auto}
  .service-integrations-head{flex-direction:column}
}

/* Wyraźny przycisk wylogowania */
.profile.auth-profile{gap:8px!important}
.profile.auth-profile .pc{min-width:0!important;flex:1 1 auto!important}
.profile-logout.logout-visible{
  width:auto!important;min-width:78px!important;height:32px!important;padding:0 10px!important;
  display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;
  flex:0 0 auto!important;border:1px solid var(--theme-line)!important;border-radius:8px!important;
  background:var(--theme-surface-2)!important;color:var(--theme-muted)!important;
  font-size:9px!important;font-weight:700!important;white-space:nowrap!important
}
.profile-logout.logout-visible:hover{
  background:var(--theme-hover)!important;color:var(--theme-text)!important;
  border-color:color-mix(in srgb,var(--theme-accent) 30%,var(--theme-line))!important
}

/* Chat attachments */
.chat-attachments{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin:0 8px 7px;
  padding:8px;
  border:1px solid var(--theme-line,#2a302b);
  border-radius:13px;
  background:color-mix(in srgb,var(--theme-surface,#111512) 94%,transparent);
  box-shadow:0 10px 30px rgba(0,0,0,.18);
}
.chat-attachment-chip{
  max-width:245px;
  height:38px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:5px 7px 5px 6px;
  border:1px solid var(--theme-line,#303830);
  border-radius:10px;
  background:var(--theme-surface-2,#171c18);
  color:var(--theme-text,#eef2ef);
}
.chat-attachment-thumb{
  width:28px;
  height:28px;
  border-radius:7px;
  object-fit:cover;
  background:var(--theme-bg,#0b0d0c);
  display:grid;
  place-items:center;
  flex:none;
  font-size:13px;
  color:var(--theme-muted,#858d87);
  overflow:hidden;
}
.chat-attachment-meta{min-width:0;display:flex;flex-direction:column;line-height:1.15}
.chat-attachment-meta strong{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-attachment-meta span{font-size:8.5px;color:var(--theme-muted,#858d87);margin-top:3px}
.chat-attachment-remove{width:24px;height:24px;border-radius:7px;background:transparent;color:var(--theme-muted,#858d87);font-size:15px;flex:none}
.chat-attachment-remove:hover{background:var(--theme-hover,#202620);color:var(--theme-text,#fff)}
.composer.file-drag{border-color:var(--theme-accent,#68ff79)!important;box-shadow:0 0 0 2px color-mix(in srgb,var(--theme-accent,#68ff79) 12%,transparent),0 16px 50px #0009!important}
.attach-btn.has-files{background:var(--theme-accent-soft,#16371b)!important;color:var(--theme-accent,#68ff79)!important}
.msg-attachments{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;justify-content:flex-end}
.row.bot .msg-attachments{justify-content:flex-start}
.msg-file-chip{display:inline-flex;align-items:center;gap:6px;max-width:260px;padding:6px 8px;border:1px solid var(--theme-line,#303830);border-radius:9px;background:var(--theme-surface-2,#171c18);font-size:9.5px;color:var(--theme-muted,#858d87)}
.msg-file-chip strong{color:var(--theme-text,#eef2ef);font-size:9.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:190px}
@media(max-width:720px){.chat-attachment-chip{max-width:100%;flex:1 1 100%}.chat-attachments{margin:0 4px 6px}.composer textarea{font-size:13px}}

.user-message-stack{display:flex;flex-direction:column;align-items:flex-end;max-width:78%;min-width:0}
.user-message-stack .bubble{max-width:100%!important}

/* === Nexora chat animation polish === */
.row.bot.is-thinking .botmark,
.row.bot.is-revealing .botmark{
  animation:nexoraLogoFloat 1.6s ease-in-out infinite;
}
.row.bot.is-thinking .bot-logo,
.row.bot.is-revealing .bot-logo{
  transform-origin:center;
  filter:drop-shadow(0 0 8px color-mix(in srgb, var(--theme-accent) 28%, transparent));
}
.row.bot.is-thinking .bot-logo{
  animation:nexoraLogoBlink 1.1s ease-in-out infinite;
}
.row.bot.is-revealing .bot-logo{
  animation:nexoraLogoBlink 1.8s ease-in-out infinite;
}
.typing-shell{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  border:1px solid color-mix(in srgb, var(--theme-line) 78%, transparent);
  background:linear-gradient(180deg,color-mix(in srgb, var(--theme-surface2) 92%, transparent),color-mix(in srgb, var(--theme-surface) 96%, transparent));
  border-radius:16px 16px 16px 6px;
  box-shadow:0 10px 26px rgba(0,0,0,.16);
}
.typing-label{
  font-size:12px;
  font-weight:700;
  letter-spacing:.01em;
  color:var(--theme-text);
  opacity:.92;
}
.typing-dots{
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.typing-dots i{
  width:7px;
  height:7px;
  border-radius:999px;
  background:var(--theme-accent);
  opacity:.35;
  transform:translateY(0) scale(.88);
  animation:nexoraTypingDot 1s infinite ease-in-out;
}
.typing-dots i:nth-child(2){animation-delay:.16s}
.typing-dots i:nth-child(3){animation-delay:.32s}
.bubble.is-revealing{
  position:relative;
}
.bubble.is-revealing::after{
  content:'';
  display:inline-block;
  width:8px;
  height:1.05em;
  margin-left:3px;
  border-right:2px solid color-mix(in srgb, var(--theme-accent) 72%, var(--theme-text));
  vertical-align:-2px;
  animation:nexoraCaretBlink 1s steps(1) infinite;
}
@keyframes nexoraTypingDot{
  0%,80%,100%{opacity:.28;transform:translateY(0) scale(.86)}
  40%{opacity:1;transform:translateY(-3px) scale(1)}
}
@keyframes nexoraCaretBlink{
  0%,49%{opacity:1}
  50%,100%{opacity:0}
}
@keyframes nexoraLogoBlink{
  0%,100%{opacity:.7;transform:scale(.96)}
  45%{opacity:1;transform:scale(1.06)}
  60%{opacity:.9;transform:scale(1.01)}
}
@keyframes nexoraLogoFloat{
  0%,100%{transform:translateY(0)}
  50%{transform:translateY(-2px)}
}


.generic-action-payload{margin-top:12px;white-space:pre-wrap;word-break:break-word;border:1px solid var(--theme-line);background:var(--theme-surface-2);border-radius:12px;padding:12px;color:var(--theme-muted);font-size:10px;line-height:1.55;max-height:260px;overflow:auto}
