/* Shared H5 tokens aligned with the existing CRM and activity questionnaire.
   Native mini-program styles are deliberately scoped outside this stylesheet. */
:root {
  --brand:#a93440; --brand-dark:#872934; --brand-soft:#fff0f1; --brand-line:#dfbcc1;
  --text-main:#20332e; --text-muted:#65736e; --field-line:#e5dadd;
  --accent:var(--brand); --accent-soft:var(--brand-soft);
  --primary:var(--brand); --primary-dark:var(--brand-dark); --primary-soft:var(--brand-soft);
  --management-control-accent:var(--brand); --management-control-soft:var(--brand-soft);
  --management-control-muted:var(--text-muted); --management-control-line:var(--field-line);
}
.h5-icon{display:inline-block;width:22px;height:22px;flex:none;background:currentColor;mask:var(--icon) center/contain no-repeat;-webkit-mask:var(--icon) center/contain no-repeat;vertical-align:middle}
.icon-house{--icon:url('icon-house.svg')}.icon-users{--icon:url('icon-users.svg')}
.icon-network{--icon:url('icon-network.svg')}.icon-calendar-days{--icon:url('icon-calendar-days.svg')}
.icon-user-round{--icon:url('icon-user-round.svg')}.icon-plus{--icon:url('icon-plus.svg')}
.icon-scan-search{--icon:url('icon-scan-search.svg')}.icon-clock{--icon:url('icon-clock.svg')}
.icon-camera{--icon:url('icon-camera.svg')}.icon-calendar{--icon:url('icon-calendar.svg')}
.management-h5 .tab-icon{display:flex;align-items:center;justify-content:center}
.management-h5 .quick-icon{display:flex;align-items:center;justify-content:center}
.management-h5 .quick-icon .h5-icon{width:22px;height:22px}
.management-h5 .tab{font-size:12px;color:var(--text-muted)}
.management-h5 .tab.active,.management-h5 .role,.management-h5 .section-link{color:var(--brand)}
.management-h5 .tab.active .tab-icon,.management-h5 .quick-icon{color:var(--brand);background:var(--brand-soft)}
.management-h5 .role,.management-h5 .chip.active,.management-h5 .todo-tab.active{color:var(--brand);background:var(--brand-soft)}
.management-h5 .stat-desc,.management-h5 .todo-sub,.management-h5 .todo-note,
.management-h5 .list-sub,.management-h5 .member-count,.management-h5 .qr-small,
.management-h5 .pager,.management-h5 .form-hint,.management-h5 .trend-day,
.management-h5 .audit-intro,.management-h5 .audit-summary,.management-h5 .audit-date-field,
.management-h5 .audit-filter-label{font-size:12px;color:var(--text-muted);line-height:1.6}
.management-h5 .quick-item,.management-h5 .list-tag,.management-h5 .tag,.management-h5 .event-date{font-size:12px}
.management-h5 .role{font-size:12px}
.management-h5 .list-tag,.management-h5 .event-date{color:var(--brand);background:var(--brand-soft)}
.management-h5 .profile-sub{font-size:12px}
.management-h5 .profile-hero{background:#254c43}
.management-h5 .submit-button,.management-h5 .audit-search,.management-h5 .filter-actions .apply,
.management-h5 .web-primary{background:var(--brand);color:#fff}
.management-h5 .progress>i{background:var(--brand)}
.management-h5 .trend-point{stroke:var(--brand)}
.management-h5 .trend-svg-label{font-size:11px;fill:var(--text-muted)}
.management-h5 .web-input:focus{border-color:var(--brand);box-shadow:0 0 0 3px #a934401a}
.management-h5 .search-toolbar{flex-wrap:wrap}
.management-h5 .search-toolbar>.search{flex:1 1 140px}
.management-h5 .search-toolbar [hidden]{display:none!important}
.management-h5 .list-query-clear,.management-h5 .search-toolbar .todo-search-button{font-size:13px;padding:0 12px}
.management-h5 .pager .pager-button{height:44px;font-size:12px;line-height:44px}
.management-h5 .web-sheet .form-hint,.management-h5 .quick-field-error{font-size:13px}
.management-h5 .management-select.has-value .management-select-trigger,
.customer-h5 .client-select.has-value .client-select-trigger{color:var(--brand);border-color:var(--brand-line);background:#fff8f8}
.customer-h5 .primary{background:var(--brand);color:#fff}
.customer-h5 .client-header>span,.customer-h5 .activity-status{font-size:12px}
.customer-h5 .client-select.is-open .client-select-trigger{box-shadow:0 0 0 3px #a934401a}
.customer-h5 :is(button,a,input,textarea,select):focus-visible,
.management-h5 :is(button,a,input,textarea,select):focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.customer-h5 .client-select-check,.customer-h5 .client-select.is-open .client-select-chevron{color:var(--brand)}
.customer-h5 .client-select-option[aria-selected=true]{color:var(--brand);background:var(--brand-soft)}
.customer-h5 .client-nav button[aria-current=page]{color:var(--brand);background:var(--brand-soft)}
.customer-h5 .card-foot strong{color:var(--brand)}
.customer-h5 .client-nav button>img{display:none}
.customer-h5 .client-nav button::before{content:'';display:block;width:24px;height:24px;margin:2px auto 5px;background:currentColor;mask:var(--nav-icon) center/contain no-repeat;-webkit-mask:var(--nav-icon) center/contain no-repeat}
.customer-h5 [data-tab=activities]{--nav-icon:url('icon-calendar-days.svg')}
.customer-h5 [data-tab=messages]{--nav-icon:url('icon-bell.svg')}
.customer-h5 [data-tab=mine]{--nav-icon:url('icon-user-round.svg')}
.image-fallback{object-fit:contain!important;background:#f6efeb!important;color:var(--text-muted)}
.image-fallback-icon{padding:32px;box-sizing:border-box}
.face-image.image-fallback-icon{padding:10px}

/* Profile: fixed title and actions around an independently scrolling form. */
dialog.profile-editor{display:flex;flex-direction:column;height:min(90dvh,900px);max-height:calc(100dvh - 24px);padding:20px 18px 0;overflow:hidden}
dialog.profile-editor:not([open]){display:none}
.profile-editor .dialog-header{flex:none;margin:0;padding-bottom:14px;border-bottom:1px solid var(--field-line)}
.profile-editor .dialog-header h2{font-size:18px}
.profile-editor .dialog-header>button{width:44px;height:44px}
.profile-editor #dialog-content{min-height:0;flex:1;display:flex;overflow:hidden}
.profile-editor .profile-form{min-height:0;min-width:0;display:flex;flex:1;flex-direction:column}
.profile-scroll{min-height:0;flex:1;overflow:auto;overscroll-behavior:contain;padding:16px 2px;scroll-padding:16px}
.profile-footer{flex:none;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);gap:10px;padding:12px 0 max(16px,env(safe-area-inset-bottom));border-top:1px solid var(--field-line);background:#fff}
.profile-footer #profile-error{grid-column:1/-1;margin:0;font-size:13px;line-height:1.5;max-height:72px;overflow:auto}
.profile-footer #profile-error:empty{display:none}
.profile-footer button.full{margin:0}
.profile-footer button{min-width:0;min-height:46px;padding:10px 8px;font-size:14px;line-height:1.5}
.profile-editor .profile-avatar-field{display:grid;grid-template-columns:72px minmax(0,1fr);align-items:center;gap:8px 12px;padding:14px;border:1px solid var(--field-line);border-radius:12px;background:#fffaf9}
.profile-avatar-field #profile-avatar-preview{grid-row:1/4;grid-column:1;width:72px;height:72px;object-fit:cover;border-radius:12px}
.profile-avatar-field:has(#profile-avatar-preview[hidden]){grid-template-columns:minmax(0,1fr)}
.profile-avatar-label{font-size:14px;font-weight:600}
.profile-upload-button{display:flex;align-items:center;justify-content:center;gap:8px;min-height:44px;width:100%;border:1px solid var(--brand-line);border-radius:9px;background:var(--brand-soft);color:var(--brand);font-size:14px}
.profile-avatar-hint{font-size:12px;color:var(--text-muted);line-height:1.6;text-align:left}

/* Calendar geometry follows the CRM date picker; the popup is fully themed. */
.management-date{width:100%;min-width:0}
.management-date>[hidden]{display:none!important}
.management-date-trigger{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:44px;padding:10px 11px;border:1px solid var(--field-line);border-radius:9px;background:#fff;color:var(--text-muted);font:inherit;font-size:14px;line-height:22px;text-align:left}
.management-date-trigger>span{min-width:0;overflow-wrap:anywhere}
.management-date-trigger .h5-icon{width:18px;height:18px;color:var(--text-muted)}
.management-date-trigger.has-value{color:var(--text-main)}
.management-date-trigger[aria-invalid=true]{border-color:var(--brand);background:#fff7f7}
.management-date-trigger[aria-expanded=true]{border-color:var(--brand);box-shadow:0 0 0 3px #a934401a}
.management-date-dialog{box-sizing:border-box;width:min(390px,calc(100vw - 24px));max-width:390px;max-height:calc(100dvh - 24px);padding:0;border:1px solid var(--field-line);border-radius:18px;color:var(--text-main);background:#fff;overflow:auto;font:14px/1.5 -apple-system,BlinkMacSystemFont,'PingFang SC','Microsoft YaHei',sans-serif}
.management-date-dialog::backdrop{background:#20332e70}
.management-date-dialog header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 16px;border-bottom:1px solid var(--field-line)}
.management-date-dialog h2{font-size:17px;margin:0}
.management-date-dialog button{font:inherit;cursor:pointer;min-width:0;border:0;border-radius:8px;background:transparent;color:inherit}
.management-date-dialog header button{width:44px;height:44px;font-size:24px}
.date-body{padding:12px 16px}
.date-navigation{display:grid;grid-template-columns:32px 32px minmax(0,1fr) 32px 32px;gap:2px;align-items:center;text-align:center;margin-bottom:8px}
.date-navigation button{height:44px;font-size:22px;color:var(--brand)}
.date-weekdays,.date-calendar{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;text-align:center}
.date-weekdays{color:var(--text-muted);font-size:12px;line-height:32px}
.date-calendar button{min-height:38px;padding:4px;font-size:14px}
.date-calendar button.outside-month{color:#6f7673}
.date-calendar button[aria-current=date]{box-shadow:inset 0 0 0 1px var(--brand-line)}
.date-calendar button[aria-pressed=true]{background:var(--brand);color:#fff}
.date-calendar button:disabled{opacity:.35;cursor:default}
.date-time{display:flex;align-items:end;justify-content:center;gap:12px;margin-top:14px}
.date-time[hidden]{display:none}
.date-time label{display:grid;gap:4px;font-size:12px;color:var(--text-muted)}
.date-time input{box-sizing:border-box;width:82px;min-height:44px;padding:8px;border:1px solid var(--field-line);border-radius:8px;background:#fff;color:var(--text-main);font-size:16px;text-align:center}
.date-time>span{line-height:44px}
.date-error{margin:8px 0 0;color:var(--brand);font-size:13px}.date-error:empty{display:none}
.management-date-dialog footer{display:flex;gap:8px;padding:12px 16px max(16px,env(safe-area-inset-bottom));border-top:1px solid var(--field-line)}
.management-date-dialog footer button{flex:1;min-height:44px;background:#f4f0ed}
.management-date-dialog footer .date-confirm{background:var(--brand);color:#fff}
@media(max-width:360px){.profile-editor .profile-avatar-field{padding:10px;gap:8px}.profile-avatar-field #profile-avatar-preview{width:56px;height:56px}.profile-editor .profile-avatar-field{grid-template-columns:56px minmax(0,1fr)}.profile-avatar-field:has(#profile-avatar-preview[hidden]){grid-template-columns:minmax(0,1fr)}.management-h5 .search-toolbar>.search{flex-basis:100%}.date-body{padding:10px 12px}}
