.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }

.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  text-align: center;
}

.auth-card h1 { margin: 0 0 10px; font-size: 26px; }
.auth-card p { margin: 0; color: var(--text-secondary); }
.app-shell { min-height: 100vh; display: flex; }

.sidebar {
  width: var(--sidebar-width);
  background: #fbfcfe;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 16px 14px;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  overflow: hidden;
}

.sidebar-brand { font-size: 18px; font-weight: 600; margin: 4px 6px 10px; }

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

.nav-group,
.drawer-group,
.nav-group-items,
.drawer-group-items,
.nav-subitems,
.drawer-subitems,
.drawer-nav {
  display: flex;
  flex-direction: column;
}

.nav-group + .nav-group,
.drawer-group + .drawer-group { margin-top: 18px; }

.nav-group-title,
.drawer-group-title {
  margin: 0 0 8px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ca3af;
}

.nav-group-items,
.drawer-group-items { gap: 2px; }

.nav-item,
.drawer-item {
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #111827;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.nav-item {
  min-height: 44px;
  padding: 10px 12px;
  position: relative;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  font-size: 15px;
  font-weight: 500;
}

.nav-item:hover,
.nav-item-group[open] > .nav-item-group-trigger,
.drawer-item-group[open] > .drawer-item-group-trigger { background: #f3f4f6; }

.nav-item.active,
.drawer-item.active { background: #eef2ff; color: #2563eb; }

.nav-item.active { font-weight: 600; }
.nav-item-group, .drawer-item-group { margin: 0; }
.nav-item-group summary, .drawer-item-group summary { list-style: none; }
.nav-item-group summary::-webkit-details-marker, .drawer-item-group summary::-webkit-details-marker { display: none; }
.nav-item-group-trigger, .drawer-item-group-trigger { width: 100%; }
.nav-subitems, .drawer-subitems { gap: 2px; padding: 4px 0 0 30px; }
.nav-item--nested, .drawer-item--nested { min-height: 40px; padding-top: 8px; padding-bottom: 8px; font-size: 13px; }
.nav-caret { margin-left: auto; font-size: 12px; color: #9ca3af; transition: transform 0.15s ease; }
.nav-item-group[open] .nav-caret, .drawer-item-group[open] .nav-caret { transform: rotate(180deg); }

.nav-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
}

.nav-icon svg,
.menu-btn svg { width: 20px; height: 20px; display: block; }

.nav-item.active .nav-icon,
.drawer-item.active .nav-icon { color: #2563eb; }

.nav-label { min-width: 0; flex: 1 1 auto; line-height: 1.25; }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 8px 0; }
.profile-name { font-size: 13px; font-weight: 600; color: #111827; margin-bottom: 2px; }
.profile-role { font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; }

.main-shell {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 56px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title { font-size: 15px; font-weight: 600; }
.topbar-subtitle { font-size: 12px; color: var(--text-secondary); }
.topbar-right { position: relative; display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; font-size: 20px; background: none; border: none; cursor: pointer; color: #111827; }

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
  z-index: 998;
}

.menu-overlay.active { opacity: 1; pointer-events: all; }

.drawer {
  position: fixed;
  top: 0;
  right: -85%;
  width: 85%;
  height: 100%;
  background: #ffffff;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  padding: 20px;
  transition: 0.3s;
  z-index: 999;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.drawer.open { right: 0; }
.drawer-header { font-size: 20px; font-weight: 600; margin-bottom: 20px; }
.drawer-nav { overflow-y: auto; min-height: 0; padding-right: 4px; }
.drawer-item:active { transform: scale(0.97); }

.notify-menu {
  position: absolute;
  right: 0;
  top: 44px;
  width: 280px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.notify-title { border-bottom: 1px solid var(--line); padding: 10px 12px; font-size: 13px; font-weight: 600; }
.notify-item { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.notify-item:last-child { border-bottom: 0; }

.workspace { width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px; }
.status-line { min-height: 18px; margin-bottom: 10px; font-size: 13px; color: var(--text-secondary); }

.build-version {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.status-line.error { color: var(--danger); }
.status-line.ok { color: #166534; }
.view { display: block; }
.section-head { margin-bottom: 16px; }
.section-head.split, .header-row { display: flex; justify-content: space-between; gap: 10px; }
.section-head.split { align-items: flex-start; gap: 12px; }
.header-row { align-items: center; }
.section-head.split > *,
.header-row > * { min-width: 0; }
.section-head h2 { margin: 0; font-size: 28px; font-weight: 600; }
.section-head p { margin: 6px 0 0; font-size: 13px; color: var(--text-secondary); }
.section { margin-top: 12px; }

.sticky-detail-head {
  position: sticky;
  top: 56px;
  z-index: 9;
  margin: -8px -8px 16px;
  padding: 8px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.92);
  background: rgba(248, 250, 252, 0.96);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

@media (max-width: 900px) {
  .sidebar { width: 220px; padding: 14px 12px; }
  .main-shell { margin-left: 220px; width: calc(100% - 220px); }
  .workspace { padding: 16px; }
}

@media (max-width: 720px) {
  .sidebar { display: none; }
  .main-shell { margin-left: 0; width: 100%; }
  .workspace { padding: 14px 12px 16px; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .section-head h2 { font-size: 24px; }
}

@media (max-width: 480px) {
  .section-head.split,
  .header-row { flex-wrap: wrap; align-items: flex-start; }

  .section-head.split > *,
  .header-row > * { width: 100%; }

  .sticky-detail-head {
    margin: -6px -4px 14px;
    padding: 6px 4px 8px;
  }
}
