/* Infinite Care platform: the top bar (48 px, sticky) and how a module's own header gives way under it.
   Tokens are the desks' palette under --ic-* names, so they never collide with a module's own tokens. */
:root {
  --ic-surface: #ffffff;
  --ic-surface-2: #f0f2f4;
  --ic-line: #e0e4e8;
  --ic-text: #16202a;
  --ic-muted: #56636f;
  --ic-brand: #0c6f79;
  --ic-brand-strong: #09565e;
  --ic-brand-soft: #e2f1f2;
  --ic-on-brand: #ffffff;
  --ic-warn: #8f5400;
  --ic-warn-soft: #fbefd9;
  --ic-shadow: 0 8px 24px rgba(16, 24, 40, .14), 0 1px 3px rgba(16, 24, 40, .08);
  --ic-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ic-surface: #161d21; --ic-surface-2: #1c252a; --ic-line: #273238; --ic-text: #e5ebee; --ic-muted: #9dabb4;
    --ic-brand: #3fb4be; --ic-brand-strong: #6cc9d1; --ic-brand-soft: #143238; --ic-on-brand: #06262a;
    --ic-warn: #f0b660; --ic-warn-soft: #36280f; --ic-shadow: 0 8px 24px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  --ic-surface: #161d21; --ic-surface-2: #1c252a; --ic-line: #273238; --ic-text: #e5ebee; --ic-muted: #9dabb4;
  --ic-brand: #3fb4be; --ic-brand-strong: #6cc9d1; --ic-brand-soft: #143238; --ic-on-brand: #06262a;
  --ic-warn: #f0b660; --ic-warn-soft: #36280f; --ic-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}

.ic-bar { position: sticky; top: 0; z-index: 40; height: 48px; background: var(--ic-surface); border-bottom: 1px solid var(--ic-line);
  color: var(--ic-text); font: 15px/1.2 var(--ic-font); -webkit-font-smoothing: antialiased; }
.ic-bar *, .ic-notice * { box-sizing: border-box; }
.ic-bar-inner { height: 47px; display: flex; align-items: center; gap: 12px; padding: 0 16px; max-width: 100%; }
.ic-logo { display: flex; flex: none; border-radius: 7px; }
.ic-logo img { display: block; height: 34px; width: auto; background: #fff; border-radius: 7px; padding: 1px 4px; }
.ic-i { width: 18px; height: 18px; flex: none; }
.ic-tabs { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; overflow: hidden; }
.ic-tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 9px; color: var(--ic-muted);
  text-decoration: none; font-weight: 600; white-space: nowrap; }
.ic-tab:hover { background: var(--ic-surface-2); color: var(--ic-text); }
.ic-tab.on { background: var(--ic-brand); color: var(--ic-on-brand); }
.ic-tab .ic-ext { width: 13px; height: 13px; opacity: .7; }
.ic-drop { position: relative; flex: none; }
.ic-mods { display: none; }
.ic-me { margin-left: auto; min-width: 0; }
.ic-btn { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 8px; padding: 5px 8px 5px 6px; border-radius: 10px;
  cursor: pointer; color: var(--ic-text); font: 600 .95rem/1.2 var(--ic-font); max-width: 100%; }
.ic-btn:hover, .ic-btn[aria-expanded="true"] { background: var(--ic-surface-2); }
.ic-btn:focus-visible, .ic-tab:focus-visible, .ic-item:focus-visible, .ic-logo:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--ic-brand) 55%, transparent); outline-offset: 2px; }
.ic-chev { width: 15px; height: 15px; color: var(--ic-muted); }
.ic-av { width: 30px; height: 30px; border-radius: 50%; background: var(--ic-brand-soft); color: var(--ic-brand-strong);
  display: inline-grid; place-items: center; font-weight: 700; font-size: .78rem; flex: none; }
.ic-name { max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ic-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 230px; max-width: calc(100vw - 32px);
  background: var(--ic-surface); border: 1px solid var(--ic-line); border-radius: 12px; box-shadow: var(--ic-shadow); padding: 6px; z-index: 50; }
.ic-menu.ic-right { left: auto; right: 0; }
.ic-who { padding: 8px 12px 10px; border-bottom: 1px solid var(--ic-line); margin-bottom: 4px; display: grid; gap: 2px; }
.ic-who span { color: var(--ic-muted); font-size: .85rem; }
.ic-item { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 8px;
  color: var(--ic-text); text-decoration: none; cursor: pointer; font: 500 .95rem/1.25 var(--ic-font); }
.ic-item:hover { background: var(--ic-surface-2); }
.ic-item.on { background: var(--ic-brand-soft); color: var(--ic-brand-strong); font-weight: 650; }
.ic-item .ic-i { color: var(--ic-muted); }
.ic-signout { border-top: 1px solid var(--ic-line); border-radius: 0 0 8px 8px; margin-top: 4px; padding-top: 11px; }
.ic-notice { position: sticky; top: 48px; z-index: 39; padding: 10px 16px; background: var(--ic-warn-soft); color: var(--ic-warn);
  font: 600 .93rem/1.4 var(--ic-font); border-bottom: 1px solid var(--ic-line); }
.ic-notice > div { max-width: 1120px; margin: 0 auto; }
.ic-notice button { all: unset; cursor: pointer; text-decoration: underline; margin: 0 8px; }
.ic-notice a { color: inherit; }

/* Below 640 px the tabs fold into one "Modules" button; the name folds into the initials. Never sideways scroll. */
@media (max-width: 639px) {
  .ic-tabs { display: none; }
  .ic-mods { display: block; }
  .ic-name { display: none; }
  .ic-bar-inner { gap: 8px; }
  .ic-logo img { height: 30px; }
}

/* ---------------------------------------------------------------- a module's header under the bar
   The module's own logo, divider and person link go (the bar has them). Its name stays as a small label and its
   page links become a second row, 44 px, sticky under the bar. Both desks use the same header markup. */
html.ic-platform .top { top: 48px; z-index: 30; }
html.ic-platform .top .top-inner,
html.ic-platform .top.stacked .top-inner { height: auto; min-height: 44px; padding: 4px 16px; gap: 2px 14px; flex-wrap: nowrap; }
html.ic-platform .top .org-logo,
html.ic-platform .top .brand-divider,
html.ic-platform #me-link { display: none !important; }
html.ic-platform .top .brand { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ic-muted); gap: 0; }
html.ic-platform .top .nav,
html.ic-platform .top.stacked .nav { order: 0; flex: 1 1 auto; flex-basis: auto; flex-wrap: wrap; overflow: visible; margin: 0; gap: 2px; min-width: 0; }
html.ic-platform .top .nav a,
html.ic-platform .top.stacked .nav a { padding: 6px 10px; font-size: .92rem; }
@media (max-width: 639px) {
  html.ic-platform .top .brand { display: none; }
  html.ic-platform .top .top-inner,
  html.ic-platform .top.stacked .top-inner { padding: 4px 10px; }
  html.ic-platform .top .nav a,
  html.ic-platform .top.stacked .nav a { padding: 6px 8px; font-size: .88rem; }
}
@media print {
  .ic-bar, .ic-notice { display: none !important; }
  html.ic-platform .top { top: 0; }
}
