:root {
  --utmi-role-admin: #206bc4;
  --utmi-role-ranking: #f59f00;
  --utmi-role-alumni: #d63384;
  --utmi-role-admin-alt: #2fb344;
  --utmi-role-ranking-alt: #f76707;
  --utmi-role-alumni-alt: #0ca678;
}

body[data-role="admin"] {
  --utmi-accent: var(--utmi-role-admin);
  --utmi-accent-alt: var(--utmi-role-admin-alt);
}

body[data-role="ranking"] {
  --utmi-accent: var(--utmi-role-ranking);
  --utmi-accent-alt: var(--utmi-role-ranking-alt);
}

body[data-role="alumni"] {
  --utmi-accent: var(--utmi-role-alumni);
  --utmi-accent-alt: var(--utmi-role-alumni-alt);
}

body.layout-fluid {
  background: var(--tblr-bg-surface);
}

.page {
  min-height: 100vh;
}

.navbar-vertical {
  border-right: 1px solid var(--tblr-border-color);
}

.brand-wrap {
  padding: .75rem 0 .25rem;
}

.nav-title {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--tblr-secondary);
  font-weight: 700;
  padding: .5rem .75rem;
}

.navbar-vertical .nav-link {
  border-radius: var(--tblr-border-radius);
  margin-bottom: .2rem;
}

.navbar-vertical .nav-link.active {
  background: color-mix(in srgb, var(--tblr-primary) 12%, transparent);
}

/* ── Sidebar user area (OpenWebUI/ChatGPT style) ── */

.sidebar-user-area {
  border-top: 1px solid var(--tblr-border-color-translucent);
  padding: .75rem .5rem;
}

.sidebar-user-btn {
  background: transparent;
  color: var(--tblr-text-light);
  transition: background .15s ease;
  cursor: pointer;
}

.sidebar-user-btn:hover {
  background: rgba(255, 255, 255, .08);
  color: var(--tblr-text-light);
}

.sidebar-user-avatar {
  width: 35px;
  height: 35px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, .15);
}

.sidebar-user-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: var(--tblr-primary);
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}

.sidebar-user-info {
  min-width: 0;
}

.sidebar-user-name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--tblr-text-light);
  line-height: 1.2;
}

.sidebar-user-subtitle {
  font-size: .7rem;
  color: var(--tblr-secondary);
  line-height: 1.2;
}

.sidebar-linkedin-icon {
  color: #0A66C2;
}

.sidebar-login-btn {
  background: #0A66C2;
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
  transition: background .15s ease;
}

.sidebar-login-btn:hover {
  background: #004182;
  color: #fff;
}

.sidebar-status {
  font-size: .7rem;
  color: var(--tblr-secondary);
  padding-top: .5rem;
}

.page-header {
  border-bottom: 1px solid var(--tblr-border-color-translucent);
  background: var(--tblr-bg-surface);
}

.page-pretitle {
  letter-spacing: .04em;
}

.page-body {
  padding-top: 1rem;
}

.hero-card {
  position: relative;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--utmi-accent) 40%, var(--tblr-border-color));
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--utmi-accent) 20%, transparent);
}

.hero-card .hero-content {
  position: relative;
  z-index: 2;
}

.status-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: #2fb344;
  margin-right: 0.35rem;
}

.chart-placeholder {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--tblr-border-color);
  border-radius: var(--tblr-border-radius);
  color: var(--tblr-secondary);
  background: color-mix(in srgb, var(--tblr-bg-surface-secondary) 65%, transparent);
}

.card {
  box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .03);
}

.kpi-color {
  position: relative;
  overflow: hidden;
  border-left: 3px solid var(--utmi-accent);
}

.kpi-color::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, color-mix(in srgb, var(--utmi-accent) 8%, transparent), transparent 55%);
  pointer-events: none;
}

.kpi-color .kpi-value {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--utmi-accent);
}

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

.proto-tile {
  border: 1px solid var(--tblr-border-color);
  border-radius: var(--tblr-border-radius-lg);
  padding: 1rem;
  background: var(--tblr-bg-surface);
}

.proto-tile .tile-label {
  font-size: .72rem;
  text-transform: uppercase;
  color: var(--tblr-secondary);
  letter-spacing: .05em;
  margin-bottom: .3rem;
}

.proto-tile .tile-value {
  font-size: 1.35rem;
  font-weight: 700;
}

.progress-rich {
  height: .55rem;
  background: color-mix(in srgb, var(--utmi-accent) 10%, var(--tblr-bg-surface-secondary));
  border-radius: 999px;
  overflow: hidden;
}

.progress-rich > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--utmi-accent), var(--utmi-accent-alt));
}

.feed-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feed-list li {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  border-bottom: 1px solid var(--tblr-border-color-translucent);
  padding: .55rem 0;
}

.feed-list li:last-child {
  border-bottom: 0;
}

.feed-dot {
  width: .55rem;
  height: .55rem;
  border-radius: 999px;
  margin-top: .4rem;
  background: var(--utmi-accent);
  box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--utmi-accent) 22%, transparent);
}

.benchmark-row {
  display: grid;
  grid-template-columns: 160px 1fr 50px;
  gap: .65rem;
  align-items: center;
  margin-bottom: .65rem;
}

.benchmark-row .name {
  color: var(--tblr-secondary);
  font-size: .85rem;
}

.benchmark-row .val {
  text-align: right;
  font-size: .85rem;
  font-weight: 700;
  color: var(--utmi-accent);
}

.card-table thead th {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.table td,
.table th {
  vertical-align: middle;
}

.metric-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid var(--tblr-border-color);
  border-radius: 999px;
  font-size: .75rem;
  padding: .1rem .55rem;
  color: var(--tblr-secondary);
}

.kpi-trend-up {
  color: var(--tblr-success);
}

.kpi-trend-down {
  color: var(--tblr-danger);
}

/* ── x-cloak: prevent Alpine flash before hydration ── */
[x-cloak] {
  display: none !important;
}

/* ── Mobile sidebar: prevent body scroll when open ── */
@media (max-width: 1023px) {
  body.mobile-nav-open {
    overflow: hidden;
  }
}

/* Sidebar Hover / Active states refinements */
.nav-link-custom {
  @apply flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-colors cursor-pointer;
}

/* Backdrop blur transition */
#sidebarBackdrop {
  transition: opacity 0.3s ease, visibility 0.3s ease, backdrop-filter 0.3s ease;
}

/* ── Responsive tweaks ── */
@media (max-width: 639px) {
  .kpi-color .kpi-value {
    font-size: 1.25rem;
  }
}

/* ── Sidebar layout states ── */
#sidebarPanel {
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
}
body.mobile-nav-open #sidebarPanel {
  transform: translateX(0) !important;
}

@media (min-width: 1024px) {
  body:not([data-role="claim"]):not([data-role="portal"]) {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    overflow-x: hidden;
  }

  #sidebarPanel {
    position: relative !important;
    top: auto;
    bottom: auto;
    left: auto !important;
    height: 100vh;
    transform: none !important;
    flex-shrink: 0;
    margin-left: 0;
    transition: margin-left 0.3s ease-in-out;
  }

  body.desktop-nav-collapsed #sidebarPanel {
    margin-left: -16rem !important;
  }
}

/* ── Main content layout states ── */
#mainContent {
  margin-left: 0;
}
@media (min-width: 1024px) {
  #mainContent {
    margin-left: 0 !important;
    flex: 1;
    min-width: 0;
  }
}

/* ── Light Sidebar Theme overrides ── */
#sidebarPanel {
  background-color: #f8f9fa !important; /* light grey background */
  color: #495057 !important;
  border-right: 1px solid #e9ecef !important;
}

/* Border separators */
#sidebarPanel .border-b,
#sidebarPanel .border-t {
  border-color: #e9ecef !important;
}

/* Logo brand text */
#sidebarPanel span.text-white {
  color: #212529 !important;
}
#sidebarPanel span.text-gray-400 {
  color: #6c757d !important;
}

/* Switcher / section headers */
#sidebarPanel div.text-gray-500 {
  color: #8c9096 !important;
}

/* Close button (mobile) */
#sidebarPanel button.lg\:hidden {
  color: #6c757d !important;
}
#sidebarPanel button.lg\:hidden:hover {
  color: #212529 !important;
}

/* Inactive nav links */
#sidebarPanel nav a:not(.border-\[\#800000\]):not(.bg-\[\#800000\]\/10) {
  color: #495057 !important;
}
#sidebarPanel nav a:not(.border-\[\#800000\]):not(.bg-\[\#800000\]\/10):hover {
  background-color: #e9ecef !important;
  color: #212529 !important;
}

/* Active role switcher links */
#sidebarPanel nav a.border-\[\#800000\] {
  background-color: rgba(128, 0, 0, 0.06) !important;
  color: #800000 !important;
}

/* Active section links */
#sidebarPanel nav a.bg-\[\#800000\]\/10 {
  background-color: rgba(128, 0, 0, 0.06) !important;
  color: #800000 !important;
}

/* Inactive section links text */
#sidebarPanel nav a.text-gray-400 {
  color: #6c757d !important;
}
#sidebarPanel nav a.text-gray-400:hover {
  background-color: #e9ecef !important;
  color: #212529 !important;
}

/* Inactive dots */
#sidebarPanel nav a span.bg-gray-600 {
  background-color: #ced4da !important;
}

/* User profile section */
#sidebarPanel [x-data="{ open: false }"] > button {
  color: #495057 !important;
}
#sidebarPanel [x-data="{ open: false }"] > button:hover {
  background-color: #e9ecef !important;
}
#sidebarPanel [x-data="{ open: false }"] > button .text-white {
  color: #212529 !important;
}
#sidebarPanel [x-data="{ open: false }"] > button .text-gray-400 {
  color: #6c757d !important;
}
#sidebarPanel [x-data="{ open: false }"] > button img {
  border-color: #ced4da !important;
}

/* Backend status indicator */
#sidebarPanel div.text-xs.text-gray-500 {
  color: #6c757d !important;
}

