/* Old-server chrome: navy sidebar, two-line menu, medical-data card, light content. */

body {
  font-size: 15px;
  background: #f4f6f8;
}

.sidebar nav button {
  transform: none;
  transition: background-color .18s, box-shadow .18s, color .18s;
}

.sidebar nav button:hover,
.sidebar nav button.active,
.sidebar nav button.atlas-v49-nav-selected {
  transform: none;
}

@media (min-width: 761px) {
  .sidebar,
  body.has-anesthesia-alarm .sidebar {
    background: #243447;
    color: #f4f7fb;
    width: var(--atlas-sidebar-width, 260px);
    height: 100dvh;
    max-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 12px 12px 14px;
    gap: 8px;
  }

  .brand { gap: 8px; padding: 0 2px; min-height: 42px; max-height: 42px; align-items: center; }
  .brand strong { color: #fff; font-size: 16px; font-weight: 750; }
  .brand span { display: block; color: #8fa0b8; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .account-switcher {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    padding: 8px;
    gap: 4px;
  }
  .account-identity small,
  .account-switcher > label,
  .account-switcher label {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    color: #8fa0b8;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .account-identity span { color: #fff; font-size: 14px; font-weight: 700; }
  .account-switcher select {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }
  .atlas-role-context {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    margin: 2px 0 0;
    color: #c5d0de;
    font-size: 12px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .atlas-role-context::before {
    content: "";
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #22c55e;
  }
  body.has-anesthesia-alarm .sidebar > .anesthesia-alarm-launch {
    position: static;
    top: auto;
    z-index: 1;
  }

  .sidebar nav,
  body.has-anesthesia-alarm .sidebar nav {
    flex: 0 0 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: visible;
  }
  .sidebar nav button {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    max-height: none;
    min-height: 0;
    align-items: stretch;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 12px;
    overflow: visible;
  }
  .sidebar nav button > span {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.2;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
  }
  .sidebar nav .nav-count { margin-left: auto; flex: 0 0 auto; }
  .sidebar nav small {
    display: block;
    width: 100%;
    color: #8fa0b8;
    margin-top: 1px;
    font-size: 12px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: visible;
  }

  .atlas-v49-view { left: var(--atlas-sidebar-width, 260px); }
  .sidebar-menu-toggle { display: none; }
  .sidebar > .sidebar-drawer { display: none; }
}

.sidebar nav button.active,
.sidebar nav button.atlas-v49-nav-selected {
  background: rgba(255, 255, 255, .08);
  box-shadow: inset 3px 0 0 #22d3ee;
}

.sidebar .privacy-note {
  display: block;
  flex: 0 0 auto;
  margin-top: 0;
  padding: 14px 12px 12px;
  color: #f4f7fb;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 16px;
}
.sidebar .privacy-note strong {
  display: block;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.sidebar .privacy-note p {
  margin: 8px 0 0;
  color: #9aa8bc;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: 0;
}
.sidebar .logout-button {
  display: block;
  width: 100%;
  min-height: 40px;
  margin-top: 12px;
  padding: 8px 10px;
  color: #eef2f8;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
}
.sidebar .logout-button:hover { background: rgba(255, 255, 255, .06); }
.sidebar .creator-credit,
.sidebar .creator-credit[data-atlas-credit] {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 0;
  margin: 10px 0 0;
  padding: 0;
  border: 0;
  color: rgba(255, 255, 255, .82);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .04em;
  line-height: 1.25;
  text-transform: uppercase;
}
.sidebar .creator-credit img {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  object-fit: contain;
  opacity: 1;
  background: #f4f7fb;
  border-radius: 9px;
}
.mobile-logout,
.sidebar-info,
.sidebar-foot { display: none; }

@media (max-width: 760px) {
  .sidebar {
    display: flex;
    flex-direction: column;
    height: auto;
    background: transparent;
    gap: 0;
    padding: 0;
    position: relative;
  }
  body.has-anesthesia-alarm .sidebar { padding-top: 56px; }
  .sidebar > .brand {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    max-height: none;
    margin: 0;
    padding: 6px 10px;
    background: #243447;
    color: #fff;
  }
  body.has-anesthesia-alarm .sidebar > .brand { top: 56px; }
  .sidebar > .brand strong { color: #fff; font-size: 16px; }
  .sidebar > .brand span:not(.brand-mark) { display: none; }
  .sidebar-menu-toggle {
    display: inline-flex;
    flex-direction: row;
    justify-content: center;
    gap: 4px;
    width: auto;
    min-width: 44px;
    height: 44px;
    margin-left: auto;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 10px;
    background: transparent;
    color: #fff;
  }
  .sidebar-menu-toggle span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: #fff;
  }
  .sidebar-drawer {
    position: fixed;
    z-index: 4700;
    top: var(--atlas-drawer-top, calc(56px + env(safe-area-inset-top, 0px)));
    left: 0;
    bottom: var(--atlas-drawer-bottom, 0px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(320px, 92vw);
    padding: 10px 10px max(10px, env(safe-area-inset-bottom, 0px));
    overflow: auto;
    background: #243447;
    transform: translateX(-110%);
    pointer-events: none;
  }
  body.has-anesthesia-alarm .sidebar-drawer { top: var(--atlas-drawer-top, calc(108px + env(safe-area-inset-top, 0px))); }
  body.sidebar-open .sidebar-drawer {
    transform: none;
    pointer-events: auto;
  }
  body.sidebar-open::before {
    content: "";
    position: fixed;
    z-index: 4600;
    inset: 0;
    background: rgba(8, 16, 28, .45);
  }
  .sidebar-drawer nav {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 2px;
    overflow: visible;
  }
  .sidebar-drawer nav button {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
  }
  .sidebar-drawer nav button > span {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
  }
  .sidebar-drawer nav small { display: block; color: #8fa0b8; font-size: 12px; }
  .sidebar-drawer .privacy-note { display: block; }
  .sidebar-drawer .account-switcher select {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
  body.has-anesthesia-alarm .anesthesia-alarm-launch {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 4800;
    display: flex;
    width: auto;
    height: 56px;
    min-height: 56px;
  }
}

.shell,
.atlas-v49-view { color: #1c2838; background: #f4f6f8; }
.shell .content { padding: 16px 20px 24px; }
.shell .page-head { margin-bottom: 12px; gap: 12px; }
.shell h1,
.atlas-v49-hero h1 {
  font-size: 26px;
  line-height: 1.15;
  margin-bottom: 4px;
}
.atlas-v49-view { padding: 14px 18px 18px; }
.atlas-v49-hero { margin-bottom: 10px; gap: 12px; }
.atlas-v49-subtitle { font-size: 14px; line-height: 1.35; }
.atlas-v49-body { gap: 10px; }

.shell :is(.panel, article, .card, .stat-card, .atlas-v49-card, .atlas-v49-subcard, .schedule-card, .statistics-fact, .kpi),
.atlas-v49-view :is(input, select, textarea),
.shell :is(input, select, textarea) {
  border-width: 1px;
  border-color: #e3e8ef;
}
.shell :is(button, select, input, textarea),
.atlas-v49-view :is(button, select, input, textarea) {
  min-height: 40px;
}
.sidebar :is(button, select, input) { min-height: 0; }
.sidebar .logout-button { min-height: 40px; }
.sidebar .account-switcher select { min-height: 0; }

.sidebar {
  display: flex;
  flex-direction: column;
}
.sidebar > .brand { order: 1; flex: 0 0 auto; }
.sidebar > .account-switcher { order: 2; flex: 0 0 auto; }
.sidebar > .anesthesia-alarm-launch { order: 3; flex: 0 0 auto; }
.sidebar > nav { order: 4; }
.sidebar > .privacy-note { order: 5; flex: 0 0 auto; }

.sidebar .brand-mark,
.sidebar .brand .brand-mark[data-atlas-logo] {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  max-width: 42px;
  max-height: 42px;
  flex: 0 0 42px;
  overflow: hidden;
}
.brand-mark,
.auth-brand .brand-mark,
.sidebar .brand .brand-mark[data-atlas-logo] {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 760;
  font-size: 22px;
  line-height: 1;
  background: linear-gradient(135deg, #00b4db 0%, #0083b0 100%);
  border-radius: 12px;
}
.brand-mark > img,
.auth-brand .brand-mark img,
.sidebar .brand-mark img,
.sidebar .brand-mark .atlas-fixed-image,
.brand .brand-mark[data-atlas-logo] > img {
  display: none !important;
}
.sidebar .account-identity > img,
.sidebar .account-identity > b {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  max-width: 36px;
  max-height: 36px;
  flex: 0 0 36px;
  object-fit: cover;
}
.sidebar .creator-credit img {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  max-width: 34px;
  max-height: 34px;
}

.sidebar .account-switcher,
.sidebar .account-identity,
.sidebar .brand {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.sidebar .account-identity > div { min-width: 0; flex: 1 1 0; }
.sidebar .account-identity small[data-atlas-employee-title] {
  display: block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.sidebar .account-identity small[data-atlas-employee-title][hidden] { display: none; }
.atlas-mobile-identity { display: none; }
@media (max-width: 760px) {
  .sidebar-drawer .atlas-mobile-identity {
    display: flex; flex-direction: column; gap: 4px;
    flex: 0 0 auto; min-width: 0; max-width: 100%;
    padding: 10px; border: 1px solid #718797; border-radius: 12px;
  }
  .atlas-mobile-identity strong { font-size: 15px; color: #fff; }
  .atlas-mobile-identity small { font-size: 13px; color: #b9c9db; }
  .atlas-mobile-identity :is(strong,small) { white-space: normal; overflow-wrap: anywhere; }
  .atlas-mobile-identity small[hidden] { display: none; }
  body.atlas-sidebar-light .atlas-mobile-identity strong { color: #243447; }
  body.atlas-sidebar-light .atlas-mobile-identity small { color: #486273; }
}
.sidebar .brand span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar .atlas-role-context {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
}
.sidebar .atlas-role-context-text {
  min-width: 0;
  flex: 1 1 0;
  overflow-wrap: anywhere;
}
.sidebar .atlas-mode-switch {
  position: static;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  min-width: 0;
  height: auto;
  margin: 4px 0 0;
  overflow: hidden;
  clip: auto;
}
.sidebar .atlas-mode-switch button {
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: auto;
  min-height: 36px;
  max-height: none;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.15;
  white-space: normal;
  overflow: hidden;
  text-align: left;
  transform: none;
}
.sidebar .atlas-mode-switch button span {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  white-space: normal;
  text-overflow: clip;
  line-height: 1.15;
}
.sidebar .atlas-mode-line {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}
.sidebar .atlas-mode-site {
  font-size: 12px;
  font-weight: 550;
  line-height: 1.2;
}
.sidebar .atlas-mode-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: block;
}
.sidebar .atlas-mode-personal { color: #d5e4f7; }
.sidebar .atlas-mode-work { color: #b7efe6; }
.sidebar .atlas-mode-personal.is-current {
  background: #f8efe9;
  color: #7a341f;
  border: 1px solid #ead8cf;
  box-shadow: none;
}
.sidebar .atlas-mode-work.is-current {
  background: #e7f4f1;
  color: #145239;
  border: 1px solid #b7d7c8;
  box-shadow: none;
}
.sidebar .anesthesia-alarm-launch,
.anesthesia-alarm-launch {
  min-height: 56px;
  border: 2px solid #e7b4ae;
  background: #fff7f6;
  color: #9a4e46;
  box-shadow: none;
}
.anesthesia-alarm-icon,
.anesthesia-alarm-launch strong { color: #9a4e46; }
.sidebar .account-switcher,
.sidebar .account-switcher.is-work,
.sidebar .account-switcher.is-personal {
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: none;
}
.atlas-tone-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 6px;
}
.atlas-tone-switch button {
  min-height: 32px;
  padding: 4px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: transparent;
  color: #d5deea;
  font: 600 13px/1.2 Inter, system-ui, sans-serif;
}
.atlas-tone-switch button.is-current {
  background: rgba(255, 255, 255, .14);
  color: #fff;
  border-color: rgba(255, 255, 255, .4);
}
.schedule-shell :is(.panel-tab, .schedule-step, .schedule-today, .schedule-hint, .schedule-room-move, .schedule-span-btn, .schedule-back-month, .schedule-load-key),
.schedule-shell .schedule-extra > summary {
  min-height: 44px;
}

.atlas-statistics .statistics-tab {
  min-height: 40px;
  border: 1px solid #e3e8ef;
  background: #fff;
  color: #1c2838;
}
.atlas-statistics .statistics-tab[aria-selected="true"],
.panel-tab[aria-selected="true"],
.schedule-span-btn[aria-pressed="true"],
.schedule-shell > .schedule-section-tabs .panel-tab[aria-selected="true"] {
  background: #eef6f3;
  border: 1px solid #b7d7c8;
  color: #145239;
}
.schedule-shell > .schedule-section-tabs .panel-tab,
.schedule-shell .schedule-span-btn,
.schedule-shell .schedule-step,
.schedule-shell .schedule-today,
.schedule-shell .schedule-room-move,
.schedule-shell .schedule-back-month,
.schedule-shell .schedule-load-key,
.schedule-shell:has(.schedule-load-month) .schedule-load-key {
  min-height: 44px;
  height: auto;
}
.schedule-load-legend,
.schedule-board:has(.schedule-load-month) > .schedule-load-legend { max-height: none; }
.ps-card.ps-emergency,
.ps-notice,
.ps-emergency {
  border-width: 1px;
}
.ps-arrival {
  background: #eef6f3;
  border: 1px solid #b7d7c8;
  color: #145239;
}

@media (min-width: 1100px) {
  .stat-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    align-items: start;
  }
  .stat-board > .stat-demo,
  .stat-board > .stat-board-note,
  .stat-board > .stat-filters { grid-column: 1 / -1; }
  .stat-card { padding: 8px 10px; gap: 4px; }
  .stat-card-head { align-items: center; }
  .stat-card-tools { flex-wrap: nowrap; gap: 4px; }
  .stat-board .stat-action { min-height: 32px; padding: 2px 8px; font-size: 13px; }
  .stat-card-note {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    font-size: 13px;
    line-height: 1.3;
  }
  .stat-totals { flex-wrap: nowrap; }
  .stat-total { min-width: 0; flex: 1 1 0; padding: 4px 6px; }
  .stat-total b { font-size: 18px; }
  .stat-total span { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .stat-chart-frame { height: 72px; }
  .stat-legend-item,
  .stat-yaxis,
  .stat-col-label,
  .stat-col-value { font-size: 12px; }
}

@media (min-width: 761px) and (max-height: 940px) {
  .shell .content { padding: 12px 16px 16px; }
  .atlas-v49-view { padding: 10px 14px 12px; }
  .atlas-v49-hero { margin-bottom: 6px; }
  .atlas-v49-hero h1 { font-size: 24px; }
  .atlas-v49-body { gap: 8px; }
  .shell .overview-grid,
  .shell .personal-page { gap: 10px; }
}

body.atlas-v49-active .sidebar nav button.active:not(.atlas-v49-nav-selected) {
  background: transparent;
  box-shadow: none;
  transform: none;
}

body.atlas-sidebar-light .sidebar,
body.atlas-sidebar-light.has-anesthesia-alarm .sidebar,
body.atlas-sidebar-light .sidebar-drawer {
  background: #f7f8fa;
  color: #1e293b;
}
body.atlas-sidebar-light .sidebar > .brand,
body.atlas-sidebar-light .sidebar > .brand strong,
body.atlas-sidebar-light .brand strong,
body.atlas-sidebar-light .account-identity span,
body.atlas-sidebar-light .sidebar .privacy-note,
body.atlas-sidebar-light .sidebar .privacy-note strong {
  color: #1e293b;
}
body.atlas-sidebar-light .brand span,
body.atlas-sidebar-light .sidebar nav small,
body.atlas-sidebar-light .sidebar-drawer nav small,
body.atlas-sidebar-light .atlas-role-context,
body.atlas-sidebar-light .sidebar .privacy-note p,
body.atlas-sidebar-light .account-switcher label,
body.atlas-sidebar-light .account-identity small {
  color: #64748b;
}
body.atlas-sidebar-light .sidebar .account-switcher,
body.atlas-sidebar-light .sidebar .account-switcher.is-work,
body.atlas-sidebar-light .sidebar .account-switcher.is-personal,
body.atlas-sidebar-light .sidebar .privacy-note {
  background: #fff;
  border: 1px solid #e3e8ef;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
body.atlas-sidebar-light .sidebar nav button {
  color: #1e293b;
}
body.atlas-sidebar-light .sidebar nav button.active,
body.atlas-sidebar-light .sidebar nav button.atlas-v49-nav-selected {
  background: #e8eef6;
  box-shadow: inset 3px 0 0 #94a3b8;
  color: #1e293b;
}
body.atlas-sidebar-light .sidebar .logout-button {
  color: #334155;
  border-color: #e3e8ef;
  background: #fff;
}
body.atlas-sidebar-light .sidebar .creator-credit,
body.atlas-sidebar-light .sidebar .creator-credit[data-atlas-credit] {
  color: #64748b;
}
body.atlas-sidebar-light .atlas-mode-switch button {
  color: #334155;
  border-color: #e3e8ef;
  background: #fff;
}
body.atlas-sidebar-light .sidebar .atlas-mode-personal.is-current {
  background: #f8efe9;
  color: #7a341f;
  border: 1px solid #ead8cf;
  box-shadow: none;
}
body.atlas-sidebar-light .sidebar .atlas-mode-work.is-current {
  background: #e7f4f1;
  color: #145239;
  border: 1px solid #b7d7c8;
  box-shadow: none;
}
body.atlas-sidebar-light .sidebar-menu-toggle {
  border-color: #e3e8ef;
  color: #1e293b;
}
body.atlas-sidebar-light .sidebar-menu-toggle span { background: #1e293b; }
body.atlas-sidebar-light .atlas-tone-switch button {
  color: #334155;
  border-color: #e3e8ef;
  background: #fff;
}
body.atlas-sidebar-light .atlas-tone-switch button.is-current {
  background: #e8eef6;
  color: #1e293b;
  border-color: #cbd5e1;
}

.sidebar nav button:focus {
  outline: none;
}
.sidebar nav button:focus-visible,
.section-switch button:focus-visible,
[role="tab"]:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}
@media (hover: hover) and (pointer: fine) {
  .sidebar nav button:hover:not(.active):not(.atlas-v49-nav-selected) {
    background: rgba(255, 255, 255, .08);
  }
}
@media (hover: none), (pointer: coarse) {
  .sidebar nav button:hover:not(.active):not(.atlas-v49-nav-selected),
  .section-switch button:hover:not(.selected):not(.active),
  [role="tab"]:hover:not([aria-selected="true"]):not(.active),
  .atlas-mode-switch button:hover:not(.is-current) {
    background: transparent;
    transform: none;
    filter: none;
  }
}
body.atlas-scope-personal .account-identity small,
body.atlas-scope-personal [data-private-profile-open] {
  display: none;
}
