/* Radio Logs Brand Kit v2 - Login + Sidebar Navigation Refresh */

:root {
  --rl-navy-950: #06111f;
  --rl-navy-900: #0a1728;
  --rl-navy-850: #0e1d31;
  --rl-blue-600: #1472c4;
  --rl-blue-500: #2487dc;
  --rl-cyan-400: #22c7f2;
  --rl-card-border: rgba(148, 163, 184, .28);
}

/* Sidebar/nav concept */
.app-sidebar {
  background:
    radial-gradient(circle at 0% 0%, rgba(34, 199, 242, .16), transparent 18rem),
    linear-gradient(180deg, var(--rl-navy-900) 0%, var(--rl-navy-950) 100%) !important;
  border-right: 1px solid rgba(148, 163, 184, .22) !important;
  color: #eaf2fb !important;
  box-shadow: 18px 0 48px rgba(2, 6, 23, .12) !important;
}

.app-sidebar-brand {
  padding: 20px 18px 18px !important;
  border-bottom: 1px solid rgba(148, 163, 184, .18) !important;
}

.app-logo {
  display: flex !important;
  align-items: center !important;
  gap: 13px !important;
  color: #fff !important;
  text-decoration: none !important;
}

.app-logo-mark,
.rl-brand-mark {
  width: 46px !important;
  height: 46px !important;
  border-radius: 15px !important;
  background: url('/static/img/brand/radiologs-mark.svg') center/cover no-repeat !important;
  color: transparent !important;
  overflow: hidden !important;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.16) inset,
    0 14px 28px rgba(20, 114, 196, .34) !important;
  flex: 0 0 auto !important;
}

.app-logo-text strong {
  display: block !important;
  color: #fff !important;
  font-size: 17px !important;
  line-height: 1.05 !important;
  letter-spacing: -.035em !important;
}

.app-logo-text em {
  display: block !important;
  color: #a9bad0 !important;
  font-size: 12px !important;
  font-style: normal !important;
  margin-top: 4px !important;
}

.app-sidebar-nav {
  padding: 18px 14px !important;
}

.nav-section {
  margin-bottom: 22px !important;
}

.nav-section-label {
  color: #8fa3bb !important;
  font-size: 11px !important;
  letter-spacing: .12em !important;
  text-transform: uppercase !important;
  font-weight: 900 !important;
  padding: 0 10px 8px !important;
}

.app-nav-link {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  min-height: 44px !important;
  padding: 10px 12px !important;
  border-radius: 14px !important;
  color: #dbe8f5 !important;
  border: 1px solid transparent !important;
  text-decoration: none !important;
  font-weight: 800 !important;
  transition: background .16s ease, color .16s ease, transform .16s ease, border-color .16s ease !important;
}

.app-nav-link:hover {
  background: rgba(255,255,255,.07) !important;
  color: #fff !important;
  text-decoration: none !important;
  transform: translateX(2px) !important;
}

.app-nav-link.active,
.app-sidebar a.active,
.nav-active {
  background: linear-gradient(90deg, rgba(20,114,196,.98), rgba(20,114,196,.48)) !important;
  border-color: rgba(96, 165, 250, .55) !important;
  color: #fff !important;
  box-shadow: 0 12px 30px rgba(20,114,196,.22) !important;
}

.nav-icon {
  width: 24px !important;
  height: 24px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 8px !important;
  background: rgba(255,255,255,.09) !important;
  color: #bfdbfe !important;
  font-size: 14px !important;
  flex: 0 0 auto !important;
}

.app-nav-link.active .nav-icon,
.app-sidebar a.active .nav-icon,
.nav-active .nav-icon {
  background: rgba(255,255,255,.18) !important;
  color: #fff !important;
}

.app-sidebar-footer {
  padding: 14px !important;
  border-top: 1px solid rgba(148, 163, 184, .18) !important;
}

.user-card {
  background: rgba(255,255,255,.07) !important;
  border: 1px solid rgba(148, 163, 184, .22) !important;
  border-radius: 16px !important;
  padding: 13px !important;
  color: #fff !important;
  box-shadow: 0 18px 38px rgba(2, 6, 23, .18) !important;
}

.user-avatar {
  background: linear-gradient(135deg, #2563eb, #22c7f2) !important;
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .34) !important;
}

.user-card-text strong { color: #fff !important; }
.user-card-text em { color: #b7c7d9 !important; }

/* Topbar refinement to pair with premium sidebar */
.app-topbar {
  background: rgba(255,255,255,.9) !important;
  backdrop-filter: blur(16px) !important;
}
html[data-theme="dark"] .app-topbar {
  background: rgba(8,17,31,.92) !important;
}

/* Login page concept */
.app-shell.is-public .app-topbar {
  display: none !important;
}

.app-shell.is-public .page-wrap.app-content {
  max-width: none !important;
  padding: 0 !important;
  min-height: 100vh !important;
}

.rl-login-v2 {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(380px, .95fr) minmax(420px, 1.05fr);
  background:
    radial-gradient(circle at 20% 15%, rgba(34,199,242,.22), transparent 28rem),
    linear-gradient(135deg, #06111f 0%, #0b1d34 48%, #eef4fb 48%, #f8fafc 100%);
}

.rl-login-brand-panel {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(180deg, rgba(6,17,31,.30), rgba(6,17,31,.90)),
    radial-gradient(circle at 20% 20%, rgba(34,199,242,.30), transparent 22rem);
}

.rl-login-brand-panel::before {
  content: "";
  position: absolute;
  inset: auto -20% 10% -20%;
  height: 220px;
  opacity: .42;
  background:
    linear-gradient(90deg, transparent 0%, rgba(34,199,242,.8) 48%, transparent 100%),
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(255,255,255,.9) 19px 22px, transparent 23px 42px);
  mask-image: radial-gradient(ellipse at center, #000 0%, transparent 72%);
  transform: skewY(-5deg);
}

.rl-login-brand-content {
  position: relative;
  z-index: 2;
  max-width: 460px;
}

.rl-login-logo-mark {
  width: 92px;
  height: 92px;
  border-radius: 26px;
  background: url('/static/img/brand/radiologs-mark.svg') center/cover no-repeat;
  box-shadow: 0 24px 60px rgba(0,0,0,.28), 0 0 0 1px rgba(255,255,255,.20) inset;
  margin-bottom: 28px;
}

.rl-login-brand-title {
  margin: 0;
  font-size: clamp(40px, 5vw, 64px);
  line-height: .95;
  letter-spacing: -.06em;
  font-weight: 950;
}

.rl-login-brand-title span {
  color: var(--rl-cyan-400);
}

.rl-login-brand-copy {
  margin-top: 22px;
  color: #c9d8e8;
  font-size: 18px;
  line-height: 1.55;
  max-width: 420px;
}

.rl-login-bullets {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 12px;
  color: #eaf2fb;
  font-weight: 800;
}

.rl-login-bullets span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.rl-login-bullets span::before {
  content: "✓";
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(34, 197, 94, .18);
  color: #86efac;
  border: 1px solid rgba(134,239,172,.28);
}

.rl-login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.rl-login-card {
  width: min(100%, 460px);
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(148,163,184,.28);
  border-radius: 28px;
  box-shadow: 0 28px 80px rgba(15,23,42,.16);
  padding: 38px;
}

.rl-login-card h1 {
  margin: 0 0 8px;
  font-size: 32px;
  letter-spacing: -.05em;
  color: #0f172a;
}

.rl-login-card p {
  margin: 0 0 26px;
  color: #64748b;
  font-weight: 650;
}

.rl-form-field {
  margin-bottom: 16px;
}

.rl-form-field label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  color: #334155;
  font-weight: 900;
}

.rl-form-field input {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  padding: 11px 13px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 15px;
}

.rl-login-submit {
  width: 100%;
  justify-content: center;
  min-height: 48px;
  margin-top: 8px;
}

.rl-login-footer-brand {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid #e2e8f0;
  text-align: center;
  color: #64748b;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: 12px;
}

.rl-login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-weight: 750;
}

html[data-theme="dark"] .rl-login-v2 {
  background:
    radial-gradient(circle at 20% 15%, rgba(34,199,242,.22), transparent 28rem),
    linear-gradient(135deg, #06111f 0%, #0b1d34 52%, #08111f 100%);
}

html[data-theme="dark"] .rl-login-card {
  background: rgba(15,23,42,.94);
  border-color: rgba(148,163,184,.24);
  box-shadow: 0 28px 80px rgba(0,0,0,.35);
}

html[data-theme="dark"] .rl-login-card h1 { color: #f8fafc; }
html[data-theme="dark"] .rl-login-card p { color: #a8b4c5; }
html[data-theme="dark"] .rl-form-field label { color: #dbe7f3; }
html[data-theme="dark"] .rl-form-field input {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}
html[data-theme="dark"] .rl-login-footer-brand {
  border-top-color: #334155;
  color: #a8b4c5;
}

@media (max-width: 900px) {
  .rl-login-v2 { grid-template-columns: 1fr; }
  .rl-login-brand-panel { min-height: 360px; padding: 38px 28px; }
  .rl-login-form-panel { padding: 28px; }
}

/* Logout form reset for topbar */
.logout-form { margin: 0; display: inline-flex; }
.logout-form button { font: inherit; }

/* Sidebar contrast fix - Brand Kit v2 active file */

html[data-theme="light"] .app-sidebar {
  background: linear-gradient(180deg, #f8fafc 0%, #eef4fb 100%) !important;
  border-right: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .app-sidebar,
html[data-theme="light"] .app-sidebar * {
  opacity: 1 !important;
}

html[data-theme="light"] .app-sidebar-brand,
html[data-theme="light"] .app-sidebar-brand *,
html[data-theme="light"] .app-sidebar-nav,
html[data-theme="light"] .app-sidebar-nav *,
html[data-theme="light"] .app-sidebar-footer,
html[data-theme="light"] .app-sidebar-footer * {
  color: #0f172a !important;
}

html[data-theme="light"] .app-sidebar .nav-section-label,
html[data-theme="light"] .app-sidebar small,
html[data-theme="light"] .app-sidebar .muted {
  color: #64748b !important;
}

html[data-theme="light"] .app-sidebar a {
  color: #334155 !important;
}

html[data-theme="light"] .app-sidebar a.active {
  background: #dbeafe !important;
  color: #175cd3 !important;
  border-color: #bfdbfe !important;
}

html[data-theme="light"] .app-sidebar a.active * {
  color: #175cd3 !important;
}

html[data-theme="light"] .app-sidebar-footer {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

/* Brand Kit v2.1 - branded blue sidebar */

html[data-theme="light"] .app-sidebar {
  background:
    radial-gradient(circle at top left, rgba(59,130,246,.22), transparent 180px),
    linear-gradient(180deg, #0b2a4a 0%, #0d1b2a 100%) !important;
  border-right: 1px solid rgba(255,255,255,.14) !important;
  color: #eaf2ff !important;
}

html[data-theme="light"] .app-sidebar * {
  opacity: 1 !important;
}

html[data-theme="light"] .app-sidebar-brand,
html[data-theme="light"] .app-sidebar-brand *,
html[data-theme="light"] .app-sidebar-footer,
html[data-theme="light"] .app-sidebar-footer * {
  color: #ffffff !important;
}

html[data-theme="light"] .app-sidebar small,
html[data-theme="light"] .app-sidebar .nav-section-label,
html[data-theme="light"] .app-sidebar .sidebar-section-label {
  color: #9fb6d8 !important;
}

html[data-theme="light"] .app-sidebar a {
  color: #dbeafe !important;
}

html[data-theme="light"] .app-sidebar a:hover {
  background: rgba(255,255,255,.08) !important;
  color: #ffffff !important;
}

html[data-theme="light"] .app-sidebar a.active {
  background: linear-gradient(90deg, #1472c4, #0f4c81) !important;
  color: #ffffff !important;
  border-color: rgba(255,255,255,.18) !important;
  box-shadow: 0 10px 24px rgba(20, 114, 196, .28) !important;
}

html[data-theme="light"] .app-sidebar a.active * {
  color: #ffffff !important;
}

html[data-theme="light"] .app-sidebar .nav-icon {
  color: #bfdbfe !important;
}

html[data-theme="light"] .app-sidebar a.active .nav-icon {
  color: #ffffff !important;
}

html[data-theme="light"] .app-sidebar-footer {
  background: rgba(255,255,255,.08) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  border-radius: 14px !important;
}

html[data-theme="light"] .app-sidebar-footer small,
html[data-theme="light"] .app-sidebar-footer span {
  color: #dbeafe !important;
}

/* Keep the current dark mode consistent */
html[data-theme="dark"] .app-sidebar {
  background:
    radial-gradient(circle at top left, rgba(59,130,246,.18), transparent 180px),
    linear-gradient(180deg, #07111f 0%, #0b1220 100%) !important;
}

/* Brand Kit v2.2 - final readable navy sidebar */

html[data-theme="light"] .app-sidebar {
  background: linear-gradient(180deg, #08243d 0%, #071827 100%) !important;
  color: #f8fafc !important;
  border-right: 1px solid rgba(255,255,255,.12) !important;
}

html[data-theme="light"] .app-sidebar * {
  opacity: 1 !important;
}

html[data-theme="light"] .app-sidebar-brand,
html[data-theme="light"] .app-sidebar-brand *,
html[data-theme="light"] .app-sidebar .sidebar-brand-title,
html[data-theme="light"] .app-sidebar .sidebar-brand-subtitle {
  color: #ffffff !important;
}

html[data-theme="light"] .app-sidebar-nav a,
html[data-theme="light"] .app-sidebar-nav a *,
html[data-theme="light"] .app-sidebar a,
html[data-theme="light"] .app-sidebar a * {
  color: #dbeafe !important;
}

html[data-theme="light"] .app-sidebar-nav a:hover {
  background: rgba(255,255,255,.10) !important;
  color: #ffffff !important;
}

html[data-theme="light"] .app-sidebar-nav a.active,
html[data-theme="light"] .app-sidebar a.active {
  background: #eaf2ff !important;
  color: #08243d !important;
  border-color: rgba(255,255,255,.28) !important;
  box-shadow: 0 10px 24px rgba(0,0,0,.22) !important;
}

html[data-theme="light"] .app-sidebar-nav a.active *,
html[data-theme="light"] .app-sidebar a.active * {
  color: #08243d !important;
}

html[data-theme="light"] .app-sidebar .nav-section-label,
html[data-theme="light"] .app-sidebar .sidebar-section-label {
  color: #93c5fd !important;
  font-weight: 900 !important;
  letter-spacing: .12em !important;
}

html[data-theme="light"] .app-sidebar-footer {
  background: rgba(255,255,255,.10) !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  color: #ffffff !important;
}

html[data-theme="light"] .app-sidebar-footer *,
html[data-theme="light"] .app-sidebar-footer strong,
html[data-theme="light"] .app-sidebar-footer span,
html[data-theme="light"] .app-sidebar-footer small {
  color: #ffffff !important;
}

html[data-theme="light"] .app-sidebar-footer small {
  color: #bfdbfe !important;
}


/* Sidebar active item readability fix */
html[data-theme="light"] .app-sidebar-nav a.active,
html[data-theme="light"] .app-sidebar a.active,
html[data-theme="light"] .app-sidebar .nav-active {
  background: #dbeafe !important;
  color: #0f172a !important;
}

html[data-theme="light"] .app-sidebar-nav a.active *,
html[data-theme="light"] .app-sidebar a.active *,
html[data-theme="light"] .app-sidebar .nav-active * {
  color: #0f172a !important;
  opacity: 1 !important;
}

html[data-theme="light"] .app-sidebar-nav a.active .nav-icon,
html[data-theme="light"] .app-sidebar a.active .nav-icon {
  color: #2563eb !important;
}

/* FINAL sidebar selected item text fix */
.app-sidebar a.active,
.app-sidebar a[aria-current="page"],
.app-sidebar .active,
.app-sidebar .nav-active,
.app-sidebar-nav a.active,
.app-sidebar-nav a[aria-current="page"] {
  background: #dbeafe !important;
  color: #0f172a !important;
  opacity: 1 !important;
}

.app-sidebar a.active *,
.app-sidebar a[aria-current="page"] *,
.app-sidebar .active *,
.app-sidebar .nav-active *,
.app-sidebar-nav a.active *,
.app-sidebar-nav a[aria-current="page"] * {
  color: #0f172a !important;
  fill: #0f172a !important;
  stroke: #0f172a !important;
  opacity: 1 !important;
}

.app-sidebar a.active svg,
.app-sidebar a[aria-current="page"] svg,
.app-sidebar .active svg,
.app-sidebar .nav-active svg {
  color: #2563eb !important;
  fill: none !important;
  stroke: #2563eb !important;
  opacity: 1 !important;
}

.app-sidebar a.active .nav-label,
.app-sidebar a[aria-current="page"] .nav-label,
.app-sidebar .active .nav-label {
  color: #0f172a !important;
  opacity: 1 !important;
}

/* Sidebar selected item: use dark active pill so text is always readable */
.app-sidebar .app-nav-link.active,
.app-sidebar .app-nav-link.is-current,
.app-sidebar .app-nav-link[aria-current="page"],
.app-sidebar a.active,
.app-sidebar a.is-current,
.app-sidebar a[aria-current="page"] {
  background: linear-gradient(90deg, #1472c4 0%, #0f4c81 100%) !important;
  color: #ffffff !important;
  border-color: rgba(255,255,255,.22) !important;
  box-shadow: 0 10px 24px rgba(0,0,0,.28) !important;
}

.app-sidebar .app-nav-link.active *,
.app-sidebar .app-nav-link.is-current *,
.app-sidebar .app-nav-link[aria-current="page"] *,
.app-sidebar a.active *,
.app-sidebar a.is-current *,
.app-sidebar a[aria-current="page"] * {
  color: #ffffff !important;
  fill: #ffffff !important;
  stroke: #ffffff !important;
  opacity: 1 !important;
}

.app-sidebar .app-nav-link.active .nav-icon,
.app-sidebar .app-nav-link.is-current .nav-icon,
.app-sidebar .app-nav-link[aria-current="page"] .nav-icon {
  background: rgba(255,255,255,.16) !important;
  color: #ffffff !important;
}
