/* UFOMS UI v0.2 — mobile-first, logical-direction CSS, no external CDN dependencies */
:root{color-scheme:light;--ink:#1b3041;--nav:#152e40;--nav-soft:#203b4e;--nav-txt:#dce8ed;--accent:#087f86;--accent-dark:#056970;--bg:#f4f7f8;--card:#fff;--line:#dce6ea;--muted:#657681;--gold:#d2a455;--shadow:0 8px 28px rgba(20,46,64,.065);font-family:system-ui,-apple-system,'Segoe UI',Tahoma,Arial,sans-serif}
*,*::before,*::after{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--ink);line-height:1.65;min-width:280px;-webkit-text-size-adjust:100%;text-size-adjust:100%}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.54}a{color:#08717b;text-underline-offset:3px}a:hover{color:var(--accent-dark)}h1{font-size:clamp(1.24rem,2.6vw,1.75rem);margin:0 0 18px;line-height:1.4;letter-spacing:-.025em}h2{font-size:1.05rem;margin:0 0 12px}h3{font-size:.96rem;margin:20px 0 10px}p{margin:0 0 12px}.help{color:var(--muted);font-size:.84rem}.skip-link{position:absolute;top:-90px;inset-inline-start:16px;background:white;padding:10px;z-index:100}.skip-link:focus{top:12px}.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.app-shell{min-height:100dvh}.sidebar{position:fixed;z-index:60;top:0;bottom:0;inset-inline-start:0;width:min(310px,88vw);display:flex;flex-direction:column;background:var(--nav);color:var(--nav-txt);transform:translateX(-110%);transition:transform .2s ease;box-shadow:0 12px 35px #0002;overflow-y:auto;overscroll-behavior:contain}html[dir=rtl] .sidebar{transform:translateX(110%)}body.sidebar-open .sidebar{transform:translateX(0)}.sidebar-backdrop{display:none;position:fixed;inset:0;z-index:55;background:rgba(7,22,33,.54)}body.sidebar-open .sidebar-backdrop{display:block}.brand-block{padding:24px 21px;display:flex;align-items:center;gap:12px;border-bottom:1px solid #ffffff1e}.brand-mark,.brand-chip{display:grid;place-items:center;width:42px;height:42px;background:linear-gradient(140deg,#22a5a2,#087c81);border-radius:13px;color:#fff;font-weight:900;box-shadow:0 6px 14px #0002;font-size:1.35rem;flex-shrink:0}.brand-copy{display:flex;flex-direction:column;line-height:1.4}.brand-copy strong{font-size:1.15rem;color:#fff;letter-spacing:.06em}.brand-copy small{font-size:.72rem;color:#9fb6c5;max-width:200px}.nav-section-heading{font-weight:700;font-size:.72rem;letter-spacing:.03em;color:#91abba;padding:22px 22px 8px}.side-nav{padding:0 12px;display:grid;gap:4px}.nav-link{display:flex;align-items:center;gap:11px;min-height:46px;padding:10px 12px;color:var(--nav-txt);border-radius:10px;text-decoration:none;font-size:.91rem;font-weight:550}.nav-link:hover{background:#ffffff16;color:white}.nav-link.is-active{background:#d2edef19;color:white;box-shadow:inset 3px 0 0 #67c9bf}.nav-glyph{display:grid;place-items:center;width:24px;font-size:1.15rem;color:#b9ced5}.nav-counter{margin-inline-start:auto;background:#fff;color:var(--nav);border-radius:50px;padding:0 7px;font-size:.72rem}.sidebar-bottom{margin-top:auto;border-top:1px solid #ffffff23;padding:18px}.sidebar-identity{display:flex;align-items:center;gap:10px;min-width:0;margin-bottom:14px}.avatar{width:38px;height:38px;border-radius:12px;background:#3b5c68;color:white;font-weight:800;display:grid;place-items:center}.identity-text{min-width:0;display:flex;flex-direction:column;line-height:1.4}.identity-text strong{color:white;font-size:.85rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.identity-text small{color:#a9bfca;font-size:.7rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:ltr;text-align:start}.sidebar-signout{width:100%;background:#ffffff14;border:1px solid #ffffff30;border-radius:9px;color:white;padding:10px}.sidebar-signout:hover{background:#ffffff24}.sidebar-close{margin-inline-start:auto;color:white}
.main-shell{min-width:0}.topbar{height:auto;min-height:72px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 14px;position:sticky;top:0;z-index:30;box-shadow:0 3px 14px #22364607}.topbar-leading,.topbar-actions{display:flex;align-items:center;gap:10px;min-width:0}.topbar-heading{min-width:0;display:flex;flex-direction:column;line-height:1.35}.topbar-heading strong{font-size:.94rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.topbar-heading small{color:var(--muted);font-size:.7rem;display:none}.icon-button,.notification-shortcut{border:1px solid var(--line);background:#f5f9fa;min-width:40px;height:40px;border-radius:10px;display:grid;place-items:center;font-size:1.2rem;color:var(--ink);text-decoration:none;flex-shrink:0}.sidebar-close{background:#ffffff13;border:0}.notification-shortcut{position:relative}.dot{position:absolute;top:7px;inset-inline-end:7px;width:7px;height:7px;border-radius:100%;background:#d96852}.locale-form{display:flex;align-items:center;gap:5px}.locale-form select{width:100px;height:40px;padding:6px;font-size:.79rem}.locale-apply{height:40px;padding:6px 9px;font-size:.78rem;background:var(--nav);white-space:nowrap}.brand-chip{width:36px;height:36px}.guest-session .topbar{padding-inline:clamp(14px,6vw,70px)}.guest-session .topbar-heading{flex-direction:row;align-items:center;gap:12px}.guest-session .topbar-heading small{display:none}
.page-content{padding:19px 14px 36px;width:100%;max-width:1560px;margin:0 auto}.page-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;margin-bottom:18px}.page-heading h1{margin:0}.panel{background:var(--card);border:1px solid var(--line);box-shadow:var(--shadow);border-radius:16px;padding:18px;margin-bottom:16px;min-width:0}.grid{display:grid;grid-template-columns:1fr;gap:15px}.row{display:flex;gap:13px;align-items:end;flex-wrap:wrap}.row>div{flex:1 1 180px;min-width:0}label{display:block;font-weight:650;font-size:.82rem;margin-bottom:6px}input:not([type=checkbox]),select,textarea{width:100%;max-width:100%;background:#fff;color:var(--ink);border:1px solid #c9d5dd;border-radius:9px;padding:10px 12px;min-height:44px;font-size:.93rem;outline:none;transition:border .15s,box-shadow .15s}input:focus,select:focus,textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px #087f8624}input[type=checkbox]{accent-color:var(--accent);width:17px;height:17px;flex-shrink:0}.field{min-width:0}.btn,button:not(.icon-button):not(.sidebar-signout):not(.locale-apply){display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;background:var(--accent);color:white;font-weight:650;font-size:.9rem;text-decoration:none;border-radius:9px;min-height:43px;padding:9px 16px}.btn:hover,button:not(.icon-button):not(.sidebar-signout):not(.locale-apply):hover{background:var(--accent-dark);color:white}.btn-outline,button.btn-outline{background:white!important;color:var(--accent)!important;border:1px solid #a5cbd1!important}.btn.danger,button.danger{background:#aa4545!important}.btn.secondary,button.secondary{background:#5a6d78!important}.checkline{display:inline-flex;align-items:center;gap:9px;padding:8px 11px;border-radius:9px;border:1px solid var(--line);margin:4px 5px 4px 0;font-weight:500;font-size:.85rem;cursor:pointer;max-width:100%}.checkline:has(input:checked){background:#e8f6f6;border-color:#b0dad9}.form-actions{padding-top:10px}.table-wrap{overflow-x:auto;max-width:100%;-webkit-overflow-scrolling:touch;border-radius:11px}table{width:100%;border-collapse:separate;border-spacing:0;min-width:530px;font-size:.88rem}th,td{text-align:start;border-bottom:1px solid #e7edef;padding:12px 14px;vertical-align:middle}th{background:#f0f5f6;font-size:.79rem;color:#526875;font-weight:750;white-space:nowrap}tbody tr:hover{background:#fbfdfd}td:first-child,th:first-child{border-inline-start:1px solid #edf1f3}td:last-child,th:last-child{border-inline-end:1px solid #edf1f3}.stat-card{display:flex;align-items:center;justify-content:space-between;gap:12px}.stat-label{font-size:.85rem;color:var(--muted)}.stat-value{font-size:clamp(1.7rem,4vw,2.25rem);line-height:1.1;font-weight:800;color:var(--nav)}.stat-icon{background:#e6f5f3;color:var(--accent);width:50px;height:50px;border-radius:15px;display:grid;place-items:center;font-size:1.6rem}.alert{padding:13px 16px;border-radius:11px;margin-bottom:15px}.alert.success{background:#e5f6ed;border:1px solid #aee0c3}.alert.errors{background:#fff0f0;border:1px solid #eac4c4}.alert ul{margin:7px 0 0;padding-inline-start:20px}.badge{display:inline-flex;align-items:center;border-radius:30px;padding:3px 9px;background:#e8eff1;color:#3c626a;font-size:.75rem;font-weight:600}.badge.status-ok{background:#e3f6eb;color:#216b43}.badge.status-off{background:#f8e9e9;color:#9b4141}.push-panel{display:flex;flex-direction:column;gap:12px}.push-panel p{margin:0}.push-control{display:flex;flex-wrap:wrap;align-items:center;gap:10px}.notification-item{padding:16px 0;border-bottom:1px solid var(--line)}.notification-item:last-child{border-bottom:0}.notification-item.is-read{opacity:.62}.notification-item p{margin:5px 0}.login-wrap{display:grid;max-width:960px;margin:clamp(22px,6vw,75px) auto;grid-template-columns:1fr;box-shadow:var(--shadow);background:#fff;border:1px solid var(--line);border-radius:20px;overflow:hidden}.login-visual{padding:32px;color:#fff;background:linear-gradient(150deg,#1a394b,#146777);min-height:190px;display:flex;flex-direction:column;justify-content:space-between;position:relative;overflow:hidden}.login-visual:before{content:"";width:270px;height:270px;border:1px solid #ffffff30;border-radius:50%;position:absolute;inset-inline-end:-80px;top:-85px;box-shadow:0 0 0 45px #ffffff08,0 0 0 100px #ffffff05}.login-visual>*{position:relative}.login-visual h2{font-size:1.65rem;max-width:300px}.login-form{padding:32px 22px}.login-form h1{margin:0 0 7px}.login-form p{margin-bottom:18px}.login-form .btn, .login-form button{width:100%}.muted-code{font-size:.77rem;color:var(--muted);direction:ltr;unicode-bidi:plaintext}.user-form{padding:20px 0;border-bottom:1px solid var(--line)}.user-form:last-child{border-bottom:0}.user-header{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-bottom:12px}.user-header strong{font-weight:750}.page-section{margin-top:22px}form.inline{display:inline}.inline-direction{direction:ltr;unicode-bidi:plaintext;display:inline-block}.pagination{margin-top:16px}button:focus-visible,a:focus-visible{outline:3px solid #e1b75e;outline-offset:2px}
@media(min-width:600px){.grid{grid-template-columns:repeat(2,minmax(0,1fr))}.page-content{padding:26px 25px 48px}.panel{padding:24px}.topbar{padding-inline:25px}.topbar-heading small{display:block}.locale-form select{width:116px}.login-form{padding:42px}}
@media(min-width:980px){.sidebar{transform:none!important;box-shadow:none;width:258px}html[dir=rtl] .sidebar{transform:none!important}.sidebar-backdrop,.sidebar-close,.menu-button{display:none!important}.main-shell{margin-inline-start:258px}.topbar{min-height:78px}.page-content{padding:30px 35px 60px}.push-panel{flex-direction:row;align-items:center;justify-content:space-between}.login-wrap{grid-template-columns:1fr 1.12fr}.login-visual{min-height:460px;padding:48px}.login-form{align-self:center;padding:50px}}
@media(min-width:1280px){.grid{grid-template-columns:repeat(3,minmax(0,1fr))}.fields-two{grid-template-columns:repeat(2,minmax(0,1fr))}.sidebar{width:275px}.main-shell{margin-inline-start:275px}}
@media(max-width:370px){.topbar-heading strong{font-size:.78rem}.locale-form select{width:80px}.locale-apply{padding:5px 7px}.notification-shortcut{display:none}.panel{padding:14px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important}}
@media print{.sidebar,.sidebar-backdrop,.topbar,.push-panel,button,.btn{display:none!important}.main-shell{margin:0}.page-content{max-width:none;margin:0;padding:0}.panel{box-shadow:none;border-color:#ccc}body{background:white}}

/* UFOMS v0.3 unified tables, responsive theme and identity */
.brand-mark img{max-width:100%;max-height:100%;object-fit:contain;border-radius:8px}.ufoms-table-tools{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:16px}.ufoms-table-tools input{flex:1 1 180px;max-width:440px}.ufoms-table-tools .btn{flex:0 0 auto}.ufoms-pager{border-top:1px solid var(--line);padding-top:14px;margin-top:16px;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:.86rem;color:var(--muted)}.ufoms-pager-links{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.ufoms-pager-links>a,.pager-disabled{border:1px solid var(--line);border-radius:9px;padding:7px 11px;text-decoration:none}.pager-disabled{opacity:.5;cursor:default}.color-input{height:52px;max-width:180px;padding:4px!important;cursor:pointer}.panel-muted{padding:12px 14px;border-radius:10px;background:var(--bg);margin-top:14px}.ufoms-ai-button{margin-top:14px}.field textarea{resize:vertical;min-height:70px}a{color:var(--accent)}.stat-value{color:var(--nav)}.sidebar .nav-link.is-active{border-inline-start:3px solid var(--accent)}
@media(max-width:620px){.ufoms-table-tools{align-items:stretch}.ufoms-table-tools input{max-width:none;width:100%;flex-basis:100%}.ufoms-table-tools .btn{flex:1 1 auto}.ufoms-pager{flex-direction:column;align-items:stretch}.ufoms-pager-links{justify-content:space-between}}

:root{--accent-dark:color-mix(in srgb,var(--accent),black 18%)}
/* UFOMS v0.4 interactive order/approval rows */
.multi-line,.workflow-step{padding:12px;border:1px solid var(--line);border-radius:10px;margin:10px 0;align-items:end}.multi-line>button,.workflow-step>button{justify-self:start}.approval-decision-form{display:flex;flex-wrap:wrap;gap:7px;align-items:center;min-width:230px}.approval-decision-form select{width:145px}.approval-decision-form input{max-width:260px;min-width:160px}.sign-footer{padding-top:18px}.field+.field{margin-top:8px}

/* UFOMS v0.5: responsive inspection questionnaire */
.ufoms-question{border:1px solid #d5dce7;border-radius:14px;padding:1rem;margin:1rem 0;background:var(--bg,#fff)}
.ufoms-question-title,.ufoms-visit-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:1rem}
.ufoms-options{display:flex;gap:.65rem;flex-wrap:wrap;padding:.8rem 0}
.ufoms-option{border:1px solid #d5dce7;border-radius:12px;padding:.7rem 1rem;display:flex;gap:.5rem;align-items:center;min-width:108px;cursor:pointer}
.ufoms-option:has(input:checked){border-color:var(--accent,#2563eb);box-shadow:0 0 0 1px var(--accent,#2563eb)}
.ufoms-score{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;padding:1rem;border-radius:14px;background:rgba(65,122,165,.07);font-size:1.3rem}
.ufoms-filter-row,.ufoms-media-list,.ufoms-action-stack{display:flex;gap:.65rem;align-items:center;flex-wrap:wrap;margin-bottom:1rem}
.ufoms-json{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.82rem;width:100%;resize:vertical;direction:ltr;text-align:left}
.ufoms-builder-item{border:1px solid #d5dce7;border-radius:14px;padding:1rem;margin-bottom:.8rem}
.ufoms-builder textarea{width:100%}
@media(max-width:600px){.ufoms-question{padding:.8rem}.ufoms-options{flex-direction:column}.ufoms-option{width:100%}.ufoms-action-stack form{width:100%}}

/* UFOMS notification center: unread preview only; read/dismissed items stay in history. */
.ufoms-notice-menu{position:relative;flex-shrink:0}
.ufoms-notice-menu>summary{list-style:none;cursor:pointer;position:relative}
.ufoms-notice-menu>summary::-webkit-details-marker{display:none}
.ufoms-notice-count{position:absolute;inset-inline-start:-10px;top:-8px;background:#087f8c;color:white;border:2px solid white;border-radius:99px;min-width:20px;height:20px;padding:0 4px;display:grid;place-items:center;font-size:10px;line-height:1;font-weight:700}
.ufoms-notice-menu[open]>summary{background:#e6f4f4;border-color:#96c8ca}
.ufoms-notice-dropdown{position:absolute;z-index:80;top:calc(100% + 10px);inset-inline-end:0;width:min(390px,calc(100vw - 30px));max-height:min(75vh,620px);overflow:auto;background:white;border:1px solid #dbe5e8;border-radius:16px;box-shadow:0 18px 50px #132c3940;color:#18313f}
.ufoms-notice-dropdown-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 16px;background:#f4f9fa;position:sticky;top:0;z-index:1}
.ufoms-notice-dropdown-head>a,.ufoms-notice-dropdown-foot{color:#077b87;font-size:.85rem;text-decoration:none}
.ufoms-notice-preview{padding:13px 16px;border-top:1px solid #edf0f2}
.ufoms-notice-preview>strong{display:block;font-size:.92rem;overflow-wrap:anywhere}
.ufoms-notice-preview>p{margin:6px 0;color:#4b6673;font-size:.82rem;overflow-wrap:anywhere}
.ufoms-notice-preview>time{display:block;color:#7a8c96;font-size:.72rem}
.ufoms-notice-preview-actions,.ufoms-notice-history-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:10px}
.ufoms-notice-preview-actions form,.ufoms-notice-history-actions form{margin:0}
.ufoms-notice-preview-actions .btn{font-size:.77rem;padding:7px 10px;min-height:34px}
.ufoms-notice-dropdown-foot{display:block;text-align:center;padding:12px;border-top:1px solid #edf0f2;background:#f9fcfc}
.ufoms-notice-tabs{display:flex;gap:9px;margin-bottom:17px;flex-wrap:wrap}
.ufoms-notice-tab{display:flex;align-items:center;gap:10px;padding:10px 16px;border:1px solid #dbe5e8;border-radius:11px;text-decoration:none;color:#2c4a59;background:#f7fafb;font-weight:600}
.ufoms-notice-tab.is-active{background:#087f8c;border-color:#087f8c;color:white}
.ufoms-notice-tab-count{background:#e3eded;color:#12333b;padding:2px 7px;border-radius:40px;font-size:.79rem}
.ufoms-notice-history{display:grid;gap:10px}
.ufoms-notice-history .notification-item{border:1px solid #e2ebee;border-radius:13px;padding:14px 16px;margin:0;background:white}
.ufoms-notice-history .notification-item.is-read{background:#f8fafb}
.ufoms-notice-history-heading{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;align-items:center}
.ufoms-notice-history-heading strong{overflow-wrap:anywhere}
.ufoms-notice-empty{text-align:center;padding:24px 12px;color:#6a818a}
@media(max-width:520px){.ufoms-notice-dropdown{position:fixed;top:65px;left:10px;right:10px;width:auto;max-height:70vh}.ufoms-notice-dropdown-head{padding:12px}.ufoms-notice-preview{padding:11px 12px}.ufoms-notice-preview-actions .btn{font-size:.74rem}}
@media(max-width:370px){.topbar .ufoms-notice-menu .notification-shortcut{display:grid}}
