:root {
  --bg: #082e22;
  --bg-deep: #06241b;
  --panel: linear-gradient(180deg, rgba(12, 72, 54, 0.99), rgba(8, 50, 39, 0.99));
  --panel-border: rgba(222, 196, 124, 0.18);
  --text: #f4f6ef;
  --muted: rgba(255, 255, 255, 0.66);
  --gold-1: #f2dea2;
  --gold-2: #d8b25a;
  --gold-3: #b8862e;
  --shadow: 0 28px 60px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

.is-hidden {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(215, 172, 76, 0.1), transparent 28%),
    radial-gradient(circle at bottom left, rgba(60, 129, 101, 0.16), transparent 32%),
    linear-gradient(180deg, #0a382b 0%, var(--bg-deep) 100%);
}

.hub-shell {
  width: min(1240px, calc(100vw - 36px));
  margin: 24px auto 40px;
  padding-top: 10px;
  padding-bottom: 24px;
}

.hub-header {
  padding: 10px 6px 24px;
}

.hub-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.hub-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hub-brand-mark {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-2);
  filter:
    drop-shadow(0 2px 8px rgba(216, 178, 90, 0.16))
    drop-shadow(0 0 14px rgba(240, 208, 126, 0.08));
}

.hub-brand-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hub-brand-copy {
  display: grid;
  gap: 3px;
}

.hub-brand-overline {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.4px;
  background: linear-gradient(180deg, var(--gold-1) 0%, var(--gold-2) 52%, var(--gold-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(216, 178, 90, 0.08);
}

.hub-brand-title {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: 0.2px;
  background: linear-gradient(180deg, #fff9e8 0%, #efd596 44%, #cc9f44 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.08), 0 0 14px rgba(216, 178, 90, 0.06);
}

.hub-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hub-user-pill {
  font-size: 13px;
  color: var(--muted);
  background: rgba(8, 42, 31, 0.74);
  border: 1px solid rgba(244, 211, 131, 0.14);
  border-radius: 12px;
  padding: 10px 12px;
}

.hub-user-pill strong {
  color: #f8f3e4;
  font-weight: 700;
}

.hub-logout-btn {
  appearance: none;
  border: 1px solid rgba(244, 211, 131, 0.14);
  background: rgba(8, 42, 31, 0.74);
  color: rgba(238, 244, 236, 0.86);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.hub-tabs {
  display: flex;
  gap: 10px;
  margin: 0 6px 18px;
}

.hub-tab-btn {
  appearance: none;
  border: 1px solid rgba(244, 211, 131, 0.14);
  background: rgba(8, 42, 31, 0.74);
  color: rgba(238, 244, 236, 0.72);
  border-radius: 14px;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.hub-tab-btn.is-active {
  color: #13281d;
  background: linear-gradient(180deg, #f2d78b 0%, #d3a747 65%, #a97823 100%);
  border-color: rgba(255, 237, 183, 0.22);
}

.hub-userbox {
  display: grid;
  gap: 6px;
}

.hub-userbox span {
  font-size: 12px;
  color: var(--muted);
}

.hub-userbox select {
  background: #0c3428;
  color: var(--text);
  border: 1px solid #2a6a56;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
}

.hub-login-card {
  width: min(480px, calc(100vw - 40px));
  margin: 40px auto 20px;
  padding: 26px 24px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(12, 72, 54, 0.98), rgba(8, 50, 39, 0.98));
  border: 1px solid rgba(222, 196, 124, 0.2);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
}

.hub-boot-card {
  width: min(420px, calc(100vw - 40px));
  margin: 46px auto 20px;
  min-height: 96px;
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(12, 72, 54, 0.92), rgba(8, 50, 39, 0.92));
  border: 1px solid rgba(222, 196, 124, 0.16);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.hub-boot-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--gold-2);
  box-shadow: 0 0 12px rgba(216, 178, 90, 0.5);
  animation: hubPulse 1s ease-in-out infinite;
}

@keyframes hubPulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

.hub-login-kicker {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-2);
  margin-bottom: 8px;
}

.hub-login-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.05;
  font-weight: 740;
  color: #f8f3e4;
}

.hub-login-subtitle {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.4;
  color: var(--muted);
}

.hub-login-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.hub-login-field {
  display: grid;
  gap: 6px;
}

.hub-login-field span {
  font-size: 12px;
  color: var(--muted);
}

.hub-login-field input {
  background: #0c3428;
  color: var(--text);
  border: 1px solid #2a6a56;
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 14px;
}

.hub-login-submit {
  margin-top: 2px;
  justify-self: start;
  appearance: none;
  border: 1px solid rgba(255, 237, 183, 0.22);
  border-radius: 10px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 800;
  color: #13281d;
  background: linear-gradient(180deg, #f2d78b 0%, #d3a747 65%, #a97823 100%);
  cursor: pointer;
}

.hub-login-error {
  min-height: 18px;
  font-size: 13px;
  color: #ffd2d2;
}

.hub-admin-panel {
  margin: 0 6px 22px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(12, 72, 54, 0.98), rgba(8, 50, 39, 0.98));
  border: 1px solid rgba(222, 196, 124, 0.16);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
}

.hub-admin-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.hub-admin-kicker {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-2);
  margin-bottom: 4px;
}

.hub-admin-head h2 {
  margin: 0;
  font-size: 20px;
  color: #f8f3e4;
}

.hub-admin-hint {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.hub-admin-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
}

.hub-admin-users,
.hub-admin-right {
  display: grid;
  gap: 10px;
}

.hub-admin-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hub-admin-user-list,
.hub-permission-list {
  display: grid;
  gap: 10px;
}

.hub-stock-panel {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(222, 196, 124, 0.15);
}

.hub-stock-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.hub-stock-card {
  background: rgba(15, 59, 45, 0.9);
  border: 1px solid rgba(42, 106, 86, 0.9);
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.hub-stock-card h3 {
  margin: 0;
  font-size: 15px;
  color: #f8f3e4;
}

.hub-stock-row {
  display: grid;
  gap: 8px;
}

.hub-stock-row input[type="date"],
.hub-stock-row input[type="file"],
.hub-stock-row button {
  background: #0c3428;
  color: var(--text);
  border: 1px solid #2a6a56;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
}

.hub-stock-row button {
  cursor: pointer;
  font-weight: 700;
}

.hub-stock-status {
  min-height: 20px;
  font-size: 13px;
  color: var(--muted);
}

.hub-admin-empty {
  background: rgba(15, 59, 45, 0.7);
  border: 1px solid rgba(42, 106, 86, 0.7);
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  color: var(--muted);
}

.hub-admin-user-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.hub-admin-user-input,
.hub-admin-small-btn,
.hub-admin-remove-btn {
  background: #0c3428;
  color: var(--text);
  border: 1px solid #2a6a56;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
}

.hub-admin-small-btn,
.hub-admin-remove-btn {
  font-weight: 700;
  cursor: pointer;
}

.hub-admin-remove-btn {
  background: rgba(127, 35, 35, 0.18);
  border-color: rgba(198, 108, 108, 0.24);
}

.hub-admin-remove-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.hub-admin-user-btn {
  width: 100%;
  text-align: left;
  background: #0f3b2d;
  color: var(--text);
  border: 1px solid #2a6a56;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.hub-admin-user-btn.is-active {
  background: linear-gradient(180deg, #f2d78b 0%, #d3a747 65%, #a97823 100%);
  color: #13281d;
  border-color: rgba(255, 237, 183, 0.22);
}

.hub-permission-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  background: rgba(15, 59, 45, 0.9);
  border: 1px solid rgba(42, 106, 86, 0.9);
  border-radius: 16px;
  padding: 14px 16px;
}

.hub-permission-copy {
  display: grid;
  gap: 4px;
}

.hub-permission-title {
  font-size: 15px;
  font-weight: 700;
  color: #f8f3e4;
}

.hub-permission-desc {
  font-size: 13px;
  color: var(--muted);
}

.hub-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.hub-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.hub-switch-track {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  transition: background 160ms ease;
}

.hub-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #f5f1df;
  transition: transform 160ms ease;
}

.hub-switch input:checked + .hub-switch-track {
  background: rgba(216, 178, 90, 0.3);
  border-color: rgba(216, 178, 90, 0.3);
}

.hub-switch input:checked + .hub-switch-track::after {
  transform: translateX(20px);
  background: #e4bf68;
}

.hub-switch-label {
  font-size: 13px;
  color: var(--muted);
  min-width: 74px;
  text-align: right;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.hub-tile {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  min-height: 286px;
  padding: 30px 34px 28px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 78% 16%, rgba(255, 255, 255, 0.03), transparent 14%),
    var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hub-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(245, 220, 156, 0.46),
    rgba(214, 173, 82, 0.1) 28%,
    rgba(255, 255, 255, 0.04) 56%,
    rgba(245, 220, 156, 0.18)
  );
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.hub-tile::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.hub-tile-top {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.hub-tile-mark {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: #ddb865;
  filter:
    drop-shadow(0 2px 8px rgba(216, 178, 90, 0.22))
    drop-shadow(0 0 10px rgba(255, 227, 149, 0.06));
}

.hub-tile-mark::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 235, 183, 0.12), rgba(255, 235, 183, 0.02) 60%, transparent 72%);
  pointer-events: none;
}

.hub-main-svg {
  width: 56px;
  height: 56px;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(255, 244, 205, 0.1));
}

.hub-tile-content {
  display: grid;
  gap: 10px;
  max-width: 60%;
  position: relative;
  z-index: 1;
}

.hub-tile-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.12;
  font-weight: 750;
  color: #f8f3e4;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.hub-tile-description {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--muted);
}

.hub-tile-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.hub-tile-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  color: #13281d;
  background: linear-gradient(180deg, #f2d78b 0%, #d3a747 65%, #a97823 100%);
  border: 1px solid rgba(255, 237, 183, 0.22);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.hub-tile-button.is-disabled {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(244, 246, 239, 0.7);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  cursor: not-allowed;
}

.hub-tile-button.is-disabled::before {
  display: none;
}

.hub-tile-button::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 1px;
  height: 45%;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.02));
  pointer-events: none;
}

.hub-arrow {
  font-size: 20px;
  line-height: 1;
  transform: translateY(-1px);
}

.hub-tile-ghost {
  position: absolute;
  right: 18px;
  bottom: 16px;
  width: 168px;
  height: 168px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(223, 232, 225, 0.052);
  pointer-events: none;
}

.hub-ghost-svg {
  width: 100%;
  height: 100%;
  display: block;
}

@media (max-width: 900px) {
  .hub-header-row,
  .hub-toolbar,
  .hub-admin-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .hub-admin-grid {
    display: grid;
  }

  .hub-stock-grid {
    grid-template-columns: 1fr;
  }

  .hub-admin-user-actions {
    grid-template-columns: 1fr;
  }

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

  .hub-tile {
    min-height: 240px;
    padding: 22px 22px 20px;
    border-radius: 22px;
  }

  .hub-tile-ghost {
    width: 110px;
    height: 110px;
    right: 16px;
    bottom: 18px;
  }

  .hub-tile-content {
    max-width: 72%;
  }
}

@media (max-width: 640px) {
  .hub-shell {
    width: min(100vw - 20px, 1240px);
    margin: 12px auto 24px;
  }

  .hub-brand-title {
    font-size: 21px;
  }

  .hub-admin-panel {
    margin-inline: 0;
    padding: 14px;
  }

  .hub-tile-title {
    font-size: 20px;
  }

  .hub-tile-content {
    max-width: 100%;
  }

  .hub-tile-button {
    width: 100%;
    justify-content: space-between;
  }
}
