/* ==========================================================
   POSTFY — Premium MicroSaaS Design System
   Version 2.0 | MicroSaaS Premium Edition
   ========================================================== */

/* ----------------------------------------------------------
   1. DESIGN TOKENS & CSS CUSTOM PROPERTIES
   ---------------------------------------------------------- */
:root {
  /* Brand — override via layout PHP injection */
  --primary:        #4f46e5;
  --primary-hover:  #4338ca;
  --primary-soft:   rgba(79, 70, 229, 0.1);
  --primary-glow:   rgba(79, 70, 229, 0.25);

  /* Semantic palette */
  --success:        #10b981;
  --success-soft:   rgba(16, 185, 129, 0.1);
  --warning:        #f59e0b;
  --warning-soft:   rgba(245, 158, 11, 0.1);
  --danger:         #ef4444;
  --danger-soft:    rgba(239, 68, 68, 0.1);
  --info:           #06b6d4;
  --info-soft:      rgba(6, 182, 212, 0.1);

  /* Neutral scale */
  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Surfaces */
  --surface-page:   #f4f5f8;
  --surface-card:   #ffffff;
  --surface-border: rgba(229, 231, 235, 0.8);

  /* Sidebar dark theme */
  --sidebar-bg:          #0f1117;
  --sidebar-border:      rgba(255,255,255,0.06);
  --sidebar-text:        rgba(255,255,255,0.55);
  --sidebar-text-hover:  rgba(255,255,255,0.92);
  --sidebar-active-bg:   rgba(255,255,255,0.08);
  --sidebar-active-text: #ffffff;
  --sidebar-active-border: var(--primary);
  --sidebar-section-label: rgba(255,255,255,0.28);

  /* Layout */
  --sidebar-width: 256px;
  --header-height: 64px;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);
  --shadow-xl:  0 20px 64px rgba(0,0,0,0.12), 0 4px 16px rgba(0,0,0,0.08);
  --shadow-glow: 0 0 0 3px var(--primary-soft);

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast:   all 0.15s var(--ease-out-expo);
  --transition-normal: all 0.25s var(--ease-out-expo);
  --transition-slow:   all 0.4s  var(--ease-out-expo);
}

/* ----------------------------------------------------------
   2. TYPOGRAPHY RESET
   ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

body, input, button, select, textarea {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.font-display {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

/* ----------------------------------------------------------
   3. CUSTOM SCROLLBAR
   ---------------------------------------------------------- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

* {
  scrollbar-width: thin;
  scrollbar-color: var(--gray-300) transparent;
}

/* ----------------------------------------------------------
   4. PAGE LAYOUT — SHELL
   ---------------------------------------------------------- */
.ps-shell {
  display: flex;
  min-height: 100vh;
  background: var(--surface-page);
}

.ps-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.3s var(--ease-out-expo);
}

/* ----------------------------------------------------------
   5. SIDEBAR — DARK PREMIUM
   ---------------------------------------------------------- */
.ps-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s var(--ease-out-expo);
}

/* Logo area */
.ps-sidebar-logo {
  height: var(--header-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border-bottom: 1px solid var(--sidebar-border);
  text-decoration: none;
}

.ps-sidebar-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 0 16px var(--primary-glow);
}

.ps-sidebar-logo-text {
  margin-left: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
}

/* Nav */
.ps-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.ps-sidebar-nav::-webkit-scrollbar { width: 3px; }
.ps-sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 99px;
}

.ps-nav-section {
  margin-bottom: 4px;
}

.ps-nav-section + .ps-nav-section {
  margin-top: 24px;
}

.ps-nav-label {
  padding: 0 8px;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-section-label);
}

.ps-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
  transition: var(--transition-fast);
  border-left: 2px solid transparent;
  margin-bottom: 2px;
}

.ps-nav-item:hover {
  color: var(--sidebar-text-hover);
  background: rgba(255,255,255,0.05);
}

.ps-nav-item.active {
  color: var(--sidebar-active-text);
  background: var(--sidebar-active-bg);
  border-left-color: var(--primary);
}

.ps-nav-item .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: var(--transition-fast);
}

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

/* Sidebar footer */
.ps-sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.ps-sidebar-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition-fast);
  border-left: 2px solid transparent;
}

.ps-sidebar-logout:hover {
  color: var(--danger);
  background: var(--danger-soft);
  border-left-color: var(--danger);
}

/* ----------------------------------------------------------
   6. TOPBAR / HEADER
   ---------------------------------------------------------- */
.ps-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-height);
  background: rgba(244, 245, 248, 0.85);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  transition: box-shadow 0.2s ease;
}

.ps-header.scrolled {
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.ps-header-title {
  flex: 1;
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-800);
  letter-spacing: -0.02em;
}

.ps-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Notification bell */
.ps-notif-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-fast);
}

.ps-notif-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
}

.ps-notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface-page);
  animation: ps-badge-pop 0.3s var(--ease-spring) forwards;
}

/* Avatar button */
.ps-avatar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--gray-200);
  background: white;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.ps-avatar-btn:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.ps-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
}

.ps-avatar-initial {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.ps-avatar-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}

/* ----------------------------------------------------------
   7. MAIN CONTENT AREA
   ---------------------------------------------------------- */
.ps-main {
  flex: 1;
  padding: 28px;
}

/* Page header row */
.ps-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.ps-page-title {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.03em;
}

.ps-page-subtitle {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 2px;
}

/* ----------------------------------------------------------
   8. CARDS & SURFACES
   ---------------------------------------------------------- */
.ps-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.ps-card:hover {
  box-shadow: var(--shadow-md);
}

.ps-card-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ps-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-800);
  letter-spacing: -0.02em;
}

.ps-card-body {
  padding: 20px;
}

/* Stat cards */
.ps-stat-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  transition: var(--transition-normal);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.ps-stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, var(--stat-accent, var(--primary-soft)) 100%);
  pointer-events: none;
}

.ps-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--stat-accent-border, var(--primary));
}

.ps-stat-card-left {}

.ps-stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
  margin-bottom: 8px;
}

.ps-stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 36px;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1;
  letter-spacing: -0.04em;
}

.ps-stat-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-400);
  margin-top: 10px;
  text-decoration: none;
  transition: var(--transition-fast);
}

.ps-stat-link:hover { color: var(--primary); }

.ps-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: var(--stat-icon-bg, var(--primary-soft));
  color: var(--stat-icon-color, var(--primary));
}

/* Stat card color variants */
.ps-stat-card--blue   { --stat-accent: rgba(59,130,246,0.07); --stat-accent-border: #93c5fd; --stat-icon-bg: rgba(59,130,246,0.1); --stat-icon-color: #2563eb; }
.ps-stat-card--purple { --stat-accent: rgba(139,92,246,0.07); --stat-accent-border: #c4b5fd; --stat-icon-bg: rgba(139,92,246,0.1); --stat-icon-color: #7c3aed; }
.ps-stat-card--green  { --stat-accent: rgba(16,185,129,0.07); --stat-accent-border: #6ee7b7; --stat-icon-bg: rgba(16,185,129,0.1); --stat-icon-color: #059669; }
.ps-stat-card--amber  { --stat-accent: rgba(245,158,11,0.07); --stat-accent-border: #fcd34d; --stat-icon-bg: rgba(245,158,11,0.1); --stat-icon-color: #d97706; }
.ps-stat-card--rose   { --stat-accent: rgba(239,68,68,0.07);  --stat-accent-border: #fca5a5; --stat-icon-bg: rgba(239,68,68,0.1);  --stat-icon-color: #dc2626; }

/* ----------------------------------------------------------
   9. BUTTONS
   ---------------------------------------------------------- */
.ps-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
  text-decoration: none;
  line-height: 1;
}

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

.ps-btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(79,70,229,0.4);
}
.ps-btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 16px rgba(79,70,229,0.35);
  transform: translateY(-1px);
  color: #fff;
}

.ps-btn-secondary {
  background: white;
  color: var(--gray-700);
  border-color: var(--gray-200);
  box-shadow: var(--shadow-xs);
}
.ps-btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  color: var(--gray-900);
}

.ps-btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 1px 3px rgba(239,68,68,0.3);
}
.ps-btn-danger:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 16px rgba(239,68,68,0.3);
  transform: translateY(-1px);
  color: #fff;
}

.ps-btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border-color: transparent;
}
.ps-btn-ghost:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.ps-btn-sm {
  font-size: 12px;
  padding: 6px 13px;
  border-radius: var(--radius-sm);
}

.ps-btn-icon {
  padding: 9px;
  border-radius: var(--radius-md);
}

/* ----------------------------------------------------------
   10. FORM CONTROLS
   ---------------------------------------------------------- */
.ps-input,
.ps-select,
.ps-textarea {
  width: 100%;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13.5px;
  padding: 10px 13px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--gray-200);
  background: white;
  color: var(--gray-800);
  outline: none;
  transition: var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
}

.ps-input::placeholder,
.ps-textarea::placeholder { color: var(--gray-400); }

.ps-input:focus,
.ps-select:focus,
.ps-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.ps-input:hover:not(:focus),
.ps-select:hover:not(:focus) {
  border-color: var(--gray-300);
}

.ps-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.ps-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ps-field-hint {
  font-size: 11.5px;
  color: var(--gray-400);
  margin-top: 2px;
}

/* ----------------------------------------------------------
   11. TABLE
   ---------------------------------------------------------- */
.ps-table-wrap {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.ps-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ps-table thead {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.ps-table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray-500);
  white-space: nowrap;
}

.ps-table td {
  padding: 13px 16px;
  color: var(--gray-700);
  border-bottom: 1px solid rgba(229,231,235,0.6);
  vertical-align: middle;
}

.ps-table tbody tr {
  transition: background 0.12s ease, box-shadow 0.12s ease;
}

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

.ps-table tbody tr:hover {
  background: var(--gray-50);
}

/* ----------------------------------------------------------
   12. BADGES / STATUS CHIPS
   ---------------------------------------------------------- */
.ps-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.ps-badge--primary { background: var(--primary-soft); color: var(--primary); }
.ps-badge--success { background: var(--success-soft); color: var(--success); }
.ps-badge--warning { background: var(--warning-soft); color: #b45309; }
.ps-badge--danger  { background: var(--danger-soft);  color: var(--danger); }
.ps-badge--info    { background: var(--info-soft);    color: #0369a1; }
.ps-badge--gray    { background: var(--gray-100);     color: var(--gray-600); }

/* ----------------------------------------------------------
   13. ALERTS / FLASH MESSAGES
   ---------------------------------------------------------- */
.ps-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border-left: 3px solid;
  font-size: 13.5px;
  margin-bottom: 20px;
  animation: ps-alert-in 0.3s var(--ease-out-expo);
}

.ps-alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

.ps-alert--success {
  background: #f0fdf4;
  border-left-color: var(--success);
  color: #14532d;
}
.ps-alert--danger {
  background: #fff1f2;
  border-left-color: var(--danger);
  color: #7f1d1d;
}
.ps-alert--warning {
  background: #fffbeb;
  border-left-color: var(--warning);
  color: #78350f;
}
.ps-alert--info {
  background: #f0f9ff;
  border-left-color: var(--info);
  color: #0c4a6e;
}

/* ----------------------------------------------------------
   14. EMPTY STATES
   ---------------------------------------------------------- */
.ps-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 24px;
  text-align: center;
}

.ps-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--gray-400);
  margin-bottom: 16px;
}

.ps-empty-title {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.ps-empty-body {
  font-size: 13px;
  color: var(--gray-400);
  max-width: 280px;
  line-height: 1.6;
}

/* ----------------------------------------------------------
   15. LIST ITEMS (sidebar-style)
   ---------------------------------------------------------- */
.ps-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  text-decoration: none;
  color: var(--gray-700);
}

.ps-list-item:hover {
  background: var(--gray-50);
  color: var(--gray-900);
}

.ps-list-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
}

.ps-list-avatar-initial {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ----------------------------------------------------------
   16. GLASSMORPHISM (Login page)
   ---------------------------------------------------------- */
.ps-glass {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow:
    0 8px 32px rgba(31,38,135,0.10),
    0 2px 8px rgba(31,38,135,0.06),
    inset 0 1px 0 rgba(255,255,255,0.8);
}

/* ----------------------------------------------------------
   17. ANIMATED BLOB BACKGROUND (Login)
   ---------------------------------------------------------- */
.ps-blob-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.ps-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: ps-blob-drift 18s ease-in-out infinite alternate;
}

.ps-blob:nth-child(1) {
  width: 600px; height: 600px;
  background: var(--primary);
  top: -200px; left: -100px;
  animation-duration: 20s;
}
.ps-blob:nth-child(2) {
  width: 400px; height: 400px;
  background: #06b6d4;
  bottom: -100px; right: -80px;
  animation-duration: 15s;
  animation-delay: -5s;
}
.ps-blob:nth-child(3) {
  width: 300px; height: 300px;
  background: #8b5cf6;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-duration: 25s;
  animation-delay: -10s;
}

/* ----------------------------------------------------------
   18. FILTER BAR
   ---------------------------------------------------------- */
.ps-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-xs);
  margin-bottom: 20px;
}

/* ----------------------------------------------------------
   19. BULK ACTION BAR (floating)
   ---------------------------------------------------------- */
.ps-bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--gray-900);
  color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  font-size: 13px;
  font-weight: 500;
}

/* ----------------------------------------------------------
   20. FOOTER
   ---------------------------------------------------------- */
.ps-footer {
  padding: 16px 28px;
  background: white;
  border-top: 1px solid var(--surface-border);
  font-size: 12px;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

/* ----------------------------------------------------------
   21. MOBILE OVERLAY
   ---------------------------------------------------------- */
.ps-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 35;
  backdrop-filter: blur(2px);
}

/* ----------------------------------------------------------
   22. ANIMATIONS
   ---------------------------------------------------------- */
@keyframes ps-fade-in-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes ps-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes ps-slide-in-left {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes ps-badge-pop {
  0%   { transform: scale(0); }
  70%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes ps-blob-drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(40px, 30px) scale(1.08); }
  100% { transform: translate(-20px, 50px) scale(0.95); }
}

@keyframes ps-alert-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes ps-pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.4); opacity: 0.7; }
}

/* Animation utilities */
.ps-animate-in {
  animation: ps-fade-in-up 0.45s var(--ease-out-expo) both;
}

.ps-animate-in-delay-1 { animation-delay: 0.05s; }
.ps-animate-in-delay-2 { animation-delay: 0.10s; }
.ps-animate-in-delay-3 { animation-delay: 0.15s; }
.ps-animate-in-delay-4 { animation-delay: 0.20s; }

/* Keep old class for backwards compat */
.animate-fade-in-up {
  animation: ps-fade-in-up 0.4s var(--ease-out-expo) forwards;
}

/* ----------------------------------------------------------
   23. RESPONSIVE
   ---------------------------------------------------------- */
@media (max-width: 768px) {
  .ps-sidebar {
    transform: translateX(-100%);
  }
  .ps-sidebar.open {
    transform: translateX(0);
  }
  .ps-content {
    margin-left: 0;
  }
  .ps-sidebar-overlay {
    display: block;
  }
  .ps-main {
    padding: 16px;
  }
  .ps-header {
    padding: 0 16px;
  }
}

/* ----------------------------------------------------------
   24. UTILITY CLASSES
   ---------------------------------------------------------- */
.hover-lift {
  transition: var(--transition-normal);
}
.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.ring-primary {
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Legacy compatibility — keep old class names working */
.glass-card {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 8px 32px rgba(31,38,135,0.10);
}

.ds-btn         { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px; padding: 9px 18px; border-radius: var(--radius-md); border: 1px solid transparent; cursor: pointer; transition: var(--transition-fast); text-decoration: none; }
.ds-btn-primary { background: var(--primary); color: #fff; }
.ds-btn-primary:hover { background: var(--primary-hover); color: #fff; }
.ds-btn-danger  { background: var(--danger); color: #fff; }
.ds-input, .ds-select, .ds-textarea {
  width: 100%; font-size: 13.5px; padding: 10px 13px; border-radius: var(--radius-md);
  border: 1.5px solid var(--gray-200); background: white; color: var(--gray-800);
  outline: none; transition: var(--transition-fast);
}
.ds-input:focus, .ds-select:focus, .ds-textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Profile dropdown menu */
.ps-dropdown {
  position: relative;
  display: inline-block;
}

.ps-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 160px;
  background: white;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  flex-direction: column;
  z-index: 999;
  animation: ps-dropdown-in 0.25s var(--ease-out-expo) forwards;
}

.ps-dropdown-menu.show {
  display: flex;
}

.ps-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--gray-700);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition-fast);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.ps-dropdown-item:hover {
  background: var(--gray-50);
  color: var(--gray-900);
}

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

.ps-dropdown-item.danger:hover {
  background: var(--danger-soft);
}

@keyframes ps-dropdown-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Lightbox Fullscreen Preview */
#ps-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.25s ease;
}
#ps-lightbox.show {
  opacity: 1;
}
#ps-lightbox img {
  max-width: 90%;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
#ps-lightbox.show img {
  transform: scale(1);
}
#ps-lightbox .close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  background: none;
  border: none;
  transition: transform 0.2s;
}
#ps-lightbox .close-btn:hover {
  transform: scale(1.1);
}


