:root {
  --app-sidebar-width: 260px;
  --app-radius: 12px;
  --app-shadow: 0 1px 3px rgba(44, 44, 44, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.app-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-family-montserrat), sans-serif;
  color: var(--color-text);
  background: #f5f5f7;
}

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

.app-sidebar {
  width: var(--app-sidebar-width);
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--color-border);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.app-brand {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin: 0;
  color: var(--color-text);
}

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

.app-nav__link {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--color-text);
  font-size: 15px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.app-nav__link:hover {
  background: rgba(188, 65, 157, 0.08);
  color: var(--color-accent);
}

.app-nav__link.is-active {
  background: rgba(188, 65, 157, 0.12);
  color: var(--color-accent);
}

.app-nav__link--muted {
  color: var(--color-text-muted);
  margin-top: auto;
}

.app-sidebar__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-main {
  flex: 1;
  min-width: 0;
  padding: 32px 40px 48px;
}

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

.app-header__title {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
}

.app-header__sub {
  margin: 6px 0 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

.app-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  padding: 22px 24px;
}

.app-card + .app-card {
  margin-top: 16px;
}

.app-card__title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
}

.app-grid {
  display: grid;
  gap: 16px;
}

.app-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.app-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.app-badge--ok {
  background: rgba(46, 160, 90, 0.12);
  color: #1f7a3f;
}

.app-badge--off {
  background: rgba(44, 44, 44, 0.08);
  color: var(--color-text-muted);
}

.app-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.app-table th,
.app-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.app-table th {
  color: var(--color-text-soft);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.app-empty {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

.app-link {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
}

.app-link:hover {
  text-decoration: underline;
}

.app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: var(--color-accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}

.app-btn:hover {
  filter: brightness(1.05);
}

.app-btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

@media (max-width: 900px) {
  .app-shell {
    flex-direction: column;
  }

  .app-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding: 16px;
    gap: 16px;
  }

  .app-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .app-sidebar__footer {
    margin-top: 0;
    flex-direction: row;
    align-items: center;
  }

  .app-main {
    padding: 20px 16px 40px;
  }

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