/* ── App shell ───────────────────────────────────────────── */

.main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  padding: 20px;
  gap: 20px;
}

.main--detail {
  padding: 40px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.app-body {
  overflow-x: hidden;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidenav */
.app-sidenav {
  display: flex;
  flex-direction: column;
  width: 280px;
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 20px;
  flex-shrink: 0;
  overflow-y: auto;
  background: linear-gradient(161.4deg, #222224 11.4%, #0f0f10 100%);
}

.app-sidenav__logo-wrap {
  display: flex;
  justify-content: center;
  padding: 35px 0;
}

.app-sidenav__logo {
  font-weight: 800;
  font-size: 32px;
  line-height: 1;
  color: #fff;
  text-decoration: none;
}

.app-sidenav__nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  padding-top: 8px;
}

.app-sidenav__spacer {
  flex: 1;
}

.app-sidenav__nav-link {
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 0 8px;
  height: 48px;
  border-radius: var(--radius-md);
  color: var(--color-subtle);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  transition: background-color 0.15s, color 0.15s;
}
.app-sidenav__nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text);
}
.app-sidenav__nav-link svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  transition: color 0.15s;
}

.app-sidenav__footer {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-top: 16px;
}

.app-sidenav__divider {
  border: none;
  border-top: 1px solid var(--color-border);
}

.app-sidenav__user {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-sidenav__user-info {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.app-sidenav__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

.app-sidenav__user-name {
  font-weight: 500;
  font-size: 18px;
  line-height: 1;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-sidenav__user-role {
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  color: rgba(69, 69, 69, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Content area */
.app-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  max-width: calc(100vw - 336px);
}

/* Header */
.app-header {
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 40px 58px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(69, 69, 69, 0.3);
}

.app-header__title {
  font-weight: 700;
  font-size: 32px;
  line-height: 1;
  color: var(--color-text);
  margin: 0;
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Main */
.app-main {
  flex: 1;
  overflow: auto;
}

/* Flash messages */
.app-flash {
  margin: 16px 20px 0;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--color-text);
}
.app-flash--notice {
  background: rgba(13, 110, 253, 0.2);
  border: 1px solid rgba(13, 110, 253, 0.4);
}
.app-flash--alert {
  background: rgba(127, 29, 29, 0.3);
  border: 1px solid rgba(185, 28, 28, 0.4);
}
