/* ================================================================
   Hostel Management System — Light UI v3.0
   Design System: Mintlify Light · Hostel-native
   Palette: Canvas white · Mint accent · Sky hero
   Target: Quản lý nhà trọ — tone sáng, hiện đại, dễ nhìn
   ================================================================ */

/* ── Font import (Inter from Google Fonts in head.jsp) ───────── */

:root {
  /* ── Brand colors (DESIGN.md exact tokens) ─────────────────── */
  --hms-ink: #0a0a0a;
  /* {colors.ink}    */
  --hms-charcoal: #1c1c1e;
  /* {colors.charcoal} */
  --hms-slate: #3a3a3c;
  /* {colors.slate}  */
  --hms-steel: #5a5a5c;
  /* {colors.steel}  */
  --hms-stone: #888888;
  /* {colors.stone}  */
  --hms-muted: #a8a8aa;
  /* {colors.muted}  */

  /* ── Mint accent (Mintlify brand-green) ────────────────────── */
  --hms-accent: #00d4a4;
  /* {colors.brand-green}      */
  --hms-accent-deep: #00b48a;
  /* {colors.brand-green-deep} */
  --hms-accent-soft: #7cebcb;
  /* {colors.brand-green-soft} */
  --hms-accent-bg: rgba(0, 212, 164, 0.08);
  --hms-accent-bg-hover: rgba(0, 212, 164, 0.14);
  --hms-accent-glow: rgba(0, 212, 164, 0.22);

  /* ── Semantic: button primary = ink (DESIGN.md) ────────────── */
  --hms-primary: #0a0a0a;
  --hms-primary-hover: #1c1c1e;
  --hms-on-primary: #ffffff;

  /* ── Hero multi-color light palette ────────────────────────── */
  --hms-hero-c1: #e0f7fa;
  /* aqua sky      */
  --hms-hero-c2: #e8f5e9;
  /* fresh mint    */
  --hms-hero-c3: #ede7f6;
  /* soft lavender */
  --hms-hero-c4: #fce4ec;
  /* blush rose    */
  --hms-hero-c5: #fff8e1;
  /* warm amber    */
  --hms-hero-c6: #e3f2fd;
  /* ice blue      */
  /* keep legacy tokens so auth-banner & print rules still resolve */
  --hms-hero-sky-from: #e0f7fa;
  --hms-hero-sky-mid: #ede7f6;
  --hms-hero-sky-to: #fce4ec;
  --hms-hero-accent-from: #00d4a4;
  --hms-hero-accent-to: #00b48a;

  /* ── Surfaces (light, white canvas system) ──────────────────── */
  --hms-body-bg: #f7f7f7;
  /* {colors.surface}      */
  --hms-canvas: #ffffff;
  /* {colors.canvas}       */
  --hms-surface: #f7f7f7;
  /* section bg            */
  --hms-surface-soft: #fafafa;
  /* {colors.surface-soft} */
  --hms-card-bg: #ffffff;
  --hms-sidebar-bg: #ffffff;

  /* ── Sidebar specific ───────────────────────────────────────── */
  --hms-sidebar-hover: #f0fdf9;
  --hms-sidebar-active-bg: #f0fdf9;
  --hms-sidebar-active-text: #0a0a0a;
  --hms-sidebar-text: #5a5a5c;
  --hms-sidebar-section: #a8a8aa;

  /* ── Borders (hairline system) ──────────────────────────────── */
  --hms-border: #e5e5e5;
  /* {colors.hairline}      */
  --hms-border-soft: #ededed;
  /* {colors.hairline-soft} */
  --hms-border-accent: rgba(0, 212, 164, 0.28);

  /* ── Text ───────────────────────────────────────────────────── */
  --hms-text: #0a0a0a;
  --hms-text-secondary: #3a3a3c;
  --hms-text-muted: #888888;
  --hms-text-placeholder: #a8a8aa;

  /* ── Semantic status ────────────────────────────────────────── */
  --hms-success: #1ba673;
  /* {colors.brand-annotate} */
  --hms-success-bg: #f0fdf9;
  --hms-success-border: #a7f3d0;
  --hms-warning: #c37d0d;
  /* {colors.brand-warn}     */
  --hms-warning-bg: #fffbeb;
  --hms-warning-border: #fde68a;
  --hms-danger: #d45656;
  /* {colors.brand-error}    */
  --hms-danger-bg: #fff5f5;
  --hms-danger-border: #fca5a5;
  --hms-info: #3772cf;
  /* {colors.brand-tag}      */
  --hms-info-bg: #eff6ff;
  --hms-info-border: #bfdbfe;

  /* ── Radius (DESIGN.md rounded scale) ──────────────────────── */
  --hms-radius-xs: 4px;
  /* {rounded.xs}   */
  --hms-radius-sm: 6px;
  /* {rounded.sm}   */
  --hms-radius: 8px;
  /* {rounded.md}   */
  --hms-radius-md: 8px;
  --hms-radius-lg: 12px;
  /* {rounded.lg}   */
  --hms-radius-xl: 16px;
  /* {rounded.xl}   */
  --hms-radius-xxl: 24px;
  /* {rounded.xxl}  */
  --hms-radius-full: 9999px;
  /* {rounded.full} */

  /* ── Elevation (DESIGN.md shadow levels) ────────────────────── */
  --hms-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --hms-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --hms-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --hms-shadow-lg: 0 24px 48px -8px rgba(0, 0, 0, 0.12);
  --hms-shadow-accent: rgba(0, 212, 164, 0.08) 0px 8px 24px;
  /* brand-tinted */

  /* ── Layout ─────────────────────────────────────────────────── */
  --hms-sidebar-width: 260px;
  --hms-header-height: 60px;

  /* ── Transitions ────────────────────────────────────────────── */
  --hms-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --hms-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --hms-ease-out: cubic-bezier(0, 0, 0.2, 1);
  --t-fast: 0.12s;
  --t: 0.22s;
  --t-slow: 0.38s;

  /* ── Typography ─────────────────────────────────────────────── */
  --hms-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --hms-font-mono: "JetBrains Mono", "Fira Code", "SF Mono", Menlo, monospace;
}

/* ── Reset ──────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--hms-font);
  background: var(--hms-body-bg);
  color: var(--hms-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  font-size: 14px;
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  KEYFRAME ANIMATIONS                                         ║
   ╚══════════════════════════════════════════════════════════════╝ */

/* Core entrance */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Shimmer for skeleton loaders */
@keyframes shimmer {
  0% {
    background-position: -700px 0;
  }

  100% {
    background-position: 700px 0;
  }
}

/* Pulse animations */
@keyframes pulseMint {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(0, 212, 164, 0.45);
  }

  60% {
    box-shadow: 0 0 0 7px rgba(0, 212, 164, 0);
  }
}

@keyframes pulseWarn {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(195, 125, 13, 0.45);
  }

  60% {
    box-shadow: 0 0 0 7px rgba(195, 125, 13, 0);
  }
}

@keyframes pulseDanger {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(212, 86, 86, 0.45);
  }

  60% {
    box-shadow: 0 0 0 7px rgba(212, 86, 86, 0);
  }
}

/* Float — auth illustration */
@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-9px);
  }
}

/* Gentle hero gradient shift */
@keyframes gradientDrift {
  0% {
    background-position: 0% 0%;
  }

  25% {
    background-position: 100% 0%;
  }

  50% {
    background-position: 100% 100%;
  }

  75% {
    background-position: 0% 100%;
  }

  100% {
    background-position: 0% 0%;
  }
}

/* Rainbow shimmer along bottom border */
@keyframes heroShimmerLine {
  0% {
    background-position: 0% 50%;
  }

  100% {
    background-position: 200% 50%;
  }
}

/* Orb float — subtle y shift */
@keyframes heroOrbFloat {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  33% {
    transform: translateY(-8px) scale(1.04);
  }

  66% {
    transform: translateY(5px) scale(0.97);
  }
}

/* KPI number pop */
@keyframes numPop {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.92);
  }

  60% {
    transform: translateY(-2px) scale(1.03);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Spin (loading indicator) */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Soft bounce (empty state icon) */
@keyframes bounceSoft {

  0%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-6px);
  }

  70% {
    transform: translateY(-3px);
  }
}

/* Card accent bar reveal */
@keyframes barReveal {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

/* ── Staggered page entrance ─────────────────────────────────── */
.page-content>* {
  animation: fadeInUp var(--t-slow) var(--hms-ease) both;
}

.page-content>*:nth-child(1) {
  animation-delay: 0.04s;
}

.page-content>*:nth-child(2) {
  animation-delay: 0.08s;
}

.page-content>*:nth-child(3) {
  animation-delay: 0.12s;
}

.page-content>*:nth-child(4) {
  animation-delay: 0.16s;
}

.page-content>*:nth-child(5) {
  animation-delay: 0.20s;
}

.page-content>*:nth-child(6) {
  animation-delay: 0.24s;
}

.page-content>*:nth-child(7) {
  animation-delay: 0.28s;
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  AUTH LAYOUT                                                 ║
   ╚══════════════════════════════════════════════════════════════╝ */

.auth-page-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--hms-canvas);
}

.auth-split-layout {
  display: flex;
  flex-direction: row-reverse;
  width: 100%;
  min-height: 100vh;
  background: var(--hms-canvas);
  overflow: hidden;
  animation: fadeIn 0.45s var(--hms-ease) both;
}

.auth-form-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem 2.5rem;
  background: var(--hms-surface-soft);
}

.auth-banner-side {
  flex: 1;
  display: none;
  position: relative;
  overflow: hidden;
}

.auth-banner-side::before {
  content: none;
}

.auth-banner-side::after {
  content: none;
}

@media (min-width: 992px) {
  .auth-banner-side {
    display: flex;
    align-items: stretch;
    justify-content: center;
  }
}

.auth-card {
  width: 100%;
  max-width: 560px;
  background: var(--hms-card-bg);
  padding: 3.5rem 4rem;
  border-radius: var(--hms-radius-xl);
  box-shadow: var(--hms-shadow-md), 0 0 0 1px rgba(0, 0, 0, 0.03);
}

.auth-illustration {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
}

.auth-stagger-1 {
  animation: fadeInUp 0.45s var(--hms-ease) 0.08s both;
}

.auth-stagger-2 {
  animation: fadeInUp 0.45s var(--hms-ease) 0.16s both;
}

.auth-stagger-3 {
  animation: fadeInUp 0.45s var(--hms-ease) 0.24s both;
}

.auth-stagger-4 {
  animation: fadeInUp 0.45s var(--hms-ease) 0.32s both;
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  APP SHELL                                                   ║
   ╚══════════════════════════════════════════════════════════════╝ */

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--hms-sidebar-width);
  background: var(--hms-canvas);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--hms-border);
  box-shadow: 1px 0 8px rgba(0, 0, 0, 0.03);
  transition: transform var(--t) var(--hms-ease);
}

/* Brand strip — light with mint accent icon */
.sidebar-brand {
  height: var(--hms-header-height);
  padding: 0 1.125rem;
  border-bottom: 1px solid var(--hms-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--hms-canvas);
}

.sidebar-brand-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--hms-accent) 0%, var(--hms-accent-soft) 100%);
  border-radius: var(--hms-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.8125rem;
  box-shadow: 0 2px 8px rgba(0, 212, 164, 0.28);
  transition: transform var(--t) var(--hms-ease-spring), box-shadow var(--t) var(--hms-ease);
}

.sidebar-brand-icon:hover {
  transform: scale(1.08) rotate(-3deg);
  box-shadow: 0 4px 16px rgba(0, 212, 164, 0.40);
}

.sidebar-brand-text {
  color: var(--hms-ink);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.sidebar-brand-text small {
  display: block;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--hms-stone);
  letter-spacing: 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.625rem;
  scrollbar-width: thin;
  scrollbar-color: var(--hms-border-soft) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 3px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--hms-border);
  border-radius: 2px;
}

.sidebar-section {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--hms-muted);
  padding: 1.125rem 0.75rem 0.375rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 2px;
  border-radius: var(--hms-radius-sm);
  color: var(--hms-steel);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all var(--t-fast) var(--hms-ease);
  position: relative;
  overflow: hidden;
}

/* Subtle left accent bar */
.sidebar-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--hms-accent);
  border-radius: 0 var(--hms-radius-full) var(--hms-radius-full) 0;
  transition: height var(--t) var(--hms-ease-spring);
}

/* Ripple background on hover */
.sidebar-link::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--hms-accent-bg);
  opacity: 0;
  transition: opacity var(--t-fast) var(--hms-ease);
  border-radius: inherit;
}

.sidebar-link:hover {
  color: var(--hms-ink);
}

.sidebar-link:hover::after {
  opacity: 1;
}

.sidebar-link:hover::before {
  height: 55%;
}

.sidebar-link.active {
  background: var(--hms-sidebar-active-bg);
  color: var(--hms-ink);
  font-weight: 600;
}

.sidebar-link.active::before {
  height: 65%;
}

.sidebar-link svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.55;
  transition: all var(--t) var(--hms-ease);
  position: relative;
  z-index: 1;
}

.sidebar-link span {
  position: relative;
  z-index: 1;
}

.sidebar-link:hover svg {
  opacity: 0.85;
  transform: scale(1.1);
}

.sidebar-link.active svg {
  color: var(--hms-accent-deep);
  opacity: 1;
}

.sidebar-footer {
  padding: 0.75rem 1.125rem;
  border-top: 1px solid var(--hms-border);
  font-size: 0.6875rem;
  color: var(--hms-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--hms-surface-soft);
}

.sidebar-footer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hms-accent);
  flex-shrink: 0;
  animation: pulseMint 2.5s ease-in-out infinite;
}

/* ── Sidebar overlay (mobile) ────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.32);
  backdrop-filter: blur(3px);
  z-index: 1039;
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  TOPBAR                                                      ║
   ╚══════════════════════════════════════════════════════════════╝ */

.main-wrapper {
  flex: 1;
  margin-left: var(--hms-sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  /* KHÔNG đặt position/z-index ở đây — để topbar sticky hoạt động
     đúng trong scroll context và không bị cô lập stacking context */
}

.topbar {
  height: var(--hms-header-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--hms-border);
  display: flex;
  align-items: center;
  padding: 0 1.75rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  /* isolation:isolate ở đây bảo vệ topbar khỏi bị children trong
     page-content (có animation) chồng lên — không ảnh hưởng sticky */
  isolation: isolate;
}

.topbar-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.375rem;
  color: var(--hms-slate);
  cursor: pointer;
  border-radius: var(--hms-radius-sm);
  transition: background var(--t-fast) var(--hms-ease);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.topbar-toggle:hover {
  background: var(--hms-surface);
}

/* Breadcrumb */
.breadcrumb-nav {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.breadcrumb-nav ol {
  list-style: none;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
}

.breadcrumb-nav li+li::before {
  content: "›";
  color: var(--hms-muted);
  padding: 0 0.125rem;
}

.breadcrumb-nav a {
  color: var(--hms-stone);
  text-decoration: none;
  padding: 0.2rem 0.35rem;
  border-radius: var(--hms-radius-xs);
  transition: all var(--t-fast) var(--hms-ease);
}

.breadcrumb-nav a:hover {
  color: var(--hms-ink);
  background: var(--hms-surface);
}

.breadcrumb-nav .active {
  color: var(--hms-ink);
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}

.topbar-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 0.5rem;
  border-radius: var(--hms-radius);
  color: var(--hms-stone);
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast) var(--hms-ease);
}

.topbar-btn:hover {
  background: var(--hms-surface);
  border-color: var(--hms-border);
  color: var(--hms-ink);
  transform: translateY(-1px);
}

.notification-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  background: var(--hms-accent);
  border-radius: 50%;
  border: 2px solid var(--hms-canvas);
  animation: pulseMint 2.2s ease-in-out infinite;
}

/* User menu */
.user-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.5rem;
  border-radius: var(--hms-radius);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--t-fast) var(--hms-ease);
  position: relative;
}

.user-menu:hover {
  background: var(--hms-surface);
  border-color: var(--hms-border);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--hms-radius-sm);
  background: linear-gradient(135deg, var(--hms-accent) 0%, var(--hms-accent-soft) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 1px 6px rgba(0, 212, 164, 0.25);
}

.user-info {
  display: none;
}

@media (min-width: 768px) {
  .user-info {
    display: block;
    padding-right: 0.25rem;
  }

  .user-info span {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--hms-ink);
    line-height: 1.25;
  }

  .user-info small {
    font-size: 0.6875rem;
    color: var(--hms-stone);
  }
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--hms-canvas);
  border: 1px solid var(--hms-border);
  border-radius: var(--hms-radius-md);
  box-shadow: var(--hms-shadow-lg);
  min-width: 196px;
  padding: 0.375rem;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.97);
  transition: all var(--t) var(--hms-ease);
  z-index: 1050;
}

.user-menu:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.dropdown-item {
  padding: 0.5rem 0.75rem;
  color: var(--hms-ink);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: var(--hms-radius-sm);
  transition: background var(--t-fast) var(--hms-ease);
}

.dropdown-item:hover {
  background: var(--hms-surface);
}

.dropdown-divider {
  height: 1px;
  background: var(--hms-border);
  margin: 0.3rem 0;
}

.dropdown-item.text-danger {
  color: var(--hms-danger);
}

.dropdown-item.text-danger:hover {
  background: var(--hms-danger-bg);
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  PAGE CONTENT                                                ║
   ╚══════════════════════════════════════════════════════════════╝ */

.page-content {
  padding: 1.75rem 2rem;
  flex: 1;
  max-width: 1280px;
  width: 100%;
}

/* ── Staggered page entrance ─────────────────────────────────── */
/* KHÔNG dùng isolation hoặc position/z-index trên page-content
   để tránh tạo stacking context mới chen vào giữa topbar và nội dung */
.page-content>* {
  animation: fadeInUp var(--t-slow) var(--hms-ease) both;
}

/* ── Page Header ─────────────────────────────────────────────── */
.page-header {
  margin-bottom: 1.5rem;
}

.page-header:not(.hero-sky-gradient) h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
  color: var(--hms-ink);
  letter-spacing: -0.5px;
}

.page-header:not(.hero-sky-gradient) p {
  color: var(--hms-stone);
  font-size: 0.9rem;
  margin: 0;
}

/* ════════════════════════════════════════════════════════════════
   HERO PAGE-HEADER — Modern Multi-Color Light Palette
   Tông sáng · đa màu · hiện đại — mint × sky × lavender × rose
   ════════════════════════════════════════════════════════════════ */
.hero-sky-gradient {
  /* 6-stop multi-color diagonal — tông pastel sáng rực rỡ */
  background: linear-gradient(135deg,
      #e0f7fa 0%,
      /* aqua-sky       */
      #e3f2fd 16%,
      /* ice-blue       */
      #e8f5e9 32%,
      /* fresh-mint     */
      #ede7f6 50%,
      /* soft-lavender  */
      #fce4ec 68%,
      /* blush-rose     */
      #fff8e1 84%,
      /* warm-amber     */
      #e0f7fa 100%
      /* aqua loop-back */
    );
  background-size: 300% 300%;
  animation: gradientDrift 18s ease infinite;
  padding: 2.5rem 2rem;
  margin: -1.75rem -2rem 1.75rem;
  position: relative;
  /* overflow:hidden omitted — avoids stacking-context / topbar conflicts */
  border-bottom: 1px solid rgba(99, 179, 237, 0.25);
}

/* ── Floating colour orbs (depth layer) ─────────────────────── */
.hero-sky-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  /* 4 large soft radial orbs — each a different brand hue */
  background:
    radial-gradient(ellipse 42% 70% at 12% 55%, rgba(56, 189, 248, 0.22) 0%, transparent 70%),
    radial-gradient(ellipse 38% 60% at 88% 25%, rgba(167, 139, 250, 0.18) 0%, transparent 65%),
    radial-gradient(ellipse 32% 55% at 52% 90%, rgba(249, 168, 212, 0.16) 0%, transparent 60%),
    radial-gradient(ellipse 28% 45% at 72% 8%, rgba(52, 211, 153, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse 20% 35% at 35% 20%, rgba(251, 191, 36, 0.10) 0%, transparent 50%);
  animation: heroOrbFloat 12s ease-in-out infinite;
  pointer-events: none;
}

/* ── Rainbow shimmer bottom bar ─────────────────────────────── */
.hero-sky-gradient::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
      #38bdf8 0%,
      /* sky        */
      #34d399 18%,
      /* mint       */
      #818cf8 35%,
      /* indigo     */
      #f472b6 52%,
      /* rose       */
      #fbbf24 68%,
      /* amber      */
      #34d399 84%,
      /* mint       */
      #38bdf8 100%
      /* sky loop   */
    );
  background-size: 200% 100%;
  animation: heroShimmerLine 5s linear infinite;
  border-radius: 0 0 2px 2px;
}

/* ── Text inside hero ───────────────────────────────────────── */
.hero-sky-gradient h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.7px;
  /* Chữ đậm tối tương phản với nền pastel sáng */
  color: var(--hms-charcoal);
  margin: 0 0 0.4rem;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.hero-sky-gradient p {
  color: var(--hms-steel);
  font-size: 0.9rem;
  margin: 0;
  position: relative;
  z-index: 1;
  font-weight: 500;
  opacity: 0.85;
}

/* ── Badge / tag chips inside hero ─────────────────────────── */
.hero-sky-gradient .badge,
.hero-sky-gradient .status-chip {
  position: relative;
  z-index: 1;
  backdrop-filter: blur(4px);
  background: rgba(255, 255, 255, 0.55) !important;
  border: 1px solid rgba(255, 255, 255, 0.75) !important;
}

/* ── Action buttons inside hero ─────────────────────────────── */
.hero-sky-gradient .btn-mintlify-primary,
.hero-sky-gradient .btn-mintlify-secondary,
.hero-sky-gradient .quick-action-btn {
  position: relative;
  z-index: 1;
}

/* Khi nút nằm trên hero-sky-gradient, tạo hiệu ứng phát sáng nhẹ */
.hero-sky-gradient .btn-mintlify-secondary,
.hero-sky-gradient .quick-action-btn:not(.primary) {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 12px rgba(0, 112, 243, 0.08);
}

.hero-sky-gradient .btn-mintlify-secondary:hover,
.hero-sky-gradient .quick-action-btn:not(.primary):hover {
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(0, 112, 243, 0.12);
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  BUTTONS (DESIGN.md button-primary = ink black pill)         ║
   ╚══════════════════════════════════════════════════════════════╝ */

/* Primary — Vibrant Mint Gradient */
.btn-mintlify-primary,
.quick-action-btn.primary {
  background: linear-gradient(135deg, #00c698 0%, #00e0b0 100%);
  border: none;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 10px 20px;
  border-radius: var(--hms-radius-full);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: -0.01em;
  line-height: 1.3;
  box-shadow: 0 4px 12px rgba(0, 212, 164, 0.3);
}

.btn-mintlify-primary:hover,
.quick-action-btn.primary:hover {
  background: linear-gradient(135deg, #00b48a 0%, #00d4a4 100%);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 212, 164, 0.4);
}

.btn-mintlify-primary:active,
.quick-action-btn.primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 212, 164, 0.25);
}

/* Secondary — Bright White Pill */
.btn-mintlify-secondary,
.quick-action-btn {
  background: #ffffff;
  border: 1px solid var(--hms-border-soft);
  color: var(--hms-ink);
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 9px 18px;
  border-radius: var(--hms-radius-full);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: -0.01em;
  line-height: 1.3;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.btn-mintlify-secondary:hover,
.quick-action-btn:hover {
  background: #fafbfc;
  border-color: var(--hms-border);
  color: var(--hms-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

/* Accent — brand-green pill (DESIGN.md button-accent-green) */
.btn-accent {
  background: var(--hms-accent);
  border: 1px solid var(--hms-accent);
  color: var(--hms-ink);
  font-weight: 700;
  font-size: 0.8125rem;
  padding: 9px 18px;
  border-radius: var(--hms-radius-full);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: all var(--t) var(--hms-ease);
  box-shadow: var(--hms-shadow-accent);
}

.btn-accent:hover {
  background: var(--hms-accent-deep);
  border-color: var(--hms-accent-deep);
  color: var(--hms-ink);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 212, 164, 0.30);
}

/* Bootstrap .btn override */
.btn {
  border-radius: var(--hms-radius-full);
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.5rem 1.125rem;
  transition: all var(--t) var(--hms-ease);
  letter-spacing: -0.01em;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-mintlify-primary.btn {
  border-radius: var(--hms-radius-full);
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  KPI CARDS                                                   ║
   ╚══════════════════════════════════════════════════════════════╝ */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.875rem;
  margin-bottom: 1.75rem;
}

.kpi-surface-card {
  padding: 1.25rem 1.125rem;
  background: var(--hms-canvas);
  border-radius: var(--hms-radius-lg);
  border: 1px solid var(--hms-border);
  box-shadow: var(--hms-shadow-xs);
  transition: all var(--t) var(--hms-ease);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  cursor: default;
}

/* Accent top-bar (scaleX from left on hover) */
.kpi-surface-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--hms-accent), var(--hms-accent-soft));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t) var(--hms-ease);
  border-radius: var(--hms-radius-lg) var(--hms-radius-lg) 0 0;
}

.kpi-surface-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--hms-shadow-md);
  border-color: rgba(0, 212, 164, 0.22);
}

.kpi-surface-card:hover::before {
  transform: scaleX(1);
}

.kpi-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hms-stone);
}

.kpi-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--hms-ink);
  line-height: 1.1;
  letter-spacing: -1px;
  animation: numPop 0.45s var(--hms-ease-spring) 0.1s both;
}

.kpi-trend {
  font-size: 0.6875rem;
  color: var(--hms-stone);
  font-weight: 500;
}

.kpi-trend.up {
  color: var(--hms-success);
  font-weight: 600;
}

.kpi-trend.down {
  color: var(--hms-danger);
  font-weight: 600;
}

.kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--hms-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hms-accent-bg);
  color: var(--hms-accent-deep);
  font-size: 1.05rem;
  align-self: flex-start;
  transition: all var(--t) var(--hms-ease-spring);
}

.kpi-surface-card:hover .kpi-icon {
  background: var(--hms-accent);
  color: #fff;
  transform: scale(1.12) rotate(-5deg);
  box-shadow: 0 4px 12px rgba(0, 212, 164, 0.28);
}

/* Semantic highlight variants */
.kpi-surface-card.highlight-warning {
  background: var(--hms-warning-bg);
  border-color: var(--hms-warning-border);
}

.kpi-surface-card.highlight-warning::before {
  background: linear-gradient(90deg, var(--hms-warning), #fbbf24);
  transform: scaleX(1);
}

.kpi-surface-card.highlight-warning .kpi-label {
  color: var(--hms-warning);
}

.kpi-surface-card.highlight-warning .kpi-value {
  color: var(--hms-warning);
}

.kpi-surface-card.highlight-warning .kpi-icon {
  background: rgba(195, 125, 13, 0.10);
  color: var(--hms-warning);
}

.kpi-surface-card.highlight-success {
  background: var(--hms-success-bg);
  border-color: var(--hms-success-border);
}

.kpi-surface-card.highlight-success::before {
  background: linear-gradient(90deg, var(--hms-success), #34d399);
  transform: scaleX(1);
}

.kpi-surface-card.highlight-success .kpi-value {
  color: var(--hms-success);
}

.kpi-surface-card.highlight-danger {
  background: var(--hms-danger-bg);
  border-color: var(--hms-danger-border);
}

.kpi-surface-card.highlight-danger::before {
  background: linear-gradient(90deg, var(--hms-danger), #f87171);
  transform: scaleX(1);
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  DATA SURFACES (Cards, Panels)                               ║
   ╚══════════════════════════════════════════════════════════════╝ */

.data-surface {
  background: var(--hms-canvas);
  border: 1px solid var(--hms-border);
  border-radius: var(--hms-radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--hms-shadow-xs);
  transition: box-shadow var(--t) var(--hms-ease);
}

.data-surface:hover {
  box-shadow: var(--hms-shadow-sm);
}

.widget-surface {
  background: var(--hms-canvas);
  border: 1px solid var(--hms-border);
  border-radius: var(--hms-radius-lg);
  overflow: hidden;
  box-shadow: var(--hms-shadow-xs);
  transition: all var(--t) var(--hms-ease);
}

.widget-surface:hover {
  box-shadow: var(--hms-shadow-sm);
}

.widget-surface-header,
.data-surface-header {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--hms-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--hms-surface-soft);
}

.widget-surface-header h3,
.data-surface-header h2 {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0;
  color: var(--hms-ink);
  letter-spacing: -0.01em;
}

.widget-surface-body {
  padding: 1.25rem;
}

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--hms-surface-soft);
  border-bottom: 1px solid var(--hms-border);
  overflow-x: auto;
}

.filter-bar .form-control:first-child,
.filter-bar input[type="text"]:first-child {
  flex: 1 1 0;
  min-width: 140px;
}

.filter-bar .form-select,
.filter-bar input[type="date"],
.filter-bar button,
.filter-bar a.btn-mintlify-secondary {
  flex-shrink: 0;
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  TABLE                                                       ║
   ╚══════════════════════════════════════════════════════════════╝ */

.table-responsive {
  overflow-x: auto;
}

.table-mintlify {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.table-mintlify thead tr {
  background: var(--hms-surface-soft);
}

.table-mintlify th {
  padding: 0.7rem 1.25rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  color: var(--hms-stone);
  border-bottom: 1px solid var(--hms-border);
  white-space: nowrap;
  user-select: none;
}

.table-mintlify td {
  padding: 0.8125rem 1.25rem;
  border-bottom: 1px solid var(--hms-border-soft);
  vertical-align: middle;
  color: var(--hms-text-secondary);
  transition: background var(--t-fast) var(--hms-ease);
}

.table-mintlify tbody tr {
  transition: background var(--t-fast) var(--hms-ease);
}

.table-mintlify tbody tr:hover {
  background: rgba(0, 212, 164, 0.03);
}

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

.table-mintlify a {
  color: var(--hms-info);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--t-fast) var(--hms-ease);
}

.table-mintlify a:hover {
  color: var(--hms-accent-deep);
}

.table-footer {
  padding: 0.7rem 1.25rem;
  border-top: 1px solid var(--hms-border);
  background: var(--hms-surface-soft);
  font-size: 0.8125rem;
  color: var(--hms-stone);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.empty-state h4 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--hms-ink);
  margin: 0 0 0.4rem;
}

.empty-state p {
  font-size: 0.8125rem;
  color: var(--hms-stone);
  margin: 0 0 1.125rem;
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  BADGES (DESIGN.md badge system)                             ║
   ╚══════════════════════════════════════════════════════════════╝ */

.badge-hms {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.1875rem 0.5625rem;
  border-radius: var(--hms-radius-sm);
  /* {rounded.sm} */
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: all var(--t-fast) var(--hms-ease);
}

.badge-success {
  background: var(--hms-success-bg);
  color: var(--hms-success);
  border-color: var(--hms-success-border);
}

.badge-warning {
  background: var(--hms-warning-bg);
  color: var(--hms-warning);
  border-color: var(--hms-warning-border);
}

.badge-danger {
  background: var(--hms-danger-bg);
  color: var(--hms-danger);
  border-color: var(--hms-danger-border);
}

.badge-info {
  background: var(--hms-info-bg);
  color: var(--hms-info);
  border-color: var(--hms-info-border);
}

.badge-neutral {
  background: var(--hms-surface);
  color: var(--hms-steel);
  border-color: var(--hms-border);
}

.badge-accent {
  background: var(--hms-accent-bg);
  color: var(--hms-accent-deep);
  border-color: rgba(0, 212, 164, 0.22);
}

/* Pill variant (full radius) */
.badge-hms.badge-pill {
  border-radius: var(--hms-radius-full);
  padding: 0.1875rem 0.625rem;
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  FORMS (DESIGN.md text-input system)                         ║
   ╚══════════════════════════════════════════════════════════════╝ */

.form-control,
.form-select {
  border: 1px solid var(--hms-border);
  /* {colors.hairline} */
  border-radius: var(--hms-radius);
  /* {rounded.md} = 8px */
  padding: 0.5625rem 0.875rem;
  height: 38px;
  font-size: 0.875rem;
  font-family: var(--hms-font);
  background: var(--hms-canvas);
  color: var(--hms-ink);
  box-shadow: var(--hms-shadow-xs);
  transition: all var(--t) var(--hms-ease);
  line-height: 1.5;
}

.form-control::placeholder {
  color: var(--hms-text-placeholder);
}

.form-control:hover,
.form-select:hover {
  border-color: #bbb;
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--hms-accent);
  box-shadow: 0 0 0 3px rgba(0, 212, 164, 0.12);
  background: var(--hms-canvas);
}

textarea.form-control {
  height: auto;
  min-height: 90px;
  resize: vertical;
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--hms-slate);
  margin-bottom: 0.35rem;
  display: block;
}

.form-label-modern {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--hms-stone);
  margin-bottom: 0.4rem;
  display: block;
}

.form-text {
  font-size: 0.75rem;
  color: var(--hms-stone);
  margin-top: 0.3rem;
}

.form-check-input:checked {
  background-color: var(--hms-accent);
  border-color: var(--hms-accent);
}

.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(0, 212, 164, 0.14);
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  ALERTS                                                      ║
   ╚══════════════════════════════════════════════════════════════╝ */

.alert {
  border-radius: var(--hms-radius);
  border: 1px solid transparent;
  padding: 0.8125rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  animation: fadeInDown 0.3s var(--hms-ease) both;
}

.alert-success {
  background: var(--hms-success-bg);
  color: var(--hms-success);
  border-color: var(--hms-success-border);
}

.alert-danger {
  background: var(--hms-danger-bg);
  color: var(--hms-danger);
  border-color: var(--hms-danger-border);
}

.alert-warning {
  background: var(--hms-warning-bg);
  color: var(--hms-warning);
  border-color: var(--hms-warning-border);
}

.alert-info {
  background: var(--hms-info-bg);
  color: var(--hms-info);
  border-color: var(--hms-info-border);
}

.alert-secondary {
  background: var(--hms-surface-soft);
  color: var(--hms-stone);
  border-color: var(--hms-border);
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  SKELETON LOADERS                                            ║
   ╚══════════════════════════════════════════════════════════════╝ */

.skeleton {
  background: linear-gradient(90deg,
      var(--hms-surface) 25%,
      var(--hms-border) 50%,
      var(--hms-surface) 75%);
  background-size: 700px 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--hms-radius-sm);
}

.skeleton-text {
  height: 0.8rem;
  margin-bottom: 0.45rem;
}

.skeleton-title {
  height: 1.25rem;
  width: 55%;
  margin-bottom: 0.6rem;
}

.skeleton-box {
  height: 72px;
  border-radius: var(--hms-radius);
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  CARDS (Bootstrap override)                                  ║
   ╚══════════════════════════════════════════════════════════════╝ */

.card {
  border-radius: var(--hms-radius-lg);
  border: 1px solid var(--hms-border);
  box-shadow: var(--hms-shadow-xs);
  transition: all var(--t) var(--hms-ease);
  background: var(--hms-canvas);
}

.card:hover {
  box-shadow: var(--hms-shadow-md);
  transform: translateY(-2px);
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  TENANT SHELL (Mobile-first)                                 ║
   ╚══════════════════════════════════════════════════════════════╝ */

.tenant-shell .sidebar {
  display: none;
}

.tenant-shell .main-wrapper {
  margin-left: 0;
}

.tenant-shell .topbar {
  padding: 0 1rem;
}

.tenant-shell .page-content {
  padding: 1.25rem 1rem 5.5rem;
  max-width: 100%;
}

.tenant-shell .hero-sky-gradient {
  margin: -1.25rem -1rem 1.5rem;
  padding: 1.75rem 1.25rem;
}

.tenant-shell .bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--hms-border);
  z-index: 1050;
  padding: 0.3rem 0 0.45rem;
  display: flex;
  justify-content: space-around;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.05);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.35rem 0.5rem;
  text-decoration: none;
  color: var(--hms-stone);
  font-size: 0.625rem;
  font-weight: 600;
  transition: all var(--t-fast) var(--hms-ease);
  flex: 1;
  border-radius: var(--hms-radius-sm);
}

.bottom-nav-item:hover {
  color: var(--hms-ink);
}

.bottom-nav-item.active {
  color: var(--hms-accent-deep);
}

.bottom-nav-item.active svg {
  filter: drop-shadow(0 1px 4px rgba(0, 212, 164, 0.35));
}

.bottom-nav-item svg {
  width: 20px;
  height: 20px;
  transition: transform var(--t-fast) var(--hms-ease-spring);
}

.bottom-nav-item:hover svg,
.bottom-nav-item.active svg {
  transform: translateY(-2px);
}

.tenant-card {
  background: var(--hms-canvas);
  border: 1px solid var(--hms-border);
  border-radius: var(--hms-radius-lg);
  padding: 1rem 1.125rem;
  margin-bottom: 0.75rem;
  display: block;
  text-decoration: none;
  box-shadow: var(--hms-shadow-xs);
  transition: all var(--t) var(--hms-ease);
  animation: fadeInUp 0.4s var(--hms-ease) both;
}

.tenant-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--hms-shadow-md);
  border-color: rgba(0, 212, 164, 0.2);
}

.tenant-card h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 0.3rem;
  color: var(--hms-ink);
}

.tenant-card p {
  font-size: 0.8125rem;
  color: var(--hms-stone);
  margin: 0;
  line-height: 1.5;
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  RESPONSIVE                                                  ║
   ╚══════════════════════════════════════════════════════════════╝ */

@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--hms-shadow-lg);
    animation: slideInLeft 0.25s var(--hms-ease) both;
  }

  .sidebar-overlay.show {
    display: block;
    animation: fadeIn 0.2s ease;
  }

  .main-wrapper {
    margin-left: 0;
  }

  .topbar-toggle {
    display: flex;
  }

  .page-content {
    padding: 1.25rem;
  }

  .hero-sky-gradient {
    padding: 1.75rem 1.25rem;
    margin: -1.25rem -1.25rem 1.5rem;
  }
}

@media (max-width: 640px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
  }

  .filter-bar {
    padding: 0.625rem 1rem;
    gap: 0.375rem;
  }

  .table-mintlify th,
  .table-mintlify td {
    padding: 0.625rem 0.875rem;
  }

  .data-surface {
    margin-bottom: 1rem;
  }

  .page-content {
    padding: 1rem;
  }
}

/* ╔══════════════════════════════════════════════════════════════╗
   ║  UTILITY CLASSES                                             ║
   ╚══════════════════════════════════════════════════════════════╝ */

.text-accent {
  color: var(--hms-accent-deep) !important;
}

.text-success {
  color: var(--hms-success) !important;
}

.text-warning {
  color: var(--hms-warning) !important;
}

.text-danger {
  color: var(--hms-danger) !important;
}

.text-info {
  color: var(--hms-info) !important;
}

.text-muted {
  color: var(--hms-stone) !important;
}

.text-ink {
  color: var(--hms-ink) !important;
}

.bg-accent-soft {
  background: var(--hms-accent-bg) !important;
}

.border-accent {
  border-color: var(--hms-border-accent) !important;
}

/* Hover-lift utility */
.hover-lift {
  transition: transform var(--t) var(--hms-ease), box-shadow var(--t) var(--hms-ease);
}

.hover-lift:hover {
  transform: translateY(-3px);
  box-shadow: var(--hms-shadow-md);
}

/* Pulse utilities */
.pulse-mint {
  animation: pulseMint 2.5s ease-in-out infinite;
}

.pulse-warn {
  animation: pulseWarn 2.5s ease-in-out infinite;
}

.pulse-danger {
  animation: pulseDanger 2.5s ease-in-out infinite;
}

/* Shimmer placeholder */
.loading-shimmer {
  background: linear-gradient(90deg,
      var(--hms-surface) 25%, var(--hms-border-soft) 50%, var(--hms-surface) 75%);
  background-size: 700px 100%;
  animation: shimmer 1.4s linear infinite;
}

/* Focus ring */
:focus-visible {
  outline: 2px solid var(--hms-accent);
  outline-offset: 2px;
  border-radius: var(--hms-radius-xs);
}

/* Divider */
.hms-divider {
  height: 1px;
  background: var(--hms-border);
  margin: 1rem 0;
}

/* Monospace text */
.mono {
  font-family: var(--hms-font-mono);
}


/* ╔══════════════════════════════════════════════════════════════╗
   ║  RESPONSIVE — Full mobile/tablet overhaul v3.1               ║
   ║  Breakpoints:                                                 ║
   ║    xl  ≥ 1280px  (desktop large)                              ║
   ║    lg  ≥ 1024px  (desktop)                                    ║
   ║    md  ≥ 768px   (iPad portrait, tablet)                      ║
   ║    sm  ≥ 576px   (large phone landscape / iPad mini)          ║
   ║    xs  < 576px   (phone portrait)                             ║
   ╚══════════════════════════════════════════════════════════════╝ */

/* ── CSS custom property overrides per breakpoint ────────────── */

/* iPad (768–1023px): tighter sidebar, moderate spacing */
@media (min-width: 768px) and (max-width: 1023px) {
  :root {
    --hms-sidebar-width: 220px;
  }

  .page-content {
    padding: 1.25rem 1.5rem;
    max-width: 100%;
  }

  .hero-sky-gradient {
    padding: 1.5rem 1.5rem;
    margin: -1.25rem -1.5rem 1.5rem;
  }

  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }

  .kpi-value {
    font-size: 1.5rem;
  }

  .hero-sky-gradient h1 {
    font-size: 1.5rem;
  }
}

/* Tablet sidebar hidden — slide-in (≤ 1023px) */
@media (max-width: 1023px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
    width: var(--hms-sidebar-width);
    z-index: 1050;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--hms-shadow-lg);
    animation: slideInLeft 0.22s var(--hms-ease) both;
  }

  .sidebar-overlay.show {
    display: block;
    animation: fadeIn 0.18s ease both;
  }

  .main-wrapper {
    margin-left: 0 !important;
  }

  .topbar-toggle {
    display: flex !important;
  }
}

/* ── Tablet (768–1023px) layout tweaks ──────────────────────── */
@media (min-width: 768px) and (max-width: 1023px) {

  /* 2-col layout collapses gracefully */
  .col-lg-4,
  .col-lg-5,
  .col-lg-6,
  .col-lg-7,
  .col-lg-8 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* Table: hide low-priority columns on tablet */
  .table-mintlify .hide-tablet {
    display: none;
  }

  .filter-bar {
    gap: 0.5rem;
    padding: 0.75rem 1rem;
  }

  .filter-bar .form-control,
  .filter-bar .form-select {
    flex: 1 1 140px;
    min-width: 0;
  }
}

/* ── Small tablet / large phone landscape (576–767px) ────────── */
@media (min-width: 576px) and (max-width: 767px) {
  :root {
    --hms-sidebar-width: 240px;
  }

  .page-content {
    padding: 1rem 1.125rem;
    max-width: 100%;
  }

  .hero-sky-gradient {
    padding: 1.25rem 1.125rem;
    margin: -1rem -1.125rem 1.25rem;
  }

  .hero-sky-gradient h1 {
    font-size: 1.35rem;
  }

  .hero-sky-gradient p {
    font-size: 0.875rem;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
    margin-bottom: 1.25rem;
  }

  .kpi-value {
    font-size: 1.5rem;
  }

  /* Stack page-header actions below title */
  .page-header.d-flex {
    flex-direction: column;
    align-items: flex-start !important;
  }

  /* Full-width data-surface forms */
  .data-surface {
    margin-bottom: 1rem;
  }

  .data-surface[style*="max-width"] {
    max-width: 100% !important;
  }

  .filter-bar {
    padding: 0.625rem 1rem;
    gap: 0.375rem;
  }

  .filter-bar .form-control,
  .filter-bar .form-select {
    flex: 1 1 130px;
    min-width: 0;
  }

  /* Table density */
  .table-mintlify th {
    padding: 0.625rem 0.875rem;
    font-size: 0.625rem;
  }

  .table-mintlify td {
    padding: 0.625rem 0.875rem;
  }

  .table-mintlify .hide-sm {
    display: none;
  }

  .table-footer {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  /* Topbar compact */
  .topbar {
    padding: 0 1rem;
    gap: 0.5rem;
  }

  .breadcrumb-nav {
    display: none;
  }

  /* Buttons */
  .quick-action-btn,
  .btn-mintlify-secondary {
    padding: 7px 14px;
    font-size: 0.8125rem;
  }

  /* Widget-surface body less padding */
  .widget-surface-body {
    padding: 1rem;
  }
}

/* ── Phone portrait (< 576px) — primary mobile target ────────── */
@media (max-width: 575px) {
  :root {
    --hms-sidebar-width: 82vw;
  }

  /* ── Page structure ── */
  .page-content {
    padding: 0.875rem 0.875rem 4rem;
    max-width: 100%;
  }

  .hero-sky-gradient {
    padding: 1.125rem 0.875rem;
    margin: -0.875rem -0.875rem 1.125rem;
    border-radius: 0;
  }

  .hero-sky-gradient h1 {
    font-size: 1.25rem;
    letter-spacing: -0.3px;
  }

  .hero-sky-gradient p {
    font-size: 0.8125rem;
  }

  /* ── Topbar ── */
  .topbar {
    padding: 0 0.875rem;
    gap: 0.375rem;
  }

  .breadcrumb-nav {
    display: none;
  }

  .topbar-btn {
    padding: 0.375rem;
  }

  /* ── KPI grid: 2 columns, compact ── */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .kpi-surface-card {
    padding: 0.875rem 0.75rem;
    gap: 0.25rem;
  }

  .kpi-value {
    font-size: 1.375rem;
    letter-spacing: -0.5px;
  }

  .kpi-label {
    font-size: 0.625rem;
  }

  .kpi-trend {
    font-size: 0.625rem;
  }

  .kpi-icon {
    width: 28px;
    height: 28px;
    font-size: 0.875rem;
  }

  /* ── Page header: stack vertically on mobile ── */
  .page-header.d-flex,
  .page-header.hero-sky-gradient.d-flex {
    flex-direction: column !important;
    align-items: stretch !important;
    /* stretch để con có thể dùng margin-left:auto */
    gap: 0.75rem !important;
  }

  /* Nút / link action trực tiếp trong page-header → đẩy sang phải */
  .page-header.d-flex>a,
  .page-header.d-flex>button {
    margin-left: auto;
    align-self: flex-end;
  }

  /* Wrapper div chứa nút (ví dụ contracts: d-flex gap-2 align-items-center) */
  .page-header.d-flex>div:last-child:not(:first-child) {
    margin-left: auto;
    align-self: flex-end;
  }

  /* Admin pattern: inner div có inline style justify-content:space-between */
  .page-header>div[style*="space-between"] {
    width: 100%;
    align-items: flex-end !important;
  }

  .page-header>div[style*="space-between"]>a,
  .page-header>div[style*="space-between"]>button {
    margin-left: auto;
  }

  /* hero-sky-gradient > div trực tiếp: chiếm full width */
  .hero-sky-gradient>div {
    width: 100%;
  }

  /* Button/link cuối trong inner wrapper của hero-sky-gradient */
  .hero-sky-gradient>div>a:last-child,
  .hero-sky-gradient>div>button:last-child {
    margin-left: auto;
  }

  .hero-sky-gradient>div>div:last-child:not(:first-child) {
    margin-left: auto;
  }

  .page-header h1 {
    font-size: 1.25rem !important;
  }

  .page-header p {
    font-size: 0.8125rem !important;
  }

  /* ── Buttons: smaller on mobile ── */
  .quick-action-btn,
  .btn-mintlify-secondary {
    padding: 7px 12px;
    font-size: 0.75rem;
  }

  .quick-action-btn.primary,
  .btn-mintlify-primary {
    padding: 8px 14px;
    font-size: 0.75rem;
  }

  /* ── Action button groups: wrap ── */
  .d-flex.gap-2.flex-wrap {
    gap: 0.375rem !important;
  }

  /* ── Forms: full width ── */
  .data-surface[style*="max-width"] {
    max-width: 100% !important;
  }

  .row .col-md-6,
  .row .col-md-4,
  .row .col-md-8,
  .row .col-md-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .form-control,
  .form-select {
    font-size: 0.875rem;
  }

  /* ── Filter bar: optimized mobile grid ── */
  .filter-bar {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    padding: 0.625rem 0.875rem;
    gap: 0.5rem;
  }

  /* Text inputs: full width */
  .filter-bar .form-control:not([type="date"]) {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }

  /* Selects, date inputs, buttons, links: 2-column (50%) */
  .filter-bar .form-select,
  .filter-bar input[type="date"] {
    flex: 1 1 calc(50% - 0.25rem) !important;
    width: auto !important;
    max-width: none !important;
  }

  .filter-bar button,
  .filter-bar a {
    flex: 1 1 calc(50% - 0.25rem) !important;
    width: auto !important;
    max-width: none !important;
    text-align: center;
    justify-content: center;
  }

  /* Fix cho các group filter bên trong filter-bar (trang payments) */
  .filter-bar>div {
    flex-direction: column !important;
    border-left: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
    width: 100%;
  }

  .filter-bar>div>label {
    align-self: flex-start;
    margin-bottom: -4px;
  }

  /* ── Tables: hide low-priority columns, reduce padding ── */
  .table-mintlify th,
  .table-mintlify td {
    padding: 0.5625rem 0.625rem;
    font-size: 0.75rem;
  }

  .table-mintlify th {
    font-size: 0.5625rem;
  }

  /* Columns to hide on phone - use explicit .hide-mobile class instead of arbitrary nth-child */
  .table-mintlify .hide-mobile {
    display: none;
  }

  .table-footer {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
    padding: 0.625rem 0.875rem;
  }

  /* ── Widget surface ── */
  .widget-surface-header,
  .data-surface-header {
    padding: 0.75rem 0.875rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .widget-surface-body {
    padding: 0.875rem;
  }

  /* ── 2-col grid collapses to 1 ── */
  .col-lg-4,
  .col-lg-5,
  .col-lg-6,
  .col-lg-7,
  .col-lg-8,
  .col-md-6,
  .col-md-4,
  .col-md-8 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }

  /* ── Revenue table: compact ── */
  .table-mintlify td [style*="min-width:120px"] {
    min-width: 80px !important;
  }

  .table-mintlify td [style*="min-width:60px"] {
    min-width: 50px !important;
  }

  /* ── Audit log detail: stacked ── */
  .row.g-3>[class*="col-lg"] {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* ── Hero gradient: no negative margin radius ── */
  .hero-sky-gradient {
    border-radius: 0 !important;
  }

  /* ── Pagination: compact ── */
  .table-footer .d-flex.gap-1 {
    gap: 0.25rem !important;
  }

  .table-footer a[style*="padding:6px"] {
    padding: 5px 10px !important;
    font-size: 0.75rem;
  }

  /* ── Form inline submit + cancel: stack ── */
  .d-flex.gap-2.mt-3 {
    flex-direction: column;
    gap: 0.5rem !important;
  }

  .d-flex.gap-2.mt-3>* {
    width: 100%;
    justify-content: center;
  }

  /* ── Revenue KPI cards: 2-col but smaller ── */
  .kpi-grid .kpi-surface-card[style*="cursor:pointer"] {
    cursor: pointer;
  }

  /* ── Table responsive scroll hint ── */
  .table-responsive {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .table-responsive::after {
    content: '';
    position: sticky;
    right: 0;
    width: 24px;
    height: 100%;
    background: linear-gradient(to left, rgba(255, 255, 255, 0.9), transparent);
    pointer-events: none;
    float: right;
  }
}

/* ── Specific Phone Breakpoints (Dimensions) ─────────────────── */

/* Toàn cục chống tràn ngang (Global anti-overflow cho Manager JSPs) */
@media (max-width: 575px) {

  body,
  .app-shell,
  .main-wrapper {
    max-width: 100vw;
    overflow-x: clip;
  }

  .row {
    margin-left: 0;
    margin-right: 0;
  }

  .row>* {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .data-surface {
    padding: 1rem !important;
  }

  /* Chống zoom tự động trên iOS khi focus vào form */
  .form-control,
  .form-select {
    font-size: 16px !important;
  }
}

/* iPhone 14 Pro Max / 15 Pro Max (430px) */
@media (max-width: 430px) {
  .page-content {
    padding: 0.875rem 0.875rem 4rem;
  }

  .hero-sky-gradient {
    padding: 1.25rem 1rem;
    margin: -0.875rem -0.875rem 1.125rem;
  }

  .kpi-grid {
    gap: 0.5rem;
  }

  .table-mintlify th,
  .table-mintlify td {
    font-size: 0.75rem;
    padding: 0.5rem;
  }

  .form-control,
  .form-select {
    width: 100%;
    max-width: 100%;
  }

  /* Override for filter-bar: keep 2-col grid */
  .filter-bar .form-control:not([type="date"]) {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }

  .filter-bar .form-select,
  .filter-bar input[type="date"] {
    flex: 1 1 calc(50% - 0.25rem) !important;
    width: auto !important;
    max-width: none !important;
  }

  .filter-bar button,
  .filter-bar a {
    flex: 1 1 calc(50% - 0.25rem) !important;
    width: auto !important;
    max-width: none !important;
  }
}

/* iPhone 14 Pro / 15 Pro (393px) & iPhone 12 Pro / 13 Pro (390px) */
@media (max-width: 393px) {
  .hero-sky-gradient h1 {
    font-size: 1.15rem;
  }

  .kpi-value {
    font-size: 1.25rem;
  }
}

/* iPhone SE / 8 / X / 11 Pro (375px) */
@media (max-width: 375px) {
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.375rem;
  }

  .hero-sky-gradient h1 {
    font-size: 1.1rem;
  }

  .hero-sky-gradient p {
    font-size: 0.75rem;
  }

  .page-content {
    padding: 0.75rem 0.75rem 4rem;
  }

  .hero-sky-gradient {
    padding: 1rem 0.75rem;
    margin: -0.75rem -0.75rem 1rem;
  }

  .topbar {
    padding: 0 0.75rem;
  }

  .filter-bar {
    padding: 0.5rem 0.75rem;
  }
}

/* Samsung Galaxy S8+ / S21 / S22 (360px) */
@media (max-width: 360px) {
  .kpi-value {
    font-size: 1.15rem;
  }

  .table-mintlify th,
  .table-mintlify td {
    font-size: 0.6875rem;
    padding: 0.4rem;
  }

  .quick-action-btn,
  .btn-mintlify-secondary,
  .btn-mintlify-primary {
    font-size: 0.7rem;
    padding: 6px 10px;
    width: 100%;
    justify-content: center;
    margin-bottom: 4px;
  }

  /* Override for filter-bar buttons: keep 2-col */
  .filter-bar button,
  .filter-bar a {
    flex: 1 1 calc(50% - 0.25rem) !important;
    width: auto !important;
    margin-bottom: 0 !important;
  }

  .data-surface {
    padding: 0.75rem !important;
  }
}

/* Galaxy Fold / Small screens (< 320px) */
@media (max-width: 320px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .hero-sky-gradient h1 {
    font-size: 1rem;
  }

  .table-responsive {
    overflow-x: auto;
    width: 100%;
    display: block;
  }
}

/* ── Touch-friendly tap targets ──────────────────────────────── */
@media (pointer: coarse) {

  /* Minimum 44×44px tap target for interactive elements */
  .sidebar-link {
    min-height: 44px;
    padding-top: 0.625rem;
    padding-bottom: 0.625rem;
  }

  .quick-action-btn,
  .btn-mintlify-secondary,
  .btn-mintlify-primary {
    min-height: 40px;
  }

  .form-control,
  .form-select {
    min-height: 44px;
    height: 44px;
  }

  .topbar-toggle {
    min-width: 44px;
    min-height: 44px;
    padding: 0.625rem;
  }

  .topbar-btn {
    min-width: 40px;
    min-height: 40px;
  }

  /* Disable hover transforms on touch — prevent sticky states */
  .kpi-surface-card:hover {
    transform: none;
  }

  .quick-action-btn:hover {
    transform: none;
  }

  .btn-mintlify-primary:hover,
  .btn-mintlify-secondary:hover {
    transform: none;
  }

  .card:hover {
    transform: none;
  }

  .table-mintlify tbody tr:hover {
    background: transparent;
  }
}

/* ── Print layout ────────────────────────────────────────────── */
@media print {

  .sidebar,
  .topbar,
  .sidebar-overlay,
  .quick-action-btn,
  .btn-mintlify-primary,
  .btn-mintlify-secondary,
  .filter-bar,
  .table-footer .d-flex,
  form[method="post"],
  [onclick] {
    display: none !important;
  }

  .main-wrapper {
    margin-left: 0 !important;
  }

  .page-content {
    padding: 0 !important;
  }

  .hero-sky-gradient {
    background: none !important;
    animation: none !important;
    border-bottom: 2px solid #000;
    padding: 0.75rem 0;
    margin-bottom: 1rem;
  }

  .data-surface,
  .widget-surface {
    box-shadow: none !important;
    border: 1px solid #ccc;
  }

  .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .table-mintlify .hide-mobile,
  .table-mintlify .hide-tablet {
    display: table-cell !important;
  }
}