:root {
  --bg: #1a1a40;
  --bg-soft: #22225a;
  --panel: #6b56f5;
  --panel-soft: linear-gradient(135deg, #6853f0 0%, #7c67ff 100%);
  --surface: #f4f4f7;
  --surface-2: #ffffff;
  --surface-3: #f8f8fc;
  --text: #111111;
  --text-light: #ffffff;
  --muted: #cfd2ff;
  --muted-dark: #5b5b6a;
  --accent: #ffcc00;
  --border: rgba(255, 255, 255, 0.12);
  --border-soft: #e6e6f0;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  --shadow-soft: 0 4px 14px rgba(0, 0, 0, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 10px;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--text);
  line-height: 1.45;
}

body.theme-alby {
  background: var(--bg);
}

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

.app-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(124, 103, 255, 0.16), transparent 24%),
    radial-gradient(circle at left top, rgba(255, 204, 0, 0.07), transparent 18%),
    var(--bg);
  color: var(--text-light);
}

.app-topbar {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 32px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand-logo {
  width: 74px;
  height: 74px;
  object-fit: contain;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  padding: 6px;
  flex-shrink: 0;
}

.brand-text {
  min-width: 0;
}

.brand-text h1,
.page-title {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.brand-subtitle,
.page-subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 1rem;
}

.page-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px 32px;
}

.workspace {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.surface,
.surface-white {
  border-radius: var(--radius);
  padding: 24px;
}

.surface {
  background: var(--surface);
  color: var(--text);
}

.surface-white {
  background: var(--surface-2);
  color: var(--text);
}

.card {
  background: var(--surface-2);
  color: var(--text);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(17, 17, 17, 0.03);
}

.card + .card {
  margin-top: 20px;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.card-title {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--bg);
}

.section-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--bg);
}

.muted {
  color: var(--muted-dark);
}

.text-light-muted {
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  transition: 0.16s ease;
  text-align: center;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--bg);
  color: #fff;
  border-color: transparent;
}

.btn-primary:hover {
  background: #141433;
}

.btn-secondary {
  background: transparent;
  color: var(--text-light);
  border-color: rgba(255, 255, 255, 0.45);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-ghost {
  background: var(--surface-3);
  color: var(--bg);
  border-color: var(--border-soft);
}

.btn-ghost:hover {
  background: #efeff8;
}

.btn-accent {
  background: var(--accent);
  color: #111;
  border-color: transparent;
}

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

.table-wrap {
  overflow-x: auto;
  border-radius: 14px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  background: #fff;
}

.table th,
.table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid #ececf4;
  vertical-align: top;
}

.table th {
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #66667a;
  background: #fafafe;
}

.table tbody tr:hover {
  background: #fafafe;
}

.flash-success,
.flash-error {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
}

.flash-success {
  background: #ecfff1;
  border: 1px solid #9bd3ab;
  color: #1d5f2b;
}

.flash-error {
  background: #fff3f3;
  border: 1px solid #e0a3a3;
  color: #8c1d1d;
}

.user-menu {
  position: relative;
  flex-shrink: 0;
}

.user-menu summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.user-menu summary::-webkit-details-marker {
  display: none;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8f80ff 0%, #6b56f5 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 0.9rem;
}

.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 220px;
  background: #fff;
  color: #111;
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 10px;
  z-index: 40;
}

.user-menu-panel a,
.user-menu-panel button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 10px;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.user-menu-panel a:hover,
.user-menu-panel button:hover {
  background: #f3f3f8;
}

.hero-home {
  text-align: center;
  padding: 24px 0 34px;
}

.hero-home .headline {
  margin: 24px 0 0;
  font-size: 2.6rem;
  line-height: 1.15;
  color: #fff;
}

.hero-home .headline .accent {
  color: var(--accent);
}

.hero-logo {
  width: min(560px, 82vw);
  height: auto;
  display: block;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  max-width: 860px;
  margin: 36px auto 0;
}

.feature-card {
  background: #fff;
  color: #111;
  border-radius: 18px;
  padding: 24px 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
}

.feature-card h3 {
  margin: 0 0 10px;
  color: var(--bg);
}

.home-footer {
  text-align: center;
  color: azure;
  margin-top: 42px;
  font-size: 0.95rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal {
  width: 100%;
  max-width: 520px;
  background: #fff;
  color: #111;
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
  position: relative;
}

.modal h2 {
  margin-top: 0;
  color: var(--bg);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
}

.form-group {
  margin-top: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: #303045;
  font-weight: 700;
  font-size: 0.95rem;
}

.form-control {
  width: 100%;
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid #d8d8e2;
  background: #fff;
  font: inherit;
  transition: 0.16s ease;
}

.form-control:focus {
  outline: none;
  border-color: #7c67ff;
  box-shadow: 0 0 0 3px rgba(124, 103, 255, 0.16);
}

textarea.form-control {
  resize: vertical;
}

.shell-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.side-nav {
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 18px;
  color: #fff;
  position: sticky;
  top: 16px;
}

.side-nav h3 {
  margin-top: 0;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.side-nav a,
.side-nav button {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s ease;
}

.side-nav a:hover,
.side-nav button:hover {
  background: rgba(255, 255, 255, 0.13);
}

.side-nav a.is-active,
.side-nav button.is-active {
  background: var(--accent);
  color: #111;
  font-weight: 700;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.header-copy h1 {
  margin: 0;
  color: #111111;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-copy p {
  margin: 8px 0 0;
  color: #444444;
}

.info-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.info-row {
  padding: 12px 14px;
  background: #fafafe;
  border: 1px solid #ececf4;
  border-radius: 12px;
}

.info-row strong {
  color: var(--bg);
}

@media (max-width: 980px) {
  .shell-layout {
    grid-template-columns: 1fr;
  }

  .side-nav {
    position: static;
  }

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

  .app-topbar,
  .page-wrap {
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (max-width: 640px) {
  .brand {
    align-items: flex-start;
  }

  .brand-logo {
    width: 56px;
    height: 56px;
  }

  .brand-text h1,
  .page-title,
  .hero-home .headline {
    font-size: 1.8rem;
  }

  .user-menu summary span.user-name {
    display: none;
  }

  .card,
  .surface,
  .surface-white {
    padding: 18px;
  }

  .workspace {
    padding: 14px;
  }

  .table th,
  .table td {
    padding: 12px 10px;
  }
}