/* Profil du SP et administration des agents : styles limités à ces modules. */
.sp-account-banner { display: flex; justify-content: space-between; align-items: center; gap: 24px; background: #173e2c; border: 1px solid #254c37; border-radius: 14px; padding: 25px 29px; color: #fff; margin-bottom: 24px; }
.sp-profile-identity { display: flex; align-items: center; gap: 19px; min-width: 0; }
.sp-profile-avatar { flex-shrink: 0; width: 72px; height: 72px; border-radius: 19px; object-fit: cover; border: 2px solid #ddc588; }
.sp-profile-avatar-placeholder { display: grid; place-items: center; background: #2a513b; color: #e0ca94; }
.sp-profile-avatar-placeholder .sp-icon { width: 33px; height: 33px; }
.sp-account-kicker { display: block; font-size: 9px; font-weight: 600; letter-spacing: 1.6px; color: #d8c68e; margin-bottom: 8px; }
.sp-profile-identity h2 { font-size: clamp(20px, 2vw, 25px); font-weight: 650; letter-spacing: -.55px; margin: 0 0 7px; overflow-wrap: anywhere; }
.sp-profile-identity p { margin: 0; color: #b5c9bb; font-size: 12px; }
.sp-account-banner-tag { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid #67805e; border-radius: 7px; color: #e2d4af; background: #ffffff05; font-size: 11px; white-space: nowrap; }
.sp-account-banner-tag .sp-icon { width: 16px; height: 16px; }
.sp-profile-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 23px; align-items: start; }
.sp-account-panel { min-width: 0; border: 1px solid var(--sp-border); border-radius: 12px; background: #fff; box-shadow: 0 4px 16px #233b2003; overflow: hidden; }
.sp-account-panel-header { display: flex; align-items: center; gap: 12px; padding: 22px 24px; border-bottom: 1px solid #e9ede5; background: #fdfefb; }
.sp-account-panel-header > div { min-width: 0; }
.sp-account-panel-header h2 { font-size: 15px; font-weight: 650; letter-spacing: -.2px; color: #2c3c2d; margin: 0 0 5px; }
.sp-account-panel-header p { font-size: 11px; line-height: 1.55; color: #798574; margin: 0; }
.sp-account-panel-icon { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; color: #4f7650; border: 1px solid #e1e9d7; background: #eff4e9; border-radius: 9px; }
.sp-account-panel-icon .sp-icon { width: 18px; height: 18px; }
.sp-account-panel-icon-gold { color: #96743d; border-color: #ece3cd; background: #f7f2e8; }
.sp-account-panel-body { padding: 24px; }
.sp-account-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
.sp-account-fields-single { grid-template-columns: minmax(0, 1fr); }
.sp-account-field-full { grid-column: 1 / -1; }
.sp-profile-page .form-label, .sp-agents-page .form-label { display: block; color: #50604c; font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.sp-profile-page .form-control, .sp-agents-page .form-control, .sp-agents-page .form-select { min-height: 42px; border: 1px solid #dce3d5; border-radius: 7px; font-size: 13px; background-color: #fff; color: #2c3c2d; }
.sp-account-required { color: #97723d; }
.sp-account-help { color: #7a8473; font-size: 11px; line-height: 1.75; margin: 7px 0 0; }
.sp-profile-photo-field { display: flex; align-items: flex-start; gap: 15px; border: 1px dashed #d9e2ce; background: #f9fbf6; border-radius: 10px; padding: 18px; margin-bottom: 24px; }
.sp-profile-photo-field > div { flex: 1; min-width: 0; }
.sp-profile-page .sp-profile-photo-field .form-control { font-size: 11px; min-height: 35px; }
.sp-account-photo-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: #edf2e5; color: #748364; margin-top: 3px; flex-shrink: 0; }
.sp-account-photo-icon .sp-icon { width: 18px; height: 18px; }
.sp-account-note { display: flex; align-items: flex-start; gap: 11px; border: 1px solid #ece3ce; border-radius: 9px; padding: 15px; background: #faf7ef; color: #8b7447; margin-bottom: 24px; }
.sp-account-note > .sp-icon { width: 18px; height: 18px; margin-top: 2px; }
.sp-account-note p { font-size: 12px; line-height: 1.65; margin: 0; }
.sp-account-form-footer { display: flex; flex-direction: column; gap: 12px; margin-top: 25px; padding-top: 19px; border-top: 1px solid #edf0e8; }
.sp-account-form-footer .sp-account-help { margin: 0; }
.sp-account-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-size: 12px; font-weight: 600; min-height: 42px; border-radius: 7px; padding: 10px 14px; }
.sp-account-btn .sp-icon { width: 17px; height: 17px; }
.sp-account-btn-outline { color: var(--ujlog-green); border: 1px solid #c5d4bc; background: #fff; }
.sp-account-btn-outline:hover { color: #205737; border-color: #8da783; background: #f2f6ec; }
.sp-account-alert { border-radius: 10px; padding: 15px 18px; font-size: 13px; line-height: 1.65; margin-bottom: 22px; }
.sp-profile-page .sp-account-alert.alert-dismissible { padding-right: 48px; }

/* Page autonome : même identité visuelle que le tableau de bord SP. */
.sp-account-topbar { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--sp-border); background: #fff; padding: 15px clamp(22px, 3.4vw, 54px); position: sticky; top: 0; z-index: 1010; }
.sp-account-brand { display: inline-flex; align-items: center; gap: 11px; color: #173e2c; text-decoration: none; flex-shrink: 0; }
.sp-account-brand:hover { color: #17634b; }
.sp-account-brand > span { display: grid; place-items: center; width: 45px; height: 45px; background: #f6f8f0; border: 1px solid #e7eadc; border-radius: 10px; }
.sp-account-brand img { object-fit: contain; }
.sp-account-brand strong { display: block; font-size: 24px; font-weight: 750; letter-spacing: -.8px; line-height: 1.15; }
.sp-account-brand strong span { color: #bc994c; }
.sp-account-brand small { display: block; font-size: 8px; letter-spacing: 1.4px; margin-top: 5px; color: #7c896b; }
.sp-account-topbar-end { display: flex; align-items: center; gap: 22px; min-width: 0; }
.sp-account-ufr { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-size: 11px; color: #637354; line-height: 1.5; }
.sp-account-ufr .sp-icon { width: 16px; height: 16px; }
.sp-account-return { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #dce4d4; border-radius: 7px; padding: 9px 12px; background: #fafbf7; font-size: 11px; font-weight: 600; color: #4a6942; text-decoration: none; white-space: nowrap; }
.sp-account-return:hover { color: #17634b; background: #edf3e6; border-color: #b6c8a6; }
.sp-account-return .sp-icon { width: 16px; height: 16px; }
.sp-account-main { padding: 34px clamp(22px, 3.4vw, 54px) 0; max-width: 1720px; margin: auto; }
.sp-account-main:focus { outline: none; }
.sp-account-heading-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: #8b7444; padding: 8px 12px; background: #f4efe1; border: 1px solid #e8ddbf; border-radius: 7px; white-space: nowrap; }
.sp-account-heading-badge .sp-icon { width: 16px; height: 16px; }
.sp-agent-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 27px 0; }
.sp-agent-stat { display: flex; align-items: center; gap: 17px; padding: 22px; background: #fff; border: 1px solid var(--sp-border); border-radius: 10px; }
.sp-agent-stat-icon { display: grid; place-items: center; flex-shrink: 0; width: 48px; height: 48px; border-radius: 11px; background: #eef2f7; color: #70879c; border: 1px solid #e3eaf2; }
.sp-agent-stat-icon .sp-icon { width: 23px; height: 23px; }
.sp-agent-stat-icon-active { background: #edf4e8; color: #617e51; border-color: #e1ead7; }
.sp-agent-stat-icon-gold { background: #f7f2e8; color: #a48c57; border-color: #eee5d2; }
.sp-agent-stat > div { min-width: 0; }
.sp-agent-stat > div > span { display: block; font-size: 11px; color: #77836d; }
.sp-agent-stat strong { display: block; font-weight: 700; font-size: 30px; line-height: 1.25; letter-spacing: -1px; color: #2e402c; margin: 5px 0 3px; }
.sp-agent-stat small { display: block; font-size: 10px; color: #89927e; line-height: 1.6; }
.sp-agents-grid { display: grid; grid-template-columns: minmax(300px, .85fr) minmax(0, 1.85fr); gap: 23px; align-items: start; }
.sp-account-fieldset { padding: 0 0 22px; margin: 0 0 22px; border: 0; border-bottom: 1px solid #edf0e8; min-width: 0; }
.sp-account-fieldset legend { float: none; width: auto; font-size: 10px; font-weight: 650; letter-spacing: .7px; color: #818e76; text-transform: uppercase; margin-bottom: 18px; }
.sp-account-fieldset-last { margin: 0; padding: 0; border: 0; }
.sp-account-fieldset-last legend { margin-bottom: 5px; }
.sp-account-count { margin-left: auto; background: #f0f4e9; border: 1px solid #e0e8d5; color: #6e815d; border-radius: 6px; font-size: 10px; padding: 5px 9px; white-space: nowrap; }
.sp-agent-permissions { display: grid; gap: 0; border: 1px solid #e3e8da; border-radius: 8px; margin-top: 14px; background: #fafbf7; max-height: 245px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #c2cfb4 #fafbf7; }
.sp-agent-permissions .form-check { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; margin: 0; min-height: 42px; border-bottom: 1px solid #edf0e7; }
.sp-agent-permissions .form-check:last-child { border-bottom: 0; }
.sp-agent-permissions .form-check-input { float: none; flex-shrink: 0; margin: 2px 0 0; width: 15px; height: 15px; border-color: #c7d3bb; cursor: pointer; }
.sp-agent-permissions .form-check-input:checked { border-color: var(--ujlog-green); background-color: var(--ujlog-green); }
.sp-agent-permissions .form-check-label { font-size: 11px; line-height: 1.55; color: #5f7053; margin: 0; cursor: pointer; }
.sp-permission-catalog.sp-agent-permissions { display: block; max-height: 560px; }
.sp-permission-group h3 { font-size: 10px; font-weight: 700; letter-spacing: .4px; padding: 13px; margin: 0; background: #eff3e8; color: #48633e; }
.sp-permission-group .form-check-label > span { display: block; }
.sp-permission-group .form-check-label > small { display: block; font-size: 10px; margin-top: 4px; color: #77856d; }
.sp-permission-group .sp-permission-origin { color: #876e3e !important; font-weight: 600; }
.sp-permission-reserved { background: #f4f3ef; }
.sp-permission-reserved .form-check-label { cursor: default; }
.sp-agents-page .sp-agent-table-wrap { border-radius: 0; }
.sp-agents-page .sp-agent-table { min-width: 690px; }
.sp-agents-page .sp-agent-table thead th { padding: 15px 16px; font-size: 9px; letter-spacing: .6px; text-transform: uppercase; background: #f7f9f3; color: #78876b; white-space: nowrap; }
.sp-agents-page .sp-agent-table td { padding: 17px 16px; font-size: 11px; }
.sp-agent-person { display: flex; align-items: center; gap: 10px; }
.sp-agent-avatar { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: #f0f3e9; color: #849573; flex-shrink: 0; }
.sp-agent-avatar .sp-icon { width: 16px; height: 16px; }
.sp-agent-person strong { font-size: 11px; font-weight: 650; display: block; color: #384c31; }
.sp-agent-person > div > span { display: block; color: #829078; font-size: 10px; margin-top: 4px; }
.sp-agent-commission { color: #6f7b65; font-size: 10px; }
.sp-agent-identifiant { color: #5f7458; background: #f4f7ee; border: 1px solid #e8ede0; border-radius: 5px; padding: 4px 7px; font-size: 10px; }
.sp-agent-permission-count { display: inline-block; color: #8f7844; background: #f6f1e4; border: 1px solid #eee4cc; border-radius: 5px; padding: 4px 7px; font-size: 10px; white-space: nowrap; }
.sp-agent-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 7px; font-size: 10px; border-radius: 5px; white-space: nowrap; }
.sp-agent-status > span { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.sp-agent-status.is-active { color: #577d44; background: #eef5e8; border: 1px solid #e0ecd5; }
.sp-agent-status.is-inactive { color: #8b8273; background: #f4f1ec; border: 1px solid #eae4d9; }
.sp-agents-page .sp-agent-edit { display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid #dce5d3; color: #6a7e59; background: #fff; border-radius: 6px; font-size: 10px; padding: 7px 9px; white-space: nowrap; }
.sp-agent-edit .sp-icon { width: 12px; height: 12px; }
.sp-agents-page .sp-agent-edit:hover { color: #17634b; border-color: #adbf9d; background: #f3f7ed; }
.sp-agent-list-note { display: flex; align-items: flex-start; gap: 9px; border-top: 1px solid #edf0e8; padding: 15px 22px; background: #fbfcf9; color: #879377; }
.sp-agent-list-note .sp-icon { width: 15px; height: 15px; margin-top: 2px; }
.sp-agent-list-note p { margin: 0; font-size: 10px; line-height: 1.75; }
.sp-account-empty { display: flex; flex-direction: column; align-items: center; padding: 60px 28px; text-align: center; }
.sp-account-empty-icon { display: grid; place-items: center; width: 62px; height: 62px; border: 1px solid #e6e9db; border-radius: 16px; background: #f5f7ef; color: #839573; margin-bottom: 20px; }
.sp-account-empty-icon .sp-icon { width: 27px; height: 27px; }
.sp-account-empty h3 { margin: 0 0 11px; font-size: 17px; font-weight: 650; color: #354b2d; letter-spacing: -.25px; }
.sp-account-empty p { max-width: 340px; font-size: 12px; color: #7a8770; line-height: 1.8; margin: 0 0 20px; }
.sp-account-empty-action { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; color: #56734a; font-weight: 600; text-decoration: none; padding: 10px 14px; background: #f2f6e9; border: 1px solid #dce6ce; border-radius: 7px; }
.sp-account-empty-action:hover { color: #17634b; border-color: #adc198; background: #eaf1df; }
.sp-account-empty-action .sp-icon { width: 14px; height: 14px; }
.sp-account-footer { display: flex; justify-content: space-between; gap: 15px; border-top: 1px solid var(--sp-border); margin-top: 38px; padding: 20px 0 25px; font-size: 9px; color: #87927d; }
.sp-agent-form-panel { scroll-margin-top: 108px; }
#agentForm { scroll-margin-top: 160px; }

.sp-agent-onboarding { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 24px; margin-bottom: 24px; border: 1px solid #dce6d2; border-radius: 10px; background: #f6f9f1; color: #405a38; }
.sp-agent-onboarding strong { font-size: 13px; }
.sp-agent-onboarding p { font-size: 12px; line-height: 1.7; margin: 7px 0; max-width: 850px; }
.sp-agent-onboarding a { color: #17634b; font-size: 12px; }
.sp-agent-onboarding form { flex-shrink: 0; max-width: 270px; }
.sp-agent-onboarding small { display: block; font-size: 10px; line-height: 1.6; margin-top: 8px; }
.sp-agent-additional { margin-top: 15px; font-size: 12px; }
.sp-agent-additional summary { cursor: pointer; color: #49683e; padding: 5px 0; }
.sp-agent-additional .form-check { margin: 10px 0 0; }
.sp-agent-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 20px 24px; border-bottom: 1px solid #e9ede5; }
.sp-agent-filters > div { flex: 1 1 180px; min-width: 0; }
.sp-agent-filter-reset { padding: 12px 0; font-size: 11px; color: #526c46; }
.sp-agent-responsibilities { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 7px; max-width: 260px; }
.sp-agent-responsibilities > span { background: #edf4e7; color: #506b42; padding: 4px 6px; border-radius: 4px; font-size: 10px; }
.sp-agent-commission { display: block; max-width: 280px; overflow-wrap: anywhere; }
.sp-account-tabs { display: flex; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid #dce3d5; margin-bottom: 24px; padding-bottom: 12px; }
.sp-account-tabs a { padding: 11px 16px; border-radius: 7px; font-size: 13px; color: #49643f; text-decoration: none; }
.sp-account-tabs a[aria-current="page"] { background: #173e2c; color: #fff; }
.sp-password-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 24px; align-items: start; }
.sp-password-side { display: grid; gap: 24px; }
.sp-password-main { max-width: 760px; padding-bottom: 40px; }
.sp-password-selection-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 12px; font-size: 12px; }
.sp-password-member-list { max-height: 340px; overflow-y: auto; border: 1px solid #dce3d5; border-radius: 8px; }
.sp-password-member { display: flex !important; align-items: flex-start; gap: 12px; margin: 0 !important; padding: 13px; border-bottom: 1px solid #e9ede5; cursor: pointer; }
.sp-password-member:last-child { border-bottom: 0; }
.sp-password-member .form-check-input { flex-shrink: 0; }
.sp-password-member strong { display: block; font-size: 12px; }
.sp-password-member small { display: block; margin-top: 5px; color: #718168; }
.sp-password-requests { list-style: none; padding: 0; margin: 0; }
.sp-password-requests li { padding: 12px 0; border-bottom: 1px solid #e9ede5; }
.sp-password-requests strong, .sp-password-requests small, .sp-password-requests a { display: block; margin-bottom: 6px; font-size: 12px; }

@media (max-width: 1199.98px) {
    .sp-agents-grid { grid-template-columns: minmax(290px, .95fr) minmax(0, 1.45fr); }
    .sp-account-panel-header, .sp-account-panel-body { padding: 20px; }
    .sp-agent-stat { gap: 13px; padding: 18px; }
}
@media (max-width: 991.98px) {
    .sp-password-grid { grid-template-columns: minmax(0,1fr); }
    .sp-profile-grid { grid-template-columns: minmax(0, 1fr); }
    .sp-agents-grid { grid-template-columns: minmax(0, 1fr); }
    .sp-agent-form-panel .sp-account-fields-single { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sp-agent-permissions { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; }
    .sp-agent-permissions .form-check { border-right: 1px solid #edf0e7; }
    .sp-account-heading-badge { display: none; }
}
@media (max-width: 767.98px) {
    .sp-agent-onboarding { flex-direction: column; align-items: flex-start; padding: 18px; }
    .sp-agent-onboarding form { max-width: 100%; }
    .sp-agent-filters { padding: 18px; }
    .sp-account-topbar { min-height: 75px; gap: 15px; padding: 13px 20px; }
    .sp-account-topbar-end { gap: 10px; }
    .sp-account-ufr { display: none; }
    .sp-account-main { padding: 26px 20px 0; }
    .sp-agent-stats { gap: 10px; margin: 23px 0; }
    .sp-agent-stat { display: block; padding: 15px; }
    .sp-agent-stat-icon { width: 33px; height: 33px; border-radius: 8px; margin-bottom: 12px; }
    .sp-agent-stat-icon .sp-icon { width: 18px; height: 18px; }
    .sp-agent-stat > div > span { font-size: 10px; }
    .sp-agent-stat strong { font-size: 25px; margin-top: 6px; }
    .sp-agent-stat small { display: none; }
    .sp-account-banner { align-items: flex-start; flex-direction: column; gap: 18px; padding: 22px; }
    .sp-account-banner-tag { align-self: flex-start; font-size: 10px; padding: 7px 10px; }
    .sp-profile-identity { gap: 15px; }
    .sp-profile-avatar { width: 62px; height: 62px; border-radius: 16px; }
    .sp-account-footer { flex-direction: column; gap: 7px; margin-top: 28px; }
}
@media (max-width: 479.98px) {
    .sp-account-main { padding: 24px 14px 0; }
    .sp-account-topbar { padding: 12px 14px; }
    .sp-account-brand { gap: 8px; }
    .sp-account-brand > span { width: 36px; height: 36px; border-radius: 8px; }
    .sp-account-brand img { width: 30px; height: 30px; }
    .sp-account-brand strong { font-size: 21px; }
    .sp-account-brand small { font-size: 7px; letter-spacing: .8px; }
    .sp-account-return { padding: 8px; gap: 6px; font-size: 10px; }
    .sp-account-panel-header, .sp-account-panel-body { padding: 19px 17px; }
    .sp-account-panel-header { gap: 10px; }
    .sp-account-panel-header h2 { font-size: 14px; }
    .sp-account-panel-header p { font-size: 10px; }
    .sp-account-fields, .sp-agent-form-panel .sp-account-fields-single, .sp-agent-permissions { grid-template-columns: minmax(0, 1fr); }
    .sp-profile-photo-field { flex-direction: column; padding: 15px; }
    .sp-profile-photo-field > div { width: 100%; }
    .sp-agent-permissions .form-check { border-right: 0; }
    .sp-agent-stat { padding: 13px 10px; }
    .sp-agent-stats { gap: 8px; }
    .sp-account-banner { padding: 20px 17px; }
    .sp-account-kicker { font-size: 8px; letter-spacing: 1px; }
    .sp-profile-identity h2 { font-size: 19px; }
    .sp-profile-identity p { font-size: 10px; }
    .sp-account-count { padding: 4px 6px; font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
    .sp-agents-page { scroll-behavior: auto; }
}
