/* ============================================================
   IDVC SaaS Platform - Global Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300..900;1,14..32,300..900&display=swap');

:root {
  /* Colors */
  --primary:        #4F46E5;
  --primary-dark:   #3730A3;
  --primary-light:  #818CF8;
  --accent:         #06B6D4;
  --accent-dark:    #0891B2;
  --success:        #10B981;
  --success-light:  rgba(16,185,129,0.1);
  --danger:         #EF4444;
  --danger-light:   rgba(239,68,68,0.1);
  --warning:        #F59E0B;
  --warning-light:  rgba(245,158,11,0.1);
  --info:           #3B82F6;
  --info-light:     rgba(59,130,246,0.1);

  /* Dark Theme */
  --bg:             #0F0E17;
  --bg2:            #1A1828;
  --bg3:            #24223A;
  --bg4:            #2D2B47;
  --border:         rgba(255,255,255,0.08);
  --border-strong:  rgba(255,255,255,0.15);
  --text:           #F1F0F9;
  --text-muted:     #9CA3AF;
  --text-dim:       #6B7280;
  --glass:          rgba(255,255,255,0.04);
  --glass-hover:    rgba(255,255,255,0.07);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #4F46E5, #06B6D4);
  --gradient-purple:  linear-gradient(135deg, #7C3AED, #4F46E5);
  --gradient-teal:    linear-gradient(135deg, #06B6D4, #10B981);
  --gradient-fire:    linear-gradient(135deg, #F59E0B, #EF4444);

  /* Layout */
  --sidebar-width:  260px;
  --header-height:  64px;
  --radius-sm:      8px;
  --radius:         12px;
  --radius-lg:      16px;
  --radius-xl:      24px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.3);
  --shadow:     0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg:  0 20px 40px rgba(0,0,0,0.4);
  --shadow-glow-primary: 0 0 20px rgba(79,70,229,0.3);
  --shadow-glow-accent:  0 0 20px rgba(6,182,212,0.3);

  /* Transitions */
  --t-fast: 0.15s ease;
  --t:      0.25s ease;
  --t-slow: 0.4s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-light); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; }

/* ==================== Layout ==================== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ==================== Sidebar ==================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--t);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bg4) transparent;
}

.sidebar-logo {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow-primary);
  flex-shrink: 0;
}
.sidebar-logo-icon svg { width: 22px; height: 22px; fill: white; }
.sidebar-logo-text { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.sidebar-logo-sub  { font-size: 0.7rem; color: var(--text-muted); }

.sidebar-section-title {
  padding: 1.25rem 1.5rem 0.4rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.sidebar-nav { flex: 1; padding: 0.5rem 0.75rem; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--t-fast);
  cursor: pointer;
  position: relative;
  margin-bottom: 2px;
  text-decoration: none;
}
.nav-item:hover {
  background: var(--glass-hover);
  color: var(--text);
}
.nav-item.active {
  background: rgba(79,70,229,0.15);
  color: var(--primary-light);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 3px;
  background: var(--gradient-primary);
  border-radius: 0 2px 2px 0;
}
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.nav-submenu { padding-left: 2rem; }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 0.75rem;
}
.user-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

/* ==================== Main Content ==================== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ==================== Pro Header ==================== */
.app-header {
  height: var(--header-height);
  background: rgba(15, 14, 23, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  transition: background var(--t), border-color var(--t);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.header-toggle-btn {
  color: var(--text-muted);
}
.header-toggle-btn:hover {
  color: var(--text);
  transform: scale(1.05);
}

.header-breadcrumb-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.header-workspace-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 8px;
  border-radius: 9999px;
  background: var(--glass);
  border: 1px solid var(--border);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text);
  cursor: default;
  transition: all var(--t-fast);
}
.header-workspace-badge:hover {
  background: var(--glass-hover);
  border-color: var(--border-strong);
}
.workspace-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.25), rgba(6, 182, 212, 0.25));
  color: var(--primary-light);
  font-size: 0.75rem;
}
.workspace-name {
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-plan-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.workspace-plan-pill.pill-pro {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.workspace-plan-pill.pill-super {
  background: rgba(99, 102, 241, 0.18);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.header-breadcrumb-divider {
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 300;
  opacity: 0.5;
}

.header-page-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* Center Search Trigger */
.header-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-search-trigger {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: var(--glass);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
  color: var(--text-muted);
  flex-shrink: 0;
}
.header-search-trigger:hover {
  background: var(--glass-hover);
  border-color: var(--border-strong);
  color: var(--text);
  transform: translateY(-1px);
}
.search-icon {
  font-size: 0.85rem;
  line-height: 1;
  color: var(--text-muted);
  transition: color var(--t-fast);
}
.header-search-trigger:hover .search-icon {
  color: var(--primary-light);
}
.search-placeholder {
  font-size: 0.8rem;
  font-weight: 400;
  flex: 1;
  text-align: left;
}
.search-kbd-shortcut {
  display: flex;
  align-items: center;
  gap: 3px;
}
kbd.kbd-key {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.65rem;
  font-family: inherit;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.4;
}

/* Right Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* System Status Pill */
.header-status-pill {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: 9999px;
  padding: 4px 10px;
  gap: 6px;
  font-size: 0.725rem;
  font-weight: 600;
  color: #10b981;
  user-select: none;
  cursor: default;
}
.status-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.25); }
}

/* Create Button */
.btn-header-create {
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #ffffff !important;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.3);
  text-decoration: none !important;
}
.btn-header-create:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.45);
}
.create-icon {
  font-size: 0.75rem;
}
.create-chevron {
  font-size: 0.65rem;
  opacity: 0.75;
}

/* Icon Buttons */
.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--glass);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
  position: relative;
}
.icon-btn:hover {
  background: var(--glass-hover);
  color: var(--text);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.icon-btn svg { width: 18px; height: 18px; }
.header-actions .icon-btn {
  width: 30px;
  height: 30px;
}
.header-actions .icon-btn svg {
  width: 15px;
  height: 15px;
}
.header-actions .icon-btn i {
  font-size: 0.85rem;
}


/* Notification Badge */
.header-notif-btn { position: relative; }
.notif-badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: white;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg2);
  animation: notifPulse 3s infinite;
}
@keyframes notifPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); box-shadow: 0 0 10px rgba(239, 68, 68, 0.6); }
}

/* Pro Flyout Dropdown Base */
.header-flyout {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: rgba(26, 24, 40, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  padding: 0.5rem;
  z-index: 250;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.98);
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.header-flyout.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}
.dropdown-header-caption {
  font-size: 0.675rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 0.4rem 0.75rem 0.2rem;
}

/* Quick Action Items */
.item-icon-box {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.item-text-box {
  display: flex;
  flex-direction: column;
}
.item-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.item-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.bg-indigo-subtle { background: rgba(99, 102, 241, 0.15); }
.bg-cyan-subtle   { background: rgba(6, 182, 212, 0.15); }
.bg-emerald-subtle{ background: rgba(16, 185, 129, 0.15); }
.bg-amber-subtle  { background: rgba(245, 158, 11, 0.15); }
.bg-purple-subtle { background: rgba(168, 85, 247, 0.15); }
.text-cyan { color: #06b6d4 !important; }
.text-purple { color: #a855f7 !important; }

/* Notification Center Flyout */
.header-notif-menu {
  width: 360px;
  max-width: 90vw;
  padding: 0;
  overflow: hidden;
}
.notif-menu-header {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--glass);
}
.notif-header-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}
.notif-count-pill {
  background: rgba(99, 102, 241, 0.18);
  color: #818cf8;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
}
.notif-mark-read-btn {
  background: none;
  border: none;
  font-size: 0.725rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--t-fast);
}
.notif-mark-read-btn:hover {
  color: var(--primary-light);
}
.notif-list-body {
  max-height: 320px;
  overflow-y: auto;
}
.notif-item {
  display: flex;
  gap: 12px;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast);
  text-decoration: none;
  color: inherit;
  align-items: flex-start;
}
.notif-item:last-child {
  border-bottom: none;
}
.notif-item:hover {
  background: var(--glass-hover);
}
.notif-item.unread {
  background: rgba(99, 102, 241, 0.04);
}
.notif-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.notif-item-content {
  flex: 1;
}
.notif-item-msg {
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 3px;
}
.notif-item-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.notif-menu-footer {
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--glass);
  text-align: center;
}
.notif-view-all {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: gap var(--t-fast);
}
.notif-view-all:hover {
  gap: 10px;
  color: var(--accent);
}

/* User Profile Chip & Menu */
.header-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 4px;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: var(--glass);
  cursor: pointer;
  transition: all var(--t-fast);
}
.header-user-chip:hover,
.header-user-chip.open {
  background: var(--glass-hover);
  border-color: var(--border-strong);
}
.user-chip-avatar {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}
.user-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid var(--bg2);
}
.user-chip-meta {
  display: flex;
  flex-direction: column;
}
.user-chip-name {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.user-chip-role {
  font-size: 0.675rem;
  color: var(--text-muted);
  line-height: 1;
}
.user-chip-arrow {
  font-size: 0.65rem;
  color: var(--text-dim);
  transition: transform var(--t-fast);
}
.header-user-chip.open .user-chip-arrow {
  transform: rotate(180deg);
}

.header-user-menu {
  width: 250px;
  padding: 0.5rem;
}
.user-card-banner {
  padding: 0.75rem 0.5rem;
}
.user-banner-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}
.user-banner-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.user-banner-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}
.user-banner-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 9999px;
}
.user-banner-badge.badge-super {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}
.user-banner-badge.badge-org {
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.3);
}
.user-menu-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.user-menu-links .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t-fast);
  text-decoration: none;
}
.user-menu-links .dropdown-item:hover {
  background: var(--glass-hover);
  color: var(--text);
}
.user-menu-links .dropdown-item.danger:hover {
  background: var(--danger-light);
  color: var(--danger);
}
.kbd-mini {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* Spotlight Command Palette Modal */
.cmd-palette-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}
.cmd-palette-backdrop.open {
  display: flex;
}
.cmd-palette-dialog {
  background: var(--bg2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: cmdSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes cmdSlideDown {
  from { opacity: 0; transform: translateY(-16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.cmd-palette-search-bar {
  display: flex;
  align-items: center;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.cmd-search-icon {
  font-size: 1.1rem;
  color: var(--primary-light);
}
.cmd-palette-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text);
  font-family: inherit;
}
.cmd-palette-input::placeholder {
  color: var(--text-dim);
}
.cmd-esc-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}
.cmd-palette-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.5rem;
}
.cmd-group-label {
  font-size: 0.675rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 0.5rem 0.75rem 0.25rem;
}
.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--t-fast);
}
.cmd-item:hover,
.cmd-item.selected {
  background: var(--glass-hover);
  border-left: 3px solid var(--primary-light);
  padding-left: calc(0.75rem - 3px);
}
.cmd-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cmd-item-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--primary-light);
}
.cmd-item-title {
  font-size: 0.875rem;
  font-weight: 500;
}
.cmd-item-badge {
  font-size: 0.675rem;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--glass);
  padding: 2px 7px;
  border-radius: 9999px;
  border: 1px solid var(--border);
}
.cmd-palette-footer {
  padding: 0.65rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--glass);
}
.cmd-tip {
  font-size: 0.725rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.cmd-tip kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 4px;
  font-size: 0.65rem;
}
.cmd-footer-tag {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 600;
}

/* Shortcuts Dialog */
.shortcuts-dialog {
  max-width: 480px;
  width: 100%;
}
.shortcuts-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.shortcuts-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--glass);
  border: 1px solid var(--border);
}
.shortcut-desc {
  font-size: 0.85rem;
  color: var(--text);
}
.shortcut-keys {
  display: flex;
  align-items: center;
  gap: 4px;
}
.shortcut-keys kbd {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text);
}
.icon-btn-sm {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--glass);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
}
.icon-btn-sm:hover {
  background: var(--glass-hover);
  color: var(--text);
}

/* ==================== Page Content ==================== */
.page-content {
  flex: 1;
  padding: 1.75rem;
}
.page-header {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-header-left h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.page-header-left p { font-size: 0.875rem; color: var(--text-muted); margin-top: 4px; }
.page-header-right { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* ==================== Cards ==================== */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.card-body { padding: 1.5rem; }
.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--glass);
}

/* ==================== Stat Cards ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
  transition: all var(--t);
}
.stat-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}
.stat-card.blue::before    { background: var(--gradient-primary); }
.stat-card.teal::before    { background: var(--gradient-teal); }
.stat-card.purple::before  { background: var(--gradient-purple); }
.stat-card.orange::before  { background: var(--gradient-fire); }

.stat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-icon.blue   { background: rgba(79,70,229,0.15); color: var(--primary-light); }
.stat-icon.teal   { background: rgba(6,182,212,0.15); color: var(--accent); }
.stat-icon.purple { background: rgba(124,58,237,0.15); color: #A78BFA; }
.stat-icon.orange { background: rgba(245,158,11,0.15); color: var(--warning); }
.stat-icon svg { width: 22px; height: 22px; }

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.stat-change {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 8px;
}
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ==================== Grid Layout ==================== */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ==================== Buttons ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(79,70,229,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(79,70,229,0.4); color: white; }
.btn-primary:active { transform: none; }

.btn-secondary {
  background: var(--glass);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--glass-hover); border-color: var(--border-strong); color: var(--text); }

.btn-danger {
  background: rgba(239,68,68,0.1);
  color: var(--danger);
  border-color: rgba(239,68,68,0.2);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); color: var(--danger); }

.btn-success {
  background: rgba(16,185,129,0.1);
  color: var(--success);
  border-color: rgba(16,185,129,0.2);
}
.btn-success:hover { background: rgba(16,185,129,0.2); color: var(--success); }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
}
.btn-sm.btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 0.82rem;
}
.btn-icon i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  line-height: 1;
}
.btn-icon svg {
  width: 15px;
  height: 15px;
  margin: 0;
}


/* ==================== Badges ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger  { background: var(--danger-light);  color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info    { background: var(--info-light);    color: var(--info); }
.badge-muted   { background: var(--glass);         color: var(--text-muted); }
.badge-primary { background: rgba(79,70,229,0.15); color: var(--primary-light); }

/* ==================== Forms ==================== */
.form-group { margin-bottom: 1.25rem; }
.form-row { display: grid; gap: 1rem; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}
.form-label.required::after {
  content: ' *';
  color: var(--danger);
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  transition: all var(--t-fast);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  background: rgba(79,70,229,0.04);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-dim); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236B7280' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 2.5rem; }
.form-textarea { min-height: 100px; resize: vertical; }
.form-help { font-size: 0.78rem; color: var(--text-dim); margin-top: 4px; }
.form-error { font-size: 0.78rem; color: var(--danger); margin-top: 4px; }

/* ==================== Tables ==================== */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--t-fast); }
.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

/* ==================== Alerts ==================== */
.alert {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 1rem;
}
.alert svg { flex-shrink: 0; margin-top: 2px; }
.alert-success { background: var(--success-light); border: 1px solid rgba(16,185,129,0.25); color: #6EE7B7; }
.alert-danger  { background: var(--danger-light);  border: 1px solid rgba(239,68,68,0.25);  color: #FCA5A5; }
.alert-warning { background: var(--warning-light); border: 1px solid rgba(245,158,11,0.25); color: #FCD34D; }
.alert-info    { background: var(--info-light);    border: 1px solid rgba(59,130,246,0.25);  color: #93C5FD; }

/* ==================== Modal ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.98);
  transition: transform var(--t);
}
.modal-overlay.active .modal { transform: none; }
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 1.05rem; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 4px; }
.modal-close:hover { color: var(--text); background: var(--glass); }
.modal-body { padding: 1.5rem; overflow-y: auto; flex: 1; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; gap: 0.5rem; justify-content: flex-end; }

/* ==================== Dropdown ==================== */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 180px;
  padding: 0.4rem;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: all var(--t-fast);
}
.dropdown-menu.open { opacity: 1; pointer-events: all; transform: none; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t-fast);
}
.dropdown-item:hover { background: var(--glass-hover); color: var(--text); }
.dropdown-item.danger:hover { background: var(--danger-light); color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 0.3rem 0; }

/* ==================== Progress ==================== */
.progress { height: 6px; background: var(--bg4); border-radius: 3px; overflow: hidden; }
.progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* ==================== Tabs ==================== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.tab-btn {
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  font-family: 'Inter', sans-serif;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--t-fast);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary-light); border-bottom-color: var(--primary); }

/* ==================== Empty State ==================== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-state-icon {
  width: 72px;
  height: 72px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}
.empty-state-icon svg { width: 32px; height: 32px; }
.empty-state h3 { font-size: 1.1rem; font-weight: 600; color: var(--text); margin-bottom: 0.5rem; }
.empty-state p  { font-size: 0.875rem; max-width: 320px; margin: 0 auto 1.25rem; }

/* ==================== Breadcrumb ==================== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.breadcrumb-sep { color: var(--text-dim); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .current { color: var(--text); font-weight: 500; }

/* ==================== Avatar ==================== */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

/* ==================== Search Bar ==================== */
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
}
.search-bar svg {
  position: absolute;
  left: 10px;
  color: var(--text-dim);
  width: 16px;
  height: 16px;
}
.search-input {
  padding: 0.55rem 0.9rem 0.55rem 2.25rem;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  outline: none;
  transition: all var(--t-fast);
  min-width: 240px;
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
.search-input::placeholder { color: var(--text-dim); }

/* ==================== Utilities ==================== */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-1 { gap: 0.25rem; } .gap-2 { gap: 0.5rem; } .gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; } .gap-6 { gap: 1.5rem; }
.mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; }
.p-4 { padding: 1rem; } .p-6 { padding: 1.5rem; }
.text-sm   { font-size: 0.8rem; }
.text-muted { color: var(--text-muted); }
.text-dim   { color: var(--text-dim); }
.text-danger{ color: var(--danger); }
.text-success{color: var(--success); }
.font-bold  { font-weight: 700; }
.font-semi  { font-weight: 600; }
.rounded    { border-radius: var(--radius); }
.truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==================== Notification Dot ==================== */
.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg2);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* ==================== Scrollbar ==================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ==================== Responsive ==================== */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .main-content { margin-left: 0; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-content { padding: 1rem; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ==================== Animations ==================== */
.fade-in {
  animation: fadeIn 0.3s ease forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.slide-in {
  animation: slideIn 0.3s ease forwards;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: none; }
}

/* Shimmer loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==================== Super Admin Badge ==================== */
.super-admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: linear-gradient(135deg, #7C3AED, #4F46E5);
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ==================== Print Utilities ==================== */
@media print {
  .sidebar, .app-header, .page-header-right, .btn { display: none !important; }
  .main-content { margin-left: 0; }
  .page-content { padding: 0; }
}

/* ==================== Light Theme System ==================== */
[data-theme="light"],
body.light-theme {
  --bg:             #F1F5F9;
  --bg2:            #FFFFFF;
  --bg3:            #F8FAFC;
  --bg4:            #E2E8F0;
  --border:         rgba(0, 0, 0, 0.09);
  --border-strong:  rgba(0, 0, 0, 0.18);
  --text:           #0F172A;
  --text-muted:     #64748B;
  --text-dim:       #94A3B8;
  --glass:          rgba(0, 0, 0, 0.04);
  --glass-hover:    rgba(0, 0, 0, 0.08);

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06);
  --shadow:     0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:  0 20px 40px rgba(0,0,0,0.12);
}


[data-theme="light"] body,
body.light-theme {
  background-color: #F1F5F9 !important;
  color: #0F172A !important;
}

[data-theme="light"] .sidebar,
body.light-theme .sidebar {
  background: #FFFFFF !important;
  border-right-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .sidebar-nav .nav-item,
body.light-theme .sidebar-nav .nav-item {
  color: #475569;
}

[data-theme="light"] .sidebar-nav .nav-item:hover,
body.light-theme .sidebar-nav .nav-item:hover {
  background: #F1F5F9;
  color: #0F172A;
}

[data-theme="light"] .sidebar-nav .nav-item.active,
body.light-theme .sidebar-nav .nav-item.active {
  background: rgba(79, 70, 229, 0.1);
  color: #4F46E5;
  font-weight: 600;
}

[data-theme="light"] .sidebar-section-title,
body.light-theme .sidebar-section-title {
  color: #94A3B8;
}

[data-theme="light"] .app-header,
body.light-theme .app-header {
  background: rgba(255, 255, 255, 0.88) !important;
  border-bottom-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

[data-theme="light"] .header-workspace-badge,
body.light-theme .header-workspace-badge {
  background: #F1F5F9 !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  color: #0F172A !important;
}

[data-theme="light"] .header-page-title,
[data-theme="light"] .header-title,
body.light-theme .header-page-title,
body.light-theme .header-title {
  color: #0F172A !important;
}

[data-theme="light"] .header-search-trigger,
body.light-theme .header-search-trigger {
  background: #F8FAFC !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  color: #334155 !important;
}
[data-theme="light"] .header-search-trigger:hover,
body.light-theme .header-search-trigger:hover {
  background: #F1F5F9 !important;
  border-color: #6366F1 !important;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.12) !important;
}
[data-theme="light"] .search-placeholder,
body.light-theme .search-placeholder {
  color: #64748B !important;
}
[data-theme="light"] kbd.kbd-key,
body.light-theme kbd.kbd-key {
  background: #E2E8F0 !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  color: #475569 !important;
}

[data-theme="light"] .header-user-chip,
body.light-theme .header-user-chip {
  background: #F8FAFC !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}
[data-theme="light"] .user-chip-name,
body.light-theme .user-chip-name {
  color: #0F172A !important;
}
[data-theme="light"] .user-chip-role,
body.light-theme .user-chip-role {
  color: #64748B !important;
}

[data-theme="light"] .header-flyout,
body.light-theme .header-flyout {
  background: #FFFFFF !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1) !important;
  color: #0F172A !important;
}
[data-theme="light"] .notif-menu-header,
[data-theme="light"] .notif-menu-footer,
body.light-theme .notif-menu-header,
body.light-theme .notif-menu-footer {
  background: #F8FAFC !important;
  border-color: rgba(0, 0, 0, 0.06) !important;
}
[data-theme="light"] .notif-item,
body.light-theme .notif-item {
  border-color: rgba(0, 0, 0, 0.06) !important;
}
[data-theme="light"] .notif-item.unread,
body.light-theme .notif-item.unread {
  background: #F0F4FF !important;
}
[data-theme="light"] .notif-item-msg,
body.light-theme .notif-item-msg {
  color: #0F172A !important;
}

[data-theme="light"] .cmd-palette-dialog,
body.light-theme .cmd-palette-dialog {
  background: #FFFFFF !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: #0F172A !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.15) !important;
}
[data-theme="light"] .cmd-palette-search-bar,
[data-theme="light"] .cmd-palette-footer,
body.light-theme .cmd-palette-search-bar,
body.light-theme .cmd-palette-footer {
  border-color: rgba(0, 0, 0, 0.08) !important;
  background: #F8FAFC !important;
}
[data-theme="light"] .cmd-palette-input,
body.light-theme .cmd-palette-input {
  color: #0F172A !important;
}
[data-theme="light"] .cmd-item,
body.light-theme .cmd-item {
  color: #0F172A !important;
}
[data-theme="light"] .cmd-item:hover,
[data-theme="light"] .cmd-item.selected,
body.light-theme .cmd-item:hover,
body.light-theme .cmd-item.selected {
  background: #F1F5F9 !important;
}
[data-theme="light"] .cmd-item-icon,
body.light-theme .cmd-item-icon {
  background: #EEF2F6 !important;
}

[data-theme="light"] .user-banner-name,
body.light-theme .user-banner-name {
  color: #0F172A !important;
}
[data-theme="light"] .user-menu-links .dropdown-item,
body.light-theme .user-menu-links .dropdown-item {
  color: #334155 !important;
}
[data-theme="light"] .user-menu-links .dropdown-item:hover,
body.light-theme .user-menu-links .dropdown-item:hover {
  background: #F1F5F9 !important;
  color: #0F172A !important;
}

[data-theme="light"] .page-title,
body.light-theme .page-title {
  color: #0F172A !important;
}

[data-theme="light"] .card,
body.light-theme .card {
  background: #FFFFFF !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  color: #0F172A !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .card-header,
body.light-theme .card-header {
  background: #FFFFFF !important;
  border-bottom-color: rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .table,
body.light-theme .table {
  color: #0F172A !important;
}

[data-theme="light"] .table th,
body.light-theme .table th {
  background: #F8FAFC !important;
  color: #64748B !important;
  border-bottom-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .table td,
body.light-theme .table td {
  border-bottom-color: rgba(0, 0, 0, 0.05) !important;
  color: #1E293B !important;
}

[data-theme="light"] .table tr:hover td,
body.light-theme .table tr:hover td {
  background: #F8FAFC !important;
}

[data-theme="light"] .form-control,
[data-theme="light"] .form-select,
body.light-theme .form-control,
body.light-theme .form-select {
  background: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
}

[data-theme="light"] .form-control:focus,
[data-theme="light"] .form-select:focus,
body.light-theme .form-control:focus,
body.light-theme .form-select:focus {
  border-color: #4F46E5 !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
}

[data-theme="light"] .btn-secondary,
body.light-theme .btn-secondary {
  background: #E2E8F0 !important;
  border-color: #CBD5E1 !important;
  color: #1E293B !important;
}

[data-theme="light"] .btn-secondary:hover,
body.light-theme .btn-secondary:hover {
  background: #CBD5E1 !important;
  color: #0F172A !important;
}

[data-theme="light"] .dropdown-menu,
body.light-theme .dropdown-menu {
  background: #FFFFFF !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  color: #0F172A !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .dropdown-item,
body.light-theme .dropdown-item {
  color: #334155 !important;
}

[data-theme="light"] .dropdown-item:hover,
body.light-theme .dropdown-item:hover {
  background: #F1F5F9 !important;
  color: #0F172A !important;
}

[data-theme="light"] .modal-content,
body.light-theme .modal-content {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15) !important;
}

[data-theme="light"] .modal-header,
[data-theme="light"] .modal-footer,
body.light-theme .modal-header,
body.light-theme .modal-footer {
  border-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .btn-close-white,
body.light-theme .btn-close-white {
  filter: invert(1) grayscale(100%) !important;
}

[data-theme="light"] .tpl-card,
body.light-theme .tpl-card {
  background: #FFFFFF !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .tpl-footer,
body.light-theme .tpl-footer {
  background: #F8FAFC !important;
  border-top-color: rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .tpl-body h3,
body.light-theme .tpl-body h3 {
  color: #0F172A !important;
}

[data-theme="light"] .designer-layout,
body.light-theme .designer-layout {
  background: #E2E8F0 !important;
}

[data-theme="light"] .designer-sidebar,
[data-theme="light"] .designer-properties,
[data-theme="light"] .designer-topbar,
body.light-theme .designer-sidebar,
body.light-theme .designer-properties,
body.light-theme .designer-topbar {
  background: #FFFFFF !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .tool-btn,
body.light-theme .tool-btn {
  background: #F1F5F9 !important;
  border-color: #E2E8F0 !important;
  color: #334155 !important;
}

[data-theme="light"] .tool-btn:hover,
body.light-theme .tool-btn:hover {
  background: rgba(99, 102, 241, 0.1) !important;
  border-color: #6366F1 !important;
  color: #4F46E5 !important;
}

[data-theme="light"] .toolbar-header,
body.light-theme .toolbar-header {
  color: #0F172A !important;
  border-bottom-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .designer-viewport,
body.light-theme .designer-viewport {
  background-color: #CBD5E1 !important;
  background-image: radial-gradient(#94A3B8 1px, transparent 1px) !important;
}

[data-theme="light"] .side-tab,
body.light-theme .side-tab {
  background: #F1F5F9;
  color: #64748B;
}

[data-theme="light"] .side-tab.active,
body.light-theme .side-tab.active {
  background: #4F46E5 !important;
  color: #FFFFFF !important;
}

/* Light Theme Alerts */
[data-theme="light"] .alert-success, body.light-theme .alert-success { background: #ECFDF5 !important; border-color: #A7F3D0 !important; color: #065F46 !important; }
[data-theme="light"] .alert-danger,  body.light-theme .alert-danger  { background: #FEF2F2 !important; border-color: #FECACA !important; color: #991B1B !important; }
[data-theme="light"] .alert-warning, body.light-theme .alert-warning { background: #FFFBEB !important; border-color: #FDE68A !important; color: #92400E !important; }
[data-theme="light"] .alert-info,    body.light-theme .alert-info    { background: #EFF6FF !important; border-color: #BFDBFE !important; color: #1E40AF !important; }

/* Light Theme Search & Inputs */
[data-theme="light"] .search-input,
body.light-theme .search-input {
  background: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
}
[data-theme="light"] .search-input:focus,
body.light-theme .search-input:focus {
  border-color: #4F46E5 !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
}

/* Light Theme Badges */
[data-theme="light"] .badge-muted,
body.light-theme .badge-muted {
  background: #E2E8F0 !important;
  color: #475569 !important;
}

/* Light Theme Empty State */
[data-theme="light"] .empty-state,
body.light-theme .empty-state {
  color: #64748B !important;
}
[data-theme="light"] .empty-state h3,
body.light-theme .empty-state h3 {
  color: #0F172A !important;
}
[data-theme="light"] .empty-state-icon,
body.light-theme .empty-state-icon {
  background: #F8FAFC !important;
  border-color: #E2E8F0 !important;
}

/* Light Theme Quick Action Cards */
[data-theme="light"] .quick-action,
body.light-theme .quick-action {
  background: #FFFFFF !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .quick-action:hover,
body.light-theme .quick-action:hover {
  border-color: #4F46E5 !important;
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.12) !important;
}

/* Light Theme Stat Cards */
[data-theme="light"] .stat-card,
body.light-theme .stat-card {
  background: #FFFFFF !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

/* ==================== Standard Layout & Utility Classes ==================== */
.content-container {
  padding: 1.75rem;
  flex: 1;
}

.d-flex { display: flex !important; }
.d-none { display: none !important; }
.d-inline-flex { display: inline-flex !important; }
.d-block { display: block !important; }

@media (min-width: 768px) {
  .d-md-inline { display: inline !important; }
  .d-md-flex { display: flex !important; }
  .d-md-none { display: none !important; }
}

.align-center, .align-items-center { align-items: center !important; }
.justify-between, .justify-content-between { justify-content: space-between !important; }
.justify-center, .justify-content-center { justify-content: center !important; }
.justify-end, .justify-content-end { justify-content: flex-end !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-column, .flex-col { flex-direction: column !important; }
.flex-1 { flex: 1 !important; }

.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }

.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.me-3 { margin-right: 1rem !important; }
.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.ms-auto { margin-left: auto !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 0.75rem !important; }
.mt-4 { margin-top: 1rem !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 0.75rem !important; }
.mb-4 { margin-bottom: 1rem !important; }

.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }

.text-primary { color: var(--primary-light) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-center { text-align: center !important; }
.text-right, .text-end { text-align: right !important; }

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 0.25rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -0.75rem;
  margin-left: -0.75rem;
}
.row > * {
  box-sizing: border-box;
  padding-right: 0.75rem;
  padding-left: 0.75rem;
  width: 100%;
}
.g-2 { margin-right: -0.25rem; margin-left: -0.25rem; }
.g-2 > * { padding-right: 0.25rem; padding-left: 0.25rem; margin-bottom: 0.5rem; }
.g-3 { margin-right: -0.5rem; margin-left: -0.5rem; }
.g-3 > * { padding-right: 0.5rem; padding-left: 0.5rem; margin-bottom: 1rem; }
.g-4 { margin-right: -0.75rem; margin-left: -0.75rem; }
.g-4 > * { padding-right: 0.75rem; padding-left: 0.75rem; margin-bottom: 1.5rem; }

@media (min-width: 768px) {
  .col-md-3 { width: 25% !important; }
  .col-md-4 { width: 33.333333% !important; }
  .col-md-6 { width: 50% !important; }
  .col-md-8 { width: 66.666667% !important; }
  .col-md-12 { width: 100% !important; }
}

@media (min-width: 992px) {
  .col-lg-3 { width: 25% !important; }
  .col-lg-4 { width: 33.333333% !important; }
  .col-lg-6 { width: 50% !important; }
  .col-lg-8 { width: 66.666667% !important; }
}


