/* ─── Shared Utility Styles ───────────────────────────
   Used across appointments, pharmacies, patient, clinic templates
   Inherits CSS custom properties from index.css
   ─────────────────────────────────────────────────── */

/* ─── Cards ───────────────────────────────────────── */
.card {
  background: var(--bg-white, #fff);
  border-radius: var(--radius-md, 14px);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.06));
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #eef0f2;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md, 0 8px 30px rgba(0,0,0,0.08));
}

.card-body { padding: 1.5rem; }
.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #eef0f2;
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark, #2d3436);
}
.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #eef0f2;
  background: var(--bg-light, #f8f9fa);
  border-radius: 0 0 var(--radius-md, 14px) var(--radius-md, 14px);
}

/* ─── Tables ──────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md, 14px);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.06));
  border: 1px solid #eef0f2;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-white, #fff);
}

table thead {
  background: var(--bg-light, #f8f9fa);
}

table th {
  padding: 0.9rem 1.2rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted, #636e72);
  border-bottom: 2px solid #eef0f2;
  white-space: nowrap;
}

table td {
  padding: 0.9rem 1.2rem;
  font-size: 0.92rem;
  color: var(--text-dark, #2d3436);
  border-bottom: 1px solid #f0f2f5;
  vertical-align: middle;
}

table tbody tr {
  transition: background 0.2s ease;
}

table tbody tr:hover {
  background: #f8faff;
}

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

/* ─── Badges / Status Pills ───────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: capitalize;
}

.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-warning { background: #fff8e1; color: #f57f17; }
.badge-danger  { background: #ffebee; color: #c62828; }
.badge-info    { background: #e3f2fd; color: #1565c0; }
.badge-default { background: #f5f5f5; color: #616161; }

/* ─── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm, 8px);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  font-family: inherit;
  text-decoration: none;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary { background: var(--primary, #005EB8); color: #fff; }
.btn-primary:hover { background: var(--primary-dark, #003087); box-shadow: 0 6px 20px rgba(0,94,184,0.35); }

.btn-secondary { background: var(--bg-light, #f8f9fa); color: var(--text-dark, #2d3436); border: 1px solid #e0e4e8; }
.btn-secondary:hover { background: #e8ecf1; }

.btn-danger { background: #dc3545; color: #fff; }
.btn-danger:hover { background: #c82333; box-shadow: 0 6px 20px rgba(220,53,69,0.35); }

.btn-success { background: var(--accent, #00b894); color: #fff; }
.btn-success:hover { background: #00a381; box-shadow: 0 6px 20px rgba(0,184,148,0.35); }

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.82rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }

/* ─── Forms ───────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--text-dark, #2d3436);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 2px solid #e8eaed;
  border-radius: var(--radius-sm, 8px);
  font-size: 0.92rem;
  transition: border-color 0.3s, box-shadow 0.3s;
  font-family: inherit;
  outline: none;
  background: var(--bg-white, #fff);
  color: var(--text-dark, #2d3436);
}

.form-control:focus {
  border-color: var(--primary, #005EB8);
  box-shadow: 0 0 0 3px rgba(0,94,184,0.1);
}

.form-control.is-invalid {
  border-color: #dc3545;
}

select.form-control {
  appearance: auto;
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

/* ─── Page Header ─────────────────────────────────── */
.page-header {
  padding: 2rem 2rem 0;
  max-width: 1200px;
  margin: 0 auto;
}

.page-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--text-dark, #2d3436);
  margin-bottom: 0.3rem;
}

.page-header p {
  color: var(--text-muted, #636e72);
  font-size: 0.95rem;
}

/* ─── Content Section ─────────────────────────────── */
.content-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.content-section-sm {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

/* ─── Grid Layouts ────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

/* ─── Flex Utilities ──────────────────────────────── */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap { gap: 1rem; }
.flex-gap-sm { gap: 0.5rem; }

/* ─── Spacing ─────────────────────────────────────── */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* ─── Text ────────────────────────────────────────── */
.text-muted { color: var(--text-muted, #636e72); }
.text-primary { color: var(--primary, #005EB8); }
.text-center { text-align: center; }
.text-sm { font-size: 0.85rem; }
.font-serif { font-family: 'Playfair Display', serif; }

/* ─── Empty State ─────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted, #636e72);
}
.empty-state i { font-size: 3rem; margin-bottom: 1rem; opacity: 0.3; }
.empty-state h3 { font-family: 'Playfair Display', serif; color: var(--text-dark, #2d3436); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.92rem; }

/* ─── Alert / Flash Messages ──────────────────────── */
.alert {
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-sm, 8px);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.alert-success { background: #e8f5e9; color: #2e7d32; border-left: 4px solid #2e7d32; }
.alert-danger  { background: #ffebee; color: #c62828; border-left: 4px solid #c62828; }
.alert-warning { background: #fff8e1; color: #f57f17; border-left: 4px solid #f57f17; }
.alert-info    { background: #e3f2fd; color: #1565c0; border-left: 4px solid #1565c0; }

/* ─── Detail Row ──────────────────────────────────── */
.detail-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid #f0f2f5;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { font-weight: 600; font-size: 0.88rem; color: var(--text-muted, #636e72); }
.detail-value { font-size: 0.92rem; color: var(--text-dark, #2d3436); }

/* ─── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .detail-row { grid-template-columns: 1fr; gap: 0.2rem; }
  .page-header { padding: 1.5rem 1rem 0; }
  .content-section { padding: 1rem; }
  .content-section-sm { padding: 1rem; }
}

@media (max-width: 480px) {
  table th, table td { padding: 0.6rem 0.8rem; }
  .card-body { padding: 1rem; }
}
