/* ============================================================
   IHS Reviews Portal — Premium Design System
   Agency-grade CSS. No generic aesthetics.
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Instrument+Serif:ital@0;1&display=swap');

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Core Brand */
  --navy-950:  #07111f;
  --navy-900:  #0f2035;
  --navy-800:  #1a365d;   /* Original brand navy */
  --navy-700:  #1e4474;
  --navy-600:  #2d5fa0;
  --navy-100:  #dbeafe;
  --navy-50:   #f0f6ff;

  /* Accent Gold */
  --gold-500:  #e8a422;
  --gold-400:  #f5b944;
  --gold-300:  #fdd068;
  --gold-100:  #fef3c7;

  /* Semantic */
  --success-bg:   #ecfdf5;
  --success-text: #065f46;
  --success-border: #a7f3d0;
  --warning-bg:   #fffbeb;
  --warning-text: #92400e;
  --warning-border: #fde68a;
  --danger-bg:    #fef2f2;
  --danger-text:  #991b1b;
  --danger-border: #fecaca;
  --info-bg:      #eff6ff;
  --info-text:    #1e40af;
  --info-border:  #bfdbfe;

  /* Surfaces */
  --surface-page: #f5f7fb;
  --surface-card: #ffffff;
  --surface-hover: #f8faff;
  --border-subtle: rgba(0, 0, 0, 0.07);
  --border-medium: rgba(0, 0, 0, 0.12);

  /* Typography */
  --font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;

  /* Shadows — layered, natural */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg:  0 10px 24px -4px rgba(0,0,0,0.08), 0 4px 10px -2px rgba(0,0,0,0.05);
  --shadow-xl:  0 20px 40px -8px rgba(0,0,0,0.12), 0 8px 16px -4px rgba(0,0,0,0.06);
  --shadow-card-hover: 0 12px 32px -6px rgba(15,32,53,0.14), 0 4px 12px -2px rgba(15,32,53,0.08);
  --shadow-modal: 0 24px 64px -12px rgba(7,17,31,0.25), 0 8px 24px -4px rgba(7,17,31,0.12);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Radii */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --radius-full: 9999px;
}

/* ============================================================
   BASE RESETS & TYPOGRAPHY
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  color: #1a2332;
  background-color: var(--surface-page);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

/* Page entry animation */
@keyframes pageReveal {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

main {
  animation: pageReveal 0.35s var(--transition-slow) both;
}

/* ============================================================
   LEGACY CLASS SUPPORT (keep .bg-navy, .text-navy working)
   ============================================================ */
.bg-navy {
  background-color: var(--navy-800);
}
.text-navy {
  color: var(--navy-800);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
aside.bg-navy {
  background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-800) 60%, #1c3d6b 100%);
  border-right: 1px solid rgba(255,255,255,0.06);
  box-shadow: 2px 0 16px rgba(7,17,31,0.18);
}

aside.sidebar-shell {
  flex-direction: column;
  justify-content: space-between;
  padding: 1.1rem 0.9rem 1rem;
  gap: 1rem;
}

/* Only show sidebar on desktop — Tailwind's hidden md:flex handles the base toggle,
   but sidebar-shell was overriding it with display:flex. */
@media (max-width: 767px) {
  aside.sidebar-shell {
    display: none !important;
  }
}

@media (min-width: 768px) {
  aside.sidebar-shell {
    display: flex;
  }
}

.sidebar-top {
  min-height: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.sidebar-branding {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  padding: 0.5rem 0.45rem 0.6rem;
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: white;
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

.sidebar-branding:hover {
  background: rgba(255,255,255,0.06);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.09);
}

.sidebar-branding:focus-visible {
  outline: 2px solid rgba(253,208,104,0.82);
  outline-offset: 2px;
}

.sidebar-brand-badge {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.95);
  color: var(--navy-900);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: 0.94rem;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.15);
}

.sidebar-brand-copy {
  min-width: 0;
}

.sidebar-brand-title {
  font-size: 1rem;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sidebar-brand-subtitle {
  margin-top: 0.18rem;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}

.sidebar-nav {
  margin-top: 1rem;
  padding: 0.2rem 0.18rem 0.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  overflow-y: auto;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-section-label {
  margin: 0;
  padding: 0 0.45rem;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.48);
}

.nav-section-items {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

/* ============================================================
   SIDEBAR - FIXED ON DESKTOP
   ============================================================ */
@media (min-width: 768px) {
  aside {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 16rem;
    overflow: hidden;
    z-index: 30;
  }
  aside + div,
  aside ~ div.flex-1 {
    margin-left: 16rem;
  }
}

/* ============================================================
   NAV ITEMS
   ============================================================ */
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.68rem;
  min-height: 44px;
  padding: 0.61rem 0.7rem;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.76);
  transition: background var(--transition-base), color var(--transition-base), box-shadow var(--transition-base);
  text-decoration: none;
  font-size: 0.885rem;
  font-weight: 530;
  position: relative;
  border: 1px solid transparent;
}

.nav-item::after {
  content: '';
  position: absolute;
  left: -2px;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 999px;
  background: transparent;
  transition: background var(--transition-base);
}

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: white;
  border-color: rgba(255,255,255,0.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.nav-item:focus-visible {
  outline: 2px solid rgba(253,208,104,0.82);
  outline-offset: 2px;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(255,255,255,0.18), rgba(255,255,255,0.12));
  color: white;
  font-weight: 650;
  border-color: rgba(255,255,255,0.16);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}

.nav-item.active::after {
  background: var(--gold-300);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.86;
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.nav-item.active svg,
.nav-item:hover svg {
  opacity: 1;
  transform: scale(1.03);
}

.nav-label {
  flex: 1;
  min-width: 0;
}

.nav-badge {
  min-width: 1.3rem;
  padding: 0.08rem 0.33rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.96);
  font-size: 0.66rem;
  font-weight: 720;
  line-height: 1.3;
  text-align: center;
}

.sidebar-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(to top, rgba(0,0,0,0.14), rgba(255,255,255,0.03));
  border-radius: 12px;
  padding: 0.78rem;
  backdrop-filter: blur(2px);
}

.sidebar-account-card {
  display: flex;
  align-items: center;
  gap: 0.72rem;
}

.sidebar-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.sidebar-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.83rem;
  letter-spacing: 0.02em;
  color: white;
  background: linear-gradient(140deg, rgba(253,208,104,0.92), rgba(232,164,34,0.72));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3);
}

.sidebar-presence {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 999px;
  background: #34d399;
  border: 1px solid rgba(9,24,41,0.95);
}

.sidebar-account-copy {
  min-width: 0;
}

.sidebar-account-kicker {
  margin: 0;
  font-size: 0.62rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.56);
}

.sidebar-account-name {
  margin: 0.14rem 0 0;
  color: #fff;
  font-size: 0.93rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.sidebar-account-meta {
  margin-top: 0.28rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.sidebar-role-badge {
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.35;
  border-radius: 999px;
  padding: 0.06rem 0.4rem;
  border: 1px solid transparent;
  white-space: nowrap;
}

.sidebar-role-badge.is-admin {
  color: #fff;
  border-color: rgba(253,208,104,0.4);
  background: rgba(232,164,34,0.26);
}

.sidebar-role-badge.is-brand {
  color: rgba(238,246,255,0.96);
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.13);
}

.sidebar-account-brand {
  color: rgba(255,255,255,0.78);
  font-size: 0.72rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.sidebar-signout {
  margin-top: 0.78rem;
  width: 100%;
  height: 2.3rem;
  border-radius: 10px;
  border: 1px solid rgba(248,113,113,0.28);
  background: rgba(127,29,29,0.2);
  color: #fee2e2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.84rem;
  font-weight: 620;
  transition: background var(--transition-base), border-color var(--transition-base), color var(--transition-base);
}

.sidebar-signout svg {
  width: 15px;
  height: 15px;
}

.sidebar-signout:hover {
  color: #fff;
  border-color: rgba(248,113,113,0.58);
  background: rgba(185,28,28,0.34);
}

.sidebar-signout:focus-visible {
  outline: 2px solid rgba(253,208,104,0.82);
  outline-offset: 2px;
}

/* ============================================================
   TOP HEADER BAR
   ============================================================ */
header.bg-white {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xs);
}

header h1 {
  color: var(--navy-900);
  font-weight: 700;
  letter-spacing: -0.025em;
}

/* ============================================================
   BACKGROUND & PAGE
   ============================================================ */
body.bg-gray-50 {
  background: var(--surface-page);
}

/* ============================================================
   CARDS — premium lift on hover
   ============================================================ */
.bg-white.rounded-lg.shadow,
.bg-white.rounded-xl.shadow-sm {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  transition: box-shadow var(--transition-slow), transform var(--transition-slow), border-color var(--transition-slow);
}

.bg-white.rounded-lg.shadow:hover,
.bg-white.rounded-xl.shadow-sm:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(29,68,116,0.1);
  transform: translateY(-1px);
}

/* ============================================================
   STAT CARDS (Dashboard)
   ============================================================ */
#statsGrid .bg-white.rounded-lg.shadow {
  padding: 1.625rem;
}

#statsGrid .bg-blue-100.rounded-full {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  box-shadow: 0 2px 8px rgba(59,130,246,0.2);
}
#statsGrid .bg-yellow-100.rounded-full {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  box-shadow: 0 2px 8px rgba(245,158,11,0.2);
}
#statsGrid .bg-green-100.rounded-full {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  box-shadow: 0 2px 8px rgba(16,185,129,0.2);
}

.text-3xl.font-bold.text-navy {
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 2rem;
}

/* Small stat label */
.text-sm.text-gray-600 {
  color: #6b7a90;
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ============================================================
   STARS — gold gradient fill
   ============================================================ */
.stars, .stars-small {
  display: inline-flex;
  gap: 1.5px;
}

.star {
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 1px 2px rgba(232,164,34,0.3));
}

.stars-small .star {
  width: 15px;
  height: 15px;
}

.star-filled {
  color: var(--gold-500);
}

.star-empty {
  color: #d1d9e6;
}

/* ============================================================
   STATUS BADGES — refined pill style
   ============================================================ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: opacity var(--transition-fast);
}

.status-badge::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.status-pending {
  background: var(--warning-bg);
  color: var(--warning-text);
  border: 1px solid var(--warning-border);
}

.status-approved {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.status-posted {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.status-rejected {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
}

/* ============================================================
   BUTTONS — premium gradients
   ============================================================ */

/* Primary navy button */
button.bg-navy,
a.bg-navy,
button[class~="bg-navy"],
a[class~="bg-navy"],
.btn-primary {
  background: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-700) 100%);
  box-shadow: 0 2px 8px rgba(15,32,53,0.25), 0 1px 3px rgba(15,32,53,0.15);
  transition: all var(--transition-base);
  border: none;
  letter-spacing: 0.01em;
}

button.bg-navy:hover,
a.bg-navy:hover {
  background: linear-gradient(135deg, var(--navy-700) 0%, var(--navy-600) 100%);
  box-shadow: 0 4px 16px rgba(15,32,53,0.3), 0 2px 6px rgba(15,32,53,0.2);
  transform: translateY(-1px);
}

button.bg-navy:active,
a.bg-navy:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(15,32,53,0.2);
}

/* Blue accent button */
button.bg-blue-600,
a.bg-blue-600 {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 2px 8px rgba(37,99,235,0.3), 0 1px 3px rgba(37,99,235,0.2);
  transition: all var(--transition-base);
}

button.bg-blue-600:hover,
a.bg-blue-600:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 4px 16px rgba(37,99,235,0.35), 0 2px 6px rgba(37,99,235,0.2);
  transform: translateY(-1px);
}

/* Ghost / outline buttons */
button.border.border-gray-300,
a.border.border-gray-300 {
  background: white;
  border-color: var(--border-medium);
  color: #374151;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-xs);
}

button.border.border-gray-300:hover,
a.border.border-gray-300:hover {
  background: #f8faff;
  border-color: var(--navy-600);
  color: var(--navy-800);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   INPUTS & SELECTS — premium focus states
   ============================================================ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
select,
textarea {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: #1a2332;
  background: white;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-md);
  transition: border-color var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
  outline: none;
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
select:hover,
textarea:hover {
  border-color: #cbd5e1;
  background: #fafcff;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus,
input.focus\:ring-2:focus,
select.focus\:ring-2:focus,
textarea.focus\:ring-2:focus {
  border-color: var(--navy-600) !important;
  box-shadow: 0 0 0 3px rgba(45,95,160,0.15) !important;
  background: white !important;
  outline: none !important;
  ring: none !important;
}

/* Label styling */
label.block.text-sm.font-medium.text-gray-700 {
  color: #374151;
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
}

/* ============================================================
   TABLES — cleaner, more premium
   ============================================================ */
table {
  border-collapse: collapse;
}

thead.bg-gray-50 {
  background: #f7f9fc;
}

thead th {
  color: #64748b !important;
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  padding: 0.875rem 1.5rem !important;
  border-bottom: 2px solid #e8edf5 !important;
}

tbody tr {
  transition: background var(--transition-fast);
}

tbody tr:hover {
  background: var(--surface-hover);
}

tbody td {
  padding: 1rem 1.5rem;
  color: #334155;
  font-size: 0.9rem;
  border-color: #f1f4f9;
}

/* Table row dividers */
.divide-y.divide-gray-200 > * + * {
  border-color: #f1f4f9;
}

/* ============================================================
   BOTTOM NAV (Mobile)
   ============================================================ */
#bottomNav {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0.25rem 0;
  padding-bottom: env(safe-area-inset-bottom, 0.375rem);
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-subtle);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
  overflow: visible;
}

@media (min-width: 768px) {
  #bottomNav {
    display: none !important;
  }
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  padding: 0.375rem 0.5rem;
  color: #9ca3af;
  text-decoration: none;
  transition: color var(--transition-base), transform var(--transition-fast);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  min-width: 3.75rem;
  flex-shrink: 0;
  position: relative;
  border-radius: var(--radius-md);
  white-space: nowrap;
}

.bottom-nav-item:hover {
  color: var(--navy-800);
  transform: translateY(-1px);
}

.bottom-nav-item.active {
  color: var(--navy-800);
  font-weight: 700;
}

.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2.5px;
  background: linear-gradient(90deg, var(--navy-700), var(--navy-600));
  border-radius: 0 0 3px 3px;
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
}

/* ============================================================
   BOTTOM NAV — MORE POPOVER
   ============================================================ */
.bottom-nav-more-wrap {
  position: relative;
  flex-shrink: 0;
}

.bottom-nav-popover {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  right: 0;
  min-width: 11rem;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-subtle);
  padding: 0.375rem;
  z-index: 100;
  animation: popoverReveal 0.18s ease-out both;
  max-height: 60vh;
  overflow-y: auto;
}

@keyframes popoverReveal {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.bottom-nav-popover-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  color: #4b5563;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.bottom-nav-popover-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.bottom-nav-popover-item:hover {
  background: var(--surface-hover);
  color: var(--navy-800);
}

.bottom-nav-popover-item.active {
  background: var(--navy-50);
  color: var(--navy-800);
  font-weight: 600;
}

.bottom-nav-popover-item.active svg {
  opacity: 1;
}

/* Mobile nav badge (dot on icon) */
.mobile-nav-badge {
  position: absolute;
  top: 2px;
  right: 50%;
  transform: translateX(calc(50% + 8px));
  min-width: 1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #ef4444;
  color: white;
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1rem;
  text-align: center;
}

/* ============================================================
   TOAST NOTIFICATIONS — premium slide-in
   ============================================================ */
@keyframes toastSlideIn {
  from {
    transform: translateX(calc(100% + 2rem));
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(calc(100% + 2rem));
    opacity: 0;
  }
}

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  max-width: 380px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  animation: toastSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  z-index: 9999;
  border: 1px solid var(--border-subtle);
}

.toast.success {
  border-left: 3px solid #10b981;
  background: linear-gradient(to right, #ecfdf5, white 60%);
}

.toast.error {
  border-left: 3px solid #ef4444;
  background: linear-gradient(to right, #fef2f2, white 60%);
}

.toast.info {
  border-left: 3px solid var(--navy-600);
  background: linear-gradient(to right, #eff6ff, white 60%);
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Styled loading indicator */
.border-navy {
  border-color: var(--navy-800);
}

.border-b-2.border-navy {
  border-bottom-color: var(--navy-800);
}

/* ============================================================
   FILTERS CARD
   ============================================================ */
.bg-white.rounded-lg.shadow.p-6.mb-6 {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
}

/* ============================================================
   MODALS — premium glass-shadow treatment
   ============================================================ */
.fixed.inset-0.bg-black {
  background: rgba(7,17,31,0.55) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.bg-white.rounded-lg.shadow-xl {
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-modal) !important;
  border: 1px solid rgba(255,255,255,0.9);
  animation: modalReveal 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes modalReveal {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Modal header border */
.bg-white.rounded-lg.shadow-xl .border-b.border-gray-200 {
  border-bottom-color: #f1f4f9 !important;
  background: #fafbfc;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 1.25rem 1.5rem;
}

.bg-white.rounded-lg.shadow-xl h3 {
  font-weight: 700;
  color: var(--navy-900);
  letter-spacing: -0.02em;
}

/* ============================================================
   PENDING REPLY CARDS
   ============================================================ */
#pendingList .bg-white,
#recentReviewsList .bg-white {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  transition: box-shadow var(--transition-slow), border-color var(--transition-slow), transform var(--transition-slow);
}

#pendingList .bg-white:hover,
#recentReviewsList .bg-white:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(29,68,116,0.1);
  transform: translateY(-1px);
}

/* Review text in cards */
.text-gray-700 {
  color: #374151;
  line-height: 1.65;
}

/* ============================================================
   REVIEW ITEMS (recent reviews list)
   ============================================================ */
#recentReviews .divide-y.divide-gray-200 > div,
#recentReviewsList > div {
  transition: background var(--transition-fast);
}

#recentReviews .divide-y.divide-gray-200 > div:hover,
#recentReviewsList > div:hover {
  background: var(--surface-hover);
}

/* Recent reviews footer */
#recentReviews .bg-gray-50 {
  background: #f7f9fc;
  border-top: 1px solid #f1f4f9;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

#recentReviews a {
  color: var(--navy-700);
  font-weight: 600;
  font-size: 0.875rem;
  transition: color var(--transition-base);
}

#recentReviews a:hover {
  color: var(--navy-600);
}

/* ============================================================
   EMPTY STATES — more atmosphere
   ============================================================ */
#emptyState svg,
.empty-state svg {
  color: #c5d0e0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.05));
}

#emptyState h3 {
  color: var(--navy-900);
  font-weight: 700;
  font-size: 1.125rem;
}

#emptyState p {
  color: #94a3b8;
  font-size: 0.9rem;
}

/* ============================================================
   PENDING COUNT BADGE
   ============================================================ */
#pendingCount {
  background: var(--warning-bg);
  color: var(--warning-text);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  padding: 0.3rem 0.875rem;
}

/* ============================================================
   LOCATION CARDS
   ============================================================ */
#locationsGrid .bg-white {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  transition: box-shadow var(--transition-slow), border-color var(--transition-slow), transform var(--transition-slow);
  overflow: hidden;
}

#locationsGrid .bg-white:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(29,68,116,0.1);
  transform: translateY(-2px);
}

/* ============================================================
   SETTINGS CARDS
   ============================================================ */
#settingsList .bg-white,
#userManagement .bg-white {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
}

/* ============================================================
   TEXT UTILITIES
   ============================================================ */
.truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.truncate-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Link colors */
.text-blue-600 {
  color: var(--navy-700) !important;
  transition: color var(--transition-base);
}

.text-blue-600:hover,
.hover\:text-blue-700:hover {
  color: var(--navy-600) !important;
}

/* ============================================================
   TEXTAREA in pending modal
   ============================================================ */
#editReplyText {
  resize: vertical;
  min-height: 140px;
  font-family: var(--font-sans);
  line-height: 1.65;
  color: #1a2332;
}

/* Review background in modal */
.bg-gray-50.p-4.rounded-lg {
  background: #f7f9fc;
  border: 1px solid #edf2f7;
  border-radius: var(--radius-md);
}

/* ============================================================
   LOGIN & AUTH PAGES — premium first impression
   ============================================================ */
body.auth-page {
  background: linear-gradient(145deg, var(--navy-950) 0%, var(--navy-900) 30%, #1a3460 65%, #1e4878 100%);
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Atmospheric background orbs */
body.auth-page::before {
  content: '';
  position: fixed;
  top: -20%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(45,95,160,0.3) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body.auth-page::after {
  content: '';
  position: fixed;
  bottom: -15%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(232,164,34,0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Auth card container */
body.auth-page > div.max-w-md {
  position: relative;
  z-index: 1;
}

/* Auth logo circle */
body.auth-page .bg-navy.rounded-full {
  background: linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0.08)) !important;
  border: 2px solid rgba(255,255,255,0.25);
  box-shadow: 0 8px 32px rgba(7,17,31,0.3), 0 0 0 8px rgba(255,255,255,0.05);
  backdrop-filter: blur(8px);
}

body.auth-page .bg-navy.rounded-full span {
  color: white;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* Auth title & subtitle */
body.auth-page h1,
body.auth-page h2 {
  color: white !important;
  font-family: var(--font-serif);
  font-style: italic;
  letter-spacing: -0.01em;
  font-weight: 400;
}

body.auth-page .text-gray-600,
body.auth-page .text-gray-500 {
  color: rgba(255,255,255,0.65) !important;
}

/* Auth card glass effect */
body.auth-page .bg-white.rounded-lg.shadow-lg {
  background: rgba(255,255,255,0.97) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-xl) !important;
  box-shadow: 0 24px 64px rgba(7,17,31,0.35), 0 1px 0 rgba(255,255,255,0.5) !important;
  border: 1px solid rgba(255,255,255,0.9);
  padding: 2.25rem !important;
  animation: authCardReveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: 0.1s;
}

@keyframes authCardReveal {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Auth card heading */
body.auth-page .bg-white.rounded-lg.shadow-lg h2 {
  font-family: var(--font-sans) !important;
  font-style: normal !important;
  color: var(--navy-900) !important;
  font-weight: 700 !important;
  font-size: 1.4rem !important;
  letter-spacing: -0.025em !important;
}

body.auth-page .bg-white.rounded-lg.shadow-lg label {
  color: #4b5563;
  font-size: 0.8125rem;
  font-weight: 500;
}

body.auth-page .bg-white.rounded-lg.shadow-lg a {
  color: var(--navy-700);
  font-weight: 500;
  transition: color var(--transition-base);
}

body.auth-page .bg-white.rounded-lg.shadow-lg a:hover {
  color: var(--navy-600);
}

/* Auth footer text */
body.auth-page .text-center.mt-6 {
  color: rgba(255,255,255,0.5) !important;
}

body.auth-page .text-center.mt-6 p {
  color: rgba(255,255,255,0.5) !important;
  font-size: 0.8rem;
}

/* Forgot password / back link */
body.auth-page > div.max-w-md > p {
  color: rgba(255,255,255,0.5) !important;
}

body.auth-page > div.max-w-md > p a {
  color: rgba(255,255,255,0.72) !important;
  transition: color var(--transition-base);
}

body.auth-page > div.max-w-md > p a:hover {
  color: white !important;
}

/* ============================================================
   ERROR / SUCCESS MESSAGES
   ============================================================ */
.bg-red-50.border.border-red-200 {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  border-radius: var(--radius-md);
  color: var(--danger-text);
  font-size: 0.875rem;
}

.bg-green-100.rounded-full {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  box-shadow: 0 4px 12px rgba(16,185,129,0.2);
}

.bg-red-100.rounded-full {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  box-shadow: 0 4px 12px rgba(239,68,68,0.2);
}

/* ============================================================
   MOBILE OPTIMIZATIONS
   ============================================================ */
@media (max-width: 768px) {
  .toast {
    bottom: 5.5rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
    border-radius: var(--radius-lg);
  }

  body.auth-page .bg-white.rounded-lg.shadow-lg {
    padding: 1.75rem !important;
  }

  header h1 {
    font-size: 1.375rem;
  }
}

/* ============================================================
   POLISHED SCROLLBAR (WebKit)
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.25);
}

/* ============================================================
   SELECTION COLOR
   ============================================================ */
::selection {
  background: rgba(29,68,116,0.15);
  color: var(--navy-900);
}

/* ============================================================
   TOGGLE SWITCHES
   ============================================================ */
.toggle-wrapper {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

.toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.toggle-label {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background: #d1d5db;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background 0.2s ease;
  user-select: none;
}

.toggle-label::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}

.toggle-input:checked + .toggle-label {
  background: var(--navy-800);
}

.toggle-input:checked + .toggle-label::after {
  transform: translateX(20px);
}

/* ============================================================
   TONE & LENGTH PILLS (reply-settings)
   ============================================================ */
.hidden-radio {
  display: none;
}

.tone-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 1.125rem;
  border-radius: var(--radius-full);
  border: 1.5px solid #e2e8f0;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all var(--transition-base);
  background: white;
  user-select: none;
}

.tone-pill:hover {
  border-color: var(--navy-600);
  color: var(--navy-800);
  background: var(--navy-50);
}

.hidden-radio:checked + .tone-pill {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: white;
  box-shadow: 0 2px 8px rgba(15,32,53,0.25);
}

.length-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 1.125rem;
  border-radius: var(--radius-full);
  border: 1.5px solid #e2e8f0;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all var(--transition-base);
  background: white;
  user-select: none;
}

.length-pill:hover {
  border-color: var(--navy-600);
  color: var(--navy-800);
  background: var(--navy-50);
}

.length-pill.active {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: white;
  box-shadow: 0 2px 8px rgba(15,32,53,0.25);
}

/* ============================================================
   TEMPLATE VARIABLE TAGS
   ============================================================ */
.var-tag {
  display: inline;
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: 600;
  background: #dbeafe;
  color: #1e40af;
  font-family: ui-monospace, 'Menlo', 'Consolas', monospace;
  vertical-align: baseline;
  line-height: 1.6;
  white-space: nowrap;
}
