:root {
  /* Color Palette - Clinical & Professional */
  --primary: #0052cc;
  --primary-dark: #0747a6;
  --secondary: #6554c0;
  --success: #36b37e;
  --warning: #ffab00;
  --danger: #ff5630;
  --info: #00b8d9;
  
  /* Neutral Palette */
  --bg-main: #f4f5f7;
  --bg-card: #ffffff;
  --text-main: #172b4d;
  --text-muted: #5e6c84;
  --border: #dfe1e6;
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 48px;
  --space-2xl: 64px;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 20px rgba(0,0,0,0.05), 0 6px 6px rgba(0,0,0,0.1);
  
  /* Borders */
  --radius: 8px;
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
}

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

.sidebar {
  width: 260px;
  background: #091e42;
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.main-content {
  flex: 1;
  margin-left: 260px;
  padding: var(--space-lg);
  width: calc(100% - 260px);
}

/* Sidebar Components */
.sidebar-header {
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-nav {
  padding: var(--space-md) 0;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: all 0.2s;
  gap: var(--space-md);
}

.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: white;
}

.nav-item.active {
  background: rgba(255,255,255,0.1);
  color: white;
  border-left: 4px solid var(--info);
}

/* Header */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
  background: white;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

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

/* Components */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: white;
  padding: var(--space-lg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-sm);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
}

.stat-trend {
  font-size: 0.8rem;
  margin-top: var(--space-xs);
}

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

/* Main Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-lg);
}

.right-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-success { color: var(--success); }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 600; }
.font-extra-bold { font-weight: 800; }
.uppercase { text-transform: uppercase; }
.font-small { font-size: 0.8rem; }
.font-xs { font-size: 0.75rem; }
.font-md { font-size: 0.9rem; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: var(--space-sm); }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: var(--space-sm); }
.p-0 { padding: 0 !important; }
.w-full { width: 100%; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.text-center { text-align: center; }

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.75rem;
}

.progress-bar {
  height: 8px;
  background: #ebecf0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
}

.protocol-list {
  padding-left: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.protocol-list li {
  margin-bottom: var(--space-xs);
}

.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

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

.card-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

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

/* Patient List Table */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  padding: var(--space-md);
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
}

td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.risk-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.risk-high { background: #ffebe6; color: var(--danger); }
.risk-medium { background: #fff0b3; color: #856404; }
.risk-low { background: #e3fcef; color: var(--success); }

/* Patient Details / Monitoring */
.monitor-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.vitals-card {
  background: #f8f9fa;
  border-radius: var(--radius);
  padding: var(--space-md);
  border-left: 4px solid var(--primary);
}

.vitals-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.vitals-value {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 4px 0;
}

/* Forms */
.form-group {
  margin-bottom: var(--space-md);
}

label {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: 500;
  font-size: 0.9rem;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
}

.btn {
  padding: 10px 20px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-main); }
.btn-outline:hover { background: #f4f5f7; }

/* Alerts */
.alert-banner {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.alert-danger {
  background: #ffebe6;
  border: 1px solid #ff5630;
  color: #bf2600;
}

/* Utility */
.placeholder-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #dfe1e6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #5e6c84;
}

.placeholder-image {
  width: 100%;
  height: 200px;
  background: #f4f5f7;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.placeholder-image::after {
  content: attr(data-label);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeIn 0.4s ease-out forwards;
}
