/* miagenda: panel interno de citas. Tokens y estilo tomados de los mockups del plan
   (indigo profundo como color estructural, ambar como unico acento). Un solo corte
   principal a 768 px: por encima, grilla semanal; por debajo, agenda de un dia. */

:root {
  --bg: #EEF1F8;
  --surface: #FFFFFF;
  --surface-2: #F6F7FB;
  --line: #E1E5F0;
  --line-soft: #ECEEF6;
  --ink: #1A2036;
  --ink-soft: #5B6478;
  --ink-faint: #8A92A6;
  --primary: #1E2447;
  --primary-2: #2B3260;
  --primary-tint: #E9EAF4;
  --accent: #E8A33D;
  --accent-ink: #7A4A0F;
  --accent-tint: #FCF0DB;
  --st-recibida: #B87A1C;
  --st-recibida-bg: #FDF1DC;
  --st-confirmada: #227A54;
  --st-confirmada-bg: #E4F4EC;
  --st-opcional: #5B4CC4;
  --st-opcional-bg: #EDEBFB;
  --st-rechazada: #B23E3E;
  --st-rechazada-bg: #FBEAEA;
  --st-bloqueada: #5F6675;
  --st-bloqueada-bg: #ECEEF2;
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 14px;
  --shadow-panel: 0 12px 40px rgba(26, 32, 54, 0.18);
  --shadow-card: 0 1px 2px rgba(26, 32, 54, 0.06);
  --sans: system-ui, -apple-system, "Segoe UI", "DejaVu Sans", Arial, sans-serif;
  --serif: Georgia, "DejaVu Serif", "Times New Roman", serif;
  --row: 38px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 14px; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 40px; text-align: center; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- inicio de sesion */
.login-screen { display: flex; min-height: 100vh; background: var(--primary); }
.login-art { flex: 1.1; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.login-art .brand, .login-brand-mobile { display: flex; align-items: center; gap: 10px; }
.login-art .brand .name { color: #fff; font-family: var(--serif); font-size: 22px; font-weight: 700; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.login-art .headline { font-family: var(--serif); color: #fff; font-size: 38px; line-height: 1.25; max-width: 520px; font-weight: 700; margin: 0; }
.login-art .sub { color: #B9C0DE; font-size: 14px; max-width: 420px; line-height: 1.6; margin: 14px 0 0; }
.login-art .foot { color: #8992BD; font-size: 13px; margin: 0; }
.clock-pair { display: flex; gap: 34px; margin-top: 18px; }
.clock-pair .tz { color: #8992BD; font-size: 11px; font-weight: 700; letter-spacing: .3px; }
.clock-pair .t { color: #fff; font-size: 30px; font-weight: 700; font-family: var(--serif); margin-top: 4px; }
.login-box-wrap { flex: 0 0 560px; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-box { width: 100%; max-width: 380px; }
.login-brand-mobile { display: none; margin-bottom: 28px; }
.login-brand-mobile .name { font-family: var(--serif); font-size: 20px; font-weight: 700; }
.login-box h1 { font-size: 22px; margin: 0 0 6px; }
.login-box .sub { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 26px; }
.field { margin-bottom: 16px; }
.field label { font-size: 12px; font-weight: 700; color: var(--ink-soft); display: block; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-s);
  padding: 11px 12px; font-size: 14px; color: var(--ink); font-family: var(--sans);
}
.field textarea { resize: vertical; min-height: 80px; }
.field .hint { font-size: 12px; color: var(--ink-faint); margin-top: 5px; }
.remember { display: flex; gap: 10px; align-items: flex-start; margin: 2px 0 16px; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.remember input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--primary); flex: 0 0 auto; }
.remember small { display: block; font-size: 12px; color: var(--ink-faint); margin-top: 2px; line-height: 1.4; }
.login-btn { width: 100%; background: var(--primary); color: #fff; border: none; border-radius: var(--radius-s); padding: 12px; font-size: 14px; font-weight: 700; margin-top: 6px; }
.login-btn:hover { background: var(--primary-2); }
.login-foot { text-align: center; font-size: 12.5px; color: var(--ink-faint); margin-top: 18px; line-height: 1.5; }
.alert { background: var(--st-rechazada-bg); color: var(--st-rechazada); border: 1px solid #F1D2D2; border-radius: var(--radius-s); padding: 10px 12px; font-size: 13px; margin-bottom: 16px; }

/* ---------------------------------------------------------------- armazon */
.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar { width: 248px; flex: 0 0 248px; background: var(--primary); color: #C9CEE0; display: flex; flex-direction: column; padding: 22px 0 18px; transition: width .18s, flex-basis .18s; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 22px 22px; margin-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand .name { color: #fff; font-family: var(--serif); font-size: 19px; font-weight: 700; }
.icon-btn { width: 30px; height: 30px; border-radius: var(--radius-s); display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 1px solid var(--line); color: var(--ink-soft); padding: 0; }
.sidebar .icon-btn { margin-left: auto; border-color: rgba(255,255,255,.14); color: #9AA2C0; width: 26px; height: 26px; }
.nav-section-label { font-size: 11px; color: #7A82A6; padding: 16px 22px 8px; font-weight: 700; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 1px 10px; border-radius: var(--radius-s); font-size: 14px; color: #C9CEE0; background: transparent; border: none; width: calc(100% - 20px); text-align: left; }
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.08); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav-item .count { margin-left: auto; font-size: 11px; background: var(--accent); color: #4A2E06; border-radius: 20px; padding: 1px 8px; font-weight: 700; }
.sidebar-spacer { flex: 1; }
.sidebar-user { margin: 10px 14px 0; padding: 16px 8px 0; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #4A2E06; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.sidebar-user .u-name { color: #fff; font-size: 13px; font-weight: 700; line-height: 1.3; }
.sidebar-user .u-role { color: #9AA2C0; font-size: 11.5px; line-height: 1.3; }
.sidebar-user .logout { margin-left: auto; background: transparent; border: none; color: #9AA2C0; font-size: 12px; text-decoration: underline; padding: 4px; }
.sidebar-user .u-text { min-width: 0; overflow: hidden; }
.sidebar.collapsed { width: 68px; flex-basis: 68px; }
.sidebar.collapsed .label, .sidebar.collapsed .nav-section-label, .sidebar.collapsed .sidebar-brand .name,
.sidebar.collapsed .u-text, .sidebar.collapsed .logout, .sidebar.collapsed .count { display: none; }
.sidebar.collapsed .sidebar-brand { padding: 0 12px 22px; flex-direction: column; }
.sidebar.collapsed .sidebar-brand .icon-btn { margin: 10px 0 0; }
.sidebar.collapsed .nav-item { justify-content: center; }
.sidebar.collapsed .sidebar-user { justify-content: center; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 24px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.week-nav { display: flex; align-items: center; gap: 8px; }
.today-btn { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 6px 12px; font-size: 13px; font-weight: 700; color: var(--ink-soft); background: var(--surface); }
.week-label { font-size: 15.5px; font-weight: 700; min-width: 170px; }
.tz-toggle { display: flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.tz-toggle button { border: none; background: var(--surface); padding: 6px 10px; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.tz-toggle button.active { background: var(--primary-tint); color: var(--primary); }
.filter-tabs { margin-left: auto; display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; overflow-x: auto; max-width: 100%; }
.filter-tab { font-size: 12.5px; font-weight: 700; padding: 7px 14px; border-radius: 999px; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; border: none; background: transparent; white-space: nowrap; }
.filter-tab .sw { width: 7px; height: 7px; border-radius: 50%; }
.filter-tab.active { background: var(--primary); color: #fff; }
.sw.recibida { background: var(--st-recibida); } .sw.confirmada { background: var(--st-confirmada); }
.sw.opcional { background: var(--st-opcional); } .sw.rechazada { background: var(--st-rechazada); }
.filter-tab.active .sw { box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.loading-bar { height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); background-size: 200% 100%; animation: load 1s linear infinite; }
@keyframes load { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- grilla semanal */
.cal-wrap { flex: 1; overflow: auto; background: var(--surface); position: relative; }
.cal-header { display: grid; grid-template-columns: 64px repeat(7, minmax(110px, 1fr)); border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 3; }
.cal-header .cell { padding: 10px 8px; text-align: center; border-left: 1px solid var(--line-soft); }
.cal-header .cell:first-child { border-left: none; font-size: 10px; color: var(--ink-faint); font-weight: 700; display: flex; align-items: flex-end; justify-content: center; }
.cal-header .dow { font-size: 10.5px; color: var(--ink-faint); font-weight: 700; letter-spacing: .3px; }
.cal-header .dnum { font-size: 17px; font-weight: 700; margin-top: 2px; }
.cal-header .cell.is-today .dnum { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; background: var(--accent); color: #4A2E06; border-radius: 50%; }
.cal-body { display: grid; grid-template-columns: 64px repeat(7, minmax(110px, 1fr)); position: relative; }
.time-col { border-right: 1px solid var(--line-soft); }
.time-slot { height: var(--row); font-size: 10.5px; color: var(--ink-faint); text-align: right; padding-right: 8px; position: relative; top: -7px; }
.time-slot.hour { color: var(--ink-soft); font-weight: 700; }
.day-col { position: relative; border-left: 1px solid var(--line-soft); }
.day-col .grid-line { height: var(--row); border-bottom: 1px dashed var(--line-soft); }
.day-col .grid-line.hour { border-bottom: 1px solid var(--line); }
.day-col.is-today { background: #FBF6EC; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--st-rechazada); z-index: 2; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--st-rechazada); }

.appt { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; position: absolute; left: 4px; right: 4px; border-radius: 7px; padding: 4px 7px; font-size: 11px; line-height: 1.28; overflow: hidden; border: none; border-left: 3px solid; box-shadow: var(--shadow-card); text-align: left; z-index: 1; }
.appt:hover { z-index: 2; box-shadow: 0 4px 12px rgba(26,32,54,.15); }
.appt .c-top { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; }
.appt .c-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt .c-cc { font-size: 8.5px; font-weight: 700; opacity: .65; flex: 0 0 auto; letter-spacing: .3px; }
.appt .c-time { font-weight: 700; margin-top: 1px; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt .c-meta { opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 9.5px; margin-top: 1px; }
.appt.recibida, .m-card.recibida { background: var(--st-recibida-bg); border-color: var(--st-recibida); color: #6B4A10; }
.appt.confirmada, .m-card.confirmada { background: var(--st-confirmada-bg); border-color: var(--st-confirmada); color: #175A3E; }
.appt.opcional, .m-card.opcional { background: var(--st-opcional-bg); border-color: var(--st-opcional); color: #40349A; }
.appt.rechazada, .m-card.rechazada { background: var(--st-rechazada-bg); border-color: var(--st-rechazada); color: #8B2E2E; }
.appt.rechazada { opacity: .78; text-decoration: line-through; text-decoration-thickness: 1px; }
.appt.rechazada .c-cc, .appt.rechazada .c-meta { text-decoration: none; }
.appt.past { filter: saturate(.55); opacity: .7; }
.appt.selected { outline: 2px solid var(--primary); outline-offset: 1px; }
.appt.bloqueada, .m-card.bloqueada { background: repeating-linear-gradient(135deg, var(--st-bloqueada-bg) 0 8px, #F6F7FA 8px 16px); border-color: var(--st-bloqueada); color: #3E4452; }
.appt.bloqueada { z-index: 0; opacity: .95; }
.sw.bloqueada, .badge.bloqueada .sw { background: var(--st-bloqueada); }
.badge.bloqueada { background: var(--st-bloqueada-bg); color: var(--st-bloqueada); }
.block-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--radius-s); padding: 6px 12px; font-size: 12.5px; font-weight: 700; }
.block-btn:hover { background: var(--surface-2); }
.preset-row { display: flex; flex-wrap: wrap; gap: 6px; }
.preset { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 12px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.preset.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.field-pair { display: flex; gap: 12px; }
.field-pair .field { flex: 1; min-width: 0; }
.empty-week { position: absolute; left: 64px; right: 0; top: 120px; text-align: center; color: var(--ink-faint); pointer-events: none; font-size: 13px; }

/* ---------------------------------------------------------------- panel de detalle */
.scrim { position: fixed; inset: 0; background: rgba(20, 24, 42, .42); z-index: 20; display: flex; }
.panel { margin-left: auto; width: 420px; max-width: 100%; height: 100%; background: var(--surface); box-shadow: var(--shadow-panel); display: flex; flex-direction: column; animation: slidein .16s ease-out; }
@keyframes slidein { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.panel-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--line); position: relative; }
.panel-head .close { position: absolute; right: 16px; top: 16px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.badge .sw { width: 7px; height: 7px; border-radius: 50%; }
.badge.recibida { background: var(--st-recibida-bg); color: var(--st-recibida); }
.badge.confirmada { background: var(--st-confirmada-bg); color: var(--st-confirmada); }
.badge.opcional { background: var(--st-opcional-bg); color: var(--st-opcional); }
.badge.rechazada { background: var(--st-rechazada-bg); color: var(--st-rechazada); }
.badge.neutral { background: var(--surface-2); color: var(--ink-soft); }
.panel-head h2 { font-size: 20px; margin: 12px 0 2px; padding-right: 30px; overflow-wrap: anywhere; }
.panel-head .sub { font-size: 13px; color: var(--ink-soft); }
.panel-body { padding: 8px 24px 18px; overflow: auto; flex: 1; }
.field-row { display: flex; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.field-row .icon { width: 18px; flex: 0 0 auto; color: var(--ink-faint); margin-top: 1px; }
.field-row .k { font-size: 11px; color: var(--ink-faint); font-weight: 700; letter-spacing: .2px; }
.field-row .v { font-size: 13.5px; margin-top: 2px; overflow-wrap: anywhere; }
.field-row .v a { color: var(--primary-2); }
.field-row .grow { flex: 1; min-width: 0; }
.tz-pair { display: flex; gap: 10px; margin-top: 8px; }
.tz-chip { flex: 1; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 10px; }
.tz-chip .tz-country { font-size: 10.5px; color: var(--ink-faint); font-weight: 700; }
.tz-chip .tz-time { font-size: 15px; font-weight: 700; margin-top: 2px; }
.panel-actions { padding: 16px 24px 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 9px; }
.panel-note { font-size: 12.5px; color: var(--ink-soft); background: var(--surface-2); border-radius: var(--radius-s); padding: 10px 12px; }
.btn { border: none; border-radius: var(--radius-s); padding: 11px 16px; font-size: 13.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { background: var(--st-confirmada); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #1C6947; }
.btn-secondary { background: var(--primary-tint); color: var(--primary); }
.btn-secondary:hover:not(:disabled) { background: #DDDFEE; }
.btn-danger { background: var(--surface); color: var(--st-rechazada); border: 1px solid #F1D2D2; }
.btn-danger:hover:not(:disabled) { background: var(--st-rechazada-bg); }
.btn-danger-solid { background: var(--st-rechazada); color: #fff; }
.btn-link { background: transparent; border: none; color: var(--st-opcional); font-weight: 700; font-size: 12.5px; padding: 4px; text-decoration: underline; }
.btn-ghost { background: transparent; border: none; color: var(--ink-soft); padding: 10px 16px; font-weight: 700; border-radius: var(--radius-s); }
.btn-cta { background: var(--primary); color: #fff; padding: 10px 20px; border: none; border-radius: var(--radius-s); font-weight: 700; }
.btn-cta:hover:not(:disabled) { background: var(--primary-2); }

/* ---------------------------------------------------------------- ventana emergente (reagendar, rechazar, usuario) */
.modal { margin: auto; width: 700px; max-width: calc(100% - 32px); max-height: calc(100% - 32px); background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow-panel); overflow: hidden; display: flex; flex-direction: column; }
.modal.small { width: 460px; }
.modal.wide { width: 1080px; }
.reject-body { align-items: flex-start; }
.reject-body .slot-list { flex: 1 1 250px; }
.reject-side { flex: 0 0 300px; border-left: 1px solid var(--line); padding-left: 22px; min-width: 0; }
.reject-intro { margin: 0 0 16px; font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
.offer-list { margin-bottom: 16px; }
.offer-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--primary-tint); color: var(--primary); border-radius: var(--radius-s); padding: 7px 8px 7px 12px; font-size: 12.5px; margin-bottom: 6px; }
.offer-chip .icon-btn { width: 24px; height: 24px; border-color: transparent; color: var(--primary); background: rgba(255,255,255,.6); flex: 0 0 auto; }
.offer-chip .icon-btn:hover { background: #fff; }
.offer-list .sl-empty { padding: 4px 0 0; font-size: 12.5px; }
.modal-head { padding: 20px 26px; border-bottom: 1px solid var(--line); }
.modal-head .eyebrow { font-size: 11.5px; color: var(--ink-faint); font-weight: 700; letter-spacing: .3px; }
.modal-head h2 { font-size: 18px; margin: 4px 0 0; }
.modal-body { padding: 22px 26px; display: flex; gap: 24px; overflow: auto; }
.modal-body.stack { display: block; }
.modal-foot { padding: 14px 26px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; align-items: center; }
.modal-foot .msg { margin-right: auto; font-size: 12.5px; color: var(--st-rechazada); }
.mini-cal { flex: 0 0 270px; }
.mc-label { font-size: 13px; font-weight: 700; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; text-transform: capitalize; }
.mc-label .mc-nav { display: flex; gap: 4px; }
.mc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.mc-dow { font-size: 10px; color: var(--ink-faint); text-align: center; font-weight: 700; padding-bottom: 4px; }
.mc-day { height: 32px; display: flex; align-items: center; justify-content: center; font-size: 12.5px; border-radius: 7px; color: var(--ink); border: 1px solid transparent; background: transparent; padding: 0; position: relative; }
.mc-day.free::after { content: ""; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--st-confirmada); }
.mc-day:disabled { color: #C3C8D5; opacity: 1; }
.mc-day:hover:not(:disabled) { background: var(--surface-2); }
.mc-day.today { border-color: var(--accent); font-weight: 700; }
.mc-day.selected { background: var(--primary); color: #fff; font-weight: 700; }
.mc-day.selected::after { background: #fff; }
.mc-legend { font-size: 11.5px; color: var(--ink-faint); margin-top: 10px; }
.slot-list { flex: 1; min-width: 0; }
.slot-list .sl-label { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.slot { border: 1px solid var(--line); border-radius: var(--radius-s); text-align: center; padding: 8px 4px; font-size: 13px; font-weight: 700; color: var(--ink); background: var(--surface); line-height: 1.3; }
.slot small { display: block; font-size: 10.5px; color: var(--ink-faint); font-weight: 700; }
.slot:hover:not(:disabled) { border-color: var(--primary); }
.slot.selected { background: var(--primary); border-color: var(--primary); color: #fff; }
.slot.selected small { color: #C9CEE0; }
.slot:disabled { color: var(--ink-faint); background: var(--surface-2); text-decoration: line-through; }
.slot.current:disabled { text-decoration: none; border-style: dashed; }
.sl-note { font-size: 12px; color: var(--ink-faint); margin-top: 12px; line-height: 1.5; }
.sl-empty { font-size: 13px; color: var(--ink-soft); padding: 18px 0; }

/* ---------------------------------------------------------------- usuarios y configuracion */
.page { flex: 1; overflow: auto; padding: 24px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; margin: 0; }
.page-head .btn-cta { margin-left: auto; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow-card); margin-bottom: 18px; overflow: hidden; }
.card h2 { font-size: 14px; margin: 0; padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11px; color: var(--ink-faint); font-weight: 700; padding: 10px 18px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.table td { padding: 12px 18px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table .muted { color: var(--ink-faint); font-size: 12.5px; }
.kv { display: grid; grid-template-columns: 220px 1fr; gap: 8px 18px; padding: 14px 18px; font-size: 13.5px; }
.kv .k { color: var(--ink-soft); }
.card p.note { padding: 0 18px 14px; margin: 0; font-size: 12.5px; color: var(--ink-faint); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }

/* ---------------------------------------------------------------- avisos */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: var(--radius-s); font-size: 13.5px; box-shadow: var(--shadow-panel); z-index: 40; max-width: calc(100% - 32px); }
.toast.error { background: var(--st-rechazada); }

/* ---------------------------------------------------------------- movil */
.m-header, .m-daystrip, .m-list, .m-tabbar, .m-only { display: none; }

@media (max-width: 1100px) and (min-width: 768px) {
  .reject-body { flex-wrap: wrap; }
  .reject-side { flex: 1 1 100%; border-left: none; padding-left: 0; border-top: 1px solid var(--line); padding-top: 16px; }
}

@media (max-width: 767px) {
  body { font-size: 15px; }
  .login-screen { flex-direction: column; }
  .login-art { display: none; }
  .login-box-wrap { flex: 1; align-items: flex-start; padding-top: 12vh; }
  .login-brand-mobile { display: flex; }

  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 280px; flex-basis: auto; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-panel); }
  .sidebar.collapsed { width: 280px; }
  .sidebar .collapse-btn { display: none; }
  .drawer-scrim { position: fixed; inset: 0; background: rgba(20,24,42,.42); z-index: 25; }

  .topbar.desktop { display: none; }
  .m-header { display: block; background: var(--surface); padding: 12px 16px 12px; border-bottom: 1px solid var(--line); }
  .m-header-top { display: flex; align-items: center; gap: 12px; }
  .m-burger { width: 36px; height: 36px; border-radius: 9px; background: var(--primary-tint); color: var(--primary); border: none; display: flex; align-items: center; justify-content: center; }
  .m-title { font-family: var(--serif); font-weight: 700; font-size: 18px; flex: 1; display: flex; align-items: center; gap: 8px; }
  .m-title .dot { width: 8px; height: 8px; }
  .m-weeknav { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
  .m-weeknav .wk-label { font-size: 15px; font-weight: 700; }
  .m-daystrip { display: flex; gap: 4px; margin-top: 12px; }
  .m-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0; border-radius: 12px; border: none; background: transparent; position: relative; min-width: 0; }
  .m-day .dd { font-size: 10px; color: var(--ink-faint); font-weight: 700; }
  .m-day .dn { font-size: 15px; font-weight: 700; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
  .m-day .has { position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
  .m-day.selected { background: var(--primary); }
  .m-day.selected .dd { color: #B9C0DE; }
  .m-day.selected .dn { color: #fff; }
  .m-day.today:not(.selected) .dn { background: var(--accent-tint); color: var(--accent-ink); }
  .m-filters { display: flex; gap: 7px; margin-top: 12px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .m-filters .filter-tab { background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; padding: 6px 12px; }
  .m-filters .filter-tab.active { background: var(--primary); border-color: var(--primary); }
  .m-tz { margin-top: 10px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-soft); }

  .cal-wrap.desktop { display: none; }
  .m-list { display: block; flex: 1; overflow: auto; padding: 14px 16px 90px; background: var(--surface-2); }
  .m-date-label { font-size: 12px; font-weight: 700; color: var(--ink-faint); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .3px; }
  .m-card { display: block; width: 100%; text-align: left; background: var(--surface); border: none; border-left: 4px solid; border-radius: 13px; box-shadow: var(--shadow-card); padding: 12px 14px; margin-bottom: 10px; color: var(--ink); }
  .m-card.recibida, .m-card.confirmada, .m-card.opcional, .m-card.rechazada { background: var(--surface); color: var(--ink); }
  .m-card.bloqueada { color: var(--ink); }
  .field-pair { flex-direction: column; gap: 0; }
  .m-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
  .m-card .m-name { font-size: 15px; font-weight: 700; }
  .m-card.rechazada .m-name { text-decoration: line-through; color: var(--ink-soft); }
  .m-card .m-meta { font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; }
  .m-card .m-time { font-size: 14px; font-weight: 700; margin-top: 8px; display: flex; gap: 18px; }
  .m-card .m-time span { color: var(--ink-faint); font-size: 10.5px; margin-right: 4px; }
  .m-empty { text-align: center; color: var(--ink-faint); padding: 40px 0; font-size: 14px; }

  .m-tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 8px 0 calc(10px + env(safe-area-inset-bottom)); z-index: 10; }
  .m-tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--ink-faint); background: transparent; border: none; position: relative; }
  .m-tab.active { color: var(--primary); }
  .m-tab .count { position: absolute; top: -4px; left: calc(50% + 6px); font-size: 10px; background: var(--accent); color: #4A2E06; border-radius: 10px; padding: 0 6px; }

  .panel { width: 100%; animation: none; }
  .scrim.sheet .modal, .modal { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; margin: 0; }
  .modal.small { width: 100%; }
  .modal.wide { width: 100%; }
  .reject-side { border-left: none; padding-left: 0; border-top: 1px solid var(--line); padding-top: 16px; flex: none; }
  .modal-body { flex-direction: column; }
  .mini-cal { flex: none; }
  .page { padding: 16px 16px 90px; }
  .table.responsive thead { display: none; }
  .table.responsive tr { display: block; border-bottom: 1px solid var(--line); padding: 10px 14px; }
  .table.responsive td { display: block; border: none; padding: 3px 0; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv .k { margin-top: 8px; }
  .toast { bottom: 84px; }
}
