:root {
  color-scheme: dark;
  --bg: #0b1020;
  --panel: #121a2c;
  --panel-hover: #182239;
  --border: #27334a;
  --text: #f5f6fb;
  --muted: #98a5ba;
  --gold: #d9b779;
  --gold-soft: #f0d8a6;
  --green: #5ed5a1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: 248px;
  padding: 27px 17px 18px;
  background: #0e1526;
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 31px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex: 0 0 43px;
  width: 43px;
  height: 43px;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 13px;
  color: var(--gold);
  font: 28px Georgia, serif;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.brand-copy strong {
  font-size: 12px;
  letter-spacing: 1.6px;
}

.brand-copy small {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 1px;
}

.workspace-label {
  padding: 0 11px 12px;
  color: #78859b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.7px;
}

.navigation {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 13px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #a7b2c5;
  text-align: left;
  cursor: pointer;
  transition: 0.2s ease;
}

.nav-item:hover {
  background: var(--panel-hover);
  color: var(--text);
}

.nav-item.active {
  border-color: #51462f;
  background: #272419;
  color: var(--gold-soft);
}

.nav-icon {
  display: grid;
  width: 22px;
  place-items: center;
  font-size: 20px;
}

.sidebar-bottom {
  margin-top: auto;
}

.sidebar-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #121a2a;
}

.sidebar-note strong,
.sidebar-note small {
  display: block;
}

.sidebar-note strong {
  font-size: 11px;
}

.sidebar-note small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.status-dot {
  display: inline-block;
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.sidebar-version {
  padding: 17px 5px 0;
  color: #78859b;
  font-size: 9px;
  letter-spacing: 1px;
}

.main-area {
  min-height: 100vh;
  margin-left: 248px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 35px;
  border-bottom: 1px solid var(--border);
  background: #0b1020ee;
  backdrop-filter: blur(16px);
}

.breadcrumb,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.breadcrumb {
  color: var(--muted);
  font-size: 12px;
}

.breadcrumb strong {
  color: var(--text);
}

.breadcrumb-separator {
  color: #59657b;
}

.topbar-right {
  gap: 18px;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #6c5a3c;
  border-radius: 50%;
  background: #2b261c;
  color: var(--gold-soft);
  font-size: 11px;
  font-weight: 700;
}

.icon-button {
  display: none;
  width: 39px;
  height: 39px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  cursor: pointer;
}

.page-content {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 38px 35px 24px;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.eyebrow,
.welcome-label {
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.8px;
}

.page-heading h1 {
  margin: 10px 0 8px;
  font-size: clamp(27px, 3vw, 36px);
  letter-spacing: -1.2px;
}

.page-description {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.heading-decoration {
  display: grid;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid #5b4b33;
  border-radius: 17px;
  color: var(--gold);
  font: 34px Georgia, serif;
}

.welcome-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 240px;
  overflow: hidden;
  padding: 35px;
  border: 1px solid #3a3b42;
  border-radius: 20px;
  background:
    radial-gradient(circle at 85% 45%, #4b402a66, transparent 30%),
    linear-gradient(120deg, #1a2234, #171c29);
}

.welcome-copy {
  position: relative;
  z-index: 1;
  max-width: 560px;
}

.welcome-copy h2 {
  margin: 17px 0 12px;
  font: 36px/1.2 Georgia, serif;
  letter-spacing: -0.6px;
}

.welcome-copy p {
  max-width: 440px;
  margin: 0;
  color: #abb5c6;
  line-height: 1.8;
}

.welcome-emblem {
  display: grid;
  flex: 0 0 145px;
  width: 145px;
  height: 145px;
  place-items: center;
  border: 1px solid #a28b5a;
  border-radius: 50%;
  color: #d9b779;
  font: 90px Georgia, serif;
  box-shadow: 0 0 0 12px #d9b7790a, inset 0 0 30px #d9b77912;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 34px 0 17px;
}

.section-heading h2 {
  margin: 0;
  font-size: 17px;
}

.section-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.module-card {
  display: flex;
  min-height: 200px;
  flex-direction: column;
  align-items: flex-start;
  padding: 21px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--panel);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}

.module-card:hover {
  transform: translateY(-3px);
  border-color: #806b45;
  background: var(--panel-hover);
}

.module-symbol {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid #55472f;
  border-radius: 12px;
  background: #282419;
  color: var(--gold);
  font-size: 23px;
}

.module-title {
  margin-top: 18px;
  font-weight: 700;
}

.module-description {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.module-link {
  margin-top: auto;
  padding-top: 17px;
  color: var(--gold-soft);
  font-size: 11px;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 38px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: #77839a;
  font-size: 10px;
}

.sidebar-overlay {
  display: none;
}

@media (max-width: 1100px) {
  .page-content {
    padding-right: 25px;
    padding-left: 25px;
  }

  .topbar {
    padding-right: 25px;
    padding-left: 25px;
  }

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

@media (max-width: 700px) {
  .sidebar {
    width: 270px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 20px 0 60px #0005;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.visible {
    position: fixed;
    inset: 0;
    z-index: 15;
    display: block;
    background: #030712a8;
  }

  .main-area {
    margin-left: 0;
  }

  .topbar {
    min-height: 64px;
    gap: 12px;
    padding: 0 16px;
  }

  .menu-toggle {
    display: grid;
    flex: 0 0 39px;
    place-items: center;
  }

  .breadcrumb {
    flex: 1;
    gap: 7px;
    font-size: 11px;
  }

  .topbar-right {
    gap: 0;
  }

  .live-indicator {
    display: none;
  }

  .avatar {
    width: 33px;
    height: 33px;
  }

  .page-content {
    padding: 27px 17px 22px;
  }

  .page-heading {
    margin-bottom: 23px;
  }

  .heading-decoration {
    flex-basis: 43px;
    width: 43px;
    height: 43px;
    border-radius: 13px;
    font-size: 26px;
  }

  .welcome-panel {
    min-height: 0;
    padding: 25px 21px;
  }

  .welcome-copy h2 {
    font-size: 27px;
  }

  .welcome-copy p {
    font-size: 12px;
  }

  .welcome-emblem {
    display: none;
  }

  .module-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .module-card {
    min-height: 170px;
    padding: 19px;
  }

  .page-footer {
    flex-direction: column;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Super Admin Login */

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 24px;
  background:
    radial-gradient(circle at top, #202b45 0, transparent 48%),
    var(--bg);
}

.login-screen[hidden] {
  display: none;
}

.login-card {
  width: 100%;
  max-width: 430px;
  padding: 32px 26px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 24px 70px #0005;
}

.login-brand {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  margin: 0 auto 22px;
  border: 1px solid var(--gold);
  border-radius: 17px;
  color: var(--gold);
  font: 36px Georgia, serif;
}

.login-card .eyebrow {
  text-align: center;
  line-height: 1.8;
}

.login-card h1 {
  margin: 12px 0;
  font-size: 30px;
  text-align: center;
}

.login-description {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.7;
  text-align: center;
}

.login-card label {
  display: block;
  margin: 18px 0 8px;
  color: #dce2ee;
  font-size: 12px;
  font-weight: 600;
}

.login-card input {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: #0b1020;
  color: var(--text);
  font: inherit;
}

.login-card input:focus {
  border-color: var(--gold);
}

.login-submit {
  width: 100%;
  min-height: 47px;
  margin-top: 24px;
  border: 1px solid var(--gold);
  border-radius: 10px;
  background: var(--gold);
  color: #171717;
  font-weight: 700;
  cursor: pointer;
}

.login-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.login-error {
  margin: 16px 0 0;
  padding: 11px;
  border: 1px solid #7f3b49;
  border-radius: 9px;
  background: #351a27;
  color: #ffb7c3;
  font-size: 12px;
  line-height: 1.6;
}

.login-footer {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
