/* Clinical/Premium Hospital Management System Stylesheet */

/* Design Tokens and Theme Variables */
:root {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --ink: #0F172A;
  --ink-muted: #64748B;
  --border: #E2E8F0;
  --primary: #4F46E5;
  --primary-dark: #3730A3;
  --primary-tint: #EEF2FF;
  --accent: #7C3AED;
  --accent-tint: #F5F3FF;
  --danger: #DC2626;
  --danger-tint: #FEF2F2;
  --success: #059669;
  --success-tint: #ECFDF5;
  --warning: #D97706;
  --warning-tint: #FFFBEB;
}
/* NOTE: --primary/--accent above are the shipped defaults; views/partials/top.ejs
   and views/login.ejs override them at runtime via an inline <style> block using
   the admin-configured Settings > Theme colors, so a saved theme change affects
   both Tailwind utility classes (bg-primary, text-accent, ...) AND these custom
   component classes (.btn-primary, .clinic-card, .badge-*, ...) consistently. */

/* Base Typographical Pairings and Resets */
body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--ink);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-serif {
  font-family: Georgia, serif;
  font-weight: 600;
}

.mono-text, .invoice-num, .mrn-code, code {
  font-family: 'Courier New', Courier, monospace;
}

/* Premium Layout Components */
.sidebar {
  width: 232px;
  background-color: var(--primary);
  color: var(--primary-tint);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.main-content {
  margin-left: 232px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Cards with Soft Multi-Layer Shadow */
.clinic-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(18, 56, 50, 0.06), 0 4px 16px rgba(18, 56, 50, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Buttons and Interaction States */
.btn-primary {
  background-color: var(--primary);
  color: var(--surface);
  border: 1px solid var(--primary-dark);
  border-radius: 6px;
  padding: 8px 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-secondary {
  background-color: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn-secondary:hover {
  background-color: var(--bg);
  border-color: var(--ink-muted);
}

.btn-danger {
  background-color: var(--danger);
  color: var(--surface);
  border: 1px solid var(--danger);
  border-radius: 6px;
  padding: 8px 16px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.btn-danger:hover {
  opacity: 0.9;
}

/* Status Badges with Tints */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.badge-scheduled {
  background-color: var(--warning-tint);
  color: var(--warning);
  border: 1px solid rgba(192, 138, 46, 0.2);
}

.badge-completed {
  background-color: var(--success-tint);
  color: var(--success);
  border: 1px solid rgba(76, 122, 92, 0.2);
}

.badge-cancelled {
  background-color: var(--danger-tint);
  color: var(--danger);
  border: 1px solid rgba(179, 69, 59, 0.2);
}

.badge-no_show {
  background-color: var(--danger-tint);
  color: var(--ink-muted);
  border: 1px solid var(--border);
}

.badge-unpaid {
  background-color: var(--danger-tint);
  color: var(--danger);
  border: 1px solid rgba(179, 69, 59, 0.2);
}

.badge-paid {
  background-color: var(--success-tint);
  color: var(--success);
  border: 1px solid rgba(76, 122, 92, 0.2);
}

.badge-partial {
  background-color: var(--warning-tint);
  color: var(--warning);
  border: 1px solid rgba(192, 138, 46, 0.2);
}

.badge-refunded {
  background-color: var(--accent-tint);
  color: var(--accent);
  border: 1px solid rgba(176, 141, 87, 0.2);
}

/* Custom Table Styles */
.clinic-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.clinic-table th {
  background-color: var(--primary-tint);
  color: var(--primary-dark);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.clinic-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--ink);
  background-color: var(--surface);
}

.clinic-table tr:hover td {
  background-color: var(--bg);
}

/* Form Styles */
.clinic-input, .clinic-select, .clinic-textarea {
  width: 100%;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.875rem;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.clinic-input:focus, .clinic-select:focus, .clinic-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(176, 141, 87, 0.15);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-muted);
  margin-bottom: 6px;
}
