.app-body {
  min-height: 100vh;
  background: #f4f7f8;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  min-height: 72px;
  padding: 10px clamp(16px, 4vw, 40px);
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.app-brand img {
  width: 170px;
  max-height: 54px;
  object-fit: contain;
}

.app-topnav {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.app-topnav a,
.app-user a {
  padding: 10px 12px;
  border-radius: 8px;
  color: #36505a;
  font-weight: 800;
}

.app-topnav a:hover,
.app-user a:hover {
  background: #ecf6f4;
}

.app-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.auth-wrap {
  min-height: calc(100vh - 72px);
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.auth-card {
  width: min(460px, 100%);
  padding: 30px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-card img {
  width: 180px;
  max-height: 62px;
  object-fit: contain;
  margin-bottom: 24px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  color: #31464e;
  font-weight: 800;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-height: 44px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-weight: 800;
}

.alert.error {
  color: #8a1f11;
  background: #fff0ed;
  border: 1px solid #ffd0c5;
}

.alert.success {
  color: #0b5e51;
  background: #e6f8f4;
  border: 1px solid #bdece4;
}

.auth-note {
  margin: 18px 0 0;
  color: var(--muted);
}

.auth-note a {
  color: var(--teal);
  font-weight: 900;
}

.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 72px);
}

.app-sidebar {
  padding: 22px;
  background: #102630;
  color: #d8e8eb;
}

.sidebar-label {
  display: block;
  margin-bottom: 12px;
  color: #93aeb6;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.app-sidebar a {
  display: block;
  padding: 12px;
  border-radius: 8px;
  font-weight: 800;
}

.app-sidebar a.active,
.app-sidebar a:hover {
  color: #ffffff;
  background: rgba(255, 145, 71, 0.22);
}

.app-content {
  min-width: 0;
  padding: clamp(18px, 4vw, 36px);
}

.page-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 22px;
}

.page-title p {
  margin-bottom: 0;
  color: var(--muted);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card,
.panel,
.data-table {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(19, 34, 43, 0.05);
}

.stat-card {
  min-height: 120px;
  padding: 18px;
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 32px;
}

.panel {
  padding: 22px;
  margin-bottom: 18px;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
}

.data-table th,
.data-table td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.data-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.status-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #e8f5f2;
  color: #0b695b;
  font-size: 12px;
  font-weight: 900;
}

.mini-button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--green);
  font-weight: 900;
  cursor: pointer;
}

.mini-button.danger {
  background: #b3261e;
}

.mini-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.user-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.user-card {
  display: grid;
  gap: 14px;
}

.user-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.user-card-head h2 {
  margin-bottom: 2px;
  font-size: 22px;
}

.user-card-head p {
  margin: 0;
  color: var(--muted);
}

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

.inbox-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
}

.mini-list {
  display: grid;
  gap: 10px;
}

.mini-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.mini-item strong,
.mini-item span {
  display: block;
}

.mini-item span {
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 900px) {
  .app-header,
  .app-shell,
  .stat-grid,
  .panel-grid,
  .user-grid,
  .inbox-layout {
    grid-template-columns: 1fr;
  }

  .app-topnav {
    justify-content: start;
    overflow-x: auto;
  }

  .app-sidebar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }

  .app-sidebar a {
    white-space: nowrap;
  }
}
