:root{--bg:#f5f7fb;--surface:#fff;--ink:#152033;--muted:#6d7788;--line:#e3e8f0;--accent:#2563eb;--accent-soft:#eaf2ff;--sidebar:#101827;--sidebar-muted:#9aa7bb;--success:#16835b;--shadow:0 12px 35px rgba(17,32,58,.07)}*{box-sizing:border-box}body{margin:0;font:14px/1.5 Vazir,Tahoma,Arial,sans-serif;background:var(--bg);color:var(--ink)}a{text-decoration:none;color:inherit}.app-shell{display:flex;min-height:100vh}.sidebar{width:244px;background:var(--sidebar);color:white;padding:24px 16px;display:flex;flex-direction:column;gap:28px}.brand{display:flex;gap:12px;align-items:center;padding:4px 8px}.brand-mark{display:grid;place-items:center;width:36px;height:36px;border-radius:10px;background:var(--accent);font-weight:800}.brand strong{display:block;font-size:15px}.brand small{display:block;color:var(--sidebar-muted);font-size:11px;margin-top:2px}.brand.large{padding:0}.sidebar nav{display:flex;flex-direction:column;gap:5px}.sidebar nav a{padding:10px 12px;border-radius:9px;color:#d8e0ed}.sidebar nav a:hover,.sidebar nav a.active{background:#1d2a40;color:#fff}.nav-label{text-transform:uppercase;font-size:10px;letter-spacing:.13em;color:#66758c;margin:14px 12px 4px}.sidebar-footer{margin-top:auto;color:#66758c;font-size:11px;padding:0 8px}.main{flex:1;min-width:0}.topbar{height:84px;background:rgba(255,255,255,.85);backdrop-filter:blur(10px);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 34px;position:sticky;top:0;z-index:2}.topbar h1{font-size:22px;margin:2px 0 0}.eyebrow{font-size:10px;letter-spacing:.14em;color:var(--muted);font-weight:700;margin:0}.user-chip{display:flex;align-items:center;gap:10px}.user-chip>span{width:38px;height:38px;border-radius:50%;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;font-weight:800}.user-chip strong,.user-chip small{display:block}.user-chip strong{font-size:13px}.user-chip small{color:var(--muted);font-size:11px}.content{padding:34px;max-width:1280px;margin:auto}.hero{display:flex;justify-content:space-between;gap:20px;align-items:end;padding:28px 30px;border-radius:18px;background:linear-gradient(120deg,#132033,#263a5a);color:white;box-shadow:var(--shadow);margin-bottom:22px}.hero h2{font-size:28px;margin:8px 0}.hero p{margin:0;color:#c5d0df;max-width:690px}.badge{font-size:10px;letter-spacing:.13em;font-weight:800;color:#9fc2ff}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:22px}.stat,.panel{background:var(--surface);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow)}.stat{padding:20px}.stat span,.stat small{display:block;color:var(--muted)}.stat strong{display:block;font-size:30px;margin:4px 0}.grid-2{display:grid;grid-template-columns:1.35fr 1fr;gap:18px;margin-bottom:18px}.panel{overflow:hidden}.panel-head{display:flex;justify-content:space-between;align-items:center;padding:20px 22px;border-bottom:1px solid var(--line)}.panel-head h3{margin:0;font-size:16px}.panel-head p{margin:3px 0 0;color:var(--muted);font-size:12px}.panel-head a{color:var(--accent);font-size:12px;font-weight:700}.bar-row{display:grid;grid-template-columns:130px 1fr 30px;gap:12px;align-items:center;padding:12px 22px}.bar{height:8px;background:#edf0f5;border-radius:99px;overflow:hidden}.bar i{display:block;height:100%;background:var(--accent);border-radius:inherit}.quick-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:18px}.quick-actions a{padding:16px;border:1px solid var(--line);border-radius:12px;background:#fbfcfe;font-weight:700}.quick-actions a:hover{border-color:#b7c8e7;background:#f6f9ff}table{width:100%;border-collapse:collapse}th,td{padding:13px 20px;text-align:left;border-bottom:1px solid var(--line);font-size:13px}th{background:#fafbfc;font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}tr:last-child td{border-bottom:0}.muted{color:var(--muted)}code{background:#f2f4f7;padding:3px 6px;border-radius:6px;font-size:11px}.pill,.status{display:inline-flex;align-items:center;border-radius:99px;padding:4px 8px;font-size:11px;font-weight:700}.pill{background:var(--accent-soft);color:var(--accent)}.status{background:#f2f3f5;color:#7a8392}.status.on{background:#eaf8f1;color:var(--success)}.empty{text-align:center;color:var(--muted);padding:32px!important}.page-actions{display:flex;justify-content:space-between;align-items:end;gap:20px;margin-bottom:20px}.page-actions h2{margin:5px 0;font-size:25px}.page-actions p{margin:0;color:var(--muted)}.primary,.secondary{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:9px;padding:10px 15px;font-weight:700;cursor:pointer;font-size:13px}.primary{background:var(--accent);color:#fff}.secondary{background:#fff;border:1px solid var(--line);color:var(--ink)}.form-panel{max-width:760px;padding:26px}.field{margin-bottom:18px}.field label{display:block;font-weight:700;margin-bottom:7px}.field input,.field select,.field textarea{width:100%;font:inherit;border:1px solid #ccd4e1;border-radius:9px;padding:10px 11px;background:#fff}.field select[multiple]{min-height:180px}.field input:focus,.field select:focus,.field textarea:focus{outline:2px solid #cfe0ff;border-color:#8eb5ff}.field small{display:block;color:var(--muted);margin-top:6px}.error{color:#b42318;font-size:12px;margin-top:5px}.form-footer{display:flex;justify-content:flex-end;gap:10px;padding-top:12px;border-top:1px solid var(--line)}.full{width:100%;margin-top:4px}.login-page{min-height:100vh;display:grid;place-items:center;background:linear-gradient(140deg,#eef4ff,#f7f9fc)}.login-card{width:min(420px,calc(100% - 32px));padding:32px;background:white;border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow)}.login-card h1{margin:28px 0 4px;font-size:26px}.login-card>p{color:var(--muted);margin-top:0;margin-bottom:24px}@media(max-width:1000px){.stats{grid-template-columns:1fr 1fr}.grid-2{grid-template-columns:1fr}.sidebar{width:210px}}@media(max-width:720px){.sidebar{display:none}.content{padding:20px}.topbar{padding:0 20px}.stats{grid-template-columns:1fr 1fr}.hero,.page-actions{align-items:start;flex-direction:column}.user-chip{display:none}th,td{padding:10px 12px}.panel{overflow:auto}.panel-head{min-width:650px}}

.flash-stack{display:grid;gap:8px;margin-bottom:16px}.flash{padding:11px 14px;border-radius:10px;border:1px solid var(--line);background:#fff;font-weight:600}.flash.success{background:#eefbf4;color:#12643f;border-color:#c9efd9}.flash.error{background:#fff1f0;color:#a5271d;border-color:#f4c5c0}.hero.compact{padding:22px 26px;margin-bottom:18px}.actions{white-space:nowrap}.inline-form{display:inline}.link-button,.text-link{font:inherit;color:var(--accent);background:none;border:0;padding:0;font-weight:700;cursor:pointer;margin-right:10px}.link-button.danger{color:#b42318}.builder-panel{padding:26px}.builder-top{display:grid;grid-template-columns:1fr 1.4fr;gap:16px;padding-bottom:4px}.builder-heading{display:flex;justify-content:space-between;align-items:center;border-top:1px solid var(--line);padding-top:24px;margin-top:12px}.builder-heading h3{margin:0}.builder-heading p{margin:4px 0 0;color:var(--muted)}.builder-field{border:1px solid var(--line);border-radius:14px;padding:18px;margin-top:14px;background:#fcfdff}.builder-field-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.field-grid{display:grid;grid-template-columns:1fr 1.2fr 1fr auto;gap:14px}.checkbox-field{display:flex;align-items:end}.checkbox-field label{font-weight:700}.checkbox-field input{width:auto}.options-editor label{display:block;font-weight:700;margin-bottom:7px}.options-editor textarea{width:100%;font:inherit;border:1px solid #ccd4e1;border-radius:9px;padding:10px 11px;resize:vertical}.builder-actions{display:flex;justify-content:flex-end;gap:10px;border-top:1px solid var(--line);padding-top:18px;margin-top:24px}.alert-panel{padding:18px 22px;margin-bottom:16px;background:#fff8f7;border-color:#f0c7c2}.alert-panel ul{margin:8px 0 0;padding-left:18px}.form-runtime{max-width:920px;padding:28px}.runtime-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px 18px}.runtime-field{padding:16px;border:1px solid var(--line);border-radius:12px;background:#fff}.runtime-field label{display:block;font-weight:700;margin-bottom:7px}.runtime-field input,.runtime-field select,.runtime-field textarea{width:100%;font:inherit;border:1px solid #ccd4e1;border-radius:9px;padding:10px 11px;background:#fff}.runtime-field input[type=file]{padding:8px}.runtime-field small{display:block;color:var(--muted);margin-top:6px}.required{color:#b42318}.checkbox-label{font-weight:500!important}.checkbox-label input{width:auto}.success-card,.empty-state{max-width:720px;padding:42px;text-align:center}.success-icon{width:58px;height:58px;margin:0 auto 16px;border-radius:50%;display:grid;place-items:center;background:#eaf8f1;color:var(--success);font-size:28px;font-weight:800}.success-card h2,.empty-state h2{margin:6px 0 8px}.success-card p{color:var(--muted)}.success-meta{display:flex;justify-content:center;gap:10px;align-items:center;margin:22px auto;padding:13px 16px;border:1px solid var(--line);border-radius:10px;width:max-content;background:#fafbfc}.success-meta span{color:var(--muted)}@media(max-width:900px){.builder-top,.field-grid,.runtime-grid{grid-template-columns:1fr}.builder-panel{padding:20px}}
/* Form Designer v1 */
.designer-meta{padding:22px;margin-bottom:16px}.designer-meta .builder-top{grid-template-columns:1fr 1.5fr 1fr}.designer-shell{display:grid;grid-template-columns:220px minmax(500px,1fr) 300px;gap:16px;align-items:start}.designer-toolbox,.designer-properties{position:sticky;top:100px;max-height:calc(100vh - 120px);overflow:auto}.designer-toolbox,.designer-properties,.designer-canvas,.designer-preview{padding:18px}.designer-pane-head{display:flex;justify-content:space-between;align-items:start;gap:12px;border-bottom:1px solid var(--line);padding-bottom:14px;margin-bottom:14px}.designer-pane-head h3{margin:2px 0 0}.designer-head-actions{display:flex;gap:8px}.toolbox-item{display:flex;width:100%;align-items:center;gap:9px;border:1px solid var(--line);background:#fbfcfe;border-radius:9px;padding:10px 12px;margin:7px 0;text-align:left;font:inherit;font-weight:700;cursor:pointer}.toolbox-item:hover{border-color:#9ab9ee;background:#f4f8ff}.toolbox-item span{display:grid;place-items:center;width:22px;height:22px;border-radius:6px;background:var(--accent-soft);color:var(--accent)}.designer-toolbox hr{border:0;border-top:1px solid var(--line);margin:16px 0}.designer-page{border:1px solid #cad5e6;border-radius:14px;background:#f8faff;margin-bottom:18px;overflow:hidden}.designer-page-head,.designer-section-head{display:flex;justify-content:space-between;align-items:center;gap:12px}.designer-page-head{padding:14px 16px;background:#edf3fc;border-bottom:1px solid #d8e2f0}.designer-page-head>div:first-child{display:flex;align-items:center;gap:10px}.designer-inline-title,.designer-inline-section{font:inherit;border:1px solid transparent;background:transparent;border-radius:7px;padding:5px 7px;font-weight:800}.designer-inline-title:focus,.designer-inline-section:focus{background:#fff;border-color:#9ab9ee;outline:none}.designer-section{margin:14px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:12px}.designer-section-head{margin-bottom:10px}.designer-section-head select{border:1px solid var(--line);border-radius:7px;padding:6px;background:#fff}.designer-row{display:flex;gap:10px;align-items:stretch}.designer-column{flex:var(--designer-width) 1 0;min-width:0;min-height:110px;border:1px dashed #b8c6da;border-radius:10px;padding:9px;background:#fbfcfe;transition:.15s}.designer-column.selected{border-color:#6e9feb;background:#f6f9ff}.designer-column.drag-over{border-color:var(--accent);background:#edf5ff}.designer-field-card{display:grid;grid-template-columns:auto 1fr auto;gap:9px;align-items:center;border:1px solid var(--line);border-radius:9px;padding:10px;background:#fff;margin-bottom:8px;cursor:pointer}.designer-field-card.selected{border-color:#76a4ed;box-shadow:0 0 0 2px #e6efff}.designer-field-card small{display:block;color:var(--muted);font-size:10px}.drag-handle{color:#9aa6b7;cursor:grab}.designer-card-actions{display:flex;gap:3px}.designer-card-actions button{border:0;background:transparent;color:var(--muted);font-size:18px;cursor:pointer}.designer-card-actions button:hover{color:var(--ink)}.designer-drop-empty{width:100%;min-height:36px;border:1px dashed transparent;border-radius:8px;background:transparent;color:var(--muted);cursor:pointer}.designer-drop-empty:hover{border-color:#aac1e6;color:var(--accent)}.designer-empty{padding:24px 10px;text-align:center;color:var(--muted)}.property-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.checkbox-field-prop input{width:auto!important}.property-condition{border-top:1px solid var(--line);padding-top:14px}.property-actions{display:flex;gap:8px;border-top:1px solid var(--line);padding-top:14px}.danger-outline{color:#b42318!important;border-color:#e7b4af!important}.designer-savebar{position:sticky;bottom:0;background:rgba(245,247,251,.96);backdrop-filter:blur(8px);padding:14px 0;z-index:3}.designer-preview{margin-top:18px}.preview-runtime{max-width:none;padding:4px;border:0;box-shadow:none}.runtime-page{margin-bottom:24px}.runtime-page-heading{border-bottom:1px solid var(--line);margin-bottom:16px;padding-bottom:10px}.runtime-page-heading span{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.1em}.runtime-page-heading h3{margin:3px 0}.runtime-section{margin-bottom:18px}.runtime-section>h4{margin:0 0 10px}.runtime-row{display:flex;gap:16px;margin-bottom:16px}.runtime-column{min-width:0}.runtime-column-1{flex:1}.runtime-column-2{flex:2}.runtime-column-3{flex:3}.runtime-column-4{flex:4}.runtime-column-5{flex:5}.runtime-column-6{flex:6}.runtime-column-7{flex:7}.runtime-column-8{flex:8}.runtime-column-9{flex:9}.runtime-column-10{flex:10}.runtime-column-11{flex:11}.runtime-column-12{flex:12}.runtime-field{margin-bottom:12px}.runtime-empty-column{border:1px dashed var(--line);padding:18px;text-align:center;color:var(--muted);border-radius:10px}@media(max-width:1180px){.designer-shell{grid-template-columns:190px 1fr}.designer-properties{grid-column:1/-1;position:static;max-height:none}.designer-meta .builder-top{grid-template-columns:1fr 1fr}}@media(max-width:850px){.designer-shell{grid-template-columns:1fr}.designer-toolbox,.designer-properties{position:static;max-height:none}.designer-row,.runtime-row{flex-direction:column}.designer-meta .builder-top{grid-template-columns:1fr}}

/* Form Designer OSS Spike: Formeo is isolated to the authoring screen only. */
.formeo-designer-page{max-width:1500px;margin:0 auto}.formeo-designer-toolbar{display:flex;justify-content:space-between;align-items:flex-start;gap:24px;margin-bottom:16px}.formeo-designer-toolbar h2{margin:4px 0 6px}.formeo-designer-toolbar p{margin:0}.formeo-toolbar-actions{display:flex;gap:8px;flex-wrap:wrap}.formeo-form-meta{display:grid;grid-template-columns:minmax(220px,.8fr) minmax(320px,1.6fr) minmax(200px,.7fr);gap:14px;padding:16px 18px;background:#fff;border:1px solid var(--line);border-radius:14px 14px 0 0}.formeo-form-meta .field{margin:0}.formeo-workspace{padding:0;margin-top:12px;overflow:hidden;border-radius:14px}.formeo-workspace-head{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:12px 16px;border-bottom:1px solid var(--line);background:#f8fafc}.formeo-workspace-head>div:first-child{display:flex;align-items:center;gap:9px}.formeo-workspace-head small{color:var(--muted)}.formeo-badge{display:inline-flex;align-items:center;padding:4px 8px;border-radius:999px;background:#eaf8f1;color:#12643f;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}.formeo-workspace-help{font-size:12px;color:var(--muted);text-align:right}.isf-formeo-editor{min-height:640px;background:#f3f5f8}.isf-formeo-editor .formeo-wrap{min-height:640px}.formeo-load-error{padding:38px;text-align:center;background:#fff8f7;color:#8f2119}.formeo-load-error p{color:#6f443f}.formeo-license-note{margin-right:auto;color:var(--muted);font-size:12px}.formeo-designer-page .designer-savebar{align-items:center}.formeo-designer-page .designer-preview{padding:18px}.formeo-designer-page .alert-panel{border:1px solid #f0c7c2;border-radius:10px;padding:14px;background:#fff8f7}.formeo-designer-page .formeo-wrap button,.formeo-designer-page .formeo-wrap input,.formeo-designer-page .formeo-wrap select,.formeo-designer-page .formeo-wrap textarea{font-family:inherit}.formeo-designer-page .formeo-wrap{font-family:inherit;color:var(--ink)}
@media(max-width:900px){.formeo-designer-toolbar,.formeo-workspace-head{flex-direction:column}.formeo-form-meta{grid-template-columns:1fr}.formeo-workspace-help{text-align:left}.isf-formeo-editor{min-height:760px}}

/* Form Designer v2 — professional workspace. Formeo stays isolated as the OSS drag/drop surface. */
.professional-designer-page{margin:-24px -28px -28px;min-height:calc(100vh - 84px);background:#eef2f7}.professional-errors{margin:16px 20px}.designer-commandbar{height:68px;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:0 20px;background:#fff;border-bottom:1px solid #dfe5ee;position:sticky;top:84px;z-index:8;box-shadow:0 2px 10px rgba(20,35,60,.04)}.designer-title-cluster,.designer-title-row,.designer-command-actions,.canvas-toolbar,.canvas-toolbar-left,.device-switch,.settings-dialog-head,.settings-dialog-actions{display:flex;align-items:center}.designer-title-cluster{gap:12px;min-width:0}.designer-back{width:34px;height:34px;border:1px solid #dbe2ec;border-radius:9px;display:grid;place-items:center;font-size:18px;background:#fff}.designer-title-row{gap:8px}.designer-title-row h2{font-size:17px;margin:0;max-width:430px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.designer-title-cluster p{font-size:11px;color:#778399;margin:2px 0 0}.designer-version{font-size:10px;padding:2px 6px;border-radius:999px;background:#eef3fb;color:#53627a}.designer-oss-pill{font-size:9px;text-transform:uppercase;letter-spacing:.08em;font-weight:800;color:#19704b;background:#e9f8f1;border-radius:999px;padding:4px 7px}.designer-command-actions{gap:8px}.icon-action{min-width:34px;height:34px;border:1px solid #dbe2ec;background:#fff;border-radius:9px;display:grid;place-items:center;font-size:18px;cursor:pointer;color:#43516a}.icon-action:disabled{opacity:.35;cursor:not-allowed}.icon-action:hover:not(:disabled),.designer-back:hover{background:#f4f7fb}.command-divider{height:24px;width:1px;background:#dfe5ee;margin:0 2px}.designer-workspace{display:grid;grid-template-columns:248px minmax(520px,1fr) 310px;height:calc(100vh - 152px);min-height:610px;overflow:hidden}.designer-left-panel,.designer-right-panel{background:#fff;min-width:0;overflow:hidden}.designer-left-panel{border-right:1px solid #dfe5ee}.designer-right-panel{border-left:1px solid #dfe5ee}.designer-panel-tabs{height:48px;display:flex;border-bottom:1px solid #e2e7ef;background:#fbfcfe}.designer-panel-tabs button{flex:1;border:0;border-bottom:2px solid transparent;background:transparent;color:#68758b;font:inherit;font-size:12px;font-weight:700;cursor:pointer}.designer-panel-tabs button.active{color:#1f63d5;border-bottom-color:#2d78ed;background:#fff}.designer-left-tabs button{display:flex;align-items:center;justify-content:center;gap:6px}.designer-left-content{height:calc(100% - 48px);overflow:auto;padding:14px}.component-search{height:38px;border:1px solid #d8e0eb;border-radius:9px;display:flex;align-items:center;gap:8px;padding:0 10px;background:#fff}.component-search:focus-within{border-color:#7ea8ef;box-shadow:0 0 0 3px #eaf1ff}.component-search span{color:#7f8b9d;font-size:17px}.component-search input{border:0;outline:0;min-width:0;width:100%;font:inherit;background:transparent}.component-help{font-size:10px;color:#8b96a7;margin:9px 2px 12px}.component-host{min-height:300px}.component-loading{color:#8b96a7;font-size:12px;padding:14px 4px}.component-host .formeo-controls,.component-host .isf-relocated-controls{width:100%!important;max-width:none!important;min-width:0!important;position:static!important;float:none!important;box-shadow:none!important;background:transparent!important;border:0!important}.component-host .formeo-controls>*{max-width:100%}.panel-section-heading{font-size:10px;text-transform:uppercase;letter-spacing:.12em;font-weight:800;color:#8a96a8;margin-bottom:10px}.structure-tree{display:flex;flex-direction:column;gap:8px}.tree-stage{border:1px solid #e3e8f0;border-radius:9px;padding:9px}.tree-stage>strong{display:block;font-size:11px;color:#53627a;margin-bottom:6px}.tree-row{display:flex;flex-direction:column;gap:4px}.tree-field{border:0;background:#f5f7fa;border-radius:7px;padding:7px 8px;text-align:left;font:inherit;font-size:11px;color:#526076;cursor:pointer}.tree-field:hover,.tree-field.active{background:#eaf2ff;color:#1f63d5}.tree-empty{font-size:11px;color:#9aa4b2}.designer-center-panel{min-width:0;background:#e9edf3;display:flex;flex-direction:column}.canvas-toolbar{height:48px;justify-content:space-between;padding:0 14px;background:#f9fafc;border-bottom:1px solid #dfe5ee}.canvas-toolbar-left{gap:8px;font-size:12px}.canvas-status-dot{width:7px;height:7px;border-radius:50%;background:#27a76f}.canvas-count{color:#8a96a8;font-size:10px}.device-switch{border:1px solid #d8e0eb;border-radius:8px;overflow:hidden;background:#fff}.device-switch button{width:34px;height:30px;border:0;border-right:1px solid #e1e6ee;background:#fff;color:#758197;cursor:pointer}.device-switch button:last-child{border-right:0}.device-switch button.active{background:#eaf2ff;color:#1d66db}.designer-canvas-scroll{flex:1;overflow:auto;padding:24px}.designer-canvas-frame{width:min(900px,100%);min-height:100%;margin:0 auto;background:#fff;border:1px solid #d5dce7;border-radius:12px;box-shadow:0 16px 45px rgba(30,45,70,.09);transition:width .2s}.designer-canvas-frame[data-device="tablet"]{width:min(720px,100%)}.designer-canvas-frame[data-device="mobile"]{width:min(410px,100%)}.canvas-paper-heading{padding:24px 28px 15px;border-bottom:1px solid #edf0f4}.canvas-paper-heading h3{font-size:22px;margin:0 0 5px}.canvas-paper-heading p{margin:0;color:#8290a3;font-size:11px}.isf-formeo-editor{min-height:520px;background:#fff!important;padding:14px}.isf-formeo-editor .formeo-wrap{min-height:500px!important;font-family:inherit!important;color:var(--ink)!important}.isf-formeo-editor .formeo-controls{display:none!important}.isf-formeo-editor .formeo-stage{background:#fff!important}.formeo-load-error{padding:32px;text-align:center;background:#fff8f7;color:#8f2119}.designer-right-panel{display:flex;flex-direction:column}.inspector-body{overflow:auto;padding:14px 16px 24px}.inspector-field-picker{padding-bottom:12px;border-bottom:1px solid #e7ebf1}.inspector-section{padding-top:4px}.inspector-empty{text-align:center;color:#7c889b;padding:42px 10px}.inspector-empty-icon{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;background:#eef4ff;color:#2d72dc;font-size:20px;margin:0 auto 10px}.inspector-empty strong{display:block;color:#4a5870;margin-bottom:4px}.inspector-empty p{font-size:11px;margin:0}.inspector-right-panel .field,.inspector-body .field{margin-bottom:13px}.inspector-body label{font-size:11px;font-weight:700;color:#526078}.inspector-body input,.inspector-body select,.inspector-body textarea{width:100%;border:1px solid #d8e0eb;border-radius:8px;padding:8px 9px;background:#fff;font:inherit;font-size:12px}.inspector-body input:focus,.inspector-body select:focus,.inspector-body textarea:focus{outline:0;border-color:#80aaf0;box-shadow:0 0 0 3px #edf3ff}.inspector-body small{display:block;font-size:9px;color:#929dad;margin-top:4px}.inspector-toggle{display:flex!important;align-items:center;gap:8px;padding:10px;border:1px solid #e0e6ee;border-radius:9px;background:#fafbfd}.inspector-toggle input{width:auto!important}.inspector-section-title{padding:8px 0 12px}.inspector-section-title strong{font-size:12px}.inspector-section-title p{font-size:10px;color:#8d98a8;margin:3px 0 0}.inspector-two-col{display:grid;grid-template-columns:1fr 1fr;gap:8px}.inspector-note{font-size:10px;color:#8d98a8;background:#f6f8fb;border-radius:8px;padding:8px}.professional-preview{position:fixed;inset:0;z-index:30;background:rgba(12,22,38,.58);backdrop-filter:blur(4px);padding:28px;overflow:auto}.preview-modal-card{max-width:1050px;margin:0 auto;background:#fff;border-radius:14px;box-shadow:0 30px 80px rgba(0,0,0,.25);min-height:400px}.preview-modal-head{display:flex;justify-content:space-between;align-items:flex-start;padding:18px 20px;border-bottom:1px solid #e3e8ef}.preview-modal-head h3{margin:2px 0}.preview-modal-head p{margin:2px 0;color:#7c8899;font-size:11px}.professional-preview .preview-runtime{padding:22px}.form-settings-dialog{border:0;border-radius:14px;padding:0;width:min(520px,calc(100vw - 30px));box-shadow:0 30px 90px rgba(0,0,0,.25)}.form-settings-dialog::backdrop{background:rgba(12,22,38,.5);backdrop-filter:blur(3px)}.settings-dialog-card{padding:20px}.settings-dialog-head{justify-content:space-between;border-bottom:1px solid #e5e9ef;padding-bottom:12px;margin-bottom:16px}.settings-dialog-head h3{margin:2px 0}.settings-dialog-card .field{margin-bottom:14px}.settings-dialog-card input{width:100%;border:1px solid #d8e0eb;border-radius:8px;padding:9px 10px;font:inherit}.settings-dialog-card small{display:block;color:#8f99a8;font-size:10px;margin-top:4px}.settings-dialog-actions{justify-content:flex-end;gap:8px;border-top:1px solid #e5e9ef;padding-top:14px;margin-top:18px}
@media(max-width:1250px){.designer-workspace{grid-template-columns:215px minmax(460px,1fr) 270px}.designer-command-actions .secondary{padding-left:9px;padding-right:9px}.designer-oss-pill{display:none}}@media(max-width:980px){.professional-designer-page{margin:-24px -20px -20px}.designer-workspace{grid-template-columns:200px 1fr}.designer-right-panel{position:fixed;right:0;top:152px;bottom:0;width:290px;z-index:12;box-shadow:-10px 0 30px rgba(20,30,50,.12)}.designer-commandbar{top:84px}.designer-title-cluster p{display:none}}@media(max-width:760px){.designer-commandbar{height:auto;min-height:68px;padding:10px;align-items:flex-start}.designer-command-actions{flex-wrap:wrap;justify-content:flex-end}.designer-workspace{grid-template-columns:1fr;height:auto;min-height:0}.designer-left-panel,.designer-right-panel{position:static;width:auto;border:0;border-bottom:1px solid #dfe5ee}.designer-left-panel{max-height:350px}.designer-right-panel{box-shadow:none}.designer-canvas-scroll{padding:12px}.professional-designer-page{margin:-24px -16px -16px}.command-divider{display:none}}

/* Bilingual/RTL foundation. Logical properties keep new UI direction-safe. */
.topbar-actions { display:flex; align-items:center; gap:12px; }
.language-switcher select { min-width:92px; padding:8px 10px; border:1px solid var(--border, #d9dee8); border-radius:8px; background:var(--surface, #fff); color:inherit; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
html[dir="rtl"] body { text-align:right; }
html[dir="rtl"] .app-shell { direction:rtl; }
html[dir="rtl"] .sidebar { border-right:0; border-left:1px solid var(--border, #e6e9ef); }
html[dir="rtl"] .page-actions,
html[dir="rtl"] .panel-head,
html[dir="rtl"] .topbar,
html[dir="rtl"] .designer-commandbar,
html[dir="rtl"] .canvas-toolbar,
html[dir="rtl"] .runtime-wizard-actions { direction:rtl; }
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select { text-align:right; }
html[dir="rtl"] code,
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="url"] { direction:ltr; text-align:left; }
html[dir="rtl"] .designer-back { transform:scaleX(-1); }
@media (max-width: 860px) { .topbar-actions { gap:8px; } .language-switcher select { min-width:78px; } }


/* Global application typography. Vazir is loaded in the base templates. */
html, body, button, input, select, textarea, option, table, th, td, a, label, small, code, pre, dialog {
  font-family: Vazir, Tahoma, Arial, sans-serif !important;
}
.formeo-wrap, .formeo-wrap *, .component-host, .component-host * {
  font-family: Vazir, Tahoma, Arial, sans-serif !important;
}


/* Persian date controls keep Gregorian ISO values in hidden inputs while users work in Jalali. */
.bpms-jalali-date {
  direction: rtl;
  text-align: right;
}
jdp-container,
.jdp-container {
  font-family: Vazir, sans-serif !important;
  direction: rtl;
}
jdp-container *,
.jdp-container * {
  font-family: inherit !important;
}


.user-account {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logout-form {
  margin: 0;
}

.logout-button {
  appearance: none;
  border: 1px solid var(--border, #d9dee8);
  border-radius: 8px;
  background: var(--surface, #fff);
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 11px;
  white-space: nowrap;
}

.logout-button:hover,
.logout-button:focus-visible {
  border-color: var(--accent, #3769c8);
  color: var(--accent, #3769c8);
}

@media (max-width: 700px) {
  .topbar-actions,
  .user-account {
    flex-wrap: wrap;
  }

  .user-chip small {
    display: none;
  }

  .logout-button {
    min-height: 38px;
  }
}


/* Global table alignment and action layout.
   Logical alignment keeps Persian RTL and English LTR tables consistent. */
table th,
table td,
.data-table th,
.data-table td {
  text-align: start;
  vertical-align: middle;
}

table th,
.data-table th {
  white-space: nowrap;
}

table td,
.data-table td {
  overflow-wrap: normal;
  word-break: normal;
}

table .actions,
.data-table .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: .45rem .7rem;
  white-space: normal;
}

table .actions > *,
.data-table .actions > * {
  margin: 0 !important;
}

table .actions .inline-form,
.data-table .actions .inline-form {
  display: inline-flex;
  align-items: center;
}

html[dir="rtl"] table,
html[dir="rtl"] .data-table,
body.is-rtl table,
body.is-rtl .data-table {
  direction: rtl;
}

html[dir="ltr"] table,
html[dir="ltr"] .data-table,
body.is-ltr table,
body.is-ltr .data-table {
  direction: ltr;
}

.table-card {
  width: 100%;
  overflow-x: auto;
}

.table-card > table {
  min-width: 100%;
}

@media (max-width: 760px) {
  table th,
  table td,
  .data-table th,
  .data-table td {
    padding-inline: 12px;
  }

  table .actions,
  .data-table .actions {
    min-width: 10rem;
  }
}


/* Unified management tables -------------------------------------------------
   Desktop management tables favor readable rows and consistent controls.
   Horizontal scrolling is preferable to character-by-character wrapping. */
.management-table {
  table-layout: auto;
  width: 100%;
}

.management-table th,
.management-table td {
  padding: 16px 18px;
  line-height: 1.65;
  vertical-align: middle;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.management-table th {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.management-table tbody tr {
  min-height: 72px;
}

.management-table .table-primary-cell {
  min-width: 18rem;
  max-width: 30rem;
}

.management-table .table-primary-cell strong {
  display: block;
  line-height: 1.65;
}

.management-table .table-subtitle {
  display: block;
  margin-top: .25rem;
  color: var(--muted);
  line-height: 1.6;
}

.management-table .table-key {
  min-width: 11rem;
  max-width: 15rem;
  direction: ltr;
  unicode-bidi: plaintext;
  text-align: start;
}

.management-table .table-key code {
  display: inline-block;
  max-width: 100%;
  line-height: 1.55;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
}

.management-table .table-email {
  min-width: 14rem;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: start;
  white-space: nowrap;
}

.management-table .table-version,
.management-table .table-number,
.management-table .table-status {
  min-width: 5.5rem;
  white-space: nowrap;
}

.management-table .table-date {
  min-width: 9rem;
  direction: ltr;
  unicode-bidi: isolate;
  white-space: nowrap;
}

.management-table .table-actions-cell {
  min-width: 16rem;
}

.management-table .row-actions,
.management-table td.actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(7rem, 1fr));
  gap: .5rem;
  align-items: stretch;
  width: max-content;
  max-width: 18rem;
  white-space: normal;
}

.management-table .row-actions form,
.management-table td.actions form,
.management-table .inline-form {
  display: flex;
  width: 100%;
  margin: 0;
}

.table-action,
.management-table .row-actions > a,
.management-table .row-actions > button,
.management-table .row-actions form > button {
  box-sizing: border-box;
  width: 100%;
  min-width: 7rem;
  min-height: 40px;
  padding: 8px 12px;
  margin: 0 !important;
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
}

.management-table .status,
.management-table .status-pill {
  min-width: 5.5rem;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
}

html[dir="rtl"] .management-table th,
html[dir="rtl"] .management-table td,
body.is-rtl .management-table th,
body.is-rtl .management-table td {
  text-align: right;
}

html[dir="ltr"] .management-table th,
html[dir="ltr"] .management-table td,
body.is-ltr .management-table th,
body.is-ltr .management-table td {
  text-align: left;
}

html[dir="rtl"] .management-table .table-email,
html[dir="rtl"] .management-table .table-key,
html[dir="rtl"] .management-table .table-date,
body.is-rtl .management-table .table-email,
body.is-rtl .management-table .table-key,
body.is-rtl .management-table .table-date {
  text-align: left;
}

@media (max-width: 980px) {
  .management-table {
    min-width: 920px;
  }

  .table-card,
  .panel.table-card {
    overflow-x: auto;
  }
}

@media (max-width: 720px) {
  .management-table th,
  .management-table td {
    padding: 12px 14px;
  }
}

/* Management data-grid separators -----------------------------------------
   Subtle column boundaries improve scanning without making tables heavy. */
.data-table th,
.data-table td,
.management-table th,
.management-table td {
  border-inline-end: 1px solid #e3e8ef;
}

.data-table th:last-child,
.data-table td:last-child,
.management-table th:last-child,
.management-table td:last-child {
  border-inline-end: 0;
}


/* Current-location navigation ------------------------------------------------ */
.sidebar nav a.active {
  position: relative;
  background: #243653;
  color: #fff;
  font-weight: 800;
  box-shadow: inset 3px 0 0 #60a5fa;
}

html[dir="rtl"] .sidebar nav a.active,
body.is-rtl .sidebar nav a.active {
  box-shadow: inset -3px 0 0 #60a5fa;
}

.sidebar nav a.active::after {
  content: "";
  position: absolute;
  inset-block: 9px;
  inset-inline-end: 9px;
  width: 6px;
  border-radius: 99px;
  background: #60a5fa;
}

/* Process instance table ---------------------------------------------------- */
.process-instance-table {
  min-width: 1180px;
}

.process-instance-table th,
.process-instance-table td {
  padding-block: 15px;
  padding-inline: 14px;
}

.process-instance-table .table-instance-id {
  width: 4rem;
  min-width: 4rem;
  white-space: nowrap;
  text-align: center;
  direction: ltr;
}

.process-instance-table .table-primary-cell {
  min-width: 13rem;
  max-width: 18rem;
  line-height: 1.8;
}

.process-instance-table .table-reference {
  width: 18rem;
  min-width: 16rem;
  max-width: 20rem;
  direction: ltr;
  unicode-bidi: plaintext;
  text-align: left;
  line-height: 1.65;
  overflow-wrap: normal;
  word-break: normal;
}

.process-instance-table .table-version,
.process-instance-table .table-status,
.process-instance-table .table-mode {
  width: 6.5rem;
  min-width: 6.5rem;
  text-align: center;
  white-space: nowrap;
}

.process-instance-table .table-email {
  width: 15rem;
  min-width: 15rem;
  max-width: 15rem;
  white-space: nowrap;
  overflow-wrap: normal;
  line-height: 1.65;
}

.process-instance-table .table-date {
  width: 9.5rem;
  min-width: 9.5rem;
  text-align: center;
}

.process-instance-table .table-actions-cell {
  width: 8.5rem;
  min-width: 8.5rem;
}

.process-instance-table .row-actions.single-action {
  display: block;
  width: 100%;
  max-width: none;
}

.process-instance-table .row-actions.single-action .table-action {
  width: 100%;
  min-width: 7rem;
}

/* Make management-grid column boundaries visible enough for presentation. */
.management-table th,
.management-table td {
  border-inline-end-color: #cfd8e5;
}

.management-table thead th {
  border-bottom: 1px solid #cfd8e5;
}

/* Presentation polish: stable table text, stronger active navigation, inline booleans. */
.sidebar nav a.active,
.sidebar nav a[aria-current="page"] {
  background: #2563eb;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .28);
}

.sidebar nav a.active:hover,
.sidebar nav a[aria-current="page"]:hover {
  background: #1d4ed8;
}

.sidebar nav a.active::before,
.sidebar nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  inset-block: 8px;
  inset-inline-start: 5px;
  width: 4px;
  border-radius: 99px;
  background: #bfdbfe;
}

.sidebar nav a.active::after,
.sidebar nav a[aria-current="page"]::after {
  display: none;
}

/* Never let compact runtime values break character-by-character. */
.table-nowrap {
  display: inline-block;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  word-break: keep-all !important;
}

.process-instance-table .table-mode,
.process-instance-table .table-status,
.process-instance-table .table-version {
  min-width: 8rem;
  width: 8rem;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
  word-break: keep-all !important;
}

.process-instance-table .table-date {
  min-width: 11.5rem;
  width: 11.5rem;
  white-space: nowrap !important;
}

.process-instance-table .table-email {
  min-width: 16.5rem;
  width: 16.5rem;
  max-width: none;
  white-space: nowrap !important;
}

.process-instance-table .table-actions-cell {
  min-width: 9.5rem;
  width: 9.5rem;
}

.process-instance-table .table-action {
  min-width: 8rem;
  white-space: nowrap !important;
  word-break: keep-all !important;
}

/* Checkboxes are inline controls, not full-width text inputs. */
.field.checkbox-field {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 2.75rem;
}

.field.checkbox-field input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--accent);
}

.field.checkbox-field label {
  display: inline-block;
  margin: 0;
  font-weight: 700;
  line-height: 1.5;
}

html[dir="rtl"] .field.checkbox-field,
body.is-rtl .field.checkbox-field {
  justify-content: flex-start;
}


/* Process instance table rebalance -----------------------------------------
   Keep the full runtime list visible on normal desktop widths. */
.process-instance-table-card {
  overflow-x: visible;
}

.process-instance-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border: 1px solid #d6dde8;
}

.process-instance-table col.col-instance-id { width: 4%; }
.process-instance-table col.col-process { width: 17%; }
.process-instance-table col.col-reference { width: 22%; }
.process-instance-table col.col-version { width: 6%; }
.process-instance-table col.col-status { width: 9%; }
.process-instance-table col.col-mode { width: 8%; }
.process-instance-table col.col-started-by { width: 15%; }
.process-instance-table col.col-started { width: 11%; }
.process-instance-table col.col-action { width: 8%; }

.process-instance-table th,
.process-instance-table td {
  width: auto;
  min-width: 0;
  max-width: none;
  padding: 14px 10px;
  border-inline-end: 0;
  border-bottom: 1px solid #d6dde8;
}

/* Draw each interior column boundary once so lines remain continuous. */
.process-instance-table th + th,
.process-instance-table td + td {
  border-inline-start: 1px solid #d6dde8;
}

.process-instance-table tbody tr:last-child td {
  border-bottom: 0;
}

.process-instance-table .table-primary-cell,
.process-instance-table .table-reference,
.process-instance-table .table-email,
.process-instance-table .table-date,
.process-instance-table .table-actions-cell,
.process-instance-table .table-version,
.process-instance-table .table-status,
.process-instance-table .table-mode {
  width: auto;
  min-width: 0;
  max-width: none;
}

.process-instance-table .table-primary-cell {
  line-height: 1.75;
  overflow-wrap: normal;
  word-break: normal;
}

.process-instance-table .table-reference {
  direction: ltr;
  unicode-bidi: plaintext;
  text-align: left;
  line-height: 1.65;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
}

.process-instance-table .table-email {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
  white-space: nowrap !important;
  font-size: 12px;
}

.process-instance-table .table-date {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: center;
  white-space: nowrap !important;
  font-size: 12px;
}

.process-instance-table .table-version,
.process-instance-table .table-status,
.process-instance-table .table-mode,
.process-instance-table .table-instance-id,
.process-instance-table .table-actions-cell {
  text-align: center;
  white-space: nowrap !important;
}

.process-instance-table .table-nowrap {
  white-space: nowrap !important;
}

.process-instance-table .row-actions.single-action {
  width: 100%;
  display: flex;
  justify-content: center;
}

.process-instance-table .row-actions.single-action .table-action {
  width: auto;
  min-width: 5.4rem;
  min-height: 38px;
  padding-inline: 10px;
}

@media (max-width: 1050px) {
  .process-instance-table-card {
    overflow-x: auto;
  }

  .process-instance-table {
    min-width: 920px;
  }
}


/* Process instance table content-aware layout ------------------------------
   Do not allocate fixed percentages to columns. The browser sizes from content
   and only genuinely compact columns are constrained. */
.process-instance-table-card {
  width: 100%;
  overflow-x: visible;
}

.process-instance-table {
  width: 100%;
  min-width: 0;
  table-layout: auto !important;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #d6dde8;
}

.process-instance-table col {
  width: auto !important;
}

.process-instance-table th,
.process-instance-table td {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  padding: 14px 12px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: clip;
  border-inline-end: 0 !important;
  border-bottom: 1px solid #d6dde8;
}

/* Draw one separator per boundary, continuously through header and body. */
.process-instance-table th + th,
.process-instance-table td + td {
  border-inline-start: 1px solid #d6dde8 !important;
}

.process-instance-table tbody tr:last-child td {
  border-bottom: 0;
}

/* Compact columns: constrain only what is intrinsically small. */
.process-instance-table .table-instance-id {
  width: 3.5rem !important;
  white-space: nowrap !important;
  text-align: center;
}

.process-instance-table .table-version {
  width: 4.5rem !important;
  white-space: nowrap !important;
  text-align: center;
}

.process-instance-table .table-status,
.process-instance-table .table-mode {
  width: 6rem !important;
  white-space: nowrap !important;
  text-align: center;
}

.process-instance-table .table-actions-cell {
  width: 6.5rem !important;
  white-space: nowrap !important;
  text-align: center;
}

/* Content columns size naturally. */
.process-instance-table .table-primary-cell {
  min-width: 10rem !important;
  line-height: 1.75;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

.process-instance-table .table-reference {
  min-width: 12rem !important;
  direction: ltr;
  unicode-bidi: plaintext;
  text-align: left;
  line-height: 1.65;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

.process-instance-table .table-email {
  min-width: 12rem !important;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
  white-space: nowrap !important;
  font-size: 12px;
}

.process-instance-table .table-date {
  min-width: 8.5rem !important;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: center;
  white-space: nowrap !important;
  font-size: 12px;
}

.process-instance-table .table-nowrap {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap !important;
}

.process-instance-table .row-actions.single-action {
  display: flex;
  justify-content: center;
  width: auto;
}

.process-instance-table .row-actions.single-action .table-action {
  width: auto;
  min-width: 5.25rem;
  min-height: 38px;
  padding-inline: 10px;
  white-space: nowrap;
}

/* Only genuinely narrow screens should scroll horizontally. */
@media (max-width: 860px) {
  .process-instance-table-card {
    overflow-x: auto;
  }

  .process-instance-table {
    min-width: 780px;
  }
}


/* Independent application scroll regions ----------------------------------
   Desktop keeps navigation stationary while main content scrolls separately. */
@media (min-width: 761px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .app-shell {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }

  .sidebar {
    flex: 0 0 244px;
    width: 244px;
    height: 100vh;
    min-height: 0;
    box-sizing: border-box;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .main {
    flex: 1 1 auto;
    height: 100vh;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
  }

  .topbar {
    position: sticky;
    top: 0;
  }
}

/* On small screens retain normal document flow. */
@media (max-width: 760px) {
  html,
  body {
    height: auto;
    overflow: auto;
  }

  .app-shell {
    min-height: 100vh;
    height: auto;
    overflow: visible;
  }

  .sidebar,
  .main {
    height: auto;
    overflow: visible;
  }
}


/* Final runtime table containment ------------------------------------------
   Runtime tables must never widen the desktop content pane. Long identifiers
   wrap inside their cell; horizontal scrolling is reserved for genuinely
   narrow viewports. */
.main,
.content,
.table-card,
.runtime-table-card,
.process-instance-table-card {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.process-instance-table-card,
.runtime-table-card {
  width: 100%;
  overflow-x: hidden !important;
  overflow-y: visible;
}

.process-instance-table,
.runtime-work-table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed !important;
  border-collapse: separate;
  border-spacing: 0;
}

.process-instance-table th,
.process-instance-table td,
.runtime-work-table th,
.runtime-work-table td {
  min-width: 0 !important;
  max-width: none !important;
  padding: .85rem .7rem;
  line-height: 1.7;
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

/* Process instances: compact technical columns, more room for business text. */
.process-instance-table th:nth-child(1),
.process-instance-table td:nth-child(1) { width: 4%; }
.process-instance-table th:nth-child(2),
.process-instance-table td:nth-child(2) { width: 16%; }
.process-instance-table th:nth-child(3),
.process-instance-table td:nth-child(3) { width: 20%; }
.process-instance-table th:nth-child(4),
.process-instance-table td:nth-child(4) { width: 6%; }
.process-instance-table th:nth-child(5),
.process-instance-table td:nth-child(5) { width: 8%; }
.process-instance-table th:nth-child(6),
.process-instance-table td:nth-child(6) { width: 8%; }
.process-instance-table th:nth-child(7),
.process-instance-table td:nth-child(7) { width: 16%; }
.process-instance-table th:nth-child(8),
.process-instance-table td:nth-child(8) { width: 13%; }
.process-instance-table th:nth-child(9),
.process-instance-table td:nth-child(9) { width: 9%; }

.process-instance-table .table-reference,
.process-instance-table .table-email,
.process-instance-table .table-date,
.process-instance-table .table-primary-cell {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

.process-instance-table .table-reference,
.process-instance-table .table-email {
  direction: ltr;
  unicode-bidi: plaintext;
  text-align: start;
}

.process-instance-table .table-date {
  direction: rtl;
  unicode-bidi: plaintext;
}

.process-instance-table .table-nowrap {
  white-space: normal !important;
  word-break: normal !important;
}

/* Work queue: keep the action and state columns compact. */
.runtime-work-table th:nth-child(1),
.runtime-work-table td:nth-child(1) { width: 15%; }
.runtime-work-table th:nth-child(2),
.runtime-work-table td:nth-child(2) { width: 18%; }
.runtime-work-table th:nth-child(3),
.runtime-work-table td:nth-child(3) { width: 21%; }
.runtime-work-table th:nth-child(4),
.runtime-work-table td:nth-child(4) { width: 9%; }
.runtime-work-table th:nth-child(5),
.runtime-work-table td:nth-child(5) { width: 10%; }
.runtime-work-table th:nth-child(6),
.runtime-work-table td:nth-child(6) { width: 15%; }
.runtime-work-table th:nth-child(7),
.runtime-work-table td:nth-child(7) { width: 12%; }

.runtime-work-table td:nth-child(3) {
  direction: ltr;
  unicode-bidi: plaintext;
}

.runtime-work-table .actions {
  min-width: 0 !important;
  justify-content: center;
}

.runtime-work-table .actions > a,
.runtime-work-table .actions > form,
.runtime-work-table .actions button {
  max-width: 100%;
}

/* At truly narrow widths preserve readable columns and expose a real
   horizontal scrollbar inside the card instead of clipping either edge. */
@media (max-width: 900px) {
  .process-instance-table-card,
  .runtime-table-card {
    overflow-x: auto !important;
    overscroll-behavior-x: contain;
    scrollbar-gutter: stable;
  }

  .process-instance-table,
  .runtime-work-table {
    min-width: 52rem !important;
  }
}


/* Rule Engine -------------------------------------------------------------- */
.rule-json {
  max-width: 100%;
  overflow: auto;
  padding: 1rem;
  border: 1px solid #dce3ec;
  border-radius: .75rem;
  background: #f8fafc;
  direction: ltr;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.stacked-form textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 10rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  direction: ltr;
  text-align: left;
}


/* Business-readable Rule Engine ------------------------------------------- */
.rule-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
}

.rule-business-panel,
.rule-effect-panel,
.rule-editor-panel,
.rule-simulation-panel {
  margin-top: 1rem;
}

/* Rule cards use full-bleed tables, so the panel itself intentionally has no
   padding. Inset the direct heading content to keep RTL text clear of the
   rounded card edge without changing the table geometry. */
.rule-business-panel > .eyebrow,
.rule-simulation-panel > .eyebrow,
.rule-effect-panel > .eyebrow {
  margin-inline: 1.5rem;
  padding-top: 1.25rem;
}

.rule-business-panel > h2,
.rule-simulation-panel > h2,
.rule-simulation-panel > .muted,
.rule-effect-panel > h2 {
  margin-inline: 1.5rem;
}

.rule-effect-panel > .rule-effect-list,
.rule-simulation-panel > .rule-visual-form,
.rule-simulation-panel > .rule-simulation-result,
.rule-simulation-panel > .rule-explanation {
  margin-inline: 1.5rem;
}

.rule-effect-panel > .rule-effect-list,
.rule-simulation-panel > .rule-visual-form {
  padding-bottom: 1.5rem;
}

.rule-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.rule-condition-list {
  display: grid;
  gap: .7rem;
  margin-top: 1rem;
}

.rule-condition-row {
  display: grid;
  grid-template-columns: auto minmax(10rem, 1.2fr) minmax(9rem, 1fr) minmax(8rem, 1fr);
  align-items: center;
  gap: .65rem;
  padding: .9rem 1rem;
  border: 1px solid #dce3ec;
  border-radius: .85rem;
  background: #f8fafc;
}

.rule-if {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.2rem;
  padding: .35rem .55rem;
  border-radius: 999px;
  background: #e8f0ff;
  font-weight: 800;
}

.rule-field,
.rule-value {
  overflow-wrap: anywhere;
}

.rule-operator {
  color: #667085;
  font-weight: 700;
}

.rule-logic-joiner {
  justify-self: center;
  padding: .2rem .65rem;
  border-radius: 999px;
  background: #eef2f7;
  color: #475467;
  font-size: .8rem;
  font-weight: 800;
}

.rule-effect-list {
  display: grid;
  gap: .75rem;
  margin-top: 1rem;
}

.rule-effect-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  padding: 1rem;
  border: 1px solid #dce3ec;
  border-radius: .85rem;
  background: #f8fafc;
}

.rule-effect-card div {
  display: grid;
  gap: .25rem;
}

.rule-effect-card span {
  color: #667085;
  font-size: .85rem;
}

.rule-visual-form {
  display: grid;
  gap: 1rem;
}

.rule-simulation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}

.rule-simulation-field {
  display: grid;
  gap: .4rem;
  min-width: 0;
  font-weight: 700;
}

.rule-simulation-field input,
.rule-simulation-field select,
.rule-simulation-field textarea {
  box-sizing: border-box;
  width: 100%;
}

.rule-simulation-result {
  display: grid;
  gap: .25rem;
  margin-top: 1rem;
  padding: 1rem;
  border-radius: .85rem;
  border: 1px solid #d0d5dd;
}

.rule-simulation-result--match {
  border-color: #abefc6;
  background: #ecfdf3;
}

.rule-simulation-result--no-match {
  border-color: #fecdca;
  background: #fef3f2;
}

@media (max-width: 900px) {
  .rule-summary-strip,
  .rule-effect-card,
  .rule-simulation-grid {
    grid-template-columns: 1fr 1fr;
  }

  .rule-condition-row {
    grid-template-columns: auto 1fr;
  }

  .rule-operator,
  .rule-value {
    grid-column: 2;
  }
}

@media (max-width: 600px) {
  .rule-summary-strip,
  .rule-effect-card,
  .rule-simulation-grid {
    grid-template-columns: 1fr;
  }
}




/* Rule Engine responsive layout fixes ------------------------------------ */
.rule-summary-strip {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.rule-summary-strip > div {
  min-width: 0;
  padding: 1rem 1.25rem;
  border: 1px solid #dce3ec;
  border-radius: 1rem;
  background: #fff;
  display: grid;
  gap: .45rem;
}

.rule-summary-strip span {
  color: #667085;
  font-size: .85rem;
}

.rule-summary-strip strong {
  overflow-wrap: anywhere;
}

.table-scroll-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.rule-score-table {
  width: 100%;
  min-width: 720px;
  table-layout: fixed !important;
}

.rule-score-table th:first-child,
.rule-score-table td:first-child {
  width: 45%;
}

.rule-score-table th:not(:first-child),
.rule-score-table td:not(:first-child) {
  width: 18%;
}

.rule-score-table td,
.rule-score-table th {
  overflow-wrap: anywhere;
}

.rule-business-panel > h2 {
  margin-bottom: .75rem;
}

@media (max-width: 700px) {
  .rule-summary-strip {
    grid-template-columns: 1fr;
  }

  /* The global mobile rule makes every .panel horizontally scrollable. That
     lets a wide score table move the complete RTL card (including its eyebrow
     and heading) off-screen. Keep the card fixed and leave horizontal scrolling
     to the dedicated table wrapper. */
  .rule-business-panel,
  .rule-effect-panel,
  .rule-editor-panel,
  .rule-simulation-panel {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .rule-business-panel .table-scroll-wrapper,
  .rule-simulation-panel .table-scroll-wrapper {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  html[dir="rtl"] .rule-business-panel > .eyebrow,
  html[dir="rtl"] .rule-business-panel > h2,
  html[dir="rtl"] .rule-simulation-panel > .eyebrow,
  html[dir="rtl"] .rule-simulation-panel > h2,
  html[dir="rtl"] .rule-effect-panel > .eyebrow,
  html[dir="rtl"] .rule-effect-panel > h2 {
    overflow-wrap: anywhere;
  }

  .rule-business-panel > .eyebrow,
  .rule-business-panel > h2,
  .rule-simulation-panel > .eyebrow,
  .rule-simulation-panel > h2,
  .rule-simulation-panel > .muted,
  .rule-effect-panel > .eyebrow,
  .rule-effect-panel > h2,
  .rule-effect-panel > .rule-effect-list,
  .rule-simulation-panel > .rule-visual-form,
  .rule-simulation-panel > .rule-simulation-result,
  .rule-simulation-panel > .rule-explanation {
    margin-inline: 1rem;
  }
}

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

/* Advanced Rule Builder ---------------------------------------------------- */
.rule-builder-form,
.advanced-rule-builder {
  min-width: 0;
}

.rule-builder-metadata,
.rule-effective-grid,
.rule-builder-score-settings,
.rule-score-band-fields,
.rule-score-term,
.rule-builder-condition {
  display: grid;
  gap: .8rem;
}

.rule-builder-metadata {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.rule-effective-grid,
.rule-builder-score-settings {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.rule-builder-metadata label,
.rule-effective-grid label,
.rule-builder-score-settings label,
.rule-builder-condition label,
.rule-score-term label,
.rule-score-band-fields label,
.rule-decision-row-header label {
  display: grid;
  gap: .35rem;
  min-width: 0;
  font-weight: 700;
}

.advanced-rule-builder {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.rule-builder-kind-bar {
  display: flex;
  justify-content: flex-start;
}

.rule-builder-kind-bar select {
  width: min(100%, 24rem);
  font-weight: 800;
}

.rule-builder-body,
.rule-builder-group,
.rule-builder-children,
.rule-builder-subsection,
.rule-score-terms,
.rule-decision-summary {
  display: grid;
  gap: .85rem;
}

.rule-builder-node {
  min-width: 0;
  padding: .85rem;
  border: 1px solid #dce3ec;
  border-radius: .85rem;
  background: #fff;
}

.rule-builder-node.depth-1,
.rule-builder-node.depth-3,
.rule-builder-node.depth-5 {
  background: #f8fafc;
}

.rule-builder-node-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: .65rem;
}

.rule-builder-group > .rb-logic {
  width: min(100%, 18rem);
  font-weight: 800;
}

.rule-builder-child {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .55rem;
  align-items: start;
}

.rule-builder-condition {
  grid-template-columns:
    minmax(8rem, 1fr)
    minmax(9rem, 1.2fr)
    minmax(11rem, 1.35fr)
    minmax(7rem, .8fr)
    minmax(9rem, 1fr);
  align-items: end;
}

.rule-builder-condition input,
.rule-builder-condition select,
.rule-builder-condition textarea,
.rule-builder-metadata input,
.rule-builder-metadata select,
.rule-effective-grid input,
.rule-score-term input,
.rule-score-band-fields input,
.rule-builder-score-settings input,
.rule-decision-row-header input {
  box-sizing: border-box;
  width: 100%;
}

.rb-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: .4rem;
}

.rule-builder-subsection {
  padding: 1rem;
  border: 1px solid #e4e7ec;
  border-radius: .9rem;
  background: #fbfcfe;
}

.rule-builder-subsection > h4,
.rule-builder-subsection > h5 {
  margin: 0;
}

.rule-score-term {
  grid-template-columns:
    minmax(8rem, 1fr)
    minmax(9rem, 1.1fr)
    minmax(6rem, .65fr)
    minmax(7rem, .75fr)
    minmax(7rem, .75fr)
    auto;
  align-items: end;
  padding: .8rem;
  border: 1px solid #e4e7ec;
  border-radius: .75rem;
  background: #fff;
}

.rule-score-band,
.rule-decision-row {
  display: grid;
  gap: .8rem;
  padding: 1rem;
  border: 1px solid #dce3ec;
  border-radius: .85rem;
  background: #fff;
}

.rule-score-band-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
}

.rule-decision-row-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .65rem;
  align-items: end;
}

.rule-output-editor,
.rule-output-list {
  display: grid;
  gap: .5rem;
}

.rule-output-row {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) minmax(8rem, 1fr) auto;
  gap: .5rem;
  align-items: center;
}

.rule-builder-submit {
  padding-top: 1rem;
  border-top: 1px solid #e4e7ec;
}

.danger-lite {
  border-color: #fecdca !important;
  color: #b42318 !important;
}

.rule-decision-summary-card {
  display: grid;
  gap: .75rem;
  padding: 1rem;
  border: 1px solid #dce3ec;
  border-radius: .85rem;
  background: #fff;
}

.rule-output-summary {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .9rem;
  align-items: center;
}

.rule-output-summary span {
  display: inline-flex;
  align-items: baseline;
  gap: .4rem;
  padding: .25rem .5rem;
  border-radius: .45rem;
  background: #f2f4f7;
}

.rule-output-summary span > small,
.rule-output-summary span > strong {
  unicode-bidi: isolate;
}

@media (max-width: 1100px) {
  .rule-builder-condition {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rb-value-label {
    grid-column: span 2;
  }

  .rule-score-term {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rule-score-term > button {
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .rule-builder-metadata,
  .rule-effective-grid,
  .rule-builder-score-settings,
  .rule-builder-condition,
  .rule-score-band-fields,
  .rule-score-term,
  .rule-output-row {
    grid-template-columns: 1fr;
  }

  .rb-value-label {
    grid-column: auto;
  }

  .rule-builder-child {
    grid-template-columns: 1fr;
  }
}
.required-marker{color:#b42318!important;font-weight:800;margin-inline-start:.18rem}

.structured-summary {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .55rem;
  align-items: flex-start;
}

.structured-summary > span {
  display: inline-flex;
  align-items: baseline;
  gap: .35rem;
  max-width: 100%;
  padding: .3rem .55rem;
  border-radius: .5rem;
  background: var(--accent-soft, #f2f6fc);
}

.structured-summary small {
  color: var(--muted);
  white-space: nowrap;
}

.structured-summary strong {
  overflow-wrap: anywhere;
  unicode-bidi: isolate;
}

.structured-summary--compact {
  max-width: 34rem;
}


/* Shared UX consistency ------------------------------------------------------ */
.stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-2.grid-2--single { grid-template-columns: 1fr; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}
