/**
 * Al-Razzaq Clinic - Professional Design System
 * Offline-First, Medical-Grade UI
 * Color Theme: Dark Navy Blue + Yellow + Neutral Support Colors
 */

:root {
  /* Navy Blue - Structure, Navigation, Authority */
  --navy-900: #0b1c2d;
  --navy-800: #102a43;
  --navy-700: #1c3d5a;
  --navy-600: #234a6b;

  /* Yellow - Actions, Highlights, CTAs */
  --yellow-500: #f5c518;
  --yellow-600: #e0b100;

  /* Gray/White - Calm Medical Space */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-300: #d1d5db;
  --gray-600: #4b5563;
  --gray-800: #1f2933;

  /* Status Colors */
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
}

/* Sidebar - Fixed, Navy Background */
.sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--navy-900);
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: var(--navy-800);
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--navy-700);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--navy-600);
}

/* Main Content Area */
.main-content {
  margin-left: 280px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  background: white;
  border-bottom: 1px solid var(--gray-300);
  padding: var(--spacing-lg) var(--spacing-xl);
  box-shadow: var(--shadow-sm);
}

/* Navigation Items */
.nav-item {
  display: flex;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-lg);
  margin: var(--spacing-xs) var(--spacing-md);
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--yellow-500);
}

.nav-item.active {
  background: var(--yellow-500);
  color: var(--navy-900);
  font-weight: 600;
}

/* Buttons */
.btn-primary {
  background: var(--yellow-500);
  color: var(--navy-900);
  font-weight: 600;
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.btn-primary:hover {
  background: var(--yellow-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-800);
  font-weight: 500;
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-300);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.btn-secondary:hover {
  background: var(--gray-300);
}

/* Content Cards */
.content-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-300);
  padding: var(--spacing-xl);
}

/* Status Badges */
.badge {
  display: inline-block;
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: rgba(22, 163, 74, 0.1);
  color: var(--success);
}

.badge-danger {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.badge-info {
  background: var(--navy-800);
  color: var(--yellow-500);
}

/* Forms - Compact Clinic Style */
.form-field {
  display: flex;
  flex-direction: column;
}

.form-label {
  display: block;
  font-weight: 500;
  color: var(--gray-800);
  margin-bottom: 0.25rem;
  font-size: 0.6875rem; /* 11px */
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.required-mark {
  color: var(--danger);
  margin-left: 0.125rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.375rem 0.5rem; /* Compact padding */
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem; /* 13px */
  line-height: 1.3;
  transition: all 0.15s ease;
  background: white;
  font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--yellow-500);
  box-shadow: 0 0 0 2px rgba(245, 197, 24, 0.1);
}

.form-input-error {
  border-color: var(--danger);
}

.form-error {
  display: block;
  font-size: 0.6875rem; /* 11px */
  color: var(--danger);
  margin-top: 0.125rem;
}

.form-textarea {
  resize: vertical;
  min-height: 3rem;
}

/* Form Grid Layout - Dense Clinic Style */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem 1rem; /* Compact gap */
}

.form-grid-full {
  grid-column: 1 / -1;
}

/* Page Header - Calm Clinic Style */
.page-header {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gray-300);
}

.page-title {
  font-size: 0.9375rem; /* 15px */
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.125rem;
}

.page-subtitle {
  font-size: 0.75rem; /* 12px */
  color: var(--gray-600);
}

/* Form Card - Subtle Container */
.form-card {
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: none;
}

/* Form Actions - Bottom Right */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-300);
}

.btn-compact {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem; /* 13px */
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.btn-compact-primary {
  background: var(--yellow-500);
  color: var(--navy-900);
}

.btn-compact-primary:hover {
  background: var(--yellow-600);
}

.btn-compact-secondary {
  background: var(--gray-100);
  color: var(--gray-800);
  border: 1px solid var(--gray-300);
}

.btn-compact-secondary:hover {
  background: var(--gray-300);
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table thead {
  background: var(--gray-100);
}

.table th {
  padding: var(--spacing-md);
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-600);
  border-bottom: 2px solid var(--gray-300);
}

.table td {
  padding: var(--spacing-md);
  border-bottom: 1px solid var(--gray-300);
}

.table tbody tr:hover {
  background: var(--gray-50);
}

/* Alerts */
.alert {
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.alert-success {
  background: rgba(22, 163, 74, 0.1);
  color: var(--success);
  border-left: 4px solid var(--success);
}

.alert-danger {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
  border-left: 4px solid var(--danger);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  border-left: 4px solid var(--warning);
}

/* User Badge */
.user-badge {
  background: var(--yellow-500);
  color: var(--navy-900);
  font-weight: 600;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
}

/* Role Badge */
.role-badge {
  background: var(--navy-800);
  color: var(--yellow-500);
  font-size: 0.75rem;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: var(--spacing-md);
}

.gap-4 {
  gap: var(--spacing-lg);
}

/* ============================================
   CLINIC UI SYSTEM - COMPLETE REFACTOR
   ============================================ */

/* Dashboard Cards - Calm Clinic Style */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.dashboard-card {
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 0.875rem;
  box-shadow: none;
}

.dashboard-card-icon {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  background: var(--navy-800);
  color: var(--yellow-500);
}

.dashboard-card-icon svg {
  width: 1rem;
  height: 1rem;
}

.dashboard-card-label {
  font-size: 0.6875rem; /* 11px */
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.dashboard-card-value {
  font-size: 1.25rem; /* 20px */
  font-weight: 700;
  color: var(--gray-800);
  line-height: 1.2;
}

/* Remove all gradient classes - clinic doesn't use them */
.no-gradients {
  background: var(--navy-900) !important;
}

/* Section Containers */
.section {
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 0.8125rem; /* 13px */
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--gray-300);
}

.section-divider {
  height: 1px;
  background: var(--gray-300);
  margin: 0.75rem 0;
  border: none;
}

/* Compact Table Styles */
.table-compact th,
.table-compact td {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
}

.table-compact th {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Action Buttons - Minimal */
.btn-action {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border: none;
  background: transparent;
  color: var(--gray-600);
  cursor: pointer;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.btn-action:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}

.btn-action-primary {
  color: var(--yellow-600);
}

.btn-action-primary:hover {
  background: rgba(245, 197, 24, 0.1);
  color: var(--yellow-600);
}

/* Remove Tailwind-like utility classes that aren't needed */
/* We use semantic classes instead */

