/* AtomService workspace. Loaded after the existing module layouts; no print rules. */
@font-face {
  font-family: 'Golos Text';
  src: url('/fonts/golos-text-variable.ttf') format('truetype');
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --navy: #202b37;
  --blue: #315efb;
  --ink: #202d3d;
  --muted: #64748b;
  --line: #e3e8ef;
  --bg: #f3f5f8;
  --radius: 12px;
  --workspace-sidebar: 208px;
  --workspace-subnav: 208px;
  font-family: 'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
}

body { background: var(--bg); color: var(--ink); }
button, input, select, textarea { font-family: inherit; }
h1, h2, h3 { color: var(--ink); letter-spacing: -.025em; }
h1 { font-size: 24px; font-weight: 650; }
h2 { font-weight: 600; }
small, .muted { color: var(--muted); }
a { color: #2857dc; }
:is(button, a, summary, input, select, textarea):focus-visible {
  outline: 3px solid #82a1ff;
  outline-offset: 3px;
}
input, select, textarea { border-color: #cdd5e0; border-radius: 7px; background: white; min-height: 38px; }
input::placeholder, textarea::placeholder { color: #7c8798; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #315efb12; }
input[type=checkbox] { accent-color: var(--blue); min-height: 0; }

/* Persistent navigation, with a compact employee identity at the bottom. */
.sidebar { width: var(--workspace-sidebar); background: var(--navy); padding: 0 12px; }
.workspace-brand { display: flex; gap: 10px; align-items: center; padding: 24px 10px 26px; color: white; }
.workspace-mark { display: grid; place-items: center; width: 34px; height: 36px; border-radius: 9px; background: #5074ff; flex-shrink: 0; }
.workspace-mark svg { width: 26px; height: 26px; }
.workspace-brand strong { display: block; font-size: 16px; font-weight: 600; letter-spacing: -.5px; }
.workspace-brand small { display: block; margin-top: 3px; font-size: 11px; color: #a7b4c7; }
.sidebar nav { padding: 0; flex: 1; }
.sidebar .nav-item { transition: background-color .12s ease, color .12s ease; height: 40px; gap: 11px; padding: 0 12px; margin: 3px 0; border-radius: 7px; color: #c0ccdb; font-size: 13px; }
.sidebar .nav-item svg { width: 18px; height: 18px; color: #a9b8ca; stroke-width: 1.65; }
.sidebar .nav-item:hover { background: #2c3949; color: white; }
.sidebar .nav-item.selected { background: #394d72; color: white; box-shadow: none; }
.sidebar .nav-item.selected svg { color: #a8bcff; }
.nav-divider:after { border-color: #ffffff12; margin: 12px 12px; }
.nav-flyout { background: #2c3949; border: 1px solid #4d5a6e; border-radius: 9px; padding: 6px; box-shadow: 0 12px 35px #16243b26; }
.nav-flyout a { padding: 10px 12px; border-radius: 5px; }
.nav-flyout a:hover { background: #3d506d; }
.sidebar .profile-button { display: flex; align-items: center; gap: 10px; height: 72px; min-height: 72px; padding: 12px 8px; margin-top: 12px; border-top: 1px solid #ffffff18; text-align: left; color: white; }
.sidebar .profile-button > span, .sidebar .profile-button > img { width: 34px; height: 34px; min-width: 34px; border-radius: 10px; font-size: 15px; font-weight: 600; background: #dce6fb; color: #324e80; object-fit: cover; }
.workspace-identity { flex: 1; min-width: 0; font-size: 12px; }
.workspace-identity b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.workspace-identity small { display: block; margin-top: 4px; font-size: 11px; color: #a7b4c7; }
.workspace-profile-chevron { width: 14px; color: #9aacbf; }
.workspace-menu, .workspace-nav-close, .workspace-scrim { display: none; }
.main { margin-left: var(--workspace-sidebar); min-width: 0; }
.main.with-settings, .main.with-profile { margin-left: calc(var(--workspace-sidebar) + var(--workspace-subnav)); }
.settings-nav, .profile-nav { left: var(--workspace-sidebar); width: var(--workspace-subnav); padding: 16px 10px; background: #f9fafc; border-right: 1px solid var(--line); }
.settings-nav > a, .profile-nav a, .profile-nav button { padding: 11px 12px; margin: 2px 0; border-radius: 7px; font-size: 13px; color: #536177; line-height: 1.5; }
.settings-nav > a.on, .profile-nav a.on { color: #2857dc; background: #eaf0ff; font-weight: 550; }
.settings-nav > a:hover, .profile-nav a:hover { background: #edf1f7; }
.settings-nav-footer { border-color: var(--line); color: #536177; }
.settings-nav-footer small { color: var(--muted); }

/* A steady header and a single full-width work surface. */
.topbar { height: 76px; padding: 0 28px; box-shadow: none; background: #fff; border-bottom: 1px solid var(--line); gap: 16px; }
.top-title { gap: 20px; }
.top-title h1 { font-size: 23px; font-weight: 600; letter-spacing: -.7px; }
.top-actions { gap: 16px; }
.topbar .help-link { font-size: 12px; padding: 8px 0 8px 8px; color: #64748b; white-space: nowrap; }
.search, .global-search, .topbar .ord-search { min-height: 38px; height: 38px; width: 230px; border: 1px solid var(--line); background: #f8fafc; border-radius: 8px; padding: 8px 12px; }
.search input { background: transparent; font-size: 12px !important; }
.topbar .ord-search { font: 12px 'Golos Text', sans-serif; margin-left: 0; }
.topbar .ord-training, .co-training summary { background: transparent; border: 0; color: #64748b; font-size: 12px; font-weight: 400; padding: 7px 0; }
.topbar .ord-training:hover { color: var(--blue); background: transparent; }
main { padding: 24px 28px; min-height: calc(100dvh - 76px); }
.page-orders { min-height: calc(100dvh - 76px); }
.page-heading { margin-bottom: 20px; }
.page-heading p { color: var(--muted); }
.panel { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: clip; box-shadow: none; }
.panel-heading { padding: 18px 20px; border-color: var(--line); }
.toolbar { padding: 14px 0; gap: 12px; }
.panel > .toolbar { padding: 14px 18px; }
.panel.pad { padding: 24px; }
.module-tabs { gap: 4px; border-color: var(--line); margin: -4px 0 22px; }
.module-tabs a { padding: 13px 14px; font-size: 13px; color: #64748b; }
.module-tabs a.on { color: #2857dc; border-color: var(--blue); font-weight: 550; }
.tabs { border-color: var(--line); }
.tabs button { color: #64748b; font-size: 13px; }
.tabs button.on { border-color: var(--blue); color: #2857dc; font-weight: 550; }

/* Shared controls, including modules with their own older control rules. */
.btn, #finance-module .btn, .fn-drawer .btn, .ord-card-footer .btn, .ct-filters .btn { min-height: 38px; border: 1px solid #d4dbe5; border-radius: 7px; background: white; color: #37465a; padding: 8px 13px; font-size: 13px; font-weight: 450; box-shadow: 0 1px 2px #15243a04; }
.btn:hover { background: #f8faff; border-color: #aebcd0; color: var(--ink); }
.btn.primary, .ord-card-footer .btn.primary, .ord-toolbar > .btn.success, .lead-toolbar > .btn.success, .co-toolbar > .green { background: var(--blue); border-color: var(--blue); color: white; font-weight: 550; box-shadow: 0 2px 3px #315efb16; }
.btn.primary:hover, .ord-toolbar > .btn.success:hover, .lead-toolbar > .btn.success:hover { background: #244fe6; border-color: #244fe6; color: white; }
.task-create { background: var(--blue) !important; border-color: var(--blue) !important; }
.btn.success, #finance-module .success, .fn-drawer .success { background: #158253; border-color: #158253; color: white; }
.btn.danger { color: #b72d36; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.btn.link { box-shadow: none; }
.btn.selected, .btn.active { background: #eaf0ff; color: #2857dc; border-color: #b9cbff; box-shadow: none; }
.ord-views, .view-switch, .task-segment { background: #f1f4f8; border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 3px; }
.ord-views .btn, .view-switch .btn, .task-segment .btn { min-height: 30px; border: 0; border-radius: 5px; background: transparent; box-shadow: none; margin: 0; color: #748198; }
.ord-views .btn.active, .view-switch .btn.selected, .task-segment .btn.selected { background: white; color: #2857dc; box-shadow: 0 1px 4px #26365712; }
.task-segment .btn:first-child, .task-segment .btn:last-child { border-radius: 5px; }

/* Tables remain dense enough for a repair queue, with stronger reading order. */
.table-wrap, .ord-table-scroll, .ct-table-scroll, .lead-table-scroll, .fn-table-wrap { border: 1px solid var(--line); border-radius: 10px; background: white; scrollbar-width: thin; scrollbar-color: #c1cad8 transparent; }
table { font-variant-numeric: tabular-nums; }
th, .ord-table th, .ord-lines th, .fn-table th, .ct-table th, .lead-table th { background: #f8fafc; border-bottom: 1px solid var(--line); border-right: 0; color: #64748b; font-size: 12px; font-weight: 500; padding: 13px 12px; height: 44px; }
td, .ord-table td, .fn-table td, .ct-table td, .lead-table td { padding: 15px 12px; border-color: #edf0f5; font-size: 13px; color: #35445a; line-height: 1.55; }
td small, .ord-table small, .ord-lines small { color: #78859a; font-size: 11px; margin-top: 3px; line-height: 1.6; }
tbody tr:hover { background: #f8faff; }
td .cell-title, .order-no { font-weight: 550; color: #2857dc; }
.ord-table .btn.link { color: #2857dc; font-weight: 550; font-size: 13px; }
.ord-table td:first-child { vertical-align: middle; }
.ord-table .ord-status { border-radius: 6px; padding: 6px 9px; font-size: 12px; line-height: 1.4; }
.ord-table th:first-child { width: 42px; }
.ord-pagination, .table-pagination { padding: 16px 0; background: transparent; font-size: 12px; color: #64748b; }
.ord-pagination .btn.active { border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--ink); }
.ord-pagination select { border-color: var(--line); background: white; }
.badge { font-size: 12px; border-radius: 6px; }
.tag { border-radius: 5px; background: #eef2f8; color: #61718b; }
.ord-empty { padding: 64px 24px; color: #64748b; }
.ord-empty::before { content: ''; display: block; width: 38px; height: 44px; border: 2px solid #c9d5e7; border-radius: 8px; margin: 0 auto 18px; background: linear-gradient(#dbe3ef, #dbe3ef) 9px 13px / 17px 2px no-repeat, linear-gradient(#dbe3ef, #dbe3ef) 9px 21px / 12px 2px no-repeat; }

/* Queue counters are contextual filters, not competing colored banners. */
.ord-badges { justify-content: flex-start; gap: 0; margin: 0 0 24px; border-bottom: 1px solid var(--line); padding: 0 0 20px; }
.ord-badges:empty { display: none; }
.ord-badges .btn { background: transparent; color: #64748b; border: 0; border-right: 1px solid #dfe5ee; border-radius: 0; align-items: flex-start; min-width: 156px; padding: 4px 24px; box-shadow: none; gap: 5px; }
.ord-badges .btn:first-child { padding-left: 0; }
.ord-badges .btn:last-child { border: 0; }
.ord-badges .btn b { color: #23344d; font-size: 20px; font-weight: 600; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.ord-badges .btn span { font-size: 12px; line-height: 1.4; }
.ord-badges .btn.selected { outline: 0; background: #e8eefe; border-radius: 7px; }
.ord-badges .btn.selected b { color: #2857dc; }
.ord-toolbar { margin: 0 0 18px; gap: 8px; }
.ord-filter-box { border-color: var(--line); background: #fff; border-radius: 10px; }
.ord-board { gap: 16px; }
.ord-board-column { background: #e9edf4; border-radius: 12px; padding: 14px; }
.ord-board-column h3 { color: #536177; font-size: 13px; }
.ord-board article { border: 1px solid #dce3ed; border-radius: 8px; box-shadow: 0 2px 3px #1f355604; padding: 16px; }

/* Connected record drawers and their history share the same material. */
.backdrop, .ord-backdrop { background: #17243b55; backdrop-filter: blur(3px); }
.modal { border-radius: 14px; box-shadow: 0 24px 80px #17243b30; border: 1px solid #e2e8f0; }
.modal > header { padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal > header h2 { font-size: 20px; font-weight: 600; }
.drawer, .ord-drawer, .lead-drawer, .task-drawer, .fn-drawer { box-shadow: -12px 0 60px #17243b18; }
.ord-drawer { border-radius: 16px 0 0 16px; overflow: hidden; }
.ord-card-head { padding: 18px 24px; min-height: 78px; border-color: var(--line); }
.ord-card-head h2 { font-size: 22px; font-weight: 600; letter-spacing: -.7px; }
.ord-card-head .btn { border-radius: 7px; }
.ord-card-tabs { padding: 0 12px; border-color: var(--line); }
.ord-card-tabs .btn { padding: 16px 12px; font-size: 12px; color: #64748b; box-shadow: none; border-radius: 0; }
.ord-card-tabs .btn.active { color: #2857dc; border-color: var(--blue); font-weight: 550; }
.ord-card-content { padding: 26px; background: #fff; }
.ord-card-content h3 { font-size: 15px; font-weight: 600; }
.ord-card-footer { background: #f8fafc; border-color: var(--line); padding: 16px 24px; }
.ord-intake-fields { gap: 18px; }
.ord-intake-fields .field > span { color: #5b6c82; font-weight: 450; }
.ord-field > span { color: #5b6c82; }
.ord-field input, .ord-field select, .ord-field textarea { border-color: #cdd5e0; border-radius: 7px; min-height: 40px; }
.ord-history { background: #f5f7fb; border-color: var(--line); }
.ord-history header { min-height: 78px; align-items: center; padding: 16px; border-color: var(--line); }
.ord-history header .btn { font-size: 12px; border-radius: 6px; box-shadow: none; }
.ord-history header .active { background: white; color: #2857dc; box-shadow: 0 1px 4px #15243b0c; }
.ord-events { padding: 24px 20px; }
.ord-events article { border-color: #dce4f0; padding-left: 18px; }
.ord-events article:before { background: #8ba7db; border: 3px solid #f5f7fb; width: 12px; height: 12px; left: -7px; }
.ord-events small { color: #75849a; font-size: 11px; }
.ord-events p { color: #42536c; font-size: 12px; line-height: 1.65; }
.ord-comment { border-color: var(--line); padding: 16px; }
.ord-comment textarea { border-color: #d5ddeb; border-radius: 8px; }
.form-footer { border-top: 1px solid var(--line); background: #f8fafc; padding: 18px 24px; }
.form-grid { padding: 24px; gap: 18px; }
.field > span, .kv > span { color: #61718b; font-weight: 450; }
.notice, .ord-notice { border-radius: 8px; line-height: 1.65; }
.form-error, .ord-error { color: #b72d36; }
.co-nested { border-radius: 14px; overflow: auto; box-shadow: 0 24px 80px #17243b30; }
.co-nested header { padding: 18px 22px; }

/* Company, tasks, contacts and finance use the same scale and surfaces. */
.tasks-page { margin: 0; padding: 0; color: var(--ink); }
.task-toolbar { gap: 12px; }
#finance-module { font-family: inherit; color: var(--ink); padding-top: 0; }
.fn-account { box-shadow: none; border-radius: 10px; border-color: var(--line); padding: 18px; }
.fn-account.selected { background: #f4f7ff; border-color: #a9bfff; }
.fn-account > b { font-weight: 600; letter-spacing: -.5px; }
.ct-toolbar { flex-wrap: wrap; }
.ct-tabs button { color: #64748b; font-size: 13px; }
.ct-tabs button.on { color: #2857dc; border-color: var(--blue); }
.co-category-panel { background: white; border: 1px solid var(--line); border-radius: 10px; overflow: clip; }
.co-category-head { background: #f8fafc; height: 44px; color: #64748b; font-size: 12px; padding: 0 16px; }
.co-category { border-color: #edf0f5; }
.co-category.on { background: #eef3ff; }
.stat, .settings-card, .integration-card { border: 1px solid var(--line); border-radius: 10px; box-shadow: none; }
.stat strong { font-weight: 600; letter-spacing: -.7px; }
.settings-card { padding: 22px; }
.settings-card h3 { font-size: 14px; }
.settings-card p { color: #64748b; }
.page-settings .page-heading { display: block; }
.page-settings .page-heading .actions { flex-wrap: wrap; margin-top: 16px; }
.task-row { background: white; border-color: var(--line); border-radius: 9px; }
.personal-profile { padding: 0 8px; }
.profile-section { border-color: var(--line); }
#toast { background: #202b37; border-radius: 9px; font-family: inherit; box-shadow: 0 6px 30px #17243b22; }

@media (max-height: 850px) and (min-width: 761px) {
  .workspace-brand { padding-top: 18px; padding-bottom: 18px; }
  .sidebar .nav-item { height: 34px; margin: 2px 0; }
  .nav-divider:after { margin-top: 7px; margin-bottom: 7px; }
  .sidebar .profile-button { height: 60px; min-height: 60px; margin-top: 8px; }
}

@media (min-width: 761px) and (max-width: 1100px) {
  :root { --workspace-sidebar: 176px; --workspace-subnav: 184px; }
  .sidebar { padding: 0 8px; }
  .workspace-brand { padding-left: 6px; gap: 8px; }
  .workspace-brand strong { font-size: 14px; }
  .sidebar .nav-item { gap: 8px; padding: 0 9px; font-size: 12px; }
  .topbar { padding: 0 20px; }
  .top-title { gap: 12px; }
  .topbar .ord-training, .co-training { display: none; }
  .topbar .ord-search, .global-search { width: 180px; min-width: 150px; }
  main { padding: 20px; }
  .ord-badges .btn { min-width: 120px; padding: 4px 16px; }
}

@media (max-width: 760px) {
  :root { --workspace-sidebar: 0px; }
  .main, .main.with-settings, .main.with-profile { margin-left: 0; }
  .sidebar { width: min(290px, 86vw); z-index: 90; padding: 0 14px; transform: translateX(-100%); visibility: hidden; overflow-y: auto; overscroll-behavior: contain; }
  .workspace-nav-open { overflow: hidden; }
  .workspace-nav-open .sidebar { transform: translateX(0); visibility: visible; }
  .workspace-brand { padding: 20px 8px; }
  .sidebar nav { flex: 1; overflow: visible; }
  .sidebar .nav-item { height: 44px; justify-content: flex-start; padding: 0 14px; margin: 2px 0; font-size: 14px; }
  .sidebar .nav-item span { display: inline; }
  .sidebar .nav-flyout { display: none; }
  .sidebar .profile-button { flex-shrink: 0; }
  .nav-divider:after { margin: 8px 12px; }
  .workspace-menu, .workspace-nav-close { display: grid; place-items: center; min-width: 44px; height: 44px; color: #536177; background: transparent; border-radius: 7px; }
  .workspace-nav-close { position: absolute; top: 17px; right: 8px; color: #b6c7dc; }
  .workspace-nav-open .workspace-scrim { display: block; position: fixed; inset: 0; z-index: 89; background: #17243b66; backdrop-filter: blur(3px); }
  .topbar { min-height: 68px; height: auto; padding: 12px 14px; gap: 8px; flex-wrap: wrap; }
  .top-title { gap: 10px; flex: 1; }
  .top-title h1 { font-size: 20px; letter-spacing: -.5px; }
  .top-actions { width: 100%; gap: 0; }
  .top-actions:has(.global-search):not(:has(.ord-search)) { display: flex; }
  .topbar .global-search, .topbar .ord-search { display: flex; width: 100%; min-width: 0; min-height: 44px; font-size: 16px; margin: 0; }
  .global-search input { max-width: none; font-size: 16px !important; }
  .topbar .help-link, .topbar .ord-training, .co-training { display: none; }
  .ord-views { margin-left: auto; }
  .ord-views .btn { min-width: 44px; min-height: 44px; padding: 5px; }
  body:has(.tasks-page) .global-search { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; padding: 8px 12px; }
  body:has(.tasks-page) .global-search svg { display: block; }
  body:has(.tasks-page) .global-search input,
  body:has(.tasks-page) .global-search input:focus,
  body:has(.tasks-page) .global-search input:not(:focus) { position: static; width: 100%; color: var(--ink); background: transparent; border: 0; box-shadow: none; }
  body:has(.tasks-page) .global-search input:not(:focus)::placeholder { font-size: 16px; }
  .ord-card-head .btn, .ord-card-content .btn { min-height: 44px; }
  .settings-nav, .profile-nav { position: static; display: flex; flex-direction: row; margin: 0; width: 100%; height: auto; padding: 8px 12px; overflow: auto; white-space: nowrap; border: 0; border-bottom: 1px solid var(--line); }
  .settings-nav > a, .profile-nav a, .profile-nav button { min-height: 44px; padding: 12px; }
  .settings-nav-footer { display: none; }
  main { padding: 18px 14px; min-height: calc(100dvh - 132px); }
  .page-orders { min-height: calc(100dvh - 132px); }
  .page-leads, .page-lead-reports { padding: 18px 14px !important; }
  .btn, .btn.small, #finance-module .btn, .fn-drawer .btn, .ord-card-footer .btn, .ct-filters .btn { min-height: 44px; }
  input, select, textarea { font-size: 16px; min-height: 44px; }
  input[type=checkbox] { min-height: 0; width: 20px; height: 20px; }
  .ord-badges { flex-wrap: wrap; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 0; padding-bottom: 16px; margin-bottom: 18px; }
  .ord-badges:empty { display: none; }
  .ord-badges .btn { min-width: 0; padding: 4px 12px; min-height: 52px; }
  .ord-badges .btn:nth-child(odd) { padding-left: 0; }
  .ord-badges .btn:nth-child(even) { border-right: 0; }
  .ord-badges .btn b { font-size: 18px; }
  .ord-badges .btn span { font-size: 11px; }
  .ord-toolbar { gap: 8px; }
  .ord-toolbar .ord-spacer { display: none; }
  .ord-pagination { flex-wrap: wrap; }
  .ord-pagination select { min-height: 44px; }
  .table-wrap, .ord-table-scroll, .ct-table-scroll { max-width: 100%; }
  .ord-drawer { border-radius: 0; width: 100vw; }
  .ord-card-head { min-height: 70px; padding: 12px 16px; }
  .ord-card-head h2 { font-size: 19px; }
  .ord-card-tabs { padding: 0 4px; }
  .ord-card-tabs .btn { min-height: 48px; padding: 14px 11px; }
  .ord-card-content { padding: 20px 16px; }
  .ord-card-footer { padding: 12px 16px max(12px, env(safe-area-inset-bottom)); }
  .ord-intake-fields .field > span { text-align: left; }
  .modal { border-radius: 12px; max-height: 94dvh; }
  .form-grid { padding: 20px 16px; }
  .form-footer { padding: 16px; }
  .module-tabs a { min-height: 48px; }
  .page-heading p { display: block; font-size: 12px; }
  .settings-card { padding: 18px; }
  .profile-section { gap: 16px; }
}

@media (prefers-reduced-motion: no-preference) {
  .workspace-menu, .btn { transition: background-color .12s ease, border-color .12s ease; }
  @media (max-width: 760px) {
    .sidebar { transition: transform .18s ease; }
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
.onec-staff-binding {
  display: grid;
  gap: 16px;
  min-width: 0;
  margin: 20px 0;
  padding: 16px;
  border: 1px solid #d5ddea;
  border-radius: 12px;
}
.onec-staff-binding legend { font-weight: 600; padding: 0 6px; }
.onec-staff-binding label { display: grid; gap: 8px; min-width: 0; }
.onec-staff-binding input,
.onec-staff-binding select { width: 100%; min-width: 0; min-height: 44px; }
.onec-staff-binding button { min-height: 44px; white-space: normal; }
.onec-staff-binding p { margin: 0; overflow-wrap: anywhere; }

/* Employee identity editor: compact, keyboard and touch friendly. */
.staff-editor-modal { max-width: 880px; }
.staff-editor .onec-staff-binding { margin: 4px 24px 24px; padding: 20px; background: #f8faff; border-color: #dce4f1; gap: 18px; }
.staff-editor .onec-staff-binding legend { font-size: 17px; padding: 0 8px; }
.staff-binding-intro, .staff-picker small, .staff-binding-message { color: #66758b; font-size: 13px; line-height: 1.5; }
.staff-binding-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; align-items: start; }
.staff-picker { display: grid; gap: 6px; min-width: 0; }
.staff-picker label { font-weight: 600; }
.staff-picker input { margin-top: 4px; background: white; font-size: 16px; }
.staff-picker-results { max-height: 220px; overflow-y: auto; border: 1px solid #ccd7ec; border-radius: 10px; background: white; box-shadow: 0 6px 18px #23365212; }
.staff-picker-results[hidden] { display: none; }
.staff-picker-results button { display: block; width: 100%; border: 0; border-radius: 0; padding: 12px; text-align: left; background: white; color: #24334b; cursor: pointer; font: inherit; overflow-wrap: anywhere; }
.staff-picker-results button + button { border-top: 1px solid #edf0f6; }
.staff-picker-results button:hover, .staff-picker-results button[aria-selected="true"], .staff-picker-results button:focus-visible { background: #eaf0ff; color: #274ada; }
.staff-picker-status { min-height: 20px; }
.staff-binding-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.staff-binding-history { border-top: 1px solid #dce4f1; padding-top: 12px; }
.staff-binding-history summary { cursor: pointer; color: #5a6980; min-height: 44px; padding: 10px 0; }
.staff-binding-history > button { margin: 8px 0; }
.staff-binding-history p { padding: 8px 0; }
@media (max-width: 640px) {
 .staff-editor .onec-staff-binding { margin: 0 12px 16px; padding: 14px; }
 .staff-binding-grid { grid-template-columns: 1fr; gap: 18px; }
 .staff-binding-actions { align-items: stretch; flex-direction: column; }
 .staff-binding-actions button { width: 100%; }
}

/* Integration forms stay inside the CRM settings shell. */
.integration-settings{max-width:820px}.integration-settings section{margin:0 0 24px;padding:8px 0}.integration-settings label{display:block;margin:16px 0}.integration-settings input:not([type=checkbox]){display:block;width:100%;box-sizing:border-box;min-height:44px;margin-top:6px;padding:12px;border:1px solid #cbd5e1;border-radius:8px;font:inherit}.integration-settings button{min-height:44px;padding:12px 18px;border:1px solid #cbd5e1;border-radius:8px;background:#3659ef;color:white;font:inherit;cursor:pointer}.integration-settings button:disabled{opacity:.55}.integration-settings [role=status]{white-space:pre-wrap;overflow-wrap:anywhere}.integration-settings .check{display:flex;gap:10px}.integration-settings [hidden]{display:none!important}@media(max-width:600px){.integration-settings button{width:100%}.integration-settings{padding:16px!important}}

/* Partner directory: compact table, single editing drawer. */
.integration-settings.partners-page{max-width:none;min-width:0}
.partners-heading,.partners-toolbar{display:flex;align-items:center;gap:16px;justify-content:space-between}.partners-heading h2{margin:0}.partners-heading p,.partners-muted{color:#64748b}.partners-toolbar{align-items:end}.partners-toolbar label:first-child{flex:1}.partners-toolbar label{margin:8px 0}.partners-toolbar select{min-height:44px;padding:8px;border:1px solid #cbd5e1;border-radius:8px;font:inherit;background:white}.partners-page .partners-toolbar button,.partners-page .partner-secondary{background:white;color:#334155}.partners-table{width:100%;border-collapse:collapse;table-layout:fixed}.partners-table th{text-align:left;color:#64748b;font-size:13px;padding:12px;background:#f8fafc}.partners-table td{padding:16px 12px;border-top:1px solid #e2e8f0;overflow-wrap:anywhere;vertical-align:top}.partners-table th:first-child{width:26%}.partners-table tbody tr{cursor:pointer}.partners-table tbody tr:hover{background:#f8faff}.partners-table small{display:block;margin-top:6px;color:#64748b;font-size:12px}.partners-page button.partner-name{display:block;border:0;background:none;color:#1e293b;text-align:left;font-weight:600;padding:0;min-height:24px}.partners-page button.partner-name:focus-visible{outline:2px solid #3659ef;outline-offset:4px}.partner-badge{display:inline-block;background:#f1f5f9;color:#475569;padding:5px 8px;border-radius:6px;font-size:12px}.partner-badge.is-ok{background:#e7f6ee;color:#176b46}.partner-badge.is-warning{background:#fff3dc;color:#865400}.partners-empty{padding:40px 16px;text-align:center;background:#f8fafc;border-radius:10px}.partners-accounting{border-top:1px solid #e2e8f0;margin-top:28px;padding-top:20px}.partners-accounting summary{cursor:pointer;color:#475569}.partners-accounting form{max-width:540px}.partner-drawer{position:fixed;inset:0 0 0 auto;margin:0;width:min(560px,100%);max-width:100%;height:100dvh;max-height:100dvh;padding:0;border:0;box-shadow:-12px 0 50px #0f172a26;color:#1e293b;background:white;box-sizing:border-box}.partner-drawer::backdrop{background:#0f172a66}.partner-drawer-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:20px 24px;border-bottom:1px solid #e2e8f0;position:sticky;top:0;background:white;z-index:1}.partner-drawer-head h2{margin:0;font-size:21px;overflow-wrap:anywhere}.partners-page .partner-drawer-head button{background:white;color:#475569;border:0;font-size:24px}.partner-drawer-body{padding:8px 24px 32px}.partner-drawer textarea{width:100%;min-height:90px;box-sizing:border-box;font:inherit;padding:12px;border:1px solid #cbd5e1;border-radius:8px;resize:vertical}.partner-active{display:flex!important;align-items:center;gap:10px}.partner-form-actions{display:flex;gap:10px;margin:20px 0}.partner-telegram{border-top:1px solid #e2e8f0!important;padding-top:16px!important}.partner-telegram [data-tg] main{padding:0}.partner-search-results{display:grid;gap:8px}.partners-page .partner-search-results button{background:white;color:#334155;text-align:left}.partner-search-results small{display:block;margin-top:6px;color:#64748b}.partner-drawer [role=status]{color:#475569}
@media(max-width:1050px){.partners-table thead{display:none}.partners-table,.partners-table tbody{display:block}.partners-table tr{display:grid;grid-template-columns:1fr 1fr;border:1px solid #e2e8f0;border-radius:10px;margin:12px 0;padding:8px}.partners-table td{display:block;border:0;padding:8px}.partners-table td:first-child{grid-column:1/-1}.partners-table td[data-label]:before{content:attr(data-label);display:block;color:#64748b;font-size:12px;margin-bottom:5px}.partners-toolbar{flex-wrap:wrap}.partners-toolbar label:first-child{flex-basis:100%}}
@media(max-width:600px){.partners-heading{align-items:stretch;flex-direction:column}.partners-toolbar{gap:8px}.partners-toolbar label{flex:1}.partners-toolbar select{width:100%}.partners-page .partners-toolbar button{width:auto}.partner-drawer-head{padding:16px}.partners-page .partner-drawer-head button{width:44px;flex-shrink:0}.partner-drawer-body{padding:8px 16px 24px}.partner-form-actions button{flex:1}.partners-table tr{grid-template-columns:1fr}.partners-table td:first-child{grid-column:auto}}
.partners-table th{white-space:normal;overflow-wrap:anywhere}.partners-toolbar label:last-of-type{display:grid;gap:6px}.partner-drawer [data-tg] button{margin:4px 4px 4px 0}

.staff-editor .form-grid > .onec-staff-binding { grid-column: 1 / -1; margin: 4px 0 16px; }

.staff-access .staff-access-toggle { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.staff-access .staff-access-toggle input { width: 20px; height: 20px; min-height: 20px; flex: 0 0 20px; margin: 0; }

/* Action failures must remain visible above order drawers and dialogs. */
#toast { z-index: 20000; }
