:root {
  --sidebar-width: 310px;
  --bottom-nav-height: 84px;
  --page-padding: 28px;
  --card-max-width: 980px;
  --smart-content-gutter: 96px;
  --smart-content-width: min(calc(100vw - var(--smart-content-gutter)), var(--card-max-width));

  --bg: #050505;
  --panel: rgba(16, 16, 16, 0.96);
  --panel-soft: rgba(24, 24, 24, 0.92);
  --line: rgba(214, 180, 92, 0.20);
  --line-soft: rgba(255,255,255,0.07);

  --gold: #d6b45c;
  --gold-dark: #a97922;
  --gold-soft: rgba(214, 180, 92, 0.14);

  --text: #ffffff;
  --text-muted: rgba(255,255,255,0.58);
  --danger: #f87171;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(214,180,92,0.18), transparent 28%),
    radial-gradient(circle at 86% 86%, rgba(201,154,62,0.14), transparent 30%),
    linear-gradient(180deg, #050505 0%, #101010 100%);
}

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

button,
input {
  font-family: inherit;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  padding-left: var(--sidebar-width);
  transition: padding-left 0.22s ease;
}

.app-shell.sidebar-collapsed {
  padding-left: 0;
}

.content {
  flex: 1;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--page-padding);
  padding-bottom: calc(var(--bottom-nav-height) + 38px + env(safe-area-inset-bottom));
}

.content-top-row {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.floating-menu-toggle,
.menu-toggle {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(16,16,16,0.92);
  color: #ffffff;
  font-size: 22px;
  letter-spacing: -2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.vvv-topbar {
  flex: 1;
  min-height: 54px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(16,16,16,0.72);
  border: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vvv-topbar-title {
  padding-left: 14px;
  color: rgba(255,255,255,0.78);
  font-weight: 900;
}

.vvv-topbar-btn {
  height: 42px;
  padding: 0 16px;
  border-radius: 13px;
  border: 1px solid rgba(214,180,92,0.28);
  background: var(--gold-soft);
  color: var(--gold);
  font-weight: 900;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100%;
  background: var(--panel);
  border-right: 1px solid var(--line);
  z-index: 40;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateX(0);
  transition: transform 0.22s ease;
}

.sidebar.collapsed {
  transform: translateX(-100%);
  pointer-events: none;
}

.sidebar-header {
  border-bottom: 1px solid var(--line);
}

.sidebar-logo-row {
  min-height: 78px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-logo-text strong {
  display: block;
  color: var(--gold);
  font-size: 34px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0.06em;
}

.sidebar-logo-text span {
  display: block;
  margin-top: 5px;
  color: rgba(255,255,255,0.54);
  font-size: 11px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-user-info {
  padding: 16px 18px 18px;
  border-bottom: 1px solid var(--line);
}

.smart-title {
  font-weight: 900;
  font-size: 20px;
  line-height: 1.15;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email {
  font-size: 14px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
}

.sidebar-home {
  border-bottom: 3px double var(--line);
  margin-bottom: 18px;
}

.smart-label {
  padding: 4px 18px 14px;
  font-size: 13px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-modules {
  padding-bottom: 14px;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 18px;
  padding-bottom: 28px;
}

.sidebar-bottom .nav-item:first-child {
  border-top: 3px double var(--line);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 14px 18px;
  color: rgba(255,255,255,0.78);
  border-top: 1px solid var(--line-soft);
  font-size: 16px;
  transition: background 0.14s ease, color 0.14s ease;
}

.nav-item:hover {
  background: rgba(214,180,92,0.07);
  color: #ffffff;
}

.nav-item.active {
  background: rgba(214,180,92,0.18);
  color: #ffffff;
  border-color: rgba(214,180,92,0.28);
}

.nav-icon {
  width: 22px;
  min-width: 22px;
  text-align: center;
  color: var(--gold);
  font-size: 17px;
}

.nav-label {
  flex: 1;
  font-weight: 800;
}

.nav-item.logout {
  color: var(--danger);
}

.vvv-page-wrap {
  width: var(--smart-content-width);
  max-width: var(--card-max-width);
  margin-left: auto;
  margin-right: auto;
}

.vvv-title-card,
.vvv-empty-card {
  border-radius: 24px;
  background: rgba(16,16,16,0.88);
  border: 1px solid var(--line);
  box-shadow: 0 18px 45px rgba(0,0,0,0.32);
}

.vvv-title-card {
  min-height: 150px;
  padding: 32px 34px;
  display: flex;
  align-items: center;
  margin-bottom: 22px;
}

.vvv-kicker {
  margin-bottom: 10px;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.vvv-title-card h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  line-height: 0.98;
  font-weight: 950;
  letter-spacing: -0.06em;
}

.vvv-title-card p {
  max-width: 520px;
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.4;
  font-weight: 650;
}

.vvv-empty-card {
  padding: 24px;
}

.vvv-empty-card h2 {
  margin: 0 0 8px;
  color: #ffffff;
  font-size: 1.35rem;
}

.vvv-empty-card p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.45;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(760px, calc(100vw - 28px));
  height: 64px;
  padding: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 22px;
  background: rgba(10,10,10,0.96);
  border: 1px solid var(--line);
  box-shadow: 0 18px 45px rgba(0,0,0,0.42);
  z-index: 30;
}

.bottom-item {
  flex: 1 1 0;
  min-width: 0;
  height: 52px;
  border-radius: 16px;
  color: rgba(255,255,255,0.56);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.94rem;
  font-weight: 900;
  white-space: nowrap;
}

.bottom-item.active {
  background: rgba(214,180,92,0.18);
  color: #ffffff;
}

.auth-body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: min(92vw, 420px);
  padding: 28px;
  border-radius: 24px;
  background: rgba(16,16,16,0.92);
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(0,0,0,0.42);
}

.auth-logo {
  margin-bottom: 24px;
  text-align: center;
}

.auth-logo strong {
  display: block;
  color: var(--gold);
  font-size: 46px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.auth-logo span {
  display: block;
  margin-top: 7px;
  color: rgba(255,255,255,0.54);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-card h1 {
  margin: 0;
  text-align: center;
  font-size: 2.2rem;
}

.auth-card p {
  margin: 10px 0 22px;
  text-align: center;
  color: var(--text-muted);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: rgba(255,255,255,0.72);
  font-size: 0.92rem;
  font-weight: 800;
}

.auth-form input {
  height: 50px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(214,180,92,0.20);
  background: rgba(255,255,255,0.07);
  color: #ffffff;
  outline: 0;
  font-size: 1rem;
}

.auth-form input:focus {
  border-color: rgba(214,180,92,0.58);
}

.auth-form button {
  height: 52px;
  margin-top: 4px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(180deg, #d6b45c, #a97922);
  color: #090909;
  font-size: 1rem;
  font-weight: 950;
  cursor: pointer;
}

.flash-list {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.flash-message {
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(248,113,113,0.16);
  border: 1px solid rgba(248,113,113,0.22);
  color: #fecaca;
  font-weight: 750;
}

@media (max-width: 760px) {
  :root {
    --smart-content-gutter: 28px;
    --page-padding: 18px;
  }

  .app-shell {
    padding-left: 0;
  }

  .sidebar {
    width: min(86vw, 310px);
  }

  .content {
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .content-top-row {
    margin-bottom: 18px;
  }

  .vvv-topbar-title {
    font-size: 0.94rem;
  }

  .vvv-title-card {
    min-height: 126px;
    padding: 26px 22px;
    border-radius: 22px;
  }

  .vvv-title-card h1 {
    font-size: 2.55rem;
  }

  .bottom-nav {
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    width: 100vw;
    height: calc(78px + env(safe-area-inset-bottom));
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }

  .bottom-item {
    height: 58px;
    border-radius: 15px;
    font-size: 0.82rem;
  }
}
