.brand-logo .brand-compact { display: none; width: 36px; height: 36px; aspect-ratio: 1; }
.sidebar { background: #fff; color: #657187; border-right: 1px solid var(--stroke); }
.sidebar .nav-group { color: #8490a3; letter-spacing: 0; }
.sidebar .nav-item { border-radius: 6px; color: #526077; }
.sidebar .nav-item:hover { background: #f1f5f9; color: #202943; }
.sidebar .nav-item.active { background: #eef6ff; color: #0369a1; box-shadow: inset 3px 0 0 #0284c7; }
.sidebar-footer { padding: 15px 0 0; }
.sidebar-collapse { flex-shrink: 0; }
.sidebar .sidebar-logout { background: #b92f47; color: #fff; border: 1px solid #e7576c; justify-content: center; text-align: center; }
.sidebar .sidebar-logout:hover { background: #cf3852; color: #fff; }
.sidebar .nav-item .ico { flex-shrink: 0; }
.sidebar .nav-item:focus-visible { outline: 2px solid #0284c7; outline-offset: 2px; }
@media (min-width: 801px) {
    .sidebar { transition: width .24s ease, padding .24s ease; overflow-x: hidden; }
    .main { transition: margin-left .24s ease, width .24s ease; }
    .sidebar-is-collapsed .sidebar { width: 76px; padding: 25px 12px 18px; }
    .sidebar-is-collapsed .main { margin-left: 76px; width: calc(100% - 76px); }
    .sidebar-is-collapsed .sidebar .brand { padding: 2px 8px 22px; }
    .sidebar-is-collapsed .sidebar .brand-wordmark { display: none; }
    .sidebar-is-collapsed .sidebar .brand-compact { display: block; }
    .sidebar-is-collapsed .sidebar .nav-item { justify-content: center; height: 43px; padding: 12px; }
    .sidebar-is-collapsed .sidebar .nav-item span { display: none; }
    .sidebar-is-collapsed .sidebar .nav-group { height: 24px; padding: 0; font-size: 0; border-bottom: 1px solid var(--stroke); margin: 0 8px 8px; }
}
.outreach-chart .bar { min-height: 0; background: #0284c7; }
.outreach-chart .bar.alt { background: #17a87c; }
.outreach-legend .dot { background: #0284c7; }
.outreach-legend .dot.customer-dot { background: #17a87c; }
.panel-head:has(.outreach-legend) { flex-wrap: wrap; }
.outreach-legend { flex-wrap: wrap; row-gap: 8px; }
.outreach-chart .bar-col { min-width: 0; }
.outreach-chart .bar-label { white-space: nowrap; left: 50%; transform: translateX(-50%); }
.bar-counts { display: flex; justify-content: center; gap: 8px; font-size: 10px; font-weight: 600; }
.bar-counts span:first-child { color: #0369a1; }
.bar-counts span:last-child { color: #138362; }
.account-surface { background: #fff; border-top: 1px solid var(--stroke); border-bottom: 1px solid var(--stroke); padding: 0 28px; max-width: 1100px; }
#profile-form { width: 100%; max-width: none; }
.profile-avatar-button { padding: 0; background: transparent; border: 0; border-radius: 50%; flex-shrink: 0; cursor: zoom-in; }
.profile-avatar-button:focus-visible { outline: 2px solid #0284c7; outline-offset: 4px; }
.choice-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.choice-options { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-option { display: flex; align-items: center; gap: 8px; border: 1px solid #dde4ee; border-radius: 6px; padding: 10px 12px; cursor: pointer; background: #fff; min-width: 0; max-width: 100%; }
.choice-option span { overflow-wrap: anywhere; }
.choice-option input { accent-color: #0284c7; width: 14px; height: 14px; flex-shrink: 0; margin: 0; }
.choice-option:has(input:checked) { color: #0369a1; border-color: #0284c7; background: #eef6ff; }
.choice-option:has(input:focus-visible) { outline: 2px solid #0284c7; outline-offset: 2px; }
.lead-dialog { width: min(100%, 940px); border-radius: 8px; }
.lead-status { min-width: 155px; font-size: 12px; }
.lead-care-link { display: block; width: 240px; max-width: 100%; background: transparent; border: 0; padding: 0; color: #0369a1; text-align: left; cursor: pointer; white-space: normal; overflow-wrap: anywhere; }
.lead-care-link span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.6; }
.lead-care-link small { display: block; margin-top: 6px; color: #788599; }
.lead-care-link:hover { text-decoration: underline; }
.lead-care-dialog { width: min(100%, 960px); border-radius: 8px; }
.lead-care-dialog .dialog-head h3 { min-width: 0; overflow-wrap: anywhere; }
.lead-care-dialog .dialog-head .icon-btn { flex-shrink: 0; }
.dashboard-care { margin-top: 24px; }
.lead-care-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.lead-care-grid h4 { margin: 0 0 18px; font-size: 14px; }
#lead-care-form { display: grid; gap: 16px; }
.care-entry { padding: 16px 0; border-bottom: 1px solid var(--stroke); }
.care-entry:first-child { padding-top: 0; }
.care-entry p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0; line-height: 1.7; }
.care-entry-meta { color: #788599; font-size: 11px; line-height: 1.6; }
.care-history-state { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.select2-container { width: 220px; max-width: 100%; }
.select2-container--default .select2-selection--single { height: 42px; border-color: var(--stroke); border-radius: 6px; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 40px; padding-left: 12px; color: #526077; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 40px; }
.select2-dropdown { border-color: var(--stroke); }
.select2-container--default .select2-search--dropdown .select2-search__field { border: 1px solid var(--stroke); padding: 8px; border-radius: 4px; }
@media (max-width: 700px) { .lead-care-grid { grid-template-columns: minmax(0, 1fr); } }
.dialog #record-form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.dialog #record-form .dialog-body { min-height: 0; overflow-y: auto; }
.dialog-head, .dialog-foot { flex-shrink: 0; }
.lead-dialog .field-input, .lead-dialog .field-select, .lead-dialog .field-textarea, .lead-dialog .btn { border-radius: 6px; }
.overlay { animation: crm-overlay-in .18s ease both; }
.overlay .dialog, .avatar-crop-dialog[open] { animation: crm-dialog-in .18s ease both; }
.overlay.is-closing { animation: crm-overlay-out .18s ease both; }
.overlay.is-closing .dialog, .avatar-crop-dialog.is-closing { animation: crm-dialog-out .18s ease both; }
.alert-wrapper { padding: 16px; }
.alert-frame { max-width: 100%; max-height: calc(100dvh - 32px); overflow: auto; border-radius: 8px; }
.alert-message, .toast-message { overflow-wrap: anywhere; white-space: pre-line; }
.alert-wrapper.is-closing { animation: crm-overlay-out .16s ease both; pointer-events: none; }
.alert-wrapper.is-closing .alert-frame { animation: crm-dialog-out .16s ease both; }
.toast-container { max-width: calc(100vw - 32px); }
.toast-frame { height: auto; min-height: 60px; flex-wrap: nowrap; gap: 12px; padding: 12px 15px; }
.toast-img { flex-shrink: 0; }
.toast-message { min-width: 0; margin-left: 0; }
.toast-close { background: transparent; border: 0; padding: 4px; margin-left: 0; flex-shrink: 0; }
@keyframes crm-overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes crm-overlay-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes crm-dialog-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes crm-dialog-out { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(12px) scale(.98); } }
@media (prefers-reduced-motion: reduce) {
    .sidebar, .main, .overlay, .overlay .dialog, .avatar-crop-dialog, .alert-wrapper, .alert-frame { animation: none !important; transition: none !important; }
}
.account-surface .btn, .account-surface .field-input, .page-head > .btn { border-radius: 6px; }
.account-surface .field-input:disabled { background: #f2f4f7; color: #6e798b; opacity: 1; cursor: not-allowed; }
.profile-heading { display: flex; align-items: center; gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--stroke); }
.profile-avatar { width: 112px; height: 112px; aspect-ratio: 1; object-fit: cover; border-radius: 50%; flex-shrink: 0; background: #e9eef2; }
.profile-identity { min-width: 0; }
.profile-identity h2 { font-size: 21px; font-weight: 700; margin: 0 0 8px; overflow-wrap: anywhere; letter-spacing: 0; }
.profile-identity p { margin: 0 0 14px; color: #788599; }
.account-section { padding: 26px 0; border-bottom: 1px solid var(--stroke); }
.account-section:last-child { border-bottom: 0; }
.account-section h2 { font-size: 15px; font-weight: 700; margin: 0 0 22px; letter-spacing: 0; }
.account-form-footer { display: flex; justify-content: flex-end; padding: 24px 0; }
.account-section .account-form-footer { padding-bottom: 0; }
.avatar-pending { display: block; color: #b46c16; margin-top: 10px; font-size: 11px; }
.account-error { color: #c12c45 !important; margin: 10px 0 0 !important; overflow-wrap: anywhere; }
.account-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--stroke); }
.account-tabs [role="tab"] { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 18px 0; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #68758a; font-weight: 600; }
.account-tabs [role="tab"][aria-selected="true"] { color: #0f766e; border-bottom-color: #0f766e; }
.account-tabs .ico { width: 18px; height: 18px; flex-shrink: 0; }
.security-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 0; }
.security-facts dt { color: #788599; font-size: 11px; margin-bottom: 8px; }
.security-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.password-requirements { color: #788599; font-size: 11px; line-height: 1.7; margin: 12px 0 0; }
.device-row { display: flex; gap: 16px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--stroke); }
.device-row:last-child { border-bottom: 0; }
.device-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 6px; background: #edf7f5; color: #0f766e; flex-shrink: 0; }
.device-icon .ico { width: 24px; height: 24px; }
.device-detail { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.device-detail strong { font-size: 12px; }
.device-detail p { font-size: 11px; line-height: 1.7; color: #788599; margin: 5px 0 0; }
.revoke-device-form { flex-shrink: 0; }
.avatar-crop-dialog { border: 1px solid var(--stroke); border-radius: 8px; padding: 0; width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); color: var(--ink); background: #fff; overflow: auto; }
.avatar-crop-dialog::backdrop { background: #18233899; }
.crop-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--stroke); }
.crop-header h2 { font-size: 16px; margin: 0; font-weight: 700; }
.crop-body { padding: 16px 20px; }
.crop-stage { height: min(360px, 45dvh); background: #edf0f4; width: 100%; overflow: hidden; }
.crop-stage > img { display: block; max-width: 100%; }
.crop-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; }
.avatar-crop-preview { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: #edf0f4; flex-shrink: 0; }
.crop-footer { padding: 16px 20px; border-top: 1px solid var(--stroke); display: flex; justify-content: flex-end; gap: 10px; }
.crop-footer .btn { border-radius: 6px; }
@media (min-width: 801px) and (max-width: 1190px) {
    #clock-date { display: none; }
    .userbox-label { max-width: 120px; }
    .topbar > .top-actions:first-child { flex: 1; min-width: 0; margin-right: 16px; }
    .topbar-search { flex: 1; }
    .topbar-search .searchbar { width: 100%; max-width: 390px; }
    .topbar > .top-actions:last-child { flex-shrink: 0; }
}
@media (max-width: 800px) {
    .login-heading { text-align: center; }
    .login-heading .brand { justify-content: center; align-items: center; }
    .userbox .account-chevron { display: none; }
    .sidebar-collapse { display: none; }
    .account-surface { padding: 0 18px; }
}
@media (max-width: 560px) {
    .outreach-chart { gap: 8px; padding: 0 2px; }
    .profile-heading { gap: 16px; flex-wrap: wrap; }
    .profile-avatar { width: 88px; height: 88px; }
    .profile-identity { min-width: 150px; flex: 1; }
    .profile-identity h2 { font-size: 18px; }
    .account-surface .form-grid, .security-facts { grid-template-columns: 1fr; }
    .account-tabs { gap: 0; justify-content: space-between; }
    .account-tabs [role="tab"] { gap: 5px; font-size: 11px; }
    .account-tabs .ico { width: 15px; height: 15px; }
    .device-row { flex-wrap: wrap; gap: 12px; }
    .device-detail { flex-basis: calc(100% - 60px); }
    .device-row .pill, .device-row form { margin-left: 56px; }
    .account-form-footer .btn { white-space: normal; text-align: center; }
    .crop-body, .crop-header, .crop-footer { padding: 14px; }
}
