:root {
  color-scheme: light;
  --navy: #39344f;
  --navy-2: #514a6d;
  --teal: #8d83cf;
  --teal-bright: #f3a0bd;
  --teal-soft: #f0edfb;
  --rose: #f19bb0;
  --orange: #f5b76f;
  --green: #a6df99;
  --sky: #75cfe0;
  --pink: #e777c9;
  --purple: #9c8fd1;
  --lavender: #aaa5ef;
  --ink: #363244;
  --muted: #797588;
  --line: #e8e5ef;
  --canvas: #faf9fc;
  --white: #fff;
  --gold: #e8b96c;
  --red: #c94e55;
  --shadow: 0 12px 30px rgba(25, 55, 75, .06);
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

.review-queue-list { display: grid; gap: 14px; }
.review-queue-card .table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.review-queue-card .table-toolbar strong { color: #294558; font-size: 13px; }
.review-queue-card .table-toolbar > span { color: #82929e; font-size: 11px; white-space: nowrap; }
.review-queue-card .cell-secondary { margin-top: 4px; }
.review-queue-card .empty-state { padding: 22px 16px; }
.contract-review-details { margin-bottom: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdfd; color: #506777; font-size: 12px; }
.review-detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 16px; }
.review-detail-grid p { margin: 0; }
.review-detail-grid strong, .review-detail-grid span { display: block; }
.review-detail-grid strong { color: #8a98a2; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.review-detail-grid span { margin-top: 3px; color: #304d5e; }
.contract-review-details h4 { margin: 17px 0 7px; color: #304d5e; font-size: 12px; }
.contract-review-details ul { margin: 0; padding-left: 19px; line-height: 1.8; }
.review-document-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.advisor-progress-panel { margin-top: 16px; }
.advisor-progress-values { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; padding: 4px 18px 18px; }
.advisor-progress-values span, .advisor-progress-values strong { display: block; }
.advisor-progress-values span { color: #81929d; font-size: 10px; }
.advisor-progress-values strong { margin-top: 5px; color: #314f61; font-size: 16px; }
.agenda-session-progress { margin: 0 0 16px; padding: 15px; border: 1px solid #d5e8e3; border-radius: 12px; background: #f5fbf9; }
.agenda-session-progress h3 { margin: 0 0 11px; color: var(--navy); font-size: 14px; }
.agenda-session-progress-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.therapist-session-progress .agenda-session-progress-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
.agenda-session-progress-metrics > div { padding: 10px 12px; border: 1px solid #e0ece8; border-radius: 10px; background: #fff; }
.agenda-session-progress-metrics span, .agenda-session-progress-metrics strong { display: block; }
.agenda-session-progress-metrics span { color: var(--muted); font-size: 10px; }
.agenda-session-progress-metrics strong { margin-top: 4px; color: var(--teal); font-size: 22px; line-height: 1.2; }
.agenda-session-progress-total, .agenda-session-progress-note { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.agenda-session-progress-total { color: var(--navy); font-weight: 700; }
.agenda-phase-status { margin: 0 0 16px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #faf9ff; }
.agenda-phase-status-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.agenda-phase-status-heading h3 { margin: 0; color: var(--navy); font-size: 14px; }
.agenda-phase-status-heading strong { padding: 4px 10px; border-radius: 20px; background: var(--teal-soft); color: var(--navy); font-size: 12px; }
.agenda-phase-status-realizado { border-color: #b7d9ca; background: #f3faf6; }
.agenda-phase-status-realizado .agenda-phase-status-heading strong { background: #dcefe3; color: #285e43; }
.agenda-phase-status-pendiente { border-color: #ead9ad; background: #fffbf1; }
.agenda-phase-status-pendiente .agenda-phase-status-heading strong { background: #f7e9c5; color: #70551f; }
.agenda-phase-status-detail, .agenda-phase-status-note { margin: 9px 0 0; color: var(--navy); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.agenda-phase-status-note { color: var(--muted); font-size: 11px; }
.agenda-plan-correction { display: grid; gap: 10px; margin: 16px 0; padding: 15px; border: 1px solid #d9d2f3; border-radius: 12px; background: #faf9ff; }
.agenda-plan-correction h3 { margin: 0; color: var(--navy); font-size: 14px; }
.agenda-plan-correction > p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.agenda-cutoff-choice { display: grid; gap: 8px; padding: 12px; border: 1px solid #ead9a9; border-radius: 10px; background: #fffaf0; color: var(--navy); font-size: 11px; }
.agenda-cutoff-choice[hidden] { display: none; }
.agenda-cutoff-choice span { color: var(--muted); line-height: 1.5; }
.agenda-cutoff-choice label { display: flex; align-items: flex-start; gap: 8px; color: var(--ink); }
.agenda-cutoff-choice input { margin: 2px 0 0; }
.therapist-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.therapist-summary .panel { padding: 15px 18px; }
.therapist-summary span, .therapist-summary strong { display: block; }
.therapist-summary span { color: var(--muted); font-size: 12px; }
.therapist-summary strong { margin-top: 7px; color: var(--navy); font-size: 27px; line-height: 1.1; }
.therapist-upcoming { margin-top: 14px; padding: 16px 18px; }
.therapist-upcoming h2 { margin: 0 0 12px; color: var(--navy); font-size: 16px; }
.therapist-session-list { display: grid; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.therapist-session-link { display: grid; gap: 4px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.therapist-session-link:hover, .therapist-session-link:focus-visible { border-color: var(--teal); background: var(--teal-soft); }
.therapist-session-link strong { font-size: 12px; }
.therapist-session-link span, .therapist-session-link small { color: var(--muted); font-size: 11px; }
.global-search-wrap[hidden], .notification-button[hidden] { display: none !important; }
@media (max-width: 620px) { .therapist-summary { grid-template-columns: repeat(2,minmax(0,1fr)); } .therapist-summary .panel { padding: 12px; } }
.attendance-session-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfaff; }
.attendance-session-summary span, .attendance-session-summary strong { display: block; }
.attendance-session-summary span { color: var(--muted); font-size: 10px; }
.attendance-session-summary strong { margin-top: 4px; color: var(--navy); font-size: 12px; line-height: 1.45; }
.agenda-history-panel { margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.agenda-history-panel h3 { margin: 0 0 12px; color: var(--navy); font-size: 14px; }
.agenda-history-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.agenda-history-list li { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.agenda-history-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; color: var(--navy); font-size: 11px; }
.agenda-history-heading time, .agenda-history-list small { color: var(--muted); font-size: 10px; }
.agenda-history-list li p { margin: 7px 0 0; color: #5f5b70; font-size: 11px; line-height: 1.5; }
.agenda-history-list li .agenda-history-note { padding-top: 7px; border-top: 1px solid #f0edf5; }
.agenda-history-empty { margin: 0; color: var(--muted); font-size: 11px; }

@media (max-width: 650px) {
  .review-queue-card .table-toolbar { flex-direction: column; align-items: flex-start; }
  .review-detail-grid, .advisor-progress-values { grid-template-columns: 1fr; }
  .advisor-progress-values { padding-top: 0; }
  .attendance-session-summary { grid-template-columns: 1fr; }
  .flow-steps { grid-template-columns: 1fr; gap: 2px; }
  .flow-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .flow-table-card .table-toolbar { align-items: flex-start; flex-direction: column; }
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid rgba(141,131,207,.34); outline-offset: 2px; }
a { color: inherit; text-decoration: none; }

.login-screen[hidden], .app-shell[hidden] { display: none !important; }
.login-view[hidden] { display: none !important; }
.login-screen { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 12% 8%,#f3eefc 0,transparent 28%),radial-gradient(circle at 90% 92%,#fdeef5 0,transparent 26%),#faf9fc; }
.login-layout { width: min(1020px,100%); min-height: 620px; display: grid; grid-template-columns: 1fr .92fr; overflow: hidden; border: 1px solid #eeeaf3; border-radius: 25px; background: #fff; box-shadow: 0 25px 80px rgba(54,44,82,.12); }
.login-main { display: flex; flex-direction: column; justify-content: center; padding: 45px clamp(30px,6vw,76px); }
.login-logo { display: block; width: 154px; height: 90px; overflow: hidden; margin: 0 0 24px -8px; border-radius: 12px; }
.login-logo img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 50%; }
.login-eyebrow { color: #8b82c6; font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.login-main h1 { margin: 10px 0 0; color: #373247; font-family: Manrope,'Segoe UI',sans-serif; font-size: clamp(30px,4vw,42px); font-weight: 800; line-height: 1.12; letter-spacing: -.045em; }
.login-main h1 span { color: #8d83cf; }
.login-secondary-heading { margin: 10px 0 0; color: #373247; font-family: Manrope,'Segoe UI',sans-serif; font-size: clamp(25px,3.5vw,34px); font-weight: 800; line-height: 1.15; letter-spacing: -.04em; }
.login-intro { margin: 12px 0 26px; color: #817d8d; font-size: 13px; line-height: 1.5; }
.login-form { display: grid; gap: 9px; }
.login-form label { margin-top: 5px; color: #514d60; font-size: 11px; font-weight: 700; }
.login-form input { width: 100%; min-height: 46px; border: 1px solid #e4e0eb; border-radius: 10px; padding: 0 13px; color: #39354a; background: #fdfcfe; font-size: 13px; }
.login-form input::placeholder { color: #aaa6b4; }
.login-form input:focus { outline: 3px solid rgba(141,131,207,.18); border-color: #aaa1df; }
.password-control { position: relative; display: flex; align-items: center; width: 100%; }
.password-control > input { padding-right: 66px !important; }
.password-toggle { position: absolute; top: 50%; right: 7px; transform: translateY(-50%); min-height: 32px; padding: 0 7px; border: 0; border-radius: 6px; color: #6257a6; background: transparent; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.password-toggle:hover { background: rgba(141,131,207,.1); }
.password-toggle:focus-visible { outline: 2px solid #8d83cf; outline-offset: 1px; }
.login-submit { min-height: 46px; margin-top: 9px; border-radius: 10px; font-size: 13px; }
.login-submit:disabled { cursor: wait; opacity: .72; }
.login-message { min-height: 16px; margin: 2px 0 0; color: #a34a5f; font-size: 11px; line-height: 1.4; }
.login-message:empty { display: none; }
.login-text-button { justify-self: start; padding: 2px 0; border: 0; color: #796dbd; background: transparent; font-size: 11px; font-weight: 700; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.login-text-button:hover { color: #5d529c; }
.login-back-button { margin-top: 16px; }
.login-footnote { margin: 22px 0 0; color: #9b97a4; font-size: 10px; }
.login-aside { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; overflow: hidden; padding: 42px; background: linear-gradient(145deg,#f5f2ff 0%,#faf2f9 50%,#fff6ee 100%); }
.login-image-frame { z-index: 1; width: min(330px,100%); height: 290px; overflow: hidden; border: 1px solid rgba(255,255,255,.85); border-radius: 24px; background: #fff; box-shadow: 0 18px 38px rgba(90,77,137,.12); }
.login-image-frame img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 50%; }
.login-orbit { position: absolute; width: 250px; height: 250px; border: 2px solid rgba(170,165,239,.35); border-radius: 50%; }
.orbit-one { top: 46px; right: -80px; }
.orbit-two { bottom: 54px; left: -132px; width: 310px; height: 310px; }
.login-palette { z-index: 1; display: flex; align-items: center; justify-content: center; gap: 8px; }
.login-palette i { width: 25px; height: 25px; display: block; border-radius: 8px; transform: rotate(-8deg); box-shadow: 0 4px 8px rgba(60,50,86,.08); }
.login-palette i:nth-child(1) { background: var(--rose); }.login-palette i:nth-child(2) { background: var(--orange); }.login-palette i:nth-child(3) { background: var(--green); }.login-palette i:nth-child(4) { background: var(--sky); }.login-palette i:nth-child(5) { background: var(--pink); }.login-palette i:nth-child(6) { background: var(--purple); }
.login-aside-copy { z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.login-aside-copy strong { color: #534b70; font-family: Manrope,'Segoe UI',sans-serif; font-size: 13px; }
.login-aside-copy span { color: #928ba4; font-size: 10px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow: hidden; background: var(--navy); color: #e8f2f5; display: flex; flex-direction: column; padding: 24px 14px 16px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 24px; }
.brand-logo-frame { flex: 0 0 82px; width: 82px; height: 68px; overflow: hidden; border-radius: 12px; background: #fff; box-shadow: 0 4px 14px rgba(16,12,40,.12); }
.brand-logo-frame img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 50%; }
.brand-copy { display: flex; flex-direction: column; gap: 2px; }
.brand-copy strong { font-family: Manrope, sans-serif; font-size: 16px; letter-spacing: .13em; }
.brand-copy small { color: #c9c4d8; font-size: 10px; }
.workspace-chip { margin: 0 8px 22px; display: flex; align-items: center; gap: 8px; color: #c1d3dc; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); border-radius: 9px; padding: 9px 10px; font-size: 12px; }
.workspace-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(166,223,153,.15); }
#sidebar-nav { min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.28) transparent; }
#sidebar-nav::-webkit-scrollbar { width: 6px; }
#sidebar-nav::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(255,255,255,.28); }
.nav-group { margin-bottom: 19px; }
.nav-label { padding: 0 12px 8px; color: #809ba9; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 11px; min-height: 38px; margin: 2px 0; padding: 0 11px; border: 0; border-radius: 8px; color: #bfd0d9; background: transparent; text-align: left; font-size: 13px; transition: .15s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-item.active { color: #fff; background: #51496e; box-shadow: inset 3px 0 0 var(--teal-bright); }
.nav-item svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 17px; }
.nav-count { margin-left: auto; border-radius: 20px; background: rgba(243,160,189,.2); color: #ffd8e5; font-size: 10px; font-weight: 700; min-width: 19px; padding: 2px 6px; text-align: center; }
.sidebar-footer { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 14px 8px 2px; border-top: 1px solid rgba(255,255,255,.1); }
.user-avatar, .topbar-user { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; background: #eeeafb; color: #655c9f; font-size: 10px; font-weight: 700; }
.user-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.user-copy strong { font-size: 11px; font-weight: 600; }
.user-copy small { color: #8fa8b5; font-size: 10px; }
.sidebar-footer .icon-button { margin-left: auto; color: #a8bbc4; }

.main-column { min-width: 0; }
.topbar { height: 72px; position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 34px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: #8a9aa7; font-size: 12px; }
.breadcrumb strong { color: var(--ink); font-size: 13px; font-weight: 600; }
.crumb-separator { color: #c0ccd3; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.global-search-wrap { position: relative; }
.search-box { width: min(290px, 28vw); display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid #e7edf0; border-radius: 9px; background: #fafcfc; color: #90a0ab; }
.global-patient-results { position: absolute; z-index: 30; top: calc(100% + 7px); right: 0; width: min(380px, 84vw); max-height: 350px; overflow: auto; border: 1px solid #e1e9ec; border-radius: 11px; background: #fff; box-shadow: 0 16px 40px rgba(22,49,64,.18); }
.global-patient-results[hidden] { display: none; }
.global-patient-result { display: grid; width: 100%; gap: 4px; padding: 11px 13px; border: 0; border-bottom: 1px solid #edf1f3; background: #fff; color: #254356; text-align: left; cursor: pointer; }
.global-patient-result:last-child { border-bottom: 0; }
.global-patient-result:hover, .global-patient-result:focus-visible { outline: 0; background: #f3f8f8; }
.global-patient-result strong { font-size: 12px; }
.global-patient-result span { color: #82939d; font-size: 10px; }
.global-patient-empty { padding: 15px; color: #82939d; font-size: 12px; }
.search-box svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.search-box input { width: 100%; min-width: 40px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.search-box input::placeholder { color: #9aa8b1; }
kbd { border: 1px solid #e3e9ec; background: white; color: #98a7b0; border-radius: 4px; padding: 2px 4px; font-family: inherit; font-size: 9px; white-space: nowrap; }
.icon-button { position: relative; border: 0; background: transparent; color: #607584; padding: 5px; display: inline-grid; place-items: center; }
.icon-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.notification-dot { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border: 1px solid white; border-radius: 50%; background: #e89056; }
.topbar-user { width: 31px; height: 31px; font-size: 10px; }
.mobile-brand { display: none; font-family: Manrope, sans-serif; font-weight: 800; letter-spacing: .11em; align-items: center; gap: 7px; color: var(--navy); }
.mobile-brand img { width: 36px; height: 29px; object-fit: cover; object-position: center 50%; border-radius: 6px; }
.mobile-menu-button { display: none; width: 29px; height: 29px; border: 0; border-radius: 7px; background: transparent; color: #587181; padding: 4px; }
.mobile-menu-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.demo-notice { display: flex; align-items: center; gap: 9px; margin: 22px 34px 0; padding: 10px 12px; border: 1px solid #e7e2f2; border-radius: 9px; background: #f5f2fc; color: #625a7b; font-size: 11px; }
.demo-notice[hidden] { display: none !important; }
.demo-notice strong { color: #665c9d; }
.notice-icon { flex: 0 0 18px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: #e8e2fa; color: #6a60a7; font-size: 11px; font-family: serif; font-weight: 700; }
.notice-close { margin-left: auto; border: 0; color: #779996; background: transparent; font-size: 18px; line-height: 1; }
.preview-only-note { display: grid; gap: 4px; margin-bottom: 16px; padding: 12px 14px; border: 1px solid #e4def7; border-radius: 9px; background: #f7f5fc; color: #5d5682; font-size: 12px; }
.preview-only-note strong { font-size: 12px; }
.preview-only-note span { color: #77738a; }
.preview-list { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.preview-row { display: grid; grid-template-columns: minmax(110px,.38fr) minmax(0,1fr); gap: 12px; padding: 11px 13px; border-bottom: 1px solid var(--line); font-size: 12px; white-space: pre-line; }
.preview-row:last-child { border-bottom: 0; }
.preview-row strong { color: #597081; }
.preview-row span { color: #334f5f; overflow-wrap: anywhere; }
#page-content { max-width: 1500px; margin: 0 auto; padding: 28px 34px 48px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.page-heading h1 { margin: 0; font-family: Manrope, sans-serif; color: #183a50; font-size: clamp(22px, 2vw, 29px); line-height: 1.2; letter-spacing: -.035em; }
.page-heading p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.heading-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 700; transition: .15s ease; }
.button svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.button-primary { color: #fff; background: var(--teal); box-shadow: 0 4px 9px rgba(23,143,132,.16); }
.button-primary:hover { background: #786ebc; }
.button-secondary { color: #526b7b; background: white; border-color: #dfe7eb; }
.button-secondary:hover { background: #f8fbfb; border-color: #c8d7dc; }
.button-danger { color: #9e3940; background: #fff5f4; border-color: #f2d3d2; }
.button-small { min-height: 30px; padding: 0 10px; font-size: 11px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card, .panel, .table-card { background: var(--white); border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow); }
.stat-card { position: relative; overflow: hidden; padding: 17px 18px 15px; }
.stat-card::after { content: ""; position: absolute; width: 67px; height: 67px; right: -18px; top: -22px; border: 10px solid rgba(23,143,132,.07); border-radius: 50%; }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: #8494a1; font-size: 11px; font-weight: 600; }
.stat-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: #7166b1; background: #f0edfb; }
.stat-icon.gold { color: #aa7934; background: #fbf3e4; }
.stat-icon.blue { color: #4a77a1; background: #edf4fa; }
.stat-icon.rose { color: #ad5a62; background: #fbefef; }
.stat-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stat-value { display: flex; align-items: baseline; gap: 8px; margin-top: 12px; color: #193b51; font-family: Manrope, sans-serif; font-size: 26px; font-weight: 800; letter-spacing: -.04em; }
.stat-change { color: #288c7f; font-family: 'DM Sans',sans-serif; font-size: 10px; font-weight: 700; letter-spacing: 0; }
.stat-sub { margin-top: 4px; color: #95a2ad; font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(300px,.9fr); gap: 16px; }
.panel { overflow: hidden; }
.panel-header, .table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 16px 18px; border-bottom: 1px solid #edf1f3; }
.panel-title { margin: 0; font-family: Manrope,sans-serif; color: #213f53; font-size: 14px; font-weight: 700; }
.panel-subtitle { margin: 4px 0 0; color: #91a0aa; font-size: 10px; }
.text-link { border: 0; padding: 3px 0; background: transparent; color: var(--teal); font-size: 11px; font-weight: 700; }
.review-list { padding: 0 18px; }
.review-row { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 13px 0; border-bottom: 1px solid #f0f3f5; }
.review-row:last-child { border-bottom: 0; }
.record-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: #276e70; background: #e9f5f3; font-size: 10px; font-weight: 700; }
.record-avatar.gold { background: #fbf3e4; color: #9a7239; }
.record-avatar.blue { background: #edf3fb; color: #5579a0; }
.record-title { color: #304a5c; font-size: 11px; font-weight: 700; }
.record-meta { margin-top: 4px; color: #98a6af; font-size: 10px; }
.review-actions { display: flex; gap: 6px; }
.mini-action { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #e4ebed; border-radius: 7px; background: white; color: #6c818e; font-size: 14px; }
.mini-action:hover { border-color: #b9d9d4; color: var(--teal); background: #f4fbf9; }
.mini-action.approve:hover { color: #198579; }
.agenda-list { padding: 4px 18px 10px; }
.agenda-row { display: grid; grid-template-columns: 43px 4px minmax(0,1fr); gap: 11px; align-items: stretch; padding: 11px 0; }
.agenda-time { padding-top: 1px; color: #718391; font-size: 10px; font-weight: 700; }
.agenda-line { border-radius: 5px; background: var(--lavender); }
.agenda-line.gold { background: var(--orange); }
.agenda-line.blue { background: var(--sky); }
.agenda-details strong { display: block; color: #2d4a5d; font-size: 11px; }
.agenda-details small { display: block; margin-top: 4px; color: #91a0aa; font-size: 10px; }
.agenda-room { float: right; color: #9aa7af; font-size: 9px; font-weight: 500; }
.agenda-toolbar { margin-bottom: 14px; padding: 0; overflow: hidden; }
.agenda-subnav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 9px 12px; }
.agenda-subnav-tabs, .agenda-subnav-actions { display: flex; align-items: center; gap: 7px; }
.agenda-subnav .agenda-view-button { min-height: 34px; }
.agenda-subnav-actions .button { white-space: nowrap; }
.agenda-availability-note { margin-bottom: 14px; padding: 15px 18px; border-color: #e4e0f5; background: #faf9ff; }
.agenda-availability-note strong { color: #554d8e; font-size: 13px; }
.agenda-availability-note p { margin: 6px 0 0; color: #73818c; font-size: 11px; line-height: 1.55; }
.agenda-urgent-alert { margin-bottom: 14px; padding: 16px 18px; border: 2px solid #c9553e; background: #fff3ef; }
.agenda-urgent-alert > strong { color: #922f20; font-size: 16px; }
.agenda-urgent-alert p { margin: 8px 0 10px; color: #6c3e36; line-height: 1.5; }
.agenda-urgent-alert summary, .agenda-availability-note summary { margin-top: 9px; cursor: pointer; font-weight: 700; }
.agenda-urgent-alert .agenda-attendance-group { margin-top: 8px; padding: 9px 12px; border: 1px solid #efd5ce; border-radius: 9px; background: rgba(255,255,255,.58); }
.agenda-urgent-alert .agenda-attendance-group summary { margin: 0; color: #803b30; }
.agenda-urgent-alert .agenda-attendance-group > p { margin: 8px 0 4px; font-size: 12px; }
.agenda-urgent-list { max-height: 250px; margin: 10px 0 0; padding: 0; overflow: auto; list-style: none; }
.agenda-urgent-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid #efd5ce; }
.agenda-urgent-list li span { min-width: 0; overflow-wrap: anywhere; }
.agenda-urgent-list li small { display: block; margin-top: 3px; color: #934232; }
.agenda-urgent-list .button { flex: none; }
.agenda-availability-panel { margin-bottom: 14px; }
.agenda-availability-panel .table-wrap { max-height: 360px; overflow: auto; }
.agenda-availability-panel .table-wrap table { min-width: 600px; }
.agenda-availability-panel .empty-state { padding: 22px 16px; }
.agenda-availability-panel .table-wrap table { min-width: 900px; }
.agenda-availability-panel .panel-header { align-items: center; gap: 12px; }
.agenda-availability-panel .panel-header .button { flex: none; }
.availability-muted { color: #a64b54; font-size: 10px; font-weight: 600; }
.availability-needs-schedule { color: #a64b54; font-weight: 700; }
.agenda-availability-panel .row-actions { flex-wrap: wrap; gap: 5px; }
.agenda-availability-panel .row-actions .button { min-height: 29px; padding: 5px 8px; }
.agenda-availability-roster { min-width: 760px !important; }
.agenda-availability-roster td:nth-child(3) { color: #617887; line-height: 1.7; }
.availability-secondary-list { margin-bottom: 14px; padding: 14px 16px; }
.availability-secondary-list > summary { cursor: pointer; color: #405b6d; font-size: 12px; font-weight: 750; }
.availability-secondary-list > .field-hint { margin: 9px 0; }
.availability-secondary-list > .button { margin: 10px 0; }
.availability-secondary-list .table-wrap { max-height: 360px; overflow: auto; }
.modal-professional-availability { width: min(1020px,calc(100vw - 32px)); }
.availability-editor-note { display: grid; gap: 5px; margin-bottom: 14px; padding: 12px 14px; border: 1px solid #e3e0f3; border-radius: 9px; background: #faf9ff; }
.availability-editor-note strong { color: #403d68; font-size: 13px; }
.availability-editor-note span { color: #74828d; font-size: 11px; line-height: 1.5; }
.availability-week-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.availability-day { min-width: 0; padding: 12px; border: 1px solid #e4eaed; border-radius: 10px; background: #fbfcfd; }
.availability-day > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.availability-day h3 { margin: 0; color: #345166; font-size: 12px; }
.availability-day-slots { display: grid; gap: 8px; }
.availability-slot-row { display: grid; grid-template-columns: minmax(78px,.8fr) minmax(78px,.8fr) minmax(120px,1.3fr) auto; align-items: end; gap: 7px; }
.availability-slot-row .field { gap: 4px; }
.availability-slot-row .field label { font-size: 9px; }
.availability-slot-row .field input, .availability-slot-row .field select { min-height: 33px; padding: 6px 7px; font-size: 10px; }
.availability-slot-remove { min-height: 31px; margin-bottom: 1px; padding: 5px 8px; border: 1px solid #e3dcdc; border-radius: 7px; background: white; color: #9c4c50; font-size: 10px; cursor: pointer; }
.availability-empty-day { margin: 0; color: #9aa5ac; font-size: 10px; }
.agenda-subnav-tabs { flex-wrap: wrap; }
.agenda-availability-note .agenda-subnav-actions { margin-top: 12px; }
.flow-steps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.flow-step { display: grid; grid-template-columns: 28px minmax(0,1fr); align-items: start; gap: 10px; padding: 10px; }
.flow-step > span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: #f0edfb; color: #665b9e; font-size: 12px; font-weight: 800; }
.flow-step strong { color: #394459; font-size: 12px; }
.flow-step p { margin: 5px 0 0; color: #7b8290; font-size: 11px; line-height: 1.5; }
.flow-summary-grid { grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); gap: 12px; margin: 14px 0; }
.flow-summary-grid .stat-card { min-width: 0; }
.flow-table-card .table-toolbar { align-items: center; }
.flow-table-card .table-toolbar strong { color: #394459; font-size: 13px; }
.flow-table-card .table-wrap { max-height: min(68vh,760px); overflow: auto; }
.flow-table-card table { min-width: 1120px; }
.flow-table-card td { max-width: 260px; white-space: normal; line-height: 1.45; vertical-align: top; }
.flow-table-card .cell-secondary { display: block; margin-top: 4px; color: #8d96a3; font-size: 10px; }
.agenda-balance-review { color: #8b5d15 !important; font-weight: 700; }
.agenda-event.needs-balance-review { border-color: #f0dcb3; border-left-color: #d6a44c; background: #fff8eb; cursor: default; }
.recurrence-slot { margin: 10px 0 14px; padding: 12px; border: 1px solid #e4e9ed; border-radius: 12px; background: #fbfcfd; }
.recurrence-remove { margin: 0 0 0 4px; }
.goal-progress { height: 8px; margin: 14px 0 6px; overflow: hidden; border-radius: 99px; background: #eeeaf8; }
.goal-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#8d82c9,#56b9a1); transition: width .25s ease; }
.advisor-progress-panel > small { color: var(--muted); font-size: 11px; }
.manager-kpi-panel { margin-top: 16px; }
.agenda-toolbar-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 16px; border-bottom: 1px solid #edf1f3; }
.agenda-date-control, .agenda-view-switch { display: flex; align-items: center; gap: 7px; }
.agenda-date-control h2 { min-width: 210px; margin: 0 8px; color: #28465a; font-family: Manrope,sans-serif; font-size: 14px; text-transform: capitalize; }
.agenda-view-switch { padding: 3px; border: 1px solid #e6ebef; border-radius: 8px; background: #f7f9fa; }
.agenda-view-button { min-height: 29px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: #718391; font-size: 11px; font-weight: 700; }
.agenda-view-button.active { background: white; color: #635a9b; box-shadow: 0 1px 4px rgba(28,52,68,.13); }
.agenda-filters { display: grid; grid-template-columns: repeat(4,minmax(120px,1fr)) minmax(150px,1.3fr) auto; align-items: center; gap: 8px; padding: 12px 16px; }
.agenda-filters .filter-select, .agenda-patient-filter { width: 100%; min-height: 34px; }
.agenda-patient-filter { border: 1px solid #e3e9ec; border-radius: 7px; padding: 0 10px; color: #526b7b; background: white; font-size: 11px; }
.agenda-patient-filter::placeholder { color: #9aa7af; }
.agenda-result-count { color: #91a0aa; font-size: 10px; white-space: nowrap; }
.agenda-calendar { overflow: hidden; }
.agenda-calendar-scroll { max-width: 100%; overflow: auto; }
.agenda-availability-key { display: flex; align-items: center; gap: 7px; min-height: 32px; padding: 6px 12px; border-bottom: 1px solid #eaf0ef; color: #627d79; font-size: 10px; }
.agenda-availability-key-swatch { width: 13px; height: 13px; flex: none; border: 1px solid #8dcdb9; border-left: 3px solid #42a98f; border-radius: 3px; background: #e8f7f1; }
.agenda-time-grid { display: grid; min-width: max-content; grid-auto-rows: auto; }
.agenda-grid-corner, .agenda-grid-header { position: sticky; top: 0; z-index: 3; min-height: 48px; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 7px 9px; border-bottom: 1px solid #e8eef0; background: #fbfcfc; }
.agenda-grid-corner { left: 0; z-index: 4; border-right: 1px solid #e8eef0; }
.agenda-grid-header { text-align: center; border-left: 1px solid #edf1f3; }
.agenda-grid-header strong { color: #405b6b; font-size: 10px; }
.agenda-grid-header span { color: #96a3ab; font-size: 9px; }
.agenda-time-axis { position: relative; height: 918px; border-right: 1px solid #e8eef0; background: #fbfcfc; }
.agenda-time-axis span { position: absolute; right: 7px; transform: translateY(-50%); color: #8d9ba4; font-size: 9px; font-weight: 600; }
.agenda-day-lane { position: relative; height: 918px; overflow: hidden; border-right: 1px solid #edf1f3; background: repeating-linear-gradient(to bottom,transparent 0,transparent 53px,#e9eef0 53px,#e9eef0 54px); }
.agenda-availability-free-slot { position: absolute; z-index: 0; left: 3px; right: 3px; display: flex; align-items: flex-start; overflow: hidden; padding: 3px 5px; border: 1px solid rgba(68,160,137,.26); border-left: 3px solid #4baa91; border-radius: 4px; background: repeating-linear-gradient(135deg,rgba(70,177,145,.13) 0,rgba(70,177,145,.13) 7px,rgba(70,177,145,.07) 7px,rgba(70,177,145,.07) 14px); color: #287863; pointer-events: none; }
.agenda-availability-free-slot span { overflow: hidden; font-size: 9px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.agenda-lane-empty { position: sticky; top: 42px; padding: 18px 8px; color: #a2adb4; text-align: center; font-size: 10px; pointer-events: none; }
.agenda-event { position: absolute; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; overflow: hidden; padding: 5px 7px; border: 1px solid #d8d3ee; border-left: 3px solid #8d83cf; border-radius: 6px; background: #f4f1fc; color: #44596a; text-align: left; font-family: inherit; cursor: pointer; }
.agenda-event:hover { z-index: 2; filter: brightness(.985); box-shadow: 0 2px 8px rgba(42,58,75,.12); }
.agenda-event strong { max-width: 100%; overflow: hidden; color: #304b5d; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.agenda-event > span:not(.agenda-event-time), .agenda-event small { max-width: 100%; overflow: hidden; color: #6d7f8b; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.agenda-event .agenda-event-time { color: #5d558f; font-size: 9px; font-weight: 800; }
.agenda-event em { display: none; font-size: 8px; font-style: normal; }
.agenda-event.status-scheduled { border-color: #d4e3f1; border-left-color: #6b98c0; background: #eef5fb; }
.agenda-event.status-approved { border-color: #cbe6dd; border-left-color: #48a18c; background: #edf8f4; }
.agenda-event.status-pending { border-color: #f0dfbc; border-left-color: #d5a54e; background: #fff8e9; }
.agenda-event.status-returned, .agenda-event.status-rejected { border-color: #efd3d4; border-left-color: #c9797d; background: #fff1f1; }
.agenda-month-calendar { overflow: hidden; }
.agenda-month-grid { display: grid; grid-template-columns: repeat(7,minmax(105px,1fr)); }
.agenda-month-weekday { padding: 10px 8px; border-right: 1px solid #edf1f3; border-bottom: 1px solid #e7ecef; background: #fbfcfc; color: #82929d; text-align: center; font-size: 10px; font-weight: 700; text-transform: capitalize; }
.agenda-month-day { min-height: 128px; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 8px; border: 0; border-right: 1px solid #edf1f3; border-bottom: 1px solid #edf1f3; background: white; color: #5f7482; text-align: left; font-family: inherit; cursor: pointer; }
.agenda-month-day:hover { background: #fbfaff; }
.agenda-month-day.outside { background: #fafbfc; color: #bac3c9; }
.agenda-month-day.today .agenda-month-number { color: #fff; background: #8d83cf; }
.agenda-month-number { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; font-size: 10px; font-weight: 700; }
.agenda-month-count { color: #98a5ad; font-size: 8px; }
.agenda-month-event { overflow: hidden; padding: 3px 5px; border-radius: 4px; background: #f1eefb; color: #5a547f; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.agenda-month-event.status-scheduled { background: #eef5fb; color: #4e759b; }
.agenda-month-event.status-approved { background: #edf8f4; color: #1d7d70; }
.agenda-month-event.status-pending { background: #fff8e9; color: #98743e; }
.agenda-month-event.status-returned, .agenda-month-event.status-rejected { background: #fff1f1; color: #a64b54; }
.agenda-month-event b { font-size: 8px; }
.agenda-year-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.agenda-year-month { min-width: 0; padding: 12px; border: 1px solid #e7ecef; border-radius: 10px; background: white; }
.agenda-year-month > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.agenda-year-month > header button { padding: 0; border: 0; background: transparent; color: #405b6b; font: 700 12px Manrope,sans-serif; text-transform: capitalize; cursor: pointer; }
.agenda-year-month > header span { color: #91a0aa; font-size: 9px; white-space: nowrap; }
.agenda-year-calendar { display: grid; grid-template-columns: repeat(7,minmax(23px,1fr)); gap: 2px; }
.agenda-year-weekday { display: grid; place-items: center; height: 20px; color: #98a5ad; font-size: 8px; font-weight: 700; text-transform: uppercase; }
.agenda-year-day { position: relative; display: grid; place-items: center; min-width: 0; height: 27px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #526b7b; font-family: inherit; font-size: 9px; font-weight: 500; cursor: pointer; }
.agenda-year-day.outside { cursor: default; color: transparent; }
.agenda-year-day.has-sessions { border-color: #d8d3ee; background: #f4f1fc; color: #5a547f; font-weight: 800; }
.agenda-year-day.has-sessions.status-approved { border-color: #cbe6dd; background: #edf8f4; color: #1d7d70; }
.agenda-year-day.has-sessions.status-pending { border-color: #f0dfbc; background: #fff8e9; color: #98743e; }
.agenda-year-day.has-sessions.status-scheduled { border-color: #d4e3f1; background: #eef5fb; color: #4e759b; }
.agenda-year-day.has-sessions.status-justified { border-color: #d9e0e5; background: #f2f5f7; color: #657784; }
.agenda-year-day.has-sessions.status-unmarked { border-color: #e4e8eb; background: #f7f8f9; color: #84919a; }
.agenda-year-day.today { outline: 2px solid #8d83cf; outline-offset: -2px; }
.agenda-year-day small { position: absolute; right: 1px; top: 0; min-width: 10px; height: 10px; display: grid; place-items: center; border-radius: 6px; background: rgba(50,67,82,.12); font-size: 7px; line-height: 1; }
.agenda-date-only-panel { margin-top: 14px; overflow: hidden; }
.agenda-history-list { display: grid; gap: 0; }
.agenda-history-entry { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid #edf1f3; border-left: 3px solid #a9b4bb; }
.agenda-history-entry.status-approved { border-left-color: #48a18c; }
.agenda-history-entry.status-pending { border-left-color: #d5a54e; }
.agenda-history-entry.status-justified { border-left-color: #82929d; }
.agenda-history-entry.status-unmarked { border-left-color: #b9c2c8; }
.agenda-history-entry div:first-child { min-width: 0; display: grid; gap: 3px; }
.agenda-history-entry strong { overflow: hidden; color: #304b5d; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.agenda-history-entry span, .agenda-history-status small { color: #82929d; font-size: 9px; }
.agenda-history-status { display: grid; flex: 0 0 auto; gap: 2px; text-align: right; }
.agenda-history-status b { color: #526b7b; font-size: 10px; }
.agenda-month-more { color: #7166b1; font-size: 8px; font-weight: 700; }
.contract-start-card { max-width: 760px; padding: 22px; color: #647886; font-size: 13px; line-height: 1.65; }
.contract-start-card h2 { margin: 0 0 8px; color: #28465a; font-family: Manrope,sans-serif; font-size: 16px; }
.contract-start-card p { margin: 8px 0; }
.dashboard-bottom { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,.9fr); gap: 16px; margin-top: 16px; }
.bar-chart { height: 136px; display: flex; align-items: flex-end; gap: 12px; padding: 15px 20px 9px; }
.bar-item { height: 100%; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; }
.bar { position: relative; width: min(25px,70%); min-height: 4px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg,#c5bdf7,#8579c4); }
.bar.secondary { background: #dcebe8; }
.bar-label { color: #9ba8b0; font-size: 9px; }
.collection-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; }
.collection-total { color: #183a50; font-family: Manrope,sans-serif; font-size: 24px; font-weight: 800; letter-spacing: -.04em; }
.collection-total small { display: block; margin-top: 4px; color: #8d9ca7; font-family: 'DM Sans',sans-serif; font-size: 10px; font-weight: 500; letter-spacing: 0; }
.collection-ring { width: 65px; height: 65px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(#8d83cf 0 74%,#eeeaf7 74% 100%); }
.collection-ring span { width: 47px; height: 47px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: #746ab4; font-size: 11px; font-weight: 800; }

.table-card { overflow: hidden; }
.table-toolbar { padding: 12px 16px; border-bottom: 0; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; }
.filter-select { min-height: 32px; border: 1px solid #e3e9ec; border-radius: 7px; padding: 0 9px; color: #617687; background: #fff; font-size: 11px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
thead { background: #f8fafb; }
th { height: 37px; padding: 0 15px; color: #8998a2; border-top: 1px solid #edf1f3; border-bottom: 1px solid #edf1f3; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
td { height: 52px; padding: 0 15px; border-bottom: 1px solid #f0f3f4; color: #526878; font-size: 11px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdfd; }
.cell-primary { color: #2b4759; font-weight: 700; }
.cell-secondary { display: block; margin-top: 4px; color: #99a6ae; font-size: 9px; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; padding: 5px 8px; font-size: 9px; font-weight: 700; }
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-pending { color: #98743e; background: #fbf3e3; }
.status-approved, .status-active, .status-paid { color: #1d7d70; background: #e6f5f1; }
.status-returned { color: #a35c49; background: #fbefea; }
.status-rejected, .status-overdue, .status-inactive { color: #a64b54; background: #fbeeee; }
.status-scheduled { color: #4e759b; background: #edf4fa; }
.status-open { color: #626e96; background: #f0f0fa; }
.row-menu { border: 0; background: transparent; color: #81929d; font-size: 18px; line-height: 1; }
.empty-state { padding: 42px 18px; text-align: center; color: #8b9aa4; font-size: 12px; }
.empty-state strong { display: block; margin-bottom: 6px; color: #445e70; font-size: 14px; }
.module-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.module-card { display: flex; align-items: flex-start; gap: 12px; padding: 17px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: var(--shadow); }
.module-card .stat-icon { flex: 0 0 31px; }
.user-card-copy { min-width: 0; flex: 1; }
.module-card h3 { margin: 1px 0 5px; color: #28465a; font-family: Manrope,sans-serif; font-size: 13px; }
.module-card p { margin: 0; color: #8a9aa5; font-size: 10px; line-height: 1.5; }
.module-card small { display: block; margin-top: 11px; color: #26877c; font-size: 10px; font-weight: 700; }
.user-card-status { margin: 8px 0 0 !important; }
.user-card-login { display: block; margin-top: 8px; color: #718594; font-size: 11px; overflow-wrap: anywhere; }
.user-card-login strong { color: #554a9a; }
.user-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.user-card-actions .button { margin: 0; }
.table-footer { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; color: #97a4ac; border-top: 1px solid #eef2f4; font-size: 10px; }
.pagination { display: flex; gap: 4px; }
.pagination button { width: 27px; height: 27px; border: 1px solid #e3eaed; border-radius: 6px; color: #6c818e; background: white; font-size: 10px; }
.pagination button.current { color: white; border-color: var(--teal); background: var(--teal); }
.pagination .page-current { min-width: 38px; display: grid; place-items: center; color: #6c818e; font-size: 10px; }
.pagination button:disabled { opacity: .45; cursor: default; }

.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(9,28,42,.55); backdrop-filter: blur(3px); }
.modal { width: min(680px,100%); max-height: min(90vh,850px); overflow: auto; border-radius: 14px; background: white; box-shadow: 0 24px 80px rgba(4,23,38,.25); }
.modal-header { display: flex; justify-content: space-between; gap: 15px; padding: 20px 22px 15px; border-bottom: 1px solid #edf1f3; }
.modal-header h2 { margin: 0; color: #193c52; font-family: Manrope,sans-serif; font-size: 18px; }
.modal-header p { margin: 5px 0 0; color: #8a9aa4; font-size: 11px; }
.modal-close { width: 30px; height: 30px; border: 0; border-radius: 7px; background: #f3f6f7; color: #6d818e; font-size: 18px; }
.modal-body { padding: 18px 22px 21px; }
.user-credentials-card { display: grid; gap: 8px; padding: 16px; border: 1px solid #dedaf4; border-radius: 11px; background: #faf9ff; }
.user-credentials-card label { color: #566b7b; font-size: 11px; font-weight: 700; }
.user-credentials-card input { width: 100%; min-height: 42px; border: 1px solid #e0e5e9; border-radius: 8px; padding: 8px 11px; color: #293f50; background: white; }
.user-credentials-card .password-control { margin-bottom: 3px; }
.user-credentials-card p { margin: 4px 0 0; color: #788894; font-size: 11px; line-height: 1.5; }
.user-copy-credentials { width: 100%; margin-top: 12px; }
.modal-patient-profile { width: min(760px,100%); }
.patient-profile-card, .patient-operational-card { margin-bottom: 14px; padding: 16px; border: 1px solid #e2e9ec; border-radius: 11px; background: #fbfdfd; }
.patient-profile-card h3, .patient-operational-card h3 { margin: 0 0 13px; color: #27475a; font-size: 13px; }
.patient-profile-details, .patient-operational-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.patient-profile-details > div, .patient-operational-grid > div { display: grid; gap: 4px; min-width: 0; }
.patient-profile-details span, .patient-operational-grid span { color: #83939d; font-size: 10px; }
.patient-profile-details strong, .patient-operational-grid strong { color: #2f4656; font-size: 12px; overflow-wrap: anywhere; }
.patient-operational-grid .patient-upcoming { grid-column: 1 / -1; }
.patient-operational-card > p, .patient-readonly-note { margin: 12px 0 0; color: #81919a; font-size: 10px; line-height: 1.5; }
.patient-name-link { padding: 0; border: 0; background: transparent; color: #284e68; font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.patient-name-link:hover, .patient-name-link:focus-visible { color: #655bb0; text-decoration: underline; outline: 0; }
.global-patient-choice-list { display: grid; gap: 7px; }
.global-patient-choice-list .global-patient-result { border: 1px solid #e7edef; border-radius: 8px; }
.modal-contract-form { width: min(820px,100%); }
.modal-contract-form .modal-body { display: grid; gap: 13px; }
.modal-contract-form .form-section-title { margin: 0; color: #203e52; font-size: 15px; letter-spacing: 0; text-transform: none; }
.contract-form-section { display: grid; gap: 15px; padding: 17px; border: 1px solid #e2e9ec; border-radius: 12px; background: #fff; box-shadow: 0 4px 14px rgba(31,65,82,.035); }
.contract-form-section > p { margin: -8px 0 0; color: #728391; font-size: 12px; line-height: 1.5; }
.contract-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.contract-section-heading > div { display: grid; gap: 5px; }
.contract-section-heading p { margin: 0; color: #728391; font-size: 11px; }
.modal-contract-form .field label { color: #42596a; font-size: 11px; }
.modal-contract-form .field input:not([type="checkbox"]), .modal-contract-form .field select, .modal-contract-form .field textarea { min-height: 43px; border-radius: 9px; padding: 10px 12px; font-size: 13px; }
.modal-contract-form .field textarea { min-height: 82px; }
.contract-financing { display: grid; gap: 11px; padding: 14px; border: 1px solid #d9e9e5; border-radius: 10px; background: #f6fbfa; }
.contract-financing[hidden] { display: none !important; }
.contract-financing h4 { margin: 0; color: #3f5a6b; font-size: 12px; }
.contract-draft-button { width: 100%; min-height: 52px; margin: 1px 0 0; border-color: #0f796e; background: #0f796e; color: #fff; }
.contract-draft-button:hover { border-color: #0b6c62; background: #0b6c62; }
.contract-draft-button.is-preview { border-color: #8d83cf; background: #8d83cf; }
.contract-draft-button:disabled { opacity: .72; cursor: default; }
.beneficiary-list { display: grid; gap: 11px; }
.modal-contract-form .beneficiary-card { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: end; gap: 12px; padding: 15px; border: 1px solid #cfe4e0; border-radius: 11px; background: #f6fbfb; }
.beneficiary-card-heading { grid-column: 1 / -1; display: flex; align-items: center; gap: 9px; min-height: 25px; }
.beneficiary-card-heading strong { color: #24675e; font-size: 14px; }
.principal-badge { margin-left: auto; padding: 5px 10px; border-radius: 999px; background: #d7f6e8; color: #267456; font-size: 10px; font-weight: 800; }
.beneficiary-card .field { min-width: 0; }
.beneficiary-card .field.full { grid-column: 1 / -1; }
.beneficiary-card .remove-beneficiary { width: 29px; height: 29px; margin-left: auto; border-radius: 7px; }
.contract-optional-payment { padding: 13px 15px; border: 1px solid #e2e9ec; border-radius: 11px; background: #fbfcfc; }
.contract-optional-payment summary { color: #415d6d; font-size: 12px; font-weight: 800; cursor: pointer; }
.contract-optional-payment > p { margin: 10px 0; color: #8998a1; font-size: 10px; line-height: 1.45; }
.contract-optional-payment[open] .form-grid { margin-top: 12px; }
.signature-gate { background: #fbfcfd; }
.signature-gate > p { margin: -5px 0 0; color: #77858f; font-size: 12px; line-height: 1.55; }
.signature-gate-card { display: grid; gap: 9px; padding: 17px; border-radius: 12px; background: white; box-shadow: 0 4px 18px rgba(33,53,66,.05); opacity: .58; }
.signature-gate-card h4 { margin: 0; color: #6f7b82; font-size: 16px; }
.signature-gate-card > span, .signature-gate-options span { color: #929da4; font-size: 11px; line-height: 1.5; }
.signature-gate-canvas { height: 150px; border: 2px dashed #bdc6cd; border-radius: 10px; background: white; }
.signature-gate-options { display: grid; gap: 5px; padding: 12px; border: 1px solid #e1e8eb; border-radius: 10px; background: #f8fafb; }
.signature-capture-section { gap: 14px; }
.signature-capture-section > p { margin: -7px 0 0; color: #8a969e; font-size: 12px; line-height: 1.5; }
.signature-capture-card { display: grid; gap: 12px; padding: 17px; border-radius: 14px; background: #fff; box-shadow: 0 4px 18px rgba(33,53,66,.05); }
.signature-capture-card > h4 { margin: 0; color: #6f7b82; font-size: 18px; }
.signature-capture-card > span { color: #929da4; font-size: 12px; line-height: 1.5; }
.draft-drive-link { color: #6255aa; font-size: 12px; font-weight: 700; }
.signature-save-button { min-height: 48px; }
.signature-clear-button { justify-self: start; }
.image-consent-card { display: grid; gap: 10px; padding: 14px; border: 1px solid #e1e8eb; border-radius: 10px; background: #f8fbfc; }
.image-consent-card h4 { margin: 0; color: #596f7d; font-size: 13px; }
.image-consent-card p { margin: 0; color: #8b99a1; font-size: 11px; line-height: 1.5; }
.signature-options { display: flex; flex-wrap: wrap; gap: 22px; }
.signature-options label { display: inline-flex; align-items: center; gap: 7px; color: #536c7b; font-size: 12px; font-weight: 700; }
.signature-options input { accent-color: #8d83cf; }
.form-section-title { margin: 0 0 11px; color: #3f5a6b; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field[hidden] { display: none !important; }
.field.full { grid-column: 1 / -1; }
.field label { color: #597081; font-size: 10px; font-weight: 700; }
.field input[type="checkbox"] { width: 14px; height: 14px; min-height: 14px; margin: 0; padding: 0; accent-color: #8d83cf; }
#manager-sales-toggle label { display: flex; align-items: center; gap: 8px; }
.field input:not([type="checkbox"]), .field select, .field textarea { width: 100%; min-height: 37px; border: 1px solid #dfe7eb; border-radius: 7px; padding: 8px 10px; color: #304b5d; background: white; font-size: 11px; }
.field textarea { min-height: 72px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #adb8bf; }
.field-hint { color: #9aa7af; font-size: 9px; line-height: 1.45; }
.field-hint-warning { color: #9a5b0a; }
.form-divider { margin: 18px 0 15px; border: 0; border-top: 1px solid #edf1f3; }
.beneficiary-list { display: grid; gap: 8px; }
.beneficiary-card { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)) auto; align-items: end; gap: 8px; padding: 10px; border: 1px solid #e6edef; border-radius: 8px; background: #fbfdfd; }
.beneficiary-card .field { min-width: 0; }
.beneficiary-card .field.full { grid-column: 1 / -1; }
.form-grid.full { grid-column: 1 / -1; }
.remove-beneficiary { width: 30px; height: 37px; border: 1px solid #e6edef; border-radius: 7px; background: white; color: #8f6d6d; font-size: 15px; }
.signature-intro { display: grid; gap: 7px; margin-bottom: 16px; color: #617686; font-size: 11px; }
.signature-intro p { margin: 0; }
#contract-signature-canvas { display: block; width: 100%; height: 300px; border: 2px dashed #c6cdd3; border-radius: 10px; background: #fff; touch-action: none; }
.consent-check { grid-column: 1 / -1; display: flex; align-items: flex-start; gap: 9px; color: #597081; font-size: 11px; line-height: 1.5; }
.consent-check input { margin-top: 1px; accent-color: #8d83cf; }
.upload-zone { border: 1px dashed #b6d2cf; border-radius: 8px; padding: 13px; background: #f6fbfa; }
.upload-zone input { min-height: 25px; padding: 0; border: 0; background: transparent; }
.upload-zone .field-hint { margin-top: 6px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 18px; border-top: 1px solid #edf1f3; }
.file-name { display: none; color: #7166b1; font-size: 10px; font-weight: 700; }
.file-name.visible { display: block; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.user-toggle { margin-top: 10px; }
.contract-summary { color: #627787; font-size: 12px; line-height: 1.55; }
.contract-summary p { margin: 8px 0; }
.contract-summary a { color: #756bb2; font-weight: 700; text-decoration: none; }
.contract-summary a:hover { text-decoration: underline; }
.button:disabled, .mini-action:disabled { cursor: wait; opacity: .6; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 30; max-width: min(420px,calc(100% - 40px)); display: flex; align-items: center; gap: 10px; padding: 12px 15px; border: 1px solid #c9e3de; border-radius: 9px; background: white; color: #38645f; box-shadow: 0 12px 35px rgba(18,54,70,.16); font-size: 12px; animation: slide-in .2s ease; }
.toast-mark { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: #eeeafb; color: #746ab4; font-size: 12px; font-weight: 800; }
@keyframes slide-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1120px) {
  .login-layout { min-height: 580px; }
  .login-main { padding-left: 38px; padding-right: 38px; }
  .app-shell { grid-template-columns: 220px minmax(0,1fr); }
  .sidebar { padding-left: 10px; padding-right: 10px; }
  .topbar { padding: 0 24px; }
  #page-content { padding-left: 24px; padding-right: 24px; }
  .demo-notice { margin-left: 24px; margin-right: 24px; }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .login-screen { padding: 14px; }
  .login-layout { width: min(540px,100%); min-height: auto; grid-template-columns: 1fr; }
  .login-main { padding: 28px clamp(22px,7vw,48px); }
  .login-logo { width: 135px; height: 76px; margin-bottom: 18px; }
  .login-aside { min-height: 265px; gap: 14px; padding: 22px; }
  .login-image-frame { width: min(255px,78%); height: 165px; border-radius: 17px; }
  .login-orbit { width: 185px; height: 185px; }
  .orbit-two { width: 225px; height: 225px; }
  .login-palette i { width: 19px; height: 19px; border-radius: 6px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 10; top: 0; left: 0; width: min(280px,86vw); height: 100dvh; transform: translateX(-102%); transition: transform .22s ease; box-shadow: 15px 0 40px rgba(6,28,42,.2); }
  .sidebar.open { transform: translateX(0); }
  .mobile-brand { display: flex; margin-right: auto; }
  .mobile-menu-button { display: inline-grid; place-items: center; }
  .breadcrumb { display: none; }
  .topbar { height: 62px; padding: 0 16px; gap: 12px; }
  .topbar-actions { gap: 9px; }
  .search-box { width: min(210px,44vw); }
  .search-box kbd { display: none; }
  .notification-button { display: none; }
  .demo-notice { margin: 14px 14px 0; align-items: flex-start; font-size: 10px; }
  #page-content { padding: 22px 14px 36px; }
  .dashboard-grid, .dashboard-bottom { grid-template-columns: 1fr; }
  .module-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 13px; }
  .agenda-toolbar-top { align-items: flex-start; flex-direction: column; }
  .agenda-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .agenda-result-count { justify-self: end; }
}
@media (max-width: 540px) {
  .login-screen { padding: 0; }
  .login-layout { min-height: 100dvh; border: 0; border-radius: 0; }
  .login-main { padding: 24px 24px 30px; }
  .login-aside { min-height: 210px; }
  .login-image-frame { height: 123px; width: 215px; }
  .login-aside-copy span { font-size: 9px; }
  .topbar { gap: 8px; }
  .global-search-wrap { min-width: 0; }
  .search-box { width: 38vw; padding: 7px; gap: 5px; }
  .search-box input { font-size: 11px; }
  .topbar-user { width: 28px; height: 28px; }
  .stats-grid { gap: 9px; }
  .stat-card { padding: 13px; }
  .stat-value { font-size: 22px; }
  .module-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .modal-backdrop { padding: 10px; align-items: end; }
  .modal { max-height: 94dvh; border-radius: 14px 14px 7px 7px; }
  .modal-header, .modal-body { padding-left: 16px; padding-right: 16px; }
  .patient-profile-details, .patient-operational-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .modal-footer { padding-left: 16px; padding-right: 16px; }
  .modal-contract-form .beneficiary-card { grid-template-columns: 1fr; }
  .modal-contract-form .form-grid { grid-template-columns: 1fr; gap: 16px; }
  .modal-contract-form .field { gap: 8px; }
  .modal-contract-form .field label { font-size: 13px; }
  .modal-contract-form .field input:not([type="checkbox"]), .modal-contract-form .field select, .modal-contract-form .field textarea { min-height: 56px; padding: 12px 14px; font-size: 16px; }
  .modal-contract-form .field textarea { min-height: 104px; }
  .modal-contract-form .beneficiary-card .field.full { grid-column: 1 / -1; }
  .form-grid.full { grid-template-columns: 1fr; }
  .contract-form-section { gap: 17px; padding: 16px; }
  .signature-gate-canvas { height: 270px; }
  .signature-capture-card { gap: 13px; padding: 16px; }
  #contract-signature-canvas { height: 290px; }
  .contract-draft-button { min-height: 56px; font-size: 15px; }
  .beneficiary-card { grid-template-columns: 1fr; }
  .beneficiary-card-heading, .beneficiary-card .field.full { grid-column: auto; }
  .beneficiary-card-heading { grid-column: 1 / -1; }
  #contract-signature-canvas { height: 210px; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .table-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .agenda-toolbar-top { gap: 9px; padding: 12px; }
  .agenda-subnav { align-items: stretch; flex-direction: column; padding: 10px; }
  .agenda-subnav-tabs, .agenda-subnav-actions { width: 100%; }
  .agenda-subnav-tabs .agenda-view-button, .agenda-subnav-actions .button { flex: 1; }
  .agenda-subnav-actions { flex-wrap: wrap; }
  .agenda-date-control { width: 100%; gap: 4px; }
  .agenda-date-control h2 { min-width: 0; flex: 1; margin: 0 4px; font-size: 12px; }
  .agenda-view-switch { width: 100%; }
  .agenda-view-button { flex: 1; }
  .agenda-filters { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; padding: 10px; }
  .agenda-filters .filter-select, .agenda-patient-filter { min-width: 0; font-size: 10px; }
  .agenda-patient-filter { grid-column: 1 / -1; }
  .agenda-result-count { grid-column: 1 / -1; justify-self: start; }
  .agenda-month-grid { min-width: 735px; }
}

@media (max-width: 980px) {
  .agenda-year-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .agenda-year-grid { grid-template-columns: 1fr; }
  .agenda-year-month { padding: 10px; }
  .agenda-year-day { height: 31px; font-size: 10px; }
  .agenda-history-entry { align-items: flex-start; padding: 10px; }
}

/* Agenda: etapa clínica y espacio de trabajo */
.agenda-stage-legend { display:flex; flex-wrap:wrap; align-items:center; gap:7px 16px; padding:8px 16px 10px; border-top:1px solid #f0f2f4; color:#667c89; font-size:10px; }
.agenda-stage-legend > span { display:inline-flex; align-items:center; gap:6px; }
.agenda-stage-dot { width:9px; height:9px; border-radius:3px; display:inline-block; }
.agenda-stage-dot.interview { background:#8d78cf; }
.agenda-stage-dot.assessment { background:#d29b3f; }
.agenda-stage-dot.therapy { background:#36a58f; }
.agenda-stage-dot.unclassified { background:#8a9aa5; }
.agenda-event.agenda-stage-interview { background:#f3efff; border-color:#ded3fa; border-left-color:#8d78cf; color:#514276; }
.agenda-event.agenda-stage-assessment { background:#fff8e9; border-color:#f0dfbc; border-left-color:#d29b3f; color:#745620; }
.agenda-event.agenda-stage-therapy { background:#eaf8f4; border-color:#cbe8dd; border-left-color:#36a58f; color:#216f60; }
.agenda-event.agenda-stage-unclassified { border-left-color:#8a9aa5; }
.agenda-event .agenda-stage-chip { display:inline-flex; align-self:flex-start; max-width:100%; padding:1px 5px; border-radius:99px; background:rgba(255,255,255,.72); color:inherit; font-size:8px; font-style:normal; font-weight:800; line-height:1.3; }
.agenda-month-event.agenda-stage-interview { border-left:3px solid #8d78cf; background:#f3efff; color:#514276; }
.agenda-month-event.agenda-stage-assessment { border-left:3px solid #d29b3f; background:#fff8e9; color:#745620; }
.agenda-month-event.agenda-stage-therapy { border-left:3px solid #36a58f; background:#eaf8f4; color:#216f60; }
.agenda-month-event.agenda-stage-unclassified { border-left:3px solid #8a9aa5; }
.agenda-year-day.agenda-stage-interview { box-shadow:inset 0 0 0 1px #8d78cf; background:#f3efff; color:#514276; }
.agenda-year-day.agenda-stage-assessment { box-shadow:inset 0 0 0 1px #d29b3f; background:#fff8e9; color:#745620; }
.agenda-year-day.agenda-stage-therapy { box-shadow:inset 0 0 0 1px #36a58f; background:#eaf8f4; color:#216f60; }
.sidebar-collapse-toggle { min-height:30px; display:flex; align-items:center; justify-content:center; gap:7px; margin:0 8px 10px; padding:4px 9px; border:1px solid rgba(255,255,255,.12); border-radius:7px; background:rgba(255,255,255,.06); color:#dce7ec; font-size:11px; font-weight:600; font-family:inherit; cursor:pointer; }
.sidebar-collapse-toggle > span:first-child { font-size:19px; line-height:14px; }
.app-shell.sidebar-collapsed { grid-template-columns:64px minmax(0,1fr); }
@media (min-width:821px) {
  .sidebar { padding:14px 9px 10px; }
  .brand { gap:8px; padding:0 5px 14px; }
  .brand-logo-frame { flex-basis:62px; width:62px; height:52px; }
  .workspace-chip { margin:0 5px 12px; padding:7px 8px; font-size:10px; }
  .nav-group { margin-bottom:12px; }
  .nav-label { padding:0 9px 5px; font-size:9px; }
  .nav-item { min-height:33px; gap:9px; margin:1px 0; padding:0 9px; font-size:11px; }
  .nav-item svg { width:15px; height:15px; flex-basis:15px; }
  .sidebar-footer { gap:7px; padding:10px 5px 1px; }
  .user-avatar { width:27px; height:27px; }
  .topbar { padding-left:24px; padding-right:24px; }
  #page-content { padding-left:24px; padding-right:24px; }
  .app-shell.sidebar-collapsed .sidebar { padding-left:7px; padding-right:7px; }
  .app-shell.sidebar-collapsed .brand { justify-content:center; padding-left:0; padding-right:0; }
  .app-shell.sidebar-collapsed .brand-copy,
  .app-shell.sidebar-collapsed .workspace-chip,
  .app-shell.sidebar-collapsed .nav-label,
  .app-shell.sidebar-collapsed .nav-item > span:not(.nav-count),
  .app-shell.sidebar-collapsed .nav-count,
  .app-shell.sidebar-collapsed .user-copy { display:none; }
  .app-shell.sidebar-collapsed .brand-logo-frame { flex-basis:42px; width:42px; height:42px; }
  .app-shell.sidebar-collapsed .sidebar-collapse-toggle { width:32px; margin-left:auto; margin-right:auto; padding:2px; }
  .app-shell.sidebar-collapsed .sidebar-collapse-label { display:none; }
  .app-shell.sidebar-collapsed .nav-item { justify-content:center; padding:0; }
  .app-shell.sidebar-collapsed .nav-item.active { box-shadow:inset 0 -2px 0 var(--teal-bright); }
  .app-shell.sidebar-collapsed .sidebar-footer { justify-content:center; }
  .app-shell.sidebar-collapsed .sidebar-footer .icon-button { display:none; }
}
@media (max-width:820px) {
  .sidebar-collapse-toggle { display:none; }
  .agenda-month-grid { grid-template-columns:repeat(7,minmax(0,1fr)); min-width:0; }
  .agenda-month-day { min-height:94px; gap:3px; padding:4px 3px; }
  .agenda-month-weekday { padding:7px 2px; font-size:9px; }
  .agenda-month-number { width:19px; height:19px; font-size:9px; }
  .agenda-month-event { padding:2px; font-size:7px; }
  .agenda-month-event b { font-size:7px; }
  .agenda-month-more { font-size:7px; }
}
@media (max-width:520px) {
  .agenda-stage-legend { gap:6px 10px; padding:8px 10px; font-size:9px; }
  .agenda-filters { grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; padding:9px 10px; }
}

@media (min-width:821px) {
  .agenda-filters { grid-template-columns:repeat(5,minmax(105px,1fr)) minmax(140px,1.2fr) auto; gap:7px; }
}
@media (min-width:821px) and (max-width:1120px) {
  .agenda-filters { grid-template-columns:repeat(3,minmax(115px,1fr)); }
  .agenda-patient-filter { grid-column:span 2; }
  .agenda-result-count { justify-self:end; }
}
@media (max-width:820px) {
  .agenda-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .availability-week-grid { grid-template-columns: 1fr; }
}
@media (max-width:560px) {
  .availability-slot-row { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .availability-slot-remove { grid-column:span 2; }
}

/* Horario de atención: 08:00–19:00 */
.agenda-time-axis,
.agenda-day-lane { height:594px; }
.agenda-time-axis span.closing-time { transform:translateY(-100%); }

/* Patient review and scheduling */
.modal [hidden], .patient-coordination-panel [hidden] { display:none !important; }
.modal-patient-profile { width:min(920px,calc(100vw - 32px)); }
.patient-wizard-steps { display:flex; gap:12px; margin:0 0 24px; padding:0; list-style:none; border-bottom:1px solid #e8e4ee; padding-bottom:16px; }
.patient-wizard-steps li { display:flex; gap:8px; align-items:center; flex:1; color:#76818e; font-size:12px; }
.patient-wizard-steps li > button { display:flex; align-items:center; gap:8px; width:100%; min-width:0; padding:0; border:0; color:inherit; background:transparent; font:inherit; text-align:left; cursor:pointer; }
.patient-wizard-steps li > button:hover { color:#625197; }
.patient-wizard-steps li > button:focus-visible { outline:2px solid #8976bd; outline-offset:4px; border-radius:6px; }
.patient-wizard-steps li.done { color:#287861; }
#patient-workflow-save-status.error { color:#8a3a35; background:#fff5f4; border-color:#ebc5c1; }
.patient-wizard-steps li span { display:grid; place-items:center; width:25px; height:25px; border-radius:50%; background:#f0edf5; flex:none; }
.patient-wizard-steps li.current { color:#625197; font-weight:750; }
.patient-wizard-steps li.current span { color:white; background:#8976bd; }
.patient-wizard-steps li.done span { color:#287861; background:#e6f4ee; }
#patient-workflow-form h3 { margin:0 0 14px; font-size:16px; }
.patient-workflow-subsection { margin-top:24px; padding-top:20px; border-top:1px solid #e8e4ee; }
.patient-weekly-slot { display:grid; grid-template-columns:100px 100px 95px minmax(140px,1fr) minmax(120px,1fr) auto; gap:10px; align-items:end; background:#f8f7fb; border:1px solid #e9e5f0; padding:12px; margin:10px 0; border-radius:10px; }
.patient-weekly-slot .field { min-width:0; margin:0; }
.patient-weekly-slot .button { margin-bottom:1px; }
.patient-check { display:flex; align-items:center; gap:10px; margin:18px 0; font-size:13px; font-weight:650; }
.patient-check input { width:17px; height:17px; accent-color:#8976bd; }
.patient-review-note { padding:12px 14px; border:1px solid #ecdfbb; border-radius:9px; background:#fffbf0; color:#715d2f; font-size:12px; line-height:1.6; }
.patient-workflow-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:20px; }
.patient-upcoming { display:grid; gap:6px; margin-top:16px; font-size:12px; line-height:1.6; }
.patient-upcoming span { color:#7a8791; }
.patient-coordination-panel { padding:15px; margin-bottom:16px; }
.patient-coordination-panel>header { display:flex; flex-wrap:wrap; gap:8px 20px; align-items:center; justify-content:space-between; margin-bottom:12px; }
.patient-coordination-panel>header>div { display:grid; gap:3px; }
.patient-coordination-panel>header>div>span { color:#74808b; font-size:11px; }
.patient-coordination-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.patient-coordination-card { padding:12px; border:1px solid #e6e3ec; border-radius:10px; background:#fff; align-self:start; min-width:0; }
.patient-coordination-card summary { cursor:pointer; font-size:13px; font-weight:750; }
.patient-coordination-card .field-hint { margin:10px 0; }
.patient-coordination-list { list-style:none; padding:0; margin:0; max-height:260px; overflow:auto; display:grid; gap:12px; }
.patient-coordination-list li { border-bottom:1px solid #eff0f4; padding-bottom:10px; }
.patient-coordination-list small { display:block; font-size:11px; line-height:1.5; color:#75818c; margin:4px 0 7px; }
.patient-coordination-actions { display:flex; gap:6px; }
.patient-coordination-actions .button { min-height:27px; padding:4px 9px; font-size:10px; }
.agenda-event>* { flex-shrink:0; line-height:1.25; }
.agenda-event strong { white-space:normal; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; font-size:10px; width:100%; }
.agenda-event .agenda-stage-chip { font-size:8px; padding:0 3px; }
.agenda-event:focus-visible { outline:3px solid #8370bb; outline-offset:2px; z-index:5; }
@media(max-width:900px) { .patient-weekly-slot { grid-template-columns:repeat(3,minmax(0,1fr)); } .patient-coordination-grid { grid-template-columns:1fr; } }
@media(max-width:540px) { .patient-wizard-steps { gap:5px; } .patient-wizard-steps li { flex-direction:column; gap:4px; font-size:10px; text-align:center; } .patient-weekly-slot { grid-template-columns:repeat(2,minmax(0,1fr)); } .modal-footer { flex-wrap:wrap; } }

.agenda-stage-followup { border-left:4px solid #8976bd; }
.agenda-stage-followup > strong { color:#554d8e; font-size:15px; }
.agenda-stage-followup-list { max-height:320px; margin:10px 0 0; padding:0; overflow:auto; list-style:none; }
.agenda-stage-followup-list li { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 0; border-top:1px solid #e8e4ee; }
.agenda-stage-followup-list li > span { min-width:0; overflow-wrap:anywhere; }
.agenda-stage-followup-list li small { display:block; margin-top:4px; color:#687780; line-height:1.45; }
.agenda-stage-followup-actions { display:flex; flex:none; gap:6px; }
@media(max-width:640px) { .agenda-stage-followup-list li { align-items:flex-start; flex-direction:column; } .agenda-stage-followup-actions { flex-wrap:wrap; } }

.agenda-event.agenda-has-phase-closure { border-color:#e6cf9d; border-left-color:#c4922e; background:#fff8e9; }
.agenda-event .agenda-phase-closure { padding:1px 5px; border-radius:99px; background:#f6e8c6; color:#795919 !important; font-size:8px !important; font-style:normal; font-weight:800; line-height:1.3; }
.agenda-phase-followup { border-left-color:#c4922e; }
.agenda-phase-followup > strong { color:#795919; }
.agenda-phase-closure-note { margin:0 0 14px; border-color:#e6cf9d; background:#fff8e9; color:#715d2f; }

/* Compact attendance controls in the pending list. */
.agenda-urgent-actions { display:flex; align-items:flex-start; gap:8px; flex:none; }
.agenda-quick-attendance { display:flex; flex-direction:column; gap:4px; max-width:260px; }
.agenda-quick-attendance select { width:142px; min-height:34px; padding:5px 8px; font-size:12px; }
.agenda-quick-attendance [data-quick-feedback]:empty { display:none; }
.agenda-quick-reason:not([hidden]) { display:flex; gap:4px; }
.agenda-quick-reason input { width:165px; min-width:0; padding:6px; border:1px solid #d8e0e6; border-radius:6px; }
@media(max-width:640px) { .agenda-urgent-list li { flex-wrap:wrap; } .agenda-urgent-actions { width:100%; justify-content:flex-end; } }

.agenda-justification-notice{padding:10px 14px;margin:10px 0;font-size:13px;border-left:3px solid #d59c36}.agenda-justification-notice summary{cursor:pointer}.agenda-justification-notice small{display:block;color:var(--text-muted,#666)}

/* A single editable dropdown retains the original select for form submission. */
.search-combo{position:relative;display:inline-block;min-width:120px;width:100%;vertical-align:middle;}
.search-combo[hidden]{display:none;}
.search-combo-input{box-sizing:border-box;width:100%;height:44px;padding:10px 30px 10px 12px;border:1px solid #dce4e8;border-radius:9px;background:#fff;color:#26465a;font:inherit;font-size:13px;}
.search-combo-input:focus{outline:2px solid #9b85cc;outline-offset:1px;}
.search-combo-input:disabled{background:#f4f6f8;color:#87949f;}
.search-combo-input[aria-invalid=true]{border-color:#d64b4b;}
.search-combo-arrow{position:absolute;right:11px;top:10px;cursor:pointer;color:#607785;}
.search-combo-native{position:absolute!important;opacity:0!important;width:1px!important;height:1px!important;padding:0!important;pointer-events:none!important;}
.search-combo-list{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:120;max-height:240px;overflow-y:auto;background:#fff;border:1px solid #dce4e8;border-radius:9px;box-shadow:0 8px 24px #20394d26;}
.search-combo-list[hidden]{display:none;}
.search-combo-list [role=option],.search-combo-empty{padding:10px 12px;font-size:13px;cursor:pointer;white-space:normal;}
.search-combo-list [role=option]:hover,.search-combo-list [role=option].active{background:#f0ebfa;}
.search-combo-list [aria-selected=true]{font-weight:600;}
.search-combo-list [aria-disabled=true]{color:#a2aab1;cursor:not-allowed;}
.search-combo-empty{color:#607785;cursor:default;}
.agenda-filters>.search-combo{width:auto;min-width:150px;flex:1;}

