/* =========================================================
   Paula Donato · Gestor de consulta
   Branding extraído de pauladonato.com
   Verde salvia #82A56D · Crema #F9F8F2 · Playfair + Public Sans
   ========================================================= */

:root {
  --sage: #82a56d;
  --sage-dark: #6b8c58;
  --sage-soft: #eaf0e5;
  --sage-tint: #f3f7f0;
  --cream: #f9f8f2;
  --ink: #212121;
  --ink-soft: #4a4a4a;
  --muted: #8a8a83;
  --line: #e6e4da;
  --white: #ffffff;
  --danger: #b4553f;
  --danger-soft: #f7ece8;
  --warn: #c08a2e;
  --warn-soft: #fbf3e2;
  --ok: var(--sage);

  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
  --shadow: 0 1px 2px rgba(33, 33, 33, .04), 0 8px 24px rgba(33, 33, 33, .06);
  --shadow-lg: 0 12px 40px rgba(33, 33, 33, .14);
  --sidebar-w: 232px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .serif { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; }
h1 { font-size: 30px; margin: 0 0 4px; }
h2 { font-size: 21px; margin: 0 0 12px; }
h3 { font-size: 17px; margin: 0 0 8px; }
a { color: var(--sage-dark); }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--line);
  padding: 26px 16px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { padding: 0 6px; }
.brand__name { font-family: var(--serif); font-size: 22px; line-height: 1.15; margin: 0; }
.brand__sub {
  font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase;
  color: var(--muted); margin: 6px 0 0;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r);
  background: none; border: 0; cursor: pointer; text-align: left;
  color: var(--ink-soft); font-size: 14.5px; width: 100%;
  transition: background .14s ease, color .14s ease;
}
.nav__item:hover { background: var(--sage-tint); color: var(--ink); }
.nav__item.is-active { background: var(--sage-soft); color: var(--ink); font-weight: 600; }
.nav__item svg { width: 17px; height: 17px; flex: 0 0 17px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.nav__badge {
  margin-left: auto; background: var(--sage); color: #fff; font-size: 11px;
  min-width: 19px; height: 19px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px;
}

.sidebar__foot { margin-top: auto; font-size: 11.5px; color: var(--muted); padding: 0 6px; }
.sidebar__foot .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--sage); margin-right: 6px; }
.sidebar__foot .dot.off { background: #ccc; }
.sidebar__foot .dot.sync { background: var(--gold, #c8a24a); animation: latido 1.2s ease-in-out infinite; }
@keyframes latido { 0%, 100% { opacity: 1 } 50% { opacity: .25 } }
#estadoNube { cursor: default; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Menú de móvil: en pantalla grande ni el botón ni la cortina existen */
.burger, .scrim { display: none; }
.burger {
  border: 1px solid var(--line); background: var(--white); border-radius: var(--r);
  width: 40px; height: 40px; padding: 0; cursor: pointer; flex: 0 0 40px;
}
.burger svg { width: 20px; height: 20px; stroke: var(--ink); fill: none; stroke-width: 1.7; stroke-linecap: round; }

.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 32px; border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .82); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.topbar__title { flex: 1; min-width: 0; }
.topbar__title p { margin: 0; color: var(--muted); font-size: 13px; }

.search {
  position: relative; width: 260px;
}
.search input {
  width: 100%; padding: 9px 12px 9px 34px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--white); outline: none;
}
.search input:focus { border-color: var(--sage); box-shadow: 0 0 0 3px var(--sage-soft); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; stroke: var(--muted); fill: none; stroke-width: 1.8; }
.search__results {
  position: absolute; top: 44px; left: 0; right: 0; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-lg); overflow: hidden; z-index: 40; display: none;
}
.search__results.is-open { display: block; }
.search__results button {
  display: block; width: 100%; text-align: left; padding: 9px 14px; border: 0; background: none; cursor: pointer;
}
.search__results button:hover { background: var(--sage-tint); }
.search__results .empty { padding: 12px 14px; color: var(--muted); font-size: 13px; }

.view { padding: 28px 32px 64px; max-width: 1240px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  padding: 9px 16px; border-radius: var(--r); border: 1px solid transparent;
  background: var(--sage); color: #fff; cursor: pointer; font-size: 14px; font-weight: 500;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
  text-decoration: none;
}
.btn:hover { background: var(--sage-dark); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink-soft); }
.btn--ghost:hover { background: var(--sage-tint); border-color: var(--sage); color: var(--ink); }
.btn--danger { background: transparent; border-color: #e3cfc8; color: var(--danger); }
.btn--danger:hover { background: var(--danger-soft); }
.btn--sm { padding: 6px 11px; font-size: 13px; }
.btn--wa { background: #25d366; }
.btn--wa:hover { background: #1eb857; }
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.iconbtn {
  border: 1px solid var(--line); background: #fff; border-radius: var(--r-sm);
  width: 30px; height: 30px; display: grid; place-items: center; cursor: pointer; color: var(--ink-soft);
}
.iconbtn:hover { border-color: var(--sage); color: var(--sage-dark); background: var(--sage-tint); }
.iconbtn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.7; }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px 22px; box-shadow: var(--shadow);
}
.card--flat { box-shadow: none; }
.card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card__head h2, .card__head h3 { margin: 0; flex: 1; }

.grid { display: grid; gap: 18px; }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid--2 { grid-template-columns: 1.55fr 1fr; align-items: start; }
@media (max-width: 1080px) { .grid--2 { grid-template-columns: 1fr; } }

.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; }
.stat__label { font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.stat__value { font-family: var(--serif); font-size: 27px; line-height: 1.1; margin: 0; }
.stat__hint { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }
.stat--accent { background: var(--sage-soft); border-color: #d9e4d1; }

/* ---------- Listas de sesiones ---------- */
.session {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r); background: #fff; margin-bottom: 8px;
}
.session:hover { border-color: var(--sage); }
.session__time {
  font-family: var(--serif); font-size: 17px; min-width: 54px; text-align: center; line-height: 1.2;
}
.session__time small { display: block; font-family: var(--sans); font-size: 11px; color: var(--muted); }
.session__body { flex: 1; min-width: 0; }
.session__name { font-weight: 600; }
.session__meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.session__actions { display: flex; gap: 6px; }
.session--done { opacity: .62; }
.session--cancelled .session__name { text-decoration: line-through; }
.bar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--sage); }
.bar--online { background: #7aa6c2; }
.bar--cancelled { background: #d8d5cb; }
.bar--noshow { background: var(--danger); }
.bar--ext { background: #c8c3b0; }
.bar--paid { background: var(--sage-dark); }
.session--ext { background: #fbfaf6; }
.session--ext .session__name { color: var(--ink-soft); font-weight: 500; }

.tag {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 2px 8px;
  border-radius: 999px; background: var(--sage-soft); color: var(--sage-dark); font-weight: 500;
}
.tag--grey { background: #f0efe8; color: var(--muted); }
.tag--warn { background: var(--warn-soft); color: var(--warn); }
.tag--danger { background: var(--danger-soft); color: var(--danger); }
.tag--online { background: #e8f0f5; color: #4d7d99; }
.tag--info { background: #e8f0f5; color: #4d7d99; }

.empty-state { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty-state p { margin: 6px 0 14px; }

/* ---------- Calendario ---------- */
.cal__head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cal__month { font-family: var(--serif); font-size: 22px; margin: 0; min-width: 200px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 7px 14px; cursor: pointer; font-size: 13.5px; color: var(--ink-soft); }
.seg button.is-active { background: var(--sage-soft); color: var(--ink); font-weight: 600; }
.seg__badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  margin-left: 5px; border-radius: 9px; background: var(--sage); color: #fff; font-size: 11px; font-weight: 700;
}

.cal {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
}
.cal__weekdays, .cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal__weekdays div {
  padding: 10px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); text-align: center; border-bottom: 1px solid var(--line);
}
.cal__day {
  min-height: 108px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 7px 8px; cursor: pointer; background: #fff; text-align: left; font: inherit;
  display: flex; flex-direction: column; gap: 3px; overflow: hidden;
}
.cal__day:nth-child(7n) { border-right: 0; }
.cal__day:hover { background: var(--sage-tint); }
.cal__day.is-out { background: #fbfaf6; color: #c3c0b6; }
.cal__day.is-today .cal__daynum { background: var(--sage); color: #fff; }
.cal__day.is-selected { box-shadow: inset 0 0 0 2px var(--sage); }
.cal__daynum {
  width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 600;
}
.cal__pill {
  font-size: 11.5px; background: var(--sage-soft); color: var(--sage-dark); border-radius: 4px;
  padding: 2px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal__pill.is-online { background: #e8f0f5; color: #4d7d99; }
.cal__pill.is-cancelled { background: #f2f1ec; color: var(--muted); text-decoration: line-through; }
.cal__pill.is-ext { background: #f5f3ec; color: #8a8477; }
.cal__more { font-size: 11px; color: var(--muted); }

.dayblock { margin-bottom: 22px; }
.dayblock:last-child { margin-bottom: 0; }
.dayblock__head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
  padding-bottom: 7px; border-bottom: 1px solid var(--line);
}
.dayblock__head h4 { margin: 0; font-family: var(--serif); font-size: 15.5px; font-weight: 500; }
.dayblock__head h4::first-letter { text-transform: uppercase; }
.dayblock.is-today .dayblock__head { border-bottom-color: var(--sage); }
.dayblock.is-selected { background: var(--sage-tint); margin: 0 -12px 22px; padding: 10px 12px 4px; border-radius: var(--r); }

.tag--paid { background: var(--sage-soft); color: var(--sage-dark); }

/* Vista semana */
.week { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.week__col-head { display: grid; grid-template-columns: 58px repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.week__col-head div { padding: 9px 6px; text-align: center; font-size: 12px; color: var(--muted); }
.week__col-head div.is-today { color: var(--sage-dark); font-weight: 700; }
.week__body { display: grid; grid-template-columns: 58px repeat(7, 1fr); position: relative; }
.week__hours div {
  height: 46px; font-size: 11px; color: var(--muted); text-align: right; padding-right: 8px;
  border-bottom: 1px solid #f1efe7;
}
.week__col { position: relative; border-left: 1px solid #f1efe7; }
.week__slot { height: 46px; border-bottom: 1px solid #f1efe7; cursor: pointer; }
.week__slot:hover { background: var(--sage-tint); }
.week__ev {
  position: absolute; left: 3px; right: 3px; border-radius: 6px; padding: 3px 6px;
  background: var(--sage-soft); border-left: 3px solid var(--sage); font-size: 11.5px;
  overflow: hidden; cursor: pointer; line-height: 1.3;
}
.week__ev.is-online { background: #e8f0f5; border-left-color: #7aa6c2; }
.week__ev.is-cancelled { background: #f2f1ec; border-left-color: #ccc; opacity: .7; }
.week__ev.is-ext { background: #f5f3ec; border-left-color: #c8c3b0; color: var(--ink-soft); }
.week__ev.is-ext:hover { background: var(--sage-tint); border-left-color: var(--sage); }
.week__ev.is-block { background: repeating-linear-gradient(45deg, #f2f1ec, #f2f1ec 6px, #eae8e0 6px, #eae8e0 12px); border-left-color: #ccc8ba; color: var(--muted); cursor: default; }
.week__ev strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Clientes ---------- */
.clients__toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.clients__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; }

/* Listado de clientes en filas */
.clist__head, .clist__row {
  display: grid;
  grid-template-columns: 34px minmax(150px, 1.7fr) 118px 84px 150px 96px 76px;
  align-items: center; gap: 12px; padding: 10px 18px;
}
.clist__head {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  font-weight: 600; border-bottom: 1px solid var(--line); background: #fbfaf6; padding-top: 12px; padding-bottom: 12px;
}
.clist__row {
  border-bottom: 1px solid #f4f3ec; cursor: pointer; background: #fff;
  transition: background .12s ease;
}
.clist__row:last-child { border-bottom: 0; }
.clist__row:hover { background: var(--sage-tint); }
.clist__row:focus-visible { outline: 2px solid var(--sage); outline-offset: -2px; }
.clist__name { font-weight: 600; min-width: 0; display: flex; flex-direction: column; }
.clist__phone { font-weight: 400; font-size: 12.5px; color: var(--muted); }
.clist__col { min-width: 0; }
.clist__num { text-align: right; }
.clist__num small { color: var(--muted); font-size: 11.5px; }
.clist__actions { display: flex; gap: 5px; justify-content: flex-end; }
.avatar--sm { width: 34px; height: 34px; flex: 0 0 34px; font-size: 13px; }

@media (max-width: 900px) {
  .clist__head { display: none; }
  .clist__row {
    grid-template-columns: 34px 1fr auto;
    grid-template-areas: "av nombre acciones" ". datos datos";
    row-gap: 6px;
  }
  .clist__row > .avatar { grid-area: av; }
  .clist__name { grid-area: nombre; }
  .clist__actions { grid-area: acciones; }
  .clist__col { grid-area: datos; display: inline; }
  .clist__num { text-align: left; }
}
.client-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px;
  cursor: pointer; display: flex; gap: 13px; align-items: flex-start; text-align: left; font: inherit;
  transition: border-color .14s ease, transform .14s ease;
}
.client-card:hover { border-color: var(--sage); transform: translateY(-1px); }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; background: var(--sage-soft); color: var(--sage-dark);
  display: grid; place-items: center; font-family: var(--serif); font-size: 16px; flex: 0 0 42px;
}
.avatar--lg { width: 66px; height: 66px; flex: 0 0 66px; font-size: 24px; }
.client-card__name { font-weight: 600; margin: 0; }
.client-card__meta { font-size: 12.5px; color: var(--muted); margin: 2px 0 8px; }

/* Ficha */
.profile__head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 22px; flex-wrap: wrap; }
.profile__head h1 { margin: 0; }
.profile__contact { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.profile__meta { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 12px; }
.profile__meta span { display: flex; flex-direction: column; font-size: 14.5px; }
.profile__meta small {
  font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1px;
}
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; flex-wrap: wrap; }
.tabs button {
  border: 0; background: none; padding: 10px 15px; cursor: pointer; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 14.5px;
}
.tabs button:hover { color: var(--ink); }
.tabs button.is-active { color: var(--ink); border-bottom-color: var(--sage); font-weight: 600; }

.field-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px 26px; }
.field label, .form label {
  display: block; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 4px;
}
.field p { margin: 0; }
.field p.is-empty { color: #c3c0b6; }

.form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.form .full { grid-column: 1 / -1; }
input[type=text], input[type=tel], input[type=email], input[type=date], input[type=time],
input[type=number], input[type=password], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fff; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--sage); box-shadow: 0 0 0 3px var(--sage-soft); }
textarea { resize: vertical; min-height: 92px; line-height: 1.6; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }
.check label { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); margin: 0; }

/* Notas */
.note {
  border: 1px solid var(--line); border-radius: var(--r); padding: 15px 17px; background: #fff; margin-bottom: 12px;
}
.note__head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.note__date { font-family: var(--serif); font-size: 15px; }
.note__body { white-space: pre-wrap; color: var(--ink-soft); }
.note--pinned { border-color: var(--sage); background: var(--sage-tint); }

.timeline { border-left: 2px solid var(--line); margin-left: 8px; padding-left: 20px; }
.timeline__item { position: relative; padding-bottom: 20px; }
.timeline__item::before {
  content: ""; position: absolute; left: -27px; top: 5px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--sage); border: 2px solid var(--cream);
}

/* ---------- Reservas ---------- */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.slot {
  border: 1px solid var(--line); background: #fff; border-radius: var(--r-sm); padding: 9px 6px;
  cursor: pointer; text-align: center; font-size: 14px;
}
.slot:hover { border-color: var(--sage); background: var(--sage-tint); }
.slot.is-selected { background: var(--sage); border-color: var(--sage); color: #fff; }
.slot.is-taken { opacity: .35; cursor: not-allowed; text-decoration: line-through; }
.daysched { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.daysched__name { width: 96px; font-weight: 600; }
.daysched input[type=time] { width: 116px; }

/* ---------- Facturación ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; padding: 0 10px 10px; border-bottom: 1px solid var(--line);
}
.table td { padding: 11px 10px; border-bottom: 1px solid #f4f3ec; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--sage-tint); }
.table .num { text-align: right; }
.rowbtns { display: flex; gap: 4px; justify-content: flex-end; }
.table tr.is-void td { opacity: .5; text-decoration: line-through; }
.table tr.is-void .iconbtn { text-decoration: none; }

.concepto-fijo {
  margin: 0; padding: 11px 13px; border: 1px dashed var(--line); border-radius: var(--r-sm);
  background: var(--sage-tint); font-style: italic; color: var(--ink-soft);
}
.ivlist { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.ivrow {
  display: flex; align-items: center; gap: 10px; padding: 10px 13px;
  border-bottom: 1px solid #f4f3ec; text-transform: none; letter-spacing: 0;
  font-size: 14px; color: var(--ink); margin: 0; cursor: pointer;
}
.ivrow:last-child { border-bottom: 0; }
.ivrow:hover { background: var(--sage-tint); }
.ivrow input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--sage); flex: 0 0 17px; }
.ivrow > span:first-of-type { flex: 1; }
.ivrow strong { margin-left: auto; white-space: nowrap; }

/* ---------- Documentos ---------- */
.docs { display: grid; gap: 10px; }
.doc {
  display: flex; align-items: center; gap: 14px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--r); background: #fff;
}
.doc:hover { border-color: var(--sage); }
.doc__thumb {
  width: 52px; height: 62px; flex: 0 0 52px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--sage-tint) center/cover no-repeat; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .04em;
}
.doc__body { flex: 1; min-width: 0; }
.doc__name { margin: 0; font-weight: 600; word-break: break-word; }
.doc__meta { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

.dropzone {
  border: 2px dashed var(--line); border-radius: var(--r-lg); background: #fff;
  padding: 34px 20px; text-align: center; color: var(--muted); margin-bottom: 18px;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone.is-over { border-color: var(--sage); background: var(--sage-tint); color: var(--ink); }
.dropzone p { margin: 0; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(33, 33, 33, .38); backdrop-filter: blur(2px);
  display: grid; place-items: center; z-index: 100; padding: 24px; overflow-y: auto;
}
.modal {
  background: var(--white); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  width: min(660px, 100%); max-height: 90vh; overflow-y: auto;
}
.modal--wide { width: min(860px, 100%); }
.modal__head { padding: 20px 24px 0; display: flex; align-items: flex-start; gap: 12px; }
.modal__head h2 { flex: 1; }
.modal__body { padding: 16px 24px; }
.modal__foot {
  padding: 16px 24px 20px; display: flex; gap: 10px; justify-content: flex-end;
  border-top: 1px solid var(--line); position: sticky; bottom: 0; background: #fff;
}
.modal__foot .left { margin-right: auto; }

/* ---------- Toast ---------- */
.toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast {
  background: var(--ink); color: #fff; padding: 11px 17px; border-radius: var(--r); font-size: 14px;
  box-shadow: var(--shadow-lg); animation: rise .22s ease;
}
.toast.is-err { background: var(--danger); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Bloqueo PIN ---------- */
.lock {
  position: fixed; inset: 0; background: var(--cream); z-index: 500; display: grid; place-items: center;
}
.lock__box { text-align: center; width: 330px; }
.lock__box--wide { width: 400px; }
.lock__box h1 { font-size: 26px; margin-bottom: 2px; }
.lock__sub { font-size: 11px; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); margin: 0 0 22px; }
.lock__form { text-align: left; margin-bottom: 18px; }
.lock__form label { display: block; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 12px 0 4px; }
.lock__form input { width: 100%; }
.lock__err { color: var(--danger); font-size: 13.5px; min-height: 20px; margin: 10px 0 0; }
/* Elegir si el aparato es de fiar o prestado */
.lock__modo { text-align: left; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 18px; }
.lock__modo .check { gap: 8px; }
.lock__modo .hint { margin: 2px 0 0 24px; font-size: 12.5px; }
.lock__code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 20px; letter-spacing: .12em;
  background: var(--sage-soft); border: 1px solid #d9e4d1; border-radius: var(--r);
  padding: 16px 10px; margin: 18px 0 14px; user-select: all;
}
.linkbtn { background: none; border: 0; color: var(--sage-dark); cursor: pointer; font-size: 13.5px; text-decoration: underline; margin-top: 14px; }

.hint { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.divider { height: 1px; background: var(--line); margin: 22px 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row--end { justify-content: flex-end; }
.spacer { flex: 1; }

@media print {
  .sidebar, .topbar, .session__actions, .btn, .iconbtn, .tabs { display: none !important; }
  .view { padding: 0; }
  body { background: #fff; }
}

@media (max-width: 760px) {
  .app { flex-direction: column; }

  /* El menú pasa a ser un cajón que entra por la izquierda */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
    width: 80%; max-width: 290px; height: 100dvh; flex: none;
    padding: 22px 14px; gap: 20px;
    transform: translateX(-101%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
  }
  .sidebar.is-open { transform: none; }
  .scrim {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(33, 33, 33, .42);
    opacity: 0; pointer-events: none; transition: opacity .22s ease;
  }
  .scrim.is-open { opacity: 1; pointer-events: auto; }
  .burger { display: grid; place-items: center; }

  /* Cabecera en dos filas: nada se pisa aunque el nombre sea largo */
  .topbar {
    display: grid; align-items: center;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "menu titulo accion" "buscar buscar buscar";
    gap: 10px 12px; padding: 12px 16px;
  }
  .burger { grid-area: menu; }
  .topbar__title { grid-area: titulo; }
  .topbar__title h1 { font-size: 24px; line-height: 1.1; }
  .topbar__title p {
    font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .search { grid-area: buscar; width: 100%; }
  #btnNewSession { grid-area: accion; padding: 9px 12px; }
  #btnNewSession span { display: none; }

  .view { padding-left: 16px; padding-right: 16px; }
  .form { grid-template-columns: 1fr; }
  .profile__meta { gap: 18px; }
}
