/* Shared visual language with Orders and Fleet. Existing controls keep their behavior. */
:root {
  --bg: #f4f6f8;
  --surface-soft: #f3f6f8;
  --text: #26363c;
  --muted: #657580;
  --line: #e1e7eb;
  --shadow: 0 12px 42px #24353d18;
}
body { font-size: 14px; line-height: 1.5; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
a, button, summary, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 3px;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.portal-icon { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.shell { grid-template-columns: 240px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100dvh; overflow: hidden; padding: 24px 16px 18px; gap: 18px; background: #f1f3f6; color: var(--text); }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sidebar .brand { gap: 10px; padding: 0 6px; }
.sidebar .brand-mark { width: 36px; height: 36px; border-radius: 11px; font-size: 14px; flex: 0 0 auto; }
.sidebar .brand strong { font-size: 16px; font-weight: 650; }
.sidebar .brand small { color: var(--muted); font-size: 12px; }
.sidebar .nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; gap: 3px; align-content: start; }
.sidebar .nav-item { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 8px 10px; border-radius: 9px; color: var(--text); text-decoration: none; font-size: 14px; line-height: 1.4; }
.sidebar .nav-item:hover { background: #e8ecef; color: var(--text); }
.sidebar .nav-item.active { background: #e0eaeb; color: #105d65; font-weight: 650; }
.nav-label { padding: 16px 10px 5px; font-size: 12px; color: var(--muted); }
.sidebar-footer { flex: 0 0 auto; padding: 14px 6px 0; border-top: 1px solid var(--line); }
.user-chip { color: var(--muted); overflow-wrap: anywhere; }
.user-chip strong { color: var(--text); font-weight: 600; }
.sidebar .sidebar-toggle { display: none; }
.main { margin: 12px 12px 12px 0; padding: 0; min-width: 0; border: 1px solid var(--line); border-radius: 20px; background: #f8fafb; }
.topbar { padding: 22px 26px; margin: 0; background: #fff; border-bottom: 1px solid var(--line); border-radius: 20px 20px 0 0; }
.topbar h1 { display: flex; align-items: center; gap: 12px; font-size: 26px; line-height: 1.3; font-weight: 650; letter-spacing: -.5px; margin: 0 0 6px; }
.topbar h1:focus { outline: none; }
.topbar p { font-size: 14px; line-height: 1.5; }
.page-symbol { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--primary); color: #fff; flex: 0 0 auto; }
.page-symbol .portal-icon { width: 22px; height: 22px; }
#content { min-width: 0; }
#content:not(.suite-body) { padding: 24px 26px 32px; }
.panel { padding: 18px; border-radius: 15px; box-shadow: 0 3px 16px #24353d04; min-width: 0; }
.button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 7px 12px; border-radius: 9px; font-size: 14px; font-weight: 550; line-height: 1.35; text-decoration: none; cursor: pointer; }
.button.secondary, .icon-button { border: 1px solid #d7e0e4; background: white; color: var(--text); box-shadow: 0 1px 3px #20354006; }
.button.secondary:hover, .icon-button:hover { background: #f3f6f7; }
.button.danger { color: #a9364c; background: #fff; border-color: #edccd3; }
.button.danger:hover { background: #fff0f3; }
.icon-button { width: 36px; height: 36px; padding: 0; flex: 0 0 auto; }
.toolbar-actions { gap: 8px; }
.input, .select { min-width: 0; min-height: 40px; padding: 8px 12px; border-radius: 9px; font-size: 14px; }
.search-input { width: min(250px, 100%); min-height: 36px; padding: 7px 10px; }
.table-wrap { min-width: 0; }
th { font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: 0; background: #f8fafb; }
th, td { padding: 10px 12px; }
td { font-size: 14px; }
td small { font-size: 12px; line-height: 1.5; }
td strong { font-weight: 600; }
tbody tr:hover { background: #fafcfc; }
.actions { gap: 6px; }
.actions .button { min-height: 32px; font-size: 13px; padding: 5px 10px; }
.badge { min-height: 24px; padding: 3px 9px; font-size: 12px; font-weight: 500; gap: 6px; white-space: nowrap; }
.badge.good { background: #e4f5ef; color: #087963; }
.badge.bad { background: #fff0f3; color: #ad354f; }
.badge.good::before, .badge.bad::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.service-filter-bar { margin: 12px 0 20px; }
.service-heading { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.service-heading h2 { font-size: 18px; font-weight: 650; margin: 0; }
.service-result-count, .area-count { font-size: 13px; color: var(--muted); background: #eef2f5; border-radius: 7px; padding: 2px 7px; font-variant-numeric: tabular-nums; }
.service-tools { display: flex; align-items: center; gap: 8px; }
.service-layout { display: flex; gap: 3px; padding-left: 10px; margin-left: 2px; border-left: 1px solid var(--line); }
.service-layout .icon-button[aria-pressed=true] { border-color: #9abfc2; background: #e5f2f1; color: #105d65; }
.service-search { display: flex; gap: 8px; align-items: center; width: 250px; height: 36px; border: 1px solid #ccd6df; border-radius: 10px; padding: 0 9px; background: white; color: var(--muted); }
.service-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px #126a7214; }
.service-search > .portal-icon { width: 16px; height: 16px; }
.service-search input { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--text); height: 30px; padding: 0; outline: none; }
.service-search input::-webkit-search-cancel-button { display: none; }
.search-clear { display: grid; place-items: center; width: 24px; height: 28px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; flex: 0 0 auto; }
.search-clear:hover { background: #eef2f5; }
.search-clear .portal-icon { width: 14px; height: 14px; }
.service-filters { position: relative; }
.service-filters > summary { list-style: none; position: relative; }
.service-filters > summary::-webkit-details-marker { display: none; }
.service-filters[open] > summary { border-color: #b4a3d8; background: #f0eafa; color: #694599; }
.filter-count { position: absolute; top: -7px; right: -6px; display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; border: 2px solid #f8fafb; border-radius: 9px; background: #7251a5; color: white; font-size: 10px; font-weight: 650; }
.service-popover { position: absolute; top: calc(100% + 10px); right: 0; width: 300px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 28px #26363c14; z-index: 5; }
.service-popover h3 { margin: 0 0 16px; font-size: 16px; font-weight: 600; }
.service-popover .field > span { color: var(--muted); font-size: 13px; font-weight: 500; }
.text-button { border: 0; background: transparent; color: var(--primary); padding: 0; font: inherit; cursor: pointer; }
.service-reset { display: flex; align-items: center; gap: 7px; width: 100%; min-height: 38px; text-align: left; font-size: 13px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.service-reset .portal-icon { width: 16px; height: 16px; }
.service-chips { display: flex; gap: 7px; flex-wrap: wrap; margin: 0; }
.filter-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; border: 0; border-radius: 999px; background: #efe8f8; color: #694599; padding: 5px 10px; font-size: 13px; line-height: 1.4; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.filter-chip:hover { background: #e5d9f4; }
.filter-chip .portal-icon { width: 13px; height: 13px; }
[data-service-results] { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 14px; align-items: start; }
.service-group { grid-column: span 3; min-width: 0; }
.service-group[data-size="1"] { grid-column: span 1; }
.service-group[data-size="2"] { grid-column: span 2; }
.service-group > header { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; }
.service-group > header h2 { margin: 0; font-size: 15px; font-weight: 600; }
.area-count { font-size: 12px; padding: 1px 6px; }
.service-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.service-group[data-size="1"] .service-cards { grid-template-columns: 1fr; }
.service-group[data-size="2"] .service-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.service-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) 16px; gap: 12px; align-items: start; border: 1px solid var(--line); border-radius: 15px; padding: 20px 16px; background: white; color: var(--text); text-decoration: none; min-width: 0; }
.service-directory:not(.is-list) .service-card { min-height: var(--service-card-height, 116px); }
.service-card:hover { border-color: #a8c4c7; box-shadow: 0 3px 14px #26363c08; background: #fcfefe; }
.service-logo { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; }
.service-logo .portal-icon { width: 23px; height: 23px; }
.tone-orange { color: #a4571d; background: #fff0e3; }
.tone-blue { color: #3668a7; background: #eaf1fc; }
.tone-teal { color: #087c70; background: #dff4ed; }
.tone-purple { color: #7751a8; background: #f0e9fb; }
.tone-amber { color: #92670c; background: #fff4d7; }
.tone-rose { color: #ad476f; background: #fce8ef; }
.tone-slate { color: #566e83; background: #eaf0f5; }
.service-copy { min-width: 0; }
.service-copy h3 { font-size: 17px; font-weight: 650; line-height: 1.3; margin: 1px 0 8px; overflow-wrap: anywhere; }
.service-copy p { font-size: 14px; line-height: 1.5; margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.service-open { color: var(--muted); padding-top: 5px; }
.service-open .portal-icon { width: 16px; height: 16px; }
.is-list [data-service-results] { display: block; }
.is-list .service-group + .service-group { margin-top: 26px; }
.is-list .service-group .service-cards { grid-template-columns: 1fr; gap: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.is-list .service-card { border: 0; border-radius: 0; grid-template-columns: 36px minmax(0, 1fr) 18px; gap: 14px; padding: 14px 18px; align-items: center; }
.is-list .service-card + .service-card { border-top: 1px solid var(--line); }
.is-list .service-logo { width: 36px; height: 36px; border-radius: 10px; }
.is-list .service-logo .portal-icon { width: 21px; height: 21px; }
.is-list .service-copy { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 2fr); gap: 20px; align-items: center; }
.is-list .service-copy h3 { font-size: 15px; margin: 0; }
.is-list .service-open { padding-top: 0; }
.service-empty { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 15px; background: #fff; padding: 32px 20px; text-align: center; }
.service-empty > .portal-icon { color: var(--primary); width: 30px; height: 30px; }
.service-empty h2 { margin: 14px 0 8px; font-size: 19px; }
.service-empty p { margin: 0 0 16px; color: var(--muted); }

/* Dialog height follows the content; only the body scrolls, keeping actions in view. */
#user-dialog { width: min(800px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border: 1px solid var(--line); border-radius: 16px; }
#user-dialog .dialog-shell { min-width: 0; width: 100%; display: flex; flex-direction: column; max-height: calc(100dvh - 26px); }
#user-dialog .dialog-shell > header, #user-dialog .dialog-shell > footer { flex: 0 0 auto; padding: 16px 22px; gap: 10px; }
#user-dialog .dialog-shell > footer { background: #f8fafb; }
#user-dialog .dialog-shell h2 { font-size: 21px; font-weight: 650; }
#dialog-body { min-height: 0; overflow-y: auto; padding: 22px; }
#user-dialog .field { min-width: 0; align-self: start; align-content: start; }
#user-dialog .field > span:first-child { min-height: 20px; line-height: 20px; font-size: 13px; font-weight: 500; }
#user-dialog .field .input:not(textarea), #user-dialog .field .select { width: 100%; min-width: 0; height: 40px; }
#user-dialog textarea.input { min-height: 80px; resize: vertical; }
.user-form, .worker-summary, .worker-section-grid { gap: 18px 20px; }
.field-note { font-size: 12px; font-weight: 400; line-height: 1.5; }
.worker-section { border-radius: 11px; }
.worker-section summary { padding: 12px 16px; font-weight: 600; background: #f6f8fa; }
.worker-section-grid { padding: 16px; }
.login-panel .button { min-height: 42px; }

@media (max-width: 1180px) {
  [data-service-results] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-group { grid-column: span 2; }
  .service-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 14px 16px; gap: 0; overflow: visible; }
  .sidebar .sidebar-toggle { display: inline-flex; }
  .sidebar .nav, .sidebar .sidebar-footer { display: none; }
  .sidebar.is-open .nav { display: grid; margin-top: 18px; max-height: 55dvh; }
  .sidebar.is-open .sidebar-footer { display: grid; margin-top: 16px; }
  .main { margin: 0 10px 10px; }
  .topbar { padding: 20px; }
  #content:not(.suite-body) { padding: 20px; }
  .service-filter-bar { flex-wrap: wrap; gap: 12px; }
  .service-tools { margin-left: auto; }
  .toolbar-actions { width: auto; }
  .toolbar .search-input { width: min(250px, 100%); }
  .user-form, .worker-summary, .worker-section-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .main { margin: 0; border-radius: 16px 16px 0 0; border-bottom: 0; }
  .topbar { padding: 18px 16px; border-radius: 16px 16px 0 0; }
  .topbar h1 { font-size: 23px; gap: 10px; }
  #content:not(.suite-body) { padding: 20px 16px 28px; }
  .service-tools { width: 100%; position: relative; justify-content: flex-end; }
  .service-search { width: auto; flex: 1; min-width: 0; }
  .service-layout { padding-left: 7px; margin-left: 0; }
  .service-filters { position: static; }
  .service-popover { right: 0; width: min(300px, 100%); }
  [data-service-results] { display: block; }
  .service-group[data-size] .service-cards { grid-template-columns: 1fr; }
  .service-directory:not(.is-list) .service-cards { gap: 10px; }
  .service-card { padding: 18px 16px; }
  .service-copy h3 { font-size: 17px; }
  .is-list .service-card { padding: 14px 12px; gap: 10px; }
  .is-list .service-copy { grid-template-columns: 1fr; gap: 4px; }
  .is-list .service-copy p { font-size: 13px; }
  .service-group + .service-group { margin-top: 22px; }
  .panel { padding: 14px; }
  #dialog-body { padding: 18px; }
  #user-dialog .dialog-shell > header, #user-dialog .dialog-shell > footer { padding: 14px 18px; }
  #user-dialog .dialog-shell > footer { flex-wrap: wrap; }
}
@media (pointer: coarse) {
  .button, .icon-button, .actions .button { min-height: 44px; }
  .icon-button { width: 44px; height: 44px; }
  .service-search, .input, .select { min-height: 44px; }
  .service-search input, input.input, select.select, textarea.input { font-size: 16px; }
  .search-clear { width: 32px; height: 40px; }
  .filter-chip { min-height: 36px; }
  #user-dialog .field .input:not(textarea), #user-dialog .field .select { height: 44px; }
}
