/* Teacher Profile: composition only. Shared UI/KPI/table systems own geometry. */
.teacher-profile-workspace { --tp-gap:var(--ui-card-padding,16px); width:100%; min-width:0; padding:var(--ui-card-padding,16px); color:var(--color-text-primary); }
.teacher-profile-workspace * { box-sizing:border-box; }
.tp-icon { width:18px; height:18px; flex-shrink:0; vertical-align:middle; }
.tp-page-head,.tp-head-actions,.tp-inline-actions,.tp-card>header,.tp-filterbar,.tp-pagination { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.tp-page-head { margin-bottom:16px; }
.tp-page-head h2 { font-size:23px; font-weight:600; margin:4px 0; }
.tp-page-head p { margin:4px 0; color:var(--color-text-secondary); font-size:14px; }
.tp-head-actions { justify-content:flex-end; }
.tp-button { display:inline-flex; align-items:center; justify-content:center; gap:6px; color:var(--color-primary); background:var(--color-surface); border:1px solid var(--color-border); border-radius:var(--radius-control); cursor:pointer; }
.tp-button:disabled { cursor:not-allowed; opacity:.65; }
.tp-actions-wrap { position:relative; }
.tp-actions-menu { position:absolute; z-index:20; top:100%; right:0; display:grid; min-width:220px; padding:8px; background:var(--color-surface); border:1px solid var(--color-border); box-shadow:var(--shadow-card); }
.tp-hero { display:grid; grid-template-columns:124px minmax(0,1fr) 116px; gap:var(--tp-gap); align-items:start; margin-bottom:var(--tp-gap); border-color:var(--color-hero-border); }
.tp-hero-main { min-width:0; }
.tp-hero-person { min-width:0; margin-bottom:12px; }
.tp-hero-facts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); grid-template-rows:repeat(4,auto); gap:0; }
.tp-hero-facts>.tp-hero-column { display:grid; grid-template-rows:subgrid; grid-row:span 4; }
.tp-hero-facts .tp-fiche-facts { grid-template-rows:subgrid; grid-row:span 4; }
.tp-hero-photo,.tp-account-photo { width:124px; height:124px; object-fit:cover; border-radius:var(--radius-card); flex-shrink:0; }
.tp-photo-fallback { display:grid; place-items:center; color:var(--color-primary); background:var(--color-surface-muted); }
.tp-hero h1 { font-size:clamp(18px,calc(1.55vw - 3px),23px); margin:0 0 8px; font-weight:600; }
.tp-hero p { margin:6px 0; font-size:13px; overflow-wrap:anywhere; }
.tp-hero small,.tp-meta { font-size:var(--ns-card-meta-font-size,12px); color:var(--color-text-secondary); }
.tp-hero-column { min-width:0; border-left:1px solid var(--color-border); padding-left:12px; }
.tp-hero-column:first-child { border-left:0; padding-left:0; padding-right:12px; }
.tp-hero-column:not(:last-child) { padding-right:12px; }
.tp-hero .tp-detail-list dt { font-weight:400; }
.tp-fiche-meta { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin:8px 0 12px; }
.tp-fiche-meta>span { font-size:11px!important; padding:4px 7px; border-radius:var(--radius-control); }
.tp-fiche-meta>span:not(.ns-semantic-badge) { background:var(--color-surface); border:1px solid var(--color-border); }
.tp-fiche-facts { display:grid; grid-template-columns:fit-content(45%) max-content minmax(0,1fr); column-gap:5px; margin:0; font-size:12px; }
.tp-fiche-facts>div { display:grid; grid-template-columns:subgrid; grid-column:1/-1; padding:5px 0; border-bottom:1px solid var(--color-border); align-items:baseline; }
.tp-fiche-facts dt { font-weight:400; color:var(--color-text-secondary); }
#appShell .teacher-profile-workspace .tp-fiche-facts dd { font-weight:600!important; margin:0; min-width:0; overflow-wrap:anywhere; }
.tp-photo-wrap { position:relative; width:fit-content; }
.tp-photo-menu { position:absolute; right:0; bottom:0; z-index:3; }
.tp-photo-menu summary { display:flex; padding:6px; background:var(--color-surface); border:1px solid var(--color-border); border-radius:var(--radius-control); cursor:pointer; }
.tp-photo-menu>div { position:absolute; top:100%; left:0; display:grid; min-width:155px; padding:6px; background:var(--color-surface); box-shadow:var(--shadow-card); border:1px solid var(--color-border); }
.tp-responsibility { display:grid; gap:4px; padding:8px 0; border-bottom:1px solid var(--color-border); }
.teacher-profile-workspace .tp-subtabs button { font-size:12px; padding:8px 12px; }
.teacher-profile-workspace .saf-school-info { flex-wrap:wrap; min-width:0; }
.teacher-profile-workspace .saf-school-block { min-width:0; white-space:normal; overflow-wrap:anywhere; }
.tp-hero-column h3 { display:flex; gap:8px; align-items:center; font-size:13px; color:var(--color-primary); margin:0 0 8px; }
.tp-hero .tp-detail-list>div { padding:3px 0; border:0; grid-template-columns:minmax(70px,.85fr) minmax(0,1.15fr); }
.tp-qr { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; min-width:0; }
.tp-qr>svg { width:96px; height:96px; background:var(--color-surface); }
.tp-qr small { text-align:center; }
.tp-profile-shell,.tp-profile-content { min-width:0; }
.teacher-profile-workspace .tp-tabs { display:flex; flex-direction:row; flex-wrap:nowrap; overflow-x:auto; gap:0; padding:4px; margin-bottom:var(--tp-gap); scrollbar-width:thin; max-width:100%; border:1px solid var(--color-border); border-radius:var(--radius-card); }
.teacher-profile-workspace .tp-tabs button { flex:1 0 auto; display:flex; align-items:center; justify-content:center; gap:7px; white-space:nowrap; color:var(--color-text-secondary); background:var(--color-surface-subtle); border:0; border-radius:var(--radius-control); }
.teacher-profile-workspace .tp-tabs button+button { border-left:1px solid var(--color-divider); }
.teacher-profile-workspace .tp-tabs button:disabled { opacity:.6; cursor:not-allowed; }
.teacher-profile-workspace .tp-tabs button.active { color:var(--color-on-primary,#fff)!important; background:var(--color-primary)!important; }
.tp-tabs small { font-size:10px; color:var(--color-text-secondary); }
/* Override the former vertical Teacher navigation theme only on this profile. */
.teacher-profile-workspace .tp-profile-shell .tp-tabs { background:var(--color-surface)!important; color:var(--tab-inactive-text)!important; }
.teacher-profile-workspace .tp-profile-shell .tp-tabs button { color:var(--tab-inactive-text)!important; }
.teacher-profile-workspace .tp-profile-shell .tp-tabs button:hover:not(:disabled):not(.active) { background:var(--tab-hover-bg)!important; }
.teacher-profile-workspace .tp-profile-shell .tp-tabs button.active { background:var(--color-primary)!important; color:var(--color-on-primary,#fff)!important; }
.teacher-profile-workspace>section.tp-hero { background:var(--color-hero-surface)!important; }
.teacher-profile-workspace .tp-hero h3 { color:var(--color-primary)!important; }
#pageContent .teacher-profile-workspace { background:var(--color-surface-muted)!important; }
#pageContent .teacher-profile-workspace .tp-card { background:var(--color-surface)!important; border:1px solid var(--color-border); border-radius:var(--radius-card); }
#pageContent .teacher-profile-workspace .tp-tabs button:not(.active) { background:var(--color-surface-subtle)!important; }
#pageContent .teacher-profile-workspace .tp-tabs button+button { border-left:1px solid var(--color-border)!important; }
#pageContent .teacher-profile-workspace .tp-stat-grid { gap:var(--tp-gap); }
.tp-heading-strip { display:flex; align-items:center; gap:14px; padding:var(--ui-card-padding,16px); margin-bottom:var(--tp-gap); border-radius:var(--radius-card); background:var(--color-hero-surface); border:1px solid var(--color-hero-border); }
.tp-heading-strip>.tp-icon { width:28px; height:28px; color:var(--color-primary); }
.tp-heading-strip>div:first-of-type { flex:1; }
.tp-heading-strip h2 { margin:0; font-size:17px; font-weight:600; }
.tp-heading-strip p { margin:4px 0 0; color:var(--color-text-secondary); font-size:13px; }
.tp-inline-actions { justify-content:flex-end; gap:6px; }
.tp-grid,.tp-stat-grid { display:grid; grid-template-columns:repeat(var(--tp-columns,2),minmax(0,1fr)); gap:var(--tp-gap); align-items:stretch; margin-bottom:var(--tp-gap); }
.tp-grid .tp-grid:last-child,.tp-stack>.tp-grid:last-child { margin-bottom:0; }
.tp-grid>* { min-width:0; }
.teacher-profile-workspace .tp-grid>.ns-chart { height:100%; }
.tp-grid-overview { grid-template-columns:2fr 1fr 1fr; }
.tp-grid-main-side { grid-template-columns:minmax(0,2fr) minmax(0,1fr); }
.tp-grid-history { grid-template-columns:230px minmax(0,1fr); }
.tp-stack { display:flex; flex-direction:column; gap:var(--tp-gap); min-width:0; }
.tp-stack>.tp-card { flex:1; }
.tp-card { min-width:0; margin:0; padding:var(--ui-card-padding,16px); }
.tp-profile-content>.tp-card+.tp-card { margin-top:var(--tp-gap); }
.tp-card>header { align-items:flex-start; margin-bottom:12px; }
.tp-card h3 { display:flex; align-items:center; gap:8px; margin:0; font-size:var(--ns-card-title-font-size); font-weight:var(--ns-card-title-font-weight); }
.tp-card h3>.tp-icon { color:var(--color-primary); }
.tp-detail-list { margin:0; }
.tp-detail-list>div { display:grid; grid-template-columns:minmax(110px,.85fr) minmax(0,1.15fr); gap:12px; padding:6px 0; border-bottom:1px solid var(--color-border); }
.tp-detail-list>div:last-child { border-bottom:0; }
.tp-detail-list dt { color:var(--color-text-secondary); font-size:13px; font-weight:600; }
.tp-detail-list dd { margin:0; font-size:13px; font-weight:400; overflow-wrap:anywhere; }
.tp-chips { display:flex; flex-wrap:wrap; gap:6px; margin:10px 0; }
.tp-activity-item { display:flex; gap:10px; align-items:center; padding:7px 0; border-bottom:1px solid var(--color-border); }
.tp-activity-item>.tp-icon { color:var(--color-primary); }
.tp-activity-item>div { flex:1; min-width:0; }
.tp-activity-item p { font-size:13px; margin:0 0 4px; overflow-wrap:anywhere; }
.tp-activity-item small { font-size:12px; color:var(--color-text-secondary); }
.tp-table-scroll { max-width:100%; min-width:0; overflow-x:auto; }
.tp-table { width:100%; }
.tp-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; padding:16px; text-align:center; color:var(--color-text-secondary); }
.tp-empty p { margin:0; }
.tp-chart-region { min-height:var(--ns-chart-card-height,270px); display:grid; place-items:center; }
.tp-filterbar { align-items:end; justify-content:flex-start; margin:10px 0; }
.tp-filterbar label,.tp-search { display:grid; gap:5px; font-size:13px; min-width:0; }
.tp-filterbar input,.tp-filterbar select,.tp-search input { max-width:100%; }
.tp-filterbar.vertical { flex-direction:column; align-items:stretch; }
.tp-pagination { margin-top:12px; font-size:12px; }
.tp-account-summary { display:flex; align-items:center; gap:20px; }
.tp-account-summary .tp-detail-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px 18px; width:100%; }
.tp-account-summary .tp-detail-list>div { display:block; }
.tp-account-summary dd { padding-top:6px; }
.tp-edit-modal { width:min(720px,calc(100vw - 30px)); }
.tp-action-modal-body { display:grid; gap:14px; max-height:66vh; padding:var(--ui-card-padding,16px); overflow-y:auto; }
.tp-edit-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.tp-modal-field,.tp-edit-grid label { display:grid; gap:6px; }
.tp-modal-field textarea { min-height:88px; }
.tp-check-line,.tp-warning-box,.tp-modal-note { display:flex; align-items:flex-start; gap:10px; }
.tp-warning-box,.tp-modal-note { padding:12px; background:var(--color-warning-soft); color:var(--color-warning-text); }
.tp-document-actions-modal { display:grid; gap:10px; }
.tp-photo-preview { display:grid; place-items:center; }
.tp-photo-preview-image { max-width:100%; max-height:62vh; object-fit:contain; }
@media (max-width:1480px) {
  .teacher-profile-workspace { --tp-gap:14px; }
  .tp-hero { grid-template-columns:100px minmax(0,1fr) 110px; }
  .tp-hero-photo { width:100px; height:100px; }
  .tp-hero .tp-detail-list>div { grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr); gap:8px; }
}
@media (max-width:1024px) {
  .tp-grid-overview,.tp-grid-main-side { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .tp-grid-overview>.tp-card:first-child { grid-column:1/-1; }
}
@media (max-width:900px) {
  .tp-hero { grid-template-columns:100px minmax(0,1fr) 110px; }
  .tp-hero-facts { grid-template-columns:1fr; gap:12px; }
  .tp-hero-column { border-left:0; padding-left:0; }
  .tp-stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .tp-grid-history { grid-template-columns:1fr; }
  .tp-account-summary .tp-detail-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:600px) {
  .teacher-profile-workspace { padding:10px; }
  .teacher-profile-workspace { --tp-gap:12px; }
  .tp-grid,.tp-grid-main-side,.tp-grid-overview { grid-template-columns:1fr; }
  .tp-stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .tp-hero { grid-template-columns:1fr; }
  .tp-hero-person { grid-column:auto; }
  .tp-hero-column { border-left:0; padding-left:0; }
  .tp-qr { flex-direction:row; flex-wrap:wrap; }
  .tp-heading-strip { flex-wrap:wrap; }
  .tp-heading-strip .tp-inline-actions { width:100%; justify-content:flex-start; }
  .tp-account-summary { align-items:flex-start; flex-direction:column; }
  .tp-account-summary .tp-detail-list,.tp-edit-grid { grid-template-columns:1fr; }
  .tp-head-actions { justify-content:flex-start; }
}
@media print {
  .tp-tabs,.tp-head-actions,.tp-button { display:none!important; }
  .tp-hero { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .tp-table-scroll { overflow:visible; }
}
.teacher-profile-workspace .tp-fiche-facts>div{align-items:center}
@media(min-width:1280px){.teacher-profile-workspace .tp-fiche-meta{flex-wrap:nowrap}.teacher-profile-workspace .tp-fiche-meta>span{white-space:nowrap}}
