:root {
  --hub-red: #b40002;
  --hub-red-deep: #7a0002;
  --hub-ink: #14090a;
  --hub-paper: #f3ebe3;
  --hub-paper-2: #e8ddd2;
  --hub-line: rgba(20, 9, 10, 0.12);
  --hub-muted: rgba(20, 9, 10, 0.62);
  --hub-rail: #1c0d0e;
  --hub-rail-text: #f6ebec;
  --hub-accent: #d4a35c;
  --hub-radius: 14px;
  --hub-font: "Montserrat", "Segoe UI", sans-serif;
  --hub-display: "Yeseva One", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body.hub-body {
  font-family: var(--hub-font);
  color: var(--hub-ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(180, 0, 2, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(212, 163, 92, 0.16), transparent 45%),
    linear-gradient(160deg, #f7f1ea 0%, #ebe1d6 48%, #e4d6c8 100%);
  background-attachment: fixed;
}

.hub-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.hub-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--hub-line);
  backdrop-filter: blur(10px);
  background: rgba(243, 235, 227, 0.72);
  position: sticky;
  top: 0;
  z-index: 20;
}

.hub-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
}

.hub-brand img {
  width: 132px;
  height: auto;
  display: block;
}

.hub-brand__meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.hub-brand__eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hub-muted);
  font-weight: 600;
}

.hub-brand__title {
  margin: 0;
  font-family: var(--hub-display);
  font-size: 1.35rem;
  line-height: 1.1;
}

.hub-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hub-user__name {
  font-size: 0.9rem;
  font-weight: 600;
}

.hub-user__role {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(180, 0, 2, 0.1);
  color: var(--hub-red-deep);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hub-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.65rem 1.1rem;
  font: inherit;
  font-weight: 650;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.hub-btn:active {
  transform: translateY(1px);
}

.hub-btn--primary {
  background: var(--hub-red);
  color: #fff;
  box-shadow: 0 10px 24px rgba(180, 0, 2, 0.28);
  animation: hubCtaPulse 2.8s ease-in-out infinite;
}

.hub-btn--primary:hover {
  background: var(--hub-red-deep);
}

.hub-btn--ghost {
  background: transparent;
  border-color: var(--hub-line);
  color: var(--hub-ink);
}

.hub-btn--ghost:hover {
  border-color: rgba(20, 9, 10, 0.28);
  background: rgba(255, 255, 255, 0.35);
}

.hub-btn--rail {
  width: 100%;
  text-align: left;
  border-radius: 10px;
  background: transparent;
  color: var(--hub-rail-text);
  border: 1px solid transparent;
  padding: 0.7rem 0.85rem;
}

.hub-btn--rail:hover,
.hub-btn--rail.is-active {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}

.hub-btn--rail.is-active {
  box-shadow: inset 3px 0 0 var(--hub-red);
}

@keyframes hubCtaPulse {
  0%,
  100% {
    box-shadow: 0 10px 24px rgba(180, 0, 2, 0.22);
  }
  50% {
    box-shadow: 0 12px 28px rgba(180, 0, 2, 0.38);
  }
}

.hub-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 0;
}

.hub-rail {
  background: linear-gradient(180deg, #241011 0%, var(--hub-rail) 55%, #120808 100%);
  color: var(--hub-rail-text);
  padding: 1.25rem 0.9rem 2rem;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.hub-rail__label {
  margin: 0 0.4rem 0.55rem;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(246, 235, 236, 0.55);
  font-weight: 600;
}

.hub-rail__nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1.4rem;
}

.hub-rail__cities {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-height: calc(100vh - 280px);
  overflow: auto;
  padding-right: 0.2rem;
}

.hub-rail__city-count {
  float: right;
  opacity: 0.55;
  font-size: 0.78rem;
}

.hub-main {
  padding: 1.35rem 1.5rem 2.5rem;
  min-width: 0;
}

.hub-main__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
  animation: hubFadeUp 420ms ease both;
}

.hub-main__title {
  margin: 0;
  font-family: var(--hub-display);
  font-size: clamp(1.8rem, 2.4vw, 2.4rem);
  line-height: 1.05;
}

.hub-main__sub {
  margin: 0.35rem 0 0;
  color: var(--hub-muted);
  max-width: 40rem;
  line-height: 1.45;
}

.hub-toolbar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  animation: hubFadeUp 480ms ease both;
}

.hub-search {
  flex: 1 1 240px;
  min-width: 200px;
  border: 1px solid var(--hub-line);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font: inherit;
  color: inherit;
}

.hub-search:focus {
  outline: 2px solid rgba(180, 0, 2, 0.28);
  border-color: rgba(180, 0, 2, 0.35);
}

.hub-panel {
  border: 1px solid var(--hub-line);
  border-radius: var(--hub-radius);
  background: rgba(255, 252, 248, 0.72);
  overflow: hidden;
  animation: hubFadeUp 540ms ease both;
}

.hub-table {
  width: 100%;
  border-collapse: collapse;
}

.hub-table th,
.hub-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--hub-line);
  font-size: 0.92rem;
}

.hub-table th {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hub-muted);
  background: rgba(255, 255, 255, 0.4);
}

.hub-table tbody tr {
  cursor: pointer;
  transition: background 160ms ease;
}

.hub-table tbody tr:hover {
  background: rgba(180, 0, 2, 0.05);
}

.hub-table tbody tr:last-child td {
  border-bottom: 0;
}

.hub-empty,
.hub-status,
.hub-error {
  padding: 1.4rem 1rem;
  color: var(--hub-muted);
}

.hub-error {
  color: var(--hub-red-deep);
}

.hub-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--hub-red);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 0.35rem;
}

@keyframes hubFadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hub-shell.is-workspace .hub-layout {
  display: none;
}

.hub-workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: calc(100vh - 74px);
  animation: hubFadeUp 360ms ease both;
}

.hub-workspace__bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--hub-line);
  background: rgba(255, 252, 248, 0.78);
  backdrop-filter: blur(8px);
}

.hub-workspace__meta {
  flex: 1;
  min-width: 0;
}

.hub-workspace__eyebrow {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hub-muted);
  font-weight: 650;
}

.hub-workspace__title {
  margin: 0.1rem 0 0;
  font-family: var(--hub-display);
  font-size: 1.25rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-workspace__frame {
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 140px);
  border: 0;
  background: #f7f1ea;
}

@media (max-width: 920px) {
  .hub-layout {
    grid-template-columns: 1fr;
  }

  .hub-rail {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .hub-rail__cities {
    max-height: 180px;
  }

  .hub-brand__meta {
    display: none;
  }

  .hub-main__head {
    flex-direction: column;
    align-items: stretch;
  }
}
