/* =========================
   PharmAssist Enterprise — Executive Catalyst
   Premium Multi-Million Dollar Investment Grade UI
   Sophisticated Gradient Palette with Neural Glass Effects
   ========================= */
:root{
  /* Premium Dark Foundation */
  --bg: linear-gradient(135deg, #0a0f1c 0%, #1a1b2e 40%, #16213e 100%);
  --bg-solid: #0a0f1c;
  --panel: rgba(15, 25, 42, 0.95);
  --panel-glass: rgba(25, 35, 55, 0.85);
  --panel-elevated: rgba(35, 45, 65, 0.9);
  --surface: rgba(20, 30, 50, 0.8);
  
  /* Neural Typography */
  --text: #f8fafc;
  --text-secondary: #cbd5e1;
  --muted: #94a3b8;
  --subtle: #64748b;
  
  /* Catalyst Primary Palette */
  --primary: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
  --primary-solid: #2563eb;
  --primary-600: #1d4ed8;
  --primary-700: #1e40af;
  --primary-800: #1e3a8a;
  
  /* Quantum Accent */
  --accent: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --accent-solid: #f59e0b;
  --accent-600: #d97706;
  --accent-glow: rgba(245, 158, 11, 0.3);
  
  /* Executive Emerald */
  --emerald: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --emerald-solid: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.25);
  
  /* Neural States */
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  
  /* Glass Morphism */
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-highlight: rgba(255, 255, 255, 0.05);
  --backdrop-blur: blur(20px);
  
  /* Premium Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  --shadow-neural: 0 0 50px rgba(59, 130, 246, 0.15);
  --shadow-accent: 0 0 30px var(--accent-glow);
  
  /* Quantum Borders */
  --border: rgba(255, 255, 255, 0.1);
  --border-light: rgba(255, 255, 255, 0.05);
  --border-accent: rgba(245, 158, 11, 0.3);
  
  /* Neural Radiuses */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;
  
  /* Executive Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  
  /* Animation Curves */
  --ease-out: cubic-bezier(0.0, 0.0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0.0, 1, 1);
  --ease-in-out: cubic-bezier(0.4, 0.0, 0.2, 1);
  --bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* =========================
   Neural Base Architecture
   ========================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-solid);
  background-image: 
    radial-gradient(circle at 20% 10%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 70%, rgba(245, 158, 11, 0.05) 0%, transparent 50%),
    var(--bg);
  background-attachment: fixed;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Neural Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

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

/* Neural Scroll Bar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-solid);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-solid);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-600);
}

/* =========================
   Executive Navigation
   ========================= */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6) var(--space-8);
  background: var(--panel-glass);
  backdrop-filter: var(--backdrop-blur);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  animation: slideInRight 0.6s var(--ease-out);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.brand {
  font-weight: 800;
  font-size: 1.5rem;
  background: var(--primary);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.topnav a {
  color: var(--muted);
  text-decoration: none;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-weight: 500;
  transition: all 0.2s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.topnav a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--glass-highlight);
  transition: left 0.3s var(--ease-out);
}

.topnav a:hover::before {
  left: 0;
}

.topnav a:hover {
  color: var(--text);
  background: var(--glass-highlight);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.topnav a.active {
  color: var(--text);
  background: var(--primary-solid);
  box-shadow: var(--shadow-neural);
  font-weight: 600;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.user-badge {
  background: var(--panel-elevated);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  font-weight: 500;
}

/* =========================
   Executive Layout System
   ========================= */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
  position: relative;
}

.container-fluid {
  width: 100%;
  padding: 0 var(--space-6);
}

.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* =========================
   Neural Glass Sections
   ========================= */
.pa-section {
  background: var(--panel-glass);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-8);
  margin: var(--space-6) 0;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s var(--ease-out);
}

.pa-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--glass-highlight);
}

.pa-section:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-xl), var(--shadow-accent);
  transform: translateY(-2px);
  transition: all 0.3s var(--ease-out);
}

.pa-section h1, .pa-section h2, .pa-section h3 {
  margin: 0 0 var(--space-6);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.pa-section h1 {
  font-size: 2.5rem;
  background: var(--primary);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.pa-section h2 {
  font-size: 1.875rem;
  color: var(--text);
  position: relative;
  padding-bottom: var(--space-4);
}

.pa-section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--accent);
  border-radius: var(--radius-full);
}

.pa-section h3 {
  font-size: 1.25rem;
  color: var(--text-secondary);
}

.pa-section p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: var(--space-4);
}

.pa-section-elevated {
  background: var(--panel-elevated);
  border: 1px solid var(--border-accent);
  box-shadow: var(--shadow-xl), var(--shadow-neural);
}

.pa-section-glass {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* =========================
   Neural Form Controls
   ========================= */
input[type="text"], 
input[type="email"],
input[type="password"], 
input[type="search"], 
input[type="file"],
input[type="number"],
textarea, 
select, 
.pa-input {
  width: 100%;
  padding: var(--space-4) var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  outline: none;
  transition: all 0.2s var(--ease-out);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
}

::placeholder {
  color: var(--subtle);
  font-weight: 400;
}

input:focus, 
textarea:focus, 
select:focus,
.pa-input:focus {
  outline: none;
  border-color: var(--primary-solid);
  box-shadow: 
    inset 0 2px 8px rgba(0, 0, 0, 0.1),
    0 0 0 3px rgba(59, 130, 246, 0.1),
    var(--shadow-neural);
  background: var(--panel-glass);
  transform: translateY(-1px);
}

input:hover:not(:focus), 
textarea:hover:not(:focus), 
select:hover:not(:focus) {
  border-color: var(--border-accent);
  background: var(--panel-glass);
}

.input-group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.input-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.025em;
}

.input-error {
  border-color: var(--danger);
  box-shadow: 
    inset 0 2px 8px rgba(0, 0, 0, 0.1),
    0 0 0 3px rgba(239, 68, 68, 0.1);
}

.error-message {
  font-size: 0.875rem;
  color: var(--danger);
  margin-top: var(--space-1);
}

/* =========================
   Neural File Upload
   ========================= */
.pa-file {
  display: block;
  width: 100%;
  padding: var(--space-8) var(--space-6);
  border-radius: var(--radius-xl);
  border: 2px dashed var(--border-accent);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  transition: all 0.3s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.pa-file::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
  transition: left 0.6s var(--ease-out);
}

.pa-file:hover::before {
  left: 100%;
}

.pa-file:hover {
  border-color: var(--primary-solid);
  background: var(--panel-glass);
  color: var(--text);
  box-shadow: var(--shadow-neural);
  transform: translateY(-2px);
}

.pa-file:active {
  transform: translateY(0);
  box-shadow: var(--shadow);
}

.file-upload-icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  opacity: 0.6;
}

.file-upload-text {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.file-upload-subtext {
  font-size: 0.875rem;
  opacity: 0.7;
}

/* =========================
   Executive Button System
   ========================= */
.btn, 
button, 
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s var(--ease-out);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.025em;
}

.btn::before,
button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.6s var(--ease-out);
}

.btn:hover::before,
button:hover::before {
  left: 100%;
}

.btn:hover, 
button:hover, 
input[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn:active, 
button:active, 
input[type="submit"]:active {
  transform: translateY(0);
  box-shadow: var(--shadow);
}

/* Primary Button */
.btn-primary, 
button[type="submit"] {
  background: var(--primary);
  color: var(--text);
  border: 1px solid var(--primary-solid);
  box-shadow: var(--shadow-neural);
}

.btn-primary:hover, 
button[type="submit"]:hover {
  background: var(--primary-600);
  border-color: var(--primary-600);
  box-shadow: var(--shadow-xl), var(--shadow-neural);
}

.btn-primary:focus-visible, 
button[type="submit"]:focus-visible {
  outline: none;
  box-shadow: 
    var(--shadow-neural),
    0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Secondary Button */
.btn-secondary {
  background: var(--panel-glass);
  color: var(--text);
  border: 1px solid var(--border);
  backdrop-filter: var(--backdrop-blur);
}

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

/* Accent Button */
.btn-accent {
  background: var(--accent);
  color: var(--bg-solid);
  border: 1px solid var(--accent-solid);
  box-shadow: var(--shadow-accent);
  font-weight: 700;
}

.btn-accent:hover {
  background: var(--accent-600);
  box-shadow: var(--shadow-xl), var(--shadow-accent);
}

/* Success Button */
.btn-success {
  background: var(--emerald);
  color: var(--text);
  border: 1px solid var(--emerald-solid);
  box-shadow: var(--emerald-glow);
}

.btn-success:hover {
  box-shadow: var(--shadow-lg), var(--emerald-glow);
}

/* Danger Button */
.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: 0.75rem;
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: 1rem;
}

.btn-xl {
  padding: var(--space-6) var(--space-12);
  font-size: 1.125rem;
  border-radius: var(--radius-xl);
}

/* Button Groups */
.button-row, .action-cell .row, .table .row {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.btn-group {
  display: flex;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

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

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

.btn-group .btn:last-child {
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  border-right: 1px solid;
}

/* =========================
   Executive Data Tables
   ========================= */
.table-container {
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--panel-glass);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

table thead {
  background: var(--panel-elevated);
  position: relative;
}

table thead::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-accent);
}

table th {
  padding: var(--space-4) var(--space-6);
  text-transform: uppercase;
  letter-spacing: 0.075em;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: left;
  white-space: nowrap;
}

table tbody tr {
  transition: all 0.2s var(--ease-out);
  border-bottom: 1px solid var(--border-light);
}

table tbody tr:hover {
  background: var(--surface);
  cursor: pointer;
  transform: scale(1.001);
}

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

table td {
  padding: var(--space-4) var(--space-6);
  color: var(--text);
  vertical-align: middle;
}

table td:first-child {
  font-weight: 600;
}

/* Table Badges */
.table-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table-badge.success {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.table-badge.warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.table-badge.danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.table-badge.info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--info);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Responsive Tables */
@media (max-width: 768px) {
  .table-container {
    overflow-x: auto;
  }
  
  table {
    min-width: 600px;
  }
}

/* =========================
   Utility Classes
   ========================= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

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

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* =========================
   Responsive Design
   ========================= */
@media (max-width: 1200px) {
  .container {
    max-width: 100%;
    padding: var(--space-6) var(--space-4);
  }
}

@media (max-width: 768px) {
  .topnav {
    padding: var(--space-4);
    flex-wrap: wrap;
  }
  
  .nav-links {
    order: 3;
    width: 100%;
    margin-top: var(--space-4);
    justify-content: center;
  }
  
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
  
  .pa-section {
    padding: var(--space-6);
  }
  
  .pa-section h1 {
    font-size: 2rem;
  }
  
  .pa-section h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: var(--space-4) var(--space-3);
  }
  
  .topnav {
    padding: var(--space-3);
  }
  
  .brand {
    font-size: 1.25rem;
  }
  
  .pa-section {
    padding: var(--space-4);
    margin: var(--space-4) 0;
  }
}