/* clients.css */

/* ─── Hide the old magnifying-glass icon ───────────────────────── */
#search-clients-button {
  display: none;
}

/* ─── Full-page “All Clients” overlay ─────────────────────────── */
#clients-page {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: #fff;
  z-index: 10000;
  display: flex;
  flex-direction: column;
}
#clients-page.hidden {
  display: none !important;
}

/* ─── Clients Page Header & Search ─────────────────────────────────── */

/* 1) Make header a column so title and search stack */
.client-page-header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #ccc;
  background: #f9f9f9;
}

/* 2) Back button pinned left */
.client-page-header .close-button {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

/* 3) Add-Client actions pinned right */
.client-page-header .client-page-actions {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 0.5rem;
}

/* 4) Title centered */
.client-page-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: bold;
}

/* 5) Search box flows below title */
#search-clients-input {
  margin-top: 0.5rem;
  width: 60%;
  max-width: 300px;
  padding: 6px 10px;
  font-size: 0.9rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

/* ─── Live, “rolling” search box under the title ──────────────── */
#search-clients-input {
  width: 60%;
  max-width: 300px;
  padding: 6px 10px;
  font-size: 0.9rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  margin-top: 0.5rem;
}

/* ─── Stats widgets (Total / Week / Month / Year) ───────────── */
.clients-dashboard {
  display: flex;
  gap: 1rem;
  padding: 1rem;
}
.clients-dashboard .widget {
  flex: 1;
  min-width: 100px;    /* was 140px */
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  text-align: center;
}

/* ─── Clients table ──────────────────────────────────────────── */
#clients-list {
  margin-top: 1rem;
  flex: 1;
  overflow: auto;   /* allow scroll if too many rows */
}
#clients-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
#clients-table th,
#clients-table td {
  padding: 0.75rem;
  border: 1px solid #ddd;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#clients-table .col-name   { width: 10%; }
#clients-table .col-dob    { width:  8%; }
#clients-table .col-phone  { width: 10%; }
#clients-table .col-notes  { width: 62%; }
#clients-table .col-action { width: 10%; text-align: right; }

/* ─── “View Profile” button ─────────────────────────────────── */
.view-profile-btn {
  padding: 0.25rem 0.5rem;
  border: none;
  background: #007bff;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}
.view-profile-btn:hover {
  background: #0056b3;
}

/* ─── Pagination (Prev / Page Info / Next) ───────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.pagination button {
  padding: 6px 12px;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}
.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
#page-info {
  font-size: 0.9rem;
  color: #444;
}

/* ─── A–Z filter row ───────────────────────────────────────── */
#alpha-filter {
  display: flex;
  flex-wrap: nowrap;       /* keep all on one line */
  justify-content: center;
  gap: 6px;
  padding: 8px 0;
  width: 100%;
  overflow-x: auto;        /* horizontal scroll if needed */
  box-sizing: border-box;
}
#alpha-filter::-webkit-scrollbar { display: none; }
#alpha-filter { -ms-overflow-style: none; scrollbar-width: none; }
#alpha-filter .alpha-button {
  flex: 0 0 auto;
  padding: 4px 8px;
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
}
#alpha-filter .alpha-button.active,
#alpha-filter .alpha-button:hover {
  background: #007bff;
  color: #fff;
  border-color: #007bff;
}

/* ─── Add Client modal ─────────────────────────────────────── */
#add-client-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 13000;
}
}
#add-client-modal.hidden {
  display: none !important;
}
#add-client-modal .modal-content {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  width: 600px;
  max-width: 90%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  position: relative;
}
#add-client-modal .modal-content h2 {
  margin-top: 0;
  text-align: center;
}
#add-client-modal .modal-content .close-button {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
}
#add-client-modal .modal-content form .modal-cols {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
}
#add-client-modal .modal-content form .modal-cols .col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
#add-client-modal .modal-content form .link-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.5rem;
}
#add-client-modal .modal-content form .link-section label,
#add-client-modal .modal-content form .link-section input {
  width: 50%;
  max-width: 300px;
}
#add-client-modal .modal-content label {
  display: block;
  margin: 0.5rem 0 0.25rem;
  font-weight: 600;
}
#add-client-modal .modal-content input,
#add-client-modal .modal-content textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}
#add-client-modal .modal-content .button-group {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}
#add-client-modal .modal-content button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
#add-client-modal .modal-content #cancel-add-client {
  background: #ccc;
}
/* -----------------------------------------------
   stick pagination & alphabet filter to bottom
   ----------------------------------------------- */
#clients-page {
  position: relative; /* ensure absolute children anchor here */
}

/* pagination bar */
#clients-page .pagination {
  position: absolute;
  bottom: 2.5rem;    /* adjust if your alpha‐filter height/gap changes */
  left: 0;
  width: 100%;
  justify-content: center;
  background: white;
  z-index: 10;
}

/* A–Z filter row */
#clients-page #alpha-filter {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  justify-content: center;
  background: white;
  z-index: 10;
}
.all-clients-notes-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 350px;   /* match to your column width */
  min-width: 80px;
  font-size: 14px;
  line-height: 1.3;
  display: table-cell;
  vertical-align: middle;
}


/* All Clients notes preview: single line with ellipsis */
#clients-table td.col-notes {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
