:root {
  --ink: #18322d;
  --muted: #71827d;
  --line: #e3ebe7;
  --canvas: #f4f7f5;
  --green: #1f6a59;
  --green-dark: #174f43;
  --sage: #dfece4;
  --blue: #e0eaf2;
  --peach: #f8e6d9;
  --danger: #a9473e;
  --white: #ffffff;
  --shadow: 0 18px 60px rgba(23, 79, 67, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--canvas); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 12px; color: #739086; font-size: 11px; font-weight: 800; letter-spacing: 2.1px; }

.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.15fr) minmax(430px, .85fr); }
.login-brand { min-height: 100vh; padding: 52px clamp(45px, 6vw, 96px); display: flex; flex-direction: column; color: #eff9f5; background:
  radial-gradient(circle at 18% 18%, rgba(128, 191, 166, .28), transparent 28%),
  radial-gradient(circle at 83% 72%, rgba(116, 163, 149, .18), transparent 32%),
  linear-gradient(145deg, #133f36 0%, #1f6a59 55%, #174f43 100%);
  position: relative; overflow: hidden;
}
.login-brand::after { content: ""; position: absolute; width: 430px; height: 430px; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; right: -180px; top: 18%; box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.018); }
.brand-lockup { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.brand-lockup > span:last-child { display: grid; line-height: 1.05; }
.brand-lockup strong { font-family: Georgia, serif; font-size: 22px; font-weight: 600; }
.brand-lockup small { margin-top: 6px; font-size: 9px; letter-spacing: 2px; text-transform: uppercase; opacity: .7; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px 13px 13px 4px; display: grid; place-items: center; flex: 0 0 auto; background: #fff; color: var(--green); font-family: Georgia, serif; font-size: 25px; font-weight: 700; }
.login-copy { margin: auto 0 35px; max-width: 680px; position: relative; z-index: 1; }
.login-copy .eyebrow { color: #b5d5c9; }
.login-copy h1 { margin: 0; font: 500 clamp(42px, 5vw, 68px)/1.04 Georgia, serif; letter-spacing: -2.3px; }
.login-copy > p:last-child { max-width: 580px; margin: 25px 0 0; color: #c8ddd5; font-size: 16px; line-height: 1.7; }
.trust-list { display: grid; gap: 13px; margin-bottom: auto; position: relative; z-index: 1; }
.trust-list span { color: #d5e7e0; font-size: 13px; }
.trust-list b { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 9px; border-radius: 50%; background: rgba(255,255,255,.11); color: #bfe6d7; }
.login-footnote { margin: 50px 0 0; font-size: 10px; letter-spacing: 1.3px; opacity: .55; position: relative; z-index: 1; }
.login-panel { min-height: 100vh; padding: 45px; display: grid; place-items: center; background: #fbfcfb; }
.login-card { width: min(420px, 100%); padding: 16px; }
.mobile-brand { display: none; }
.login-card h2 { margin: 0; font: 500 37px/1.15 Georgia, serif; letter-spacing: -.8px; }
.form-intro { margin: 12px 0 30px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.login-card > label, .login-card form > label { display: grid; gap: 8px; margin: 17px 0; font-size: 12px; font-weight: 750; }
.login-card input, .login-card select { width: 100%; height: 49px; border: 1px solid #dce5e1; border-radius: 10px; padding: 0 14px; outline: none; background: #fff; color: var(--ink); font-size: 14px; transition: .2s; }
.login-card textarea { width: 100%; padding: 12px 14px; border: 1px solid #dce5e1; border-radius: 10px; outline: none; resize: vertical; }
.login-card input:focus, .login-card select:focus { border-color: #70a393; box-shadow: 0 0 0 4px #eaf3ef; }
.password-field { position: relative; }
.password-field input { padding-right: 62px; }
.password-field button { position: absolute; inset: 0 8px 0 auto; border: 0; background: transparent; color: var(--green); font-size: 11px; font-weight: 800; }
.form-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin: 3px 0 18px; color: var(--muted); font-size: 10px; }
.remember { display: flex !important; align-items: center; gap: 7px; margin: 0 !important; font-weight: 600 !important; }
.remember input { width: 15px; height: 15px; accent-color: var(--green); }
.form-error { min-height: 18px; margin: 0 0 7px; color: var(--danger); font-size: 11px; line-height: 1.5; }
.primary-button { width: 100%; height: 50px; border: 0; border-radius: 10px; background: var(--green); color: #fff; font-size: 13px; font-weight: 800; box-shadow: 0 8px 22px rgba(31, 106, 89, .2); transition: .2s; }
.primary-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.primary-button:disabled { opacity: .65; cursor: wait; }
.security-note { display: flex; justify-content: center; gap: 7px; margin-top: 18px; color: #82958f; font-size: 10px; }
.security-note span { color: #36a57d; }
.auth-switch { margin: 22px 0 12px; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 10px; }
.auth-switch::before, .auth-switch::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.text-button { width: 100%; margin-top: 13px; padding: 10px; border: 0; background: transparent; color: var(--green); font-size: 11px; font-weight: 800; }
.security-hint { margin: -8px 0 13px; color: var(--muted); font-size: 10px; }
.booking-card { width: min(540px, 100%); }
.booking-price { margin: -10px 0 22px; padding: 15px; display: grid; border-radius: 11px; background: #edf5f1; }
.booking-price span, .booking-price small { color: var(--muted); font-size: 9px; }
.booking-price strong { margin: 4px 0; color: var(--green); font: 600 24px Georgia, serif; }
.booking-divider { margin: 18px 0; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 10px; }
.booking-divider::before, .booking-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.secondary-button { width: 100%; height: 48px; border: 1px solid #b9d1c8; border-radius: 10px; background: #fff; color: var(--green); font-weight: 800; }
.payment-methods { margin: 17px 0; padding: 12px; display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 10px; }
.payment-methods legend { padding: 0 5px; color: var(--muted); font-size: 10px; font-weight: 800; }
.payment-methods label, .consent-check { display: flex !important; align-items: center; gap: 9px; font-size: 11px !important; font-weight: 650 !important; }
.payment-methods input, .consent-check input { width: 16px !important; height: 16px !important; flex: 0 0 auto; accent-color: var(--green); }
.transfer-card { margin-top: 16px; padding: 17px; display: grid; gap: 5px; border-radius: 11px; background: #edf5f1; }
.transfer-card small, .transfer-card span { color: var(--muted); font-size: 10px; }
.transfer-card strong { color: var(--green); font-size: 20px; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 245px; padding: 26px 18px 18px; display: flex; flex-direction: column; background: #fbfcfb; border-right: 1px solid var(--line); z-index: 20; }
.sidebar-brand { padding: 0 9px 30px; color: var(--ink); }
.sidebar-brand .brand-mark { background: var(--green); color: #fff; width: 38px; height: 38px; font-size: 22px; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav button { width: 100%; height: 45px; padding: 0 13px; border: 0; border-radius: 10px; display: flex; align-items: center; gap: 12px; background: transparent; color: #61736e; font-size: 12px; font-weight: 700; text-align: left; }
.sidebar nav button span { width: 21px; font-size: 18px; text-align: center; }
.sidebar nav button:hover { background: #f0f4f2; }
.sidebar nav button.active { background: #e6f0eb; color: var(--green); }
.sidebar-footer { margin-top: auto; display: grid; gap: 14px; }
.session-safe { padding: 12px; display: flex; align-items: center; gap: 9px; border-radius: 10px; background: #edf5f1; }
.session-safe > span { color: #32a67c; font-size: 8px; }
.session-safe div, .profile div { display: grid; flex: 1; min-width: 0; }
.session-safe strong, .profile strong { font-size: 10px; overflow: hidden; text-overflow: ellipsis; }
.session-safe small, .profile small { margin-top: 3px; color: var(--muted); font-size: 8px; overflow: hidden; text-overflow: ellipsis; }
.profile { padding: 14px 4px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 9px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: var(--sage); color: #396458; font-size: 10px; font-weight: 850; }
.profile button { border: 0; background: transparent; color: #84938f; font-size: 18px; }
.workspace { width: calc(100% - 245px); margin-left: 245px; min-height: 100vh; }
.topbar { height: 76px; padding: 0 36px; position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.93); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.mobile-title, .menu-button { display: none; }
.global-search { width: min(440px, 45vw); height: 40px; padding: 0 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfa; color: #84938f; }
.global-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; }
.role-badge { margin-left: auto; padding: 7px 11px; border-radius: 999px; background: #edf4f1; color: var(--green); font-size: 8px; font-weight: 850; text-transform: uppercase; letter-spacing: .6px; }
.icon-button, .small-button { border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--green); font-weight: 800; }
.icon-button { width: 40px; height: 40px; font-size: 18px; }
.content { max-width: 1500px; margin: 0 auto; padding: 34px 38px 60px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; }
.page-heading h1 { margin: 0 0 7px; font: 500 clamp(29px, 3vw, 40px)/1.1 Georgia, serif; letter-spacing: -1.2px; }
.page-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 18px; }
.stat-card { min-height: 104px; padding: 17px; display: flex; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.stat-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--sage); color: var(--green); font-size: 18px; }
.stat-card:nth-child(2) .stat-icon { background: var(--blue); }
.stat-card:nth-child(3) .stat-icon { background: var(--peach); }
.stat-card:nth-child(4) .stat-icon { background: #eae3f0; }
.stat-card div { display: grid; }
.stat-card small { color: var(--muted); font-size: 9px; }
.stat-card strong { margin-top: 3px; font: 500 27px Georgia, serif; }
.panel-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr); gap: 17px; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 4px 16px rgba(24,50,45,.025); }
.panel-header { min-height: 68px; padding: 17px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #edf1ef; }
.panel-header h2 { margin: 0 0 4px; font: 500 18px Georgia, serif; }
.panel-header p { margin: 0; color: var(--muted); font-size: 8px; }
.small-button { padding: 8px 11px; font-size: 8px; }
.data-row { width: 100%; min-height: 63px; padding: 12px 18px; border: 0; border-bottom: 1px solid #eef2f0; display: grid; grid-template-columns: minmax(150px, 1.2fr) minmax(120px, .9fr) minmax(100px, .7fr) auto; gap: 15px; align-items: center; background: #fff; text-align: left; }
.organization-row { grid-template-columns: minmax(150px, 1.2fr) minmax(120px, .9fr) minmax(100px, .7fr) auto auto; }
.data-row:hover { background: #fafcfb; }
.data-row > span { display: grid; min-width: 0; }
.data-row strong { font-size: 10px; overflow: hidden; text-overflow: ellipsis; }
.data-row small { margin-top: 4px; color: var(--muted); font-size: 8px; overflow: hidden; text-overflow: ellipsis; }
.pill { width: fit-content; padding: 5px 8px; border-radius: 999px; background: #e7f1ec; color: var(--green); font-size: 7px; font-weight: 850; text-transform: uppercase; }
.pill.warn { background: #faebdf; color: #986443; }
.pill.error { background: #f9e3e0; color: var(--danger); }
.audit-row { grid-template-columns: minmax(140px, .9fr) minmax(130px, .8fr) minmax(120px, .8fr) minmax(120px, 1fr) auto; }
.empty-state, .loading-state { padding: 46px 22px; color: var(--muted); text-align: center; font-size: 11px; }
.loading-state::before { content: ""; width: 24px; height: 24px; margin: 0 auto 12px; display: block; border: 3px solid #dfe9e5; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
.side-stack { display: grid; gap: 17px; align-content: start; }
.info-card { padding: 20px; background: linear-gradient(145deg, #fff, #f1f7f4); }
.info-card .big { display: block; margin: 13px 0 6px; font: 500 32px Georgia, serif; }
.info-card > p { color: var(--muted); font-size: 9px; line-height: 1.55; }
.security-card { padding: 19px; background: #173f36; color: #eff9f5; }
.security-card h3 { margin: 0 0 8px; font: 500 18px Georgia, serif; }
.security-card p { margin: 0; color: #bdd3cb; font-size: 9px; line-height: 1.65; }
.toolbar { padding: 14px 17px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; }
.toolbar input { width: min(360px, 100%); height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; outline: 0; }
.management-grid { display: grid; grid-template-columns: minmax(310px, .65fr) minmax(0, 1.35fr); gap: 17px; align-items: start; }
.booking-management { margin-bottom: 18px; }
.form-panel { overflow: visible; }
.form-body { padding: 18px; display: grid; gap: 14px; }
.form-body > label, .form-grid label { display: grid; gap: 7px; color: #50665f; font-size: 9px; font-weight: 800; }
.form-body input, .form-body select { width: 100%; height: 41px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: #fff; color: var(--ink); font-size: 10px; }
.form-body textarea { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; outline: 0; resize: vertical; color: var(--ink); font-size: 10px; }
.form-body input:focus, .form-body select:focus { border-color: #70a393; box-shadow: 0 0 0 3px #eaf3ef; }
.form-body .primary-button { height: 43px; margin-top: 2px; font-size: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.form-grid .wide { grid-column: 1 / -1; }
.organization-row { grid-template-columns: minmax(150px, 1.1fr) minmax(150px, 1fr) minmax(110px, .65fr) auto; }
.member-row { grid-template-columns: minmax(160px, 1.1fr) minmax(130px, .85fr) minmax(90px, .55fr) auto; }
.combined-profile-card { margin-bottom: 18px; }
.combined-profile-card h2 { margin: 8px 0; font: 500 22px Georgia, serif; }
.payment-row { grid-template-columns: minmax(170px, 1.2fr) minmax(130px, .75fr) minmax(150px, 1fr) auto minmax(130px, auto); }
.payment-actions { display: flex !important; gap: 6px; justify-content: flex-end; }
.approve-button { background: var(--green); color: #fff; border-color: var(--green); }
.reject-button { color: var(--danger); border-color: #ecc9c4; }
.link-actions { display: flex !important; gap: 6px; justify-content: flex-end; }
.danger-button { color: var(--danger); border-color: #ecc9c4; }
.subheading { padding: 13px 18px; background: #f5f8f6; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: 1.2px; text-transform: uppercase; }
.invite-result { margin-top: 3px; padding: 13px; border: 1px solid #d5e7df; border-radius: 9px; background: #edf6f2; }
.invite-result > strong { font-size: 10px; color: var(--green); }
.invite-result p { margin: 5px 0 10px; color: #647c74; font-size: 8px; line-height: 1.5; }
.invite-result > div { display: flex; gap: 6px; }
.invite-result input { min-width: 0; height: 35px; background: #fff; font-size: 8px; }
.invite-result button { padding: 0 10px; border: 0; border-radius: 7px; background: var(--green); color: #fff; font-size: 8px; font-weight: 800; }
.invite-result small { display: block; margin-top: 7px; color: var(--muted); font-size: 7px; }
.invited-profile { margin: -8px 0 18px; padding: 12px; display: grid; border-radius: 9px; background: #edf5f1; }
.invited-profile strong { font-size: 11px; }
.invited-profile small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.email-verification-box { margin: 0 0 18px; gap: 10px; }
.email-verification-box .small-button { justify-self: start; }
.email-verification-box label { margin: 0; }
.schedule-days { display: grid; gap: 7px; }
.schedule-day { padding: 10px; display: grid; gap: 9px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfb; }
.schedule-day-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.schedule-day label { display: flex; align-items: center; gap: 7px; color: #50665f; font-size: 9px; font-weight: 750; }
.schedule-day label input { width: 15px; height: 15px; accent-color: var(--green); }
.schedule-ranges { display: grid; gap: 7px; }
.schedule-range { display: grid; grid-template-columns: minmax(90px, 1fr) auto minmax(90px, 1fr) 28px; gap: 7px; align-items: center; }
.schedule-range > input { height: 34px; }
.schedule-range > span { color: var(--muted); font-size: 9px; }
.remove-range-button { width: 28px; height: 28px; border: 1px solid #ecc9c4; border-radius: 7px; background: #fff; color: var(--danger); font-size: 16px; }
.schedule-day.is-disabled .schedule-ranges { opacity: .48; }
.clinical-grid { display: grid; grid-template-columns: minmax(280px, .65fr) minmax(0, 1.35fr); gap: 17px; align-items: start; }
.clinical-entry { padding: 20px; border-bottom: 1px solid var(--line); }
.clinical-entry header { display: flex; justify-content: space-between; gap: 15px; }
.clinical-entry header strong { font-size: 11px; }
.clinical-entry time { color: var(--muted); font-size: 9px; }
.clinical-entry > p { margin: 15px 0; white-space: pre-wrap; font-size: 12px; line-height: 1.65; }
.clinical-entry dl { margin: 9px 0 0; display: grid; grid-template-columns: 90px 1fr; gap: 8px; font-size: 10px; }
.clinical-entry dt { color: var(--muted); font-weight: 800; }
.clinical-entry dd { margin: 0; white-space: pre-wrap; }
#patient-email-code-area { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
#patient-email-code-area.hidden { display: none; }
#patient-email-status { min-height: 16px; font-size: 11px; }
.invitation-brand { display: flex; }
.success-card { padding: 25px 5px; text-align: center; }
.success-card > span { width: 54px; height: 54px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 50%; background: var(--sage); color: var(--green); font-size: 24px; font-weight: 900; }
.success-card h2 { font-size: 32px; }
.success-card p { margin: 13px auto 23px; max-width: 330px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.success-card.error-card > span { background: #f9e3e0; color: var(--danger); }
.link-button { display: grid; place-items: center; text-decoration: none; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 80; padding: 12px 17px; border-radius: 9px; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.2); }

/* Experiencia de trabajo simplificada */
h1, h2, h3, .brand-lockup strong, .mobile-brand strong, .mobile-title strong,
.panel-header h2, .info-card .big, .stat-card strong {
  font-family: "Montserrat", ui-sans-serif, system-ui, sans-serif;
}
h1, h2, h3, .page-heading h1, .panel-header h2, .drawer-header h2,
.info-card h2, .security-card h3 {
  text-transform: uppercase;
  letter-spacing: .035em;
}
.page-heading h1 { font: 700 clamp(27px, 3vw, 38px)/1.12 "Montserrat", sans-serif; letter-spacing: .02em; }
.panel-header h2 { font: 700 15px/1.25 "Montserrat", sans-serif; }
.login-copy h1 { font: 700 clamp(40px, 5vw, 66px)/1.05 "Montserrat", sans-serif; letter-spacing: -.045em; text-transform: uppercase; }
.login-card h2 { font: 700 32px/1.15 "Montserrat", sans-serif; letter-spacing: .01em; text-transform: uppercase; }
.brand-lockup strong { font-weight: 700; letter-spacing: -.02em; }
.brand-mark { font-family: "Montserrat", sans-serif; }
.primary-action { min-height: 42px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--green); color: #fff; font-size: 10px; font-weight: 800; box-shadow: 0 8px 22px rgba(31,106,89,.18); }
.primary-action:hover { background: var(--green-dark); transform: translateY(-1px); }

.quick-actions { margin: -6px 0 20px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.quick-actions button { min-height: 82px; padding: 15px; display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; column-gap: 11px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--ink); text-align: left; transition: .18s; }
.quick-actions button:hover { border-color: #aaccc0; box-shadow: 0 10px 28px rgba(23,79,67,.08); transform: translateY(-2px); }
.quick-actions span { grid-row: 1 / 3; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--sage); color: var(--green); font-weight: 800; }
.quick-actions strong { align-self: end; font: 700 10px "Montserrat", sans-serif; text-transform: uppercase; }
.quick-actions small { color: var(--muted); font-size: 8px; }

.calendar-toolbar { margin-bottom: 14px; padding: 12px 15px; display: flex; justify-content: space-between; align-items: end; gap: 18px; overflow: visible; }
.calendar-toolbar label { min-width: 220px; display: grid; gap: 6px; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.calendar-toolbar select { height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.calendar-navigation { display: flex; align-items: center; gap: 7px; }
.calendar-navigation strong { margin-left: 8px; font: 700 11px "Montserrat", sans-serif; text-transform: uppercase; }
.week-calendar { min-height: 430px; display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); overflow-x: auto; }
.calendar-day { min-width: 130px; border-right: 1px solid var(--line); background: #fff; }
.calendar-day:last-child { border-right: 0; }
.calendar-day > header { min-height: 57px; padding: 11px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); background: #fafcfb; }
.calendar-day > header span { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.calendar-day > header strong { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; font-size: 11px; }
.calendar-day.is-today > header { background: #edf6f2; }
.calendar-day.is-today > header strong { background: var(--green); color: #fff; }
.calendar-appointments { padding: 8px; display: grid; gap: 7px; align-content: start; }
.appointment-card { padding: 10px; display: grid; gap: 4px; border-left: 3px solid var(--green); border-radius: 8px; background: #edf6f2; }
.appointment-card.warn { border-color: #c6814e; background: #fff6ef; }
.appointment-card.error { border-color: var(--danger); background: #fff1ef; }
.appointment-card time { color: var(--green); font-size: 8px; font-weight: 850; }
.appointment-card strong { font-size: 9px; }
.appointment-card small { color: var(--muted); font-size: 7px; }
.appointment-card span { margin-top: 3px; color: var(--muted); font-size: 7px; }
.calendar-empty { padding: 28px 5px; color: #a2afab; font-size: 8px; text-align: center; }

.drawer-layer { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: flex-end; }
.drawer-backdrop { position: absolute; inset: 0; border: 0; background: rgba(16,39,34,.42); backdrop-filter: blur(2px); }
.side-drawer { position: relative; width: min(520px, 100%); height: 100%; overflow-y: auto; background: #fbfcfb; box-shadow: -18px 0 55px rgba(14,40,34,.2); animation: drawer-in .2s ease-out; }
.drawer-header { position: sticky; top: 0; z-index: 2; padding: 22px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.drawer-header .eyebrow { margin-bottom: 5px; }
.drawer-header h2 { margin: 0; font: 700 19px "Montserrat", sans-serif; }
.drawer-header > button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font-size: 21px; }
.drawer-form { padding: 24px; display: grid; gap: 15px; }
.drawer-form > label, .drawer-form .form-grid label { display: grid; gap: 7px; color: #50665f; font-size: 9px; font-weight: 800; }
.drawer-form input, .drawer-form select, .drawer-form textarea { width: 100%; min-height: 43px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); outline: 0; }
.drawer-form textarea { padding-top: 11px; }
.drawer-form input:focus, .drawer-form select:focus { border-color: #70a393; box-shadow: 0 0 0 3px #eaf3ef; }
.drawer-form small { color: var(--muted); font-size: 8px; font-weight: 500; }

.section-tabs { margin-bottom: 17px; padding: 5px; display: inline-flex; gap: 4px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.section-tabs button { min-height: 35px; padding: 0 15px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 800; }
.section-tabs button.active { background: var(--green); color: #fff; box-shadow: 0 5px 15px rgba(31,106,89,.18); }
.configuration-panel { display: grid; gap: 17px; }
.settings-form-wide { width: 100%; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; align-items: start; }
.settings-list { margin-top: 0; }

@keyframes drawer-in { from { transform: translateX(25px); opacity: .6; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1050px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .panel-grid { grid-template-columns: 1fr; }
  .management-grid { grid-template-columns: 1fr; }
  .clinical-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: repeat(2, 1fr); }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { padding: 25px; }
  .mobile-brand { margin-bottom: 38px; display: flex; align-items: center; gap: 10px; }
  .mobile-brand .brand-mark { background: var(--green); color: #fff; }
  .mobile-brand strong { font: 600 20px Georgia, serif; }
  .sidebar { transform: translateX(-100%); transition: .22s; box-shadow: 15px 0 35px rgba(24,50,45,.15); }
  .app-shell.menu-open .sidebar { transform: translateX(0); }
  .workspace { width: 100%; margin-left: 0; }
  .topbar { padding: 0 15px; }
  .menu-button { width: 38px; height: 38px; display: block; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
  .mobile-title { display: flex; align-items: center; gap: 7px; }
  .mobile-title .brand-mark { width: 31px; height: 31px; border-radius: 9px 9px 9px 3px; background: var(--green); color: #fff; font-size: 18px; }
  .mobile-title strong { font: 600 14px Georgia, serif; }
  .global-search { margin-left: auto; width: 40px; justify-content: center; }
  .global-search input { display: none; }
  .role-badge { display: none; }
  .content { padding: 24px 14px 40px; }
  .data-row, .audit-row { grid-template-columns: 1fr auto; }
  .organization-row, .member-row { grid-template-columns: 1fr auto; }
  .data-row > span:nth-child(2), .data-row > span:nth-child(3), .audit-row > span:nth-child(4) { display: none; }
  .calendar-toolbar { align-items: stretch; flex-direction: column; }
  .calendar-toolbar label { min-width: 0; }
  .settings-grid { grid-template-columns: 1fr; }
  .week-calendar { grid-template-columns: repeat(7, minmax(150px, 1fr)); }
}
@media (max-width: 520px) {
  .login-panel { align-items: start; padding: 28px 13px; }
  .login-card { padding: 8px; }
  .login-card h2 { font-size: 31px; }
  .stats { display: flex; overflow-x: auto; }
  .stat-card { min-width: 205px; }
  .side-stack { grid-template-columns: 1fr; }
  .schedule-range { grid-template-columns: 1fr auto 1fr 28px; }
  .page-heading { align-items: flex-start; }
  .page-heading { flex-direction: column; }
  .page-heading .primary-action { width: 100%; }
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .quick-actions button { min-height: 76px; padding: 11px; }
  .section-tabs { width: 100%; overflow-x: auto; }
  .section-tabs button { flex: 0 0 auto; }
  .drawer-form { padding: 18px 14px 30px; }
  .drawer-header { padding: 18px 14px; }
}

/* Lambda Salud · Sistema visual profesional */
:root {
  --ink: #102c29;
  --muted: #647973;
  --line: #dce7e2;
  --canvas: #f3f7f5;
  --green: #13715f;
  --green-dark: #0b4d43;
  --sage: #dff0e9;
  --blue: #e5edf6;
  --peach: #f7eadd;
  --danger: #b14343;
  --white: #fff;
  --sidebar: #0b3531;
  --sidebar-muted: #a9c2bb;
  --shadow: 0 20px 50px rgba(20, 62, 55, .09);
  --shadow-soft: 0 8px 24px rgba(20, 62, 55, .06);
}

body {
  background: radial-gradient(circle at 95% 0, rgba(75, 151, 130, .08), transparent 24rem), var(--canvas);
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: "Inter", ui-sans-serif, system-ui, sans-serif; }
button { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(19, 113, 95, .18);
  outline-offset: 2px;
}

.login-brand {
  padding: 46px clamp(44px, 6vw, 100px);
  background: radial-gradient(circle at 20% 18%, rgba(111, 195, 166, .22), transparent 24rem), radial-gradient(circle at 87% 72%, rgba(132, 183, 167, .13), transparent 27rem), linear-gradient(145deg, #082d2a 0%, #0b4a42 54%, #116553 100%);
}
.login-brand::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 24px;
  pointer-events: none;
}
.login-brand::after { opacity: .75; right: -135px; top: 22%; }
.brand-lockup { gap: 14px; }
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px 14px 14px 5px;
  background: #f7fffb;
  color: var(--green-dark);
  box-shadow: 0 8px 22px rgba(0,0,0,.12);
}
.brand-lockup strong { font-size: 20px; letter-spacing: -.035em; }
.brand-lockup small { margin-top: 7px; font-size: 8px; letter-spacing: 2.4px; }
.product-badge {
  display: flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 24px;
  padding: 8px 11px;
  border: 1px solid rgba(217,244,234,.22);
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  color: #d8eee6;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.3px;
}
.login-copy { margin: clamp(56px, 7vh, 88px) 0 30px; }
.login-copy h1 { max-width: 720px; font-size: clamp(40px, 4.6vw, 66px); line-height: 1.02; }
.login-copy > p:last-child { font-size: 15px; }
.trust-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 28px; }
.trust-list span {
  min-height: 76px;
  padding: 14px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 14px;
  background: rgba(255,255,255,.055);
  font-size: 11px;
  line-height: 1.45;
}
.trust-list b { flex: 0 0 auto; }
.login-proof { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(255,255,255,.12); }
.login-proof div { padding: 20px 18px 4px 0; display: grid; gap: 4px; }
.login-proof strong { font: 700 20px "Montserrat", sans-serif; color: #f3fbf8; }
.login-proof span { color: #a9c9be; font-size: 9px; }
.login-footnote { margin-top: 32px; }

.login-panel { padding: 42px; background: radial-gradient(circle at 100% 0, rgba(58, 135, 114, .08), transparent 19rem), #fbfdfc; }
.login-card {
  width: min(450px, 100%);
  padding: 34px;
  border: 1px solid rgba(210, 225, 219, .85);
  border-radius: 22px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 24px 70px rgba(25, 72, 63, .1);
}
.login-card h2 { color: #0c3530; font-size: 30px; }
.form-intro { margin-bottom: 25px; font-size: 12px; }
.login-card > label, .login-card form > label { color: #38534d; font-size: 11px; }
.login-card input, .login-card select { height: 52px; border-color: #d7e3de; border-radius: 12px; }
.primary-button { height: 52px; border-radius: 12px; background: linear-gradient(135deg, #13715f, #0b5549); box-shadow: 0 12px 24px rgba(19,113,95,.22); }
.primary-button:hover { box-shadow: 0 15px 30px rgba(19,113,95,.28); }
.secondary-button { border-radius: 12px; }

.sidebar {
  width: 258px;
  padding: 28px 18px 18px;
  background: radial-gradient(circle at 0 0, rgba(78, 159, 136, .19), transparent 16rem), var(--sidebar);
  border-right: 0;
  box-shadow: 8px 0 30px rgba(16, 52, 47, .08);
}
.sidebar-brand { padding: 0 10px 34px; color: #fff; }
.sidebar-brand .brand-mark { background: #e9f6f1; color: var(--green-dark); box-shadow: none; }
.sidebar-brand small { color: var(--sidebar-muted); opacity: 1; }
.sidebar nav { gap: 6px; }
.sidebar nav button { height: 48px; padding: 0 14px; border: 1px solid transparent; border-radius: 12px; color: var(--sidebar-muted); font-size: 11px; }
.sidebar nav button span { color: #72aa9c; }
.sidebar nav button:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav button.active { border-color: rgba(205,239,228,.11); background: linear-gradient(90deg, rgba(117, 190, 167, .22), rgba(255,255,255,.07)); color: #fff; box-shadow: inset 3px 0 #6ed0b2; }
.session-safe { border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.055); }
.session-safe strong, .profile strong { color: #eef8f4; }
.session-safe small, .profile small { color: #99b9b0; }
.profile { border-top-color: rgba(255,255,255,.09); }
.avatar { background: #d8ede5; color: var(--green-dark); }
.profile button { color: #a9c2bb; }

.workspace { width: calc(100% - 258px); margin-left: 258px; }
.topbar { height: 82px; padding: 0 38px; gap: 18px; background: rgba(250,252,251,.9); border-bottom-color: rgba(211,225,219,.85); box-shadow: 0 5px 18px rgba(22,60,53,.035); }
.topbar-context { min-width: 150px; display: grid; gap: 4px; }
.topbar-context small { color: #81948f; font-size: 7px; font-weight: 800; letter-spacing: 1.3px; }
.topbar-context strong { color: var(--ink); font: 700 11px "Montserrat", sans-serif; }
.global-search { width: min(480px, 42vw); height: 44px; border-radius: 12px; background: #fff; box-shadow: 0 3px 12px rgba(22,60,53,.025); }
.global-search input { font-size: 10px; }
.role-badge { padding: 8px 12px; background: #e1f1eb; }
.icon-button { width: 42px; height: 42px; border-radius: 11px; }
.content { max-width: 1540px; padding: 38px 42px 70px; }

.page-heading { margin-bottom: 30px; align-items: center; }
.page-heading h1 { color: #0c332f; font-size: clamp(26px, 3vw, 36px); letter-spacing: .01em; }
.page-heading p:last-child { font-size: 11px; line-height: 1.6; }
.eyebrow { color: #5b8b7d; font-size: 8px; letter-spacing: 2px; }
.primary-action { min-height: 45px; padding: 0 20px; border-radius: 11px; background: linear-gradient(135deg, #13715f, #0b5549); box-shadow: 0 10px 22px rgba(19,113,95,.18); }
.primary-action:hover { box-shadow: 0 13px 27px rgba(19,113,95,.24); }

.quick-actions { gap: 14px; margin-bottom: 22px; }
.quick-actions button { min-height: 92px; border-radius: 16px; box-shadow: var(--shadow-soft); }
.quick-actions button:hover { border-color: #92bfb1; box-shadow: 0 14px 30px rgba(23,79,67,.1); }
.quick-actions span { width: 40px; height: 40px; border-radius: 12px; }
.quick-actions strong { font-size: 9px; }
.stats { gap: 14px; margin-bottom: 22px; }
.stat-card { min-height: 116px; padding: 20px; border-color: rgba(213,227,221,.92); border-radius: 17px; box-shadow: var(--shadow-soft); }
.stat-icon { width: 44px; height: 44px; border-radius: 13px; }
.stat-card small { font-size: 8px; font-weight: 600; letter-spacing: .2px; }
.stat-card strong { font-size: 25px; }

.panel { border-color: rgba(213,227,221,.92); border-radius: 17px; box-shadow: var(--shadow-soft); }
.panel-header { min-height: 74px; padding: 19px 22px; }
.panel-header h2 { font-size: 13px; letter-spacing: .055em; }
.panel-header p { margin-top: 5px; font-size: 8px; }
.data-row { min-height: 68px; padding: 14px 20px; }
.data-row:hover { background: #f7fbf9; }
.data-row strong { font-size: 10px; }
.pill { padding: 6px 9px; font-size: 7px; }
.small-button { min-height: 32px; padding: 0 11px; border-radius: 8px; background: #fdfefd; }
.small-button:hover { border-color: #9ec3b7; box-shadow: 0 5px 12px rgba(20,62,55,.06); }
.panel-grid, .management-grid, .clinical-grid, .settings-grid { gap: 20px; }
.info-card { background: linear-gradient(145deg, #fff 20%, #edf6f2); }
.security-card { background: linear-gradient(145deg, #0b3531, #14594d); }

.calendar-toolbar { margin-bottom: 16px; padding: 15px 18px; }
.calendar-navigation { gap: 8px; }
.week-calendar { min-height: 460px; border-radius: 17px; }
.calendar-day > header { min-height: 64px; background: #f8faf9; }
.calendar-day.is-today > header { background: #e4f2ec; }
.calendar-appointments { padding: 10px; gap: 8px; }
.appointment-card { padding: 11px; border-radius: 9px; box-shadow: 0 4px 12px rgba(20,62,55,.045); }
.appointment-card time { font-size: 8px; }
.appointment-card strong { font-size: 9px; line-height: 1.35; }
.section-tabs { margin-bottom: 20px; padding: 6px; border-radius: 13px; box-shadow: var(--shadow-soft); }
.section-tabs button { min-height: 38px; border-radius: 9px; }
.form-body { padding: 22px; gap: 16px; }
.form-body input, .form-body select { height: 44px; border-radius: 9px; }
.schedule-day { padding: 12px; border-radius: 11px; }
.side-drawer { width: min(560px, 100%); box-shadow: -24px 0 70px rgba(10,45,40,.22); }
.drawer-header { padding: 24px 26px; }
.drawer-form { padding: 26px; }
.toast { bottom: 34px; padding: 14px 20px; border-radius: 11px; font-size: 10px; }

@media (max-width: 1100px) {
  .trust-list { grid-template-columns: 1fr; }
  .trust-list span { min-height: auto; }
}
@media (max-width: 820px) {
  .sidebar { width: 265px; }
  .workspace { width: 100%; margin-left: 0; }
  .topbar { height: 72px; padding: 0 14px; gap: 10px; }
  .topbar-context { display: none; }
  .content { padding: 26px 15px 48px; }
  .login-card { padding: 25px; }
}
@media (max-width: 520px) {
  .login-panel { padding: 18px 12px 30px; }
  .login-card { padding: 22px 18px; border-radius: 18px; }
  .mobile-brand { margin-bottom: 30px; }
  .page-heading { margin-bottom: 23px; }
  .page-heading h1 { font-size: 25px; }
  .quick-actions { gap: 9px; }
  .quick-actions button { min-height: 86px; border-radius: 14px; }
  .stat-card { min-width: 190px; }
}
