/* ============================================
   PostPro Nexus - Combined Styles
   Includes: Legacy Module Styles (header layout)
             + Command Center v2 (sidebar layout)
   ============================================ */

/* ============================================
   CSS VARIABLES - Combined
   ============================================ */
:root {
  /* Legacy variables (used by all module pages) */
  --bg-color: #F0F2F5;
  --card-bg: #FFFFFF;
  --text-main: #1A202C;
  --text-muted: #718096;
  --accent-color: #000000;
  --tech-blue: #3B82F6;
  --tech-cyan: #06B6D4;
  --tech-green: #10B981;
  --tech-red: #EF4444;
  --tech-purple: #8B5CF6;
  --tech-orange: #F59E0B;
  --border-color: #E2E8F0;
  --grid-line: rgba(0, 0, 0, 0.05);
  
  /* Command Center v2 variables */
  --sidebar-bg: #0f1419;
  --sidebar-bg-hover: #1a2028;
  --sidebar-bg-active: rgba(59, 130, 246, 0.15);
  --sidebar-text: #8b9aab;
  --sidebar-text-bright: #ffffff;
  --sidebar-border: #1e2630;
  
  --bg-primary: #f5f7fa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f8fafc;
  --bg-hover: #f1f5f9;
  
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  
  --accent-primary: #3b82f6;
  --accent-secondary: #2563eb;
  --accent-light: rgba(59, 130, 246, 0.1);
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  
  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;
  
  --grid-color: rgba(148, 163, 184, 0.08);
  --grid-size: 32px;
  
  --dept-technical: #06b6d4;
  --dept-operations: #10b981;
  --dept-sales: #f59e0b;
  --dept-finance: #3b82f6;
  --dept-customer: #ec4899;
  --dept-logistics: #8b5cf6;
  
  --status-success: #10b981;
  --status-warning: #f59e0b;
  --status-error: #ef4444;
  --status-info: #3b82f6;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.05);
  --shadow-card: 0 1px 3px 0 rgb(0 0 0 / 0.04), 0 1px 2px -1px rgb(0 0 0 / 0.04);
  
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --topbar-height: 72px;
  
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
}

/* ============================================
   PART 1: LEGACY MODULE STYLES
   Used by: machines.html, errors.html, components.html,
            tools.html, benchmarking.html, admin.html
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
  background-color: var(--bg-color);
  background-image: 
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 20px 20px;
  color: var(--text-main); 
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; 
  min-height: 100vh;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tech-font {
  font-family: 'JetBrains Mono', monospace;
}

/* --- Dark Module Header (matching homepage topbar) --- */
.header { 
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--sidebar-border);
  padding: 0 24px; 
  position: sticky; 
  top: 0; 
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.logo-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  font-weight: 400;
  color: var(--sidebar-text-bright);
  letter-spacing: 0.08em;
}

.logo-divider {
  height: 24px;
  width: 1px;
  background: var(--sidebar-border);
  margin: 0 10px;
}

/* Header module title badge */
.header .badge {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border: none;
  background: transparent;
  color: var(--sidebar-text-bright);
}

/* Back to dashboard link in dark header */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.back-link:hover {
  color: var(--sidebar-text-bright);
  background: var(--sidebar-bg-hover);
}

/* Header buttons on dark background */
.header .btn {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  clip-path: none;
}

.header .btn:hover {
  background: var(--accent-secondary);
  border-color: var(--accent-secondary);
  color: white;
}

.header .btn-secondary {
  background: transparent;
  border: 1px solid var(--sidebar-border);
  color: var(--sidebar-text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
}

.header .btn-secondary:hover {
  background: var(--sidebar-bg-hover);
  border-color: var(--sidebar-text);
  color: var(--sidebar-text-bright);
}

/* --- Futuristic Cards (legacy) --- */
.card { 
  background: var(--card-bg); 
  border: 1px solid var(--border-color); 
  position: relative;
  padding: 20px; 
  clip-path: polygon(
    0 0, 
    100% 0, 
    100% calc(100% - 15px), 
    calc(100% - 15px) 100%, 
    0 100%, 
    0 15px,
    15px 0
  );
}

.card::before {
  content: ''; 
  position: absolute; 
  top: 0; 
  left: 0; 
  width: 30px; 
  height: 30px;
  border-top: 2px solid var(--text-main); 
  border-left: 2px solid var(--text-main); 
  pointer-events: none;
}

.card::after {
  content: ''; 
  position: absolute; 
  bottom: 0; 
  right: 0; 
  width: 30px; 
  height: 30px;
  border-bottom: 2px solid var(--text-main); 
  border-right: 2px solid var(--text-main); 
  pointer-events: none;
}

/* --- Legacy Buttons --- */
.btn { 
  background: var(--text-main); 
  color: white; 
  padding: 8px 20px; 
  font-family: 'JetBrains Mono', monospace; 
  text-transform: uppercase; 
  font-size: 14px;
  border: 1px solid var(--text-main); 
  cursor: pointer; 
  transition: all 0.2s; 
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn:hover { 
  background: transparent; 
  color: var(--text-main); 
}

.btn:disabled { 
  opacity: 0.5; 
  cursor: not-allowed; 
}

.btn-secondary { 
  background: transparent; 
  color: var(--text-main); 
  border: 1px solid var(--border-color);
  padding: 8px 16px; 
  cursor: pointer; 
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase; 
  font-size: 13px; 
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

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

.btn-danger { 
  background: var(--tech-red); 
  border-color: var(--tech-red); 
  color: white; 
  padding: 8px 16px;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  font-size: 13px;
  transition: all 0.2s;
}

.btn-danger:hover { 
  background: transparent; 
  color: var(--tech-red); 
}

/* --- Legacy Inputs --- */
.input { 
  background: #F8FAFC; 
  border: 1px solid var(--border-color); 
  padding: 10px 12px; 
  color: var(--text-main); 
  width: 100%; 
  font-family: 'JetBrains Mono', monospace;
  transition: border-color 0.2s;
  font-size: 14px;
}

.input:focus { 
  outline: none; 
  border-color: var(--text-main); 
  background: white; 
}

.input::placeholder {
  color: var(--text-muted);
}

/* --- Legacy Lists & Rows --- */
.row { 
  padding: 12px; 
  margin-bottom: 4px; 
  cursor: pointer; 
  transition: all 0.15s; 
  border-left: 3px solid transparent; 
  border-bottom: 1px solid #f1f1f1;
}

.row:hover { 
  background: #F8FAFC; 
  border-left-color: var(--border-color); 
}

.row.selected { 
  background: #EDF2F7; 
  border-left-color: var(--text-main); 
  font-weight: 600; 
}

/* --- Legacy Badges --- */
.badge { 
  display: inline-block; 
  padding: 2px 8px; 
  font-size: 11px; 
  font-weight: 600; 
  font-family: 'JetBrains Mono', monospace; 
  text-transform: uppercase; 
  border: 1px solid transparent;
}

.badge-green { 
  background: rgba(16, 185, 129, 0.1); 
  color: var(--tech-green); 
  border-color: var(--tech-green); 
}

.badge-yellow { 
  background: rgba(245, 158, 11, 0.1); 
  color: #D97706; 
  border-color: #D97706; 
}

.badge-gray { 
  background: #E2E8F0; 
  color: var(--text-muted); 
}

.badge-cyan { 
  background: rgba(6, 182, 212, 0.1); 
  color: var(--tech-cyan); 
  border-color: var(--tech-cyan); 
}

.badge-red { 
  background: rgba(239, 68, 68, 0.1); 
  color: var(--tech-red); 
  border-color: var(--tech-red); 
}

.badge-blue { 
  background: rgba(59, 130, 246, 0.1); 
  color: var(--tech-blue); 
  border-color: var(--tech-blue); 
}

.badge-purple {
  background: rgba(139, 92, 246, 0.1);
  color: var(--tech-purple);
  border-color: var(--tech-purple);
}

.badge-orange {
  background: rgba(245, 158, 11, 0.1);
  color: var(--tech-orange);
  border-color: var(--tech-orange);
}

.btn-sm { padding: 4px 10px; font-size: 11px; }

/* --- Legacy Modals --- */
dialog { 
  background: var(--card-bg); 
  border: 1px solid var(--text-main); 
  color: var(--text-main); 
  padding: 0; 
  max-width: 90vw; 
  max-height: 90vh; 
  position: fixed; 
  top: 50%; 
  left: 50%;
  transform: translate(-50%, -50%); 
  margin: 0;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  z-index: 10000;
}

dialog::backdrop { 
  background: rgba(255, 255, 255, 0.8); 
  backdrop-filter: blur(4px);
  z-index: 9999;
}

.modal-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #F8FAFC;
}

.modal-header h3 {
  font-weight: 700;
  font-size: 16px;
}

.modal-body {
  padding: 24px;
}

/* --- Legacy Stats & Details --- */
.stat-box { 
  padding: 16px; 
  background: #F8FAFC; 
  border: 1px solid var(--border-color); 
}

.stat-number { 
  font-family: 'JetBrains Mono', monospace; 
  font-size: 32px; 
  font-weight: 700; 
  margin-bottom: 4px; 
}

.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.detail-label { 
  color: var(--text-muted); 
  font-size: 12px; 
  text-transform: uppercase; 
  font-weight: 600; 
  margin-bottom: 4px;
  display: block;
}

.detail-value { 
  font-family: 'JetBrains Mono', monospace; 
  font-size: 15px; 
  color: var(--text-main); 
}

/* --- Legacy Tables --- */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: #F8FAFC;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

tr:hover {
  background: #FAFAFA;
}

/* --- Legacy Loading --- */
@keyframes spin { 
  to { transform: rotate(360deg); } 
}

.loading-spinner {
  border: 4px solid #f3f3f3; 
  border-top: 4px solid var(--text-main); 
  border-radius: 50%;
  width: 40px; 
  height: 40px; 
  animation: spin 1s linear infinite;
}

/* --- Legacy Scrollbars --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* --- Legacy Utility Classes --- */
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.text-xs { font-size: 12px; }
.text-sm { font-size: 14px; }
.text-lg { font-size: 18px; }

/* --- Legacy Back Link --- */
.back-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--text-main);
}

/* --- Legacy Item Cards (for components/tools) --- */
.item-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s;
}

.item-card:hover {
  border-color: var(--text-main);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.item-image {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

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

.item-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
}

.item-meta {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.item-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* --- Legacy Grid Layouts --- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* --- Legacy Form Sections --- */
.form-section {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  padding: 16px;
  margin-bottom: 16px;
}

.form-section h4 {
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 14px;
}


/* ============================================
   PART 2: COMMAND CENTER v2 STYLES
   Used by: index.html (new sidebar layout)
   ============================================ */

/* App Container for sidebar layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Override body styles for Command Center pages */
body.command-center-v2 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  background-image: none;
}

/* ============================================
   SIDEBAR NAVIGATION - Dark Theme
   ============================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: width var(--transition-normal);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .search-input,
.sidebar.collapsed .search-shortcut,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-item-text,
.sidebar.collapsed .nav-item-badge,
.sidebar.collapsed .user-details,
.sidebar.collapsed .nav-section-title {
  display: none;
}

.sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 16px 0;
  flex-direction: column;
  gap: 8px;
}

/* Hide collapse button in collapsed state, or center it */
.sidebar.collapsed .sidebar-collapse-btn {
  margin-left: 0;
  margin: 0 auto;
}

.sidebar.collapsed .sidebar-logo-icon {
  margin: 0 auto;
}

.sidebar.collapsed .sidebar-search {
  padding: 8px 12px;
}

.sidebar.collapsed .search-input-wrapper {
  justify-content: center;
  padding: 10px;
}

/* Center nav section header (the toggle arrows) */
.sidebar.collapsed .nav-section-header {
  justify-content: center;
  padding: 8px 0;
}

.sidebar.collapsed .nav-section-toggle {
  margin: 0;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px;
}

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

/* Center sidebar footer user avatar */
.sidebar.collapsed .sidebar-footer {
  padding: 16px 0;
}

.sidebar.collapsed .user-info {
  justify-content: center;
}

.sidebar.collapsed .user-avatar {
  margin: 0 auto;
}

/* Sidebar Header */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo {
  height: 32px;
  width: auto;
  filter: brightness(0) invert(1);
}

.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  display: none;
  flex-shrink: 0;
}

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

.sidebar.collapsed .sidebar-logo-icon {
  display: block;
}

.sidebar-brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--sidebar-text-bright);
}

.sidebar-collapse-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.sidebar-collapse-btn:hover {
  background: var(--sidebar-bg-hover);
  color: var(--sidebar-text-bright);
}

/* Sidebar Search */
.sidebar-search {
  padding: 16px 16px 8px;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--sidebar-bg-hover);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  transition: all var(--transition-fast);
}

.search-input-wrapper:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-icon {
  color: var(--sidebar-text);
  flex-shrink: 0;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.nav-loading {
  padding: 16px;
  text-align: center;
  color: var(--sidebar-text);
  font-size: 0.875rem;
}

.nav-section {
  margin-bottom: 8px;
}

.nav-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px 6px;
  cursor: pointer;
  user-select: none;
}

.nav-section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sidebar-text);
}

.nav-section-toggle {
  color: var(--sidebar-text);
  transition: transform var(--transition-fast);
}

.nav-section.collapsed .nav-section-toggle {
  transform: rotate(-90deg);
}

.nav-section.collapsed .nav-section-items {
  display: none;
}

.nav-section-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.nav-item:hover {
  background: var(--sidebar-bg-hover);
  color: var(--sidebar-text-bright);
}

.nav-item.active {
  background: var(--sidebar-bg-active);
  color: var(--accent-primary);
}

.nav-item-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sidebar-text);
}

.nav-item-icon svg {
  width: 18px;
  height: 18px;
}

.nav-item:hover .nav-item-icon,
.nav-item.active .nav-item-icon {
  color: inherit;
}

.nav-item-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item-badge {
  background: var(--accent-primary);
  color: white;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
}

.nav-item-badge.locked-badge {
  background: transparent;
  color: var(--sidebar-text);
  padding: 0;
  min-width: auto;
}

.locked-indicator {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  color: var(--text-muted);
  vertical-align: middle;
}

.locked-indicator svg {
  width: 12px;
  height: 12px;
}

.nav-item.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.nav-item.locked:hover {
  background: transparent;
  color: var(--sidebar-text);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--sidebar-border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

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

.user-role {
  font-size: 0.75rem;
  color: var(--sidebar-text);
  text-transform: capitalize;
}

/* ============================================
   MAIN CONTENT AREA - Clean White Design + Grid
   ============================================ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: 
    linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px),
    var(--bg-primary);
  background-size: var(--grid-size) var(--grid-size);
  transition: margin-left var(--transition-normal);
}

.sidebar.collapsed ~ .main-content {
  margin-left: var(--sidebar-collapsed);
}

/* Top Bar - Dark theme matching sidebar */
.topbar {
  height: var(--topbar-height);
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
}

.topbar .page-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--sidebar-text-bright);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Legacy system status for module pages (not inside topbar) */
.system-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tech-green);
  animation: pulse 2s infinite;
}

/* V2 system status inside topbar */
.topbar .system-status {
  padding: 8px 14px;
  background: rgba(16, 185, 129, 0.15);
  border-radius: var(--radius-lg);
  margin-right: 12px;
  font-family: inherit;
  font-size: 0.8125rem;
  color: var(--status-success);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-success);
  animation: pulse 2s infinite;
}

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

.status-text {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--status-success);
}

.topbar-btn {
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 10px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.topbar-btn:hover {
  background: var(--sidebar-bg-hover);
  color: var(--sidebar-text-bright);
}

.topbar-btn.active {
  color: var(--accent-primary);
}

.topbar-btn.logout-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--status-error);
}

/* ============================================
   DASHBOARD - Clean Card Design
   ============================================ */
.dashboard {
  flex: 1;
  padding: 32px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

/* Welcome Section */
.welcome-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.welcome-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.25rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.welcome-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-gradient);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25);
  text-decoration: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
}

/* Stats Grid - Card Style */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
}

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

.stat-card.loading {
  opacity: 0.6;
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.stat-icon svg {
  width: 22px;
  height: 22px;
}

.stat-icon.technical,
.stat-icon.operations,
.stat-icon.sales,
.stat-icon.finance { 
  background: var(--bg-tertiary); 
  color: var(--text-secondary); 
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.5rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.stat-change.positive { 
  color: var(--status-success); 
  background: rgba(16, 185, 129, 0.1);
}
.stat-change.negative { 
  color: var(--status-error); 
  background: rgba(239, 68, 68, 0.1);
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  margin-bottom: 32px;
}

/* Dashboard Sections */
.dashboard-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.section-title svg {
  color: var(--text-muted);
}

.section-action {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent-primary);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.section-action:hover {
  color: var(--accent-secondary);
}

/* Modules Grid */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.module-card-loading,
.modules-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.module-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px;
  background: var(--bg-tertiary);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-fast);
  position: relative;
}

.module-card:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.module-card.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.module-card.locked:hover {
  background: var(--bg-tertiary);
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.module-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.module-icon svg {
  width: 22px;
  height: 22px;
}

.module-icon.technical,
.module-icon.operations,
.module-icon.sales,
.module-icon.finance,
.module-icon.customer,
.module-icon.logistics { 
  background: var(--bg-hover); 
  color: var(--text-secondary); 
}

.module-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.module-count {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.module-access-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.module-access-badge.admin {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.module-access-badge.editor {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.module-access-badge.viewer {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.module-access-badge.locked {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
}

/* Activity / Quick Stats List */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item,
.stat-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.activity-item:hover,
.stat-item:hover {
  background: var(--bg-hover);
}

.activity-icon,
.stat-item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-hover);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-icon svg,
.stat-item-icon svg {
  width: 18px;
  height: 18px;
}

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

.activity-text,
.stat-item-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.activity-text strong {
  font-weight: 600;
  color: var(--text-primary);
}

.activity-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.stat-item-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

/* View Toggle */
.view-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg-tertiary);
  padding: 4px;
  border-radius: var(--radius-md);
}

.view-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
}

.view-btn:hover {
  color: var(--text-primary);
}

.view-btn.active {
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Department View */
.department-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.department-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.department-header:hover {
  background: var(--bg-tertiary);
}

.department-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.department-icon svg {
  width: 22px;
  height: 22px;
}

.department-info {
  flex: 1;
}

.department-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.department-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.department-toggle {
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.department-section.expanded .department-toggle {
  transform: rotate(180deg);
}

.department-content {
  display: none;
  padding: 16px 24px 24px;
  background: var(--bg-tertiary);
}

.department-section.expanded .department-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.dept-module-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-fast);
}

.dept-module-item:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.dept-module-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dept-module-icon svg {
  width: 18px;
  height: 18px;
}

.dept-module-info {
  flex: 1;
  min-width: 0;
}

.dept-module-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.dept-module-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Quick Actions Section */
.quick-actions-section {
  margin-top: 0;
}

.quick-actions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.quick-action-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

/* ============================================
   V2 MODALS - Clean Design (for Command Center)
   ============================================ */
.modal {
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 0;
  max-width: 90vw;
  max-height: 90vh;
}

.modal::backdrop {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  width: 520px;
  max-width: 100%;
}

.quick-create-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.quick-create-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 20px;
  background: var(--bg-tertiary);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-fast);
}

.quick-create-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.quick-create-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.quick-create-icon svg {
  width: 28px;
  height: 28px;
}

.quick-create-label {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

/* Command Palette */
.command-palette {
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 0;
  width: 640px;
  max-width: 90vw;
  position: fixed;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
}

.command-palette::backdrop {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}

.command-palette-content {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.command-search {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}

.command-search svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.command-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 1.0625rem;
  color: var(--text-primary);
  outline: none;
}

.command-search input::placeholder {
  color: var(--text-muted);
}

.command-search kbd {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.command-results {
  max-height: 420px;
  overflow-y: auto;
  padding: 12px;
}

.command-group {
  margin-bottom: 12px;
}

.command-group-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 10px 14px 6px;
}

.command-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  text-decoration: none;
  color: inherit;
}

.command-item:hover,
.command-item.selected {
  background: var(--bg-tertiary);
}

.command-item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.command-item-icon svg {
  width: 18px;
  height: 18px;
}

.command-item-text {
  flex: 1;
}

.command-item-name {
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.command-item-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.command-no-results {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1280px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .mobile-menu-btn {
    display: flex;
  }
  
  .topbar {
    padding: 0 20px;
  }
  
  .dashboard {
    padding: 20px;
  }
  
  .welcome-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .system-status .status-text {
    display: none;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .modules-grid {
    grid-template-columns: 1fr;
  }
  
  .quick-create-grid {
    grid-template-columns: 1fr;
  }
  
  .department-content {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   V2 SCROLLBARS
   ============================================ */

/* Sidebar scrollbar - darker */
.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

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

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

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: var(--sidebar-text);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================
   ADDITIONAL FIXES - December 2024
   ============================================ */

/* --- Sidebar Search: Button-like Clickable Styling --- */
.sidebar-search .search-input-wrapper {
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.sidebar-search .search-input-wrapper:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.sidebar-search .search-input {
  cursor: pointer;
  caret-color: transparent;
  background: transparent;
  border: none;
  color: var(--sidebar-text);
  font-size: 0.875rem;
  flex: 1;
  min-width: 0;
}

.sidebar-search .search-input::placeholder {
  color: var(--sidebar-text);
}

.sidebar-search .search-input:focus {
  outline: none;
  box-shadow: none;
}

/* Hide the ⌘K shortcut badge */
.sidebar-search .search-shortcut,
.search-shortcut {
  display: none !important;
}

/* --- Command Palette: Remove Input White Highlight --- */
.command-search input {
  background: transparent !important;
}

.command-search input:focus {
  outline: none;
  box-shadow: none;
  background: transparent !important;
}

.command-search input::selection {
  background: rgba(59, 130, 246, 0.2);
}

/* --- Dashboard Grid: Full Width (removed side panel) --- */
.dashboard-grid {
  display: block !important;
  grid-template-columns: none !important;
}

.pinned-modules {
  width: 100%;
}

/* --- Modules Grid: Responsive Full Width --- */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* --- Module Cards: Improved Styling --- */
.module-card {
  position: relative;
  padding: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.module-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-medium);
}

.module-card.locked {
  cursor: not-allowed;
  opacity: 0.7;
}

.module-card.locked:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border-light);
}

/* Module Access Badge */
.module-access-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.module-access-badge.admin {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

.module-access-badge.editor,
.module-access-badge.custom {
  background: rgba(59, 130, 246, 0.15);
  color: #2563EB;
}

.module-access-badge.viewer {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.module-access-badge.locked {
  background: rgba(239, 68, 68, 0.1);
  color: #DC2626;
}

/* Locked Indicator (small lock icon) */
.locked-indicator {
  opacity: 0.5;
  display: inline-flex;
  align-items: center;
}

.locked-indicator svg {
  width: 12px;
  height: 12px;
}

/* --- Command Palette: Locked Items --- */
.command-item[style*="cursor: not-allowed"] {
  opacity: 0.5;
}

/* --- No Quick Actions Message --- */
.no-quick-actions {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ============================================
   STANDARDIZED MODULE HEADER STYLES
   Consistent across all modules
   ============================================ */

/* Header User Badge - consistent styling */
.header-user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--sidebar-border);
  border-radius: 24px;
}

.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
}

.header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.header-user-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--sidebar-text-bright);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Header Icon Buttons - Admin & Logout */
.header-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.header-icon-btn:hover {
  background: var(--sidebar-bg-hover);
  border-color: var(--sidebar-text);
  color: var(--sidebar-text-bright);
}

.header-icon-btn svg {
  width: 20px;
  height: 20px;
}

.header-icon-btn.logout-btn:hover {
  border-color: #EF4444;
  color: #EF4444;
}

/* Header right layout */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Module-specific buttons group */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 8px;
  padding-right: 16px;
  border-right: 1px solid var(--sidebar-border);
}

/* Back link styling */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  margin-right: 8px;
}

.back-link:hover {
  color: var(--sidebar-text-bright);
  background: var(--sidebar-bg-hover);
}
