body[data-workspace="team"] { background: #f4f6f6; --ink: #233b40; --muted: #6c7a7e; --line: #dce4e4; }
body[data-workspace="team"] .app-shell { grid-template-columns: 218px minmax(0, 1fr); }
body[data-workspace="team"] .main { min-width: 0; width: 100%; max-width: 1640px; padding: 28px 32px 48px; margin-inline: auto; }
body[data-workspace="team"] .admin-sidebar { background: #fff; color: var(--ink); border-inline-end: 1px solid var(--line); padding: 26px 16px; gap: 26px; overflow-y: auto; z-index: 30; }
.admin-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.admin-brand img { border-radius: 8px; }
.admin-brand span { display: grid; gap: 3px; }
.admin-brand strong { font-size: 24px; line-height: 1.3; }
.admin-brand small { color: var(--muted); font-size: 12px; }
.admin-primary-nav { display: grid; gap: 7px; }
.admin-primary-nav button { display: flex; align-items: center; gap: 12px; padding: 12px; min-height: 48px; border-radius: 6px; color: #4e6267; background: transparent; text-align: start; font-size: 15px; }
.admin-primary-nav button[aria-current="page"] { background: #e5f2ef; color: #17685e; font-weight: 700; }
.admin-primary-nav button:hover, .admin-more button:hover { background: #eff4f3; }
.admin-primary-nav .driver-icon { opacity: .8; }
.admin-more { border-top: 1px solid var(--line); padding-top: 16px; }
.admin-more summary { cursor: pointer; padding: 10px 12px; min-height: 44px; font-size: 14px; }
.admin-more nav { display: grid; gap: 2px; margin-top: 6px; }
.admin-more button { background: transparent; padding: 11px 12px; text-align: start; color: var(--muted); border-radius: 6px; min-height: 42px; font-size: 13px; }
.admin-more button[aria-current="page"] { color: #17685e; background: #e5f2ef; }
.admin-team-links { margin-top: auto; display: flex; gap: 12px; flex-wrap: wrap; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.admin-team-links > span { flex-basis: 100%; font-size: 12px; color: var(--muted); }
.admin-team-links a { color: #49646a; font-size: 13px; min-height: 28px; text-underline-offset: 4px; }
body[data-workspace="team"] .admin-topbar { align-items: center; margin: 0 0 26px; padding-bottom: 22px; border-bottom: 1px solid var(--line); gap: 16px; }
.admin-topbar h2 { font-size: 25px; margin: 5px 0 0; line-height: 1.4; }
.admin-dateline { font-size: 12px; color: var(--muted); }
.admin-top-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-top-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 6px; font-size: 14px; }
.admin-top-actions .primary .driver-icon { filter: brightness(0) invert(1); }
.admin-sync { font-size: 11px; color: var(--muted); max-width: 170px; }
body[data-workspace="team"] .icon-button, .admin-dialog .icon-button { display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); width: 44px; height: 44px; flex: 0 0 44px; }
.admin-workspace { min-width: 0; }
.admin-workspace h3 { margin: 0; font-size: 18px; line-height: 1.5; }
.admin-workspace h4 { margin: 0; font-size: 14px; line-height: 1.5; }
.admin-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 28px; }
.admin-metric { background: #fff; border: 1px solid var(--line); border-top: 3px solid #317d70; border-radius: 6px; padding: 17px 18px 14px; min-width: 0; }
.admin-metric > span { color: #526a6f; font-size: 14px; }
.admin-metric > div { display: flex; align-items: baseline; gap: 9px; min-height: 57px; }
.admin-metric > div strong { font-size: 35px; line-height: 1.5; font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.admin-metric small { color: var(--muted); font-size: 12px; }
.admin-metric footer { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--muted); border-top: 1px solid #edf1f1; padding-top: 9px; min-height: 34px; }
.admin-metric footer b { color: #526a6f; font-size: 12px; }
.admin-metric.is-processing { border-top-color: #c9a259; }
.admin-metric.is-processing > div strong { color: #8e6a28; }
.admin-overview-grid { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(225px, 1fr); gap: 30px; margin-bottom: 34px; }
.admin-section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 0 0 15px; }
.admin-section-heading > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; }
.admin-section-heading .btn { font-size: 13px; min-height: 42px; display: inline-flex; align-items: center; gap: 8px; border-radius: 6px; }
.admin-count { font-size: 13px; margin-inline-start: 8px; color: var(--muted); font-weight: 500; }
.admin-text-button { background: transparent; color: #17685e; padding: 8px 0; min-height: 40px; font-size: 13px; text-align: start; }
.admin-order-totals { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; padding: 0 0 16px; color: var(--muted); font-size: 12px; }
.admin-order-totals b { font-size: 19px; margin-inline-end: 4px; color: #233b40; }
.admin-order-table { border-top: 1px solid var(--line); }
.admin-order-table-head, .admin-order-row { display: grid; grid-template-columns: minmax(130px, 1.5fr) minmax(140px, 1.6fr) minmax(85px, 1fr) minmax(80px, .8fr) 80px; gap: 12px; align-items: center; }
.admin-order-table-head { padding: 10px 12px; color: var(--muted); font-size: 11px; }
.admin-order-row { width: 100%; background: #fff; border: 0; border-bottom: 1px solid var(--line); text-align: start; padding: 15px 12px; color: var(--ink); }
.admin-order-row:hover { background: #edf5f3; }
.admin-order-row:focus-visible, .admin-primary-nav button:focus-visible, .admin-map-order-list button:focus-visible { outline: 2px solid #188c7c; outline-offset: -2px; }
.admin-order-row > span { min-width: 0; }
.admin-order-person { display: grid; gap: 5px; }
.admin-order-person > bdi { font-size: 14px; font-weight: 700; }
.admin-order-person > strong { font-size: 15px; overflow-wrap: anywhere; }
.admin-order-person > small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.admin-order-products { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.admin-product { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 5px; font-size: 13px; }
.admin-product b { font-size: 19px; color: #247567; }
.admin-product small { color: var(--muted); font-size: 10px; }
.admin-status { display: inline-block; padding: 4px 7px; color: #7b682f; background: #f5f0df; font-size: 11px; line-height: 1.6; border-radius: 4px; }
.admin-status.is-delivering { color: #296861; background: #e5f2ed; }
.admin-owner { font-size: 12px; line-height: 1.6; }
.admin-owner[data-driver="yahya"] { color: #3961a5; }
.admin-owner[data-driver="shuaib"] { color: #906a25; }
.admin-owner[data-driver="unassigned"] { color: #78828a; }
.admin-age { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; color: #53666d; }
.admin-overview-grid .admin-order-table-head, .admin-overview-grid .admin-order-row { grid-template-columns: minmax(100px, 1.3fr) minmax(125px, 1.6fr) 85px; }
.admin-overview-grid .admin-order-table-head > :nth-child(4), .admin-overview-grid .admin-order-table-head > :nth-child(5), .admin-overview-grid .admin-order-row > :nth-child(4), .admin-overview-grid .admin-order-row > :nth-child(5) { display: none; }
.admin-location-summary { border-inline-start: 1px solid var(--line); padding-inline-start: 26px; }
.admin-location-head, .admin-location-row { display: grid; grid-template-columns: minmax(100px, 1fr) 50px 50px; gap: 10px; align-items: center; }
.admin-location-head { color: var(--muted); font-size: 11px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.admin-location-row { padding: 15px 0; font-size: 13px; border-bottom: 1px solid var(--line); }
.admin-location-row b { font-size: 20px; font-weight: 600; }
.admin-followup { margin-top: 24px; }
.admin-followup h4 { color: #52656b; margin-bottom: 10px; }
.admin-followup button { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 12px 0; background: transparent; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 12px; text-align: start; }
.admin-followup b { font-size: 15px; color: #926b25; }
.admin-notice { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 12px 14px; margin: 0 0 18px; border-inline-start: 3px solid #9c762c; color: #795f29; background: #f9f3e5; font-size: 13px; line-height: 1.8; }
.admin-notice[hidden] { display: none; }
.admin-notice button { background: transparent; color: inherit; text-decoration: underline; min-height: 30px; }
.admin-muted { color: var(--muted); font-size: 12px; line-height: 1.8; }
.admin-empty { color: var(--muted); text-align: center; padding: 35px 12px; font-size: 14px; margin: 0; }
.admin-filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.admin-filters input, .admin-filters select { min-height: 44px; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 10px 12px; color: var(--ink); font-size: 14px; min-width: 0; }
.admin-filters input { width: auto; flex: 1 1 240px; }
.admin-filters select { width: auto; flex: 0 1 180px; }
.admin-segments { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.admin-segments button { background: #fff; color: #52656b; padding: 10px 18px; min-height: 44px; font-size: 13px; }
.admin-segments button[aria-pressed="true"] { background: #e5f2ed; color: #17685e; font-weight: 700; }
.admin-stock-table { overflow-x: auto; }
.admin-stock-table table { width: 100%; min-width: 540px; border-collapse: collapse; background: #fff; }
.admin-stock-table th, .admin-stock-table td { padding: 13px 14px; font-size: 13px; border-bottom: 1px solid var(--line); text-align: start; }
.admin-stock-table thead { color: var(--muted); }
.admin-stock-table thead th { font-size: 12px; font-weight: 500; background: #edf1f1; }
.admin-stock-table .admin-batch-heading th { background: #e7eeed; padding: 12px 14px; }
.admin-batch-heading th > span { display: inline-flex; flex-wrap: wrap; gap: 14px; align-items: baseline; }
.admin-batch-heading th > b { float: left; font-size: 12px; color: #287467; }
.admin-batch-heading small { font-weight: 400; color: var(--muted); font-size: 11px; }
.admin-stock-age strong { font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; color: #296e62; }
.admin-stock-age.is-aging strong { color: #956c24; }
.admin-map-section { border-top: 1px solid var(--line); padding-top: 24px; }
.admin-map-tools { display: flex; align-items: center; gap: 8px; }
.admin-map-legend { display: flex; flex-wrap: wrap; gap: 18px; margin: 0 0 14px; font-size: 12px; color: var(--muted); }
.admin-map-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.admin-map-legend i { width: 8px; height: 8px; border-radius: 50%; background: #66787c; }
.admin-map-legend [data-driver="yahya"] i { background: #426ba4; }
.admin-map-legend [data-driver="shuaib"] i { background: #bb8e3e; }
.admin-map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; border: 1px solid var(--line); background: #fff; overflow: hidden; border-radius: 6px; }
.admin-map-canvas { height: 520px; min-width: 0; z-index: 1; background: #e7eeec; direction: ltr; }
.is-preview .admin-map-canvas { height: 350px; }
.admin-map-loading { display: grid; place-items: center; height: 100%; font-size: 14px; color: var(--muted); }
.admin-map-detail { padding: 20px; overflow: auto; max-height: 520px; min-width: 0; }
.is-preview .admin-map-detail { max-height: 350px; }
.admin-map-order-list { display: grid; margin-top: 12px; }
.admin-map-order-list button { display: grid; grid-template-columns: 1fr auto; text-align: start; gap: 6px; border-bottom: 1px solid var(--line); background: #fff; padding: 14px 0; color: var(--ink); }
.admin-map-order-list bdi { font-size: 12px; grid-column: 1 / -1; }
.admin-map-order-list strong { font-size: 13px; overflow-wrap: anywhere; }
.admin-map-order-list small { color: var(--muted); font-size: 11px; }
.admin-pin { background: none; border: 0; }
.admin-pin span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: #5c7074; border: 2px solid #fff; box-shadow: 0 2px 5px #233b4038; color: transparent; }
.admin-pin span::after { content: attr(data-number); transform: rotate(45deg); color: #fff; font: 700 12px "Segoe UI", sans-serif; }
.admin-pin [data-driver="yahya"] { background: #426ba4; }
.admin-pin [data-driver="shuaib"] { background: #a6792c; }
.admin-no-location { margin-top: 14px; font-size: 13px; }
.admin-no-location[hidden] { display: none; }
.admin-no-location summary { color: var(--muted); cursor: pointer; padding: 10px 0; }
.admin-no-location > div { display: flex; flex-wrap: wrap; gap: 12px; }
.admin-no-location button { text-align: start; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 4px; min-width: 180px; color: var(--ink); }
.admin-no-location small { display: block; color: var(--muted); margin-top: 5px; }
.admin-detail-heading { display: flex; gap: 14px; justify-content: space-between; align-items: start; margin: 12px 0 20px; }
.admin-detail-heading bdi { font-size: 13px; color: var(--muted); }
.admin-detail-heading h3 { font-size: 20px; margin: 7px 0 0; overflow-wrap: anywhere; }
.admin-detail-fields { margin: 0; display: grid; gap: 14px; }
.admin-detail-fields dt { font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.admin-detail-fields dd { margin: 0; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.admin-detail-products { display: flex; flex-wrap: wrap; gap: 12px 18px; border-block: 1px solid var(--line); padding: 18px 0; margin: 20px 0; }
.admin-external-map { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13px; text-decoration: none; }
.admin-dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 48px); overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 24px; color: var(--ink); background: #fff; }
.admin-dialog::backdrop { background: #162d3870; }
.admin-dialog .admin-dialog-close { display: grid; margin-inline-start: auto; font-size: 26px; }
body[data-workspace="team"] .main .panel { border-radius: 6px; box-shadow: none; }
@media (max-width: 1180px) {
  body[data-workspace="team"] .app-shell { grid-template-columns: 190px minmax(0, 1fr); }
  body[data-workspace="team"] .main { padding: 22px; }
  .admin-sync { display: none; }
  .admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-overview-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .admin-location-summary { border-inline-start: 0; padding-inline-start: 0; border-top: 1px solid var(--line); padding-top: 22px; }
  .admin-location-head, .admin-location-row { grid-template-columns: minmax(120px, 1fr) 90px 90px; }
  .admin-order-table-head, .admin-order-row { grid-template-columns: minmax(110px, 1.4fr) minmax(110px, 1.5fr) 90px 90px; }
  .admin-order-table-head > :last-child, .admin-order-row > :last-child { display: none; }
  .admin-map-layout { grid-template-columns: minmax(0, 1fr) 235px; }
}
@media (max-width: 760px) {
  body[data-workspace="team"] .app-shell { display: block; }
  body[data-workspace="team"] .main { padding: 18px 16px calc(98px + env(safe-area-inset-bottom)); }
  body[data-workspace="team"] .admin-sidebar { position: static; height: auto; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 12px 16px; overflow: visible; gap: 0; border-inline: 0; border-bottom: 1px solid var(--line); }
  .admin-brand { padding: 0; border: 0; gap: 9px; }
  .admin-brand img { width: 36px; height: 36px; }
  .admin-brand strong { font-size: 20px; }
  .admin-brand small { font-size: 10px; }
  .admin-primary-nav { position: fixed; bottom: 0; inset-inline: 0; z-index: 1000; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; background: #fff; border-top: 1px solid var(--line); padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); }
  .admin-primary-nav button { display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 8px 2px; min-height: 58px; font-size: 11px; }
  .admin-more { border: 0; padding: 0; }
  .admin-more summary { font-size: 13px; }
  .admin-more[open] { width: 100%; margin-top: 12px; }
  .admin-more nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 8px 0; border-top: 1px solid var(--line); }
  .admin-team-links { display: none; }
  body[data-workspace="team"] .admin-topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; margin-bottom: 20px; padding-bottom: 18px; align-items: center; }
  .admin-topbar h2 { font-size: 22px; }
  .admin-dateline { font-size: 10px; }
  .admin-top-actions { gap: 7px; flex-wrap: nowrap; }
  .admin-top-actions .btn { padding: 10px; min-width: 44px; font-size: 12px; }
  .admin-top-actions .btn .driver-icon { display: none; }
  .admin-metrics { gap: 10px; margin-bottom: 24px; }
  .admin-metric { padding: 12px; }
  .admin-metric > span { font-size: 12px; }
  .admin-metric > div strong { font-size: 29px; }
  .admin-metric > div { min-height: 48px; gap: 6px; }
  .admin-metric small { font-size: 10px; }
  .admin-metric footer { font-size: 10px; gap: 3px 8px; min-height: 38px; }
  .admin-section-heading h3 { font-size: 16px; }
  .admin-order-table-head { display: none !important; }
  .admin-order-row, .admin-overview-grid .admin-order-row { grid-template-columns: minmax(0, 1fr) minmax(80px, auto); gap: 12px; padding: 16px 12px; }
  .admin-order-person { grid-column: 1; grid-row: 1; }
  .admin-order-products { grid-column: 1 / -1; grid-row: 2; padding-top: 10px; border-top: 1px solid #edf1f1; }
  .admin-owner { grid-column: 2; grid-row: 1; max-width: 100px; text-align: end; align-self: start; }
  .admin-order-row > :nth-child(4) { grid-column: 2; grid-row: 3; text-align: end; }
  .admin-order-row > :last-child { display: block; grid-column: 1; grid-row: 3; }
  .admin-overview-grid .admin-order-row > :last-child { display: none; }
  .admin-location-head, .admin-location-row { grid-template-columns: minmax(90px, 1fr) 65px 65px; }
  .admin-filters { gap: 8px; }
  .admin-filters input { flex-basis: 100%; }
  .admin-filters select { flex: 1 1 120px; font-size: 12px; }
  .admin-segments { flex: 1 1 100%; }
  .admin-segments button { flex: 1; }
  .admin-map-layout { grid-template-columns: minmax(0, 1fr); }
  .admin-map-canvas, .is-preview .admin-map-canvas { height: 350px; }
  .admin-map-detail, .is-preview .admin-map-detail { max-height: 300px; border-top: 1px solid var(--line); padding: 16px; }
  .admin-map-detail:empty { display: none; }
  .admin-map-order-list { max-height: 190px; overflow-y: auto; }
  .admin-map-legend { gap: 14px; font-size: 11px; }
  .admin-stock-table table { display: table !important; }
  .admin-stock-table thead { display: table-header-group !important; }
  .admin-stock-table tbody { display: table-row-group !important; }
  .admin-stock-table tr { display: table-row !important; }
  .admin-stock-table th, .admin-stock-table td { display: table-cell !important; width: auto !important; padding: 12px !important; }
  .admin-stock-table td::before { display: none !important; }
}
