/* Public provisioner navigation. Tokens and icon artwork stay local so setup.genial.io
   works without the Fleet shell or a third-party stylesheet. */
:root {
  --public-sidebar-width: 280px;
  --public-sidebar-rail: 72px;
  --wifi-sidebar-selected-bg: var(--suite-selected-bg, #E6F5F5);
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font: inherit;
}

.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.app-sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  display: flex;
  flex: 0 0 var(--public-sidebar-width);
  flex-direction: column;
  width: var(--public-sidebar-width);
  height: 100vh;
  height: 100svh;
  padding: 24px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--surface, #fff);
  border-right: 1px solid var(--border, #E4E9EA);
  transition: width .18s ease, flex-basis .18s ease, transform .18s ease;
  z-index: 25;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0 8px 16px;
  color: var(--text, #092331);
  text-decoration: none;
  white-space: nowrap;
}

.sidebar-brand__name {
  overflow: hidden;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 28px;
}

.sidebar-brand__subtitle {
  overflow: hidden;
  margin-top: 2px;
  color: var(--label, #5A6B73);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  text-overflow: ellipsis;
}

.sidebar-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.sidebar-toggle,
.sidebar-mobile-close,
.sidebar-menu-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  color: var(--text, #092331);
  background: var(--surface, #fff);
  border: 1px solid var(--control-border, #C2CACE);
  border-radius: 8px;
  cursor: pointer;
}

.sidebar-toggle {
  width: 32px;
  height: 32px;
}

.sidebar-mobile-close,
.sidebar-menu-open {
  display: none;
}

.sidebar-toggle-icon,
.sidebar-close-icon,
.sidebar-menu-icon,
.sidebar-icon {
  display: block;
  width: 18px;
  height: 18px;
  background-color: currentColor;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.sidebar-toggle-icon { -webkit-mask-image: url("icons/chevron-double-left.svg"); mask-image: url("icons/chevron-double-left.svg"); }
.app-sidebar[data-collapsed="true"] .sidebar-toggle-icon { -webkit-mask-image: url("icons/chevron-double-right.svg"); mask-image: url("icons/chevron-double-right.svg"); }
.sidebar-close-icon { -webkit-mask-image: url("icons/x.svg"); mask-image: url("icons/x.svg"); }
.sidebar-menu-icon { -webkit-mask-image: url("icons/list.svg"); mask-image: url("icons/list.svg"); }
.sidebar-icon--configure { -webkit-mask-image: url("icons/gear.svg"); mask-image: url("icons/gear.svg"); }
.sidebar-icon--help { -webkit-mask-image: url("icons/info-circle.svg"); mask-image: url("icons/info-circle.svg"); }

.sidebar-nav { min-width: 0; }

.sidebar-menu-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  min-width: 0;
  list-style: none;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  overflow: hidden;
  border-radius: 8px;
  color: var(--text, #092331);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  text-decoration: none;
  white-space: nowrap;
}

.sidebar-link:hover { background: var(--hover, #F5F8F8); }
.sidebar-link[aria-current="page"] {
  background: var(--wifi-sidebar-selected-bg);
  color: var(--teal, #09989B);
  font-weight: 500;
}

.sidebar-link:focus-visible,
.sidebar-toggle:focus-visible,
.sidebar-mobile-close:focus-visible,
.sidebar-menu-open:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring, 0 0 0 3px rgba(9, 152, 155, .18));
}

.sidebar-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-sidebar[data-collapsed="true"] {
  flex-basis: var(--public-sidebar-rail);
  width: var(--public-sidebar-rail);
  padding-right: 12px;
  padding-left: 12px;
}

.app-sidebar[data-collapsed="true"] .sidebar-brand,
.app-sidebar[data-collapsed="true"] .sidebar-label { display: none; }
.app-sidebar[data-collapsed="true"] .sidebar-actions { justify-content: center; }
.app-sidebar[data-collapsed="true"] .sidebar-link { justify-content: center; padding: 0; }

.app-workspace {
  flex: 1 1 auto;
  min-width: 0;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 8px 24px;
  color: var(--text, #092331);
  background: var(--surface, #fff);
  border-bottom: 1px solid var(--border, #E4E9EA);
}

.app-header__title {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--text, #092331);
  font: 600 18px/1.3 var(--ds-font, system-ui, sans-serif);
  text-overflow: ellipsis;
}

.app-header__right { justify-content: flex-end; }
/* The header is white now, so the chip's grey fill and its #C2CACE control
   border (~1.7:1 on white) no longer read as an edge. Outline uses the faint
   neutral (#64748B, 4.76:1 on white, >3:1 against the chip fill too) and the
   label the column-header ink (#334155, ~10:1 on white, ~8.7:1 on the fill). */
.app-header .status-pill--muted {
  border-color: var(--faint, #64748B);
  background: var(--divider, #EDF0F1);
  color: var(--suite-text-head, #334155);
}

.sidebar-scrim[hidden] { display: none !important; }

.app-footer { display: none; }

/* The Fleet host owns navigation and reserves its own shell chrome. */
html[data-app-context="fleet"] .app-sidebar,
html[data-app-context="fleet"] .sidebar-scrim,
html[data-app-context="fleet"] .sidebar-menu-open,
html[data-app-context="fleet"] .sidebar-mobile-close,
html[data-app-context="fleet"] .sidebar-toggle,
html[data-sidebar-owner="suite"] .app-sidebar,
html[data-sidebar-owner="suite"] .sidebar-scrim,
html[data-sidebar-owner="suite"] .sidebar-menu-open,
html[data-sidebar-owner="suite"] .sidebar-mobile-close,
html[data-sidebar-owner="suite"] .sidebar-toggle { display: none !important; }
html[data-app-context="fleet"] .app-layout { min-height: 0; }
html[data-app-context="fleet"] .app-header { position: relative; }

.guia-main {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

.guia-header { min-height: 64px; }
.guia-header__title { font-size: 18px; }

@media (max-width: 900px) {
  .app-sidebar {
    position: fixed;
    left: 0;
    width: min(var(--public-sidebar-width), calc(100vw - 56px));
    max-width: calc(100vw - 56px);
    height: 100vh;
    height: 100svh;
    transform: translateX(-105%);
    box-shadow: none;
    z-index: 31;
  }

  .app-sidebar[data-mobile-open="true"] { transform: translateX(0); }
  .app-sidebar[data-collapsed="true"] { width: min(var(--public-sidebar-width), calc(100vw - 56px)); }
  .app-sidebar[data-mobile-open="true"] .sidebar-brand,
  .app-sidebar[data-mobile-open="true"] .sidebar-label { display: flex; }
  .app-sidebar[data-mobile-open="true"] .sidebar-link { justify-content: flex-start; padding: 0 12px; }
  .app-sidebar[data-mobile-open="true"] .sidebar-actions { justify-content: flex-end; }
  .sidebar-toggle { display: none; }
  .sidebar-mobile-close {
    display: inline-flex;
    width: 44px;
    height: 44px;
  }

  .sidebar-link {
    min-height: 44px;
    height: 44px;
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    display: block;
    padding: 0;
    border: 0;
    background: rgba(9, 35, 49, .28);
    z-index: 30;
  }

  .sidebar-menu-open {
    display: inline-flex;
    grid-row: 1;
    grid-column: 1;
    width: 44px;
    height: 44px;
  }

  .app-header {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 8px 12px;
    padding: 8px 14px;
  }

  .app-header__title { grid-row: 1; grid-column: 2; }
  .app-header__right {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-content: space-between;
    gap: 8px;
  }

  .guia-header { grid-template-columns: 44px minmax(0, 1fr); }
  .guia-main { padding: 20px 14px 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .app-sidebar { transition: none; }
}
