.app {
  display: flex;
  min-height: 100vh;
  padding: 20px;
  gap: 16px;
}

.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: var(--bg-1);
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: fixed;
  height: 100vh;
  overflow: visible !important;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  padding: 0 24px 32px;
  letter-spacing: 2px;
}

.nav-label {
  font-size: 10px;
  letter-spacing: 1.6px;
  color: var(--text-low);
  font-weight: 600;
  padding: 0 24px 16px;
  text-transform: uppercase;
  margin: 14px 8px 8px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 16px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-mid);
  transition:
    background 0.15s,
    color 0.15s;
  border-left: 3px solid transparent;
  font-weight: 600;
  font-size: 13px;
  user-select: none;
}

.nav-icon {
  width: 18px;
  height: 18px;
  min-width: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.65;
  transition: opacity 0.2s;
  color: var(--text-mid);
}

.nav-text {
  font-size: 13px;
  letter-spacing: 0.3px;
}

.nav-item svg {
  width: 16px;
  height: 16px;
  opacity: 0.85;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--bg-2);
  color: var(--text-hi);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-left-color: var(--accent);
}

.nav-item.active .nav-icon {
  transform: scale(1.05);
  opacity: 1;
  color: var(--accent);
}

.nav-item.active svg {
  opacity: 1;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin-left: 250px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 30px;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.header h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.user-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 16px;
}

.user-avatar {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px;
  min-height: 36px;
  max-width: 36px;
  max-height: 36px;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #8f2140, #4a0e1a) !important;
  color: #fff !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
  border: none !important;
  outline: none !important;
  box-shadow: none;
  flex-shrink: 0;
  overflow: hidden;
  padding: 0 !important;
  line-height: 1;
}

.user-avatar:hover {
  transform: scale(1.1);
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.user-avatar:active {
  transform: scale(0.95);
}

.user-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: transparent !important;
  border: none !important;
  border-radius: 50%;
  overflow: visible;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 200px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
  margin-top: 8px;
  overflow: hidden;
}

.user-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  color: var(--text-mid);
  font-weight: 600;
  font-size: 13px;
  transition: all 0.15s;
}

.dropdown-item:hover {
  background: var(--bg-3);
  color: var(--text-hi);
}

.dropdown-item#logout:hover {
  background: var(--red-bg);
  color: var(--red);
}

.dropdown-divider {
  height: 1px;
  background: var(--line);
  margin: 0;
}

.mobile-search-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text-mid);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}

.mobile-search-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.mobile-search-toggle svg {
  width: 17px;
  height: 17px;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
}

.theme-icon-light {
  display: none;
}

.sidebar-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text-mid);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}

.sidebar-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.sidebar-toggle svg {
  width: 18px;
  height: 18px;
}

.sidebar-backdrop {
  display: none;
}

.global-search {
  position: relative;
  flex: 0 1 320px;
  max-width: 360px;
  margin: 0 0 0 auto;
}

.global-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-low);
  pointer-events: none;
}

.global-search input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text-hi);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 14px 9px 36px;
  transition: all 0.15s;
}

.global-search input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-3);
}

.global-search input::placeholder {
  color: var(--text-low);
  font-weight: 500;
}

.global-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.15s ease;
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
}

.global-search-results.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.section,
.stat-card,
.player-card,
.session-item,
.dropdown-menu,
.week-cal-day,
.kiviat-card,
.eval-item,
.indiv-stat-row,
.attendance-card,
.stat-detail-card,
.leaderboard,
.user-dropdown,
.eval-average,
.reminder-banner,
.search-result:hover {
  border-radius: 16px;
}

.stat-card,
.player-card,
.session-item,
.dropdown-menu,
.week-cal-day,
.kiviat-card,
.eval-item,
.indiv-stat-row,
.attendance-card,
.stat-detail-card,
.leaderboard,
.user-dropdown,
.eval-average,
.reminder-banner {
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.roster-list,
.dropdown-menu,
.global-search-results,
.main,
.sidebar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.roster-list::-webkit-scrollbar,
.dropdown-menu::-webkit-scrollbar,
.global-search-results::-webkit-scrollbar,
.main::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
  display: none;
}

.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
}

.sidebar .user-dropdown {
  top: auto;
  bottom: 0;
  left: calc(100% + 12px);
  right: auto;
}

.mobile-avatar {
  display: none;
}

.mobile-notif {
  display: none;
}

.sidebar .theme-toggle {
  background: transparent;
  border: none;
  width: 34px;
  height: 34px;
}

.sidebar .theme-toggle:hover {
  color: var(--accent);
  border-color: transparent;
}

.notif-wrapper {
  position: relative;
}

.notif-toggle {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: color 0.15s;
}

.notif-toggle:hover {
  color: var(--accent);
}

.notif-toggle svg {
  width: 17px;
  height: 17px;
}

.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  border: 1.5px solid var(--bg-1);
}

.notif-dot.hidden {
  display: none;
}

.notif-dropdown {
  position: absolute;
  bottom: 0;
  left: calc(100% + 12px);
  width: 300px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all 0.18s ease;
  z-index: 300;
  overflow: hidden;
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}

.notif-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.notif-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
}

.notif-header {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-low);
}

.notif-markall {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  padding: 0;
}

.notif-markall:hover {
  text-decoration: underline;
}

.notif-list {
  display: flex;
  flex-direction: column;
  max-height: 320px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--line-soft);
  transition: opacity 0.2s;
}

.notif-item.read {
  opacity: 0.55;
}

.notif-item-body {
  flex: 1;
  min-width: 0;
}

.notif-unread-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  margin-left: 6px;
  vertical-align: middle;
}

.notif-mark-read {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0 0;
}

.notif-mark-read:hover {
  text-decoration: underline;
}

.notif-item-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.notif-item-icon.warn { background: rgba(245, 158, 11, 0.15); }

.notif-item-icon.info { background: var(--accent-soft); }

.notif-item-icon.success { background: var(--green-bg); }

.notif-item-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-hi);
  margin-bottom: 2px;
}

.notif-item-time {
  font-size: 10.5px;
  color: var(--text-low);
  font-weight: 600;
}

.notif-item-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.notif-item-link:hover {
  text-decoration: underline;
}

.notif-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-low);
}

.sidebar .nav {
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar .nav::-webkit-scrollbar {
  display: none;
}

@media print {
  .sidebar, .header .global-search, .header .user-section, .no-print,
    .stat-selector, .nav, .dropdown, .eval-actions {
      display: none !important;
    }

  .main {
      margin-left: 0 !important;
    }

  .app, .content {
      display: block !important;
    }
}

@media (max-width: 900px) {
  .global-search {
      display: none;
    }

  .sidebar-toggle {
      display: flex;
    }

  .sidebar {
      position: fixed;
      top: 0;
      left: 0;
      height: 100vh;
      width: 260px;
      z-index: 500;
      transform: translateX(-100%);
      transition: transform 0.25s ease;
      box-shadow: 12px 0 32px rgba(0, 0, 0, 0.5);
    }

  .sidebar.open {
      transform: translateX(0);
    }

  .sidebar-backdrop {
      display: block;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.55);
      z-index: 400;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.25s ease;
    }

  .sidebar-backdrop.open {
      opacity: 1;
      visibility: visible;
    }

  .main {
      margin-left: 0;
    }

  .theme-toggle {
      display: none !important;
    }

  .notif-dropdown {
      left: 0;
      bottom: auto;
      top: 100%;
      margin-top: 12px;
    }
}

@media (max-width: 600px) {
  .sidebar-toggle {
      display: none;
    }

  .sidebar-backdrop {
      display: none !important;
    }

  .theme-toggle {
      display: none;
    }

  .mobile-search-toggle {
      display: flex;
    }

  .global-search.mobile-open {
      display: flex !important;
      position: fixed;
      top: 12px;
      left: 10px;
      right: 10px;
      max-width: none;
      margin: 0;
      z-index: 600;
      background: var(--bg-2);
      box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    }

  .sidebar,
    .sidebar.open {
      top: auto;
      bottom: calc(10px + env(safe-area-inset-bottom));
      left: 10px;
      right: 10px;
      width: auto;
      height: auto;
      flex-direction: row;
      align-items: center;
      justify-content: space-around;
      padding: 6px 4px;
      border-radius: 20px;
      border: 1px solid rgba(255, 255, 255, 0.08);
      background: rgba(20, 25, 36, 0.28);
      backdrop-filter: blur(20px) saturate(160%);
      -webkit-backdrop-filter: blur(20px) saturate(160%);
      box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
      transform: none;
      z-index: 500;
    }

  .sidebar .logo,
    .sidebar .nav-label,
    .sidebar .structure-switch {
      display: none;
    }

  .sidebar .nav {
      flex-direction: row;
      justify-content: space-around;
      align-items: center;
      width: 100%;
      gap: 0;
    }

  .sidebar .nav-item {
      flex-direction: column;
      gap: 1px;
      padding: 3px 2px;
      border-radius: 8px;
      flex: 1;
      text-align: center;
      background: transparent !important;
      border: none !important;
      border-left: none !important;
      box-shadow: none !important;
    }

  .sidebar .nav-item.active {
      background: transparent !important;
      border: none !important;
      box-shadow: none !important;
    }

  .sidebar .nav-icon {
      width: 17px;
      height: 17px;
      opacity: 0.6;
    }

  .sidebar .nav-item.active .nav-icon {
      opacity: 1;
    }

  .sidebar .nav-text {
      font-size: 8px;
      font-weight: 600;
      letter-spacing: 0.1px;
      color: var(--text-low);
    }

  .sidebar .nav-item.active .nav-text {
      color: var(--accent);
      font-weight: 700;
    }

  .main {
      padding-bottom: 80px;
    }

  .header {
      padding: 16px 18px;
    }

  .header h1 {
      font-size: 16px;
    }

  .app {
      padding: 10px;
    }

  .sidebar {
      flex-direction: row;
    }

  .sidebar .nav {
      flex: 1;
      width: auto;
    }

  .sidebar-bottom {
      margin-top: 0;
      padding-top: 0;
      flex-direction: row;
      margin-left: auto;
      padding-right: 6px;
    }

  .sidebar .user-dropdown {
      top: auto;
      bottom: calc(100% + 12px);
      left: auto;
      right: 0;
    }

  .sidebar .user-avatar {
      width: 30px;
      height: 30px;
      font-size: 12px;
    }

  .desktop-avatar {
      display: none;
    }

  .mobile-avatar {
      display: block;
    }

  .mobile-avatar .user-avatar {
      width: 34px;
      height: 34px;
      min-width: 34px;
      min-height: 34px;
      max-width: 34px;
      max-height: 34px;
      font-size: 14px;
    }

  .notif-toggle {
      width: 30px;
      height: 30px;
    }

  .notif-toggle svg {
      width: 15px;
      height: 15px;
    }

  .notif-dropdown {
      left: auto;
      right: 0;
      bottom: auto;
      top: calc(100% + 12px);
      width: 260px;
    }

  .patchnotes-item,
    .desktop-notif {
      display: none !important;
    }

  .mobile-notif {
      display: block;
    }
}

@media (min-width: 901px) {
  .sidebar {
      position: static !important;
      width: 52px !important;
      flex-shrink: 0;
      height: calc(100vh - 40px);
      border-radius: 18px;
      align-items: center;
      padding: 14px 0 !important;
      background: var(--bg-1);
      border: 1px solid var(--line);
      backdrop-filter: blur(var(--glass-blur));
      -webkit-backdrop-filter: blur(var(--glass-blur));
      box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    }

  .logo,
    .nav-label,
    .sidebar .nav-text {
      display: none;
    }

  .structure-switch {
      width: 42px;
      padding: 0;
      margin: 0 0 10px;
    }

  .structure-switch .label {
      display: none;
    }

  .structure-switch .dropdown {
      width: 42px;
      max-width: 42px;
    }

  .structure-switch .dropdown-btn {
      width: 42px;
      height: 42px;
      padding: 0;
      justify-content: center;
      border-radius: 10px;
    }

  .structure-switch .dropdown-btn-left span,
    .structure-switch .dropdown-chevron {
      display: none;
    }

  .structure-switch .dropdown-menu {
      left: 0;
      right: auto;
      width: 220px;
    }

  .nav {
      align-items: center;
      width: 100%;
      gap: 3px;
      padding: 0;
    }

  .nav-item {
      width: 42px;
      height: 42px;
      justify-content: center;
      border-radius: 12px;
      padding: 0;
    }

  .sidebar .nav-icon {
      width: 19px;
      height: 19px;
      min-width: 19px;
    }

  .nav-item.active {
      background: var(--accent-grad) !important;
      border-color: transparent !important;
    }

  .nav-item.active .nav-icon,
    .nav-item.active svg {
      color: #fff !important;
      opacity: 1 !important;
    }

  .main {
      margin-left: 0 !important;
      border-radius: 22px;
      border: 1px solid var(--line);
      background: var(--bg-1);
      backdrop-filter: blur(var(--glass-blur));
      -webkit-backdrop-filter: blur(var(--glass-blur));
      box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
      overflow-y: auto;
      max-height: calc(100vh - 40px);
    }

  .sidebar {
      position: relative !important;
      z-index: 50;
    }
}

@media (max-width: 900px) and (min-width: 601px) {
  .sidebar .user-dropdown {
      top: 100%;
      bottom: auto;
      left: 0;
      right: auto;
    }
}
