/* ARKA Clinic — single stylesheet */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #1a1a2e;
  background: #f5f7fa;
  min-height: 100vh;
}

/* ── Layout ── */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

.wide { max-width: 900px; }

/* ── Header ── */
.site-header {
  background: #155858;
  color: #fff;
  padding: 0.9rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-brand       { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: #fff; }
.site-logo          { height: 42px; width: 42px; border-radius: 50%; object-fit: contain; background: #fff; flex-shrink: 0; }
.site-header .brand { font-size: 1.15rem; font-weight: 800; letter-spacing: .02em; line-height: 1.2; }
.brand-pulmo        { font-weight: 500; opacity: 0.88; }
.site-header .sub   { font-size: 0.72rem; opacity: 0.65; line-height: 1.3; }
.site-header nav    { margin-left: auto; display: flex; gap: 1rem; }
.site-header nav a  { color: #c8e8e8; text-decoration: none; font-size: 0.9rem; }
.site-header nav a:hover { color: #fff; }

/* ── Cards ── */
.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  padding: 1.4rem;
  margin-bottom: 1.2rem;
}

/* ── Typography ── */
h1 { font-size: 1.5rem; margin-bottom: 0.3rem; }
h2 { font-size: 1.15rem; margin-bottom: 0.8rem; color: #155858; }
h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
p  { margin-bottom: 0.6rem; }

.muted { color: #666; font-size: 0.9rem; }
.label { font-weight: 600; }

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.95rem; }

input[type="text"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid #ccd1d9;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  transition: border-color .15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #155858;
}

textarea { min-height: 80px; resize: vertical; }

.checkbox-group { display: flex; flex-direction: column; gap: 0.5rem; }
.checkbox-group label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-weight: normal;
  font-size: 0.92rem;
  cursor: pointer;
}
.checkbox-group input[type="checkbox"] {
  width: auto;
  margin-top: 3px;
  flex-shrink: 0;
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 0.55rem 1.3rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .15s, opacity .15s;
}

.btn-primary   { background: #155858; color: #fff; }
.btn-primary:hover { background: #0d4545; }

.btn-success   { background: #198754; color: #fff; }
.btn-success:hover { background: #146c43; }

.btn-danger    { background: #dc3545; color: #fff; }
.btn-danger:hover { background: #b02a37; }

.btn-warning   { background: #f0a500; color: #fff; }
.btn-warning:hover { background: #c48500; }

.btn-outline   { background: transparent; border: 2px solid #155858; color: #155858; }
.btn-outline:hover { background: #155858; color: #fff; }

.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.85rem; }

.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* ── Slots grid ── */
.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.5rem;
  margin: 0.8rem 0;
}

.slot-btn {
  padding: 0.55rem;
  border: 2px solid #ccd1d9;
  border-radius: 6px;
  background: #fff;
  text-align: center;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all .15s;
}

.slot-btn:hover  { border-color: #155858; background: #e5f5f5; }
.slot-btn.active { border-color: #155858; background: #155858; color: #fff; }

/* ── Status badges ── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.badge-waiting     { background: #fff3cd; color: #856404; }
.badge-in_progress { background: #cfe2ff; color: #084298; }
.badge-done        { background: #d1e7dd; color: #0a3622; }
.badge-cancelled   { background: #f8d7da; color: #842029; }
.badge-no_show     { background: #e2e3e5; color: #41464b; }
.badge-booked      { background: #d1e7dd; color: #0a3622; }
.badge-walkin      { background: #fff3cd; color: #856404; }

/* ── Alert / errors ── */
.alert {
  padding: 0.85rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}

.alert-danger  { background: #f8d7da; color: #842029; border: 1px solid #f1aeb5; }
.alert-info    { background: #cff4fc; color: #055160; border: 1px solid #9eeaf9; }
.alert-warning { background: #fff3cd; color: #664d03; border: 1px solid #ffda6a; }
.alert-success { background: #d1e7dd; color: #0a3622; border: 1px solid #a3cfbb; }

/* ── Queue / list rows ── */
.queue-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #eee;
}

.queue-row:last-child { border-bottom: none; }
.queue-time { font-size: 1.1rem; font-weight: 700; min-width: 52px; color: #155858; }
.queue-name { flex: 1; font-weight: 600; }
.queue-meta { color: #666; font-size: 0.88rem; }

/* ── Date nav ── */
.date-nav {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.date-nav .date-label {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
}

/* ── Table ── */
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th    { text-align: left; padding: 0.5rem 0.6rem; background: #f0f4f8; font-weight: 600; }
td    { padding: 0.5rem 0.6rem; border-top: 1px solid #eee; vertical-align: top; }
tr:hover td { background: #fafbfc; }

/* ── Intake form details ── */
.intake-detail { background: #f8f9fa; border-radius: 6px; padding: 0.9rem; margin-top: 0.5rem; }
.intake-detail dt { font-weight: 600; color: #555; font-size: 0.85rem; text-transform: uppercase; letter-spacing: .04em; }
.intake-detail dd { margin: 0 0 0.6rem 0; }

/* ── Vitals grid (intake form) ── */
.vitals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.5rem 0.75rem;
}
.vital-item label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #444;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 0.2rem;
}
.vital-unit {
  font-weight: normal;
  text-transform: none;
  letter-spacing: 0;
  color: #888;
}
.vital-item input[type="number"] {
  padding: 0.4rem 0.5rem;
  font-size: 0.95rem;
}

/* ── Vitals display (doctor view) ── */
.vitals-display {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  background: #f0f4f8;
  border-radius: 6px;
  padding: 0.55rem 0.8rem;
  margin-bottom: 0.7rem;
  font-size: 0.9rem;
}
.vital-chip { color: #1a1a2e; }
.vital-chip .vital-label {
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #555;
  margin-right: 0.2rem;
}

/* ── Form section dividers (intake) ── */
.form-section { padding-top: 1rem; margin-top: 0.5rem; border-top: 1px solid #eee; }
.form-section:first-child { padding-top: 0; margin-top: 0; border-top: none; }
.form-section h2 { margin-bottom: 0.3rem; }
.field-hint { color: #666; font-size: 0.85rem; margin-bottom: 0.4rem; }

/* ── Past prescription entries ── */
.past-rx-entry { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid #eee; }
.past-rx-entry:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.past-rx-date { font-size: 0.8rem; font-weight: 700; color: #555; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 0.25rem; }
.past-rx-text { font-family: inherit; font-size: 0.9rem; margin: 0; white-space: pre-wrap; color: #1a1a2e; }

/* ── Success icon ── */
.big-check {
  font-size: 3.5rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

/* ── Responsive tweaks ── */
@media (max-width: 480px) {
  .site-header { flex-wrap: wrap; }
  .site-header nav { margin-left: 0; }
  h1 { font-size: 1.25rem; }
}
