:root {
  --wingman-brown: #351C15;
  --wingman-gold: #FFC107;
  --wingman-border: rgba(255, 255, 255, 0.08);
  --wingman-border-strong: rgba(255, 255, 255, 0.12);
  --wingman-panel: rgba(255, 255, 255, 0.05);
  --wingman-muted: #94a3b8;
  --wingman-text: #e2e8f0;
}

html,
body.portal-shell-page {
  height: 100%;
}

body.portal-shell-page {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  padding: 0;
  display: flex;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 6%, rgba(255, 193, 7, 0.08), transparent 30rem),
    linear-gradient(180deg, var(--wingman-brown) 0%, #21110d 58%, #050505 100%);
  color: var(--wingman-text);
  -webkit-font-smoothing: antialiased;
}

body.portal-login-page {
  display: block;
  overflow: auto;
}

body.portal-shell-page::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent 70%);
}

body.portal-login-page .app-sidebar,
body.portal-login-page .mobile-header {
  display: none;
}

.mobile-header {
  display: none;
}

.mobile-sidebar-backdrop {
  display: none;
}

.app-sidebar {
  width: 16rem;
  height: 100vh;
  flex: 0 0 16rem;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 5;
  background: rgba(0, 0, 0, 0.2);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(24px);
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.portal-brand-mark {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 193, 7, 0.12);
  border: 1px solid rgba(255, 193, 7, 0.25);
  color: var(--wingman-gold);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  box-shadow: 0 0 28px rgba(255, 193, 7, 0.12);
}

.portal-brand-wordmark {
  color: #ffffff;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
  margin-top: 1px;
}

.sidebar-logo {
  height: 5rem;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  text-decoration: none;
  margin-bottom: 1rem;
}

.sidebar-logo .portal-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  font-size: 0.88rem;
}

.sidebar-logo .portal-brand-wordmark {
  font-size: 1.02rem;
}

.sidebar-nav {
  flex: 1;
  padding: 0 1rem 1.5rem;
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 1.5rem;
}

.sidebar-heading {
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.68rem 0.75rem;
  border-radius: 0.75rem;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s;
}

.sidebar-link iconify-icon {
  color: #64748b;
  transition: color 0.2s;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.sidebar-link:hover iconify-icon {
  color: #cbd5e1;
}

.sidebar-link.active {
  background: rgba(255, 193, 7, 0.1);
  color: var(--wingman-gold);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.sidebar-link.active iconify-icon {
  color: var(--wingman-gold);
}

.sidebar-user {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-user-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.5rem;
  border-radius: 0.75rem;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.2s;
}

.sidebar-user-link:hover {
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 193, 7, 0.18);
  border: 1px solid rgba(255, 193, 7, 0.3);
  color: var(--wingman-gold);
  font-size: 0.82rem;
  font-weight: 600;
  flex: 0 0 auto;
}

.sidebar-user-copy {
  min-width: 0;
  flex: 1;
}

.sidebar-user-name,
.sidebar-user-role {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-name {
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
}

.sidebar-user-role {
  color: #64748b;
  font-size: 0.75rem;
}

body.portal-shell-page > .container {
  position: relative;
  z-index: 1;
  flex: 1;
  height: 100vh;
  max-width: none;
  margin: 0;
  padding: 2.5rem;
  overflow-y: auto;
}

body.portal-shell-page > .container::before {
  content: '';
  position: fixed;
  top: 0;
  right: 0;
  width: 500px;
  height: 500px;
  border-radius: 999px;
  background: rgba(255, 193, 7, 0.06);
  filter: blur(120px);
  pointer-events: none;
}

body.portal-shell-page .header {
  margin: 0 auto 2rem;
  max-width: 64rem;
  padding: 0;
  border-bottom: 0;
}

body.portal-shell-page .header h1 {
  color: #ffffff;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.035em;
}

body.portal-shell-page .card,
body.portal-shell-page .panel,
body.portal-shell-page .form-section,
body.portal-shell-page .modal-content,
body.portal-shell-page .dashboard-card,
body.portal-shell-page .menu-card {
  background: var(--wingman-panel);
  border: 1px solid var(--wingman-border-strong);
  border-radius: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px);
}

body.portal-shell-page .card {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

body.portal-shell-page .card h2,
body.portal-shell-page h2,
body.portal-shell-page h3 {
  color: #ffffff;
}

body.portal-shell-page input[type='text'],
body.portal-shell-page input[type='email'],
body.portal-shell-page input[type='tel'],
body.portal-shell-page input[type='number'],
body.portal-shell-page input[type='password'],
body.portal-shell-page input[type='file'],
body.portal-shell-page textarea,
body.portal-shell-page select {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  color: #ffffff;
  outline: none;
}

body.portal-shell-page input:focus,
body.portal-shell-page textarea:focus,
body.portal-shell-page select:focus {
  border-color: rgba(255, 193, 7, 0.55);
  box-shadow: 0 0 0 1px rgba(255, 193, 7, 0.35);
}

body.portal-shell-page input::placeholder,
body.portal-shell-page textarea::placeholder {
  color: #64748b;
}

body.portal-shell-page .btn,
body.portal-shell-page button {
  font-family: inherit;
}

body.portal-shell-page .btn-primary {
  background: var(--wingman-gold);
  color: var(--wingman-brown);
  box-shadow: 0 0 18px rgba(255, 193, 7, 0.16);
}

body.portal-shell-page .btn-primary:hover {
  background: #ffd24a;
}

body.portal-shell-page .btn-secondary,
body.portal-shell-page .btn-add {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

body.portal-shell-page table {
  border-collapse: collapse;
}

body.portal-shell-page th {
  color: #64748b;
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

body.portal-shell-page td {
  color: #cbd5e1;
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
  body.portal-shell-page {
    display: block;
    overflow: auto;
  }

  body.portal-shell-page .app-sidebar {
    display: none;
  }

  body.portal-shell-page.mobile-sidebar-open {
    overflow: hidden;
  }

  body.portal-shell-page.mobile-sidebar-open .app-sidebar {
    position: fixed;
    top: 4rem;
    left: 0;
    bottom: 0;
    width: min(20rem, 86vw);
    height: auto;
    display: flex;
    z-index: 45;
    transform: translateX(0);
    box-shadow: 10px 0 26px rgba(0, 0, 0, 0.36);
  }

  body.portal-shell-page .mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4rem;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    background: rgba(53, 28, 21, 0.82);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(22px);
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
  }

  .mobile-brand .portal-brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-size: 0.84rem;
  }

  .mobile-brand .portal-brand-wordmark {
    font-size: 1rem;
  }

  .mobile-menu-button {
    color: #94a3b8;
    background: transparent;
    border: 0;
    cursor: pointer;
  }

  .mobile-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 4rem 0 0 0;
    z-index: 40;
    border: 0;
    width: 100%;
    padding: 0;
    background: rgba(0, 0, 0, 0.48);
    cursor: pointer;
  }

  body.portal-shell-page.mobile-sidebar-open .mobile-sidebar-backdrop {
    display: block;
  }

  body.portal-shell-page > .container {
    height: auto;
    min-height: 100vh;
    padding: 5.5rem 1rem 2rem;
    overflow: visible;
  }
}
