/* Final shared control layer for tenant, owner, operator and public forms.
   Keep specialized layouts and chart dimensions in their module styles. */
:root{--control-bg:#fff;--control-ink:#26312b;--control-border:#d5ddd6;--control-hover:#a4b0a6;--control-focus:#456b4f;--control-muted:#69756c;--control-radius:7px;--control-height:34px}
body :is(input:where(:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=hidden]):not([type=file]):not([type=submit]):not([type=button])),select,textarea){font-family:inherit;color:var(--control-ink);background-color:var(--control-bg);border:1px solid var(--control-border);border-radius:var(--control-radius);font-size:12px;line-height:1.45;box-shadow:none;min-width:0;max-width:100%;box-sizing:border-box}
body :is(input:where(:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=hidden]):not([type=file]):not([type=submit]):not([type=button])),select){min-height:var(--control-height);padding:7px 10px}
body textarea{padding:9px 10px;resize:vertical}
body select:not([multiple]){appearance:none;padding-right:32px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2369756c' stroke-width='1.7'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;background-size:16px}
body select[multiple]{padding:5px;min-height:96px;background-image:none}body select option{color:var(--control-ink);background:#fff;padding:7px}
body :is(input,select,textarea)::placeholder{color:#7d887f;opacity:1}
body :is(input,select,textarea):hover:not(:disabled):not(:focus){border-color:var(--control-hover)}
body :is(input,select,textarea):focus-visible,body .co-select-toggle:focus-visible{outline:2px solid var(--control-focus);outline-offset:2px;border-color:var(--control-focus)}
body :is(input,select,textarea):disabled{background-color:#f1f3f1;color:#758077;cursor:not-allowed;opacity:1}
body :is(input,textarea)[readonly]{background-color:#f6f8f5;color:#5b685e}
body :is(input,select,textarea)[aria-invalid=true]{border-color:#ae4840;outline-color:#ae4840}
body input:is([type=checkbox],[type=radio]){appearance:auto;accent-color:#263b2c;width:16px;height:16px;min-width:16px;min-height:16px;max-width:16px;padding:0;vertical-align:middle;flex:none;box-shadow:none}
body input[type=radio]{border-radius:50%}body input[type=file]{font:inherit;font-size:12px;max-width:100%}
body input[type=file]::file-selector-button{font:inherit;border:1px solid var(--control-border);border-radius:var(--control-radius);padding:7px 10px;margin-right:10px;background:#f5f7f3;color:var(--control-ink);cursor:pointer}
body :is(.button,.btn){font-family:inherit;border-radius:var(--control-radius)}
body :is(button,a):focus-visible{outline:2px solid var(--control-focus);outline-offset:2px}
body button:disabled{cursor:not-allowed}
body :is(.field,.form-grid)>:is(label,div){min-width:0}
/* Search groups own their outer border; their inner field must not double it. */
body :is(.searchbox,.co-searchbox,.shell-search-panel>label) input{border:0;background:transparent;box-shadow:none;min-height:30px}
body .co-panel .co-compose textarea{min-height:43px;max-height:140px;resize:none;border-radius:12px}
body .co-panel .co-select-toggle{background:var(--control-bg);color:var(--control-ink);border-color:var(--control-border);border-radius:var(--control-radius)}
body .co-panel .co-select-option{color:var(--control-ink)}
body .co-panel :is(.co-top h2,.co-thread-head h3,.co-room-top b,.co-form h3,.co-choice span){color:var(--control-ink)}
body .co-panel :is(.co-top p,.co-thread-head small,.co-room-bottom small,.co-choice small,.co-subtle,.co-empty,.co-form>label,.co-form legend,.co-welcome p,.co-welcome h3,.co-privacy-note){color:var(--control-muted)}
/* Both rails use the same dark selection. Message counters retain their alert color. */
body .toolrail .tool-button:is(.active,[aria-pressed=true],[aria-expanded=true]){background:#202721;color:#fff;box-shadow:none}
body .toolrail .tool-button:is(.active,[aria-pressed=true],[aria-expanded=true]):hover{background:#303a32;color:#fff}
body .toolrail .tool-button:not(.active):not([aria-pressed=true]):not([aria-expanded=true]):hover{background:#e7ebe7;color:#1e2822}
body .navrail .navitem::after{display:none!important}
.tt-rail-tooltip{position:fixed;z-index:11000;pointer-events:none;background:#26312a;color:#fff;padding:6px 9px;border-radius:4px;font-family:inherit;font-size:11px;line-height:16px;font-weight:450;max-width:min(260px,calc(100vw - 72px));overflow-wrap:anywhere;box-shadow:0 3px 12px #17231a18}
/* Avatars are graphics, not status indicators. Names remain visible beside them. */
.tt-avatar{width:36px;height:36px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;overflow:hidden;flex:none;background:#e7ece5;vertical-align:middle}
.tt-avatar img{display:block;width:100%;height:100%;object-fit:cover}.tt-person{display:inline-flex;align-items:center;gap:10px;min-width:0}.tt-person>span:last-child{overflow-wrap:anywhere}
.navrail .tt-avatar{width:27px;height:27px}.portal-rail .tt-avatar{width:34px;height:34px}
.co-panel .tt-avatar.co-avatar{width:40px;height:40px;padding:0}.co-panel .tt-avatar.co-author-avatar{width:22px;height:22px;margin-right:6px}.co-message header{align-items:center;justify-content:flex-start;gap:0}
.co-choice .tt-avatar,.ct-check .tt-avatar{width:32px;height:32px;padding:0;display:inline-flex;flex:none}
.tt-profile{width:min(500px,calc(100vw - 28px));max-height:calc(100dvh - 32px);padding:0;border:1px solid var(--control-border);border-radius:14px;background:#fff;color:var(--control-ink);box-shadow:0 20px 70px #1e312b33;font-family:inherit;font-size:13px;line-height:1.6}
.tt-profile::backdrop{background:#17231c55}.tt-profile>header{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:18px 22px;border-bottom:1px solid #e4e9e2}.tt-profile h2{font-size:18px;margin:0}.tt-profile>header button{background:transparent;border:0;font-size:24px;color:var(--control-muted);width:32px;height:32px;cursor:pointer}
.tt-profile-body{padding:20px 22px}.tt-profile-identity{display:flex;align-items:center;gap:13px;margin-bottom:14px}.tt-profile-identity .tt-avatar{width:56px;height:56px}.tt-profile-identity small{display:block;color:var(--control-muted);overflow-wrap:anywhere}.tt-profile-body>p{color:var(--control-muted);margin:12px 0}.tt-profile fieldset{padding:0;border:0;margin:16px 0}.tt-profile legend{font-size:12px;font-weight:600;margin-bottom:10px}.tt-avatar-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.tt-avatar-grid label{position:relative;display:flex;align-items:center;flex-direction:column;gap:7px;padding:11px 4px;border:1px solid #dfe5dc;border-radius:9px;cursor:pointer;font-size:10px;text-align:center}.tt-avatar-grid label:has(:checked){border-color:#47664b;background:#eff5e9;box-shadow:inset 0 0 0 1px #47664b}.tt-avatar-grid input{position:absolute;opacity:0;left:4px;top:4px}.tt-avatar-grid label:focus-within{outline:2px solid var(--control-focus);outline-offset:2px}.tt-profile footer{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}.tt-profile footer button{padding:8px 14px;border:1px solid var(--control-border);background:#fff;cursor:pointer}.tt-profile footer .primary{background:#263b2c;color:#fff;border-color:#263b2c}.tt-profile-error{color:#a13b35;font-size:12px}
/* User-sized nonmodal messenger. Body class survives workspace route renders. */
body.co-pinned .workspace{right:calc(var(--company-chat-width) + var(--tools,44px))}
.co-panel{max-width:calc(100vw - var(--tools,44px) - var(--side,48px))}
.co-resize{position:absolute;left:-4px;top:0;bottom:0;width:9px;z-index:20;cursor:ew-resize;touch-action:none;background:transparent}
.co-resize::after{content:"";position:absolute;width:3px;height:44px;top:50%;left:3px;border-radius:3px;background:#9aa89b;opacity:0;transition:opacity .15s}
.co-resize:hover::after,.co-resize:focus-visible::after{opacity:1}.co-resize:focus-visible{outline:2px solid var(--control-focus);outline-offset:-2px}
body.co-resizing,body.co-resizing *{cursor:ew-resize!important;user-select:none!important}
.co-panel .co-icon-button[aria-pressed=true]{background:#202721;color:#fff}.co-panel .co-icon-button[aria-busy=true] svg{animation:co-refresh 1s linear infinite}@keyframes co-refresh{to{transform:rotate(360deg)}}
.co-panel .co-kind-tabs{display:flex;flex-wrap:wrap;gap:5px;background:#f0f3ef;border-radius:9px;padding:4px}.co-panel .co-kind-tabs button{flex:1;border:0;background:transparent;border-radius:6px;font-size:11px;padding:9px 7px;white-space:nowrap}.co-panel .co-kind-tabs button[aria-pressed=true]{background:#263b2c;color:#fff}
.co-panel [hidden]{display:none!important}.co-panel .co-layout{grid-template-columns:minmax(230px,32%) minmax(0,1fr)}
.co-panel.co-compact .co-layout{display:flex;height:auto}.co-compact .co-sidebar{width:100%;border:0;flex:1}.co-compact .co-detail{display:none}.co-compact.co-show-thread .co-sidebar{display:none}.co-compact.co-show-thread .co-detail{display:flex;flex:1}.co-panel.co-compact .co-back-list{display:grid}.co-panel.co-compact .co-top{padding:10px 12px;gap:8px;flex-wrap:wrap}.co-compact .co-top h2{font-size:16px}.co-compact .co-top p{font-size:10px}.co-compact .co-top .co-actions{margin-left:auto}.co-compact .co-messages{padding:14px}.co-compact .co-form{padding:17px}.co-compact .co-compose{padding:10px 12px}
@media(max-width:941px){body.co-pinned .workspace{right:var(--tools,44px)}}
@media(prefers-reduced-motion:reduce){.co-panel .co-icon-button[aria-busy=true] svg{animation:none}.co-resize::after{transition:none}}
@media(forced-colors:active){body select:not([multiple]){appearance:auto;background-image:none}.tt-avatar-grid label:has(:checked){outline:2px solid Highlight}.co-resize::after{background:ButtonText}}
/* Reserve the icon slot after every module and shared control rule. */
body .searchbox.searchbox{position:relative;display:block;height:auto;min-height:34px;padding:0;border:0;background:transparent}
body .searchbox.searchbox>input{display:block;width:100%;height:34px;min-height:34px;padding:6px 10px 6px 34px;border:1px solid var(--control-border);border-radius:var(--control-radius);background:#fff;line-height:20px}
body .searchbox.searchbox>svg{position:absolute;left:11px;top:50%;transform:translateY(-50%);width:14px;height:14px;margin:0;pointer-events:none;z-index:1;color:var(--control-muted)}
body :is(.co-searchbox,.shell-search-panel>label,.global-search>label,.command-input-row){align-items:center}
body :is(.co-searchbox,.shell-search-panel>label,.global-search>label,.command-input-row)>svg{flex:none;pointer-events:none}
/* Common table surface. Module widths, sticky columns and semantic badges stay local. */
body :is(.workspace,.portal-content,.portal-main,#portal,.drawer,dialog) table{border-collapse:separate;border-spacing:0;font-family:inherit;font-size:11px;line-height:1.45;color:var(--control-ink);font-variant-numeric:tabular-nums}
body :is(.workspace,.portal-content,.portal-main,#portal,.drawer,dialog) table>thead>tr>th{padding:10px 12px;background:#f1f4ef;color:#647168;border-bottom:1px solid #d7ded5;font-size:10px;font-weight:600;letter-spacing:.25px;vertical-align:middle;text-transform:none}
body :is(.workspace,.portal-content,.portal-main,#portal,.drawer,dialog) table>tbody>tr{--row-bg:#fff;background:var(--row-bg)}
body :is(.workspace,.portal-content,.portal-main,#portal,.drawer,dialog) table>tbody>tr:nth-child(even){--row-bg:#f8faf6}
body :is(.workspace,.portal-content,.portal-main,#portal,.drawer,dialog) table>tbody>tr:hover{--row-bg:#f0f4eb}
body :is(.workspace,.portal-content,.portal-main,#portal,.drawer,dialog) table>tbody>tr:is(.selected,[aria-selected=true]){--row-bg:#eaf0e2}
body :is(.workspace,.portal-content,.portal-main,#portal,.drawer,dialog) table>tbody>tr>:is(td,th){padding:10px 12px;background:var(--row-bg);border-bottom:1px solid #e5e9e1;vertical-align:middle}
body.comfortable .workspace table>tbody>tr>:is(td,th){padding-block:14px}
body :is(.workspace,#portal,.drawer,dialog) table :is(input,select){font-size:11px;min-height:30px}
body :is(.workspace,#portal,.drawer,dialog) table :is(.actions,.row-actions){gap:5px}

/* Grouped search: one frame belongs to the wrapper, including keyboard focus.
   Standalone icon searches retain the field-owned frame above. */
body .co-panel .co-searchbox{border:1px solid transparent;border-radius:var(--control-radius);background:#f1f4ef;padding:0 11px}
body .co-panel .co-searchbox:hover{border-color:var(--control-hover)}
body .co-panel .co-searchbox:focus-within{border-color:var(--control-focus);outline:2px solid var(--control-focus);outline-offset:2px;background:#fff}
body .co-panel .co-searchbox>input[name=search]{border:0;border-radius:0;outline:0;background:transparent;box-shadow:none;min-height:34px;height:34px;padding:7px 0;flex:1;min-width:0}
/* Window actions match the established order / driver panel controls. */
body :is(.window-action,.co-panel .co-icon-button,.drawer-head .icon-btn,.location-dialog>header .icon-btn,.workspace-detail>header .icon-btn,.vehicle-detail-head .icon-btn){display:inline-grid;place-items:center;flex:none;width:var(--ui-control,28px);min-width:var(--ui-control,28px);height:var(--ui-control,28px);min-height:var(--ui-control,28px);padding:0;border:0;border-radius:var(--ui-radius,4px);background:transparent;box-shadow:none;color:#7b8996;line-height:1;cursor:pointer}
body :is(.window-action,.co-panel .co-icon-button,.drawer-head .icon-btn,.location-dialog>header .icon-btn,.workspace-detail>header .icon-btn,.vehicle-detail-head .icon-btn)>svg{display:block;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
body :is(.window-action,.co-panel .co-icon-button,.drawer-head .icon-btn,.location-dialog>header .icon-btn,.workspace-detail>header .icon-btn,.vehicle-detail-head .icon-btn):hover{background:#eef2f4;color:#344858}
body :is(.window-action,.co-panel .co-icon-button,.drawer-head .icon-btn)[aria-pressed=true]{background:#202721;color:#fff}
