/* ==========================================================================
   Hospital CRM — custom styles (Tailwind handles most of the layout)
   ========================================================================== */

:root {
  --brand: #0d6efd;
  --brand-dark: #0a58ca;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* --- Scrollbar ----------------------------------------------------------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* --- Sidebar ------------------------------------------------------------- */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.5rem;
  color: #cbd5e1;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.sidebar-link:hover { background: #1e293b; color: #fff; }
.sidebar-link.active { background: var(--brand); color: #fff; }
.sidebar-link i { width: 1.1rem; text-align: center; }

/* --- Cards --------------------------------------------------------------- */
.stat-card {
  background: #fff;
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
}

/* --- Tables -------------------------------------------------------------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.data-table tbody tr:hover { background: #f8fafc; }

/* --- Badges -------------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
}

/* --- Modal --------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.modal-panel {
  background: #fff;
  border-radius: 0.75rem;
  max-width: 42rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

/* --- Forms --------------------------------------------------------------- */
.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.3rem;
}
.field-input {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  outline: none;
  transition: border 0.15s, box-shadow 0.15s;
  background: #fff;
}
.field-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-secondary { background: #e2e8f0; color: #334155; }
.btn-secondary:hover:not(:disabled) { background: #cbd5e1; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }

/* --- Toast --------------------------------------------------------------- */
.toast {
  min-width: 16rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  color: #fff;
  font-size: 0.875rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.2s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(1rem); } to { opacity: 1; transform: none; } }
.toast-success { background: #16a34a; }
.toast-error { background: #dc2626; }
.toast-info { background: #0d6efd; }

/* --- Login --------------------------------------------------------------- */
.login-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* --- Misc ---------------------------------------------------------------- */
.spinner {
  border: 3px solid #e2e8f0;
  border-top-color: var(--brand);
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.enc-badge {
  font-size: 0.65rem;
  color: #059669;
  background: #d1fae5;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  margin-left: 0.35rem;
}
