/* Enterprise surfaces share the ledger's live theme and blur settings. */
:root {
  --en-ink: var(--blue-900);
  --en-muted: color-mix(in srgb, var(--blue-800) 79%, transparent);
  --en-line: var(--glass-edge);
  --en-highlight: color-mix(in srgb, var(--glass-line) 82%, transparent);
  --en-danger: #b54155;
  --en-success: #237556;
  --en-warning: #966011;
}

.enterprise-view[hidden],
.enterprise-view [hidden],
#enterpriseAuth[hidden],
#enterpriseAuth [hidden],
#enterpriseModal[hidden],
#enterpriseModal [hidden],
#enterpriseToast[hidden],
.en-context-bar[hidden],
.en-context-bar [hidden],
.en-notification-badge[hidden],
.en-alert[hidden],
.en-dev-code[hidden],
.bottom-nav [hidden] { display: none !important; }

body.enterprise-locked { overflow: hidden; }
body.enterprise-locked > .app-shell,
body.enterprise-locked > .bottom-nav { visibility: hidden; pointer-events: none; }

.enterprise-view,
#enterpriseAuth,
#enterpriseModal,
.en-context-bar,
#enterpriseToast { color: var(--en-ink); font-size: 14px; line-height: 1.5; }

.enterprise-view {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: 18px;
  padding: 2px 2px 20px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--blue-300) transparent;
}

.app-shell:has(.enterprise-view:not([hidden])) {
  display: flex;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding-bottom: calc(99px + env(safe-area-inset-bottom));
}

.enterprise-view :is(h1, h2, h3, p),
#enterpriseAuth :is(h1, h2, h3, p),
#enterpriseModal :is(h1, h2, h3, p) { margin: 0; }
.enterprise-view h2, #enterpriseModal h2 { font-size: 21px; line-height: 1.3; letter-spacing: -.035em; }
.enterprise-view h3 { font-size: 16px; line-height: 1.4; letter-spacing: -.025em; }
.enterprise-view svg, #enterpriseAuth svg, #enterpriseModal svg { width: 20px; height: 20px; flex-shrink: 0; }

.en-page-head { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 16px; padding: 3px 1px 1px; }
.en-page-head > div { min-width: 0; }
.en-page-head h1 { font-size: clamp(25px, 2.6vw, 34px); line-height: 1.2; letter-spacing: -.05em; }
.en-eyebrow { display: block; margin-bottom: 5px; color: var(--blue-700); font-size: 10px; font-weight: 780; letter-spacing: .14em; text-transform: uppercase; }
.en-subtitle { margin-top: 7px !important; color: var(--en-muted); font-size: 12px; line-height: 1.7; }
.en-muted { color: var(--en-muted); font-size: 12px; line-height: 1.7; }
.en-account-label { max-width: 130px; overflow: hidden; font-size: 12px; font-weight: 740; text-overflow: ellipsis; white-space: nowrap; }

.en-card,
.en-metric,
.en-member-card {
  position: relative;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--glass-line);
  border-radius: 23px;
  background: var(--surface-control);
  box-shadow: inset 0 1px 0 var(--en-highlight), 0 7px 22px color-mix(in srgb, var(--blue-900) 5%, transparent);
  backdrop-filter: blur(var(--blur)) saturate(145%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(145%);
}
.en-card { flex: 0 0 auto; }
:is(#dispatchView, #managementView, #accountView) .motion-card.motion-active { box-shadow: var(--motion-shadow-x, 0px) 17px 34px var(--accent-shadow), inset 0 1px 0 var(--en-highlight); }
:is(#dispatchView, #managementView, #accountView) .motion-card::after { background-image: radial-gradient(ellipse at var(--glare-x) var(--glare-y), var(--en-highlight), color-mix(in srgb, var(--glass-line) 18%, transparent) 35%, transparent 66%), linear-gradient(var(--glare-angle), transparent 28%, color-mix(in srgb, var(--glass-line) 10%, transparent) 39%, var(--en-highlight) 49%, color-mix(in srgb, var(--glass-line) 15%, transparent) 58%, transparent 72%); box-shadow: inset 0 0 0 1px var(--glass-line); }
.en-card > h3 + .en-form, .en-card > h3 + .en-member-grid { margin-top: 18px; }

.en-context-bar { display: flex; flex: 0 0 auto; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; margin: -3px 0 17px; padding: 8px 11px; border: 1px solid var(--glass-line); border-radius: 17px; background: var(--surface-control); box-shadow: inset 0 1px 0 var(--en-highlight); }
.en-context-bar > div { display: flex; min-width: 0; align-items: center; gap: 9px; }
.en-context-picker { display: flex; min-width: 0; align-items: center; gap: 8px; }
.en-context-picker > span, .en-context-bar > span { color: var(--en-muted); font-size: 11px; white-space: nowrap; }
.en-context-picker .en-select, select.en-context-picker { width: auto; max-width: min(350px, 45vw); min-height: 35px; padding-block: 6px; font-size: 12px; font-weight: 740; }
.en-context-picker > select { width: auto; min-width: 0; max-width: min(350px, 45vw); min-height: 35px; padding: 6px 27px 6px 10px; border: 1px solid var(--en-line); border-radius: 10px; color: var(--blue-800); background: var(--ice-strong); font: inherit; font-size: 12px; font-weight: 740; cursor: pointer; }
.en-context-picker > select:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.en-context-picker > select option { color: var(--en-ink); background: var(--sky); }
.en-context-bar .en-button { min-height: 34px; }

.en-button {
  display: inline-flex;
  flex-shrink: 0;
  min-width: 0;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border: 1px solid var(--glass-line);
  border-radius: 13px;
  color: var(--blue-700);
  background: var(--ice-strong);
  box-shadow: inset 0 1px 0 var(--en-highlight);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 220ms var(--soft-spring);
}
.en-button:hover:not(:disabled) { border-color: var(--blue-300); background: var(--surface-primary); box-shadow: inset 0 1px 0 var(--en-highlight), 0 5px 14px color-mix(in srgb, var(--accent-shadow) 55%, transparent); transform: translateY(-1px); }
.en-button:active:not(:disabled) { transform: translateY(0) scale(.98); }
.en-button.primary { border-color: color-mix(in srgb, var(--accent-color, var(--blue-700)) 75%, var(--glass-line)); color: var(--accent-ink, #fff); background: var(--accent-color, var(--blue-700)); box-shadow: 0 5px 14px var(--accent-shadow), inset 0 1px 0 rgba(255, 255, 255, .25); }
.en-button.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent-color, var(--blue-700)) 92%, var(--en-ink)); }
.en-button.quiet { border-color: transparent; background: transparent; box-shadow: none; }
.en-button.quiet:hover:not(:disabled) { border-color: var(--glass-line); background: var(--surface-control); }
.en-button.danger { color: var(--en-danger); border-color: color-mix(in srgb, var(--en-danger) 20%, transparent); background: color-mix(in srgb, var(--en-danger) 7%, var(--surface-control)); }
.en-button.small { min-height: 33px; padding: 6px 10px; border-radius: 10px; font-size: 11px; }
.en-button:disabled { opacity: .5; cursor: not-allowed; }
.en-button svg { width: 17px; height: 17px; }
.en-button:focus-visible,
.en-input:focus-visible,
.en-select:focus-visible,
.en-segmented button:focus-visible,
.en-auth-tabs button:focus-visible,
.en-notification:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

.en-form { display: grid; gap: 17px; }
.en-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.en-field { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.en-field > label, label.en-field > span:first-child { color: var(--blue-800); font-size: 12px; font-weight: 740; }
.en-field small { color: var(--en-muted); font-size: 11px; line-height: 1.6; }
.en-input,
.en-select { display: block; width: 100%; min-width: 0; min-height: 45px; padding: 11px 13px; border: 1px solid var(--en-line); border-radius: 12px; color: var(--en-ink); background: var(--ice-strong); box-shadow: inset 0 1px 2px color-mix(in srgb, var(--blue-900) 3%, transparent); font: inherit; font-size: 13px; line-height: 1.5; outline: none; transition: border-color 180ms ease, box-shadow 180ms ease; }
.en-input::placeholder { color: var(--en-muted); opacity: .7; }
.en-input:focus, .en-select:focus { border-color: var(--blue-500); }
.en-input[aria-invalid="true"], .en-select[aria-invalid="true"] { border-color: var(--en-danger); }
.en-input:disabled, .en-select:disabled { opacity: .6; cursor: not-allowed; }
textarea.en-input { min-height: 96px; resize: vertical; }
select.en-select { padding-right: 30px; cursor: pointer; }
.en-select option { color: var(--en-ink); background: var(--sky); }
.en-span-2 { grid-column: 1 / -1; }
.en-check-grid { display: flex; flex-wrap: wrap; gap: 10px 20px; padding: 6px 0; }
.en-check-grid label { display: inline-flex; align-items: center; gap: 8px; color: var(--blue-800); font-size: 12px; cursor: pointer; }
.en-check-grid input { width: 17px; height: 17px; margin: 0; accent-color: var(--blue-700); }
.en-inline-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }

.en-alert,
.en-dev-code { padding: 12px 14px; border: 1px solid var(--en-line); border-radius: 13px; color: var(--blue-800); background: var(--surface-primary); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.en-alert:empty, .en-dev-code:empty { display: none; }
.en-alert.error, .en-alert.danger, .en-alert[data-type="error"] { color: var(--en-danger); border-color: color-mix(in srgb, var(--en-danger) 23%, transparent); background: color-mix(in srgb, var(--en-danger) 7%, var(--surface-control)); }
.en-alert.success, .en-alert[data-type="success"] { color: var(--en-success); border-color: color-mix(in srgb, var(--en-success) 23%, transparent); background: color-mix(in srgb, var(--en-success) 7%, var(--surface-control)); }
.en-dev-code { border-style: dashed; border-color: color-mix(in srgb, var(--en-warning) 36%, transparent); color: var(--en-warning); background: color-mix(in srgb, var(--en-warning) 6%, var(--surface-control)); }
.en-dev-code strong, .en-dev-code code { font-size: 16px; font-weight: 800; letter-spacing: .12em; }
.en-status { display: inline-flex; align-items: center; gap: 6px; color: var(--en-muted); font-size: 11px; line-height: 1.4; }
.en-status::before { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--blue-500); content: ""; }
.en-status:empty { display: none; }
.en-form > .en-status:not(:empty) { color: var(--en-danger); line-height: 1.7; }
.en-form > .en-status:not(:empty)::before { background: var(--en-danger); }
.en-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.en-code-row > .en-button { min-height: 45px; padding-inline: 12px; }

.en-metrics { display: grid; flex: 0 0 auto; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.en-metric { display: flex; min-height: 114px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 7px; padding: 18px 20px; border-radius: 20px; }
.en-metric:first-child { background: linear-gradient(135deg, var(--surface-strong), var(--surface-tint)); border-color: color-mix(in srgb, var(--blue-500) 16%, var(--glass-line)); }
.en-metric label { color: var(--blue-800); font-size: 12px; font-weight: 650; }
.en-metric b { max-width: 100%; color: var(--blue-700); font-size: clamp(25px, 2.8vw, 35px); font-weight: 820; line-height: 1.12; letter-spacing: -.055em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.en-metric span { color: var(--en-muted); font-size: 10px; line-height: 1.4; }
.en-metric b small { margin-left: 2px; font-size: 12px; font-weight: 650; letter-spacing: 0; }
.en-metric > span { color: var(--blue-800); font-size: 13px; font-weight: 680; font-variant-numeric: tabular-nums; }
.en-metric > span small { margin-left: 3px; color: var(--en-muted); font-size: 10px; font-weight: 500; }
.en-toolbar { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.en-toolbar > div { min-width: 0; }
.en-card > .en-toolbar { margin-bottom: 17px; }
.en-toolbar .en-input, .en-toolbar .en-select { width: auto; max-width: 240px; min-height: 38px; padding-block: 8px; font-size: 12px; }
.en-segmented, .en-auth-tabs { display: inline-flex; min-width: 0; gap: 3px; padding: 4px; border: 1px solid var(--glass-line); border-radius: 14px; background: var(--surface-tint); }
.en-segmented button, .en-auth-tabs button { display: inline-flex; min-width: 0; min-height: 35px; align-items: center; justify-content: center; gap: 5px; padding: 7px 13px; border: 1px solid transparent; border-radius: 10px; color: var(--blue-800); background: transparent; font: inherit; font-size: 12px; font-weight: 720; white-space: nowrap; cursor: pointer; transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease; }
.en-segmented button.active, .en-segmented button[aria-selected="true"], .en-segmented button[aria-pressed="true"], .en-auth-tabs button.active, .en-auth-tabs button[aria-selected="true"] { border-color: var(--glass-line); color: var(--blue-700); background: var(--ice-strong); box-shadow: inset 0 1px 0 var(--en-highlight), 0 3px 8px color-mix(in srgb, var(--accent-shadow) 45%, transparent); }
#dispatchPeriod { position: relative; isolation: isolate; }
#dispatchPeriod button { position: relative; z-index: 1; }
#dispatchPeriod button.active, #dispatchPeriod button[aria-pressed="true"] { border-color: transparent; background: transparent; box-shadow: none; }
#dispatchPeriod .liquid-pill { border-color: var(--glass-line); border-radius: 10px; background: var(--ice-strong); box-shadow: inset 0 1px 0 var(--en-highlight), 0 3px 8px color-mix(in srgb, var(--accent-shadow) 45%, transparent); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); }
#dispatchPeriod .liquid-pill.flowing { border-radius: 15px; }

.en-table-wrap { width: 100%; min-width: 0; overflow: auto; border: 1px solid var(--en-line); border-radius: 15px; scrollbar-width: thin; scrollbar-color: var(--blue-300) var(--surface-tint); }
.en-table { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0; color: var(--en-ink); font-size: 12px; text-align: left; font-variant-numeric: tabular-nums; }
.en-table th { position: sticky; top: 0; z-index: 1; padding: 13px 15px; border-bottom: 1px solid var(--en-line); color: var(--blue-800); background: var(--surface-table-head); font-size: 11px; font-weight: 760; white-space: nowrap; }
.en-table td { padding: 14px 15px; border-bottom: 1px solid var(--en-line); background: var(--surface-table-cell); line-height: 1.6; vertical-align: middle; }
.en-table tr:last-child td { border-bottom: 0; }
.en-table tbody tr:hover td { background: var(--surface-primary); }
.en-table td > strong { display: block; font-weight: 730; }
.en-table td > small { display: block; margin-top: 3px; color: var(--en-muted); font-size: 10px; }
.en-table td .en-inline-actions { flex-wrap: nowrap; }
.en-table .en-empty { padding: 35px 20px; }
.en-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border: 1px solid var(--en-line); border-radius: 8px; color: var(--blue-700); background: var(--surface-primary); font-size: 10px; font-weight: 760; line-height: 1.5; white-space: nowrap; }
.en-pill.owner, .en-pill.admin, .en-pill.assigned, .en-pill.pending, .en-pill.normal { color: var(--blue-700); }
.en-pill.completed, .en-pill.done, .en-pill.active, .en-pill.settled, .en-pill.success { color: var(--en-success); border-color: color-mix(in srgb, var(--en-success) 19%, transparent); background: color-mix(in srgb, var(--en-success) 8%, var(--surface-control)); }
.en-pill.urgent, .en-pill.high, .en-pill.overdue, .en-pill.danger, .en-pill.refunded { color: var(--en-danger); border-color: color-mix(in srgb, var(--en-danger) 19%, transparent); background: color-mix(in srgb, var(--en-danger) 8%, var(--surface-control)); }
.en-pill.medium, .en-pill.in_progress, .en-pill.processing, .en-pill.warning { color: var(--en-warning); border-color: color-mix(in srgb, var(--en-warning) 19%, transparent); background: color-mix(in srgb, var(--en-warning) 8%, var(--surface-control)); }
.en-pill.employee, .en-pill.low, .en-pill.cancelled, .en-pill.inactive, .en-pill.muted { color: var(--en-muted); background: var(--surface-control); }
.en-pill.quiet { color: var(--en-muted); background: var(--surface-control); }
.en-pill.blue { color: var(--blue-700); background: var(--surface-primary); }
.en-table td > .en-priority-high { color: var(--en-warning); font-weight: 750; }
.en-table td > .en-priority-urgent { color: var(--en-danger); font-weight: 800; }
.en-table td > .en-priority-normal { color: var(--blue-700); }
.en-table td > .en-priority-low { color: var(--en-muted); }
.en-priority-high::before, .en-priority-urgent::before { display: inline-block; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: currentColor; vertical-align: 1px; content: ""; }

.en-member-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.en-member-card { display: flex; flex-direction: column; gap: 15px; padding: 19px; border-radius: 19px; }
.en-member-card > header, .en-member-card > .en-member-head { display: flex; align-items: center; gap: 11px; }
.en-member-card > header > div, .en-member-head > div { min-width: 0; }
.en-member-card h3, .en-member-card strong { overflow-wrap: anywhere; }
.en-member-card .en-inline-actions { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--en-line); }
.en-member-heading { display: flex; align-items: center; gap: 12px; }
.en-member-heading > div { min-width: 0; }
.en-member-heading h3 { margin-bottom: 5px; }
.en-member-heading h3 small { color: var(--en-muted); font-size: 10px; font-weight: 600; }
.en-member-stats { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 12px; padding: 13px 0; border-block: 1px solid var(--en-line); }
.en-member-stats > span { display: flex; min-width: 0; flex-direction: column; gap: 7px; color: var(--en-muted); font-size: 11px; }
.en-member-stats strong { color: var(--blue-700); font-size: 21px; font-weight: 780; line-height: 1.2; letter-spacing: -.04em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.en-member-stats strong small { font-size: 10px; font-weight: 550; letter-spacing: 0; }
.en-member-permissions { min-height: 39px; font-size: 11px; line-height: 1.8; }
.en-avatar { display: inline-grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; overflow: hidden; border: 1px solid var(--glass-line); border-radius: 15px; color: var(--accent-ink, #fff); background: var(--accent-color, var(--blue-700)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 5px 12px color-mix(in srgb, var(--accent-shadow) 70%, transparent); font-size: 18px; font-weight: 800; }
.en-avatar img, img.en-avatar { width: 44px; height: 44px; object-fit: cover; }
.en-avatar.has-image { background-size: cover; background-position: center; }
.en-profile-grid { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.5fr); align-items: start; gap: 18px; }
.en-profile-grid > .en-card { display: grid; gap: 20px; }
.en-profile-hero { display: grid; grid-template-columns: 62px minmax(0, 1fr); align-items: center; gap: 2px 15px; padding-bottom: 19px; border-bottom: 1px solid var(--en-line); }
.en-profile-hero > .en-avatar { grid-column: 1; grid-row: 1 / 4; }
.en-profile-hero > h3, .en-profile-hero > .en-account-label, .en-profile-hero > code { grid-column: 2; min-width: 0; }
.en-profile-hero > h3 { align-self: end; font-size: 20px; }
.en-profile-hero > .en-account-label { display: block; margin-top: 4px; color: var(--en-muted); font-size: 9px; font-weight: 500; }
.en-profile-hero > code { align-self: start; color: var(--en-muted); font-size: 9px; line-height: 1.5; overflow-wrap: anywhere; }
.en-profile-hero .en-avatar { width: 62px; height: 62px; flex-basis: 62px; border-radius: 21px; font-size: 25px; }
.en-profile-hero .en-avatar img { width: 100%; height: 100%; }
.en-profile-hero > div { min-width: 0; }
.en-profile-hero h2, .en-profile-hero p { overflow-wrap: anywhere; }
.en-enterprise-list { display: grid; gap: 10px; }
.en-enterprise-row { display: flex; min-width: 0; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 14px; border: 1px solid var(--en-line); border-radius: 15px; background: var(--surface-table-cell); }
.en-enterprise-row > div { min-width: 0; }
.en-enterprise-row strong { display: block; margin-bottom: 4px; font-size: 13px; overflow-wrap: anywhere; }
.en-enterprise-row.active { border-color: color-mix(in srgb, var(--blue-500) 40%, var(--glass-line)); background: var(--surface-primary); }
.en-enterprise-row small { display: block; color: var(--en-muted); font-size: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.en-account-bindings { display: grid; gap: 12px; padding-top: 17px; border-top: 1px solid var(--en-line); }
.en-account-bindings > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 11px; }
.en-account-bindings > div > span { flex-shrink: 0; color: var(--en-muted); }
.en-account-bindings strong { min-width: 0; font-weight: 650; overflow-wrap: anywhere; text-align: right; }
.en-input[type="file"] { padding: 7px; font-size: 11px; }
.en-input[type="file"]::file-selector-button { min-height: 28px; margin-right: 9px; padding: 5px 9px; border: 1px solid var(--en-line); border-radius: 7px; color: var(--blue-700); background: var(--surface-primary); font: inherit; font-weight: 650; cursor: pointer; }
.en-card > .en-page-head { margin-bottom: 18px; }
.en-card > .en-subtitle + .en-inline-actions { margin-top: 17px; }
.en-card > .en-dev-code, .en-card > .en-enterprise-list + .en-muted { margin-top: 16px; }

#enterpriseAuth { position: fixed; z-index: 250; inset: 0; display: grid; align-items: center; overflow: auto; padding: 36px 24px; background: radial-gradient(ellipse at 17% 14%, var(--ambient-one), transparent 53%), radial-gradient(ellipse at 90% 80%, var(--ambient-two), transparent 46%), var(--sky); }
.en-auth-shell { display: grid; width: min(960px, 100%); grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); align-items: center; gap: 74px; margin: auto; }
.en-auth-brand { position: relative; padding: 20px 0; }
.en-auth-brand > svg, .en-auth-brand > .en-brand-icon { display: grid; width: 58px; height: 58px; place-items: center; margin-bottom: 25px; padding: 13px; border: 1px solid var(--glass-line); border-radius: 19px; color: var(--blue-700); background: var(--ice); box-shadow: 0 10px 30px var(--accent-shadow), inset 0 1px 0 var(--en-highlight); }
.en-auth-brand h1 { max-width: 400px; font-size: clamp(34px, 4.5vw, 50px); font-weight: 820; line-height: 1.22; letter-spacing: -.055em; }
.en-auth-brand h1 + p { max-width: 330px; margin-top: 18px !important; color: var(--en-muted); font-size: 14px; line-height: 1.9; }
.en-auth-brand .en-status { margin-top: 27px; }
.en-auth-brand .en-eyebrow { margin-bottom: 14px; }
.en-brand-icon svg { width: 29px !important; height: 29px !important; }
.en-auth-brand-foot { display: flex; flex-wrap: wrap; gap: 11px 17px; margin-top: 35px; color: var(--blue-800); font-size: 11px; font-weight: 600; }
.en-auth-brand-foot > span { display: inline-flex; align-items: center; gap: 7px; }
.en-auth-brand-foot > span::before { width: 5px; height: 5px; border-radius: 50%; background: var(--blue-500); content: ""; }
.en-auth-card { min-width: 0; padding: 30px; border: 1px solid var(--glass-line); border-radius: 29px; background: var(--surface-control); box-shadow: 0 24px 65px color-mix(in srgb, var(--accent-shadow) 58%, transparent), inset 0 1px 0 var(--en-highlight); backdrop-filter: blur(var(--blur)) saturate(150%); -webkit-backdrop-filter: blur(var(--blur)) saturate(150%); }
.en-auth-card h2 { font-size: 23px; line-height: 1.3; letter-spacing: -.04em; }
.en-auth-card > p { margin-top: 7px !important; color: var(--en-muted); font-size: 12px; }
.en-auth-tabs { display: flex; margin: 23px 0 22px; }
.en-auth-card > .en-auth-tabs:first-child { margin-top: 0; }
.en-auth-tabs button { flex: 1 1 0; min-height: 38px; }
.en-auth-card .en-form { gap: 15px; margin-top: 23px; }
.en-auth-card .en-form > .en-button.primary { width: 100%; min-height: 46px; margin-top: 3px; }
.en-auth-card .en-input { min-height: 46px; }
.en-auth-card .en-alert, .en-auth-card .en-dev-code { margin-top: 14px; }
.en-auth-card > .en-muted:last-child { margin-top: 20px !important; font-size: 10px; text-align: center; }
.en-auth-card > .en-auth-foot { margin-top: 22px !important; padding-top: 17px; border-top: 1px solid var(--en-line); color: var(--en-muted); font-size: 10px; line-height: 1.8; text-align: center; }

#enterpriseModal { position: fixed; z-index: 260; inset: 0; display: grid; align-items: center; justify-items: center; padding: 24px; }
.en-modal-backdrop { position: absolute; inset: 0; background: var(--theme-backdrop); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
.en-dialog { position: relative; display: flex; width: min(650px, 100%); min-width: 0; max-height: min(850px, calc(100dvh - 48px)); flex-direction: column; overflow: hidden; border: 1px solid var(--glass-line); border-radius: 26px; background: var(--surface-sheet); box-shadow: 0 30px 95px rgba(4, 32, 68, .23), inset 0 1px 0 var(--en-highlight); backdrop-filter: blur(var(--blur)) saturate(145%); -webkit-backdrop-filter: blur(var(--blur)) saturate(145%); animation: en-dialog-enter 220ms var(--soft-spring) both; }
.en-dialog-wide { width: min(790px, 100%); }
.en-dialog > form.en-form { display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; gap: 0; overflow: hidden; }
.en-dialog > form.en-form > .en-status:not(:empty) { flex: 0 0 auto; padding: 0 25px 14px; }
.en-dialog-head { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 16px; padding: 23px 25px 17px; border-bottom: 1px solid var(--en-line); }
.en-dialog-head h2 { font-size: 20px !important; }
.en-dialog-head .en-button { width: 34px; min-height: 34px; padding: 6px; border-radius: 50%; }
.en-dialog-body { display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; gap: 17px; padding: 22px 25px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--blue-300) transparent; }
.en-dialog-body > * { flex-shrink: 0; }
.en-dialog-body > .en-subtitle:first-child { margin-top: 0 !important; }
.en-dialog-body > .en-alert { margin-bottom: 16px; }
.en-dialog-body > .en-form + .en-card, .en-dialog-body > .en-card + .en-card { margin-top: 18px; }
.en-dialog-actions { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; padding: 16px 25px 21px; border-top: 1px solid var(--en-line); background: var(--surface-control); }
.en-dialog-body .en-form > .en-dialog-actions { margin: 3px -25px -22px; }
.en-order-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.en-invite-code { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 14px; padding: 19px; border: 1px dashed var(--blue-300); border-radius: 15px; background: var(--surface-control); }
.en-invite-code code { min-width: 0; color: var(--blue-700); font-size: clamp(16px, 2.5vw, 23px); font-weight: 750; letter-spacing: .055em; overflow-wrap: anywhere; user-select: all; }
.en-history { border-top: 1px solid var(--en-line); }
.en-history summary { padding: 15px 0; color: var(--blue-800); font-size: 12px; font-weight: 750; cursor: pointer; }
.en-history summary::marker { color: var(--blue-500); }
.en-history summary:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: 6px; }
.en-history .en-timeline { margin: 6px 0 3px 5px; }

#enterpriseToast { position: fixed; z-index: 300; right: 16px; bottom: calc(102px + env(safe-area-inset-bottom)); left: 16px; display: flex; justify-content: center; pointer-events: none; }
.en-toast, #enterpriseToast.en-toast { width: max-content; max-width: min(520px, calc(100vw - 32px)); padding: 12px 19px; border: 1px solid var(--glass-line); border-radius: 15px; color: var(--en-ink); background: var(--surface-sheet); box-shadow: 0 8px 28px var(--accent-shadow), inset 0 1px 0 var(--en-highlight); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); font-size: 12px; line-height: 1.6; text-align: center; overflow-wrap: anywhere; animation: en-dialog-enter 200ms ease both; }
#enterpriseToast.en-toast { margin-inline: auto; }
.en-toast.error { color: var(--en-danger); }

#enterpriseNotificationButton { position: relative; flex-shrink: 0; }
#enterpriseNotificationButton.has-unread { color: var(--blue-600); animation: en-notification-breathe 2.5s ease-in-out infinite; }
.en-notification-badge { position: absolute; top: -3px; right: -3px; display: grid; min-width: 17px; height: 17px; place-items: center; padding: 0 4px; border: 2px solid var(--sky); border-radius: 99px; color: #fff; background: #d7566a; font-size: 9px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.en-notification-badge:empty { display: none; }
.en-notification-list { display: grid; gap: 11px; }
.en-notification { min-width: 0; padding: 16px; border: 1px solid var(--en-line); border-radius: 15px; background: var(--surface-control); text-align: left; }
.en-notification.unread { border-color: color-mix(in srgb, var(--blue-500) 33%, var(--glass-line)); background: var(--surface-primary); box-shadow: inset 3px 0 0 var(--blue-500); }
.en-notification h3, .en-notification strong { font-size: 13px; font-weight: 750; overflow-wrap: anywhere; }
.en-notification p { margin-top: 7px !important; color: var(--blue-800); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.en-notification-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 10px; margin-top: 9px; color: var(--en-muted); font-size: 10px; }
.en-notification > .en-notification-meta:first-child { justify-content: space-between; margin: 0 0 8px; }
.en-notification > .en-button:last-child { margin-top: 10px; }
.en-change-list { display: grid; gap: 6px; margin: 12px 0 0; padding: 11px 13px; border-radius: 10px; background: var(--surface-control); list-style: none; color: var(--blue-800); font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
.en-change-list li { display: grid; grid-template-columns: minmax(65px, .65fr) minmax(0, 2fr); align-items: baseline; gap: 12px; padding: 2px 0; }
.en-change-list li > span:first-child { color: var(--en-muted); }
.en-change-list li > span:last-child { overflow-wrap: anywhere; }
.en-change-list del { color: var(--en-muted); }
.en-change-list ins { color: var(--blue-700); text-decoration: none; font-weight: 700; }
.en-timeline { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.en-timeline > * { position: relative; padding: 0 0 21px 24px; border-left: 1px solid var(--en-line); }
.en-timeline > *::before { position: absolute; top: 5px; left: -4px; width: 7px; height: 7px; border: 2px solid var(--surface-sheet); border-radius: 50%; background: var(--blue-500); box-shadow: 0 0 0 1px var(--blue-300); content: ""; }
.en-timeline > *:last-child { padding-bottom: 0; border-left-color: transparent; }
.en-timeline h3, .en-timeline strong { font-size: 12px; }
.en-timeline time { color: var(--en-muted); font-size: 10px; }
.en-timeline > article > small { display: block; margin-top: 4px; color: var(--en-muted); font-size: 10px; }
.en-empty { display: flex; min-height: 155px; align-items: center; justify-content: center; flex-direction: column; gap: 9px; padding: 29px 20px; color: var(--en-muted); font-size: 12px; line-height: 1.8; text-align: center; }
.en-empty > svg { width: 33px; height: 33px; margin-bottom: 5px; color: var(--blue-500); opacity: .8; }
.en-empty strong, .en-empty h3 { color: var(--blue-800); font-size: 15px; }
.en-empty .en-button { margin-top: 8px; }

/* Flex sizing lets the two permission-dependent tabs collapse naturally. */
.bottom-nav:has([data-nav="派单"]) { display: flex; width: min(680px, calc(100% - 28px)); gap: 1px; }
.bottom-nav:has([data-nav="派单"]) .nav-item { flex: 1 1 0; min-width: 0; }
.bottom-nav:has([data-nav="派单"]) .nav-add { flex: 0 0 56px; margin-inline: 4px; }

@keyframes en-dialog-enter { from { opacity: 0; transform: translateY(9px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes en-notification-breathe { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--blue-500) 5%, transparent); } 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--blue-500) 15%, transparent); } }

@media (max-width: 1100px) {
  .en-member-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .en-metric { padding: 16px 13px; }
  .en-profile-grid { grid-template-columns: minmax(230px, .85fr) minmax(0, 1.15fr); }
}

@media (max-width: 760px) {
  .en-auth-shell { width: min(460px, 100%); grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .en-auth-brand { padding: 0 5px; }
  .en-auth-brand > svg, .en-auth-brand > .en-brand-icon { width: 46px; height: 46px; margin-bottom: 17px; padding: 10px; border-radius: 15px; }
  .en-auth-brand h1 { font-size: 32px; }
  .en-auth-brand h1 + p { max-width: none; margin-top: 10px !important; font-size: 12px; }
  .en-auth-brand .en-status { margin-top: 14px; }
  .en-auth-brand .en-eyebrow { margin-bottom: 8px; }
  .en-auth-brand-foot { margin-top: 19px; font-size: 10px; }
  .en-profile-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 700px) {
  .app-shell:has(.enterprise-view:not([hidden])) { height: auto; min-height: 100dvh; overflow: visible; padding-bottom: calc(99px + env(safe-area-inset-bottom)); }
  .enterprise-view { flex: 0 0 auto; gap: 14px; padding-bottom: 8px; overflow: visible; }
  .en-context-bar { flex-wrap: wrap; gap: 7px; margin-bottom: 15px; padding: 7px 8px; }
  .en-context-bar > div { gap: 5px; }
  .en-context-picker { flex: 1; }
  .en-context-picker > span { display: none; }
  .en-context-picker .en-select, select.en-context-picker { max-width: 42vw; padding-left: 8px; font-size: 11px; }
  .en-context-picker > label { flex-shrink: 0; font-size: 10px; }
  .en-context-picker > select { flex: 1; max-width: 100%; padding-left: 8px; font-size: 11px; }
  .en-context-bar > .en-inline-actions { width: 100%; justify-content: space-between; }
  .en-context-bar > .en-inline-actions .en-segmented { margin-left: auto; padding: 2px; border-radius: 10px; }
  .en-context-bar > .en-inline-actions .en-segmented button { min-height: 29px; padding: 5px 7px; border-radius: 7px; font-size: 10px; }
  .en-context-bar > .en-inline-actions .en-pill { padding-inline: 6px; font-size: 9px; }
  .en-context-bar > .en-inline-actions > .en-button { min-height: 29px; font-size: 9px; }
  .en-context-bar .en-status { max-width: 90px; font-size: 10px; }
  .en-context-bar .en-button { padding-inline: 7px; font-size: 10px; }
  .en-page-head { align-items: flex-start; gap: 10px; }
  .en-page-head h1 { font-size: 26px; }
  .en-page-head > .en-button { min-height: 39px; padding: 9px 12px; }
  .en-page-head .en-subtitle { font-size: 11px; }
  .en-card { padding: 17px; border-radius: 20px; }
  .en-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .en-metric { min-height: 101px; padding: 15px; border-radius: 17px; }
  .en-metric:first-child { grid-column: 1 / -1; min-height: 89px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: center; column-gap: 12px; }
  .en-metric:first-child b { grid-column: 2; grid-row: 1 / 3; align-self: center; font-size: 37px; }
  .en-metric:first-child span { grid-column: 1; }
  .en-metric b { font-size: 29px; }
  .en-toolbar { gap: 10px; }
  .en-toolbar .en-segmented { max-width: 100%; overflow-x: auto; }
  .en-segmented button { padding-inline: 10px; font-size: 11px; }
  .en-toolbar > .en-inline-actions { width: 100%; }
  .en-toolbar .en-input, .en-toolbar .en-select { flex: 1 1 90px; max-width: 100%; }
  .en-form-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .en-input, .en-select { font-size: 16px; }
  .en-member-grid { grid-template-columns: minmax(0, 1fr); gap: 11px; }
  .en-member-card { padding: 17px; border-radius: 17px; }
  .en-profile-grid { gap: 14px; }
  .en-enterprise-row { padding: 12px; }
  .en-enterprise-row > .en-inline-actions { width: 100%; }
  .en-enterprise-row > .en-inline-actions .en-button { flex: 1; }
  .en-table th, .en-table td { padding: 12px; }
  #enterpriseAuth { padding: max(28px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom)); }
  .en-auth-card { padding: 24px; border-radius: 24px; }
  #enterpriseModal { align-items: end; padding: 12px 9px max(10px, env(safe-area-inset-bottom)); }
  .en-dialog { max-height: calc(100dvh - 35px - env(safe-area-inset-bottom)); border-radius: 23px; }
  .en-dialog-head { padding: 19px 18px 15px; }
  .en-dialog-body { padding: 18px; }
  .en-dialog > form.en-form > .en-status:not(:empty) { padding-inline: 18px; }
  .en-dialog-actions { padding: 14px 18px 18px; }
  .en-dialog-body .en-form > .en-dialog-actions { margin-inline: -18px; margin-bottom: -18px; }
  .en-dialog-actions > .en-button { flex: 1 1 0; }
  .en-notification { padding: 14px; }
  .en-invite-code { gap: 10px; padding: 14px; }
  .en-change-list { padding: 10px; }
  .en-change-list li { grid-template-columns: 60px minmax(0, 1fr); gap: 8px; }
  .en-account-label { display: none; }
  .bottom-nav:has([data-nav="派单"]) { gap: 0; padding-inline: 5px; width: calc(100% - 20px); right: 10px; left: 10px; }
  .bottom-nav:has([data-nav="派单"]) .nav-add { width: 46px; height: 46px; flex-basis: 46px; margin-inline: 3px; }
  .bottom-nav:has([data-nav="派单"]) .nav-item { gap: 4px; border-radius: 16px; }
  .bottom-nav:has([data-nav="派单"]) .nav-item svg { width: 19px; height: 19px; }
  .bottom-nav:has([data-nav="派单"]) .nav-item span { font-size: 9px; }
}

@media (max-width: 370px) {
  .en-auth-card { padding: 20px; }
  #enterpriseAuth { padding-inline: 15px; }
  .en-page-head h1 { font-size: 24px; }
  .en-page-head { flex-wrap: wrap; }
  .en-context-bar { flex-wrap: wrap; }
  .en-context-picker .en-select, select.en-context-picker { max-width: 58vw; }
  .bottom-nav:has([data-nav="派单"]) .nav-add { width: 42px; height: 42px; flex-basis: 42px; margin-inline: 1px; }
  .bottom-nav:has([data-nav="派单"]) .nav-item svg { width: 18px; height: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .en-button, .en-input, .en-select, .en-segmented button, .en-auth-tabs button { transition: none; }
  .en-dialog, .en-toast, #enterpriseNotificationButton.has-unread { animation: none; }
  #enterpriseNotificationButton.has-unread { box-shadow: 0 0 0 3px var(--focus-ring); }
}
