/* Shared workspace presentation; storefront and printed documents stay unchanged. */
@media screen {
  :is(.admin-body, .reception-body, .courier-body, .customer-page) {
    --portal-bg: #f4f6f5;
    --portal-border: #dce2df;
    --portal-green: #265f4d;
    color: #242927;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background: var(--portal-bg);
  }
  :is(.admin-body, .reception-body, .courier-body, .customer-page) :is(h1,h2,h3,button,label,summary) { letter-spacing: 0; }
  :is(.admin-body, .reception-body, .courier-body, .customer-page) :is(h1,h2,h3,p,small,strong,label,dd) { overflow-wrap: anywhere; }
  :is(.admin-body, .reception-body, .courier-body, .customer-page) h1 { font-size: 28px; line-height: 1.2; }
  :is(.admin-body, .reception-body, .courier-body, .customer-page) h2 { font-size: 22px; line-height: 1.3; }
  :is(.admin-body, .reception-body, .courier-body, .customer-page) h3 { font-size: 18px; line-height: 1.35; }
  :is(.admin-body, .reception-body, .courier-body, .customer-page) :is(button,.button) {
    min-height: 44px;
    min-width: 0;
    max-width: 100%;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 650;
    white-space: normal;
    overflow-wrap: anywhere;
    border-radius: 6px;
  }
  :is(.admin-body, .reception-body, .courier-body, .customer-page) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea) {
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    font: inherit;
    font-size: 16px;
    border-color: var(--portal-border);
    border-radius: 6px;
  }
  :is(.admin-body, .reception-body, .courier-body, .customer-page) :is(button,a,input,select,textarea,summary):focus-visible {
    outline: 2px solid var(--portal-green);
    outline-offset: 3px;
  }
  :is(.admin-sidebar,.customer-sidebar,.reception-sidebar) { background: #fff; border-color: var(--portal-border); }
  :is(.admin-side-nav a,.customer-side-nav button,.reception-sidebar a,.courier-nav button) {
    min-height: 44px;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
  }
  :is(.admin-side-nav a.active,.customer-side-nav button.active,.reception-sidebar a.active,.courier-nav button.active) {
    background: #e8f1ed;
    color: #265f4d;
    border-left: 4px solid #265f4d;
  }
  .admin-section { border: 0; border-radius: 0; box-shadow: none; }
  .admin-row, .store-order-card { background: #fff; border-color: var(--portal-border); }
  :is(.admin-section-head,.customer-page-header,.page-heading) { flex-wrap: wrap; align-items: center; gap: 16px; }
  :is(.admin-row-actions,.store-order-actions,.customer-order-actions,.courier-order-actions,.customer-auth-actions) {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    min-width: 0;
  }
  :is(.admin-row-actions,.store-order-actions,.customer-order-actions,.courier-order-actions,.customer-auth-actions) > :is(button,a.button,select,label) {
    flex: 1 1 160px;
    margin: 0;
    min-width: 0;
  }
  .order-admin-row .admin-row-actions { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(140px,100%),1fr)); align-items: stretch; }
  .order-admin-row .admin-row-actions > :is(button,select) { width: 100%; }
  .order-admin-row .admin-row-actions > :is(strong,small,.courier-order-actions,.order-primary-actions) { grid-column: 1/-1; }
  .order-admin-row .courier-order-actions { display: flex; }
  .order-primary-actions { align-items: center; }
  .order-primary-actions > button { min-height: 44px; align-self: center; }
  .order-admin-row .accept-order-control { width: min(100%,430px); }
  .store-order-actions > label { align-self: flex-end; }
  .order-view-switch { max-width: 540px; }
  .order-view-switch button { border-radius: 0; padding: 10px 8px; }

  /* Customer workspace uses the same sidebar/content proportions as admin. */
  .customer-page { padding: 24px 24px 32px; }
  .customer-page-active .site-footer { display: none; }
  .customer-shell { width: 100%; max-width: 1600px; gap: 0; }
  .customer-page-header { padding: 20px 24px; border: 0; border-bottom: 1px solid var(--portal-border); border-radius: 0; box-shadow: none; }
  .customer-page-header h2 { font-size: 28px; }
  .customer-layout { border: 0; border-radius: 0; box-shadow: none; background: transparent; overflow: visible; }
  .customer-sidebar { padding: 24px 16px; min-width: 0; }
  .customer-side-nav button { width: calc(100% - 18px); }
  .customer-content { padding: 24px; }
  .customer-account-head { padding: 0 0 16px; background: transparent; border: 0; border-bottom: 1px solid var(--portal-border); border-radius: 0; }
  .customer-panel, .customer-profile { min-width: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
  .customer-profile > button { justify-self: start; width: auto; padding: 12px 20px; }
  .customer-auth-card { margin-top: 24px; padding: 24px; box-shadow: none; }

  /* Reception keeps its restricted navigation and existing actions. */
  .reception-body > header { min-height: 76px; padding: 12px 24px; }
  .reception-body > header h1 { font-size: 20px; }
  .reception-body > main { max-width: none; padding: 24px; }
  .reception-body #login { width: min(440px,100%); max-width: none; padding: 24px; margin: 24px auto; background: #fff; border: 1px solid var(--portal-border); border-radius: 8px; }
  .reception-body #login button { width: 100%; background: #265f4d; color: #fff; }
  .reception-body #workspace { display: grid; grid-template-columns: 256px minmax(0,1fr); gap: 24px; }
  .reception-sidebar { padding: 20px 16px; border-right: 1px solid var(--portal-border); }
  .reception-sidebar nav { display: grid; gap: 8px; }
  .reception-sidebar a { color: #242927; text-decoration: none; }
  .reception-content { min-width: 0; }
  .reception-body .filters { align-items: flex-end; }
  .reception-body .filters > label { flex: 1 1 200px; min-width: 0; }
  .reception-body #orders { border: 1px solid var(--portal-border); border-radius: 8px; }
  .reception-body #orders h2 { font-size: 18px; }

  /* Courier navigation becomes a sidebar on larger screens. */
  .courier-header { background: #fff; }
  .courier-main { width: 100%; min-width: 0; }
  .courier-panel { border: 0; border-radius: 0; box-shadow: none; padding: 20px 0; background: transparent; }
  .courier-order { box-shadow: none; border-color: var(--portal-border); }
  .courier-order-actions .wide { flex-basis: 100%; }
  .courier-order-actions a { display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }
  .courier-shift { grid-template-columns: minmax(0,1fr) auto; }
  .availability-day { background: #fff; }
  .courier-login-card { box-shadow: none; }
  .courier-body .password-field button { min-height: 40px; }
  @media (min-width: 1000px) {
    .courier-app { display: grid; grid-template-columns: 280px minmax(0,1fr); align-items: start; }
    .courier-header { grid-column: 1/-1; grid-row: 1; }
    .courier-main { grid-column: 2; grid-row: 2; padding: 32px; }
    .courier-nav { position: sticky; grid-column: 1; grid-row: 2; top: 76px; left: auto; right: auto; bottom: auto; width: auto; transform: none; display: grid; grid-template-columns: minmax(0,1fr); align-content: start; min-height: calc(100dvh - 76px); padding: 24px 16px; border: 0; border-right: 1px solid var(--portal-border); border-radius: 0; background: #fff; }
  }
  @media (max-width: 999px) {
    .customer-layout { grid-template-columns: minmax(0,1fr); }
    .customer-sidebar { min-height: 0; border-right: 0; border-bottom: 1px solid var(--portal-border); }
    .customer-side-nav { display: none; }
    .customer-mobile-nav { display: grid; gap: 8px; }
    .reception-body #workspace { grid-template-columns: minmax(0,1fr); }
    .reception-sidebar { border-right: 0; padding: 12px; }
    .reception-sidebar nav { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .courier-nav { left: 0; width: 100%; transform: none; border-radius: 0; }
    .courier-nav button { padding: 8px 4px; text-align: center; font-size: 13px; }
  }
  @media (max-width: 600px) {
    .admin-shell,.customer-content,.reception-body > main { padding: 16px; }
    .customer-page { padding: 90px 0 24px; }
    .customer-page-header { padding: 16px; }
    .customer-page-header h2 { font-size: 24px; }
    .admin-section { padding: 16px 0; }
    .courier-main { padding: 20px 16px calc(100px + env(safe-area-inset-bottom)); }
    .courier-shift { grid-template-columns: minmax(0,1fr); }
    .order-admin-row .accept-order-control { grid-template-columns: minmax(0,1fr); }
    :is(.admin-row-actions,.store-order-actions,.customer-order-actions,.courier-order-actions) > :is(button,a.button,select,label) { flex-basis: 140px; }
    .customer-profile > button { width: 100%; }
  }
}
