.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-expanded) minmax(0, 1fr);
  transition: grid-template-columns .2s ease;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: #10344f;
  color: white;
  border-right: 1px solid rgba(255,255,255,.08);
  z-index: 40;
}

.sidebar-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255,255,255,.12);
  font-size: 23px;
}

.brand-copy {
  min-width: 0;
  transition: opacity .18s ease, width .18s ease;
}

.brand-copy strong,
.brand-copy span {
  display: block;
}

.brand-copy span {
  color: rgba(255,255,255,.66);
  font-size: 12px;
  margin-top: 2px;
}

body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .sidebar-footer-copy {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 10px;
}

.nav-section-title {
  padding: 10px 12px 8px;
  color: rgba(255,255,255,.45);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  white-space: nowrap;
}

.nav-link {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border-radius: 12px;
  text-decoration: none;
  color: rgba(255,255,255,.84);
  margin-bottom: 5px;
}

.nav-link:hover,
.nav-link.active {
  color: white;
  background: rgba(255,255,255,.12);
}

.nav-icon {
  flex: 0 0 32px;
  width: 32px;
  text-align: center;
  font-size: 19px;
}

.nav-label {
  white-space: nowrap;
  transition: opacity .18s ease, width .18s ease;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,.10);
}

.sidebar-toggle {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 11px;
  padding: 0 11px;
  background: rgba(255,255,255,.10);
  color: white;
  cursor: pointer;
}

.main-area {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 clamp(16px, 3vw, 32px);
  background: rgba(255,255,255,.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(15px);
}

@media (prefers-color-scheme: dark) {
  .topbar { background: rgba(26,34,41,.92); }
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -.02em;
}

.topbar-meta {
  color: var(--muted);
  font-size: 13px;
}

.content {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero {
  padding: clamp(24px, 5vw, 48px);
  border-radius: var(--radius-lg);
  color: white;
  background: linear-gradient(135deg, #0f4f83, #1d79b9);
  box-shadow: var(--shadow-md);
}

.hero h2 {
  margin: 0 0 10px;
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -.04em;
  line-height: 1.05;
}

.hero p {
  margin: 0;
  max-width: 760px;
  color: rgba(255,255,255,.86);
  font-size: 17px;
  line-height: 1.55;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin: 30px 0 14px;
}

.section-heading h3 {
  margin: 0;
  font-size: 22px;
}

.section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 18px;
}

.tool-card {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: #9dc4df;
  box-shadow: var(--shadow-md);
}

.tool-card.disabled {
  opacity: .66;
}

.tool-card .icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--accent-soft);
  font-size: 24px;
}

.tool-card h4 {
  margin: 18px 0 8px;
  font-size: 20px;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.tool-card .status {
  margin-top: auto;
  padding-top: 18px;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 800;
}

.badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 820px) {
  .app-shell,
  body.sidebar-collapsed .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 300px);
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: 20px 0 50px rgba(0,0,0,.25);
  }

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

  .mobile-menu-button {
    display: inline-grid !important;
  }

  .content {
    width: min(100% - 20px, 1320px);
    padding-top: 18px;
  }
}

.mobile-menu-button {
  display: none;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
