:root {
  /* Colors */
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --secondary: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg-body: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-sidebar: #0f172a;
  
  /* Text */
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-sidebar: #e2e8f0;
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  
  /* Borders */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --border-light: #e2e8f0;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  /* Layout */
  --sidebar-width: 260px;
  --header-height: 70px;
}

* {
  box-sizing: border-box;
}

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

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

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  color: var(--text-sidebar);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 var(--space-lg);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.brand {
  font-size: 18px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.nav-menu {
  padding: var(--space-lg) var(--space-md);
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: block;
  padding: 12px var(--space-md);
  color: var(--text-light);
  text-decoration: none;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-xs);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-weight: 500;
}

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

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

.nav-icon {
  width: 20px;
  height: 20px;
  background-color: rgba(255,255,255,0.2);
  border-radius: 4px;
}

.user-profile-mini {
  padding: var(--space-lg);
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

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

/* Header */
.top-header {
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  position: sticky;
  top: 0;
  z-index: 50;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-body);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  width: 300px;
}

.search-input {
  border: none;
  background: transparent;
  outline: none;
  margin-left: var(--space-sm);
  width: 100%;
  color: var(--text-main);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.action-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  padding: 8px;
  border-radius: 50%;
  transition: background 0.2s;
}

.action-btn:hover {
  background-color: var(--bg-body);
}

.notification-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background-color: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
}

/* Dashboard Content */
.content-wrapper {
  padding: var(--space-xl);
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.page-title-area {
  margin-bottom: var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
  font-size: 14px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.4);
}

/* Stats Grid */
.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: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-md);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.stat-icon.blue { background: #e0f2fe; color: var(--primary); }
.stat-icon.green { background: #dcfce7; color: var(--success); }
.stat-icon.orange { background: #fef3c7; color: var(--warning); }
.stat-icon.red { background: #fee2e2; color: var(--danger); }

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: var(--space-xs);
}

.stat-label {
  color: var(--text-muted);
  font-size: 14px;
}

.stat-trend {
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  margin-top: auto;
}

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

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

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

.card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.card-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.card-action {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}

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

/* Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: left;
  padding: 12px var(--space-md);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-light);
}

.table td {
  padding: 16px var(--space-md);
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  font-size: 14px;
}

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

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

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-body);
  flex-shrink: 0;
}

.avatar.sm {
  width: 32px;
  height: 32px;
}

.avatar.lg {
  width: 48px;
  height: 48px;
}

.status-badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}

.status-in-patient { background: #e0f2fe; color: var(--primary); }
.status-out-patient { background: #fef3c7; color: var(--warning); }
.status-recovered { background: #dcfce7; color: var(--success); }

/* Doctor List */
.doctor-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.doctor-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-light);
}

.doctor-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.doctor-info {
  flex: 1;
}

.doctor-name {
  font-weight: 600;
  display: block;
}

.doctor-dept {
  font-size: 12px;
  color: var(--text-muted);
}

.availability-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--success);
}

.availability-indicator.busy {
  background-color: var(--danger);
}

/* Charts Placeholders */
.chart-placeholder {
  height: 200px;
  background-color: var(--bg-body);
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding: 20px;
  gap: 10px;
}

.bar {
  width: 100%;
  background-color: var(--primary);
  opacity: 0.8;
  border-radius: 6px 6px 0 0;
  transition: height 0.3s;
  position: relative;
}

.bar:hover {
  opacity: 1;
}

.bar-label {
  position: absolute;
  bottom: -25px;
  width: 100%;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}

.bar.blue { background-color: #3b82f6; }
.bar.green { background-color: #10b981; }
.bar.orange { background-color: #f59e0b; }
.bar.red { background-color: #ef4444; }
.bar.grey { background-color: #94a3b8; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .main-content {
    margin-left: 0;
    width: 100%;
  }
  
  .menu-toggle {
    display: block;
  }
}

.placeholder-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    background-color: currentColor;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
}

/* Specific icon masks (simplified for wireframe) */
.icon-dashboard { -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 3H11V11H3V3Z' fill='currentColor'/%3E%3Cpath d='M13 3H21V11H13V3Z' fill='currentColor'/%3E%3Cpath d='M3 13H11V21H3V13Z' fill='currentColor'/%3E%3Cpath d='M13 13H21V21H13V13Z' fill='currentColor'/%3E%3C/svg%3E"); }
.icon-users { -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 12C14.21 12 16 10.21 16 8C16 5.79 14.21 4 12 4C9.79 4 8 5.79 8 8C8 10.21 9.79 12 12 12ZM12 14C9.33 14 4 15.34 4 18V20H20V18C20 15.34 14.67 14 12 14Z' fill='currentColor'/%3E%3C/svg%3E"); }
.icon-calendar { -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19 4H18V2H16V4H8V2H6V4H5C3.89 4 3.01 4.9 3.01 6L3 20C3 21.1 3.89 22 5 22H19C20.1 22 21 21.1 21 20V6C21 4.9 20.1 4 19 4ZM19 20H5V10H19V20ZM19 8H5V6H19V8Z' fill='currentColor'/%3E%3C/svg%3E"); }

