:root {
  --sidebar-w: 260px;
  --shell-header-h: 4.5rem;
  --shell-content-offset: 12rem;
  --shell-content-max-w: 1200px;
}

body.has-shell {
  overflow-x: hidden;
}

/*
 * Shell mount öncesi FOUC: token varsa body gizlenir (padding-left hack yok —
 * o canlıdan farklı “küçülüp büyüme” yaratıyordu).
 */
html.pool-shell-pending body {
  visibility: hidden;
}

html.pool-shell-ready body {
  visibility: visible;
}

.pool-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.pool-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  height: 100vh;
  padding: 1.25rem 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--line);
  box-shadow: 4px 0 24px rgba(26, 43, 76, 0.04);
}

.pool-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 0.5rem 1.1rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.pool-sidebar__brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.pool-sidebar__brand-text {
  min-width: 0;
}

.pool-sidebar__brand-text strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.pool-sidebar__brand-text span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.pool-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.pool-nav__group {
  margin-bottom: 1rem;
}

.pool-nav__label {
  display: block;
  padding: 0.35rem 0.65rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.pool-nav__item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.62rem 0.75rem;
  margin: 0.15rem 0;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pool-nav__item:hover {
  background: rgba(26, 43, 76, 0.04);
  color: var(--navy);
}

.pool-nav__item--active {
  background: var(--accent-soft);
  border-color: rgba(201, 162, 39, 0.22);
  color: var(--navy);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}

.pool-nav__item--disabled {
  opacity: 0.48;
  cursor: not-allowed;
  color: var(--muted);
  pointer-events: none;
  user-select: none;
}

.pool-nav__item--disabled:hover {
  background: transparent;
  color: var(--muted);
}

.pool-nav__text {
  flex: 1;
  min-width: 0;
}

.pool-nav__badge {
  flex-shrink: 0;
  margin-left: auto;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(26, 43, 76, 0.06);
  border: 1px solid rgba(26, 43, 76, 0.08);
}

.pool-nav__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  opacity: 0.85;
}

.pool-nav__icon svg {
  width: 1.1rem;
  height: 1.1rem;
}

.pool-sidebar__footer {
  padding-top: 0.85rem;
  margin-top: auto;
  border-top: 1px solid var(--line);
}

.pool-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.45rem;
  margin-bottom: 0.5rem;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  transition: background 0.15s;
}

.pool-user:hover {
  background: rgba(201, 162, 39, 0.1);
}

.pool-user__avatar-wrap {
  flex-shrink: 0;
  display: inline-flex;
}

.pool-user__avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy);
  background: var(--accent-soft);
  border: 1px solid rgba(201, 162, 39, 0.25);
  flex-shrink: 0;
}

.pool-user__avatar--photo {
  display: block;
  object-fit: cover;
}

.pool-user__meta {
  min-width: 0;
  flex: 1;
}

.pool-user__name {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pool-user__role {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: capitalize;
}

.pool-sidebar__logout {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--navy);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pool-sidebar__logout:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(26, 43, 76, 0.18);
}

.pool-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  padding: 1.5rem 1.5rem 0;
}

/*
 * Canlı ile aynı: ana kolon full-width.
 * (Eski 560/1200 cap’ler profil ve kartları küçültüyordu.)
 */
.pool-main > .app {
  flex: 1;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 0 1.5rem;
}

body.has-shell .pool-main > .app {
  max-width: none;
  margin: 0;
  padding: 0 0 1.5rem;
}

.pool-site-footer {
  flex-shrink: 0;
  margin-top: auto;
  margin-left: -1.5rem;
  margin-right: -1.5rem;
  padding: 0.75rem 1.35rem 0.85rem;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.pool-site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 2.75rem;
}

.pool-site-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.pool-site-footer__logo {
  width: 1.65rem;
  height: 1.65rem;
  object-fit: contain;
  flex-shrink: 0;
}

.pool-site-footer__brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.2;
}

.pool-site-footer__title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.pool-site-footer__tagline {
  font-size: 0.72rem;
  color: var(--muted);
}

.pool-site-footer__center {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem 0.55rem;
  flex: 1;
  min-width: 0;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.35;
}

.pool-site-footer__copy {
  font-weight: 500;
  color: var(--ink);
}

.pool-site-footer__sep {
  opacity: 0.4;
  user-select: none;
}

.pool-site-footer__credit {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
}

.pool-site-footer__credit:hover {
  color: #0a66c2;
  background: rgba(10, 102, 194, 0.08);
}

.pool-site-footer__icon {
  flex-shrink: 0;
  display: block;
  width: 1rem;
  height: 1rem;
}

.pool-site-footer__version {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
}

/* Canlı ile aynı: sayfa max-width’lerini shell altında kaldır */
body.has-shell .admin-app,
body.has-shell .history-app,
body.has-shell .stats-app,
body.has-shell .iccid-app,
body.has-shell .smoke-app,
body.has-shell .fwa-app,
body.has-shell .pool-app,
body.has-shell .profile-app {
  max-width: none;
  margin: 0;
  padding: 0 0 1.5rem;
}

.pool-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.pool-page-header__text h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.pool-page-header__text p {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 36rem;
}

.pool-page-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.pool-shell-toggle {
  display: none;
  position: fixed;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 120;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: var(--glass-blur);
  color: var(--navy);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.pool-shell-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

.pool-shell-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(12, 20, 38, 0.35);
  backdrop-filter: blur(2px);
}

@media (max-width: 900px) {
  .pool-layout {
    grid-template-columns: 1fr;
  }

  .pool-shell-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .pool-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 8px 0 32px rgba(26, 43, 76, 0.12);
  }

  body.shell-nav-open .pool-sidebar {
    transform: translateX(0);
  }

  body.shell-nav-open .pool-shell-backdrop {
    display: block;
  }

  .pool-main {
    padding: 3.75rem 1rem 0;
  }

  .pool-site-footer {
    margin-left: -1rem;
    margin-right: -1rem;
  }

  .pool-page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .pool-page-header__actions {
    justify-content: flex-end;
  }
}

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