:root {
  --app-bg: #f3f6fb;
  --app-surface: rgba(255, 255, 255, 0.92);
  --app-surface-strong: #ffffff;
  --app-border: rgba(24, 39, 75, 0.12);
  --app-text: #172033;
  --app-muted: #6a768c;
  --app-primary: #155eef;
  --app-primary-deep: #0f3fb5;
  --app-accent: #12b3a8;
  --app-danger: #d92d20;
  --app-warning: #f59e0b;
  --app-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
  --app-radius-xl: 28px;
  --app-radius-lg: 20px;
  --app-radius-md: 14px;
  --app-shell-width: 280px;
}

html {
  overflow-x: hidden;
}

body.app-body {
  margin: 0;
  min-height: 100vh;
  color: var(--app-text);
  background:
    radial-gradient(circle at top left, rgba(21, 94, 239, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(18, 179, 168, 0.14), transparent 20%),
    linear-gradient(180deg, #f8fbff 0%, var(--app-bg) 48%, #eef3fa 100%);
  font-family:
    "Trebuchet MS",
    "Segoe UI",
    sans-serif;
}

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

.app-sidebar {
  width: var(--app-shell-width);
  padding: 24px 18px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background:
    linear-gradient(180deg, rgba(249, 250, 247, 0.98) 0%, rgba(243, 245, 240, 0.98) 100%);
  color: var(--app-text);
  border-right: 1px solid rgba(22, 29, 24, 0.08);
  box-shadow: 18px 0 40px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(14px);
}

.app-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 6px 14px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(22, 29, 24, 0.08);
}

.app-brand img {
  width: 150px;
  height: auto;
  opacity: 1;
  filter: none;
}

.app-panel-label {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.app-user-chip {
  padding: 14px 16px;
  border: 1px solid rgba(22, 29, 24, 0.08);
  background: rgba(255, 255, 255, 0.8);
  border-radius: var(--app-radius-md);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.app-user-chip .label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--app-muted);
}

.app-user-chip .value {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--app-text);
}

.app-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--app-radius-md);
  color: var(--app-muted);
  text-decoration: none;
  transition:
    transform 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease;
  border: 1px solid transparent;
}

.app-nav-link:hover,
.app-nav-link:focus-visible {
  color: var(--app-text);
  background: rgba(21, 94, 239, 0.08);
  border-color: rgba(21, 94, 239, 0.12);
  transform: translateX(3px);
}

.app-nav-link.active {
  background: linear-gradient(135deg, rgba(21, 94, 239, 0.28), rgba(18, 179, 168, 0.2));
  border-color: rgba(124, 159, 255, 0.28);
  color: var(--app-primary-deep);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.app-nav-badge {
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(21, 94, 239, 0.12);
  color: inherit;
  font-size: 0.78rem;
  text-align: center;
}

.app-nav-link.active .app-nav-badge {
  background: rgba(21, 94, 239, 0.16);
}

.app-sidebar-footer {
  margin-top: auto;
}

.app-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 16px;
  color: #b42318;
  text-decoration: none;
  border-radius: var(--app-radius-md);
  border: 1px solid rgba(217, 45, 32, 0.14);
  background: rgba(217, 45, 32, 0.06);
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.app-logout:hover,
.app-logout:focus-visible {
  color: #ffffff;
  background: linear-gradient(135deg, #d92d20, #b42318);
  border-color: rgba(180, 35, 24, 0.75);
  transform: scale(1.03);
  box-shadow: 0 12px 24px rgba(180, 35, 24, 0.22);
}


.app-main {
  min-width: 0;
  margin-left: var(--app-shell-width);
  padding: 28px;
}

.app-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 26px;
  padding: 18px 22px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-xl);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.app-topbar .eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--app-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
}

.app-topbar h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.08;
}

.app-topbar p {
  margin: 6px 0 0;
  color: var(--app-muted);
  max-width: 720px;
}

.app-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.app-content-stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.app-card,
.card {
  border: 1px solid var(--app-border) !important;
  border-radius: var(--app-radius-lg) !important;
  background: var(--app-surface) !important;
  box-shadow: var(--app-shadow);
  overflow: hidden;
}

.app-card-soft {
  border: 1px solid rgba(21, 94, 239, 0.12);
  border-radius: var(--app-radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 255, 0.92));
  box-shadow: var(--app-shadow);
}

.app-hero {
  position: relative;
  overflow: hidden;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: calc(var(--app-radius-xl) + 4px);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.2), transparent 28%),
    linear-gradient(135deg, #1246ba 0%, #155eef 45%, #12b3a8 100%);
  color: #ffffff;
  box-shadow: 0 24px 50px rgba(17, 67, 178, 0.22);
}

.app-hero::after {
  content: "";
  position: absolute;
  inset: auto -30px -60px auto;
  width: 220px;
  height: 220px;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 999px;
}

.app-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.app-kpi {
  padding: 20px;
  border-radius: var(--app-radius-lg);
  border: 1px solid var(--app-border);
  background: rgba(255, 255, 255, 0.8);
}

.app-kpi-label {
  color: var(--app-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.app-kpi-value {
  margin-top: 8px;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 800;
  line-height: 1;
}

.app-kpi-note {
  margin-top: 6px;
  color: var(--app-muted);
  font-size: 0.92rem;
}

.app-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.app-section-header h2,
.app-section-header h3,
.app-section-header h5 {
  margin: 0;
}

.app-meta {
  color: var(--app-muted);
  font-size: 0.93rem;
}

.app-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.app-chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(21, 94, 239, 0.14);
  background: rgba(21, 94, 239, 0.06);
  color: var(--app-text);
  font-weight: 600;
  font-size: 0.9rem;
}

.app-chip.active,
.app-chip:hover,
.app-chip:focus-visible {
  background: rgba(21, 94, 239, 0.12);
  border-color: rgba(21, 94, 239, 0.22);
  color: var(--app-primary-deep);
}

.app-tabstrip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.app-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  padding: 11px 16px;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  background: rgba(255, 255, 255, 0.84);
  color: var(--app-muted);
  text-decoration: none;
  font-weight: 700;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.app-tab:hover,
.app-tab:focus-visible {
  color: var(--app-text);
  border-color: rgba(21, 94, 239, 0.18);
  background: rgba(21, 94, 239, 0.06);
  transform: translateY(-1px);
}

.app-tab.active {
  background: linear-gradient(135deg, rgba(21, 94, 239, 0.16), rgba(18, 179, 168, 0.1));
  border-color: rgba(21, 94, 239, 0.2);
  color: var(--app-primary-deep);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.app-inline-list {
  display: grid;
  gap: 12px;
}

.app-inline-item {
  padding: 16px 18px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-md);
  background: rgba(255, 255, 255, 0.78);
}

.app-inline-item .title {
  font-weight: 700;
}

.app-inline-item .meta {
  color: var(--app-muted);
  font-size: 0.92rem;
}

.app-stack-sm {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-roster-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.app-roster-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  background: rgba(255, 255, 255, 0.82);
  font-weight: 600;
}

.app-roster-pill-initial,
.app-person-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(21, 94, 239, 0.12);
  color: var(--app-primary-deep);
  font-weight: 800;
  flex-shrink: 0;
}

.app-person-card {
  height: 100%;
  padding: 18px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(249, 251, 255, 0.86));
  box-shadow: var(--app-shadow);
}

.app-person-card-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 18px;
  align-items: start;
}

.app-person-main {
  min-width: 0;
}

.app-person-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-person-copy {
  min-width: 0;
}

.app-person-copy .title,
.app-person-copy .meta {
  overflow-wrap: anywhere;
}

.app-person-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: start;
}

.app-stat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-stat-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  color: var(--app-muted);
  font-size: 0.85rem;
  font-weight: 600;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(21, 94, 239, 0.03);
  --bs-table-hover-bg: rgba(21, 94, 239, 0.04);
  margin-bottom: 0;
}

.table thead th {
  color: var(--app-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom-width: 1px;
}

.table > :not(caption) > * > * {
  padding: 0.95rem 0.9rem;
  border-color: rgba(24, 39, 75, 0.08);
}

.btn {
  border-radius: 999px;
  font-weight: 600;
  padding: 0.72rem 1rem;
}

.btn-sm {
  padding: 0.45rem 0.8rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--app-primary), var(--app-primary-deep));
  border-color: transparent;
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-danger,
.btn-outline-success,
.btn-outline-warning,
.btn-outline-dark {
  background: rgba(255, 255, 255, 0.72);
}

.form-control,
.form-select,
.modal-content {
  border-radius: var(--app-radius-md);
}

.form-control,
.form-select {
  min-height: 48px;
  border-color: rgba(24, 39, 75, 0.12);
  background: rgba(255, 255, 255, 0.9);
}

.alert {
  border: 1px solid transparent;
  border-radius: var(--app-radius-md);
}

.badge {
  border-radius: 999px;
  padding: 0.45em 0.7em;
}

.app-footer {
  margin-top: 28px;
  padding: 18px 4px 8px;
  color: var(--app-muted);
  font-size: 0.92rem;
}

.app-footer small {
  display: block;
}

@media (max-width: 991.98px) {
  .app-shell {
    display: block;
  }

  .app-sidebar {
    width: auto;
    height: auto;
    position: static;
    left: auto;
    bottom: auto;
    overflow-y: visible;
    padding: 18px 14px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .app-brand {
    justify-content: flex-start;
    padding-top: 4px;
    padding-bottom: 12px;
  }

  .app-nav {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .app-nav-link {
    flex: 0 0 auto;
  }

  .app-sidebar-footer {
    margin-top: 0;
  }
}

@media (max-width: 767.98px) {
  .app-main {
    margin-left: 0;
    padding: 18px 14px 28px;
  }

  .app-topbar {
    padding: 18px;
    border-radius: 22px;
  }

  .app-hero {
    padding: 22px;
  }

  .app-kpi-grid {
    grid-template-columns: 1fr;
  }

  .app-section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-person-card-layout {
    grid-template-columns: 1fr;
  }

  .app-person-actions {
    width: 100%;
  }
}
