/* ============================================
   RUACH PRACTICE APP — SHARED STYLES
   ============================================ */

:root {
  --green:        #4A7C59;
  --green-dark:   #2D5A3D;
  --green-light:  #6EA17E;
  --accent:       #ccdfd6;
  --light:        #F7FCF9;
  --white:        #FFFFFF;
  --text:         #2C342E;
  --text-light:   #6D7A72;
  --border:       #E8EDEA;
  --amber:        #d97706;
  --amber-light:  #fef3c7;
  --red:          #dc2626;
  --red-light:    #fee2e2;
  --teal:         #0f766e;
  --teal-light:   #ccfbf1;
  --purple:       #7c3aed;
  --purple-light: #ede9fe;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.1);
  --radius:       12px;
  --radius-sm:    8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; color: var(--text); background: var(--light); font-size: 15px; line-height: 1.6; }
a { text-decoration: none; color: inherit; }
button { font-family: 'Inter', sans-serif; cursor: pointer; }
input, select, textarea { font-family: 'Inter', sans-serif; }

/* ─── LAYOUT ──────────────────────────────── */

.admin-body { overflow: hidden; height: 100vh; }
.client-body { background: var(--light); min-height: 100vh; }

.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ─── SIDEBAR ─────────────────────────────── */

.sidebar {
  background: var(--green-dark);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  position: relative;
  z-index: 100;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
}

.sidebar-title { display: flex; flex-direction: column; }
.sidebar-name { color: #fff; font-weight: 600; font-size: 15px; line-height: 1.3; }
.sidebar-role { color: rgba(255,255,255,0.5); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }

.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-footer { padding: 12px 0; border-top: 1px solid rgba(255,255,255,0.1); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  position: relative;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-item.active { color: #fff; background: rgba(255,255,255,0.12); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.nav-item i { width: 18px; text-align: center; font-size: 16px; flex-shrink: 0; }
.nav-logout { color: rgba(255,255,255,0.5); }
.nav-logout:hover { color: #ff9999; background: rgba(220,38,38,0.1); }

.badge {
  margin-left: auto;
  background: var(--amber);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 50px;
  min-width: 20px;
  text-align: center;
}

/* ─── MAIN CONTENT ────────────────────────── */

.main-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text);
  padding: 4px;
}

.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--text);
  font-weight: 700;
  flex: 1;
}

.topbar-date { font-size: 13px; color: var(--text-light); }

/* ─── PAGES ───────────────────────────────── */

.page { display: none; padding: 24px 28px; overflow-y: auto; flex: 1; }
.page.active { display: block; }

/* ─── STATS ───────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-icon.green   { background: #dcfce7; color: var(--green); }
.stat-icon.amber   { background: var(--amber-light); color: var(--amber); }
.stat-icon.teal    { background: var(--teal-light); color: var(--teal); }
.stat-icon.purple  { background: var(--purple-light); color: var(--purple); }

.stat-value { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* ─── CARDS ───────────────────────────────── */

.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.card-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  color: var(--text);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ─── APPOINTMENT LIST ────────────────────── */

.apt-list { padding: 8px 0; }

.apt-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.apt-item:last-child { border-bottom: none; }
.apt-item:hover { background: var(--light); }

.apt-time {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 60px;
  flex-shrink: 0;
}
.apt-time .day { font-size: 11px; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.05em; }
.apt-time .time { font-size: 14px; font-weight: 600; color: var(--text); }

.apt-divider { width: 1px; height: 40px; background: var(--border); flex-shrink: 0; }

.apt-info { flex: 1; min-width: 0; }
.apt-name { font-weight: 600; font-size: 14px; color: var(--text); }
.apt-type { font-size: 12px; color: var(--text-light); }

.apt-actions { display: flex; gap: 6px; flex-shrink: 0; }

.apt-empty { text-align: center; padding: 32px 20px; color: var(--text-light); font-size: 14px; }

/* ─── STATUS BADGES ───────────────────────── */

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.status-pending    { background: var(--amber-light); color: #92400e; }
.status-confirmed  { background: #dcfce7; color: #166534; }
.status-cancelled  { background: var(--red-light); color: #991b1b; }
.status-completed  { background: var(--teal-light); color: #134e4a; }

/* ─── TABLES ──────────────────────────────── */

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  background: var(--light);
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--light); }

.client-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.client-name-cell { display: flex; align-items: center; gap: 10px; }
.client-name { font-weight: 600; color: var(--text); }
.client-email { font-size: 12px; color: var(--text-light); }

/* ─── BUTTONS ─────────────────────────────── */

.btn-primary {
  background: var(--green);
  color: #fff;
  padding: 11px 24px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--green-dark); }
.btn-full { width: 100%; }

.btn-sm {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  transition: all 0.15s;
}
.btn-sm:hover { background: var(--light); }
.btn-green { background: var(--green); color: #fff; border-color: var(--green); }
.btn-green:hover { background: var(--green-dark); }
.btn-red { background: var(--red); color: #fff; border-color: var(--red); }
.btn-amber { background: var(--amber); color: #fff; border-color: var(--amber); }

.btn-link {
  background: none;
  border: none;
  color: var(--green);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.btn-link:hover { color: var(--green-dark); }

.btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.15s;
}
.btn-icon:hover { background: var(--light); }
.btn-icon.green { background: #dcfce7; border-color: #86efac; color: #166534; }
.btn-icon.red   { background: var(--red-light); border-color: #fca5a5; color: var(--red); }
.btn-icon.amber { background: var(--amber-light); border-color: #fcd34d; color: var(--amber); }

.btn-back {
  background: none;
  border: none;
  color: var(--green);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  padding: 0;
}
.btn-back:hover { color: var(--green-dark); }

/* ─── FORMS ───────────────────────────────── */

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--green); }
.form-group textarea { min-height: 100px; resize: vertical; }

.input-sm {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  background: var(--white);
  outline: none;
}
.input-sm:focus { border-color: var(--green); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ─── ALERTS ──────────────────────────────── */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-error   { background: var(--red-light); color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }

/* ─── LOGIN ───────────────────────────────── */

.login-screen {
  min-height: 100vh;
  background: var(--green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--white);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 12px;
}
.login-logo h2 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--text);
  margin-bottom: 4px;
}
.login-logo p { font-size: 13px; color: var(--text-light); }
.login-footer { text-align: center; font-size: 13px; color: var(--text-light); margin-top: 16px; }
.login-footer a { color: var(--green); font-weight: 500; }

/* ─── TABS ────────────────────────────────── */

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}

.tab {
  background: none;
  border: none;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  position: relative;
  transition: color 0.15s;
}
.tab.active { color: var(--green); }
.tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 2px;
  background: var(--green);
  border-radius: 2px 2px 0 0;
}
.tab:hover { color: var(--green); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── CLIENT DETAIL ───────────────────────── */

.client-detail-header {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.client-detail-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  flex-shrink: 0;
}
.client-detail-info h2 {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  margin-bottom: 4px;
}
.client-detail-meta { font-size: 13px; color: var(--text-light); display: flex; gap: 16px; flex-wrap: wrap; }
.client-detail-meta span { display: flex; align-items: center; gap: 6px; }

/* ─── NOTES ───────────────────────────────── */

.notes-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }

.note-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.note-date { font-size: 12px; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.05em; }
.note-body { font-size: 14px; color: var(--text); line-height: 1.7; white-space: pre-wrap; }

.note-form-wrap {
  background: var(--light);
  border-radius: var(--radius-sm);
  padding: 16px;
  border: 1px solid var(--border);
}
.note-form-wrap h4 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }

/* ─── MESSAGES ────────────────────────────── */

.messages-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - 72px);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
}

.messages-sidebar {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.messages-search { padding: 12px; border-bottom: 1px solid var(--border); }
.messages-search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
}
.messages-search input:focus { border-color: var(--green); }

#conversations-list { overflow-y: auto; flex: 1; }

.conversation-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.conversation-item:hover { background: var(--light); }
.conversation-item.active { background: #f0f9f4; }

.conv-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}
.conv-name { font-size: 14px; font-weight: 600; color: var(--text); }
.conv-preview { font-size: 12px; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-unread {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  margin-left: auto;
}

.messages-main { display: flex; flex-direction: column; overflow: hidden; }
.messages-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  gap: 12px;
}
.messages-empty i { font-size: 48px; opacity: 0.3; }

.messages-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.messages-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
}
.message-bubble.from-client {
  background: var(--light);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.message-bubble.from-admin {
  background: var(--green);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.message-time { font-size: 11px; opacity: 0.6; margin-top: 4px; }

.messages-compose {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
}
.messages-compose textarea {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  resize: none;
  outline: none;
  height: 60px;
  font-family: 'Inter', sans-serif;
}
.messages-compose textarea:focus { border-color: var(--green); }

/* ─── AVAILABILITY ────────────────────────── */

.avail-grid { padding: 16px 20px; }
.avail-day { margin-bottom: 20px; }
.avail-day-header {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.avail-blocks { display: flex; flex-wrap: wrap; gap: 8px; }
.avail-block {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f0f9f4;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  color: var(--green-dark);
}
.avail-block.inactive { background: var(--light); border-color: var(--border); color: var(--text-light); }

/* ─── AVAILABILITY PAGE ───────────────────── */

.hint-text { font-size: 13px; color: var(--text-light); padding: 8px 20px 16px; }

/* ─── MODAL ───────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--light);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-light);
}
.modal-close:hover { background: var(--border); }

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  margin-bottom: 20px;
  color: var(--text);
}

.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ─── PAGE TOOLBAR ────────────────────────── */

.page-toolbar { margin-bottom: 16px; }
.filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ─── CLIENT PORTAL SPECIFIC ─────────────── */

.portal-header {
  background: var(--green-dark);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.portal-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.portal-header img {
  height: 40px;
  width: auto;
  object-fit: contain;
}
.portal-nav { display: flex; align-items: center; gap: 4px; }
.portal-nav a {
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.portal-nav a:hover { color: #fff; background: rgba(255,255,255,0.1); }
.portal-nav a.active { color: #fff; background: rgba(255,255,255,0.12); }
.portal-user { display: flex; align-items: center; gap: 10px; }
.portal-user-name { color: rgba(255,255,255,0.9); font-size: 13px; }
.portal-user button {
  background: rgba(255,255,255,0.1);
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 50px;
  cursor: pointer;
}
.portal-user button:hover { background: rgba(255,255,255,0.2); }

.portal-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px;
}

.portal-page { display: none; }
.portal-page.active { display: block; }

/* ─── BOOKING CALENDAR ────────────────────── */

.booking-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  align-items: start;
}

.mini-calendar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.cal-nav h3 { font-size: 16px; font-weight: 600; }
.cal-nav button { background: none; border: none; font-size: 18px; color: var(--text-light); cursor: pointer; }
.cal-nav button:hover { color: var(--text); }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.cal-weekday { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-light); padding: 4px 0; text-transform: uppercase; }
.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.cal-day:hover:not(.disabled):not(.empty) { background: var(--accent); }
.cal-day.today { border-color: var(--green); color: var(--green); font-weight: 600; }
.cal-day.selected { background: var(--green); color: #fff; }
.cal-day.disabled { color: var(--border); cursor: not-allowed; }
.cal-day.empty { cursor: default; }
.cal-day.has-slots { background: #f0f9f4; }

.slots-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.slots-panel h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.slots-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.slot-btn {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}
.slot-btn:hover { border-color: var(--green); background: #f0f9f4; color: var(--green); }
.slot-btn.selected { background: var(--green); color: #fff; border-color: var(--green); }
.slots-empty { text-align: center; color: var(--text-light); padding: 32px 0; font-size: 14px; }

/* ─── INTAKE FORM ─────────────────────────── */

.intake-wrap {
  max-width: 680px;
  margin: 0 auto;
}
.intake-intro {
  background: var(--green-dark);
  color: rgba(255,255,255,0.9);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.intake-intro h2 { color: #fff; font-family: 'Playfair Display', serif; font-size: 22px; margin-bottom: 8px; }
.intake-intro p { font-size: 14px; }

/* ─── CALENDAR VIEW TOGGLE ────────────────── */

.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-left: auto;
}

.view-btn {
  background: var(--white);
  border: none;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.15s;
  border-right: 1px solid var(--border);
}
.view-btn:last-child { border-right: none; }
.view-btn:hover { background: var(--light); color: var(--text); }
.view-btn.active { background: var(--green); color: #fff; }

/* ─── WEEK / MONTH NAV ────────────────────── */

.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 2px;
}
.week-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* ─── WEEK VIEW ───────────────────────────── */

.week-grid {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
}

.week-time-col { background: var(--light); }

.week-day-header {
  padding: 10px 6px;
  text-align: center;
  border-bottom: 2px solid var(--border);
  border-left: 1px solid var(--border);
  background: var(--light);
}
.week-day-header.today { background: #f0f9f4; }
.week-day-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.week-day-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.week-day-header.today .week-day-num { color: var(--green); }

.week-time-header {
  padding: 10px 6px;
  border-bottom: 2px solid var(--border);
  background: var(--light);
}

.week-time-label {
  font-size: 11px;
  color: var(--text-light);
  text-align: right;
  padding: 0 6px;
  height: 50px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-top: 6px;
  border-bottom: 1px solid var(--border);
  background: var(--light);
}

.week-cell {
  min-height: 50px;
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  padding: 2px;
}
.week-cell:hover { background: #fafffe; }

.week-apt {
  background: var(--green);
  color: #fff;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 2px;
  cursor: pointer;
  line-height: 1.4;
  overflow: hidden;
}
.week-apt.pending  { background: var(--amber); }
.week-apt.cancelled { background: var(--text-light); }
.week-apt.confirmed { background: var(--green); }

/* ─── MONTH VIEW ──────────────────────────── */

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
}

.month-weekday {
  padding: 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--light);
  border-bottom: 2px solid var(--border);
  border-right: 1px solid var(--border);
}
.month-weekday:last-child { border-right: none; }

.month-cell {
  min-height: 100px;
  padding: 6px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.month-cell:nth-child(7n) { border-right: none; }
.month-cell.other-month { background: #fafafa; }
.month-cell.today { background: #f0f9f4; }

.month-day-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 4px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.month-cell.today .month-day-num { background: var(--green); color: #fff; }

.month-apt {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  font-weight: 500;
}
.month-apt.confirmed { background: #dcfce7; color: #166534; }
.month-apt.pending   { background: var(--amber-light); color: #92400e; }
.month-apt.cancelled { background: var(--red-light); color: #991b1b; }
.month-more {
  font-size: 11px;
  color: var(--text-light);
  padding: 2px 4px;
  cursor: pointer;
}
.month-more:hover { color: var(--green); }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: -240px;
    top: 0;
    bottom: 0;
    z-index: 200;
    transition: left 0.3s;
  }
  .sidebar.open { left: 0; }
  .menu-toggle { display: flex; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .booking-layout { grid-template-columns: 1fr; }
  .messages-layout { grid-template-columns: 1fr; height: auto; }
  .messages-sidebar { height: 200px; }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .form-row { grid-template-columns: 1fr; }
  .slots-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── PUBLIC BOOKING PAGE ─────────────────── */

.pub-booking-header {
  background: var(--green-dark);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.pub-booking-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.pub-booking-header img {
  height: 44px; width: 44px;
  border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(255,255,255,0.2); flex-shrink: 0;
}
.pub-booking-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 18px; color: #fff; line-height: 1.2;
}
.pub-booking-header p { font-size: 12px; color: rgba(255,255,255,0.6); }
.pub-back-link {
  margin-left: auto; color: rgba(255,255,255,0.7);
  font-size: 13px; display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.pub-back-link:hover { color: #fff; }
.pub-booking-body { max-width: 1100px; margin: 0 auto; padding: 28px 24px; }
.pub-therapist-card {
  display: flex; align-items: center; gap: 20px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
  margin-bottom: 24px; box-shadow: var(--shadow-sm);
}
.pub-therapist-img {
  width: 72px; height: 72px; border-radius: 50%;
  object-fit: cover; border: 3px solid var(--accent); flex-shrink: 0;
}
.pub-therapist-info h2 {
  font-family: 'Playfair Display', serif;
  font-size: 20px; color: var(--text); margin-bottom: 4px;
}
.pub-therapist-title { font-size: 13px; color: var(--text-light); margin-bottom: 10px; }
.pub-therapist-meta { display: flex; gap: 16px; flex-wrap: wrap; }
.pub-therapist-meta span { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-light); }
.pub-therapist-meta i { color: var(--green); font-size: 12px; }
.pub-cal-hint { font-size: 11px; color: var(--text-light); margin-top: 12px; text-align: center; }

/* ═══════════════════════════════════════════════
   MOBILE APP EXPERIENCE — COMPLETE OVERHAUL
   ═══════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* ── BODY & BASE ─────────────────────────── */
  .client-body {
    background: var(--light);
    padding-bottom: 80px; /* space for bottom nav */
  }

  /* ── PORTAL HEADER → slim on mobile ─────── */
  .portal-header {
    padding: 10px 0;
  }
  .portal-header-inner {
    padding: 0 16px;
    gap: 10px;
  }
  .portal-header img {
    height: 32px;
  }
  .portal-user-name { display: none; } /* hide name, save space */
  .portal-user button {
    font-size: 11px;
    padding: 5px 10px;
  }

  /* ── HIDE TOP NAV → replaced by bottom nav ─ */
  .portal-nav { display: none; }

  /* ── BOTTOM NAV BAR ──────────────────────── */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--green-dark);
    border-top: none;
    z-index: 500;
    padding: 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
  }
  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 4px 12px;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.6);
    font-size: 10px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    transition: color 0.15s;
    position: relative;
    text-decoration: none;
  }
  .mobile-nav-item i { font-size: 20px; }
  .mobile-nav-item span { font-size: 10px; }
  .mobile-nav-item.active { color: #fff; }
  .mobile-nav-item.active i { color: #fff; }
  .mobile-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0; left: 20%; right: 20%;
    height: 2px;
    background: var(--accent);
    border-radius: 0 0 4px 4px;
  }
  .mobile-nav-badge {
    position: absolute;
    top: 6px;
    right: calc(50% - 18px);
    background: var(--amber);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* ── PORTAL MAIN PADDING ─────────────────── */
  .portal-main {
    padding: 16px;
  }

  /* ── HOME PAGE CARDS ─────────────────────── */
  .portal-page h1 {
    font-size: 22px !important;
    margin-bottom: 4px !important;
  }
  .portal-page > div > p {
    font-size: 13px;
    margin-bottom: 16px !important;
  }

  /* Quick action cards — 1 column stacked */
  .portal-page > div > div[style*="grid-template-columns:1fr 1fr 1fr"] {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
  }

  /* ── SESSION CARDS ───────────────────────── */
  .card {
    border-radius: var(--radius) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
  }

  /* Session apt card row */
  .card > div[style*="display:flex;align-items:center;justify-content:space-between"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  /* ── BOOKING CALENDAR ────────────────────── */
  .booking-layout {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }
  .mini-calendar { padding: 16px; }
  .cal-day { font-size: 14px; min-height: 40px; }
  .slots-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }
  .slot-btn { padding: 14px 8px; font-size: 15px; }

  /* ── MY SESSIONS PAGE ────────────────────── */
  .portal-page h2 {
    font-size: 20px !important;
    margin-bottom: 14px !important;
  }

  /* Session card layout on mobile */
  .card[style*="padding:20px;margin-bottom:12px"] {
    padding: 16px !important;
  }

  /* ── MESSAGES ────────────────────────────── */
  .card[style*="height:500px"] {
    height: calc(100vh - 220px) !important;
  }
  .messages-compose textarea { height: 48px; font-size: 16px; }

  /* ── PUBLIC BOOKING PAGE ─────────────────── */
  .pub-booking-body { padding: 16px; }
  .pub-therapist-card {
    flex-direction: column;
    text-align: center;
    padding: 16px;
    gap: 12px;
  }
  .pub-therapist-meta { justify-content: center; }
  .pub-therapist-img { width: 80px; height: 80px; }

  .pub-booking-header-inner {
    flex-wrap: wrap;
    gap: 8px;
  }
  .pub-back-link { font-size: 12px; }

  /* ── AUTH / LOGIN CARD ───────────────────── */
  .login-screen { padding: 16px; align-items: flex-start; padding-top: 40px; }
  .login-card { padding: 28px 20px; border-radius: 20px; }

  /* ── INTAKE FORM ─────────────────────────── */
  .intake-wrap { padding: 0; }
  .intake-intro { border-radius: var(--radius); padding: 20px; }
  .intake-intro h2 { font-size: 20px; }

  /* ── FORMS ───────────────────────────────── */
  .form-row { grid-template-columns: 1fr !important; }
  input, select, textarea {
    font-size: 16px !important; /* prevents iOS zoom on focus */
  }

  /* ── STATUS BADGES bigger on mobile ─────── */
  .status-badge { font-size: 12px; padding: 4px 12px; }

  /* ── BUTTONS bigger touch targets ───────── */
  .btn-primary { padding: 14px 24px; font-size: 15px; }
  .btn-sm { padding: 10px 16px; font-size: 13px; }

  /* ── BOOKING SUCCESS MODAL ───────────────── */
  #booking-success > div {
    border-radius: 20px;
    padding: 28px 20px;
  }
}

/* Hide bottom nav on desktop */
@media (min-width: 769px) {
  .mobile-bottom-nav { display: none; }
}