 :root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#172033;background:#f4f7fb;line-height:1.45}*{box-sizing:border-box}html,body,#app{margin:0;min-height:100%;min-height:100vh}body{background:#f4f7fb}.app-shell{min-height:100vh;display:flex}.sidebar{width:216px;flex:0 0 216px;background:#101827;color:#c7d0df;padding:0 7px 10px;position:sticky;top:0;height:100vh;display:flex;flex-direction:column;overflow:hidden}.sidebar-brand{flex:0 0 auto;background:#fff;border-radius:0;margin:0 -7px 10px;padding:0;display:flex;align-items:center;justify-content:center;height:68px;overflow:hidden}.sidebar-logo{display:block;width:100%;max-width:none;height:68px;object-fit:contain}.sidebar-nav{flex:1;min-height:0;overflow:auto;padding:0}.nav-group{margin:15px 0 0}.nav-section-button,.nav-section-static{width:100%;border:0;background:transparent;padding:5px 9px;color:#6f82a4;font-size:10px;font-weight:500;letter-spacing:.025em;text-transform:uppercase;text-align:left;line-height:1.2}.nav-section-button{display:flex;align-items:center;justify-content:space-between;cursor:pointer;font-family:inherit}.nav-section-button:hover{color:#9aacc9}.nav-section-static{display:block}.nav-chevron{width:6px;height:6px;border-right:1px solid currentColor;border-bottom:1px solid currentColor;transform:rotate(45deg);opacity:.55;transition:transform .15s,opacity .15s}.nav-chevron.open{transform:rotate(225deg);opacity:.75}.nav-subitems{padding:2px 0 0}.nav-item{display:flex;align-items:center;gap:10px;text-decoration:none;color:#d0d8e6;padding:8px 10px;border-radius:6px;margin:1px 0;font-size:14px;font-weight:400;line-height:1.25;min-height:34px}.nav-item:hover{background:#1b263a;color:#f7f9fc}.nav-item.router-link-active{background:#273653;color:#fff}.nav-item-main{margin:0 0 9px;color:#edf2fa;font-weight:400}.nav-icon{position:relative;width:12px;min-width:12px;height:14px;display:inline-flex;align-items:center;justify-content:center;color:#a8b8d2}.nav-item:hover .nav-icon,.nav-item.router-link-active .nav-icon{color:#c5d3ea}.nav-icon-dashboard:before{content:"";width:7px;height:7px;border:1.4px solid currentColor;border-radius:1.5px;display:block}.nav-icon-person:before{content:"";width:5px;height:5px;border:1.2px solid currentColor;border-radius:50%;position:absolute;top:1px}.nav-icon-person:after{content:"";width:9px;height:5px;border:1.2px solid currentColor;border-bottom:0;border-radius:7px 7px 0 0;position:absolute;bottom:1px}.nav-icon-prospect:before{content:"";width:5px;height:5px;border:1.2px solid currentColor;border-radius:50%;position:absolute;top:1px}.nav-icon-prospect:after{content:"";width:8px;height:4px;border:1.2px solid currentColor;border-radius:6px 6px 0 0;position:absolute;bottom:1px}.nav-icon-group:before{content:"♧";font-size:13px;line-height:1}.nav-icon-folder:before{content:"";width:9px;height:7px;border:1.2px solid currentColor;border-radius:1px;display:block}.nav-icon-clock:before{content:"";width:8px;height:8px;border:1.2px solid currentColor;border-radius:50%;display:block}.nav-icon-clock:after{content:"";position:absolute;width:3px;height:1px;background:currentColor;transform:rotate(35deg);top:7px;left:6px}.nav-icon-check:before{content:"✓";font-size:13px;line-height:1}.nav-icon-mail:before{content:"";width:9px;height:6px;border:1.2px solid currentColor;border-radius:1px;display:block}.nav-icon-operation:before{content:"□";font-size:13px;line-height:1}.nav-icon-plus:before{content:"+";font-size:15px;font-weight:300;line-height:1}.nav-icon-cart:before{content:"";width:8px;height:6px;border:1.2px solid currentColor;border-top:0;display:block;transform:skew(-10deg)}.nav-icon-cart:after{content:"••";font-size:9px;letter-spacing:2px;position:absolute;bottom:-4px;left:2px}.nav-icon-document:before{content:"";width:7px;height:9px;border:1.2px solid currentColor;border-radius:1px;display:block}.nav-icon-payment:before{content:"$";font-size:12px;line-height:1}.nav-icon-stock:before{content:"";width:9px;height:8px;border:1.2px solid currentColor;display:block}.nav-icon-movement:before{content:"↕";font-size:14px;line-height:1}.nav-icon-transfer:before{content:"⇄";font-size:13px;line-height:1}.nav-icon-reservation:before{content:"";width:7px;height:8px;border:1.2px solid currentColor;border-radius:1px;display:block}.nav-icon-warehouse:before{content:"";width:9px;height:8px;border:1.2px solid currentColor;display:block}.nav-icon-product:before{content:"";width:8px;height:8px;border:1.2px solid currentColor;display:block}.nav-icon-category:before{content:"☷";font-size:13px;line-height:1}.nav-icon-variant:before{content:"◇";font-size:13px;line-height:1}.nav-icon-price:before{content:"$";font-size:11px;line-height:1}.nav-icon-promotion:before{content:"%";font-size:11px;line-height:1}.nav-icon-tax:before{content:"%";font-size:11px;line-height:1}.nav-icon-bundle:before{content:"⊞";font-size:13px;line-height:1}.nav-icon-branch:before{content:"⌂";font-size:13px;line-height:1}.nav-icon-channel:before{content:"↔";font-size:13px;line-height:1}.nav-icon-delivery:before{content:"›";font-size:17px;line-height:1}.nav-icon-report:before{content:"▥";font-size:12px;line-height:1}.nav-icon-company:before{content:"▥";font-size:11px;line-height:1}.nav-icon-roles:before{content:"◇";font-size:12px;line-height:1}.nav-icon-settings:before{content:"⚙";font-size:12px;line-height:1}.sidebar-footer{flex:0 0 auto;border-top:1px solid #1e293b;margin-top:8px;padding:10px 10px 1px;color:#62718a;font-size:10px}.app-main{min-width:0;flex:1;width:auto}.topbar{height:68px;background:#fff;border-bottom:1px solid #e3e8ef;display:flex;align-items:center;justify-content:space-between;padding:0 28px;position:sticky;top:0;z-index:20}.topbar-spacer{flex:1}.topbar-actions{display:flex;align-items:center;justify-content:flex-end;gap:14px}.topbar-icon-button,.topbar-help,.topbar-language-option,.topbar-profile-button{border:0;background:transparent;color:#344054;font:inherit;cursor:pointer}.topbar-icon-button{width:34px;height:34px;border-radius:7px;display:grid;place-items:center}.topbar-icon-button:hover,.topbar-help:hover,.topbar-language-option:hover,.topbar-profile-button:hover{background:#f5f7fa}.topbar-bell-emoji{display:block;font-size:18px;line-height:1}.topbar-help{padding:7px 6px;font-size:14px;color:#344054}.topbar-language{display:flex;align-items:center;gap:2px;padding:2px;border-radius:8px}.topbar-language-option{display:flex;align-items:center;justify-content:center;padding:6px 9px;border-radius:7px;font-size:12px;color:#536174}.topbar-language-current{background:#eef3ff;color:#175cd3;font-weight:700;min-width:38px}.topbar-flag{font-size:15px;line-height:1}.topbar-profile{position:relative}.topbar-profile-button{display:flex;align-items:center;gap:9px;padding:4px 7px 4px 4px;border-radius:9px}.topbar-avatar{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:#e8edff;color:#315efb;font-size:16px;font-weight:800}.topbar-profile-name{font-size:14px;font-weight:600;color:#344054;max-width:180px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.topbar-profile-chevron{width:6px;height:6px;border-right:1px solid currentColor;border-bottom:1px solid currentColor;transform:rotate(45deg);margin:0 2px 3px 1px;transition:transform .15s}.topbar-profile-chevron.open{transform:rotate(225deg);margin-top:5px;margin-bottom:0}.topbar-profile-menu{position:absolute;right:0;top:calc(100% + 7px);min-width:150px;background:#fff;border:1px solid #e3e8ef;border-radius:9px;box-shadow:0 10px 28px rgba(16,24,40,.14);padding:5px;z-index:30}.topbar-profile-menu-item{display:block;width:100%;border:0;background:transparent;text-align:left;padding:9px 10px;border-radius:6px;color:#344054;font:inherit;font-size:13px;cursor:pointer}.topbar-profile-menu-item:hover{background:#f5f7fa;color:#175cd3}.page-content{padding:30px;max-width:none}.page-header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:22px}.page-header h1{font-size:26px;line-height:1.2;margin:0 0 6px}.card{background:#fff;border:1px solid #e3e8ef;border-radius:12px;padding:20px;box-shadow:0 1px 2px rgba(16,24,40,.03)}.dashboard-grid{display:grid;grid-template-columns:repeat(2,minmax(220px,1fr));gap:18px}.metric-label{color:#667085;font-size:13px}.metric-value{font-size:28px;font-weight:700;margin-top:8px}.button{border:0;border-radius:7px;padding:9px 15px;font:inherit;font-size:14px;font-weight:600;cursor:pointer;transition:.15s}.button:disabled{opacity:.55;cursor:not-allowed}.button-primary{background:#175cd3;color:#fff}.button-primary:hover:not(:disabled){background:#124db5}.button-secondary{background:#eef1f5;color:#344054}.button-ghost{background:transparent;color:#536174}.login-page{min-height:100vh;display:grid;place-items:center;padding:24px;background:#f4f7fb}.login-card{width:min(430px,100%);padding:34px}.login-brand{margin-bottom:28px}.login-logo{display:block;width:352px;height:auto}.login-title{margin:0 0 5px;font-size:22px}.login-submit{width:100%;margin-top:6px;height:44px}.form-field{margin:0 0 17px}.form-field label{display:block;margin-bottom:7px;font-size:13px;font-weight:700;color:#344054}.form-field input{display:block;width:100%;height:43px;border:1px solid #cfd6df;border-radius:7px;padding:9px 11px;font:inherit;background:#fff}.form-field input:focus{outline:none;border-color:#84aef5;box-shadow:0 0 0 3px rgba(23,92,211,.1)}.alert{padding:11px 13px;border-radius:8px;margin:0 0 17px;font-size:14px}.error{background:#fff0f0;color:#b42318;border:1px solid #fecdca}.state{padding:28px;text-align:center;color:#667085}.table-wrap{overflow:auto}.data-table{width:100%;border-collapse:collapse;font-size:14px}.data-table th,.data-table td{text-align:left;padding:12px 10px;border-bottom:1px solid #edf0f4;vertical-align:top}.data-table th{font-size:12px;text-transform:uppercase;letter-spacing:.03em;color:#667085;background:#fafbfc}.data-table tr:last-child td{border-bottom:0}.pagination{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-top:18px}.muted{color:#667085}.info-banner{background:#eef6ff;border:1px solid #cfe2ff;color:#174ea6;padding:12px 14px;border-radius:9px;margin-bottom:18px;font-size:14px}.status-pill{display:inline-flex;padding:3px 8px;border-radius:999px;background:#edf3fb;color:#175cd3;font-size:12px;font-weight:700}@media(max-width:900px){.sidebar{width:210px;flex-basis:210px}.page-content{padding:20px}}@media(max-width:700px){.app-shell{display:block}.sidebar{width:100%;height:auto;position:relative;border-right:0;border-bottom:1px solid #273142}.sidebar-nav{overflow:visible}.topbar{padding:0 16px}.topbar-actions{gap:6px}.topbar-help{display:none}.topbar-profile-name{display:none}.topbar-language-option{padding:6px}.topbar-flag{font-size:14px}.page-content{padding:16px}.dashboard-grid{grid-template-columns:1fr}.page-header{align-items:stretch;flex-direction:column}}
.login-version{margin-top:18px;text-align:center;color:#8b95a7;font-size:11px}.navigation-placeholder{min-height:220px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}.navigation-placeholder-icon{font-size:34px;color:#175cd3;margin-bottom:8px}.navigation-placeholder h2{margin:0 0 6px;font-size:18px}.navigation-placeholder p{margin:0;max-width:560px;color:#667085}
/* CoreFlow CRM shared UI primitives — Clientes */
.module-filters{display:flex;gap:10px;align-items:center;margin-bottom:16px}.module-search{flex:1;min-width:180px;height:40px;border:1px solid #cfd6df;border-radius:7px;padding:8px 11px;font:inherit;background:#fff}.module-search:focus{outline:none;border-color:#84aef5;box-shadow:0 0 0 3px rgba(23,92,211,.1)}.person-cell{display:flex;align-items:center;gap:10px}.person-avatar{width:36px;height:36px;min-width:36px;border-radius:50%;display:grid;place-items:center;background:#e8edff;color:#315efb;font-weight:700;font-size:12px}.person-avatar-large{width:46px;height:46px;min-width:46px;font-size:14px}.small-text{font-size:11px}.actions-cell{white-space:nowrap}.button-small{padding:6px 9px;font-size:12px;margin-left:4px}.status-active{background:#e4f7f0;color:#11765a}.status-inactive{background:#eef1f5;color:#687386}.ui-modal-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.52);display:flex;align-items:center;justify-content:center;padding:20px;z-index:100}.ui-modal{width:min(560px,100%);max-height:calc(100vh - 40px);overflow:auto;background:#fff;border:1px solid #e3e8ef;border-radius:12px;box-shadow:0 20px 60px rgba(16,24,40,.22)}.ui-modal-wide{width:min(720px,100%)}.ui-modal-confirm{width:min(460px,100%)}.ui-modal-message{width:min(440px,100%);text-align:center;padding:26px}.ui-modal-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:20px 22px 10px}.ui-modal-header h3{margin:0;font-size:18px}.ui-modal-header p{margin:4px 0 0}.ui-modal-close{border:0;background:transparent;color:#667085;font-size:25px;line-height:1;cursor:pointer;padding:0 3px}.ui-modal-body{padding:10px 22px 20px}.ui-modal-footer{display:flex;justify-content:flex-end;gap:9px;padding:14px 22px 20px;border-top:1px solid #edf0f4}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.form-field{margin:0}.form-field label{display:block;margin-bottom:6px;font-size:12px;font-weight:700;color:#344054}.form-field input,.form-field select,.form-field textarea{display:block;width:100%;border:1px solid #cfd6df;border-radius:7px;padding:9px 10px;font:inherit;background:#fff}.form-field textarea{resize:vertical}.form-field input:focus,.form-field select:focus,.form-field textarea:focus{outline:none;border-color:#84aef5;box-shadow:0 0 0 3px rgba(23,92,211,.1)}.form-field-full{grid-column:1 / -1}.person-detail-head{display:flex;align-items:center;gap:12px}.person-detail-head h3{margin:0}.detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.detail-grid>div{padding-bottom:12px;border-bottom:1px solid #edf0f4}.detail-grid span,.detail-notes>span{display:block;color:#667085;font-size:11px;margin-bottom:4px}.detail-grid strong{font-size:14px}.detail-notes{margin-top:18px;padding:14px;background:#f8fafc;border:1px solid #edf0f4;border-radius:8px}.ui-message-icon{width:46px;height:46px;border-radius:50%;display:grid;place-items:center;margin:0 auto 12px;font-weight:800;font-size:20px}.message-success{background:#e4f7f0;color:#11765a}.message-error{background:#fde8eb;color:#b22f40}.message-warning{background:#fff2d6;color:#94600b}.message-info{background:#e9edff;color:#315efb}.button-danger{background:#b42318;color:#fff}.button-danger:hover:not(:disabled){background:#912018}.ui-modal-message .ui-modal-footer{border-top:0;padding-bottom:0}.ui-modal-confirm .ui-modal-body{padding-top:16px}@media(max-width:700px){.form-grid,.detail-grid{grid-template-columns:1fr}.form-field-full{grid-column:auto}.module-filters{align-items:stretch;flex-direction:column}.module-search{width:100%}.actions-cell{white-space:normal}.button-small{margin:2px 2px 2px 0}}

.dashboard-page{width:100%}.dashboard-period{display:flex;align-items:center;gap:10px;margin:-4px 0 18px;color:#667085;font-size:13px}.dashboard-period strong{color:#344054;font-weight:600}.dashboard-metrics{display:grid;grid-template-columns:repeat(4,minmax(180px,1fr));gap:16px;margin-bottom:18px}.dashboard-metric{display:flex;align-items:center;gap:14px;padding:18px}.dashboard-metric-icon{width:42px;height:42px;border-radius:10px;display:grid;place-items:center;background:#eef3ff;color:#315efb;font-weight:800}.dashboard-columns{display:grid;grid-template-columns:1fr 1fr;gap:18px}.dashboard-section-header{display:flex;align-items:flex-start;justify-content:space-between;gap:15px;padding-bottom:14px;border-bottom:1px solid #edf0f4}.dashboard-section-header h2{margin:0 0 3px;font-size:17px}.dashboard-section-header p{margin:0;font-size:12px}.dashboard-list{display:flex;flex-direction:column}.dashboard-list-item{display:flex;align-items:flex-start;gap:11px;padding:13px 0;border-bottom:1px solid #edf0f4}.dashboard-list-item:last-child{border-bottom:0}.dashboard-list-dot{width:8px;height:8px;min-width:8px;margin-top:6px;border-radius:50%;background:#315efb}.dashboard-list-dot-warning{background:#d98a00}.dashboard-list-content{display:flex;flex-direction:column;gap:2px;min-width:0}.dashboard-list-content strong{font-size:13px;color:#344054;font-weight:600}.dashboard-list-content span{font-size:11px}.dashboard-empty{padding:24px 10px}@media(max-width:1000px){.dashboard-metrics{grid-template-columns:repeat(2,minmax(180px,1fr))}.dashboard-columns{grid-template-columns:1fr}}@media(max-width:700px){.dashboard-metrics{grid-template-columns:1fr}}
.group-members-section{margin-top:22px;border-top:1px solid #edf0f4;padding-top:18px}.group-members-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}.group-members-header h4{margin:0;font-size:15px}.group-members-header p{margin:3px 0 0}

/* CoreFlow Reports — shared report UI */
.reports-page{width:100%}.report-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(170px,1fr));gap:16px;margin-bottom:18px}.report-kpi-card{display:flex;align-items:center;gap:14px;padding:18px}.report-kpi-icon{width:42px;height:42px;border-radius:10px;display:grid;place-items:center;background:#eef3ff;color:#315efb;font-weight:800}.report-kpi-content{min-width:0}.report-filters{margin-bottom:18px}.report-filter-grid{display:grid;grid-template-columns:repeat(4,minmax(160px,1fr));gap:14px}.report-filter-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:14px}.report-period-spacer{height:0}.report-chart-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-bottom:18px}.report-chart-grid-single{grid-template-columns:1fr}.report-chart{min-width:0}.report-chart .dashboard-section-header{margin-bottom:14px}.report-bars{display:flex;flex-direction:column;gap:11px;padding-top:6px}.report-bar-row{display:grid;grid-template-columns:minmax(100px,160px) 1fr minmax(55px,90px);gap:10px;align-items:center}.report-bar-label{font-size:12px;color:#344054;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.report-bar-track{height:11px;background:#edf1f6;border-radius:99px;overflow:hidden}.report-bar-fill{height:100%;background:#175cd3;border-radius:99px;min-width:3px}.report-bar-value{text-align:right;font-size:12px;font-weight:700;color:#344054}.report-donut-wrap{display:flex;align-items:center;justify-content:center;gap:28px;min-height:220px}.report-donut{width:190px;height:190px;border-radius:50%;display:grid;place-items:center;flex:0 0 190px}.report-donut-hole{width:112px;height:112px;border-radius:50%;background:#fff;display:grid;place-items:center;font-size:22px;font-weight:700;color:#344054}.report-legend{min-width:180px;display:flex;flex-direction:column;gap:9px}.report-legend-row{display:grid;grid-template-columns:10px 1fr auto;align-items:center;gap:8px;font-size:12px}.report-legend-dot{width:8px;height:8px;border-radius:50%;display:block}.report-legend-label{color:#667085}.report-financial-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.report-financial-grid>div{background:#f8fafc;border:1px solid #edf0f4;border-radius:9px;padding:14px;display:flex;flex-direction:column;gap:5px}.report-financial-grid span{font-size:11px}.report-financial-grid strong{font-size:17px}.report-line-chart{overflow:hidden}.report-line-chart svg{width:100%;height:250px;display:block}.report-chart-axis{stroke:#d9e0e8;stroke-width:1}.report-line{stroke:#175cd3;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}.report-line-point{fill:#fff;stroke:#175cd3;stroke-width:3}.report-line-labels{display:flex;justify-content:space-between;gap:8px;font-size:10px;color:#667085;overflow:hidden}.report-line-labels span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.report-empty-state{min-height:120px;display:flex;align-items:center;justify-content:center}.report-summary-card{margin-bottom:18px}
@media(max-width:1100px){.report-kpi-grid{grid-template-columns:repeat(2,minmax(170px,1fr))}.report-filter-grid{grid-template-columns:repeat(2,minmax(160px,1fr))}.report-financial-grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:760px){.report-kpi-grid,.report-chart-grid,.report-filter-grid,.report-financial-grid{grid-template-columns:1fr}.report-filter-actions{justify-content:stretch}.report-filter-actions .button{flex:1}.report-donut-wrap{flex-direction:column}.report-bar-row{grid-template-columns:90px 1fr 65px}}

/* Administration — Users / Roles */
.ui-modal textarea{display:block;width:100%;border:1px solid #cfd6df;border-radius:7px;padding:9px 11px;font:inherit;background:#fff;resize:vertical}.check-grid{display:grid;grid-template-columns:repeat(2,minmax(220px,1fr));gap:8px 12px}.check-item{display:flex;align-items:flex-start;gap:8px;padding:9px 10px;border:1px solid #edf0f4;border-radius:7px;background:#fafbfc;font-size:13px;color:#344054}.check-item input{margin-top:3px}.check-item span{display:flex;flex-direction:column;gap:2px}.check-item small{font-size:11px;color:#667085}.permission-groups{display:flex;flex-direction:column;gap:14px}.permission-group{border:1px solid #edf0f4;border-radius:9px;padding:12px}.permission-group h4{margin:0 0 9px;font-size:12px;color:#667085;text-transform:uppercase;letter-spacing:.04em}.tag-pill{display:inline-flex;margin:0 4px 4px 0;padding:3px 7px;border-radius:999px;background:#eef3ff;color:#315efb;font-size:11px;font-weight:700}.status-pill-inactive{background:#f2f4f7;color:#667085}.admin-danger{background:#fff0f0;color:#b42318}.admin-danger:hover:not(:disabled){background:#ffe1e1}.small-state{padding:12px;text-align:left}.actions-cell{white-space:nowrap}.actions-cell .button{margin:0 4px 4px 0}
@media(max-width:760px){.check-grid{grid-template-columns:1fr}.actions-cell{white-space:normal}}

/* Appointments calendar */
.appointments-header-actions{display:flex;gap:8px;align-items:center}.appointments-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:18px;align-items:start}.appointments-calendar-card,.appointments-day-card,.appointments-list-card{min-width:0}.calendar-toolbar,.appointments-day-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}.calendar-toolbar h2,.appointments-day-head h2,.section-card-title{font-size:17px;margin:0 0 4px;text-transform:capitalize}.calendar-nav{display:flex;gap:5px}.calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));border-top:1px solid #e8edf3;border-left:1px solid #e8edf3}.calendar-weekday{padding:9px 4px;text-align:center;background:#f8fafc;color:#667085;font-size:11px;font-weight:700;border-right:1px solid #e8edf3;border-bottom:1px solid #e8edf3}.calendar-day{appearance:none;display:flex;flex-direction:column;align-items:stretch;text-align:left;gap:4px;min-height:91px;padding:7px 6px;border:0;border-right:1px solid #e8edf3;border-bottom:1px solid #e8edf3;background:#fff;cursor:pointer;overflow:hidden;color:#344054;font:inherit}.calendar-day:hover{background:#f8faff}.calendar-day-outside{background:#fafbfc;color:#98a2b3}.calendar-day-selected{background:#eff4ff;box-shadow:inset 0 0 0 2px #315efb}.calendar-day-today .calendar-day-number{background:#315efb;color:#fff}.calendar-day-number{width:24px;height:24px;display:grid;place-items:center;border-radius:50%;font-size:12px;font-weight:700}.calendar-day-count{font-size:10px;color:#315efb;font-weight:700}.calendar-event{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:4px;background:#e8efff;color:#2549a6;padding:3px 4px;font-size:10px;cursor:pointer}.calendar-more{font-size:10px;color:#667085}.calendar-legend{display:flex;align-items:center;gap:7px;margin-top:12px;font-size:11px}.calendar-legend-dot{width:8px;height:8px;border-radius:50%;background:#315efb}.appointments-day-card{padding:18px}.appointments-day-head{align-items:flex-start}.appointments-day-head p{margin:0}.appointments-empty{padding:28px 10px}.appointment-list-item{display:flex;flex-direction:column;align-items:flex-start;gap:5px;width:100%;padding:12px 0;border:0;border-top:1px solid #edf0f4;background:transparent;text-align:left;cursor:pointer;color:#344054}.appointment-list-item:hover strong{color:#315efb}.appointment-time{font-size:11px;font-weight:700;color:#315efb}.appointment-list-item>span:not(.appointment-time):not(.appointment-item-actions){font-size:12px}.appointment-list-item small{color:#667085}.appointment-location{color:#667085}.appointment-item-actions{display:flex;gap:5px;margin-top:5px}.appointments-list-card{margin-top:18px}.appointments-list-card .module-filters>div{min-width:220px}.appointments-list-card .module-search{max-width:420px}.appointments-list-card .section-card-title{margin-bottom:3px}.appointments-view .form-field small{display:block;margin-top:5px;font-size:10px;line-height:1.4}
@media(max-width:1050px){.appointments-layout{grid-template-columns:minmax(0,1fr)}.appointments-day-card{order:2}.calendar-day{min-height:76px}}
@media(max-width:650px){.appointments-header-actions{flex-direction:column;align-items:stretch}.calendar-day{min-height:58px;padding:4px 3px}.calendar-event{font-size:9px}.calendar-day-count{font-size:9px}.calendar-toolbar{align-items:flex-start;flex-direction:column}.appointments-list-card .module-filters{flex-direction:column}.appointments-list-card .module-search{max-width:none}}

/* CoreFlow 0.4.37 appointments calendar refinements */
.calendar-view-toggle{display:flex;gap:3px;margin-right:6px}.appointment-time{font-size:15px!important;font-weight:800!important;line-height:1.35}.appointment-list-item>strong{font-size:14px;font-weight:750}.calendar-grid-week{grid-template-rows:auto minmax(130px,auto)}.calendar-grid-week .calendar-day{min-height:130px}


/* Tasks module */
.task-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:18px}.task-summary{padding:18px 20px;display:flex;flex-direction:column;gap:8px}.task-summary span{font-size:.9rem;color:var(--text-muted,#687386)}.task-summary strong{font-size:1.8rem;line-height:1.1}.task-filters{align-items:end;flex-wrap:wrap}.task-filters select,.task-status-select{min-height:38px;border:1px solid var(--border-color,#d9dee7);border-radius:8px;padding:7px 10px;background:var(--surface,#fff);color:inherit}.task-priority{display:inline-flex;padding:4px 8px;border-radius:999px;font-size:.78rem;font-weight:700;white-space:nowrap}.priority-low{background:#edf2f7;color:#526174}.priority-normal{background:#e8f1ff;color:#2458a6}.priority-high{background:#fff1d6;color:#8b5700}.priority-urgent{background:#ffe5e5;color:#a51d1d}.task-status-select{max-width:150px;font-size:.86rem}@media(max-width:900px){.task-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.task-filters{align-items:stretch}.task-filters .module-search{min-width:180px}}@media(max-width:520px){.task-summary-grid{grid-template-columns:1fr 1fr;gap:10px}.task-summary{padding:14px}}

/* Communications and Operations */
.communications-layout{display:grid;grid-template-columns:minmax(260px,340px) minmax(0,1fr);gap:16px;align-items:stretch}.communications-sidebar,.communications-main{min-width:0;overflow:hidden}.communications-list-header{padding:16px;border-bottom:1px solid var(--border-color,#e5e7eb);display:grid;gap:12px}.conversation-item{display:flex;width:100%;flex-direction:column;align-items:flex-start;gap:5px;padding:14px 16px;border:0;border-bottom:1px solid var(--border-color,#e5e7eb);background:transparent;text-align:left;cursor:pointer;color:inherit}.conversation-item:hover,.conversation-selected{background:var(--surface-hover,#f3f4f6)}.conversation-item strong{font-size:14px}.conversation-item span{font-size:12px}.conversation-detail-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:18px;border-bottom:1px solid var(--border-color,#e5e7eb)}.conversation-detail-header h2{margin:0 0 6px}.message-list{padding:16px;display:flex;flex-direction:column;gap:12px;min-height:220px;max-height:460px;overflow:auto}.message-entry{border:1px solid var(--border-color,#e5e7eb);border-radius:10px;padding:12px 14px;background:var(--surface,#fff)}.message-entry p{white-space:pre-wrap;overflow-wrap:anywhere;margin:10px 0}.message-entry-header{display:flex;justify-content:space-between;gap:12px}.message-compose{border-top:1px solid var(--border-color,#e5e7eb);padding:16px}.message-compose-actions{display:flex;justify-content:flex-end;margin-top:12px}.communications-empty{min-height:400px;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;padding:24px}.communications-empty h3{margin-bottom:4px}@media(max-width:900px){.communications-layout{grid-template-columns:1fr}.communications-sidebar{max-height:360px;overflow:auto}.conversation-detail-header{flex-direction:column}}

/* Sales: carts, orders and payments */
.sales-view .sales-header-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.sales-view .sales-summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:18px}.sales-view .sales-summary-grid>div{border:1px solid #edf0f4;border-radius:8px;padding:12px;background:#fafbfc;min-width:0}.sales-view .sales-summary-grid span{display:block;color:#667085;font-size:11px;margin-bottom:5px}.sales-view .sales-summary-grid strong{font-size:14px;overflow-wrap:anywhere}.sales-view .sales-subheading{font-size:14px;margin:18px 0 10px}.sales-view .sales-add-line{display:grid;grid-template-columns:minmax(0,2fr) minmax(100px,1fr) auto;gap:12px;align-items:end;padding:14px 0 4px}.sales-view .sales-quantity{width:88px;min-width:72px;padding:7px;border:1px solid #cfd6df;border-radius:6px;font:inherit}.sales-view .sales-notice{background:#fff7e6;border:1px solid #f4d79b;color:#7a5200;border-radius:8px;padding:12px;margin-bottom:16px;font-size:13px}.sales-view .sales-reason{margin-top:14px}.sales-view .sales-footnote{margin:12px 0 0}.sales-cart-modal{width:min(1050px,100%)}.sales-view .pagination{display:flex;align-items:center;justify-content:flex-end;gap:12px;padding:14px 16px}.sales-view .pagination span{font-size:12px;color:#667085}@media(max-width:760px){.sales-view .sales-summary-grid{grid-template-columns:1fr 1fr}.sales-view .sales-add-line{grid-template-columns:1fr}.sales-view .sales-header-actions{width:100%}.sales-view .sales-header-actions .button{flex:1}}

/* Sales status semantics */
.status-pill-success{background:#dcfae6;color:#067647;border:1px solid #abefc6}.status-pill-danger{background:#fee4e2;color:#b42318;border:1px solid #fecdca}.status-pill-warning{background:#fef0c7;color:#93370d;border:1px solid #fedf89}

.assignment-limit-input{width:100px;min-width:90px;height:36px;border:1px solid #cfd6df;border-radius:7px;padding:7px 8px;font:inherit;background:#fff}.assignment-limit-input:focus{outline:none;border-color:#84aef5;box-shadow:0 0 0 3px rgba(23,92,211,.1)}


/* Healthcare extension: reuse CoreFlow cards, fields, buttons and modal language. */
.alert.success{background:#ecfdf3;color:#027a48;border:1px solid #abefc6}
.healthcare-panel{margin-top:24px;padding-top:20px;border-top:1px solid var(--border-color,#e5e7eb)}
.healthcare-heading,.healthcare-section-title{display:flex;align-items:center;justify-content:space-between;gap:12px}
.healthcare-heading h3,.healthcare-section-title h4{margin:0}
.healthcare-section{margin-top:18px;padding:16px;border:1px solid var(--border-color,#e5e7eb);border-radius:12px}
.healthcare-section-title{margin-bottom:12px}
.healthcare-history{margin:14px 0;padding:12px;border-radius:10px;background:var(--surface-secondary,#f8fafc)}
.healthcare-history-list{display:flex;flex-wrap:nowrap;gap:8px;margin-top:8px;max-width:100%;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;touch-action:pan-x}
.healthcare-history-list>.button{flex:0 0 auto;max-width:none;white-space:nowrap}
.healthcare-form{margin-top:12px}
.healthcare-read{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.healthcare-value{display:flex;flex-direction:column;gap:4px;padding:9px 10px;border-radius:8px;background:var(--surface-secondary,#f8fafc);min-width:0}
.healthcare-value span{font-size:12px;color:var(--text-muted,#64748b)}
.healthcare-value strong{font-size:13px;white-space:pre-wrap;overflow-wrap:anywhere;font-weight:500}
.healthcare-value-full{grid-column:1/-1}
.healthcare-eye-grid{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.healthcare-eye-grid h5{margin:8px 0}
.healthcare-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-top:12px}
.healthcare-confirm{margin-top:12px;padding:12px;border:1px solid var(--border-color,#e5e7eb);border-radius:9px}
.healthcare-confirm p{margin-top:0}
@media(max-width:700px){.healthcare-read,.healthcare-eye-grid{grid-template-columns:1fr}.healthcare-section{padding:12px}}
/* PWA update prompt */
.pwa-update-banner{position:sticky;top:68px;z-index:19;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 24px;background:#eef6ff;border-bottom:1px solid #cfe2ff;color:#174ea6;font-size:14px}
.pwa-update-banner .button{flex:0 0 auto}
@media(max-width:700px){.pwa-update-banner{top:68px;align-items:stretch;flex-direction:column;padding:12px 16px}.pwa-update-banner .button{width:100%;min-height:44px}}

/* Responsive navigation shell */
.topbar-menu-button{display:none}
.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:800px){
  html,body{max-width:100%;overflow-x:hidden}
  .app-shell,.app-main{min-width:0;max-width:100%}
  .app-shell{display:block}
  .sidebar{position:fixed;z-index:50;inset:0 auto 0 0;width:min(320px,86vw);height:100vh;height:100dvh;max-width:100%;padding:env(safe-area-inset-top) 7px env(safe-area-inset-bottom);border:0;box-shadow:12px 0 36px rgba(0,0,0,.2);transform:translateX(-105%);visibility:hidden;transition:transform .22s ease,visibility .22s linear;will-change:transform}
  .sidebar.sidebar-open{transform:translateX(0);visibility:visible;transition:transform .22s ease,visibility 0s}
  .sidebar-brand{margin-top:0}
  .sidebar-nav{overflow:auto;overscroll-behavior:contain}
  .mobile-nav-backdrop{position:fixed;inset:0;z-index:40;width:100%;height:100%;padding:0;border:0;background:rgba(15,23,42,.48);cursor:pointer}
  .topbar{height:auto;min-height:calc(60px + env(safe-area-inset-top));padding:env(safe-area-inset-top) max(12px,env(safe-area-inset-right)) 0 max(12px,env(safe-area-inset-left));z-index:30;gap:8px}
  .topbar-menu-button{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;padding:0;border:0;border-radius:8px;background:transparent;color:#344054;cursor:pointer}
  .topbar-menu-button:hover,.topbar-menu-button:focus-visible{background:#f1f4f8}
  .topbar-menu-icon,.topbar-menu-icon:before,.topbar-menu-icon:after{display:block;width:20px;height:2px;border-radius:2px;background:currentColor}
  .topbar-menu-icon{position:relative}
  .topbar-menu-icon:before,.topbar-menu-icon:after{position:absolute;left:0;content:""}
  .topbar-menu-icon:before{top:-6px}
  .topbar-menu-icon:after{top:6px}
  .topbar-actions{gap:4px}
  .topbar-icon-button{width:40px;height:40px}
  .topbar-language-option{min-width:40px;min-height:40px}
  .topbar-profile-button{min-height:44px;padding:4px}
  .page-content{padding:20px max(16px,env(safe-area-inset-right)) 20px max(16px,env(safe-area-inset-left))}
}
@media(max-width:700px){.page-content{padding:16px max(16px,env(safe-area-inset-right)) 20px max(16px,env(safe-area-inset-left))}}
@media(prefers-reduced-motion:reduce){.sidebar{transition:none}}

/* Mobile presentation for dense CRM lists */
@media(max-width:700px){
  .persons-view .table-wrap,.prospects-view .table-wrap,.expedientes-view .table-responsive,.tasks-view .table-wrap{overflow:visible}
  .persons-view .data-table,.prospects-view .data-table,.expedientes-view .data-table,.tasks-view .data-table{display:block;width:100%}
  .persons-view .data-table thead,.prospects-view .data-table thead,.expedientes-view .data-table thead,.tasks-view .data-table thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
  .persons-view .data-table tbody,.prospects-view .data-table tbody,.expedientes-view .data-table tbody,.tasks-view .data-table tbody{display:grid;gap:12px}
  .persons-view .data-table tbody tr,.prospects-view .data-table tbody tr,.expedientes-view .data-table tbody tr,.tasks-view .data-table tbody tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start;min-width:0;padding:7px 9px;border:1px solid #e3e8ef;border-radius:10px;background:#fff;box-shadow:0 1px 2px rgba(16,24,40,.04)}
  .persons-view .data-table tbody td,.prospects-view .data-table tbody td,.expedientes-view .data-table tbody td,.tasks-view .data-table tbody td{display:flex;flex-direction:column;justify-content:center;gap:3px;min-width:0;padding:8px 7px;border:0;overflow-wrap:anywhere}
  .persons-view .data-table tbody td:before,.prospects-view .data-table tbody td:before,.expedientes-view .data-table tbody td:before,.tasks-view .data-table tbody td:before{color:#667085;font-size:10px;font-weight:700;line-height:1.25}
  .persons-view .data-table tbody td:first-child,.prospects-view .data-table tbody td:first-child,.expedientes-view .data-table tbody td:first-child,.tasks-view .data-table tbody td:first-child{grid-column:1/-1;padding-bottom:9px}
  .persons-view .data-table tbody td:last-child,.prospects-view .data-table tbody td:last-child,.expedientes-view .data-table tbody td:last-child,.tasks-view .data-table tbody td:last-child{grid-column:1/-1;border-top:1px solid #edf0f4;padding-top:10px}
  .persons-view .data-table tbody td:nth-child(2):before,.prospects-view .data-table tbody td:nth-child(2):before{content:"Teléfono / celular"}
  .persons-view .data-table tbody td:nth-child(3):before,.prospects-view .data-table tbody td:nth-child(3):before{content:"Email"}
  .persons-view .data-table tbody td:nth-child(4):before,.prospects-view .data-table tbody td:nth-child(4):before{content:"Género"}
  .persons-view .data-table tbody td:nth-child(5):before,.prospects-view .data-table tbody td:nth-child(5):before{content:"Fecha de nacimiento"}
  .persons-view .data-table tbody td:nth-child(6):before,.prospects-view .data-table tbody td:nth-child(6):before{content:"Estado"}
  .expedientes-view .data-table tbody td:nth-child(2):before{content:"Persona"}
  .expedientes-view .data-table tbody td:nth-child(3):before{content:"Operación"}
  .expedientes-view .data-table tbody td:nth-child(4):before{content:"Estado"}
  .tasks-view .data-table tbody td:nth-child(2):before{content:"Prioridad"}
  .tasks-view .data-table tbody td:nth-child(3):before{content:"Estado"}
  .tasks-view .data-table tbody td:nth-child(4):before{content:"Fecha límite"}
  .tasks-view .data-table tbody td:nth-child(5):before{content:"Persona"}
  .tasks-view .data-table tbody td:nth-child(6):before{content:"Responsable"}
  .tasks-view .data-table tbody td:nth-child(7):before{content:"Expediente"}
  .persons-view .data-table tbody td:first-child:before,.prospects-view .data-table tbody td:first-child:before,.expedientes-view .data-table tbody td:first-child:before,.tasks-view .data-table tbody td:first-child:before,.persons-view .data-table tbody td:last-child:before,.prospects-view .data-table tbody td:last-child:before,.expedientes-view .data-table tbody td:last-child:before,.tasks-view .data-table tbody td:last-child:before{content:none}
  .persons-view .data-table .actions-cell,.prospects-view .data-table .actions-cell,.expedientes-view .data-table .table-actions,.tasks-view .data-table .actions-cell{display:flex;flex-direction:row;flex-wrap:wrap;gap:6px;white-space:normal}
  .persons-view .data-table .button-small,.prospects-view .data-table .button-small,.expedientes-view .data-table .button-small,.tasks-view .data-table .button-small{min-height:40px;margin:0;padding:8px 10px}
  .tasks-view .data-table .task-status-select{width:100%;max-width:none;min-height:42px}
  .appointments-view .table-wrap{overflow-x:auto;overscroll-behavior-x:contain}
  .appointments-view .data-table{min-width:760px}
  .appointments-view .calendar-day{min-height:60px;padding:5px 3px;gap:3px}
  .appointments-view .calendar-event{display:none}
  .appointments-view .calendar-day-count{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px}
  .appointments-view .calendar-weekday{padding:8px 1px;font-size:10px}
  .dashboard-page .dashboard-metric{min-width:0;padding:14px;gap:10px}
  .dashboard-page .dashboard-columns>.card{min-width:0;padding:16px}
  .dashboard-page .dashboard-metric-detail strong,.dashboard-page .metric-value{overflow-wrap:anywhere}
}

/* Mobile forms, details and long-running modal content */
@media(max-width:700px){
  .ui-modal-backdrop{align-items:stretch;justify-content:stretch;padding:0;overscroll-behavior:contain}
  .ui-modal:not(.ui-modal-confirm):not(.ui-modal-message){display:flex;flex:1 1 auto;flex-direction:column;width:100%;height:100vh;height:100dvh;max-height:none;overflow:hidden;border:0;border-radius:0;padding:env(safe-area-inset-top) max(16px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(16px,env(safe-area-inset-left));box-shadow:none}
  .ui-modal:not(.ui-modal-confirm):not(.ui-modal-message) .ui-modal-header{flex:0 0 auto;padding:16px 4px 12px}
  .ui-modal:not(.ui-modal-confirm):not(.ui-modal-message) .ui-modal-body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:12px 4px 20px}
  .ui-modal:not(.ui-modal-confirm):not(.ui-modal-message) .ui-modal-footer{position:relative;flex:0 0 auto;justify-content:stretch;gap:8px;margin:0 -4px;padding:12px 4px 14px;background:#fff;box-shadow:0 -6px 16px rgba(16,24,40,.06)}
  .ui-modal-confirm{align-self:center;max-height:calc(100dvh - 32px);overflow:auto;border-radius:12px}
  .ui-modal-message{align-self:center;max-height:calc(100dvh - 32px);overflow:auto;border-radius:12px}
  .ui-modal-footer>.button{min-height:44px;flex:1 1 0}
  .ui-modal-close{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;margin:-8px -8px 0 0;border-radius:8px}
  .ui-modal input:not([type=checkbox]):not([type=radio]),.ui-modal select,.ui-modal textarea,.healthcare-panel input,.healthcare-panel select,.healthcare-panel textarea{min-height:44px;font-size:16px;scroll-margin-block:100px}
  .ui-modal textarea,.healthcare-panel textarea{min-height:88px}
  .ui-modal input[type=checkbox],.ui-modal input[type=radio],.healthcare-panel input[type=checkbox],.healthcare-panel input[type=radio]{width:24px;height:24px}
  .ui-modal .button,.healthcare-panel .button{min-height:44px}
  .ui-modal .ui-message-icon{flex:0 0 46px}
  .person-detail-head{align-items:flex-start;min-width:0}
  .person-detail-head>div:last-child{min-width:0;overflow-wrap:anywhere}
  .detail-grid>div,.detail-notes,.healthcare-value{min-width:0;overflow-wrap:anywhere}
  .healthcare-panel{margin-top:18px;padding-top:16px}
  .healthcare-section{margin-top:14px;padding:12px}
  .healthcare-heading,.healthcare-section-title{align-items:flex-start;flex-wrap:wrap}
  .healthcare-actions{justify-content:stretch}
  .healthcare-actions .button{flex:1 1 100%}
  .healthcare-history-list .button{max-width:none;white-space:nowrap;overflow-wrap:normal}
  .healthcare-confirm .button{margin:3px 3px 3px 0}
  .appointments-view .calendar-nav{width:100%;flex-wrap:wrap;align-items:center}
  .appointments-view .calendar-view-toggle{flex:1 1 100%;margin:0 0 4px}
  .appointments-view .calendar-view-toggle .button{flex:1;min-height:44px}
  .appointments-view .calendar-nav>.button{min-width:44px;min-height:44px}
  .appointments-view .appointment-list-item{min-height:56px;padding:14px 2px}
  .appointments-view .appointment-item-actions .button{min-width:44px;min-height:44px}
}

/* Keep the application header fixed while the page content scrolls. */
.app-main{padding-top:68px}
.topbar{position:fixed;top:0;left:216px;right:0}
@media(max-width:900px){.topbar{left:210px}}
@media(max-width:800px){.topbar{left:0;right:0}.app-main{padding-top:calc(60px + env(safe-area-inset-top))}}

/* Consultable table rows */
.data-table tbody tr.data-row-consultable{cursor:pointer;transition:background-color .15s ease}
@media(hover:hover){.data-table tbody tr.data-row-consultable:hover{background-color:#f8faff}}
.data-table tbody tr.data-row-consultable:focus-visible{outline:2px solid #84aef5;outline-offset:-2px}

/* Shared institutional modal header */
.ui-modal-header{align-items:center;padding:20px 22px;background:#175cd3;color:#fff;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;border-radius:11px 11px 0 0}
.ui-modal-header>div{min-width:0}
.ui-modal-header h3{font-family:inherit;font-size:20px;font-weight:600;line-height:1.3;overflow-wrap:anywhere;color:#fff}
.ui-modal-header p{color:rgba(255,255,255,.76);font-size:12px;line-height:1.4;overflow-wrap:anywhere}
.ui-modal-close{flex:0 0 36px;width:36px;height:36px;display:grid;place-items:center;margin:-4px -7px -4px 0;border-radius:7px;color:#fff}
.ui-modal-close:hover{background:rgba(255,255,255,.12);color:#fff}
.ui-modal-close:focus-visible{outline:2px solid #fff;outline-offset:2px}
@media(max-width:800px){.ui-modal-close{flex-basis:44px;width:44px;height:44px;margin:-8px -8px 0 0}.ui-modal:not(.ui-modal-confirm):not(.ui-modal-message) .ui-modal-header{margin-left:calc(0px - max(16px,env(safe-area-inset-left)));margin-right:calc(0px - max(16px,env(safe-area-inset-right)));padding-left:calc(max(16px,env(safe-area-inset-left)) + 4px);padding-right:calc(max(16px,env(safe-area-inset-right)) + 4px);border-radius:0}}

/* Expediente detail workspace: fixed summary beside independently scrolling clinical history. */
.expediente-detail-workspace .healthcare-panel{margin-top:0;padding-top:0;border-top:0}
@media(min-width:901px){
  .ui-modal.expediente-detail-modal{display:flex;flex-direction:column;width:min(1180px,calc(100vw - 48px));height:min(88vh,900px);max-height:calc(100vh - 40px);max-height:calc(100dvh - 40px);overflow:hidden}
  .expediente-detail-modal>.ui-modal-header,.expediente-detail-modal>.ui-modal-footer{flex:0 0 auto}
  .expediente-detail-modal>.ui-modal-body{display:grid;flex:1 1 auto;grid-template-columns:minmax(0,35fr) minmax(0,65fr);gap:24px;min-height:0;overflow:hidden;padding:20px 22px}
  .expediente-detail-summary,.expediente-detail-workspace{min-width:0;min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain}
  .expediente-detail-summary{display:flex;flex-direction:column}
  .expediente-detail-summary>.button{margin-top:auto;align-self:flex-start}
  .expediente-detail-summary .detail-grid{grid-template-columns:minmax(0,1fr)}
  .expediente-detail-summary .detail-grid>div,.expediente-detail-summary .detail-notes{overflow-wrap:anywhere}
  .expediente-detail-workspace .healthcare-history{position:sticky;top:0;z-index:4;margin-top:0;background:var(--surface-secondary,#f8fafc);box-shadow:0 8px 10px -10px rgba(16,24,40,.35)}
}
@media(max-width:900px){
  .ui-modal.expediente-detail-modal{display:flex;flex-direction:column;width:min(720px,calc(100vw - 32px));height:calc(100vh - 40px);height:calc(100dvh - 40px);max-height:calc(100dvh - 40px);overflow:hidden}
  .expediente-detail-modal>.ui-modal-header,.expediente-detail-modal>.ui-modal-footer{flex:0 0 auto}
  .expediente-detail-modal>.ui-modal-body{display:block;flex:1 1 auto;min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
  .expediente-detail-summary{display:flex;flex:0 0 auto;flex-direction:column;min-width:0;overflow:visible}
  .expediente-detail-summary>.button{margin-top:12px;align-self:flex-start}
  .expediente-detail-workspace{min-width:0;min-height:0;overflow:visible}
  .expediente-detail-workspace .healthcare-history{position:sticky;top:0;z-index:4;margin-top:0;background:var(--surface-secondary,#f8fafc);box-shadow:0 8px 10px -10px rgba(16,24,40,.35)}
}
@media(max-width:700px){
  .ui-modal:not(.ui-modal-confirm):not(.ui-modal-message).expediente-detail-modal{width:100%;height:100vh;height:100dvh;max-height:none;overflow:hidden}
  .ui-modal:not(.ui-modal-confirm):not(.ui-modal-message).expediente-detail-modal>.ui-modal-body{display:block;min-height:0;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch}
}

/* Clinical record tabs are desktop-only; mobile keeps the sequential sections. */
.healthcare-tabs{display:flex;gap:6px;margin:8px 0 0;padding:0 4px;border-bottom:1px solid var(--border-color,#e5e7eb)}
.healthcare-tab{appearance:none;border:0;border-bottom:3px solid transparent;margin-bottom:-1px;padding:10px 14px;border-radius:7px 7px 0 0;background:transparent;color:#536174;font:inherit;font-weight:600;cursor:pointer;transition:background-color .15s ease,color .15s ease}
.healthcare-tab:hover{background:#eef4ff;color:#175cd3}
.healthcare-tab:focus-visible{outline:2px solid #84aef5;outline-offset:2px}
.healthcare-tab-active,.healthcare-tab-active:hover{border-bottom-color:#175cd3;background:#175cd3;color:#fff}
.healthcare-tab-panel[data-active="false"]{display:none}
@media(max-width:700px){.login-page{width:100%;min-width:0;min-height:100dvh;grid-template-columns:minmax(0,1fr);padding:16px}.login-card{width:100%;max-width:430px;min-width:0;padding:24px}.login-brand{min-width:0;margin-bottom:24px}.login-logo{width:100%;max-width:352px}}
.product-images{display:grid;gap:16px;min-width:0;margin-top:22px;padding:20px;border:1px solid var(--border-color,#e5e7eb);border-radius:10px;background:var(--surface,#fff);box-sizing:border-box}
.product-images-heading,.product-images-title,.product-image-list-heading,.product-image-name{display:flex;align-items:center}
.product-images-heading{justify-content:space-between;gap:16px;margin:0}
.product-images-title{gap:12px;min-width:0}
.product-images-icon,.product-image-upload-icon{display:grid;place-items:center;flex:0 0 auto;color:var(--primary-color,#175cd3);background:var(--primary-light,#eff6ff);border-radius:10px}
.product-images-icon{width:42px;height:42px}
.product-images-icon svg{width:22px;height:22px}
.product-images-heading h4,.product-image-list-heading h5{margin:0}
.product-images-heading p{margin:4px 0 0}
.product-images-count{flex:0 0 auto;padding:6px 10px;border:1px solid var(--border-color,#e5e7eb);border-radius:999px;color:var(--text-secondary,#667085);font-size:12px;font-weight:600}
.product-image-dropzone{display:flex;align-items:center;flex-direction:column;gap:9px;padding:24px 16px;border:1.5px dashed var(--primary-color,#175cd3);border-radius:12px;background:var(--primary-light,#f8fbff);text-align:center}
.product-image-upload-icon{width:40px;height:40px;border-radius:50%;font-size:24px}
.product-image-file-input{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;clip-path:inset(50%)}
.product-image-dropzone small{margin-top:2px}
.product-image-selection{display:flex;align-items:center;gap:10px;margin-top:4px;font-size:13px}
.product-image-list-heading{justify-content:space-between;gap:12px;margin:0}
.product-image-list-title{display:flex;align-items:center;gap:8px}
.product-image-list-title svg{width:18px;height:18px;flex:0 0 auto;color:var(--primary-color,#175cd3)}
.product-image-list{display:grid;gap:12px;min-width:0}
.product-image-item{display:flex;align-items:center;gap:14px;min-width:0;padding:12px;border:1px solid var(--border-color,#e5e7eb);border-radius:10px;background:var(--surface,#fff);transition:border-color .15s,box-shadow .15s}
.product-image-item.product-image-primary{border-color:#a6d9b7;box-shadow:0 0 0 2px rgba(18,183,106,.07)}
.product-image-position{display:flex;flex:0 0 30px;align-items:center;flex-direction:column;gap:4px;color:var(--text-secondary,#667085);font-size:11px}
.product-image-icon-button{display:grid;place-items:center;width:28px;height:28px;padding:0;border:1px solid var(--border-color,#e5e7eb);border-radius:6px;background:var(--surface,#fff);color:var(--text-primary,#344054);font-size:16px;cursor:pointer}
.product-image-icon-button:disabled{opacity:.4;cursor:not-allowed}
.product-image-item>img{width:84px;height:84px;flex:0 0 84px;object-fit:contain;border-radius:7px;background:#f2f4f7}
.product-image-details{display:grid;gap:10px;min-width:0;flex:1}
.product-image-name{flex-wrap:wrap;gap:8px;min-width:0}
.product-image-name>strong{min-width:0;overflow-wrap:anywhere;white-space:normal}
.product-image-badge{padding:4px 8px;border-radius:999px;font-size:11px;font-weight:600;line-height:1.2}
.product-image-badge-primary{background:#ecfdf3;color:#027a48}
.product-image-badge-secondary{background:#f2f4f7;color:#475467}
.product-image-details label input{display:block;width:100%;margin-top:4px}
.product-image-actions{display:flex;align-items:center;justify-content:flex-end;flex:0 0 auto;flex-wrap:wrap;gap:6px;padding-left:12px;border-left:1px solid var(--border-color,#e5e7eb)}
@media(max-width:700px){.product-image-item{align-items:flex-start;flex-wrap:wrap}.product-image-position{align-self:center}.product-image-item>img{width:76px;height:76px;flex-basis:76px}.product-image-details{flex-basis:calc(100% - 120px)}.product-image-actions{width:100%;justify-content:flex-start;padding:10px 0 0;border-top:1px solid var(--border-color,#e5e7eb);border-left:0}.product-image-actions .button{flex:1 1 auto}}
@media(max-width:420px){.product-images{gap:14px;padding:16px}.product-images-heading{align-items:flex-start}.product-images-title{align-items:flex-start}.product-images-icon{width:36px;height:36px}.product-images-icon svg{width:20px;height:20px}.product-images-count{padding:5px 7px;font-size:11px}.product-image-item{gap:9px;padding:10px}.product-image-position{flex-basis:24px}.product-image-icon-button{width:24px;height:24px}.product-image-item>img{width:64px;height:64px;flex-basis:64px}.product-image-details{flex-basis:calc(100% - 100px)}.product-image-dropzone{padding:20px 12px}}
.catalog-product-modal,.catalog-product-modal .ui-modal-body,.catalog-product-modal .form-grid,.catalog-product-modal .form-field,.catalog-product-modal .product-images,.catalog-product-modal .product-image-item,.catalog-product-modal .product-image-details,.catalog-product-modal .product-image-name,.catalog-product-modal .product-image-actions{min-width:0}
.catalog-product-modal .ui-modal-body{overflow-x:hidden}
.catalog-product-modal .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.catalog-product-modal .form-field input,.catalog-product-modal .form-field select,.catalog-product-modal .form-field textarea{min-width:0;max-width:100%}
@media(max-width:700px){.catalog-product-modal .form-grid{grid-template-columns:minmax(0,1fr)}.catalog-product-modal .product-images{width:100%;max-width:100%}.catalog-product-modal .product-image-actions .button{min-width:0;overflow-wrap:anywhere}}
