:root {
  --primary: #f4c54a;
  --primaryDark: #b48825;
  --darkBg: #241e3a;
  --darkDeep: #0f0b2b;
  --lightBg: #f4ecce;
  --lightGold: #f8f1d4;
  --brown: #5b4633;
  --text: rgba(15, 11, 43, 0.92);
  --muted: rgba(91, 70, 51, 0.78);
  --border: rgba(244, 197, 74, 0.30);
  --surface: var(--lightGold);
  --surface2: rgba(244, 197, 74, 0.10);
  --shadow-sm: 0 10px 30px rgba(15, 11, 43, 0.08);
  --shadow-md: 0 16px 50px rgba(15, 11, 43, 0.12);
  --radius: 18px;
  --ring: 0 0 0 3px rgba(244, 197, 74, 0.35);
  --appBg: #eef2f3;
  --gold-border: linear-gradient(135deg, rgba(244, 197, 74, 0.65), rgba(180, 136, 37, 0.55), rgba(244, 197, 74, 0.35));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  background: var(--appBg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-weight: 600;
  letter-spacing: -0.01em;
}

a {
  color: var(--primaryDark);
  text-decoration: none;
  transition: color 200ms ease, opacity 200ms ease;
}

a:hover {
  color: var(--primary);
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 10px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  background: radial-gradient(circle at 20% 20%, rgba(244, 197, 74, 0.08), transparent 35%), linear-gradient(180deg, rgba(244, 197, 74, 0.04), transparent), var(--appBg);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 280px;
  background: linear-gradient(180deg, rgba(15, 11, 43, 0.96), rgba(36, 30, 58, 0.95));
  color: var(--lightGold);
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 16px;
  box-shadow: var(--shadow-md);
  z-index: 40;
  transform: translateX(0);
  transition: transform 220ms ease;
  height: 100vh;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 6px 4px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: transparent;
  display: grid;
  place-items: center;
  box-shadow: none;
}

.sidebar-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar-title {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 150px;
}

.sidebar-title img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.sidebar-full-logo {
  height: 46px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
}

.auth-top-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  object-fit: contain;
  box-shadow: var(--shadow-sm);
}

.auth-top-icon + h2,
.auth-top-icon + h3 {
  margin-top: 4px;
}

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

.nav-section {
  display: grid;
  gap: 8px;
}

.nav-label,
.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  opacity: 0.65;
  padding: 0 10px;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid transparent;
  font-weight: 500;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-link svg {
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.8);
}

.nav-link:hover {
  --gold-surface: rgba(244, 197, 74, 0.22);
  background: linear-gradient(var(--gold-surface), var(--gold-surface)) padding-box, var(--gold-border) border-box;
  border: 1px solid transparent;
  transform: translateX(2px);
}

.nav-link-active {
  --gold-surface: rgba(244, 197, 74, 0.18);
  background: linear-gradient(var(--gold-surface), var(--gold-surface)) padding-box, var(--gold-border) border-box;
  border: 1px solid transparent;
  color: #fff;
  position: relative;
}

.nav-link-active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 10%;
  bottom: 10%;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(244, 197, 74, 0.8), rgba(180, 136, 37, 0.8));
}

.sidebar-footer {
  padding: 12px;
  margin-top: 30px;
  border-radius: 14px;
  --gold-surface: rgba(255, 255, 255, 0.06);
  background: linear-gradient(var(--gold-surface), var(--gold-surface)) padding-box, var(--gold-border) border-box;
  border: 1px solid transparent;
  display: grid;
  gap: 10px;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  max-height: calc(100vh - 110px);
  padding-bottom: 12px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(244, 197, 74, 0.35) rgba(255, 255, 255, 0.08);
}

.sidebar-scroll::-webkit-scrollbar {
  width: 10px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(244, 197, 74, 0.25);
  border-radius: 999px;
  border: 3px solid rgba(15, 11, 43, 0.6);
}

.sidebar-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(244, 197, 74, 0.45);
}

.sidebar-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(244, 197, 74, 0.20);
  display: grid;
  place-items: center;
  font-weight: 600;
  color: #fff;
}

.sidebar-user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  min-width: 0;
}

.sidebar-user-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.sidebar-links {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.sidebar-links a {
  color: rgba(255, 255, 255, 0.88);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sidebar-links a:hover {
  color: var(--primary);
}

.sidebar-actions {
  display: flex;
  gap: 8px;
}

.sidebar-actions form {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
}

.sidebar-actions button {
  flex: 0 0 auto;
  width: 100%;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 11, 43, 0.45);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 30;
}

.overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.main {
  grid-column: 2 / 3;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 80% 20%, rgba(244, 197, 74, 0.08), transparent 30%), linear-gradient(180deg, rgba(244, 197, 74, 0.04), transparent), var(--appBg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  background: rgba(248, 241, 212, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--darkDeep);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--darkDeep);
  box-shadow: var(--shadow-sm);
}

.content {
  padding: clamp(16px, 2vw, 32px);
  display: grid;
  gap: 16px;
}

.gold-border {
  border: 1px solid transparent;
  background: linear-gradient(var(--gold-surface, #fff), var(--gold-surface, #fff)) padding-box, var(--gold-border) border-box;
}

.card {
  --gold-surface: #fff;
  background: linear-gradient(var(--gold-surface), var(--gold-surface)) padding-box, var(--gold-border) border-box;
  border: 1px solid transparent;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.card-header {
  padding: 18px 20px 12px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--darkDeep);
}

.card-subtitle {
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 4px;
}

.muted {
  color: var(--muted);
  font-weight: 400;
}

.card-body {
  padding: 18px 20px 20px 20px;
  display: grid;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease, filter 150ms ease;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn:focus-visible {
  outline: 3px solid rgba(244, 197, 74, 0.35);
  outline-offset: 2px;
}

.btn:active {
  transform: translateY(1px);
  box-shadow: none;
  filter: brightness(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, rgba(244, 197, 74, 0.95), rgba(180, 136, 37, 0.95));
  color: var(--darkDeep);
  box-shadow: var(--shadow-sm);
  border-color: rgba(244, 197, 74, 0.50);
}

.btn-primary:hover {
  background: linear-gradient(135deg, rgba(244, 197, 74, 1), rgba(180, 136, 37, 1));
  transform: translateY(-1px);
}

.btn-primary:active {
  filter: brightness(0.95);
}

.btn-secondary {
  --gold-surface: #fff;
  background: linear-gradient(var(--gold-surface), var(--gold-surface)) padding-box, var(--gold-border) border-box;
  color: var(--darkBg);
  border: 1px solid transparent;
}

.btn-secondary:hover {
  --gold-surface: rgba(244, 197, 74, 0.08);
  background: linear-gradient(var(--gold-surface), var(--gold-surface)) padding-box, var(--gold-border) border-box;
}

.btn-ghost {
  background: transparent;
  color: var(--darkDeep);
  border-color: transparent;
}

.btn-ghost:hover {
  background: rgba(244, 197, 74, 0.18);
  border-color: rgba(244, 197, 74, 0.30);
}

.btn-danger {
  --gold-surface: rgba(180, 136, 37, 0.10);
  background: linear-gradient(var(--gold-surface), var(--gold-surface)) padding-box, var(--gold-border) border-box;
  color: var(--darkDeep);
  border: 1px solid transparent;
}

.btn-danger:hover {
  --gold-surface: rgba(180, 136, 37, 0.14);
  background: linear-gradient(var(--gold-surface), var(--gold-surface)) padding-box, var(--gold-border) border-box;
}

.form-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: var(--muted);
  font-size: 14px;
}

.form-help {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.form-error {
  margin-top: 6px;
  font-size: 13px;
  color: var(--darkDeep);
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  --gold-surface: #fff;
  border: 1px solid transparent;
  background: linear-gradient(var(--gold-surface), var(--gold-surface)) padding-box, var(--gold-border) border-box;
  color: var(--text);
  font-size: 14px;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.textarea {
  min-height: 110px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  box-shadow: var(--ring);
  outline: none;
}

.alert {
  background: #fff;
  --gold-surface: #fff;
  border: 1px solid transparent;
  background: linear-gradient(var(--gold-surface), var(--gold-surface)) padding-box, var(--gold-border) border-box;
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.alert::before {
  content: "";
  width: 4px;
  border-radius: 999px;
  background: rgba(244, 197, 74, 0.45);
  display: block;
  align-self: stretch;
}

.alert-icon {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.alert-title {
  font-weight: 600;
  color: var(--darkDeep);
}

.alert-text {
  font-weight: 500;
  line-height: 1.4;
  color: var(--brown);
}

.alert-success::before {
  background: rgba(34, 197, 94, 0.70);
}

.alert-success .alert-icon,
.alert-success .alert-text {
  color: rgb(34, 197, 94);
}

.alert-info::before {
  background: rgba(180, 136, 37, 0.75);
}

.alert-info .alert-icon,
.alert-info .alert-text {
  color: var(--primaryDark);
}

.alert-warning::before {
  background: rgba(244, 197, 74, 0.85);
}

.alert-warning .alert-icon,
.alert-warning .alert-text {
  color: var(--primary);
}

.alert-danger::before {
  background: rgba(180, 136, 37, 0.90);
}

.alert-danger .alert-icon,
.alert-danger .alert-text {
  color: var(--primaryDark);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 14px;
  --gold-surface: #fff;
  border: 1px solid transparent;
  background: linear-gradient(var(--gold-surface), var(--gold-surface)) padding-box, var(--gold-border) border-box;
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.table th,
.table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.table th {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(244, 197, 74, 0.10);
}

.table td {
  font-weight: 400;
}

.table tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(244, 197, 74, 0.20);
  color: var(--darkDeep);
  font-weight: 600;
  font-size: 12px;
  border: 1px solid rgba(244, 197, 74, 0.35);
}

.badge-soft {
  background: rgba(244, 197, 74, 0.12);
}

.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 10px 0;
}

.kpi-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.kpi-card {
  border-radius: var(--radius);
  --gold-surface: #fff;
  border: 1px solid transparent;
  background: linear-gradient(var(--gold-surface), var(--gold-surface)) padding-box, var(--gold-border) border-box;
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.kpi-card h4 {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.kpi-value {
  font-size: 28px;
  font-weight: 600;
  margin-top: 6px;
}

.empty-state {
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(244, 197, 74, 0.08);
  display: grid;
  gap: 8px;
  text-align: center;
  color: var(--muted);
}

.empty-state .icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(244, 197, 74, 0.18);
  color: var(--darkDeep);
  margin: 0 auto 6px auto;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  --gold-surface: rgba(244, 197, 74, 0.12);
  border: 1px solid transparent;
  background: linear-gradient(var(--gold-surface), var(--gold-surface)) padding-box, var(--gold-border) border-box;
  color: var(--darkDeep);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--primary);
}

.grid-2 {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid-3 {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.table-meta {
  font-size: 13px;
  color: var(--muted);
}

.overlay-card {
  --gold-surface: linear-gradient(135deg, rgba(244, 197, 74, 0.12), rgba(180, 136, 37, 0.12));
  background: linear-gradient(135deg, rgba(244, 197, 74, 0.12), rgba(180, 136, 37, 0.12)) padding-box, var(--gold-border) border-box;
  border: 1px solid transparent;
}

.help-card {
  display: grid;
  gap: 10px;
  --gold-surface: rgba(36, 30, 58, 0.08);
  background: linear-gradient(var(--gold-surface), var(--gold-surface)) padding-box, var(--gold-border) border-box;
  border: 1px solid transparent;
  color: var(--darkDeep);
}

.help-links {
  display: grid;
  gap: 8px;
}

.help-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--darkDeep);
}

.badge-muted {
  background: rgba(36, 30, 58, 0.12);
  color: var(--darkDeep);
}

.support-card {
  --gold-surface: #fff;
  background: linear-gradient(var(--gold-surface), var(--gold-surface)) padding-box, var(--gold-border) border-box;
  border: 1px solid transparent;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  display: grid;
  gap: 12px;
}

.support-card__header {
  display: grid;
  gap: 4px;
}

.support-card__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--darkDeep);
}

.support-card__subtitle {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}

.support-card__list {
  display: grid;
  gap: 0;
}

.support-card__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 14px;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.support-card__item + .support-card__item {
  border-top: 1px solid rgba(244, 197, 74, 0.16);
}

.support-card__item:hover {
  background: rgba(244, 197, 74, 0.12);
  box-shadow: inset 0 0 0 1px rgba(244, 197, 74, 0.30);
}

.support-card__icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(244, 197, 74, 0.10);
  color: var(--primaryDark);
  flex: 0 0 auto;
  transition: background 160ms ease;
}

.support-card__item:hover .support-card__icon {
  background: rgba(244, 197, 74, 0.20);
}

.support-card__icon-svg {
  width: 18px;
  height: 18px;
}

.support-card__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.support-card__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.support-card__value {
  font-size: 14px;
  font-weight: 500;
  color: var(--darkDeep);
  word-break: break-all;
}

.support-card__arrow {
  color: var(--primaryDark);
  opacity: 0.7;
  transition: opacity 160ms ease;
}

.support-card__arrow-svg {
  width: 16px;
  height: 16px;
}

.support-card__item:hover .support-card__arrow {
  opacity: 1;
}

.support-card__item:hover .support-card__value {
  text-decoration: underline;
  text-decoration-color: rgba(244, 197, 74, 0.45);
  text-underline-offset: 2px;
}

.table-title {
  font-weight: 600;
}

.label-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 1024px) {
  .sidebar-full-logo {
    height: 40px;
    max-width: 220px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    transform: translateX(-100%);
  }

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

  .main {
    grid-column: 1 / -1;
  }

  .hamburger {
    display: inline-flex;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 14px 16px;
  }

  .card-header,
  .card-body {
    padding: 16px;
  }

  .content {
    padding: 14px;
  }

  .table {
    min-width: 520px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .auth-top-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }

  .support-card {
    padding: 16px;
  }

  .support-card__item {
    padding: 12px 8px;
  }

  .support-card__arrow {
    display: none;
  }
}
