:root {
  --brand-primary: #b8c8ff;
  --brand-secondary: #d7c6ff;
  --brand-accent: #bfe7dd;
  --bg: #f8f6fb;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: #ffffff;
  --surface-soft: #f7f6fd;
  --text: #3f4254;
  --heading: #2e3140;
  --muted: #7c8398;
  --border: rgba(188, 194, 214, 0.42);
  --success: #4f9f82;
  --warning: #c89a4b;
  --danger: #c76b7f;
  --shadow: 0 10px 30px rgba(115, 114, 157, 0.10);
  --shadow-soft: 0 8px 24px rgba(173, 168, 208, 0.10);
  --radius: 22px;
  --radius-sm: 14px;
  --max-width: 1280px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Montserrat Alternates", Inter, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(215, 198, 255, 0.22), transparent 30%),
    radial-gradient(circle at top right, rgba(184, 200, 255, 0.18), transparent 32%),
    radial-gradient(circle at bottom left, rgba(191, 231, 221, 0.18), transparent 28%),
    linear-gradient(180deg, #fbfaff 0%, #f6f4fb 100%);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

h1,
h2,
h3 {
  color: var(--heading);
  letter-spacing: 0;
}

h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 3vw, 32px);
}

h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(252, 249, 255, 0.92)),
    linear-gradient(135deg, rgba(184, 200, 255, 0.15), rgba(215, 198, 255, 0.15));
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 4px 14px;
}

.brand-logo {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(184, 200, 255, 0.42), rgba(215, 198, 255, 0.55));
  color: var(--heading);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.brand-text h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.brand-text p {
  margin: 4px 0 0;
  font-size: 13px;
}

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

.nav-label {
  margin-bottom: 4px;
  padding-left: 6px;
  color: #9aa0b4;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-link {
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--text);
  font-size: 15px;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  background: linear-gradient(135deg, rgba(184, 200, 255, 0.25), rgba(215, 198, 255, 0.28));
  color: var(--heading);
  transform: translateX(2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(14px);
}

.topbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.topbar-title h2 {
  margin: 0;
  font-size: 24px;
}

.topbar-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

main,
.content-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px;
}

.panel,
.content {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.panel {
  padding: 22px;
}

.content {
  padding: 28px;
  line-height: 1.65;
}

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

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

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

.button,
button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 14px;
  background: linear-gradient(135deg, #c8b8ff, #b7cbff);
  color: #2f3140;
  padding: 10px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.button:hover,
button:hover {
  transform: translateY(-1px);
}

.button.secondary,
button.secondary {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  border: 1px solid var(--border);
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

textarea {
  min-height: 140px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #c8b8ff;
  box-shadow: 0 0 0 0.2rem rgba(200, 184, 255, 0.22);
  outline: none;
}

label {
  display: block;
  margin: 12px 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

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

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

.table a {
  color: #5c5ca8;
  font-weight: 700;
}

.muted {
  color: var(--muted) !important;
}

.flash {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(79, 159, 130, 0.22);
  border-radius: 14px;
  background: rgba(237, 248, 243, 0.92);
  color: #2f6f5b;
  box-shadow: var(--shadow-soft);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 1px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f0edff;
  color: #6a63a8;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
  }
}

@media (max-width: 820px) {
  main,
  .content-shell,
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .grid.two {
    grid-template-columns: 1fr;
  }

  .toolbar {
    flex-direction: column;
  }

  .table {
    display: block;
    overflow-x: auto;
  }
}
