.app-shell {
  min-height: 100vh;
  background: var(--rs-background);
  color: var(--rs-text);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--rs-border-light);
}

.topbar {
  position: static;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--rs-content-max);
  min-height: 76px;
  margin: 0 auto;
  padding: 12px 24px;
  background: transparent;
  border: 0;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 44px; height: 44px; object-fit: contain; }
.brand strong { color: var(--rs-text); font-size: 16px; font-weight: 600; line-height: 1.15; }
.brand span { margin-top: 3px; color: var(--rs-text-secondary); font-size: 12px; }

.user-menu { display: flex; align-items: center; gap: 12px; }
.user-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: #edf2f7; color: #64748b; font-size: 14px; font-weight: 600; }
.user-meta { min-width: 96px; }
.user-meta strong { display: block; font-size: 14px; font-weight: 600; }
.user-meta span { display: block; margin-top: 2px; color: var(--rs-text-secondary); font-size: 12px; }

.logout-button {
  display: grid;
  place-items: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--rs-text-secondary);
  font-size: 18px;
}
.logout-button:hover { border-color: var(--rs-border-light); background: var(--rs-surface-subtle); color: var(--rs-text); }

.global-nav,
.header-context {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

.global-nav {
  max-width: var(--rs-content-max);
  min-height: 54px;
  margin: 0 auto;
  padding: 0 24px;
  border-top: 1px solid #f1f3f6;
}

.global-nav-item,
.header-sector-menu-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 14px;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #4b5563;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.global-nav-item:hover,
.header-sector-menu-item:hover { background: transparent; color: var(--rs-primary); }

.global-nav-item.is-active,
.header-sector-menu-item.is-active {
  background: transparent;
  border: 0;
  color: var(--rs-primary);
}

.global-nav-item.is-active::after,
.header-sector-menu-item.is-active::after {
  content: '';
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 12px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--rs-primary);
}

.global-nav-icon { width: 18px; color: currentColor; font-size: 16px; text-align: center; }

.header-context {
  min-height: 0;
  padding: 0 max(24px, calc((100vw - var(--rs-content-max)) / 2 + 24px));
  background: var(--rs-surface);
  border-top: 1px solid #f1f3f6;
}

.header-context:empty { display: none; }
.header-sector-menu { display: flex; flex-wrap: nowrap; gap: 4px; width: max-content; }
.header-sector-menu-back { color: var(--rs-text-secondary); }

.notice { display: none; }
.notice:not(:empty) { display: block; max-width: var(--rs-content-max); margin: 16px auto 0; padding: 12px 24px; background: var(--rs-warning-light); border: 1px solid #fed7aa; border-radius: var(--rs-radius); }

.app-content {
  width: 100%;
  max-width: var(--rs-content-max);
  min-width: 0;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.home-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.home-hero h1 { margin: 0; font-size: clamp(28px, 3vw, 36px); letter-spacing: -0.03em; }
.home-hero p { margin: 8px 0 0; color: var(--rs-text-secondary); font-size: 15px; }
.home-date { color: var(--rs-text-secondary); font-size: 13px; }

.sector-card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.sector-card { min-height: 136px; padding: 20px; border: 1px solid var(--rs-border-light); border-radius: var(--rs-radius); background: var(--rs-surface); box-shadow: var(--rs-shadow-sm); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.sector-card:hover { border-color: #bfdbfe; background: var(--rs-surface); box-shadow: var(--rs-shadow); }
.sector-card-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--rs-primary-light); color: var(--rs-primary); font-size: 19px; }
.sector-card-content strong { font-size: 15px; font-weight: 600; }
.sector-card-content small { color: var(--rs-text-secondary); font-size: 12px; line-height: 1.5; }

@media (max-width: 1100px) { .sector-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (max-width: 720px) {
  .topbar { min-height: 68px; padding: 10px 16px; }
  .brand img { width: 38px; height: 38px; }
  .brand span, .user-meta { display: none; }
  .global-nav { padding: 0 8px; }
  .global-nav-item { padding: 0 12px; }
  .header-context { padding: 0 8px; }
  .app-content { padding: 24px 16px 40px; }
  .sector-card-grid { grid-template-columns: 1fr; gap: 12px; }
  .sector-card { min-height: 104px; }
  .home-hero { align-items: flex-start; flex-direction: column; gap: 8px; }
}
