/* The authenticated workspace uses one viewport, with independent navigation and content scroll. */
.app-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.app-page .topbar {
  flex: none;
  border-bottom-color: #e9deda;
  box-shadow: 0 8px 30px rgba(34, 20, 20, .04);
}

.topbar-context {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #82716e;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
}

.topbar-context-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9e2a2d;
  box-shadow: 0 0 0 4px #f5e8e6;
}

.app-page .shell {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.app-page .sidebar {
  position: relative;
  top: auto;
  align-self: stretch;
  height: auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 8px 0 26px rgba(28, 17, 17, .07);
}

.app-page .content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-top: 30px;
  background: radial-gradient(circle at 95% 0, #f8eeee 0, transparent 33%), #faf8f7;
}

.app-page .userbox {
  gap: 20px;
  flex: none;
}

.profile-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 9px 6px 6px;
  border-radius: 12px;
  color: #302220;
  transition: background .18s ease;
}
.profile-link:hover { background: #f8f0ee; }
.app-page .user-avatar {
  width: 38px;
  height: 38px;
  border: 1px solid #f0d8d5;
  font-size: 16px;
}
.greeting-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.greeting-copy small { color: #82716e; font-size: 11px; font-weight: 500; }
.greeting-copy strong { font-size: 13px; white-space: nowrap; }
.app-page .link-button {
  border-left: 1px solid #e8dedb;
  padding: 7px 0 7px 19px;
  color: #862224;
}
.app-page .link-button:hover { color: #641819; text-decoration: underline; }

/* Clear, consistent hierarchy across existing modules. */
.app-page .content h1 { font-size: clamp(27px, 2.4vw, 35px); line-height: 1.16; }
.app-page .content .panel,
.app-page .content .card {
  border: 1px solid #e9dfdc;
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(34, 20, 20, .035);
}
.app-page .panel { padding: clamp(18px, 2vw, 28px); }
.app-page .panel .page-head {
  padding-bottom: 15px;
  border-bottom: 1px solid #efe7e4;
}
.app-page .panel h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.app-page .button.primary {
  font-weight: 700;
  background: #862224;
  box-shadow: 0 5px 13px rgba(134, 34, 36, .13);
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.app-page .button.primary:hover {
  background: #6c1b1d;
  box-shadow: 0 8px 20px rgba(134, 34, 36, .18);
  transform: translateY(-1px);
}
.app-page table {
  border: 1px solid #ece3e0;
  border-radius: 12px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}
.app-page .panel table { border-color: #f1eae7; }
.app-page th {
  background: #faf7f6;
  color: #5f4e4b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.app-page th,
.app-page td { border-color: #f0e8e5; }
.app-page td { font-size: 13px; line-height: 1.45; }
.app-page tbody tr { transition: background .15s ease; }
.app-page tbody tr:hover { background: #fcf8f7; }
.app-page tbody tr:last-child td { border-bottom: 0; }
.app-page .action-toggle { transition: background .16s ease, color .16s ease; }
.app-page .action-toggle:hover { background: #f1dddb; color: #681719; }
.app-page .field :is(input, select, textarea) { border-radius: 10px; border-color: #d9cac6; font: inherit; }
.app-page .field :is(input, select, textarea):focus { border-color: #9e2a2d; outline: 2px solid #ecd7d3; }

/* The dashboard has a distinct entrance without changing its routes or data. */
.app-page .dashboard-heading {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(24px, 3vw, 36px);
  border-radius: 20px;
  background: linear-gradient(120deg, #261919, #442524 70%, #6a2a2b);
  box-shadow: 0 18px 42px rgba(43, 23, 23, .13);
}
.dashboard-heading::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 290px;
  height: 290px;
  right: 9%;
  top: -205px;
  border: 48px solid rgba(255, 255, 255, .075);
  border-radius: 50%;
}
.app-page .dashboard-heading h1,
.app-page .dashboard-heading p { color: #fff; }
.app-page .dashboard-heading p { color: #e8d9d5; }
.app-page .dashboard-heading .eyebrow { color: #eccac6; }
.app-page .dashboard-heading .dashboard-create {
  background: #fff;
  color: #862224;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .12);
}
.app-page .dashboard-heading .dashboard-create:hover { background: #f9eae7; }
.app-page .summary-card { box-shadow: 0 12px 34px rgba(34, 20, 20, .05); }
.dashboard-team { margin-top: 18px; }
.dashboard-team-link { font-size: 13px; font-weight: 700; white-space: nowrap; }
.dashboard-team-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dashboard-team-member { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 14px; border: 1px solid #f0e7e4; border-radius: 12px; background: #fdfafa; }
.dashboard-team-avatar,.directory-avatar { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 11px; background: #f5e8e6; color: #862224; font-weight: 800; }
.dashboard-team-member > span:last-child { min-width: 0; }
.dashboard-team-member strong,.dashboard-team-member small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-team-member strong { color: #2c2020; font-size: 13px; }
.dashboard-team-member small { margin-top: 3px; color: #806f6d; font-size: 11px; }
.directory-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 10px 0 24px; }
.directory-heading h1 { margin: 8px 0 6px; }
.directory-heading p { margin: 0; color: #766b68; font-size: 14px; }
.directory-stats { display: flex; gap: 12px; }
.directory-stats > div { min-width: 110px; padding: 12px 16px; border: 1px solid #eae2df; border-radius: 12px; background: #fff; }
.directory-stats strong,.directory-stats span { display: block; }
.directory-stats strong { color: #862224; font-size: 24px; line-height: 1.2; }
.directory-stats span { margin-top: 3px; color: #746765; font-size: 11px; }
.directory-panel { overflow-x: auto; }
.app-page .directory-table { min-width: 650px; }
.directory-person { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.directory-person strong { font-size: 13px; }
@media (max-width: 1050px) { .dashboard-team-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 650px) { .dashboard-team-list { grid-template-columns: 1fr; } .directory-heading { flex-direction: column; align-items: stretch; } .directory-stats > div { flex: 1; } }

.profile-page { max-width: 700px; margin: 0 auto; }
.profile-heading { margin: 8px 0 24px; }
.profile-heading h1 { margin: 9px 0; }
.profile-heading p { color: #786b68; margin: 0; line-height: 1.5; }
.profile-panel { max-width: 700px; }
.profile-identity { display: flex; align-items: center; gap: 15px; padding-bottom: 24px; border-bottom: 1px solid #efe7e4; margin-bottom: 24px; }
.profile-identity-avatar { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 15px; background: #f7eae7; color: #862224; font-size: 23px; font-weight: 800; }
.profile-identity strong,
.profile-identity small { display: block; }
.profile-identity strong { color: #2b201e; font-size: 16px; }
.profile-identity small { color: #82716e; font-size: 12px; margin-top: 4px; overflow-wrap: anywhere; }
.profile-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

@media (max-width: 800px) {
  .app-page .shell { flex-direction: column; }
  .app-page .sidebar {
    position: relative;
    flex: none;
    width: 100%;
    height: auto;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: 0 5px 14px rgba(28, 17, 17, .08);
  }
  .app-page .content { width: 100%; min-height: 0; overflow-y: auto; }
  .topbar-context { display: none; }
}

@media (max-width: 630px) {
  .app-page .user-avatar { display: grid; width: 30px; height: 30px; font-size: 13px; }
  .app-page .userbox { gap: 4px; }
  .profile-link { gap: 7px; padding: 4px; }
  .greeting-copy small { font-size: 10px; }
  .greeting-copy strong { font-size: 12px; }
  .app-page .link-button { border-left: 0; padding: 6px 0 6px 5px; }
  .app-page table { border: 0; border-radius: 0; }
  .app-page .dashboard-heading { padding: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .app-page :is(a, button, tr) { transition: none; }
}
