/* Presentation only. Existing routes, form fields and event handlers are retained.
   This sheet is loaded with media="screen"; printed documents keep their styles. */
:root {
    --app-gap: clamp(8px, 1.3vw, 20px);
    --app-border: #dce5ed;
}

body {
    min-width: 280px;
    min-height: 100vh;
    font-family: "VazirmatnTable", Tahoma, Geneva, sans-serif;
    font-size: 14px;
    line-height: 1.8;
}

:where(#footer, #boxContainer, #boxContainer1, .prompt, .dialog, .dialogForm,
       .help_dialog, .TABcrt, .TABcrt > .menu, .conents, form, fieldset,
       .fieldClDi, .fieldDiv, .planfilters, .filterBox) {
    box-sizing: border-box;
    min-width: 0;
}

/* Header presentation only; keep the generated markup and session hooks intact. */
#footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    height: auto;
    min-height: 84px;
    padding: 14px 24px;
    border-top: 3px solid #187f8c;
    border-bottom: 1px solid #dce7ee;
    border-radius: 0 0 12px 12px;
    background: linear-gradient(110deg, #f6fafc, #fff 55%);
    color: #24485f;
    font-family: inherit;
    line-height: 1.8;
    box-shadow: 0 3px 14px rgba(28, 66, 88, .06);
    overflow: visible;
}

#footer > div {
    float: none !important;
    width: auto !important;
    max-width: 100%;
    min-width: 0;
}

#footer > div:only-child {
    flex: 1 1 100%;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

#footer > div:nth-child(3) {
    order: 1;
    flex: 1 1 340px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: right !important;
    font-size: 15px !important;
    font-weight: 650;
    line-height: 1.9;
}

#footer > div:nth-child(3)::before {
    content: "";
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: #187f8c url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none'%3E%3Cpath d='M4 17h6l3-9 6 17 3-8h6' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 30px no-repeat;
    box-shadow: 0 4px 10px rgba(24, 127, 140, .16);
}

#footer > div:nth-child(2) {
    order: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-top: 0 !important;
}

#footer .footerTime {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    margin: 0;
    color: #4d687b;
    font-size: 12px;
    line-height: 1.8;
}

#footer :is(#op_time, #op_date) {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    box-sizing: border-box;
    min-height: 34px;
    margin: 0;
    padding: 5px 10px;
    border: 1px solid #e1eaf0;
    border-radius: 8px;
    background: #f4f8fb;
    white-space: nowrap;
    unicode-bidi: isolate;
}

#footer #op_time {
    min-width: 102px;
    direction: ltr;
    justify-content: center;
    color: #285b72;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

#footer #op_date { direction: rtl; }

#footer :is(#op_time, #op_date)::before {
    content: "";
    flex: 0 0 15px;
    width: 15px;
    height: 15px;
    background-color: #6b899c;
    -webkit-mask: var(--header-icon) center / contain no-repeat;
    mask: var(--header-icon) center / contain no-repeat;
}

#footer #op_time { --header-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
#footer #op_date { --header-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M7 3v4m10-4v4M3 11h18m-13 4h2m4 0h2m-8 3h2'/%3E%3C/svg%3E"); }

#footer .copyRight {
    margin: 0;
    padding: 0 2px;
    background: none;
    color: #718697;
    font-size: 10px;
    direction: ltr;
    white-space: nowrap;
}

#footer .copyRight::before { content: "\00a9 "; }

#footer #LoginUserInf {
    order: 3;
    flex: 0 1 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    overflow: visible;
    font-family: inherit;
    font-size: 12px;
}

#footer #LoginUserInf .userInf {
    float: none;
    box-sizing: border-box;
    height: auto;
    margin: 0;
    border: 0;
}

#footer #LoginUserInf .usernamediv {
    order: 1;
    display: flex;
    align-items: center;
    gap: 9px;
    width: auto;
    max-width: 240px;
    min-width: 0;
    padding: 0;
    background: none;
    color: #24485f;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

#footer #LoginUserInf .usernamediv::before {
    content: "";
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border: 1px solid #d7e9eb;
    border-radius: 50%;
    background: #eaf4f5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23187f8c' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M5 20v-1a7 7 0 0 1 14 0v1'/%3E%3C/svg%3E") center / 22px no-repeat;
}

#footer #LoginUserInf .exit { order: 2; padding: 0; }
#footer #LoginUserInf #timeOutShow { display: none; }

#footer #LoginUserInf .exit > a {
    display: block;
    border-radius: 8px;
    color: #a14c53;
}

#footer .exitSysBtn {
    display: flex;
    align-items: center;
    gap: 7px;
    box-sizing: border-box;
    width: auto;
    min-height: 36px;
    height: auto;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid #efdfe2;
    border-radius: 8px;
    background: #fff7f7;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.8;
}

#footer .exitSysBtn::after {
    content: "";
    width: 15px;
    height: 15px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a14c53' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 5H5v14h5m4-11 4 4-4 4m-5-4h12'/%3E%3C/svg%3E") center / contain no-repeat;
}

#footer .exitSysBtn:hover { border-color: #d99ba4; background: #fcebed; color: #8c3441; }
#footer #LoginUserInf .exit > a:focus-visible { outline: 2px solid #187f8c; outline-offset: 3px; }

#boxContainer,
#boxContainer1 {
    float: none;
    width: calc(100% - 2 * var(--app-gap));
    max-width: 1440px;
    height: auto;
    margin: var(--app-gap) auto;
}

#boxContainer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 16px;
    direction: rtl;
}

#boxContainer > .DeskWork {
    --home-accent: #147d78;
    --home-tint: #e9f5f3;
    box-sizing: border-box;
    float: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 132px;
    margin: 0;
    padding: 18px 12px;
    border: 1px solid #e0e8ef;
    border-radius: 12px;
    background-color: #fff !important;
    color: #244259;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.7;
    text-shadow: none;
    overflow-wrap: break-word;
    box-shadow: 0 2px 6px rgba(24, 49, 69, .04);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

#boxContainer > .DeskWork > .my-icon {
    width: 50px !important;
    max-width: 100%;
    height: 50px !important;
    margin: 0 !important;
    flex-shrink: 0;
    border-radius: 14px;
    background-image: none;
    background-color: var(--home-tint);
}

#boxContainer > .DeskWork > .my-icon::after {
    content: "";
    position: absolute;
    inset: 11px;
    background-color: var(--home-accent);
    -webkit-mask: var(--home-icon) center / contain no-repeat;
    mask: var(--home-icon) center / contain no-repeat;
}

#boxContainer > .DeskWork > div:last-child {
    max-width: 100%;
    margin-top: 12px;
    font-weight: 600;
    line-height: 1.8;
}

#boxContainer > .DeskWork:nth-child(4n + 2) { --home-accent: #3976b5; --home-tint: #edf3fb; }
#boxContainer > .DeskWork:nth-child(4n + 3) { --home-accent: #7d62ac; --home-tint: #f2eef9; }
#boxContainer > .DeskWork:nth-child(4n + 4) { --home-accent: #aa792e; --home-tint: #fbf4e7; }

#boxContainer > .DeskWork:hover {
    border: 1px solid #a5c8d4;
    border-radius: 12px;
    opacity: 1;
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(24, 49, 69, .09);
}

#boxContainer > .DeskWork > .notify_p {
    position: absolute;
    top: 10px;
    right: 10px;
    float: none;
    margin: 0;
}

/* Keep the dashboard artwork behind open menus too. Menu cards stay in the
   document when hidden, so their presence identifies the application screen. */
body:has(#boxContainer > .DeskWork) {
    background-image: url("../img/emergency-background.svg");
    background-color: #edf6f7;
    background-position: center bottom;
    background-size: cover;
    background-repeat: no-repeat;
}

@media (max-width: 768px) {
    body:has(#boxContainer > .DeskWork) {
        background-size: auto 100vh;
        background-position: left bottom;
    }
}

#boxContainer1 > div {
    box-sizing: border-box;
    width: 100% !important;
    height: auto !important;
    min-height: 56px;
    margin: 0 !important;
    padding: 14px 18px !important;
    gap: 12px;
    justify-content: flex-start !important;
    border: 1px solid #dce9ec;
    border-radius: 12px !important;
    background-color: #edf5f6 !important;
    color: #3d606c !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    letter-spacing: normal !important;
    line-height: 1.9 !important;
    text-align: right !important;
    direction: rtl;
    box-shadow: none !important;
}

#boxContainer1 > div > span { min-width: 0; overflow-wrap: anywhere; }

div.prompt {
    position: relative;
    width: calc(100% - 2 * var(--app-gap)) !important;
    height: auto !important;
    margin: var(--app-gap) auto;
    padding: 12px;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: #f2f6f9;
    box-shadow: 0 6px 24px rgba(24, 49, 69, .08);
}

.prompt > .content { clear: both; }

.prompt > :is(.closeBtn, .fullBtn, .fullBtn2, .helpBtn),
.dialogForm > .closeBtn,
.dialog > .closeBtn,
.help_dialog > .closeBtn {
    width: 32px;
    height: 32px;
    margin: 0 4px 10px;
    background-position: center;
    background-repeat: no-repeat;
}

div.TABcrt {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    height: auto !important;
    margin: 0;
    direction: rtl;
}

.TABcrt > .menu {
    float: none;
    flex: 0 0 252px;
    width: 252px;
    max-height: calc(100vh - 144px);
    max-height: calc(100dvh - 144px);
    padding: 8px;
    margin: 0;
    top: auto;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: #fff;
    scrollbar-width: thin;
    scrollbar-color: #bdcdd9 transparent;
    overscroll-behavior: contain;
    text-align: right;
}

.tab-menu-heading {
    position: sticky;
    top: -8px;
    z-index: 2;
    margin: -8px -8px 8px;
    padding: 14px 18px 12px;
    border-bottom: 1px solid #e9eff4;
    background: #fff;
    color: #728697;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.8;
    text-align: right;
}

.TABcrt_Items {
    display: flex;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
    width: 100%;
    min-height: 48px;
    margin: 0 0 4px;
    padding: 10px 12px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.8;
    text-align: right;
    direction: rtl;
    border: 1px solid transparent;
    background-color: transparent;
    background-image: none !important;
    color: #365168;
    font-weight: 500;
    box-shadow: none;
    cursor: pointer;
    transition: color .15s ease, background-color .15s ease;
}

.TABcrt_Items::before {
    content: "";
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    background-color: #748b9d;
    -webkit-mask: var(--tab-menu-icon) center / contain no-repeat;
    mask: var(--tab-menu-icon) center / contain no-repeat;
}
.TABcrt_Items::after {
    content: "‹";
    flex: 0 0 8px;
    color: #9bafbd;
    font-family: Arial, sans-serif;
    font-size: 21px;
    line-height: 1;
    text-align: left;
}
.TABcrt_Items > .tab-menu-title { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; }
.TABcrt_Items > .notify_pp {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    float: none;
    width: auto;
    min-width: 20px;
    height: 20px;
    margin: 0;
    padding: 0 5px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1;
}
.TABcrt_Items:last-child { margin-bottom: 0; }
.TABcrt_Items:hover { background-color: #f0f5f9; color: #214e6b; }
.TABcrt_Items:focus-visible { outline: 2px solid #228e88; outline-offset: -2px; background-color: #f0f7f8; }
.TABcrt_Items_active {
    margin: 0 0 4px;
    border-color: transparent;
    background-color: #e7f4f1;
    color: #13766f;
    font-weight: 600;
    box-shadow: inset -3px 0 #16877e;
}
.TABcrt_Items_active::before { background-color: #16877e; }
.TABcrt_Items_active::after { color: #16877e; }
.TABcrt_Items_active:hover { background-color: #e0f0ec; color: #116b65; }
.TABcrt > .menu::-webkit-scrollbar { width: 5px; }
.TABcrt > .menu::-webkit-scrollbar-track { background: transparent; box-shadow: none; }
.TABcrt > .menu::-webkit-scrollbar-thumb { background: #bdcdd9; border: 1px solid #fff; border-radius: 8px; box-shadow: none; }

/* Menu ids match the existing routes; icons are presentation only. */
.TABcrt_Items { --tab-menu-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221.5%22%2F%3E%3Crect%20x%3D%2214%22%20y%3D%223%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221.5%22%2F%3E%3Crect%20x%3D%223%22%20y%3D%2214%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221.5%22%2F%3E%3Crect%20x%3D%2214%22%20y%3D%2214%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221.5%22%2F%3E%3C%2Fsvg%3E"); }
.TABcrt_Items:is([fpx="1"], [fpx="133"]) { --tab-menu-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%229%22%2F%3E%3Cpath%20d%3D%22M12%207v5l3%202%22%2F%3E%3C%2Fsvg%3E"); }
.TABcrt_Items:is([fpx="5"], [fpx="13"], [fpx="195"]) { --tab-menu-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%225%22%20width%3D%2218%22%20height%3D%2216%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M7%203v4M17%203v4M3%2010h18M7%2014h3M14%2014h3M7%2018h3%22%2F%3E%3C%2Fsvg%3E"); }
.TABcrt_Items[fpx="12"] { --tab-menu-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%206h5M12%206h9M3%2012h11M18%2012h3M3%2018h3M10%2018h11%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%226%22%20r%3D%222%22%2F%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2212%22%20r%3D%222%22%2F%3E%3Ccircle%20cx%3D%228%22%20cy%3D%2218%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E"); }
.TABcrt_Items[fpx="85"] { --tab-menu-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%225%22%20y%3D%222%22%20width%3D%2214%22%20height%3D%2220%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M8%206h8v4H8zM8%2014h1M12%2014h1M16%2014h.1M8%2018h1M12%2018h1M16%2018h.1%22%2F%3E%3C%2Fsvg%3E"); }
.TABcrt_Items:is([fpx="88"], [fpx="132"], [fpx="206"]) { --tab-menu-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%203v18h18M7%2016v-5M12%2016V7M17%2016V9%22%2F%3E%3C%2Fsvg%3E"); }
.TABcrt_Items[fpx="116"] { --tab-menu-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m3%2010%209-7%209%207M5%209v12h14V9M9%2021v-7h6v7M9%209h.1M15%209h.1%22%2F%3E%3C%2Fsvg%3E"); }
.TABcrt_Items[fpx="117"] { --tab-menu-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%229%22%20cy%3D%228%22%20r%3D%223%22%2F%3E%3Cpath%20d%3D%22M3%2021v-2a6%206%200%200%201%2012%200v2M16%205a3%203%200%200%201%200%206M18%2015a5%205%200%200%201%203%204v2%22%2F%3E%3C%2Fsvg%3E"); }
.TABcrt_Items[fpx="193"] { --tab-menu-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M14%202H6a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2V8zM14%202v6h6M8%2013h8M8%2017h5%22%2F%3E%3C%2Fsvg%3E"); }
.TABcrt_Items[fpx="4"] { --tab-menu-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%229%22%20r%3D%226%22%2F%3E%3Cpath%20d%3D%22m8%2014-1%208%205-3%205%203-1-8%22%2F%3E%3C%2Fsvg%3E"); }

.TABcrt > .conents {
    flex: 1 1 0%;
    width: auto !important;
    max-width: 100%;
    min-width: 0;
    height: calc(100vh - 154px) !important;
    height: calc(100dvh - 154px) !important;
    min-height: 200px;
    margin: 0 !important;
    padding: 14px;
    border: 1px solid var(--app-border);
    background-color: #fff;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

#lister_table,
#reporter_result,
.workplansAllEl,
.planfilters_con {
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
}

#lister_table { clear: both; padding-right: 0; }

form, fieldset { max-width: 100%; }
fieldset { min-inline-size: 0; }
legend { max-width: 100%; white-space: normal; }
.fieldClDi, .fieldDiv, .clear2 { max-width: 100%; }
.clear2 { box-sizing: border-box; }

:is(input, select, textarea, button):not(:where([type="hidden"], .datePicker *,
    .ui-datepicker *, .pdp-default *, .pdp-dark *, jdp-container *, .workPlans *, .workPlansA *)) {
    box-sizing: border-box;
    max-width: 100%;
    font-family: inherit;
}

:is(input[type="text"], input[type="password"], input[type="search"],
    input[type="number"], input[type="email"], input[type="tel"], select, textarea):not(:where(
    .datePicker *, .ui-datepicker *, .pdp-default *, .pdp-dark *, jdp-container *, .workPlans *, .workPlansA *)) {
    min-height: 38px;
    padding: 6px 10px;
    font-size: 14px;
}

:is(input[type="submit"], input[type="button"], button):not(:where(
    .datePicker *, .ui-datepicker *, .pdp-default *, .pdp-dark *, jdp-container *, .workPlans *, .workPlansA *)) {
    min-height: 40px;
    white-space: normal;
}

textarea { resize: vertical; }
.planfilters { max-width: calc(100% - 10px); }
.ComboText { max-width: 100%; }

table.tableLister > tbody > tr > td:has(> .minitool) {
    min-width: 112px;
    white-space: nowrap;
}

/* Icons follow existing menu route attributes; no menu markup or routes change. */
#boxContainer > .DeskWork { --home-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221.5%22%2F%3E%3Crect%20x%3D%2214%22%20y%3D%223%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221.5%22%2F%3E%3Crect%20x%3D%223%22%20y%3D%2214%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221.5%22%2F%3E%3Crect%20x%3D%2214%22%20y%3D%2214%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221.5%22%2F%3E%3C%2Fsvg%3E"); }
#boxContainer > .DeskWork[fpx="2"],
#boxContainer > .DeskWork[fpx="6"],
#boxContainer > .DeskWork[fpx="59"] { --home-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%229%22%20cy%3D%228%22%20r%3D%223%22%2F%3E%3Cpath%20d%3D%22M3%2021v-2a6%206%200%200%201%2012%200v2M16%205a3%203%200%200%201%200%206M18%2015a5%205%200%200%201%203%204v2%22%2F%3E%3C%2Fsvg%3E"); }
#boxContainer > .DeskWork[fpx="13"],
#boxContainer > .DeskWork[fpx="14"] { --home-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%229%22%2F%3E%3Cpath%20d%3D%22M12%207v5l3%202%22%2F%3E%3C%2Fsvg%3E"); }
#boxContainer > .DeskWork[fpx="17"] { --home-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%225%22%20width%3D%2218%22%20height%3D%2216%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M7%203v4M17%203v4M3%2010h18M7%2014h3M14%2014h3M7%2018h3%22%2F%3E%3C%2Fsvg%3E"); }
#boxContainer > .DeskWork[fpx="15"] { --home-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%224%22%20y%3D%223%22%20width%3D%2216%22%20height%3D%2218%22%20rx%3D%222%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%229%22%20r%3D%223%22%2F%3E%3Cpath%20d%3D%22M7%2018a5%205%200%200%201%2010%200%22%2F%3E%3C%2Fsvg%3E"); }
#boxContainer > .DeskWork[fpx="23"],
#boxContainer > .DeskWork[fpx="250"] { --home-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%206v15M12%206C9%203%206%203%203%204v15c3-1%206-1%209%202M12%206c3-3%206-3%209-2v15c-3-1-6-1-9%202%22%2F%3E%3C%2Fsvg%3E"); }
#boxContainer > .DeskWork[fpx="27"] { --home-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%227%22%20width%3D%2218%22%20height%3D%2214%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M8%207V4h8v3M3%2012c6%204%2012%204%2018%200M10%2013h4v3h-4z%22%2F%3E%3C%2Fsvg%3E"); }
#boxContainer > .DeskWork[fpx="28"],
#boxContainer > .DeskWork[fpx="231"] { --home-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%229%22%2F%3E%3Cpath%20d%3D%22m7%2012%203%203%207-7%22%2F%3E%3C%2Fsvg%3E"); }
#boxContainer > .DeskWork[fpx="234"] { --home-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%2013v-1a9%209%200%200%201%2018%200v5c0%203-3%204-6%204%22%2F%3E%3Crect%20x%3D%223%22%20y%3D%2211%22%20width%3D%224%22%20height%3D%227%22%20rx%3D%221.5%22%2F%3E%3Crect%20x%3D%2217%22%20y%3D%2211%22%20width%3D%224%22%20height%3D%227%22%20rx%3D%221.5%22%2F%3E%3C%2Fsvg%3E"); }
#boxContainer > .DeskWork[fpx="51"],
#boxContainer > .DeskWork[fpx="240"] { --home-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m12%203%208%203v6c0%205-5%208-8%2010-3-2-8-5-8-10V6zM8%2012l3%203%205-6%22%2F%3E%3C%2Fsvg%3E"); }
#boxContainer > .DeskWork[fpx="62"] { --home-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M20%207H5a2%202%200%200%201%200-4h13v4M3%205v14a2%202%200%200%200%202%202h15V7%22%2F%3E%3Cpath%20d%3D%22M20%2012h-6v5h6M16%2014.5h.1%22%2F%3E%3C%2Fsvg%3E"); }
#boxContainer > .DeskWork[fpx="71"] { --home-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%206h5M12%206h9M3%2012h11M18%2012h3M3%2018h3M10%2018h11%22%2F%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%226%22%20r%3D%222%22%2F%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2212%22%20r%3D%222%22%2F%3E%3Ccircle%20cx%3D%228%22%20cy%3D%2218%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E"); }
#boxContainer > .DeskWork[fpx="94"] { --home-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M20%204a6%206%200%200%200-8%201%206%206%200%200%200-8-1c-6%205%201%2012%208%2017%207-5%2014-12%208-17%22%2F%3E%3Cpath%20d%3D%22M3%2012h5l2-4%204%208%202-4h5%22%2F%3E%3C%2Fsvg%3E"); }
#boxContainer > .DeskWork[fpx="106"] { --home-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%226%22%20width%3D%2218%22%20height%3D%2215%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M8%206V3h8v3M12%2010v7M8.5%2013.5h7%22%2F%3E%3C%2Fsvg%3E"); }
#boxContainer > .DeskWork[fpx="110"],
#boxContainer > .DeskWork[fpx="115"],
#boxContainer > .DeskWork[fpx="170"] { --home-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%203v18h18M7%2016v-5M12%2016V7M17%2016v-8%22%2F%3E%3C%2Fsvg%3E"); }
#boxContainer > .DeskWork[fpx="124"] { --home-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m12%203%209%205-9%205-9-5zM3%208v10l9%205%209-5V8M12%2013v10M7%205.8l9%205%22%2F%3E%3C%2Fsvg%3E"); }
#boxContainer > .DeskWork[fpx="134"] { --home-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%207V5a2%202%200%200%201%202-2h5l3%204h6a2%202%200%200%201%202%202v10a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2z%22%2F%3E%3C%2Fsvg%3E"); }
#boxContainer > .DeskWork[fpx="165"] { --home-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%205h12v12H3zM15%209h4l3%204v4h-7%22%2F%3E%3Ccircle%20cx%3D%227%22%20cy%3D%2218%22%20r%3D%223%22%2F%3E%3Ccircle%20cx%3D%2218%22%20cy%3D%2218%22%20r%3D%223%22%2F%3E%3C%2Fsvg%3E"); }
#boxContainer > .DeskWork[fpx="177"] { --home-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%227%22%2F%3E%3Cpath%20d%3D%22m15%2015%206%206M7%2010h6M10%207v6%22%2F%3E%3C%2Fsvg%3E"); }
#boxContainer > .DeskWork[fpx="174"] { --home-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M5%203h14v19l-3-2-4%202-4-2-3%202zM8%208h8M8%2012h8M8%2016h4%22%2F%3E%3C%2Fsvg%3E"); }
#boxContainer > .DeskWork[fpx="227"] { --home-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%225%22%20y%3D%222%22%20width%3D%2214%22%20height%3D%2220%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M8%206h8v4H8zM8%2014h1M12%2014h1M16%2014h.1M8%2018h1M12%2018h1M16%2018h.1%22%2F%3E%3C%2Fsvg%3E"); }
#boxContainer > .DeskWork[fpx="220"] { --home-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M8%2021v-4H5v-5H3l3-5a8%208%200%201%201%2014%208v6M10%209c1-3%206-3%207%200M10%2012h7%22%2F%3E%3C%2Fsvg%3E"); }

/* Shared list toolbar: keep every existing control and expansion handler.
   Ignore legacy animated widths so the panel never covers or squeezes a table. */
.filterBox {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    max-height: none;
    margin: 0 0 12px !important;
    padding: 10px 12px;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: #f8fafc;
    color: #365168;
    font-size: 13px;
    line-height: 1.9;
    overflow: visible;
    z-index: auto;
    box-shadow: none;
}

.filterBox > :is(#openFilterbox, #closeFilterbox) {
    box-sizing: border-box;
    float: none;
    width: fit-content;
    max-width: 100%;
    height: auto;
    min-height: 36px;
    margin: 0;
    padding: 5px 12px;
    border: 1px solid #cbdde5;
    border-radius: 7px;
    background-color: #fff;
    background-image: none;
    background-position: right 9px center;
    background-size: 16px;
    color: #24556b;
    cursor: pointer;
}

.filterBox > #openFilterbox::after { content: "ابزارها و فیلترها"; }
.filterBox > #closeFilterbox::after { content: "بستن ابزارها و فیلترها"; }
/* The legacy controls open on hover. Keep the close target away from the
   opening pointer so expanding the panel cannot immediately collapse it. */
.filterBox > #closeFilterbox { margin-right: auto; }
.filterBox > :is(#openFilterbox, #closeFilterbox)::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin: 0 0 3px 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
}
.filterBox > #closeFilterbox::before { transform: rotate(225deg); margin-bottom: 0; }
.filterBox > :is(#openFilterbox, #closeFilterbox):hover { background-color: #edf5f7; }

.filterBox_inner { clear: both; padding-top: 12px; }

.filterBox_inner > div:has(> .toolKey) {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 0 12px !important;
    border-bottom: 1px solid var(--app-border);
    margin-bottom: 12px;
}

.filterBox_inner > div:has(> .toolKey) > div[style*="clear"] { display: none; }

.filterBox .toolKey {
    box-sizing: border-box;
    float: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 84px;
    max-width: 100%;
    height: auto;
    min-height: 40px;
    margin: 0;
    padding: 7px 40px 7px 12px;
    border: 1px solid #d5e1e9;
    border-radius: 7px;
    background-color: #fff !important;
    background-position: right 8px center !important;
    background-size: 26px !important;
    color: #294d65;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.8;
    box-shadow: none;
}

.filterBox .toolKey::after { content: attr(title); }
.filterBox .toolKey:hover { border-color: #8ebbbf; background-color: #edf5f7 !important; }
.filterBox .toolKey:active { background-color: #e0efee !important; }

.filterBox #frmTbLister {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 12px;
    margin: 0;
}

.filterBox #frmTbLister > div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 0 !important;
}

.filterBox input[name="pageLimitX"] { width: 64px !important; text-align: center; }
.filterBox input[name="searchStrX"] { flex: 1 1 120px; width: auto !important; min-width: 0; }
.filterBox input[type="text"] {
    border: 1px solid #cbdde5;
    border-radius: 7px;
    background: #fff;
    color: #294d65;
    box-shadow: none;
}
.filterBox input[type="submit"] {
    flex: 0 0 auto;
    min-width: 72px;
    margin: 0;
    padding: 6px 16px;
    border: 1px solid #147d78;
    border-radius: 7px;
    background: #147d78;
    color: #fff;
    box-shadow: none;
}

.filterBox .tbPageNavigat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    margin: 0;
    padding: 0 6px;
    border: 1px solid #d5e1e9;
    border-radius: 7px;
    background: #fff;
    color: #24556b;
    box-shadow: none;
}

.filterBox #lister_currentPage { background: #e9f5f3; color: #116b68; cursor: default; }
.filterBox ul { box-sizing: border-box; list-style: none; margin: 0; padding: 0; min-width: 0; }
.filterBox #frmTbLister > ul {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    align-items: start;
    gap: 6px;
    max-height: 260px;
    max-height: min(32dvh, 300px);
    padding: 10px 0 2px;
    border-top: 1px solid var(--app-border);
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #b5cbd5 #f8fafc;
}

.filterBox li {
    margin: 0;
    padding: 7px 8px;
    border: 1px solid #e1e9ef;
    border-radius: 7px;
    background: #fff;
    overflow-wrap: anywhere;
}

.filterBox li:has(> input:checked) { border-color: #b9d9dc; background: #f0f8f6; }
.filterBox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0 0 0 6px;
    vertical-align: middle;
    accent-color: #147d78;
}

.filterBox .subFilters {
    max-width: 100%;
    margin-top: 8px;
    padding: 6px;
    border-radius: 7px;
    background: #edf3f7;
}
.filterBox .subFilters li { margin-bottom: 4px; border: 0; background: transparent; }
.filterBox .subFilters li:last-child { margin-bottom: 0; }
.filterBox :is(input, select):focus-visible { outline: 2px solid #147d78; outline-offset: 2px; }

@media (max-width: 600px) {
    .filterBox { padding: 8px; }
    .filterBox #frmTbLister { grid-template-columns: minmax(0, 1fr); }
    .filterBox .toolKey { flex: 1 1 90px; }
    .filterBox #frmTbLister > ul { max-height: 240px; max-height: 32dvh; }
}

.dialog, .dialogForm, .help_dialog {
    min-width: 0 !important;
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 12px;
    overflow: auto;
}

.dialogForm {
    position: fixed !important;
    left: 50% !important;
    top: 24px !important;
    transform: translateX(-50%);
    width: max-content;
    margin: 0;
    padding: 14px;
    z-index: 10000;
}

.dialogForm > .content {
    clear: both;
    max-width: 100%;
    max-height: calc(100vh - 108px);
    max-height: calc(100dvh - 108px);
    overflow: auto;
}

.dialogForm .content > div { box-sizing: border-box; max-width: 100%; }
.dialogInerContent { max-width: 100% !important; }
.help_dialog { z-index: 10001; }
.help_dialog :is(video, iframe), .content > :is(img, video, iframe) { max-width: 100%; }
.toast, .ERRBOX { box-sizing: border-box; max-width: calc(100vw - 40px); overflow-wrap: break-word; }

/* Shift/work reports: styling only. Keep every cell, colour and existing hook. */
.workplansAllEl {
    box-sizing: border-box;
    padding: 16px;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background-color: #fff;
}

.workplansAllEl .toolKey {
    box-sizing: border-box;
    border: 1px solid #d4e1ea;
    border-radius: 9px;
    box-shadow: 0 2px 5px rgba(24, 49, 69, .1);
}

.workplansAllEl .toolKey:hover {
    border-color: #7ba9c5;
    box-shadow: 0 0 0 2px rgba(80, 144, 180, .15);
}

.workplansAllEl .toolKey.wp_big {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    font-family: inherit;
    font-size: 18px;
    font-weight: 600;
}

.workplansAllEl form:has(> .planfilters) {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    padding-block: 12px;
}

.workplansAllEl .planfilters {
    float: none;
    flex: 1 1 160px;
    width: auto;
    min-width: 0;
    max-width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 10px;
    border: 1px solid #dce7ef;
    border-radius: 8px;
    background-color: #f4f8fb;
    color: #2e5068;
    font-size: 13px;
    line-height: 1.9;
}

.workplansAllEl .planfilters .opcls {
    width: 26px;
    height: 26px;
    background-size: 16px;
}

.workplansAllEl .subFilters {
    max-height: 280px;
    margin: 8px 0 0;
    padding: 8px 0 0;
    border-top: 1px solid #dce7ef;
    background-color: #fff;
    overflow: auto;
}

.workplansAllEl .inputDatex {
    width: calc(100% - 26px);
    min-width: 0;
    direction: ltr;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.workplansAllEl .subFilters li { list-style: none; margin: 4px 0; }
.workplansAllEl .subFilters label { cursor: pointer; }
.workplansAllEl .subFilters ul { padding-inline-start: 14px; }

.workplansAllEl form:has(> .planfilters) > input[type="submit"] {
    align-self: flex-start;
    min-height: 48px;
    margin: 0;
    padding: 8px 22px;
    border-radius: 8px;
    background-color: #147d78;
    color: #fff;
    box-shadow: 0 2px 5px rgba(24, 49, 69, .12);
}

table.workPlans,
table.workPlansA {
    border-width: 1px;
}

table.workPlans > tbody > tr > th:not([style]):not(:where(.vacation, .Month, .info)) {
    background-color: #edf5fa;
    font-size: 11px;
    line-height: 1.8;
}

table.workPlans .names { font-weight: 600; white-space: nowrap; }

/* The existing shift grid keeps its DOM, IDs, shift colours and handlers. */
table#worksplanTBL.workPlans {
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #cbdce6;
    border-radius: 10px;
    margin: 16px 0;
    color: #26465b;
    font-family: "VazirmatnTable", Tahoma, Geneva, sans-serif;
    font-size: 12px;
    line-height: 1.75;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 3px 12px rgba(24, 49, 69, .07);
}

table#worksplanTBL.workPlans > tbody > tr > :is(th, td) {
    box-sizing: border-box;
    border: 0;
    border-bottom: 1px solid #dce8ec;
    border-inline-end: 1px solid #dce8ec;
    padding: 7px 5px;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.75;
    text-align: center;
    vertical-align: middle;
}

table#worksplanTBL.workPlans > tbody > tr:first-child > th {
    padding: 11px 6px;
    background-color: #edf4f8;
    color: #294e65;
    font-weight: 650;
    white-space: nowrap;
}

table#worksplanTBL.workPlans > tbody > tr:first-child > th.Month {
    background-color: #e3eef5;
    font-size: 14px;
    font-weight: 700;
}

table#worksplanTBL.workPlans > tbody > tr > th.calender {
    min-width: 30px;
    padding: 7px 3px;
    font-size: 11px;
    line-height: 1.65;
}

table#worksplanTBL.workPlans > tbody > tr > th.calender:not(.vacation):not([style]) {
    background-color: #f4f8fb;
}

table#worksplanTBL.workPlans > tbody > tr > th.calender.vacation {
    background-color: #ccc;
    border-bottom-width: 3px;
    border-bottom-color: #00c;
}

table#worksplanTBL.workPlans > tbody > tr > th.calender:hover {
    background-color: #9cc;
}

table#worksplanTBL.workPlans > tbody > tr > td.info {
    background-color: #eff5fa;
    color: #254d66;
    font-size: 12px;
}

table#worksplanTBL.workPlans > tbody > tr > td.info.names {
    min-width: 72px;
    padding-inline: 10px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

table#worksplanTBL.workPlans > tbody > tr > td.info[coltype="name"]:not(.names) {
    min-width: 96px;
    direction: ltr;
    white-space: nowrap;
}

table#worksplanTBL.workPlans > tbody > tr > td.info[coltype="unit"] {
    min-width: 96px;
    max-width: 150px;
    white-space: normal;
    word-break: normal;
}

table#worksplanTBL.workPlans > tbody > tr > td.plan.shifts {
    min-width: 30px;
    padding: 7px 3px;
    font-size: 12px;
    direction: ltr;
    unicode-bidi: isolate;
    white-space: nowrap;
}

table#worksplanTBL.workPlans .shiftooid { font-family: inherit; font-weight: 600; }

table#worksplanTBL.workPlans > tbody > tr.workPlansTR > th {
    min-width: 26px;
    padding: 7px 4px;
    background-color: #f8fafc;
    color: #34556d;
    font-size: 11px;
    font-weight: 600;
}

table#worksplanTBL.workPlans > tbody > tr.workPlansTR > th:last-child {
    min-width: 64px;
    background-color: #eaf4f2;
    color: #19685f;
    font-size: 12px;
    font-weight: 700;
}

table#worksplanTBL.workPlans > tbody > tr:last-child > th {
    padding-block: 10px;
    border-top: 2px solid #b7ceda;
    background-color: #eaf2f7;
    color: #254d66;
    font-weight: 700;
}

table#worksplanTBL.workPlans > tbody > tr.workPlansTR:hover > td.info {
    background-color: #e4eff7;
}

table#worksplanTBL.workPlans > tbody > tr:first-child > th:first-child { border-start-start-radius: 9px; }
table#worksplanTBL.workPlans > tbody > tr:first-child > th:last-child { border-start-end-radius: 9px; }
table#worksplanTBL.workPlans > tbody > tr:last-child > th:first-child { border-end-start-radius: 9px; }
table#worksplanTBL.workPlans > tbody > tr:last-child > th:last-child { border-end-end-radius: 9px; }

@media (max-width: 1024px) {
    #footer > div:nth-child(3) { flex-basis: 100%; }
    #footer > div:nth-child(2) { justify-content: flex-start; }
    #footer #LoginUserInf { margin-inline-start: auto; }
    .TABcrt > .menu { flex-basis: 224px; width: 224px; }
    .TABcrt > .conents { height: calc(100dvh - 178px) !important; padding: 10px; }
    .TABcrt_Items { font-size: 13px; }
    .dialog:not(.comboList) {
        position: fixed !important;
        left: 12px !important;
        right: 12px !important;
        top: 72px !important;
        width: auto !important;
        max-height: calc(100vh - 96px);
        max-height: calc(100dvh - 96px);
        z-index: 10002;
    }
}

@media (max-width: 768px) {
    body { background-image: none; background-color: #edf3f8; }
    #boxContainer { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
    #boxContainer > .DeskWork { min-height: 116px; font-size: 13px; padding: 14px 8px; }
    #boxContainer > .DeskWork > .my-icon { width: 44px !important; height: 44px !important; }
    #boxContainer > .DeskWork > .my-icon::after { inset: 9px; }
    #boxContainer1 > div { padding: 12px !important; }
    #footer { gap: 12px; padding: 12px 16px; }
    #footer > div:nth-child(3) { font-size: 14px !important; }
    div.prompt { padding: 10px; }
    div.TABcrt { flex-direction: column; gap: 10px; }
    .TABcrt > .menu {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px;
        flex: 0 0 auto;
        width: 100%;
        max-height: 200px;
        overflow: auto;
    }
    .TABcrt_Items {
        display: flex;
        align-items: center;
        vertical-align: top;
        width: 100%;
        margin: 0;
        min-height: 48px;
        font-size: 13px;
    }
    .tab-menu-heading { grid-column: 1 / -1; }
    .TABcrt > .conents {
        flex: 0 1 auto;
        width: 100% !important;
        height: auto !important;
        min-height: 260px;
        max-height: 70vh;
        max-height: 70dvh;
        padding: 10px;
        overscroll-behavior: auto;
    }
    .fieldDiv { float: none; width: auto; }
    .fieldClDi, .planfilters { float: none; width: auto; margin: 8px 0; padding: 10px; }
    .fieldClDi > .fieldDiv { width: 100%; }
    .clear2 { width: auto; }
    .planfilters { max-width: 100%; }
    .workplansAllEl { padding: 10px; }
    .workplansAllEl .planfilters { flex-basis: 100%; }
    .workplansAllEl form:has(> .planfilters) > input[type="submit"] { width: 100%; }
    .assessChkl { margin: 8px 0; padding: 6px; overflow-x: auto; }
    #assessForms { margin: 8px 0; padding: 10px; }
    .assessItemsTd { min-width: 180px; }
    .assess-saveBtn { display: inline-block; max-width: 100%; box-sizing: border-box; }
    .dialogForm { top: 12px !important; padding: 10px; }
    .help_dialog { left: 12px; top: 12px; padding: 10px; }
    :is(input[type="text"], input[type="password"], input[type="search"],
        input[type="number"], input[type="email"], input[type="tel"], select, textarea):not(:where(
        .datePicker *, .ui-datepicker *, .pdp-default *, .pdp-dark *, jdp-container *, .workPlans *, .workPlansA *)) {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    #footer { gap: 12px; padding: 12px; border-radius: 0 0 10px 10px; }
    #footer > div:nth-child(3) { gap: 10px; font-size: 13px !important; }
    #footer > div:nth-child(3)::before { flex-basis: 38px; width: 38px; height: 38px; border-radius: 11px; background-size: 26px; }
    #footer > div:nth-child(2) { flex-basis: 100%; justify-content: space-between; gap: 6px; }
    #footer .footerTime { gap: 6px; font-size: 11px; }
    #footer :is(#op_time, #op_date) { gap: 5px; padding: 4px 7px; }
    #footer #op_time { min-width: 92px; }
    #footer #LoginUserInf { flex-basis: 100%; justify-content: space-between; padding-top: 10px; border-top: 1px solid #e4edf2; }
    #footer #LoginUserInf .usernamediv { max-width: calc(100% - 80px); }
    #boxContainer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    div.prompt { padding: 8px; }
    .TABcrt > .conents { padding: 8px; }
    .TABcrt_Items { gap: 8px; padding: 8px; font-size: 12px; }
    .dialogForm .content > div { padding: 12px !important; }
    .dialogForm form > div > span:first-child { display: block !important; width: auto !important; }
    .dialogForm form :is(input[type="text"], input[type="password"], textarea, select) { max-width: 100% !important; }
    .tableLister .minitool { width: 28px; height: 28px; margin: 3px; }
}

@media (max-height: 480px) and (min-width: 769px) {
    .TABcrt > .conents { height: 260px !important; }
    .TABcrt > .menu { max-height: 260px; }
}

@media (prefers-reduced-motion: reduce) {
    #boxContainer > .DeskWork { transition: none; }
    #boxContainer > .DeskWork:hover { transform: none; }
    .TABcrt_Items { transition: none; }
}

/* Create/edit forms: presentation only, including AJAX-inserted forms.
   Keep field names, values, validation colours, order and all event hooks intact. */
/* The legacy lister inserts a div/form directly into its table element. */
.conents #ajax_tableLister:has(> div > form) {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-inline: 0;
    border: 0;
}

:is(.conents, .dialogForm) form:has(> .fieldClDi),
:is(.conents, .dialogForm) fieldset:has(> .fieldClDi) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
    align-items: start;
    gap: 14px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 16px;
    border: 1px solid #dce5ed;
    border-radius: 12px;
    background-color: #f7f9fc;
    color: #263e52;
    font-family: "VazirmatnTable", Tahoma, Geneva, sans-serif;
    font-size: 15px;
    line-height: 1.9;
    direction: rtl;
    text-align: right;
}

:is(.conents, .dialogForm) form .fieldClDi {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-content: start;
    align-items: center;
    align-self: stretch;
    gap: 10px;
    float: none;
    clear: none;
    width: auto;
    min-width: 0;
    max-width: 100%;
    height: auto;
    margin: 0;
    padding: 16px;
    border: 1px solid #d8e3ec;
    border-radius: 12px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgb(24 49 69 / 3%);
    color: #263e52;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.9;
    overflow: visible;
    overflow-wrap: anywhere;
}

:is(.conents, .dialogForm) form .fieldClDi:focus-within {
    border-color: #8dbabf;
    box-shadow: 0 0 0 2px rgb(20 125 120 / 7%);
}

:is(.conents, .dialogForm) .fieldClDi > .fieldDiv {
    grid-column: 1 / -1;
    float: none;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0;
}

:is(.conents, .dialogForm) .fieldClDi > .fieldDiv:first-child {
    color: #29465c;
    font-weight: 600;
}

:is(.conents, .dialogForm) .fieldClDi > .fieldDiv + .fieldDiv {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-weight: 400;
}

:is(.conents, .dialogForm) form :is(input:not([type]), input[type="text"],
    input[type="password"], input[type="email"], input[type="tel"],
    input[type="number"], input[type="search"], input[type="date"],
    input[type="time"], input[type="url"], select, textarea):not(:where(
    .filterBox *, .planfilters *, .workPlans *, .workPlansA *,
    .datePicker *, .ui-datepicker *, .pdp-default *, .pdp-dark *, jdp-container *)) {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 11px 14px;
    border: 1px solid #bdccd8;
    border-radius: 9px;
    background-color: #fff;
    color: #20384e;
    box-shadow: 0 1px 2px rgb(24 49 69 / 3%);
    font-family: "VazirmatnTable", Tahoma, Geneva, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    vertical-align: middle;
}

:is(.conents, .dialogForm) form .fieldClDi :is(input:not([type]),
    input[type="text"], input[type="password"], input[type="email"],
    input[type="tel"], input[type="number"], input[type="search"],
    input[type="date"], input[type="time"], input[type="url"], select, textarea) {
    grid-column: 1 / -1;
    flex: 1 1 100%;
    width: 100% !important;
}

:is(.conents, .dialogForm) form :is(input, select, textarea):focus-visible {
    outline: 2px solid #147d78;
    outline-offset: 2px;
}

:is(.conents, .dialogForm) form :is(input, textarea)::placeholder {
    color: #687e90;
    opacity: 1;
}

:is(.conents, .dialogForm) form :is(input, select, textarea):disabled {
    color: #536879;
    -webkit-text-fill-color: #536879;
    opacity: 1;
    cursor: not-allowed;
}

:is(.conents, .dialogForm) form :is(input, textarea)[readonly] {
    background-color: #f0f4f7;
    color: #40586c;
}

:is(.conents, .dialogForm) form .fieldClDi > :is(div:not(.fieldDiv), label, p),
:is(.conents, .dialogForm) form .fieldClDi > span:not(.minitool),
:is(.conents, .dialogForm) form .fieldClDi .fieldDiv > span:not(.minitool) {
    grid-column: 1 / -1;
    max-width: 100%;
}

:is(.conents, .dialogForm) form .fieldClDi span[style*="font-size:9px"],
:is(.conents, .dialogForm) form .fieldClDi span[style*="font-size: 9px"] {
    flex-basis: 100%;
    color: #5a7082;
    font-size: 12px !important;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

:is(.conents, .dialogForm) form .fieldClDi:has(textarea),
:is(.conents, .dialogForm) form:has(> .fieldClDi) > :is(fieldset, .clear),
:is(.conents, .dialogForm) form:has(> .fieldClDi) > input[type="submit"],
:is(.conents, .dialogForm) form:has(> .fieldClDi) > div:not(.fieldClDi) {
    grid-column: 1 / -1;
}

:is(.conents, .dialogForm) form textarea,
:is(.conents, .dialogForm) form .fieldClDi textarea {
    min-height: 160px;
    height: auto;
    resize: vertical;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

/* Searchable combos retain their two existing navigation controls. */
:is(.conents, .dialogForm) form .fieldClDi input:is(.comboText, .comboTextFree,
    .assesscomboText, .comboText_ajax):has(~ .ComboText) {
    grid-column: 1;
    grid-row: 2;
    flex: 1 1 120px;
    width: calc(100% - 88px) !important;
    padding-left: 36px;
}

:is(.conents, .dialogForm) form .fieldClDi > .minitool.ComboText {
    grid-row: 2;
}

:is(.conents, .dialogForm) form .fieldClDi > input:is(.comboText, .comboTextFree,
    .assesscomboText, .comboText_ajax):has(~ .ComboText) {
    width: 100% !important;
}

:is(.conents, .dialogForm) form .fieldClDi .minitool.ComboText {
    float: none;
    flex: 0 0 34px;
    width: 34px;
    height: 40px;
    margin: 0;
    align-self: center;
    vertical-align: middle;
}

/* Time and vehicle plate segments remain distinct, readable inputs. */
:is(.conents, .dialogForm) form .fieldClDi input:is(.timeX, .inputDatex, [data-jdp]) {
    min-width: min(100%, 104px);
    direction: ltr;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

:is(.conents, .dialogForm) form .fieldClDi:has(input[name^="plq1_"]) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

:is(.conents, .dialogForm) form .fieldClDi input[name^="plq"] {
    flex: 0 1 64px;
    width: 64px !important;
    min-width: 48px;
    padding-inline: 4px;
    text-align: center;
}

:is(.conents, .dialogForm) form .fieldClDi:has(> input:is([type="checkbox"], [type="radio"])) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

:is(.conents, .dialogForm) form input:is([type="checkbox"], [type="radio"]) {
    flex: 0 0 auto;
    width: 18px !important;
    height: 18px;
    min-height: 0;
    margin: 4px;
    vertical-align: middle;
    accent-color: #147d78;
}

:is(.conents, .dialogForm) form input[type="submit"] {
    justify-self: start;
    min-width: 128px;
    min-height: 48px;
    margin: 6px 0 0;
    padding: 9px 24px;
    border: 1px solid #116b68;
    border-radius: 8px;
    background-color: #147d78;
    color: #fff;
    box-shadow: none;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.8;
    cursor: pointer;
}

:is(.conents, .dialogForm) form input[type="submit"].costomBtn {
    padding-right: 42px;
    background-position: right 8px center;
}

:is(.conents, .dialogForm) form input[type="submit"]:hover { background-color: #116b68; }

:is(.conents, .dialogForm) #UpForm:is([cfx="insert"], [cfx="updated"], [cfx="upDateForm2"])::before {
    grid-column: 1 / -1;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e8ef;
    color: #29465c;
    font-size: 18px;
    font-weight: 600;
}

:is(.conents, .dialogForm) #UpForm[cfx="insert"]::before { content: "ایجاد اطلاعات"; }
:is(.conents, .dialogForm) #UpForm:is([cfx="updated"], [cfx="upDateForm2"])::before { content: "ویرایش اطلاعات"; }

/* Related-record editors keep their table headers and every existing row. */
:is(.conents, .dialogForm) form#frmansGr {
    width: 100%;
    min-width: 0;
    padding-block: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
}

:is(.conents, .dialogForm) form#frmansGr > table {
    width: max-content !important;
    min-width: 100%;
    margin: 0;
    border-collapse: collapse;
    table-layout: auto !important;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.9;
}

:is(.conents, .dialogForm) form#frmansGr > table > tbody > tr > :is(th, td) {
    min-width: 140px;
    padding: 12px;
    border: 1px solid #dce5ed;
    vertical-align: top;
    font-size: 14px;
    overflow-wrap: anywhere;
}

:is(.conents, .dialogForm) form#frmansGr th { background-color: #edf5f6; color: #29465c; }

/* Access checklists use existing labels; only their layout changes. */
.dialogForm form:is(#userAccessManager, #unitAccessManager, #hospitalsAccessManager,
    #cityAccessManager, #signsAccessManager),
.dialogForm #certAccessForm > ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 10px;
    margin: 12px 0;
    padding: 0;
    list-style: none;
}

.dialogForm form:is(#userAccessManager, #unitAccessManager, #hospitalsAccessManager,
    #cityAccessManager, #signsAccessManager) > div:has(label),
.dialogForm #certAccessForm > ul > div {
    float: none !important;
    min-width: 0;
    margin: 0 !important;
    padding: 12px !important;
    border: 1px solid #dce5ed;
    border-radius: 8px;
    background-color: #fff !important;
    font-size: 14px;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

.dialogForm form:is(#userAccessManager, #unitAccessManager, #hospitalsAccessManager,
    #cityAccessManager, #signsAccessManager) > input[type="submit"] { grid-column: 1 / -1; }
.dialogForm #certAccessForm li { list-style: none; }

.dialogForm:has(form) {
    box-sizing: border-box;
    width: min(960px, calc(100vw - 32px));
    max-height: calc(100dvh - 48px);
    padding: 16px;
    border: 1px solid #cadbe4;
    background-color: #f5f8fb;
    color: #263e52;
    box-shadow: 0 16px 56px rgb(24 49 69 / 22%);
}

.dialogForm:has(form) > .closeBtn {
    position: sticky;
    top: 0;
    margin: 0 0 12px;
}

.dialogForm:has(form) > .content {
    max-height: calc(100dvh - 130px);
    padding: 2px;
    scrollbar-width: thin;
    scrollbar-color: #b7cbd5 #f5f8fb;
}

.dialogForm .content > div:has(> form) {
    width: auto !important;
    min-width: 0;
    padding: 0 !important;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.9;
}

/* Older hand-written dialog forms use spans for labels instead of fieldClDi. */
.dialogForm form:not(:has(.fieldClDi)) > div:has(> :is(input:not([type="hidden"]), select, textarea)) {
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    margin-block: 12px;
    padding: 12px;
    border: 1px solid #e0e8ef;
    border-radius: 8px;
    background-color: #fff;
}

.dialogForm form:not(:has(.fieldClDi)) > div > span:first-child {
    width: 100% !important;
    font-size: 14px;
    line-height: 1.9;
}

.dialogForm form:not(:has(.fieldClDi)) > :is(input[type="text"], input[type="password"], select, textarea) {
    display: block;
    width: 100% !important;
    max-width: 100%;
    margin-block: 8px 12px;
}

@media (max-width: 768px) {
    :is(.conents, .dialogForm) form:has(> .fieldClDi),
    :is(.conents, .dialogForm) fieldset:has(> .fieldClDi) {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        padding: 12px;
    }
    :is(.conents, .dialogForm) form .fieldClDi { padding: 12px; }
    :is(.conents, .dialogForm) form :is(input:not([type]), input[type="text"],
        input[type="password"], input[type="email"], input[type="tel"],
        input[type="number"], input[type="search"], input[type="date"],
        input[type="time"], input[type="url"], select, textarea) { font-size: 16px; }
    .dialogForm:has(form) { top: 12px !important; padding: 12px; max-height: calc(100dvh - 24px); }
    .dialogForm:has(form) > .content { max-height: calc(100dvh - 104px); }
}

@media (max-width: 480px) {
    :is(.conents, .dialogForm) form:has(> .fieldClDi),
    :is(.conents, .dialogForm) fieldset:has(> .fieldClDi) { padding: 10px; gap: 10px; }
    :is(.conents, .dialogForm) form .fieldClDi { padding: 10px; }
    :is(.conents, .dialogForm) form input[type="submit"] { width: 100%; }
}

/* Percase data confirmation: keep the existing filter controls above the results. */
.conents div:has(> div > form[cnx="percase"][cfx="itemCert1"]) {
    position: static !important;
    display: flow-root;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 !important;
}

.conents form[cnx="percase"][cfx="itemCert1"] {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
    padding: 16px;
}

.conents form[cnx="percase"][cfx="itemCert1"] > .fieldClDi {
    flex: 1 1 220px;
    min-width: min(100%, 220px);
    align-self: auto;
    gap: 8px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.conents form[cnx="percase"][cfx="itemCert1"] > input[type="submit"] {
    flex: 0 0 128px;
    width: auto;
    margin: 0;
}

.conents div:has(> div > form[cnx="percase"][cfx="itemCert1"]) + #itemCert1Forms {
    clear: both;
    margin-top: 16px;
}

/* The old report offset made room for the fixed filter; it now follows the form. */
.conents div:has(> div > form[cnx="percase"][cfx="itemCert1"]) + #itemCert1Forms > div[style*="padding-top"] {
    padding-top: 0 !important;
}

@media (max-width: 600px) {
    .conents form[cnx="percase"][cfx="itemCert1"] { padding: 12px; }
    .conents form[cnx="percase"][cfx="itemCert1"] > .fieldClDi,
    .conents form[cnx="percase"][cfx="itemCert1"] > input[type="submit"] {
        flex-basis: 100%;
    }
}

/* Work calculation: compact inline editor inside the Operations column. */
@media screen {
    table.percaseitbx .itbx:has(form[cnx="staffsworks"][cfx="staffkarkardsReg"]) {
        box-sizing: border-box;
        width: 280px;
        min-width: 280px;
        margin-top: 8px;
        text-align: right;
    }

    :is(.conents, .dialogForm) form[cnx="staffsworks"][cfx="staffkarkardsReg"] {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        padding: 12px;
        border-color: #d5e5e8;
        border-radius: 10px;
        background: #f5fafb;
        font-size: 13px;
        line-height: 1.7;
    }

    :is(.conents, .dialogForm) form[cnx="staffsworks"][cfx="staffkarkardsReg"] > .fieldClDi {
        grid-template-columns: minmax(0, 1fr) 82px;
        align-content: center;
        align-items: center;
        gap: 6px 10px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        font-size: 13px;
        line-height: 1.8;
        overflow-wrap: normal;
    }

    :is(.conents, .dialogForm) form[cnx="staffsworks"][cfx="staffkarkardsReg"] > .fieldClDi > :is(input[type="text"], input[type="number"], textarea) {
        grid-column: 2;
        width: 100% !important;
        min-height: 36px;
        height: 36px;
        padding: 5px 8px;
        border-radius: 7px;
        font-size: 14px;
        line-height: 1.6;
        direction: ltr;
        text-align: center;
        font-variant-numeric: tabular-nums;
    }

    /* These generated metadata hints duplicate input titles and include bare commas. */
    :is(.conents, .dialogForm) form[cnx="staffsworks"][cfx="staffkarkardsReg"] > .fieldClDi > span[style*="font-size:9px"] {
        display: none;
    }

    :is(.conents, .dialogForm) form[cnx="staffsworks"][cfx="staffkarkardsReg"] > .fieldClDi:has([name="comment"]) {
        grid-template-columns: minmax(0, 1fr);
    }

    :is(.conents, .dialogForm) form[cnx="staffsworks"][cfx="staffkarkardsReg"] > .fieldClDi > :is(input, textarea)[name="comment"] {
        grid-column: 1 / -1;
        direction: rtl;
        text-align: right;
    }

    :is(.conents, .dialogForm) form[cnx="staffsworks"][cfx="staffkarkardsReg"] > .fieldClDi > textarea[name="comment"] {
        min-height: 72px;
        height: 72px;
        resize: vertical;
    }

    :is(.conents, .dialogForm) form[cnx="staffsworks"][cfx="staffkarkardsReg"] > input[type="submit"] {
        width: 100%;
        min-height: 36px;
        margin: 2px 0 0;
        padding: 6px 12px;
        font-size: 13px;
    }
}
/* Percase calculation: align only this form's existing controls. */
@media screen {
    form#UpForm[cnx="percase"][cfx="percasecomputing"] {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        align-items: center;
        gap: 16px;
        padding: 16px;
    }

    form#UpForm[cnx="percase"][cfx="percasecomputing"] > .fieldDiv {
        float: none;
        min-width: 0;
        margin: 0 !important;
    }

    form#UpForm[cnx="percase"][cfx="percasecomputing"] > .fieldDiv:has(> .comboText) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 30px 30px;
        align-items: center;
        gap: 8px 6px;
        line-height: 24px;
    }

    form#UpForm[cnx="percase"][cfx="percasecomputing"] > .fieldDiv > input.comboText {
        grid-column: 1;
        grid-row: 2;
        width: 100% !important;
        min-width: 0;
        max-width: 100%;
        height: 48px;
        margin: 0;
    }

    form#UpForm[cnx="percase"][cfx="percasecomputing"] > .fieldDiv > .minitool.ComboText {
        grid-row: 2;
        margin: 0;
    }

    form#UpForm[cnx="percase"][cfx="percasecomputing"] > #allsDiv {
        grid-column: 1 / -2;
        order: 1;
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 48px;
    }

    form#UpForm[cnx="percase"][cfx="percasecomputing"] > .fieldDiv:has(> input[type="submit"]) {
        grid-column: -2 / -1;
        order: 2;
        justify-self: end;
    }

    form#UpForm[cnx="percase"][cfx="percasecomputing"] > .fieldDiv > input[type="submit"] {
        min-height: 48px;
        margin: 0;
    }

    form#UpForm[cnx="percase"][cfx="percasecomputing"] > div:not(.fieldDiv) {
        grid-column: 1 / -1;
        order: 3;
        min-width: 0;
    }

    form#UpForm[cnx="percase"][cfx="percasecomputing"] > .clear { display: none; }
}

@media screen and (max-width: 1440px) {
    form#UpForm[cnx="percase"][cfx="percasecomputing"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 720px) {
    form#UpForm[cnx="percase"][cfx="percasecomputing"] {
        grid-template-columns: minmax(0, 1fr);
        padding: 12px;
    }
    form#UpForm[cnx="percase"][cfx="percasecomputing"] > #allsDiv,
    form#UpForm[cnx="percase"][cfx="percasecomputing"] > .fieldDiv:has(> input[type="submit"]) {
        grid-column: 1 / -1;
    }
    form#UpForm[cnx="percase"][cfx="percasecomputing"] > .fieldDiv:has(> input[type="submit"]),
    form#UpForm[cnx="percase"][cfx="percasecomputing"] > .fieldDiv > input[type="submit"] {
        width: 100%;
    }
}

/* Shared personnel item editor in registration and data confirmation. */
@media screen {
    .percaseItemsHost:not(:empty),
    table.percaseitbx .itbx:has(form[cnx="percase"][cfx="staffItemsReg"]) {
        box-sizing: border-box;
        width: 480px;
        min-width: 0;
        max-width: calc(100vw - 64px);
    }
    .percaseItemsEditor { padding: 12px 0 0; }
    .percaseItemsEditor > strong {
        display: block;
        padding: 0 4px 10px;
        color: #204858;
        font-family: "VazirmatnTable", Tahoma, sans-serif;
        font-size: 14px;
        line-height: 1.8;
    }
    :is(.conents, .dialogForm) form[cnx="percase"]:is([cfx="staffItemsReg"], [cfx="confirmationItemsReg"]) {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
        gap: 14px 16px;
        margin: 8px 0 0;
        padding: 18px;
        border: 1px solid #d8e6eb;
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 6px 20px rgb(24 61 76 / 6%);
        color: #355568;
        font-size: 13px;
        line-height: 1.7;
    }
    :is(.conents, .dialogForm) form[cnx="percase"]:is([cfx="staffItemsReg"], [cfx="confirmationItemsReg"]) > .fieldClDi {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-content: start;
        gap: 6px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        font-size: 12px;
        line-height: 1.7;
        font-weight: 500;
    }
    :is(.conents, .dialogForm) form[cnx="percase"]:is([cfx="staffItemsReg"], [cfx="confirmationItemsReg"]) > .fieldClDi:has(.comboText) {
        grid-column: 1 / -1;
        grid-template-columns: minmax(0, 1fr) 34px 34px;
    }
    :is(.conents, .dialogForm) form[cnx="percase"]:is([cfx="staffItemsReg"], [cfx="confirmationItemsReg"]) input[type="text"] {
        box-sizing: border-box;
        width: 100% !important;
        min-height: 42px;
        padding: 8px 12px;
        border: 1px solid #cbdbe3;
        border-radius: 8px;
        background-color: #fff !important;
        box-shadow: 0 1px 2px rgb(24 61 76 / 3%);
        color: #204858;
        font-size: 14px;
        font-weight: 500;
        line-height: 1.5;
        direction: ltr;
        text-align: center;
        font-variant-numeric: tabular-nums;
    }
    :is(.conents, .dialogForm) form[cnx="percase"]:is([cfx="staffItemsReg"], [cfx="confirmationItemsReg"]) input.comboText {
        direction: rtl;
        text-align: right;
    }
    :is(.conents, .dialogForm) form[cnx="percase"]:is([cfx="staffItemsReg"], [cfx="confirmationItemsReg"]) input[type="text"]:focus {
        border-color: #16867f;
        outline: 0;
        box-shadow: 0 0 0 3px rgb(22 134 127 / 10%);
    }
    :is(.conents, .dialogForm) form[cnx="percase"]:is([cfx="staffItemsReg"], [cfx="confirmationItemsReg"]) input[type="submit"] {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 44px;
        margin: 2px 0 0;
        padding: 10px 18px;
        border: 1px solid #117d76;
        border-radius: 9px;
        background: #117d76;
        box-shadow: none;
        color: #fff;
        font-size: 14px;
        font-weight: 600;
    }
    :is(.conents, .dialogForm) form[cnx="percase"]:is([cfx="staffItemsReg"], [cfx="confirmationItemsReg"]) input[type="submit"]:hover { background: #0d6c66; }
    .percaseItemsEditor > [role="status"]:not(:empty) { padding: 10px 4px 0; font-size: 13px; }
}
@media screen and (max-width: 600px) {
    :is(.conents, .dialogForm) form[cnx="percase"]:is([cfx="staffItemsReg"], [cfx="confirmationItemsReg"]) {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        padding: 14px;
    }
    :is(.conents, .dialogForm) form[cnx="percase"]:is([cfx="staffItemsReg"], [cfx="confirmationItemsReg"]) input[type="text"] { font-size: 16px; }
}
