/* SAJ- Intelligence shared product components. All selectors are IQ workspace scoped. */
:root{
 --saj-font:Inter,"Noto Sans Arabic",-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
 --saj-text-xs:.8125rem;--saj-text-sm:.875rem;--saj-text-md:1rem;--saj-text-lg:1.125rem;
 --saj-space-1:4px;--saj-space-2:8px;--saj-space-3:12px;--saj-space-4:16px;--saj-space-5:20px;--saj-space-6:24px;--saj-space-8:32px;
 --saj-radius-sm:10px;--saj-radius-md:14px;--saj-radius-lg:20px;
 --saj-surface-subtle:#f8f9fc;--saj-border-strong:#b4bfd2;--saj-success:#14684f;--saj-success-bg:#eaf7f0;
 --saj-warning:#76500e;--saj-warning-bg:#fff6e4;--saj-danger:#a32e3d;--saj-danger-bg:#fff0f1;
 --saj-shadow:0 3px 12px #202b5005;--saj-shadow-raised:0 10px 30px #202b5010;
 --navy:var(--saj-brand);--line:var(--saj-line);--muted:var(--saj-muted);
}
body{font-family:var(--saj-font);font-size:var(--saj-text-md);-webkit-font-smoothing:antialiased}
#content{max-width:1600px;line-height:1.55}#content:focus{outline:none}
#content :is(h1,h2,h3,h4){color:var(--saj-ink);overflow-wrap:anywhere}
#content h1{font-weight:700;font-size:clamp(24px,2.4vw,32px);letter-spacing:-.65px;line-height:1.3}
#content h2{font-size:1.0625rem;line-height:1.45;font-weight:600}#content h3{font-size:0.9375rem;line-height:1.5;font-weight:600}
#content p,#modal-body p{font-size:0.8125rem;line-height:1.75}#content :is(small,.small),#modal-body .small{font-size:0.8125rem;line-height:1.6;color:var(--saj-muted)}
#content .quiet{color:var(--saj-muted)}#content>.eyebrow{margin-bottom:8px;letter-spacing:.12em}
#content .page-heading{padding-bottom:20px;margin-bottom:24px;border-bottom:1px solid var(--saj-line);align-items:center;flex-wrap:wrap}
#content .page-heading>div{flex:1 1 260px;min-width:0}#content .page-heading p{max-width:760px;margin-top:6px}
#content :is(.primary,.secondary,.danger),#modal-body :is(.primary,.secondary,.danger),.dialog-footer button{
 min-height:44px;border-radius:var(--saj-radius-sm);padding:10px 16px;font-size:0.8125rem;font-weight:600;line-height:1.4;gap:8px;white-space:normal;text-align:center;transition:background .15s,border-color .15s,box-shadow .15s;
}
#content .primary,#modal-body .primary{background:var(--saj-brand);border-color:var(--saj-brand);color:white;box-shadow:0 2px 3px #252f6812}
#content .primary:hover:not(:disabled),#modal-body .primary:hover:not(:disabled){background:#1b2454;box-shadow:0 4px 10px #252f6820}
#content .secondary,#modal-body .secondary{background:var(--saj-surface);color:var(--saj-ink);border-color:var(--saj-line)}
#content .secondary:hover:not(:disabled),#modal-body .secondary:hover:not(:disabled){background:var(--saj-surface-subtle);border-color:var(--saj-border-strong)}
#content .danger,#modal-body .danger{color:var(--saj-danger);background:var(--saj-surface);border-color:#e8bfc6}
#content .danger:hover:not(:disabled),#modal-body .danger:hover:not(:disabled){background:var(--saj-danger-bg)}
#content button:disabled,#modal-body button:disabled{cursor:not-allowed}#content .saj-icon,#modal-body .saj-icon{width:19px;height:19px;flex-basis:19px}
#content :is(input,select,textarea),#modal-body :is(input,select,textarea){font-family:var(--saj-font);font-size:0.875rem;color:var(--saj-ink);border-color:var(--saj-line);border-radius:var(--saj-radius-sm);padding:11px 12px;line-height:1.5;min-width:0;background:var(--saj-surface)}
#content :is(input,select),#modal-body :is(input,select){min-height:46px}#content textarea,#modal-body textarea{min-height:112px}
#content :is(input,select,textarea):hover:not(:disabled),#modal-body :is(input,select,textarea):hover:not(:disabled){border-color:var(--saj-border-strong)}
#content :is(input,select,textarea):focus,#modal-body :is(input,select,textarea):focus{border-color:var(--saj-focus);box-shadow:0 0 0 3px #315bd510}
#content :is(input,select,textarea):disabled,#modal-body :is(input,select,textarea):disabled{background:#f0f2f7;color:var(--saj-muted)}
#content input::placeholder,#content textarea::placeholder,#modal-body input::placeholder{color:#68768e;opacity:1}
#content label,#modal-body label{font-size:0.8125rem;font-weight:600;line-height:1.6;color:var(--saj-muted)}
#content .field,#modal-body .field{min-width:0;margin-bottom:16px}#content .field>label,#modal-body .field>label{margin-bottom:7px}
#content input[type=checkbox],#content input[type=radio],#modal-body input[type=checkbox],#modal-body input[type=radio]{min-height:20px;width:20px;height:20px;padding:0}
#content fieldset,#modal-body fieldset{min-width:0;border:1px solid var(--saj-line);border-radius:var(--saj-radius-md);padding:18px}
#content legend,#modal-body legend{padding-inline:8px;font-size:0.8125rem;font-weight:600;color:var(--saj-ink)}
#content .panel{border:1px solid var(--saj-line);border-radius:var(--saj-radius-lg);box-shadow:var(--saj-shadow);margin-bottom:24px;min-width:0;background:var(--saj-surface)}
#content .panel-head{padding:18px 22px;gap:12px;flex-wrap:wrap;min-width:0;background:linear-gradient(180deg,#fff,#fdfdff);border-bottom:1px solid var(--saj-line)}
#content .panel-body{padding:22px}#content .panel-head h2{font-size:0.9375rem}#content .panel-head .small{font-size:0.8125rem}
#content .panel>form:not(.filter-bar):not(.marketing-filters):not(.journey-progress-filters){padding:22px}
#content .panel>p{margin-inline:22px}#content .panel>.notice{margin:18px}
#content :is(.filter-bar,.marketing-filters,.journey-progress-filters,.foundation-form){gap:14px;padding:18px 22px;background:var(--saj-surface-subtle);border-bottom:1px solid var(--saj-line);align-items:end}
#content .filter-bar{flex-wrap:wrap}#content .filter-bar>span{display:block;margin-inline-start:auto;font-size:0.8125rem}
#content .filter-bar .field,#content .marketing-filters .field{margin:0}#content .marketing-filters button{margin:0}
#content .actions,#modal-body .actions{gap:8px;align-items:center}#content .actions button,#modal-body .actions button{min-height:44px;font-size:0.8125rem;padding:9px 12px;line-height:1.5}
#content .actions>label{margin:0}#content .badge,#modal-body .badge{font-size:0.8125rem;font-weight:600;letter-spacing:0;padding:5px 9px;border:1px solid transparent;border-radius:7px;line-height:1.35;max-width:100%;white-space:normal}
#content .badge:is(.green,.sent,.approved,.completed,.ready,.active){background:var(--saj-success-bg);color:var(--saj-success)}
#content .badge:is(.amber,.queued,.scheduled,.sending,.suspended,.high,.disconnected,.permission_missing,.check_failed,.different_endpoint){background:var(--saj-warning-bg);color:var(--saj-warning)}
#content .badge:is(.unknown,.rejected,.failed,.deactivated,.urgent){background:var(--saj-danger-bg);color:var(--saj-danger)}
#content .badge:is(.draft,.paused){color:var(--saj-muted);background:#eef1f7}
#content .notice,#modal-body .notice{border-radius:var(--saj-radius-md);padding:16px 18px;border:1px solid #dbe3fa;background:#eff3ff;color:#415277;font-size:0.8125rem;line-height:1.7;white-space:normal}
#content .notice strong,#modal-body .notice strong{color:var(--saj-brand)}#content .notice p{color:inherit;margin-bottom:0}
#content table,#modal-body table{font-size:0.8125rem;text-align:start;width:100%;border-collapse:separate;border-spacing:0}
#content :is(th,td),#modal-body :is(th,td){text-align:start;padding:15px 18px;line-height:1.6;overflow-wrap:anywhere}
#content th,#modal-body th{font-size:0.8125rem;font-weight:600;letter-spacing:.035em;color:var(--saj-muted);background:var(--saj-surface-subtle);border-bottom:1px solid var(--saj-line);text-transform:none}
#content td,#modal-body td{border-bottom:1px solid #edf0f5;border-top:0;vertical-align:top}#content tbody tr:last-child td{border-bottom:0}
#content tbody tr:hover{background:#fafbff}#content td p{margin:4px 0;font-size:0.8125rem}#content td small{font-size:0.8125rem;color:var(--saj-muted)}
#content .table-wrap,#modal-body .table-wrap{overscroll-behavior-inline:contain;border-radius:var(--saj-radius-md);scrollbar-width:thin;max-width:100%;min-width:0;outline-offset:-3px}
#content .table-wrap:focus-visible{outline:3px solid var(--saj-focus)}#content td .actions{min-width:140px}
#content .empty{display:grid;justify-items:center;align-content:center;min-height:240px;padding:36px 24px;background:linear-gradient(180deg,#fff,#fcfcff)}
#content .empty-icon{width:52px;height:52px;border-radius:16px;background:var(--saj-selected);color:var(--saj-brand);margin-bottom:16px}#content .empty-icon .saj-icon{width:25px;height:25px}
#content .empty h3{font-size:1rem;margin-bottom:0}#content .empty p{max-width:420px;margin-block:8px 20px}
#content .cards{gap:16px;margin-bottom:24px}#content .stat{border-radius:var(--saj-radius-md);padding:20px;box-shadow:var(--saj-shadow);position:relative;overflow:hidden}
#content .stat-label{color:var(--saj-muted);font-size:0.8125rem;gap:8px;align-items:center}#content .stat-label span:last-child{display:grid;place-items:center;width:32px;height:32px;flex-shrink:0;background:var(--saj-selected);color:var(--saj-brand);border-radius:10px}
#content .stat strong{font-size:2rem;line-height:1.2;color:var(--saj-ink);margin-block:12px 8px;font-variant-numeric:tabular-nums}#content .stat small{font-size:0.8125rem;color:var(--saj-muted);line-height:1.6;display:block}
#content .templates{grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:18px}
#content .template-card{padding:22px;border-radius:var(--saj-radius-lg);box-shadow:var(--saj-shadow);min-width:0;transition:border-color .15s,box-shadow .15s}
#content .template-card:hover{border-color:#bdc8df;box-shadow:var(--saj-shadow-raised)}#content .template-card h3{font-size:1rem;line-height:1.5}
#content .template-card p{font-size:0.8125rem;min-height:0;overflow-wrap:anywhere}#content .template-card .actions{padding-top:16px;margin-top:18px;gap:8px}
#content .template-meta{gap:10px;flex-wrap:wrap;margin-bottom:16px}#content .languages{font-size:0.8125rem;font-weight:600;color:var(--saj-muted)}
#content .preview,#modal-body .preview{padding:20px;border:1px solid #e0e6f5;border-radius:var(--saj-radius-md);background:#f6f8ff;font-size:0.875rem;line-height:1.85;color:var(--saj-ink)}
#content .preview-grid,#modal-body .preview-grid{gap:18px}#content .preview-title,#modal-body .preview-title{font-size:0.8125rem;font-weight:600;color:var(--saj-muted);margin-block:0 10px}
#content .knowledge-group{margin-bottom:16px}#content .knowledge-group>summary{padding:20px 22px;min-height:64px;line-height:1.6;color:var(--saj-ink);background:var(--saj-surface-subtle)}
#content .knowledge-group[open]>summary{border-bottom:1px solid var(--saj-line)}#content .knowledge-group>.templates{padding:20px}#content .category-links{padding:16px 20px;gap:8px;background:#fff}
#content .category-filters{padding:20px;background:var(--saj-surface);border:1px solid var(--saj-line);border-radius:var(--saj-radius-lg);margin-bottom:20px;gap:16px}
#content .category-filters .field{margin:0}#content .rewrite-tool{margin-block:20px;padding:18px;border:1px solid var(--saj-line);border-radius:var(--saj-radius-md);background:var(--saj-surface-subtle)}
#content .rewrite-tool h3{margin-top:0}#content .employee-actions>summary{min-height:44px;padding:10px 12px;background:var(--saj-surface-subtle);border:1px solid var(--saj-line);border-radius:10px;font-size:0.8125rem}
#content .employee-actions>div{padding:12px 0;gap:8px}#content .employee-actions button{white-space:normal;text-align:start}
#content .loading{padding:64px 24px;display:flex;flex-direction:column;align-items:center;gap:18px;font-size:0.875rem;color:var(--saj-muted)}
#content .loading::before{content:"";width:30px;height:30px;border:3px solid var(--saj-line);border-top-color:var(--saj-brand);border-radius:50%;animation:saj-spin .8s linear infinite}
@keyframes saj-spin{to{transform:rotate(360deg)}}
dialog#modal{border-radius:22px;max-width:880px;width:min(820px,calc(100vw - 32px));box-shadow:0 28px 100px #202b5038;border-color:var(--saj-line)}
#modal .dialog-head{position:sticky;top:0;z-index:1;padding:20px 24px;background:var(--saj-surface-subtle);gap:16px}#modal .dialog-head h2{font-size:1.125rem;line-height:1.5}#modal .icon{min-width:44px;min-height:44px;display:grid;place-items:center;color:var(--saj-muted);border-radius:10px;font-size:1.375rem}
#modal .icon:hover{background:var(--saj-selected)}#modal-body{padding:24px;min-width:0}#modal-body>p:first-child{margin-top:0}
#modal .dialog-footer{flex-wrap:wrap;margin-top:24px;padding-top:20px;gap:10px}#modal-body form>.notice{margin-bottom:22px}
#content .notification-card{padding:20px;border:1px solid var(--saj-line);border-radius:var(--saj-radius-md);margin-block:14px;background:var(--saj-surface);box-shadow:var(--saj-shadow)}
#content .notification-card h3{font-size:0.9375rem;display:flex;gap:10px;align-items:center;flex-wrap:wrap}#content .notification-card p{margin-block:8px}
#content .notification-actions{margin-inline-start:auto;align-self:flex-start}#content .notification-actions>summary{padding:10px 12px;border:1px solid var(--saj-line);border-radius:10px;font-size:0.8125rem;font-weight:600}
#content .notification-actions>div{display:flex;flex-wrap:wrap;gap:8px;padding-top:10px}
#content #notification-preferences{padding:0}#content:has(#notification-preferences) .panel{padding:24px}#content:has(#notification-preferences) .panel>h2{margin-bottom:20px}
#content .team-compose,#content .conversation-toolbar{background:var(--saj-surface)}#content .team-messages{background:#f7f8fc}
#content .bubble{padding:14px 16px;border-radius:16px 16px 16px 4px;box-shadow:0 2px 5px #202b5004}#content .bubble.staff,#content .bubble.outbound{border-radius:16px 16px 4px 16px}
#content .bubble p{font-size:0.875rem;line-height:1.75}#content .bubble small{font-size:0.8125rem;color:var(--saj-muted)}
.login{background:var(--saj-canvas);gap:0}.login-brand{background:radial-gradient(ellipse at 10% 5%,#44569b,transparent 65%),var(--saj-brand);padding:64px 12%;position:relative}
.login-brand img{width:72px;height:72px;object-fit:contain;border-radius:20px;background:white;padding:8px;margin-bottom:28px}.login-brand>p{font-size:0.8125rem;color:#e1e7ff;letter-spacing:.1em}.login-brand .lead{color:#e1e7ff}.login-brand h1{font-weight:600;font-size:clamp(32px,3.5vw,48px);line-height:1.25}.brand-note{color:#d6defc}
.login-panel{width:min(480px,100%);max-width:480px;margin:auto;padding:44px;background:var(--saj-surface);border:1px solid var(--saj-line);border-radius:24px;box-shadow:var(--saj-shadow-raised)}
.login-panel h2{font-size:1.875rem;font-weight:700;letter-spacing:-.6px}.login-panel .eyebrow{font-size:0.8125rem;color:var(--saj-muted)}.login-panel label{font-size:0.8125rem}.login-panel input{font-size:1rem;min-height:48px;border-radius:10px}.login-panel .primary{justify-content:center;min-height:48px;border-radius:10px;font-size:0.875rem;gap:8px}.login-panel .secondary{min-height:44px;border-radius:10px;margin-top:10px}.safe-note{font-size:0.8125rem;color:var(--saj-muted)}.login-panel .small{font-size:0.8125rem}.login-panel .remember-device input{min-height:20px}
.login-mobile-brand{display:none}#toast{
 font-size:0.8125rem;
 line-height:1.6;
 border-radius:14px;
 padding:14px 20px;
 inset-inline:16px;
 top:calc(12px + env(safe-area-inset-top,0px));
 bottom:auto;
 transform:none;
 width:fit-content;
 max-width:min(520px,calc(100vw - 32px));
 margin-inline:auto;
 box-sizing:border-box;
 white-space:pre-wrap;
 overflow-wrap:anywhere;
 word-break:normal;
 max-height:calc(100dvh - 140px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));
 overflow:auto;
 text-align:start;
}
#content .saj-record-table td::before{display:none}
[dir=rtl] #content h1{letter-spacing:0}[dir=rtl] #content .bubble{border-radius:16px 16px 4px 16px}[dir=rtl] #content .bubble.staff,[dir=rtl] #content .bubble.outbound{border-radius:16px 16px 16px 4px}
[dir=rtl] #content .employee-actions button{text-align:start}
@media(min-width:1001px) and (max-width:1100px){.main{margin-left:250px}[dir=rtl] .main{margin-left:0;margin-right:250px}}
@media(max-width:1000px){#content .page-heading h1{font-size:1.625rem}#content .page-heading{margin-bottom:20px;padding-bottom:18px}.login-panel{padding:36px}}
@media(max-width:760px){.login{padding:24px 16px;align-items:center;min-height:100dvh}.login-panel{padding:28px;border-radius:22px}.login-mobile-brand{display:flex;align-items:center;gap:12px;margin-bottom:28px}.login-mobile-brand img{width:46px;height:46px;object-fit:contain}.login-mobile-brand strong{display:block;font-size:1rem;color:var(--saj-brand);direction:ltr}.login-mobile-brand small{display:block;color:var(--saj-muted);font-size:0.8125rem;letter-spacing:.08em;margin-top:3px}.login-panel .eyebrow{font-size:0.8125rem}#content .templates{grid-template-columns:1fr}#content .category-filters{padding:16px}}
@media(max-width:600px){
 #content .page-heading{align-items:flex-start;gap:12px}#content .page-heading>div{flex-basis:100%}#content .page-heading h1{font-size:1.5625rem}#content .page-heading .primary{font-size:0.8125rem}
 #content .panel-head,#content .panel-body{padding:16px}#content .panel>p{margin-inline:16px}#content .panel>form:not(.filter-bar):not(.marketing-filters):not(.journey-progress-filters){padding:16px}
 #content :is(.filter-bar,.marketing-filters,.journey-progress-filters,.foundation-form){padding:16px;gap:12px}#content :is(input,select,textarea),#modal-body :is(input,select,textarea){font-size:1rem}
 #content .filter-bar select{width:100%;max-width:100%}#content .filter-bar>label{width:100%}#content .filter-bar>span{margin-inline-start:0;flex-basis:100%}
 #content .template-card{padding:18px}#content .category-links{padding:14px 16px}#content .knowledge-group>.templates{padding:16px}
 #content .cards{gap:12px;grid-template-columns:repeat(2,minmax(0,1fr))}#content .stat{padding:16px}#content .stat strong{font-size:1.75rem}#content .stat small{font-size:0.8125rem}
 #content .channel-card{padding:18px;gap:12px;flex-wrap:wrap}#content .channel-meta{padding:14px 18px;gap:10px;flex-wrap:wrap}
 #content .notification-card{padding:16px}#content .notification-actions{margin-inline-start:0}#content:has(#notification-preferences) .panel{padding:18px}
 dialog#modal{width:calc(100vw - 20px);border-radius:18px;max-height:calc(100dvh - 32px)}#modal .dialog-head{padding:16px}#modal-body{padding:18px}#modal .dialog-footer>button{flex:1 1 auto}
 #content .saj-record-table,#modal-body .saj-record-table{display:block;border:0;background:transparent}
 #content .saj-record-table thead,#modal-body .saj-record-table thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
 #content .saj-record-table tbody,#modal-body .saj-record-table tbody{display:grid;gap:12px;padding:14px;background:var(--saj-surface-subtle)}
 #content .saj-record-table tr,#modal-body .saj-record-table tr{display:grid;min-width:0;border:1px solid var(--saj-line);border-radius:14px;background:var(--saj-surface);padding:6px 14px;box-shadow:var(--saj-shadow)}
 #content .saj-record-table td,#modal-body .saj-record-table td{display:grid;grid-template-columns:minmax(80px,.7fr) minmax(0,1.3fr);gap:8px;padding:12px 0;border-bottom:1px solid #edf0f5;align-items:start;min-width:0;font-size:0.8125rem}
 #content .saj-record-table td::before,#modal-body .saj-record-table td::before{content:attr(data-label);display:block;font-size:0.8125rem;color:var(--saj-muted);font-weight:600;line-height:1.7}
 #content .saj-record-table td>*,#modal-body .saj-record-table td>*{min-width:0;grid-column:2}
 #content .saj-record-table td>p,#content .saj-record-table td>small{margin:0}
 #content .saj-record-table td:last-child,#modal-body .saj-record-table td:last-child{border-bottom:0}#content .saj-record-table td .actions,#modal-body .saj-record-table td .actions{min-width:0}
 body[data-saj-view=daily] #content .page-heading{align-items:center;flex-wrap:nowrap}body[data-saj-view=daily] #content .page-heading>div{flex-basis:auto}
}
@media(max-width:360px){#content .stat{padding:12px}#content .stat-label{flex-wrap:wrap}#content .saj-record-table td,#modal-body .saj-record-table td{grid-template-columns:1fr;gap:5px}#content .saj-record-table td>*,#modal-body .saj-record-table td>*{grid-column:1}}
@media(prefers-reduced-motion:reduce){#content .loading::before{animation:none;border-color:var(--saj-brand)}#content *,#modal-body *{transition:none!important}}
#content .saj-record-table th,#modal-body .saj-record-table th{white-space:nowrap}
#content .channel-meta{color:var(--saj-muted)}
/* Compatibility aliases keep specialist modules on the same semantic palette. */
:root{--brand:var(--saj-brand);--surface:var(--saj-surface);--surface-soft:var(--saj-surface-subtle);--surface-subtle:var(--saj-surface-subtle);--ink:var(--saj-ink);--border:var(--saj-line);--focus:var(--saj-focus)}
#content :is(.filter-bar,.analytics-tabs,.analytics-actions,.ai-workbench-tabs,.studio-tabs) button[aria-pressed=true],#content :is(.filter-bar,.analytics-tabs,.analytics-actions,.ai-workbench-tabs,.studio-tabs) button[aria-pressed=true]:hover{background:var(--saj-selected);color:var(--saj-brand);border-color:var(--saj-brand);box-shadow:inset 0 0 0 1px var(--saj-brand);font-weight:600}
