/* =========================================================
   Дела сердечные — Личный кабинет пациента
   Префикс: cab-
   ========================================================= */
.cab { background: var(--bg-soft); padding: 52px 0 96px; min-height: 70vh; }
.cab-shell {
  display: grid; grid-template-columns: 268px minmax(0, 1fr);
  gap: 26px; align-items: start;
}
.cab-shell--widget {
  display: block;
}
.cab-widget-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  margin: 0 auto;
  max-width: 1040px;
  padding: 30px;
}
.cab-widget-card h1 {
  color: var(--text);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.12;
  margin: 0 0 10px;
}
.cab-widget-note {
  background: var(--violet-soft);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 15px;
  margin: 0 0 22px;
  padding: 14px 16px;
}
.cab-widget-host {
  min-height: 0;
}
.cab-widget-card > .rnova-widget {
  color: var(--text);
}
.cab-widget-card > .rnova-widget .v-application {
  background: transparent !important;
  color: var(--text) !important;
  font-family: var(--ff) !important;
}
.cab-widget-card > .rnova-widget .v-application--wrap,
.cab-widget-card > .rnova-widget .v-main,
.cab-widget-card > .rnova-widget .v-main__wrap {
  min-height: 0 !important;
}
.cab-widget-card > .rnova-widget .auth-form.fill-height {
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
}
.cab-widget-card > .rnova-widget .auth-form > .row {
  align-items: flex-start !important;
  margin: 0 !important;
  width: 100%;
}
.cab-widget-card > .rnova-widget .auth-form > .row > [class*="col-"] {
  flex: 0 1 460px !important;
  max-width: 460px !important;
  padding: 0 !important;
}
.cab-widget-card > .rnova-widget .auth-form .v-card {
  border: 1px solid var(--border) !important;
  border-radius: var(--r-xl) !important;
  box-shadow: var(--shadow-soft) !important;
  overflow: hidden;
}
.cab-widget-card > .rnova-widget .v-application .accent {
  background-color: var(--violet) !important;
  border-color: var(--violet) !important;
}
.cab-widget-card > .rnova-widget .v-application .accent--text {
  color: var(--violet) !important;
  caret-color: var(--violet) !important;
}
.cab-widget-card > .rnova-widget .auth-form .v-toolbar__title {
  font-family: var(--ff);
  font-size: 20px;
  font-weight: 700;
}
.cab-widget-card > .rnova-widget .auth-form .v-card__text {
  padding: 24px 24px 10px;
}
.cab-widget-card > .rnova-widget .auth-form .v-label,
.cab-widget-card > .rnova-widget .auth-form input,
.cab-widget-card > .rnova-widget .auth-form .v-card__text > form > span {
  font-family: var(--ff);
}
.cab-widget-card > .rnova-widget .auth-form .v-card__text > form > span {
  color: var(--text-muted);
  display: block;
  font-size: 13px;
  line-height: 1.5;
}
.cab-widget-card > .rnova-widget .auth-form .v-card__actions {
  display: block;
  padding: 6px 24px 24px;
}
.cab-widget-card > .rnova-widget .auth-form .v-card__actions .spacer {
  display: none;
}
.cab-widget-card > .rnova-widget .auth-form .v-card__actions .v-btn {
  border-radius: var(--r-md);
  box-shadow: none;
  font-family: var(--ff);
  font-size: 15px;
  font-weight: 700;
  height: 48px;
  letter-spacing: 0;
  margin: 0;
  text-transform: none;
  width: 100%;
}
@media (max-width: 720px) {
  .cab-widget-card > .rnova-widget,
  .cab-widget-card > .rnova-widget .v-application,
  .cab-widget-card > .rnova-widget .v-application--wrap,
  .cab-widget-card > .rnova-widget .v-main,
  .cab-widget-card > .rnova-widget .v-main__wrap,
  .cab-widget-card > .rnova-widget .auth-form,
  .cab-widget-card > .rnova-widget .auth-form > .row {
    max-width: 100% !important;
    min-width: 0 !important;
    width: 100% !important;
  }
  .cab-widget-card > .rnova-widget .auth-form > .row > [class*="col-"] {
    flex: 1 1 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    width: 100% !important;
  }
  .cab-widget-card > .rnova-widget .auth-form .v-card {
    max-width: 100% !important;
    width: 100% !important;
  }
  .cab-widget-card > .rnova-widget .auth-form .v-card__text {
    padding: 20px 18px 8px;
  }
  .cab-widget-card > .rnova-widget .auth-form .v-card__actions {
    padding: 6px 18px 20px;
  }
}

/* ---------- Sidebar ---------- */
.cab-side {
  position: sticky; top: 108px;
  background: #fff; border-radius: var(--r-lg);
  box-shadow: var(--shadow-card); padding: 12px;
}
.cab-side-user {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 14px; margin-bottom: 6px;
}
.cab-side-ava {
  width: 46px; height: 46px; border-radius: 50%; flex: 0 0 auto;
  background: var(--violet); color: #fff; display: grid; place-items: center;
  font-size: 17px; font-weight: 800;
}
.cab-side-meta { min-width: 0; }
.cab-side-name { font-size: 15.5px; font-weight: 800; color: var(--text); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cab-side-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 1px; }
.cab-side-sep { height: 1px; background: var(--border); margin: 4px 6px 8px; }

.cab-nav { display: flex; flex-direction: column; gap: 2px; }
.cab-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--r-md);
  color: var(--text); font-size: 14.5px; font-weight: 600; cursor: pointer;
  border: 0; background: transparent; width: 100%; text-align: left;
  transition: background .15s ease, color .15s ease;
}
.cab-nav-item svg { width: 20px; height: 20px; color: var(--text-light); flex: 0 0 auto; transition: color .15s ease; }
.cab-nav-item span { flex: 1 1 auto; }
.cab-nav-item .cab-nav-badge { flex: 0 0 auto; }
.cab-nav-item:hover { background: var(--bg-soft); }
.cab-nav-item.is-active { background: var(--violet-soft); color: var(--violet); }
.cab-nav-item.is-active svg { color: var(--violet); }
.cab-nav-badge {
  flex: 0 0 auto; width: 21px; height: 21px; padding: 0;
  border-radius: 50%; background: var(--coral); color: #fff;
  font-size: 11px; font-weight: 600; display: grid; place-items: center;
}
.cab-nav-item.is-active .cab-nav-badge { background: var(--violet); }

/* мобильный выпадающий выбор раздела (в общем стиле .custom-select) */
.cab-nav-select { display: none; }
.cab-nav-select .custom-select-trigger {
  width: 100%;
  background: #fff;
  border-color: var(--border);
  box-shadow: var(--shadow-soft);
  font-weight: 600;
}
.cab-nav-select .custom-select-option { display: flex; align-items: center; gap: 10px; }
.cab-nav-select .custom-select-trigger { gap: 10px; }
.cab-nav-select .custom-select-trigger > svg,
.cab-nav-select .custom-select-option > svg { width: 18px; height: 18px; flex: 0 0 auto; }
.cab-nav-select .cab-nav-opt-label { flex: 1 1 auto; }
.cab-nav-badge--inline { position: static; width: 20px; height: 20px; margin-left: auto; }

/* ---------- Content host ---------- */
.cab-content { min-width: 0; }
.cab-sec { display: none; }
.cab-sec.is-active { display: block; }
@keyframes cabFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* section heading */
.cab-h {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; margin-bottom: 20px; flex-wrap: wrap;
}
.cab-h-tt { min-width: 0; }
.cab-h h1 { font-size: 30px; font-weight: 700; letter-spacing: -.02em; color: var(--text); margin: 0 0 6px; line-height: 1.12; }
.cab-h p { font-size: 15px; color: var(--text-muted); margin: 0; max-width: 560px; text-wrap: pretty; }
.cab-h .btn { height: 52px; }

.cab-sec-title { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -.01em; margin: 30px 0 14px; display: flex; align-items: center; gap: 10px; }
.cab-sec-title:first-child { margin-top: 0; }
.cab-sec-title .cab-count { font-size: 13px; font-weight: 700; color: var(--text-light); }
.cab-sec-title .cab-see { margin-left: auto; font-size: 13.5px; font-weight: 700; color: var(--violet); cursor: pointer; }
.cab-sec-title .cab-see:hover { text-decoration: underline; }

/* ---------- Card primitives ---------- */
.cab-card {
  background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  padding: 22px; border: 1px solid var(--border);
}
.cab-grid { display: grid; gap: 16px; }
.cab-grid.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.cab-grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }

/* dashboard quick tiles */
.cab-tiles { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-top: 6px; }
.cab-tile {
  display: flex; flex-direction: column; gap: 12px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-card); padding: 18px; cursor: pointer; text-align: left;
  transition: transform .18s ease, box-shadow .2s ease;
}
.cab-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.cab-tile-ico { width: 42px; height: 42px; border-radius: 12px; background: var(--violet-soft); color: var(--violet); display: grid; place-items: center; }
.cab-tile-ico svg { width: 22px; height: 22px; }
.cab-tile-tt { font-size: 15px; font-weight: 700; color: var(--text); }
.cab-tile-sub { font-size: 12.5px; color: var(--text-muted); margin-top: -6px; }
.cab-tile-badge { align-self: flex-start; font-size: 11px; font-weight: 800; color: #fff; background: var(--coral); padding: 3px 10px; border-radius: 999px; }
.cab-tile .cab-nav-badge { align-self: flex-start; }

/* hero appointment card */
.appt {
  display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center;
}
.appt-date {
  flex: 0 0 auto; width: 86px; text-align: center;
  background: var(--violet); color: #fff; border-radius: var(--r-md); padding: 14px 8px;
}
.appt-date .d { font-size: 30px; font-weight: 800; line-height: 1; }
.appt-date .m { font-size: 12.5px; font-weight: 700; margin-top: 4px; text-transform: uppercase; letter-spacing: .04em; opacity: .9; }
.appt-date .t { font-size: 13.5px; font-weight: 800; margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.25); }
.appt-info { min-width: 0; }
.appt-spec { font-size: 13px; font-weight: 700; color: var(--violet); text-transform: uppercase; letter-spacing: .03em; }
.appt-doc { font-size: 19px; font-weight: 800; color: var(--text); letter-spacing: -.01em; margin: 3px 0 8px; }
.appt-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--text-muted); }
.appt-meta span { display: inline-flex; align-items: center; gap: 7px; }
.appt-meta svg { width: 16px; height: 16px; color: var(--text-light); }
.appt-actions { display: flex; flex-direction: column; gap: 8px; flex: 0 0 auto; }
@media (max-width: 720px) { .appt { grid-template-columns: auto 1fr; } .appt-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; } }

.cab-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 16px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 700; border: 1px solid var(--border);
  background: #fff; color: var(--text); cursor: pointer; white-space: nowrap;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.cab-btn svg { width: 16px; height: 16px; }
.cab-btn:hover { background: var(--bg-soft); }
.cab-btn--primary { background: var(--violet); color: #fff; border-color: var(--violet); }
.cab-btn--primary:hover { background: var(--violet-hover); }
.cab-btn--ghost { border-color: transparent; background: var(--bg-soft); }
.cab-btn--danger { color: var(--coral-deep); }
.cab-btn--danger:hover { background: var(--coral-soft); border-color: transparent; }

/* list rows (results, documents, orders, notifications) */
.cab-rows { display: flex; flex-direction: column; }
.cab-row {
  display: flex; align-items: center; gap: 15px;
  padding: 16px 6px; border-bottom: 1px solid var(--border);
}
.cab-row:last-child { border-bottom: 0; }
.cab-row-ico {
  width: 46px; height: 46px; border-radius: 12px; flex: 0 0 auto;
  background: var(--bg-soft); color: var(--violet); display: grid; place-items: center;
}
.cab-row-ico svg { width: 23px; height: 23px; }
.cab-row-ico.is-green { background: var(--green-pill); color: var(--green-text); }
.cab-row-ico.is-coral { background: var(--coral-soft); color: var(--coral-deep); }
.cab-row-main { flex: 1 1 auto; min-width: 0; }
.cab-row-tt { font-size: 15px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.cab-row-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.cab-row-act { display: flex; gap: 8px; flex: 0 0 auto; }
@media (max-width: 640px) { .cab-row { flex-wrap: wrap; } .cab-row-act { width: 100%; } }

.cab-pill {
  font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  letter-spacing: .01em; white-space: nowrap;
}
.pill-new { background: var(--coral-soft); color: var(--coral-deep); }
.pill-ready { background: var(--green-pill); color: var(--green-text); }
.pill-paid { background: var(--green-pill); color: var(--green-text); }
.pill-wait { background: #FFF3DC; color: #A8730B; }
.pill-soft { background: var(--bg-soft); color: var(--text-muted); }

/* doctor cards */
.doc-card { display: flex; gap: 15px; align-items: center; }
.doc-ava { width: 64px; height: 64px; border-radius: 16px; flex: 0 0 auto; object-fit: cover; object-position: top center; background: var(--lavender-hero); }
.doc-card-main { flex: 1 1 auto; min-width: 0; }
.doc-name { font-size: 16px; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.doc-spec { font-size: 13px; color: var(--text-muted); margin: 2px 0 7px; }
.doc-slot { font-size: 12.5px; font-weight: 700; color: var(--green-text); display: inline-flex; align-items: center; gap: 6px; }
.doc-slot svg { width: 14px; height: 14px; }

/* family */
.fam-card { display: flex; align-items: center; gap: 14px; }
.fam-ava { width: 50px; height: 50px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; font-size: 16px; font-weight: 800; color: #fff; }
.fam-name { font-size: 15.5px; font-weight: 800; color: var(--text); }
.fam-rel { font-size: 13px; color: var(--text-muted); margin-top: 1px; }
.fam-add {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 1.5px dashed var(--border); border-radius: var(--r-lg); background: #fff;
  padding: 22px; color: var(--violet); font-weight: 700; font-size: 14.5px; cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.fam-add:hover { border-color: var(--violet); background: var(--violet-soft); }
.fam-add svg { width: 20px; height: 20px; }

/* personal data */
.cab-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 2px 28px; }
.cab-field-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 2px; border-bottom: 1px solid var(--border); }
.cab-field-row .k { font-size: 13.5px; color: var(--text-muted); }
.cab-field-row .v { font-size: 14.5px; font-weight: 700; color: var(--text); text-align: right; }
.cab-field-row .v.empty { color: var(--text-light); font-weight: 600; }

/* settings toggles */
.cab-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 2px; border-bottom: 1px solid var(--border); }
.cab-toggle-row:last-child { border-bottom: 0; }
.cab-toggle-row .tt { font-size: 15px; font-weight: 700; color: var(--text); }
.cab-toggle-row .ds { font-size: 13px; color: var(--text-muted); margin-top: 2px; max-width: 460px; }
.cab-switch { position: relative; width: 48px; height: 28px; flex: 0 0 auto; }
.cab-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.cab-switch .track { position: absolute; inset: 0; border-radius: 999px; background: #D6D6DE; transition: background .2s ease; }
.cab-switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: transform .2s ease; }
.cab-switch input:checked + .track { background: var(--green); }
.cab-switch input:checked + .track::after { transform: translateX(20px); }

/* ---------- Empty states ---------- */
.cab-empty { text-align: center; padding: 40px 24px; }
.cab-empty-ic { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 16px; background: var(--violet-soft); color: var(--violet); display: grid; place-items: center; }
.cab-empty-ic svg { width: 30px; height: 30px; }
.cab-empty h3 { font-size: 18px; font-weight: 800; color: var(--text); margin: 0 0 7px; letter-spacing: -.01em; }
.cab-empty p { font-size: 14px; color: var(--text-muted); margin: 0 auto 18px; max-width: 380px; text-wrap: pretty; }

/* ---------- Skeleton loading ---------- */
.sk { background: linear-gradient(90deg,#ECECF1 25%,#F5F5F8 37%,#ECECF1 63%); background-size: 400% 100%; animation: cabSk 1.3s ease infinite; border-radius: 8px; }
@keyframes cabSk { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.sk-line { height: 13px; border-radius: 6px; }
.sk-card { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-card); }

/* ---------- Gate / error / expired ---------- */
.cab-state {
  background: #fff; border-radius: var(--r-xl); box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  text-align: center; padding: 56px 32px; max-width: 540px; margin: 24px auto;
}
.cab-state-ic { width: 78px; height: 78px; border-radius: 22px; margin: 0 auto 22px; display: grid; place-items: center; }
.cab-state-ic svg { width: 38px; height: 38px; }
.cab-state-ic.v { background: var(--violet-soft); color: var(--violet); }
.cab-state-ic.c { background: var(--coral-soft); color: var(--coral-deep); }
.cab-state h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--text); margin: 0 0 10px; }
.cab-state p { font-size: 15px; color: var(--text-muted); margin: 0 auto 24px; max-width: 400px; text-wrap: pretty; }
.cab-state .btn { display: inline-flex; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .cab-shell { grid-template-columns: 1fr; gap: 16px; }
  .cab-side { position: static; padding: 0; overflow: visible; background: transparent; box-shadow: none; }
  .cab-side-user, .cab-side-sep, .cab-nav { display: none; }
  .cab-nav-select { display: block; width: 100%; }
  .cab-tiles { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .cab-grid.cols-2, .cab-grid.cols-3 { grid-template-columns: 1fr; }
  .cab-fields { grid-template-columns: 1fr; }
  .cab-h h1 { font-size: 25px; }
  .cab-widget-card { padding: 22px 16px; }
  .cab-widget-card h1 { font-size: 25px; }
}
@media (max-width: 460px) {
  .cab-tiles { grid-template-columns: 1fr 1fr; }
}
