/* ═══════════════════════════════════════════
   СТОМАТОЛОГИЯ — бело-синяя тема
   ═══════════════════════════════════════════ */

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

:root {
  --blue-50:  #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-300: #93c5fd;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --blue-900: #1e3a8a;
  --sky-500:  #0ea5e9;
  --white:    #ffffff;
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-900: #0f172a;
  --red:      #dc2626;
  --amber:    #f59e0b;
}

html, body { height: 100%; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--gray-900);
  background: linear-gradient(180deg, #f0f6ff 0%, #ffffff 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.55;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-600); text-decoration: none; transition: color .18s; }
a:hover { color: var(--blue-800); text-decoration: underline; }

/* ═══ ВЕРХНЯЯ ПАНЕЛЬ ═══ */
.topbar {
  background: var(--white);
  border-bottom: 3px solid var(--blue-600);
  box-shadow: 0 2px 12px rgba(37,99,235,.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 36px;
  flex-wrap: wrap;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar > div:first-child {
  font-size: 20px;
  font-weight: 800;
  color: var(--blue-700);
  letter-spacing: .3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar nav {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.topbar nav a {
  color: var(--gray-700);
  padding: 9px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  border: 2px solid transparent;
  transition: all .2s;
  text-decoration: none;
}

.topbar nav a:hover {
  background: var(--blue-50);
  color: var(--blue-700);
  border-color: var(--blue-200);
  text-decoration: none;
}

.topbar nav a.active {
  background: var(--blue-600);
  color: var(--white);
  border-color: var(--blue-600);
  box-shadow: 0 4px 12px rgba(37,99,235,.3);
}

.topbar .user {
  color: var(--blue-700);
  font-size: 13px;
  padding: 7px 14px;
  background: var(--blue-50);
  border: 2px solid var(--blue-100);
  border-radius: 8px;
  font-weight: 600;
}

.logout {
  background: var(--white) !important;
  color: var(--red) !important;
  border: 2px solid #fecaca !important;
}
.logout:hover {
  background: #fee2e2 !important;
  border-color: var(--red) !important;
  color: var(--red) !important;
}

/* ═══ ОСНОВНОЙ КОНТЕНТ ═══ */
main {
  padding: 36px;
  max-width: 1500px;
  margin: 0 auto;
  animation: fadeIn .3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

main h2 {
  font-size: 26px;
  margin-bottom: 24px;
  color: var(--blue-800);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 5px solid var(--blue-600);
  padding-left: 14px;
}

/* ═══ НАВИГАЦИЯ ПО НЕДЕЛЯМ ═══ */
.weeknav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  background: var(--white);
  padding: 16px 20px;
  border-radius: 14px;
  border: 2px solid var(--blue-100);
  box-shadow: 0 4px 16px rgba(37,99,235,.06);
}

.weeknav h2 {
  font-size: 18px;
  margin: 0;
  color: var(--blue-800);
  padding: 0;
  border: none;
  font-weight: 700;
  letter-spacing: .2px;
}

.btn {
  padding: 10px 20px;
  background: var(--blue-600);
  color: var(--white);
  border-radius: 10px;
  border: 2px solid var(--blue-600);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all .2s;
  box-shadow: 0 3px 10px rgba(37,99,235,.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-family: inherit;
}

.btn:hover {
  background: var(--blue-700);
  border-color: var(--blue-700);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37,99,235,.4);
  color: var(--white);
  text-decoration: none;
}

.btn:active { transform: translateY(0); }

/* ═══ ТАБЛИЦА РАСПИСАНИЯ ═══ */
.tablewrap {
  overflow: auto;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(37,99,235,.1);
  border: 2px solid var(--blue-100);
}

table.schedule {
  width: 100%;
  border-collapse: collapse;
  min-width: 950px;
}

table.schedule th,
table.schedule td {
  border-bottom: 1px solid var(--blue-100);
  border-right: 1px solid var(--blue-100);
  padding: 8px;
  text-align: center;
}

table.schedule th:last-child,
table.schedule td:last-child { border-right: none; }

table.schedule thead th {
  background: linear-gradient(180deg, var(--blue-50), var(--blue-100));
  font-weight: 700;
  font-size: 13px;
  color: var(--blue-800);
  padding: 14px 6px;
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 2px solid var(--blue-300);
  text-transform: uppercase;
  letter-spacing: .4px;
}

table.schedule th.today {
  background: linear-gradient(180deg, var(--blue-500), var(--blue-600));
  color: var(--white);
  box-shadow: inset 0 -4px 0 var(--blue-800);
}
table.schedule th.today small { color: var(--blue-100); }

table.schedule th small {
  font-size: 11px;
  opacity: .7;
  font-weight: 500;
  display: block;
  margin-top: 2px;
}

td.time {
  background: var(--blue-50);
  font-weight: 700;
  font-size: 13px;
  width: 78px;
  color: var(--blue-800);
  border-right: 2px solid var(--blue-200) !important;
}

td.slot {
  cursor: pointer;
  height: 58px;
  font-size: 12px;
  vertical-align: middle;
  transition: all .18s;
  position: relative;
}

td.slot.free { background: var(--white); }

td.slot.free:hover {
  background: var(--blue-50);
  box-shadow: inset 0 0 0 2px var(--blue-400);
}

td.slot.free .plus {
  color: var(--blue-400);
  font-size: 24px;
  font-weight: 300;
  opacity: .25;
  transition: all .2s;
  display: inline-block;
  line-height: 1;
}

td.slot.free:hover .plus {
  opacity: 1;
  color: var(--blue-600);
  transform: scale(1.3);
}

td.slot.busy {
  background: linear-gradient(135deg, var(--blue-500) 0%, var(--blue-600) 100%);
  color: var(--white);
  box-shadow: inset 0 0 0 1px var(--blue-700);
}

td.slot.busy:hover {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
}

td.slot.busy .pname {
  font-weight: 700;
  display: block;
  color: var(--white);
  font-size: 12px;
  margin-bottom: 2px;
  line-height: 1.2;
}

td.slot.busy small {
  color: var(--blue-100);
  font-size: 10px;
  display: block;
  line-height: 1.2;
}

/* ═══ МОДАЛЬНОЕ ОКНО ═══ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  z-index: 50;
  display: none;
}
.modal:not([hidden]) { display: flex; animation: fadeIn .2s; }

.modal-box {
  background: var(--white);
  padding: 32px;
  border-radius: 16px;
  max-width: 520px;
  width: 92%;
  position: relative;
  box-shadow: 0 24px 60px rgba(15,23,42,.3);
  border-top: 5px solid var(--blue-600);
  animation: popIn .25s cubic-bezier(.2,.9,.3,1.15);
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(.94) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-box h3 {
  font-size: 20px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--blue-100);
  color: var(--blue-800);
  font-weight: 700;
}

.modal-box p {
  margin: 8px 0;
  font-size: 14px;
  color: var(--gray-700);
  padding: 8px 0;
  border-bottom: 1px dashed var(--blue-100);
}
.modal-box p b { color: var(--blue-700); font-weight: 700; }
.modal-box p:last-of-type { border-bottom: none; }

.modal-box input,
.modal-box textarea,
.modal-box select {
  width: 100%;
  padding: 12px 14px;
  margin: 6px 0;
  border: 2px solid var(--blue-100);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  background: var(--gray-50);
  transition: all .18s;
  color: var(--gray-900);
  font-family: inherit;
}

.modal-box input:focus,
.modal-box textarea:focus,
.modal-box select:focus {
  outline: none;
  border-color: var(--blue-500);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(59,130,246,.15);
}

.modal-box textarea { min-height: 90px; resize: vertical; }

.modal-box button {
  margin-top: 16px;
  padding: 12px 22px;
  background: var(--blue-600);
  color: var(--white);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  transition: all .2s;
  box-shadow: 0 3px 10px rgba(37,99,235,.25);
  font-family: inherit;
}

.modal-box button:hover {
  background: var(--blue-700);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37,99,235,.4);
}

.modal-box button.danger,
button.danger {
  background: var(--red);
  box-shadow: 0 3px 10px rgba(220,38,38,.25);
}
.modal-box button.danger:hover,
button.danger:hover {
  background: #b91c1c;
  box-shadow: 0 6px 18px rgba(220,38,38,.4);
}

.modal-box optgroup {
  font-weight: 700;
  color: var(--blue-700);
  font-size: 13px;
  background: var(--blue-50);
}
.modal-box optgroup option {
  font-weight: 500;
  color: var(--gray-900);
  background: var(--white);
  padding: 6px;
}

.close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--blue-50);
  border: 2px solid var(--blue-100);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 22px;
  color: var(--blue-700);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  line-height: 1;
  font-weight: 300;
  padding: 0;
}
.close:hover {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
  transform: rotate(90deg);
}

/* ═══ СТРАНИЦЫ АВТОРИЗАЦИИ ═══ */
body.auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  padding: 20px;
}

.card {
  background: var(--white);
  padding: 44px 38px;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(37,99,235,.18);
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  border: 2px solid var(--blue-100);
  position: relative;
  overflow: hidden;
  animation: popIn .35s cubic-bezier(.2,.9,.3,1.15);
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--blue-400), var(--blue-600), var(--sky-500));
}

.card h1 {
  text-align: center;
  margin-bottom: 26px;
  font-size: 28px;
  color: var(--blue-700);
  font-weight: 800;
  letter-spacing: -.3px;
}

.card input {
  padding: 14px 16px;
  margin: 7px 0;
  border: 2px solid var(--blue-100);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  transition: all .18s;
  background: var(--gray-50);
  font-family: inherit;
  color: var(--gray-900);
}

.card input:focus {
  outline: none;
  border-color: var(--blue-500);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(59,130,246,.15);
}

.card button {
  margin-top: 20px;
  padding: 14px;
  background: var(--blue-600);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font: inherit;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .3px;
  transition: all .22s;
  box-shadow: 0 6px 20px rgba(37,99,235,.35);
  font-family: inherit;
}

.card button:hover {
  background: var(--blue-700);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(37,99,235,.5);
}

.card button:active { transform: translateY(0); }

.muted {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--gray-500);
}
.muted a { font-weight: 600; color: var(--blue-600); }

.err {
  color: #991b1b;
  text-align: center;
  padding: 11px 14px;
  background: #fee2e2;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 14px;
  border-left: 4px solid var(--red);
  font-weight: 500;
}

.ok {
  color: #064e3b;
  text-align: center;
  padding: 11px 14px;
  background: #d1fae5;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 14px;
  border-left: 4px solid #10b981;
  font-weight: 500;
}

/* ═══ ЗАМЕТКИ ═══ */
.noteform {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  background: var(--white);
  padding: 18px;
  border-radius: 14px;
  border: 2px solid var(--blue-100);
  box-shadow: 0 4px 16px rgba(37,99,235,.06);
}

.noteform textarea {
  flex: 1;
  padding: 14px;
  border: 2px solid var(--blue-100);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  min-height: 70px;
  resize: vertical;
  transition: all .18s;
  background: var(--gray-50);
  font-family: inherit;
  color: var(--gray-900);
}

.noteform textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(59,130,246,.15);
}

.noteform button {
  padding: 0 28px;
  background: var(--blue-600);
  color: var(--white);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  transition: all .2s;
  box-shadow: 0 3px 10px rgba(37,99,235,.25);
  font-family: inherit;
}

.noteform button:hover {
  background: var(--blue-700);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37,99,235,.4);
}

.note {
  background: var(--white);
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 12px;
  border: 2px solid var(--blue-100);
  border-left: 5px solid var(--blue-500);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  transition: all .22s;
  animation: fadeIn .3s;
  box-shadow: 0 2px 8px rgba(37,99,235,.05);
}

.note:hover {
  transform: translateX(4px);
  border-left-color: var(--blue-700);
  box-shadow: 0 6px 20px rgba(37,99,235,.15);
}

.note .ntext {
  flex: 1;
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-700);
  word-break: break-word;
}

.nmeta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  font-size: 12px;
  color: var(--gray-500);
  white-space: nowrap;
  font-weight: 500;
}

.nmeta button {
  background: var(--blue-50);
  border: 2px solid var(--blue-100);
  cursor: pointer;
  font-size: 16px;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all .2s;
  line-height: 1;
  color: var(--blue-600);
}
.nmeta button:hover {
  background: #fee2e2;
  border-color: #fecaca;
  color: var(--red);
  transform: scale(1.08);
}

/* ═══ ТАБЛИЦА ПОЛЬЗОВАТЕЛЕЙ ═══ */
.usertable {
  width: 100%;
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  border-collapse: collapse;
  box-shadow: 0 8px 32px rgba(37,99,235,.1);
  border: 2px solid var(--blue-100);
}

.usertable th,
.usertable td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--blue-100);
  text-align: left;
  font-size: 14px;
}

.usertable thead th {
  background: linear-gradient(180deg, var(--blue-50), var(--blue-100));
  font-weight: 700;
  color: var(--blue-800);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .6px;
  border-bottom: 2px solid var(--blue-300);
}

.usertable tbody tr { transition: background .15s; }
.usertable tbody tr:hover { background: var(--blue-50); }
.usertable tbody tr:last-child td { border-bottom: none; }

.usertable button {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: var(--blue-600);
  color: var(--white);
  cursor: pointer;
  margin-right: 4px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(37,99,235,.2);
  font-family: inherit;
}

.usertable button:hover {
  background: var(--blue-700);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37,99,235,.35);
}

.usertable button.danger {
  background: var(--red);
  box-shadow: 0 2px 8px rgba(220,38,38,.2);
}
.usertable button.danger:hover {
  background: #b91c1c;
  box-shadow: 0 4px 14px rgba(220,38,38,.35);
}

/* ═══ АДАПТИВ ═══ */
@media (max-width: 768px) {
  .topbar { padding: 12px 16px; }
  .topbar > div:first-child { font-size: 17px; }
  .topbar nav a { padding: 7px 12px; font-size: 13px; }
  main { padding: 18px; }
  main h2 { font-size: 20px; }
  .weeknav { padding: 12px; }
  .weeknav h2 { font-size: 15px; }
  .btn { padding: 8px 14px; font-size: 13px; }
  .card { padding: 30px 24px; }
  .card h1 { font-size: 24px; }
  .modal-box { padding: 24px; }
  .noteform { flex-direction: column; }
  .noteform button { padding: 12px; }
  .usertable th, .usertable td { padding: 10px 12px; font-size: 13px; }
}

/* ═══ СКРОЛЛБАР ═══ */
.tablewrap::-webkit-scrollbar { height: 10px; width: 10px; }
.tablewrap::-webkit-scrollbar-track { background: var(--blue-50); }
.tablewrap::-webkit-scrollbar-thumb {
  background: var(--blue-400);
  border-radius: 10px;
}
.tablewrap::-webkit-scrollbar-thumb:hover { background: var(--blue-600); }

/* ═══ ПЕЧАТЬ ═══ */
@media print {
  .topbar, .weeknav, .modal { display: none !important; }
  body { background: #fff; }
  .tablewrap { box-shadow: none; border: 1px solid #ccc; }
}
/* ═══════════════════════════════════════
   ПАНЕЛЬ УПРАВЛЕНИЯ (НЕДЕЛЯ + ПОИСК)
   ═══════════════════════════════════════ */
.controlbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  background: #fff;
  padding: 12px 16px;
  border-radius: 14px;
  border: 2px solid #dbeafe;
  box-shadow: 0 4px 16px rgba(37,99,235,.06);
  flex-wrap: wrap;
}

.weeknav-compact {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-arrow {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2563eb;
  color: #fff !important;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(37,99,235,.2);
}

.btn-arrow:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  color: #fff !important;
}

.week-label {
  font-size: 15px;
  font-weight: 700;
  color: #1e40af;
  padding: 0 12px;
  white-space: nowrap;
}

.btn-today {
  padding: 8px 14px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 2px solid #bfdbfe;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s;
}

.btn-today:hover {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  text-decoration: none;
}

.search-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: 1;
  max-width: 420px;
  min-width: 260px;
}

.search-field {
  flex: 1;
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 2px solid #dbeafe;
  border-radius: 10px;
  padding: 0 4px 0 12px;
  transition: all .2s;
  height: 38px;
}

.search-field:focus-within {
  border-color: #3b82f6;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(59,130,246,.12);
}

.search-icon {
  font-size: 14px;
  color: #94a3b8;
  margin-right: 6px;
}

.search-field input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  padding: 8px 0;
  color: #0f172a;
  font-family: inherit;
}

.search-field input::placeholder {
  color: #94a3b8;
}

.search-clear {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #94a3b8;
  border-radius: 6px;
  font-size: 18px;
  text-decoration: none;
  transition: all .2s;
  line-height: 1;
}

.search-clear:hover {
  background: #fee2e2;
  color: #dc2626;
}

.btn-search {
  padding: 0 18px;
  height: 38px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
  white-space: nowrap;
}

.btn-search:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

/* ═══ РЕЗУЛЬТАТЫ ПОИСКА ═══ */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #eff6ff, #fff);
  border: 2px solid #dbeafe;
  border-radius: 14px;
  flex-wrap: wrap;
  gap: 12px;
}

.results-header > div {
  font-size: 15px;
  color: #334155;
}

.results-count {
  font-size: 22px;
  font-weight: 800;
  color: #1d4ed8;
  margin-right: 4px;
}

.results-query {
  color: #1d4ed8;
  font-weight: 600;
}

.btn-back {
  padding: 8px 16px;
  background: #fff;
  color: #1d4ed8;
  border: 2px solid #bfdbfe;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s;
  white-space: nowrap;
}

.btn-back:hover {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  text-decoration: none;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.result-card {
  display: flex;
  align-items: stretch;
  gap: 14px;
  background: #fff;
  border: 2px solid #dbeafe;
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(37,99,235,.05);
}

.result-card:hover {
  transform: translateY(-3px);
  border-color: #60a5fa;
  box-shadow: 0 8px 24px rgba(37,99,235,.15);
}

.rc-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  color: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  min-width: 62px;
}

.rc-day { font-size: 24px; font-weight: 800; line-height: 1; }
.rc-month { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; opacity: .9; margin-top: 3px; }
.rc-weekday {
  font-size: 11px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,.25);
  width: 100%;
  text-align: center;
  font-weight: 600;
}

.rc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rc-name {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rc-meta { display: flex; gap: 12px; font-size: 12px; color: #64748b; flex-wrap: wrap; }
.rc-time, .rc-phone { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.rc-service {
  font-size: 13px;
  color: #1d4ed8;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rc-notes {
  font-size: 12px;
  color: #64748b;
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rc-arrow {
  display: flex;
  align-items: center;
  font-size: 20px;
  color: #60a5fa;
  padding-left: 4px;
  transition: all .2s;
}
.result-card:hover .rc-arrow {
  color: #1d4ed8;
  transform: translateX(4px);
}

.empty-results {
  background: linear-gradient(135deg, #eff6ff, #fff);
  border: 2px dashed #bfdbfe;
  border-radius: 16px;
  padding: 48px 24px;
  text-align: center;
}
.empty-icon { font-size: 56px; opacity: .5; margin-bottom: 12px; }
.empty-title { font-size: 20px; font-weight: 700; color: #1e40af; margin-bottom: 8px; }
.empty-hint { font-size: 14px; color: #64748b; max-width: 420px; margin: 0 auto; }

@media (max-width: 900px) {
  .controlbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .weeknav-compact { justify-content: center; flex-wrap: wrap; }
  .search-inline { margin-left: 0; max-width: none; width: 100%; }
  .results-grid { grid-template-columns: 1fr; }
  .week-label { padding: 0 6px; font-size: 14px; }
}

