/* ============================================================
   PharmaPro — Main Design System
   Futuristic Dark Glassmorphism · Apple-Inspired
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ─────────────────────────────────────────────────────────────
   1. CSS CUSTOM PROPERTIES
   ───────────────────────────────────────────────────────────── */
:root {
  /* ── Core palette ── */
  --color-bg-deep:        #050508;
  --color-bg-surface:     rgba(18, 18, 25, 0.6);
  --color-bg-elevated:    rgba(25, 25, 35, 0.65);
  --color-bg-card:        rgba(255, 255, 255, 0.03);
  --color-bg-card-hover:  rgba(255, 255, 255, 0.08);
  --color-bg-input:       rgba(255, 255, 255, 0.04);
  --color-bg-input-focus: rgba(255, 255, 255, 0.12);

  /* ✨ Glass */
  --glass-bg:             rgba(255, 255, 255, 0.05);
  --glass-bg-medium:      rgba(255, 255, 255, 0.08);
  --glass-bg-strong:      rgba(255, 255, 255, 0.12);
  --glass-border:         rgba(255, 255, 255, 0.1);
  --glass-border-light:   rgba(255, 255, 255, 0.15);
  --glass-border-focus:   rgba(255, 255, 255, 0.3);
  --glass-blur:           blur(30px);
  --glass-blur-heavy:     blur(60px);

  /* ── Accents ── */
  --accent-primary:       #00f2fe;
  --accent-primary-rgb:   0, 242, 254;
  --accent-primary-dim:   rgba(0, 242, 254, 0.15);
  --accent-primary-glow:  rgba(0, 242, 254, 0.4);
  --accent-secondary:     #4facfe;
  --accent-secondary-rgb: 79, 172, 254;
  --accent-secondary-dim: rgba(79, 172, 254, 0.15);
  
  --color-success:        #00f2fe;
  --color-success-rgb:    0, 242, 254;
  --color-success-dim:    rgba(0, 242, 254, 0.15);
  --color-danger:         #ff0844;
  --color-danger-rgb:     255, 8, 68;
  --color-danger-dim:     rgba(255, 8, 68, 0.15);
  --color-warning:        #f6d365;
  --color-warning-rgb:    246, 211, 101;
  --color-warning-dim:    rgba(246, 211, 101, 0.15);
  --color-info:           #8E2DE2;
  --color-info-rgb:       142, 45, 226;
  --color-info-dim:       rgba(142, 45, 226, 0.15);

  /* ── Text ── */
  --text-primary:         #ffffff;
  --text-secondary:       #a0aec0;
  --text-tertiary:        #718096;
  --text-inverse:         #000000;

  /* ── Spacing ── */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* ── Radii ── */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --radius-2xl:  24px;
  --radius-full: 9999px;

  /* ── Shadows ── */
  --shadow-sm:    0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md:    0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg:    0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-xl:    0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow:  0 0 20px rgba(0, 212, 255, 0.15);
  --shadow-glow-strong: 0 0 30px rgba(0, 212, 255, 0.25);
  --shadow-inner: inset 0 1px 0 rgba(255, 255, 255, 0.05);

  /* ── Transitions ── */
  --ease-smooth:  cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in:      cubic-bezier(0.4, 0, 1, 1);
  --ease-out:     cubic-bezier(0, 0, 0.2, 1);
  --duration-fast:   150ms;
  --duration-normal: 300ms;
  --duration-slow:   500ms;
  --transition:  all 0.3s var(--ease-smooth);
  --transition-fast: all 0.15s var(--ease-smooth);

  /* ── Layout ── */
  --sidebar-width:   280px;
  --sidebar-collapsed: 72px;
  --topbar-height:   72px;
  --content-max:     1400px;

  /* ── Z-index ── */
  --z-base:     1;
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-overlay:  500;
  --z-modal:    1000;
  --z-toast:    2000;
}

/* ─────────────────────────────────────────────────────────────
   2. RESET & BASE
   ───────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--color-bg-deep);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Ambient Background (Futuristic Apple Vision Style) ── */
.ambient-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, #0a0a14 0%, #030305 100%);
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: floatOrb 20s infinite ease-in-out alternate;
}

.glow-orb.orb-1 {
  width: 45vw;
  height: 45vw;
  background: rgba(0, 242, 254, 0.12);
  top: -15vw;
  left: -15vw;
  animation-delay: 0s;
}

.glow-orb.orb-2 {
  width: 55vw;
  height: 55vw;
  background: rgba(142, 45, 226, 0.08);
  bottom: -20vw;
  right: -10vw;
  animation-delay: -5s;
}

.glow-orb.orb-3 {
  width: 35vw;
  height: 35vw;
  background: rgba(0, 212, 255, 0.08);
  top: 30%;
  left: 50%;
  animation-delay: -10s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(5%, 10%) scale(1.1); }
  100% { transform: translate(-5%, -5%) scale(0.9); }
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: var(--transition-fast);
}
a:hover { color: #33ddff; }

img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }
h1, h2, h3, h4, h5, h6 { font-weight: 600; line-height: 1.3; color: var(--text-primary); }
h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
p  { color: var(--text-secondary); line-height: 1.7; }

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 212, 255, 0.4);
  border-radius: var(--radius-full);
  transition: var(--transition);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 212, 255, 0.6);
}

/* ── Selection ── */
::selection {
  background: rgba(0, 212, 255, 0.3);
  color: #fff;
}
::-moz-selection {
  background: rgba(0, 212, 255, 0.3);
  color: #fff;
}

/* ─────────────────────────────────────────────────────────────
   3. APP LAYOUT
   ───────────────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: calc(100% - var(--sidebar-width));
  max-width: calc(100% - var(--sidebar-width));
}

/* ─────────────────────────────────────────────────────────────
   4. SIDEBAR
   ───────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur-heavy);
  -webkit-backdrop-filter: var(--glass-blur-heavy);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sticky);
  transition: width 0.4s var(--ease-smooth);
  overflow: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(180deg, rgba(0, 212, 255, 0.04) 0%, transparent 100%);
  pointer-events: none;
}

/* ── Sidebar Header ── */
.sidebar-header {
  padding: 20px 15px;
  border-bottom: 1px solid var(--glass-border);
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.sidebar-logo-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.25);
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  justify-content: center;
}

.sidebar-logo-text h2 {
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.01em;
  white-space: normal;
  line-height: 1.2;
}

.sidebar-logo-text span {
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: normal;
  line-height: 1.4;
  margin-top: 2px;
}

.sidebar-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.sidebar-toggle-arrow {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.sidebar-toggle-arrow:hover {
  background: var(--glass-bg-medium);
  color: #fff;
}

body.sidebar-collapsed .sidebar-toggle-arrow {
  transform: rotate(180deg);
}

body.sidebar-collapsed .sidebar-logo-text {
  display: none;
}

body.sidebar-collapsed .sidebar-header {
  flex-direction: column;
  padding: 15px 0;
  gap: 15px;
}

/* ── Sidebar Nav ── */
.sidebar-nav {
  flex: 1;
  padding: var(--space-4) var(--space-3);
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section-title {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  padding: var(--space-4) var(--space-3) var(--space-2);
  margin-top: var(--space-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  cursor: pointer;
  margin-bottom: 2px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: var(--glass-bg-medium);
  color: var(--text-primary);
  border-color: var(--glass-border);
}

.nav-item.active {
  background: var(--accent-primary-dim);
  color: var(--accent-primary);
  border-color: rgba(0, 212, 255, 0.15);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.08);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--accent-primary);
  border-radius: var(--radius-full);
  box-shadow: 0 0 8px var(--accent-primary);
}

.nav-item-icon {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-item.active .nav-item-icon { opacity: 1; }

.nav-item-badge {
  margin-left: auto;
  background: var(--color-danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}

/* ── Sidebar Footer ── */
.sidebar-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  transition: var(--transition);
  cursor: pointer;
}

.sidebar-user:hover {
  background: var(--glass-bg-medium);
}

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

.sidebar-user-info .name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-info .role {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sidebar-version {
  font-size: 0.6rem;
  color: var(--text-tertiary);
  text-align: center;
  padding-top: var(--space-2);
  letter-spacing: 0.05em;
}

/* ─────────────────────────────────────────────────────────────
   5. TOP BAR
   ───────────────────────────────────────────────────────────── */
.top-bar {
  width: 100%;
  height: var(--topbar-height);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-8);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  gap: var(--space-6);
}

.mobile-nav {
  display: none;
}

.search-global#poda {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex: 1;
  max-width: 480px;
  height: 45px;
  margin: 0;
}

#poda .white,
#poda .border,
#poda .darkBorderBg,
#poda .glow {
  height: 100%;
  width: 100%;
  position: absolute;
  overflow: hidden;
  z-index: -1;
  border-radius: 12px;
  filter: blur(3px);
}

#poda .search-input {
  background-color: transparent;
  border: none;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  color: white;
  padding: 0 45px 0 50px;
  font-size: 0.9rem;
  box-sizing: border-box;
  outline: none;
}

#poda .search-input::placeholder {
  color: #c0b9c0;
}

#poda #main {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  background-color: #010201;
  border-radius: 10px;
}

#main:focus-within > #input-mask {
  display: none;
}

#input-mask {
  display: none;
  pointer-events: none;
  width: 100px;
  height: 20px;
  position: absolute;
  background: linear-gradient(90deg, transparent, #010201);
  top: 12px;
  left: 70px;
}

#pink-mask {
  pointer-events: none;
  width: 30px;
  height: 20px;
  position: absolute;
  background: #cf30aa;
  top: 10px;
  left: 5px;
  filter: blur(20px);
  opacity: 0.8;
  transition: all 2s;
}

#main:hover > #pink-mask {
  opacity: 0;
}

#poda .white {
  filter: blur(2px);
  border-radius: 10px;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
}

#poda .white::before {
  content: "";
  z-index: -2;
  text-align: center;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(83deg);
  position: absolute;
  width: 800px;
  height: 800px;
  background-repeat: no-repeat;
  background-position: 0 0;
  filter: brightness(1.4);
  background-image: conic-gradient(rgba(0, 0, 0, 0) 0%, #a099d8, rgba(0, 0, 0, 0) 8%, rgba(0, 0, 0, 0) 50%, #dfa2da, rgba(0, 0, 0, 0) 58%);
  transition: all 2s;
}

#poda .border {
  filter: blur(0.5px);
  border-radius: 11px;
  width: calc(100% - 2px);
  height: calc(100% - 2px);
}

#poda .border::before {
  content: "";
  z-index: -2;
  text-align: center;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(70deg);
  position: absolute;
  width: 800px;
  height: 800px;
  filter: brightness(1.3);
  background-repeat: no-repeat;
  background-position: 0 0;
  background-image: conic-gradient(#1c191c, #402fb5 5%, #1c191c 14%, #1c191c 50%, #cf30aa 60%, #1c191c 64%);
  transition: all 2s;
}

#poda .darkBorderBg::before {
  content: "";
  z-index: -2;
  text-align: center;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(82deg);
  position: absolute;
  width: 800px;
  height: 800px;
  background-repeat: no-repeat;
  background-position: 0 0;
  background-image: conic-gradient(rgba(0, 0, 0, 0), #18116a, rgba(0, 0, 0, 0) 10%, rgba(0, 0, 0, 0) 50%, #6e1b60, rgba(0, 0, 0, 0) 60%);
  transition: all 2s;
}

#poda:hover > .darkBorderBg::before {
  transform: translate(-50%, -50%) rotate(262deg);
}

#poda:hover > .glow::before {
  transform: translate(-50%, -50%) rotate(240deg);
}

#poda:hover > .white::before {
  transform: translate(-50%, -50%) rotate(263deg);
}

#poda:hover > .border::before {
  transform: translate(-50%, -50%) rotate(250deg);
}

#poda:focus-within > .darkBorderBg::before {
  transform: translate(-50%, -50%) rotate(442deg);
  transition: all 4s;
}

#poda:focus-within > .glow::before {
  transform: translate(-50%, -50%) rotate(420deg);
  transition: all 4s;
}

#poda:focus-within > .white::before {
  transform: translate(-50%, -50%) rotate(443deg);
  transition: all 4s;
}

#poda:focus-within > .border::before {
  transform: translate(-50%, -50%) rotate(430deg);
  transition: all 4s;
}

#poda .glow {
  overflow: hidden;
  filter: blur(30px);
  opacity: 0.4;
  height: 120%;
  width: 120%;
}

#poda .glow::before {
  content: "";
  z-index: -2;
  text-align: center;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(60deg);
  position: absolute;
  width: 999px;
  height: 999px;
  background-repeat: no-repeat;
  background-position: 0 0;
  background-image: conic-gradient(#000, #402fb5 5%, #000 38%, #000 50%, #cf30aa 60%, #000 87%);
  transition: all 2s;
}

#filter-icon {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  height: calc(100% - 8px);
  width: 38px;
  isolation: isolate;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(180deg, #161329, black, #1d1b4b);
  border: 1px solid transparent;
  cursor: pointer;
}

.filterBorder {
  height: calc(100% - 8px);
  width: 40px;
  position: absolute;
  overflow: hidden;
  top: 4px;
  right: 3px;
  border-radius: 8px;
}

.filterBorder::before {
  content: "";
  text-align: center;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(90deg);
  position: absolute;
  width: 600px;
  height: 600px;
  background-repeat: no-repeat;
  background-position: 0 0;
  filter: brightness(1.35);
  background-image: conic-gradient(rgba(0, 0, 0, 0), #3d3a4f, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0) 50%, #3d3a4f, rgba(0, 0, 0, 0) 100%);
  animation: rotate 4s linear infinite;
}

#search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
}

@keyframes rotate {
  100% {
    transform: translate(-50%, -50%) rotate(450deg);
  }
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.mobile-top-brand {
  display: none;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}

.user-avatar-mobile {
  display: none;
}

.user-menu:hover {
  background: var(--glass-bg-medium);
  border-color: var(--glass-border);
}

.user-menu-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.user-menu-name {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  color: var(--text-primary);
  line-height: 1.2;
}

.user-menu-role {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  line-height: 1.2;
}

/* ─────────────────────────────────────────────────────────────
   6. PAGE HEADER
   ───────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--space-8);
  gap: var(--space-4);
  flex-wrap: wrap;
}

.page-header-info h1 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-1);
}

.page-header-info p {
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

.page-header-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
}

.content-area {
  flex: 1;
  padding: var(--space-8);
}

/* ─────────────────────────────────────────────────────────────
   7. CARDS
   ───────────────────────────────────────────────────────────── */
.card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm), var(--shadow-inner);
  transition: var(--transition);
  overflow: hidden;
  position: relative;
}

.card:hover {
  background: var(--color-bg-card-hover);
  border-color: var(--glass-border-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.card-body {
  padding: var(--space-6);
}

.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* ── Stat Cards ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-6);
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-5);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: default;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0;
  transition: opacity 0.5s var(--ease-smooth);
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: var(--glass-border-light);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.stat-card:hover::after { opacity: 0.5; }

.stat-card.stat-cyan::after    { background: var(--accent-primary); }
.stat-card.stat-violet::after  { background: var(--accent-secondary); }
.stat-card.stat-emerald::after { background: var(--color-success); }
.stat-card.stat-amber::after   { background: var(--color-warning); }

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.1);
}

.stat-icon.icon-cyan    { background: var(--accent-primary-dim); color: var(--accent-primary); }
.stat-icon.icon-violet  { background: var(--accent-secondary-dim); color: var(--accent-secondary); }
.stat-icon.icon-emerald { background: var(--color-success-dim); color: var(--color-success); }
.stat-icon.icon-amber   { background: var(--color-warning-dim); color: var(--color-warning); }
.stat-icon.icon-danger  { background: var(--color-danger-dim); color: var(--color-danger); }

.stat-content { flex: 1; min-width: 0; }

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: var(--space-1);
  font-weight: 500;
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: var(--space-2);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.stat-trend.up   { color: var(--color-success); background: var(--color-success-dim); }
.stat-trend.down { color: var(--color-danger);  background: var(--color-danger-dim); }

/* ─────────────────────────────────────────────────────────────
   8. TABLES
   ───────────────────────────────────────────────────────────── */
.data-table-wrapper {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--glass-border);
  gap: var(--space-4);
  flex-wrap: wrap;
}

.table-toolbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
}

.table-toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: var(--z-base);
}

.data-table th {
  padding: var(--space-4) var(--space-5);
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
  user-select: none;
}

.data-table td {
  padding: var(--space-4) var(--space-5);
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: var(--transition-fast);
}

.data-table tbody tr {
  transition: var(--transition-fast);
}

.data-table tbody tr:hover {
  background: var(--glass-bg-medium);
}

.data-table tbody tr:hover td {
  color: var(--text-primary);
}

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

.table-actions {
  display: flex;
  gap: var(--space-2);
  opacity: 0.5;
  transition: var(--transition-fast);
}

.data-table tbody tr:hover .table-actions {
  opacity: 1;
}

/* ─────────────────────────────────────────────────────────────
   9. FORMS
   ───────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--color-bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-tertiary);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  background: var(--color-bg-input-focus);
  border-color: rgba(0, 212, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), 0 0 15px rgba(0, 212, 255, 0.08);
}

.form-input:disabled,
.form-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

.form-row {
  display: flex;
  gap: var(--space-5);
}

.form-row .form-group { flex: 1; }

.form-error {
  font-size: 0.75rem;
  color: var(--color-danger);
  margin-top: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.form-error::before {
  content: '⚠';
  font-size: 0.8rem;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}

/* ─────────────────────────────────────────────────────────────
   10. BUTTONS
   ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
  outline: none;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

@media (hover: hover) {
  .btn:hover {
    transform: translateY(-1px) scale(1.02);
  }
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* Primary */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), #00a0cc);
  color: var(--text-inverse);
  font-weight: 600;
  border: none;
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 6px 25px rgba(0, 212, 255, 0.35), var(--shadow-glow-strong);
}

/* Secondary (ghost) */
.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--glass-border-light);
}

.btn-secondary:hover {
  background: var(--glass-bg-medium);
  color: var(--text-primary);
  border-color: var(--glass-border-focus);
  box-shadow: var(--shadow-sm);
}

/* Danger */
.btn-danger {
  background: linear-gradient(135deg, var(--color-danger), #dc2626);
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  box-shadow: 0 6px 25px rgba(239, 68, 68, 0.35);
}

/* Success */
.btn-success {
  background: linear-gradient(135deg, var(--color-success), #059669);
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
  box-shadow: 0 6px 25px rgba(16, 185, 129, 0.35);
}

/* Warning */
.btn-warning {
  background: linear-gradient(135deg, var(--color-warning), #d97706);
  color: var(--text-inverse);
  border: none;
}

/* Sizes */
.btn-sm {
  padding: 6px 14px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

/* Icon button */
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
  font-size: 1.1rem;
}

.btn-icon.btn-sm {
  width: 32px;
  height: 32px;
  font-size: 0.9rem;
}

.btn-icon.btn-lg {
  width: 48px;
  height: 48px;
  font-size: 1.3rem;
}

/* Button group */
.btn-group {
  display: inline-flex;
  gap: 0;
}

.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.btn-group .btn:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.btn-group .btn + .btn {
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

/* Button Loading State */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.2em;
  height: 1.2em;
  margin-top: -0.6em;
  margin-left: -0.6em;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: button-spin 0.6s linear infinite;
}
@keyframes button-spin {
  to { transform: rotate(360deg); }
}

/* ─────────────────────────────────────────────────────────────
   11. MODALS
   ───────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease-smooth), visibility 0.3s;
  padding: var(--space-6);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--color-bg-elevated);
  backdrop-filter: var(--glass-blur-heavy);
  -webkit-backdrop-filter: var(--glass-blur-heavy);
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl), 0 0 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.92) translateY(10px);
  opacity: 0;
  transition: transform 0.35s var(--ease-bounce), opacity 0.3s var(--ease-smooth);
}

.modal.modal-lg {
  max-width: 700px;
}

.modal.modal-xl {
  max-width: 900px;
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-header {
  padding: var(--space-6) var(--space-6) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 1.15rem;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--glass-bg-medium);
  border-radius: var(--radius-full);
  color: var(--text-tertiary);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--glass-bg-strong);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-4) var(--space-6) var(--space-6);
}

.modal-footer {
  padding: var(--space-4) var(--space-6) var(--space-6);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  border-top: 1px solid var(--glass-border);
}

@keyframes modalIn {
  from {
    transform: scale(0.9) translateY(20px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* ─────────────────────────────────────────────────────────────
   12. BADGES & TAGS
   ───────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.badge-success { background: var(--color-success-dim); color: var(--color-success); }
.badge-warning { background: var(--color-warning-dim); color: var(--color-warning); }
.badge-danger  { background: var(--color-danger-dim);  color: var(--color-danger); }
.badge-info    { background: var(--color-info-dim);    color: var(--color-info); }
.badge-primary { background: var(--accent-primary-dim); color: var(--accent-primary); }
.badge-secondary { background: var(--accent-secondary-dim); color: var(--accent-secondary); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--glass-bg-medium);
  border: 1px solid var(--glass-border);
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.tag-close {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-tertiary);
  font-size: 0.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.tag-close:hover { background: var(--color-danger-dim); color: var(--color-danger); }

/* ─────────────────────────────────────────────────────────────
   13. TOASTS / NOTIFICATIONS
   ───────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 380px;
}

.toast {
  background: var(--color-bg-elevated);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  border-left: 3px solid var(--text-tertiary);
  animation: toastIn 0.4s var(--ease-bounce) forwards;
  position: relative;
}

.toast-success { border-left-color: var(--color-success); }
.toast-error   { border-left-color: var(--color-danger); }
.toast-warning { border-left-color: var(--color-warning); }
.toast-info    { border-left-color: var(--accent-primary); }

.toast-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-success .toast-icon { color: var(--color-success); }
.toast-error .toast-icon   { color: var(--color-danger); }
.toast-warning .toast-icon { color: var(--color-warning); }
.toast-info .toast-icon    { color: var(--accent-primary); }

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.toast-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 2px;
  transition: var(--transition-fast);
}

.toast-close:hover { color: var(--text-primary); }

.toast.removing { animation: toastOut 0.3s var(--ease-in) forwards; }

@keyframes toastIn {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

/* ─────────────────────────────────────────────────────────────
   14. EMPTY STATES
   ───────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-12) var(--space-6);
  min-height: 300px;
}

.empty-state-icon {
  font-size: 4rem;
  color: var(--text-tertiary);
  opacity: 0.4;
  margin-bottom: var(--space-6);
  animation: float 4s ease-in-out infinite;
}

.empty-state-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.empty-state-text {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  max-width: 360px;
  margin-bottom: var(--space-6);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

/* ─────────────────────────────────────────────────────────────
   15. LOADING
   ───────────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text  { height: 14px; margin-bottom: var(--space-2); }
.skeleton-title { height: 22px; width: 60%; margin-bottom: var(--space-3); }
.skeleton-circle { border-radius: var(--radius-full); }
.skeleton-card  { height: 120px; border-radius: var(--radius-lg); }

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--accent-primary);
  border-radius: var(--radius-full);
  animation: spin 0.7s linear infinite;
}

.spinner-sm { width: 20px; height: 20px; border-width: 2px; }
.spinner-lg { width: 48px; height: 48px; border-width: 4px; }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  z-index: var(--z-overlay);
}

/* ─────────────────────────────────────────────────────────────
   16. LOGIN PAGE
   ───────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(
    135deg,
    #0a0a1a 0%,
    #0d1025 20%,
    #12082e 40%,
    #0a1628 60%,
    #0e0a20 80%,
    #0a0a1a 100%
  );
  background-size: 300% 300%;
  animation: gradientShift 15s ease infinite;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  align-items: flex-start;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.08) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  pointer-events: none;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.08) 0%, transparent 70%);
  bottom: -80px;
  left: -80px;
  pointer-events: none;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  25%  { background-position: 50% 0%; }
  50%  { background-position: 100% 50%; }
  75%  { background-position: 50% 100%; }
  100% { background-position: 0% 50%; }
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--glass-bg-medium);
  backdrop-filter: var(--glass-blur-heavy);
  -webkit-backdrop-filter: var(--glass-blur-heavy);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-10);
  box-shadow: var(--shadow-xl), 0 0 80px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 1;
  animation: fadeIn 0.8s var(--ease-smooth);
  margin: auto;
}

.login-logo {
  text-align: center;
  margin-bottom: var(--space-8);
}

.login-logo h1 {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
  text-shadow: none;
  filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.2));
}

.login-logo p {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: var(--space-2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.login-tabs {
  display: flex;
  background: var(--glass-bg);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: var(--space-8);
  position: relative;
  border: 1px solid var(--glass-border);
}

.login-tab {
  flex: 1;
  padding: var(--space-3);
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  position: relative;
  z-index: 1;
  border: none;
  background: none;
}

.login-tab.active {
  color: var(--text-primary);
  background: var(--glass-bg-strong);
  box-shadow: var(--shadow-sm);
}

.login-tab:hover:not(.active) {
  color: var(--text-secondary);
}

.login-form {
  display: none;
  flex-direction: column;
  gap: var(--space-5);
}

.login-form.active {
  display: flex;
}

.login-form .btn-primary {
  width: 100%;
  padding: 14px;
  font-size: 0.95rem;
  margin-top: var(--space-2);
}

.login-footer {
  text-align: center;
  margin-top: var(--space-6);
  position: relative;
}

.secret-trigger {
  font-size: 0.8rem;
  opacity: 0.5;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-tertiary);
  background: none;
  border: none;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  display: inline-block;
}

.secret-trigger:hover { opacity: 0.45; }

.secret-modal .modal {
  max-width: 380px;
}

.secret-modal .modal-body {
  text-align: center;
}

.secret-input {
  text-align: center;
  letter-spacing: 0.15em;
  font-size: 1.1rem;
}

/* ─────────────────────────────────────────────────────────────
   17. POS PAGE
   ───────────────────────────────────────────────────────────── */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-6);
  height: calc(100vh - var(--topbar-height) - 64px);
}

.pos-products {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pos-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--space-4);
  overflow-y: auto;
  padding: var(--space-2);
  flex: 1;
}

.pos-product-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.pos-product-card:hover {
  background: var(--glass-bg-strong);
  border-color: rgba(0, 212, 255, 0.2);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.pos-product-card:active {
  transform: scale(0.97);
}

.pos-product-icon {
  font-size: 2rem;
  padding: var(--space-3);
}

.pos-product-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

.pos-product-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.pos-product-stock {
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

.pos-cart {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pos-cart-header {
  padding: var(--space-5) var(--space-5);
  border-bottom: 1px solid var(--glass-border);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pos-cart-items {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3);
}

.pos-cart-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: var(--transition-fast);
}

.pos-cart-item:hover { background: var(--glass-bg); border-radius: var(--radius-sm); }

.pos-cart-item-info {
  flex: 1;
  min-width: 0;
}

.pos-cart-item-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-cart-item-price {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.pos-cart-item-qty {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.pos-cart-item-qty button {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-secondary);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.pos-cart-item-qty button:hover {
  background: var(--accent-primary-dim);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.pos-cart-item-total {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-primary);
  min-width: 60px;
  text-align: right;
}

.pos-total {
  border-top: 1px solid var(--glass-border);
  padding: var(--space-5);
}

.pos-total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-2);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.pos-total-row.grand-total {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--glass-border);
}

.pos-total .btn-primary {
  width: 100%;
  margin-top: var(--space-4);
  padding: 14px;
  font-size: 1rem;
}

/* ─────────────────────────────────────────────────────────────
   18. MISCELLANEOUS
   ───────────────────────────────────────────────────────────── */

/* ── Avatar ── */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm { width: 32px; height: 32px; font-size: 0.7rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar-xl { width: 72px; height: 72px; font-size: 1.4rem; }

.avatar-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-bg-deep);
}

.avatar-status.online  { background: var(--color-success); }
.avatar-status.offline { background: var(--text-tertiary); }

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--glass-border);
  margin: var(--space-6) 0;
  border: none;
}

.divider-text {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  color: var(--text-tertiary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}

/* ── Dropdown ── */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--color-bg-elevated);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.97);
  transition: var(--transition);
}

.dropdown.open .dropdown-menu,
.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background: var(--glass-bg-medium);
  color: var(--text-primary);
}

.dropdown-item.danger { color: var(--color-danger); }
.dropdown-item.danger:hover { background: var(--color-danger-dim); }

.dropdown-divider {
  height: 1px;
  background: var(--glass-border);
  margin: var(--space-2) 0;
}

/* ── Tabs ── */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--glass-border);
  gap: 0;
  overflow-x: auto;
}

.tab {
  padding: var(--space-4) var(--space-5);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-tertiary);
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  white-space: nowrap;
}

.tab:hover { color: var(--text-secondary); }

.tab-active,
.tab.active {
  color: var(--accent-primary);
}

.tab-active::after,
.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: var(--space-5);
  right: var(--space-5);
  height: 2px;
  background: var(--accent-primary);
  border-radius: var(--radius-full) var(--radius-full) 0 0;
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

/* ── Progress Bar ── */
.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-full);
  transition: width 0.6s var(--ease-smooth);
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 100%
  );
  animation: shimmer 2s ease-in-out infinite;
}

/* ── Tooltip ── */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 6px 12px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-primary);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-fast);
  pointer-events: none;
  box-shadow: var(--shadow-md);
  z-index: var(--z-dropdown);
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ── Chip ── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  background: var(--glass-bg-medium);
  border: 1px solid var(--glass-border);
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: var(--transition-fast);
  cursor: default;
}

.chip.clickable {
  cursor: pointer;
}

.chip.clickable:hover {
  background: var(--glass-bg-strong);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.chip.active {
  background: var(--accent-primary-dim);
  border-color: rgba(0, 212, 255, 0.25);
  color: var(--accent-primary);
}

/* ─────────────────────────────────────────────────────────────
   19. ANIMATIONS
   ───────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 0.4;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px rgba(0, 212, 255, 0.2); }
  50%      { box-shadow: 0 0 20px rgba(0, 212, 255, 0.4); }
}

.animate-fadeIn     { animation: fadeIn 0.5s var(--ease-smooth) forwards; }
.animate-slideUp    { animation: slideInUp 0.5s var(--ease-smooth) forwards; }
.animate-slideRight { animation: slideInRight 0.5s var(--ease-smooth) forwards; }
.animate-slideDown  { animation: slideInDown 0.5s var(--ease-smooth) forwards; }
.animate-scaleIn    { animation: scaleIn 0.4s var(--ease-bounce) forwards; }
.animate-pulse      { animation: pulse 2s ease-in-out infinite; }
.animate-glow       { animation: glow 2s ease-in-out infinite; }

/* Stagger delays for lists */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }
.stagger-7 { animation-delay: 0.35s; }
.stagger-8 { animation-delay: 0.4s; }

/* ─────────────────────────────────────────────────────────────
   20. UTILITIES
   ───────────────────────────────────────────────────────────── */

/* ── Text Colors ── */
.text-primary   { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-tertiary  { color: var(--text-tertiary) !important; }
.text-accent    { color: var(--accent-primary) !important; }
.text-success   { color: var(--color-success) !important; }
.text-danger    { color: var(--color-danger) !important; }
.text-warning   { color: var(--color-warning) !important; }
.text-info      { color: var(--color-info) !important; }

/* ── Text Alignment ── */
.text-center { text-align: center !important; }
.text-right  { text-align: right !important; }
.text-left   { text-align: left !important; }

/* ── Font Weight ── */
.font-light    { font-weight: 300 !important; }
.font-normal   { font-weight: 400 !important; }
.font-medium   { font-weight: 500 !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold     { font-weight: 700 !important; }

/* ── Font Size ── */
.text-xs { font-size: 0.72rem !important; }
.text-sm { font-size: 0.85rem !important; }
.text-md { font-size: 1rem !important; }
.text-lg { font-size: 1.15rem !important; }
.text-xl { font-size: 1.5rem !important; }

/* ── Flexbox ── */
.flex         { display: flex !important; }
.flex-col     { display: flex !important; flex-direction: column !important; }
.flex-row     { display: flex !important; flex-direction: row !important; }
.flex-wrap    { flex-wrap: wrap !important; }
.flex-between { display: flex !important; justify-content: space-between !important; align-items: center !important; }
.flex-center  { display: flex !important; justify-content: center !important; align-items: center !important; }
.flex-end     { display: flex !important; justify-content: flex-end !important; align-items: center !important; }
.flex-start   { display: flex !important; align-items: flex-start !important; }
.items-center { align-items: center !important; }
.flex-1       { flex: 1 !important; }

/* ── Gap ── */
.gap-1 { gap: var(--space-1) !important; }
.gap-2 { gap: var(--space-2) !important; }
.gap-3 { gap: var(--space-3) !important; }
.gap-4 { gap: var(--space-4) !important; }
.gap-5 { gap: var(--space-5) !important; }
.gap-6 { gap: var(--space-6) !important; }

/* ── Margin ── */
.mt-1 { margin-top: var(--space-1) !important; }
.mt-2 { margin-top: var(--space-2) !important; }
.mt-3 { margin-top: var(--space-3) !important; }
.mt-4 { margin-top: var(--space-4) !important; }
.mt-6 { margin-top: var(--space-6) !important; }
.mt-8 { margin-top: var(--space-8) !important; }

.mb-1 { margin-bottom: var(--space-1) !important; }
.mb-2 { margin-bottom: var(--space-2) !important; }
.mb-3 { margin-bottom: var(--space-3) !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }
.mb-6 { margin-bottom: var(--space-6) !important; }
.mb-8 { margin-bottom: var(--space-8) !important; }

.ml-auto { margin-left: auto !important; }
.mr-auto { margin-right: auto !important; }

/* ── Padding ── */
.p-1 { padding: var(--space-1) !important; }
.p-2 { padding: var(--space-2) !important; }
.p-3 { padding: var(--space-3) !important; }
.p-4 { padding: var(--space-4) !important; }
.p-5 { padding: var(--space-5) !important; }
.p-6 { padding: var(--space-6) !important; }
.p-8 { padding: var(--space-8) !important; }

.px-4 { padding-left: var(--space-4) !important; padding-right: var(--space-4) !important; }
.py-4 { padding-top: var(--space-4) !important; padding-bottom: var(--space-4) !important; }

/* ── Display ── */
.hidden       { display: none !important; }
.visible      { visibility: visible !important; }
.invisible    { visibility: hidden !important; }
.block        { display: block !important; }
.inline-block { display: inline-block !important; }
.inline-flex  { display: inline-flex !important; }
.grid         { display: grid !important; }

/* ── Sizing ── */
.w-full { width: 100% !important; }
.h-full { height: 100% !important; }
.min-h-screen { min-height: 100vh !important; }

/* ── Overflow ── */
.overflow-hidden { overflow: hidden !important; }
.overflow-auto   { overflow: auto !important; }
.overflow-x-auto { overflow-x: auto !important; }

/* ── Borders ── */
.rounded    { border-radius: var(--radius-sm) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }

.border      { border: 1px solid var(--glass-border) !important; }
.border-none { border: none !important; }

/* ── Text ── */
.truncate {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.uppercase   { text-transform: uppercase !important; }
.capitalize  { text-transform: capitalize !important; }
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Cursor ── */
.cursor-pointer { cursor: pointer !important; }
.cursor-default { cursor: default !important; }

/* ── Position ── */
.relative { position: relative !important; }
.absolute { position: absolute !important; }
.sticky   { position: sticky !important; }

/* ── Opacity ── */
.opacity-0   { opacity: 0 !important; }
.opacity-50  { opacity: 0.5 !important; }
.opacity-100 { opacity: 1 !important; }

/* ── Pointer events ── */
.pointer-events-none { pointer-events: none !important; }

/* ── Transitions ── */
.transition      { transition: var(--transition) !important; }
.transition-fast { transition: var(--transition-fast) !important; }
.transition-none { transition: none !important; }

/* ── Screen reader only ── */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ── Mobile / Desktop visibility (used with responsive.css) ── */
.mobile-only  { display: none !important; }
.desktop-only { display: block !important; }

/* ============================================================
   COLLAPSED SIDEBAR STATE
   ============================================================ */
body.sidebar-collapsed {
    --sidebar-width: var(--sidebar-collapsed);
}

body.sidebar-collapsed .sidebar-logo-text,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .nav-section-title,
body.sidebar-collapsed .sidebar-user-info,
body.sidebar-collapsed .nav-badge,
body.sidebar-collapsed .sidebar-version {
    display: none !important;
}

body.sidebar-collapsed .sidebar-logo,
body.sidebar-collapsed .sidebar-user {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

body.sidebar-collapsed .sidebar-nav {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

body.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: var(--space-3);
}

body.sidebar-collapsed .nav-icon {
    margin-right: 0;
}


/* Fix dropdown options visibility on Windows */
.form-select option {
  background-color: var(--color-bg-deep);
  color: #ffffff;
}
