:root { font-family: "Nunito", "Segoe UI", system-ui, sans-serif; color: #29252e; background: #f5f3f6; }
* { box-sizing: border-box; }
body { margin: 0; }
.board { min-height: 100vh; display: flex; flex-direction: column; }
.television { height: 100vh; overflow: hidden; }
.topbar { height: 84px; flex: none; background: white; display: flex; align-items: center;
  padding: 0 3.1vw; border-bottom: 1px solid #e9e2ea; gap: 32px; }
.topbar img { width: 190px; height: 54px; object-fit: contain; }
.top-title { border-left: 1px solid #e4dde5; padding-left: 32px; display: grid; gap: 4px; }
.top-title span, .eyebrow { font-size: 12px; color: #8c7a8e; font-weight: 700; letter-spacing: .12em; }
.top-title strong { font-size: 21px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 25px; }
.top-right time { font-size: 32px; font-weight: 600; font-variant-numeric: tabular-nums; }
.connection { background: #f3edf4; color: #815184; border-radius: 30px; padding: 9px 15px; font-size: 14px; font-weight: 600; }
.connection.offline { color: #a45431; background: #fff1e9; }
main { padding: 25px 3.1vw 18px; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 18px; }
.heading { display: flex; align-items: end; justify-content: space-between; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(25px, 1.9vw, 36px); letter-spacing: -.025em; margin-top: 4px; }
.date { text-transform: capitalize; color: #786e7b; font-size: 16px; }
.metrics { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 13px; }
.metric, .panel { background: white; border: 1px solid #eae4eb; border-radius: 13px; }
.metric { min-width: 0; padding: 17px 18px; display: flex; flex-direction: column; gap: 5px; }
.metric span { font-weight: 600; font-size: clamp(13px, .85vw, 17px); color: #675c6a; }
.metric strong { font-size: clamp(29px, 2.1vw, 40px); line-height: 1.1; font-weight: 650; }
.metric small { font-size: 12px; color: #948a97; }
.metric.primary { background: #faf5fb; border-color: #ddc7e0; }
.metric.primary strong { color: #944e94; }
.content { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(300px,1fr); gap: 18px; flex: 1; min-height: 0; }
.panel { padding: 23px; min-width: 0; }
.team-panel, .calls-panel { display: flex; flex-direction: column; min-height: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 18px; }
.panel-heading h2 { font-size: clamp(20px,1.35vw,26px); margin: 5px 0; }
.panel-heading p { font-size: 14px; color: #8a808d; }
.pill { background: #f1e8f2; color: #87488a; padding: 7px 12px; border-radius: 8px; font-weight: 700; white-space: nowrap; }
.agent-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; align-content: start; }
.agent { display: flex; gap: 14px; padding: 16px; background: #faf9fb; border: 1px solid #f0ebf1; border-radius: 10px; min-width: 0; }
.agent.urgent { background: #fff3f2; border-color: #efc1bd; }
.avatar { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: #f0e5f1; color: #944e94; font-weight: 700; }
.agent-info { display: grid; gap: 4px; min-width: 0; }
.agent-info strong { font-size: clamp(16px,1vw,21px); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.agent-info span { font-size: 13px; color: #8b828e; }
.agent-state { font-size: 14px; color: #7d5680; font-weight: 600; }
.attention { font-size: 14px; font-weight: 700; color: #b04a43; }
.pagination { margin-top: auto; text-align: right; color: #8b828e; font-size: 13px; padding-top: 10px; }
.right-column { display: grid; grid-template-rows: 1fr auto; gap: 18px; min-height: 0; }
.call-list { display: grid; gap: 0; }
.call { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 11px 0; border-bottom: 1px solid #f0ebf1; }
.call div { display: grid; gap: 3px; min-width: 0; }
.call strong { font-size: 17px; }
.call span { color: #8b828e; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call b { color: #944e94; background: #f2eaf3; padding: 6px 9px; border-radius: 6px; font-size: 13px; white-space: nowrap; }
.alerts { padding-top: 18px; padding-bottom: 18px; }
.alerts .panel-heading { margin-bottom: 10px; }
.unavailable { color: #8b828e; font-size: 15px; }
.empty { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 9px; text-align: center; color: #8b828e; }
.empty strong { color: #514957; font-size: 19px; }
.empty span { font-size: 14px; }
.empty.compact { padding: 15px; }
.announcement { flex: none; display: flex; align-items: center; gap: 18px; border-radius: 12px; padding: 17px 22px; color: white; background: #944e94; min-height: 94px; }
.announcement.warning { background: #c77918; }
.announcement.danger { background: #b33a3a; }
.announcement-icon { display: grid; place-items: center; background: #ffffff25; border-radius: 11px; width: 46px; height: 46px; flex: none; font-size: 22px; }
.announcement span { font-size: 12px; font-weight: 700; letter-spacing: .12em; opacity: .8; }
.announcement p { font-size: clamp(18px,1.3vw,25px); font-weight: 600; margin-top: 5px; overflow-wrap: anywhere; }
.announcement p :is(strong, em) { opacity: 1; }
.announcement p strong { font-weight: 800; }
.announcement p em { font-style: italic; }
footer { flex: none; display: flex; gap: 20px; justify-content: space-between; align-items: center; color: #8e8491; background: white; padding: 10px 3.1vw; font-size: 12px; }
footer a, .back { color: #944e94; text-decoration: none; font-weight: 600; }
.settings { max-width: 800px; padding: 40px 24px; margin: auto; }
.settings h1 { margin: 24px 0; }
.settings-card { background: white; padding: 25px; border: 1px solid #eae4eb; border-radius: 12px; margin: 18px 0; }
.settings-card p { margin: 12px 0; color: #756b79; }
.settings-card label { display: block; font-weight: 600; margin: 18px 0 8px; }
textarea { width: 100%; font: inherit; padding: 12px; border-radius: 8px; border: 1px solid #d7ced9; resize: vertical; }
button { background: #944e94; color: white; border: none; border-radius: 8px; padding: 12px 17px; font: inherit; font-weight: 600; cursor: pointer; }
button.secondary { color: #944e94; background: #f2eaf3; }
button:disabled { opacity: .5; }
.settings-actions { display: flex; gap: 10px; margin-top: 14px; }
.status { font-weight: 600; }
.announcement-levels { display: flex; gap: 12px; margin: 14px 0 6px; }
.announcement-level { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 8px;
  border: 2px solid #e5dee6; font-weight: 600; cursor: pointer; }
.announcement-level:has(input:checked) { border-color: currentColor; background: #f9f5fa; }
.announcement-level.normal { color: #944e94; }
.announcement-level.warning { color: #c77918; }
.announcement-level.danger { color: #b33a3a; }
.announcement-level input { accent-color: currentColor; }
@media (max-width: 1050px) { .metrics { grid-template-columns: repeat(3,1fr); } .content { grid-template-columns: 1fr; } .television { height: auto; overflow: auto; } .right-column { grid-template-rows: auto auto; } }
@media (max-width: 650px) { .topbar { padding: 0 18px; gap: 12px; height: 70px; } .topbar img { width: 130px; } .top-title, .date { display: none; } .top-right { gap: 10px; } .top-right time { font-size: 22px; } .connection { font-size: 11px; padding: 7px; } main { padding: 20px 14px; } .metrics { grid-template-columns: repeat(2,1fr); gap: 9px; } .metric { padding: 13px; } .agent-grid { grid-template-columns: 1fr; } .panel { padding: 18px; } footer { flex-wrap: wrap; } }

@media (min-width: 1100px) {
  .television .eyebrow, .television .top-title span, .television .announcement span { font-size: 15px; }
  .television .metric span { font-size: 17px; }
  .television .metric small, .television .panel-heading p { font-size: 15px; }
  .television .agent-info strong { font-size: 21px; }
  .television .agent-info span, .television .agent-state, .television .attention { font-size: 17px; }
  .television .call strong { font-size: 20px; }
  .television .call span, .television .call b { font-size: 16px; }
  .television .pagination, .television footer { font-size: 15px; }
}

/* Wallboard TV : indicateurs denses et listes lisibles sans défilement manuel. */
.television .topbar { height: 64px; padding: 0 1.2vw; gap: 18px; }
.television .topbar img { width: 175px; height: 48px; }
.television .top-title, .television .heading { display: none; }
.television .top-right { gap: 16px; }
.television .top-right time { font-size: 26px; }
.television main { padding: 12px 1vw 8px; gap: 10px; }
.television .metrics { gap: 10px; }
.television .metric { border-radius: 9px; padding: 10px 14px; gap: 3px; }
.television .metric span { font-size: clamp(14px, .9vw, 17px); }
.television .metric strong { font-size: clamp(27px, 2vw, 38px); }
.television .metric small { display: none; }
.television .metric.primary { background: #944e94; border-color: #944e94; }
.television .metric.primary span, .television .metric.primary strong { color: white; }
.television .tv-content { display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 10px; flex: 1; min-height: 0; }
.television .tv-content .panel { padding: 13px; border-radius: 9px; min-height: 0; }
.tv-team, .tv-alerts, .tv-calls { display: flex; flex-direction: column; min-width: 0; }
.tv-panel-heading { display: flex; align-items: center; justify-content: space-between;
  gap: 8px; border-bottom: 1px solid #e5dee6; padding-bottom: 9px; margin-bottom: 8px; }
.tv-panel-heading h2 { font-size: clamp(18px, 1.25vw, 24px); color: #29252e; }
.tv-panel-count { color: #944e94; font-size: 15px; font-weight: 700; white-space: nowrap; }
.tv-table-header { display: grid; grid-template-columns: minmax(0, 2fr) minmax(100px, 1.2fr) 75px 75px;
  align-items: center; gap: 8px; color: #756b79; font-size: 13px; font-weight: 600; padding: 5px 10px; }
.tv-table-header span:nth-child(n+3) { text-align: center; }
.tv-operator-list { display: flex; flex-direction: column; }
.tv-operator { display: flex; flex-direction: column; border-bottom: 1px solid #e7e4e9;
  background: #f7f7f9; font-size: clamp(15px, .93vw, 18px); }
.tv-operator:nth-child(even) { background: #eeeeF1; }
.tv-operator.urgent { background: #ffe9e7; border-left: 5px solid #d6544d; }
.tv-operator.urgent .tv-operator-row { padding-left: 5px; }
.tv-operator-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(100px, 1.2fr) 75px 75px;
  align-items: center; gap: 8px; min-height: clamp(31px, 4.3vh, 48px); padding: 4px 10px; }
.tv-operator-name { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.tv-operator-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-operator-name span { font-size: 13px; color: #807482; white-space: nowrap; }
.tv-operator-calls { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 10px 8px;
  background: #f1eff2; border-top: 1px solid #e7e4e9; }
.tv-operator-call { display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  min-width: 0; padding: 4px 8px; border-radius: 5px; background: #f8f6f9; }
.tv-operator-call > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; font-weight: 600; }
.tv-operator-call .tv-call-state { font-size: 11px; padding: 3px 4px; }
.tv-transfer { width: 100%; color: #88418c; font-size: 11px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-state { justify-self: start; border-radius: 5px; font-size: 13px; font-weight: 600;
  padding: 4px 7px; white-space: nowrap; }
.tv-state.busy { color: #744077; background: #efe1f1; }
.tv-state.ringing { color: #895900; background: #ffefca; }
.tv-state.unknown { color: #645c67; background: #e8e6ea; }
.tv-count { text-align: center; font-size: clamp(17px, 1.1vw, 22px); }
.tv-count.attention { color: #bd3535; }
.tv-pagination { color: #756b79; font-size: 14px; text-align: right; padding-top: 8px; margin-top: auto; }
.tv-empty, .tv-unavailable { padding: 16px 8px; color: #77707a; font-size: 16px; }
.tv-side { display: grid; grid-template-rows: auto minmax(0,1fr); gap: 10px; min-height: 0; }
.tv-backup-stats { display: grid; grid-template-columns: repeat(3,1fr); text-align: center; background: #f7f7fa; border-radius: 6px; padding: 10px 3px; }
.tv-backup-stats div { display: grid; gap: 4px; border-right: 1px solid #e5dee6; }
.tv-backup-stats div:last-child { border-right: 0; }
.tv-backup-stats strong { font-size: 24px; color: #827888; }
.tv-backup-stats span { font-size: 13px; color: #756b79; }
.tv-backups .tv-unavailable { text-align: center; font-size: 14px; padding: 8px 0 0; }
.tv-call-state { color: #87488a; background: #f1e8f2; border-radius: 5px; padding: 4px 6px;
  font-size: 13px; font-weight: 600; white-space: nowrap; }
.television .announcement { min-height: 48px; border-radius: 8px; padding: 8px 14px; gap: 12px; }
.television .announcement-icon { width: 32px; height: 32px; font-size: 17px; border-radius: 6px; }
.television .announcement div:last-child { display: flex; align-items: baseline; gap: 15px; min-width: 0; }
.television .announcement span { font-size: 13px; white-space: nowrap; }
.television .announcement p { font-size: clamp(17px, 1.1vw, 21px); margin: 0; }
.television footer { padding: 6px 1vw; font-size: 13px; }
@media (max-width: 1300px) {
  .television .tv-table-header, .television .tv-operator-row {
    grid-template-columns: minmax(0, 2fr) minmax(95px, 1.2fr) 58px 58px;
  }
  .television .tv-operator-name span { display: none; }
}
@media (max-height: 850px) {
  .television .topbar { height: 50px; }
  .television .metric { padding: 6px 10px; }
  .television .metric strong { font-size: 27px; }
  .television .tv-content .panel { padding: 9px; }
  .television .tv-panel-heading { padding-bottom: 5px; margin-bottom: 3px; }
  .television .tv-operator-row { min-height: 31px; }
  .television .tv-state { padding: 2px 5px; }
  .television .tv-operator-call { padding: 3px 5px; }
  .television .tv-operator-call > span:first-child { font-size: 12px; }
  .television .tv-call-state { font-size: 12px; padding: 3px 4px; }
  .television .announcement { min-height: 42px; }
}

@media (min-width: 700px) and (max-width: 1050px) {
  .television { height: 100vh; overflow: hidden; }
  .television .metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .television .tv-table-header, .television .tv-operator-row {
    grid-template-columns: minmax(0, 1.7fr) minmax(90px, 1fr) 42px 42px;
    gap: 4px;
  }
  .television .tv-table-header, .television .tv-state { font-size: 11px; }
  .television .tv-operator-row { font-size: 13px; }
}

/* Tableau opérateurs et appels regroupés par poste. */
.television .tv-operations { display: grid; grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px; min-height: 0; min-width: 0; }
.television .tv-side { display: block; }
.television .tv-table-header, .television .tv-operator-row {
  grid-template-columns: minmax(130px, 2fr) minmax(108px, 1.2fr) repeat(5, minmax(48px, .55fr));
  gap: 5px;
}
.television .tv-table-header span { line-height: 1.1; }
.television .tv-missing { text-align: center; color: #8d8491; font-weight: 600; }
.television .tv-team .tv-pagination { margin-top: 5px; }
.television .source-warning { color: #975523; background: #fff0e5; border-radius: 6px;
  padding: 8px 10px; font-size: 14px; font-weight: 600; }
@media (max-width: 1300px) {
  .television .tv-table-header, .television .tv-operator-row {
    grid-template-columns: minmax(100px, 1.5fr) minmax(95px, 1fr) repeat(5, 42px);
  }
  .television .tv-table-header { font-size: 11px; }
  .tv-operator-call { gap: 3px; padding: 3px 6px; }
  .tv-operator-call > span:first-child { font-size: 11px; }
  .tv-operator-call .tv-call-state { font-size: 10px; padding: 2px; }
}
@media (max-height: 850px) {
  .television .tv-operator-row { min-height: 28px; }
  .television .tv-operator-calls { padding: 3px 10px 5px; }
  .television .tv-operator-call { padding: 2px 5px; }
  .television .tv-table-header { padding-top: 2px; padding-bottom: 2px; }
}
@media (min-width: 700px) and (max-width: 1050px) {
  .television .tv-table-header, .television .tv-operator-row {
    grid-template-columns: minmax(70px, 1.2fr) minmax(90px, 1fr) repeat(5, 32px);
    gap: 3px;
  }
  .television .tv-count { font-size: 14px; }
  .tv-operator-call > span:first-child { font-size: 11px; }
}

@media (max-height: 850px) {
  .television .topbar { height: 42px; }
  .television .topbar img { height: 35px; }
  .television main { padding-top: 6px; padding-bottom: 5px; gap: 6px; }
  .television .metric { padding: 5px 8px; }
  .television .metric span { font-size: 12px; line-height: 1.15; }
  .television .metric strong { font-size: 23px; line-height: 1; }
  .television .tv-content { gap: 6px; }
  .television .tv-operations { gap: 6px; }
  .television .tv-panel-heading h2 { font-size: 16px; }
  .television .tv-operator-row { min-height: 25px; padding-top: 2px; padding-bottom: 2px; }
  .television .tv-count { font-size: 16px; }
  .television .tv-pagination { padding-top: 3px; font-size: 11px; }
  .television .announcement { min-height: 36px; padding: 4px 10px; }
  .television .announcement-icon { width: 28px; height: 28px; }
  .television footer { padding-top: 3px; padding-bottom: 3px; font-size: 11px; }
}

.ninja-status { font-size: 13px; color: #68606c; padding: 3px 0 8px; }
.ninja-status.stale { color: #a15322; font-weight: 600; }
.ninja-alert-list { display: grid; gap: 7px; align-content: start; min-height: 0; }
.ninja-alert { border-radius: 6px; padding: 8px 10px; background: #f1eff2;
  border-left: 4px solid #958b98; min-width: 0; }
.ninja-alert.critical { background: #ffe8e6; border-color: #c83f35; }
.ninja-alert.high { background: #fff0df; border-color: #db8122; }
.ninja-alert.medium { background: #fff5d9; border-color: #d1a320; }
.ninja-alert.low { background: #eaf4fb; border-color: #4083b3; }
.ninja-alert-heading { display: flex; gap: 6px; align-items: baseline; justify-content: space-between; }
.ninja-alert-heading strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 15px; }
.ninja-alert-heading span { font-size: 11px; font-weight: 700; flex: none; }
.ninja-alert-device { font-size: 12px; color: #6f6672; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ninja-alert-message { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-height: 850px) {
  .television .ninja-alert-list { gap: 4px; }
  .television .ninja-alert { padding: 4px 7px; }
  .television .ninja-alert-heading strong { font-size: 13px; }
  .television .ninja-alert-device, .television .ninja-alert-message { font-size: 11px; }
}
.tv-operator-call.long-call,
.call.long-call {
    background: #fff0f0;
    border: 2px solid #b42332;
    color: #a01828;
}

.long-call .tv-call-state,
.long-call b {
    color: #a01828;
    font-weight: 800;
}
.tv-alert-page {
    min-height: 0;
    animation: alert-page-enter 350ms ease-out both;
}

@keyframes alert-page-enter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-rotation-track {
    height: 3px;
    margin-top: 8px;
    overflow: hidden;
    background: #E8DFE8;
    border-radius: 3px;
}

.alert-rotation-track > span {
    display: block;
    height: 100%;
    background: #944E94;
    transform-origin: left;
    animation: alert-rotation-progress var(--alert-rotation, 9s) linear both;
}

@keyframes alert-rotation-progress {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
    .tv-alert-page,
    .alert-rotation-track > span { animation: none; transform: none; }
    .alert-rotation-track { display: none; }
}

/* Sauvegardes : même lecture sur TV et mobile. */
.backup-panel .backup-cycle { font-size: 14px; margin: 6px 0 10px; color: #65586a; }
.backup-panel .backup-success { color: #16804b; }
.backup-panel .backup-pending { color: #946400; }
.backup-panel .backup-failed, .backup-unknown { color: #b52c39; }
.backup-breakdown { width: 100%; border-collapse: collapse; margin-top: 10px; }
.backup-breakdown th, .backup-breakdown td { padding: 7px 4px; text-align: right; }
.backup-breakdown th:first-child { text-align: left; }
.backup-breakdown thead { font-size: 12px; color: #65586a; }
.backup-breakdown tbody { font-size: 16px; }
.backup-breakdown tbody tr + tr { border-top: 1px solid #eee8ef; }
.backup-freshness, .backup-detail { margin-top: 9px; font-size: 13px; color: #65586a; }
.backup-panel.stale .backup-freshness { color: #946400; font-weight: 700; }
.backup-unknown { margin-top: 8px; font-weight: 700; }

.board-clock { display: grid; justify-items: end; gap: 1px; }
.board-date { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #65586a; }
.api-indicator { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.api-indicator.online { background: #16804b; }
.api-indicator.offline { background: #b52c39; }

.access-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.access-card { width: min(100%, 480px); flex: none; background: white; padding: 32px;
  border: 1px solid #eae4eb; border-radius: 14px; gap: 20px; }
.access-card img { width: 210px; height: auto; }
.access-card h1 { font-size: 26px; }
.access-card form { display: grid; gap: 14px; }
.access-card input { min-height: 44px; padding: 10px; border: 1px solid #b9a7bd;
  border-radius: 6px; font: inherit; width: 100%; }
.access-card button { min-height: 44px; background: #944e94; color: white; border: 0;
  border-radius: 6px; padding: 10px 18px; font: inherit; cursor: pointer; }
.access-card input:focus-visible, .access-card button:focus-visible { outline: 3px solid #944e94;
  outline-offset: 3px; }
.access-error { color: #b52c39; }
.access-success { color: #16804b; }
/* Consultation des agents sur PC et mobile. */
.mobile { font-family: "Segoe UI", system-ui, sans-serif; background: #F6F5F8; color: #292929; }
.mobile main { width: min(100%, 1680px); margin: 0 auto; gap: 24px; }
.mobile .topbar { height: 72px; padding: 0 24px; gap: 24px; }
.mobile .topbar img { width: 170px; height: 48px; }
.mobile .top-title { padding-left: 24px; }
.mobile .source-warning { color: #946013; background: #FFF3DE; padding: 8px; border-radius: 6px; }
.mobile .content { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.mobile .team-panel { padding: 0; background: transparent; border: 0; }
.mobile .panel-heading { align-items: center; margin-bottom: 16px; }
.mobile h1 { font-size: 26px; margin: 0; }
.mobile .agent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mobile .agent { display: block; padding: 16px; background: #FFFFFF; border-color: #E8DFE8; }
.mobile .agent.urgent { border-color: #B42332; }
.agent-header { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.mobile .agent-info { flex: 1; min-width: min(160px, 100%); }
.mobile .agent-info h2 { font-size: 18px; overflow-wrap: anywhere; }
.mobile .agent-state { color: #6B6470; font-size: 14px; }
.agent-header .attention { width: 100%; }
.agent-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 16px 0 0; border-top: 1px solid #E8DFE8; gap: 16px; padding-top: 16px; }
.agent-stats dt { font-size: 13px; color: #6B6470; }
.agent-stats dd { margin: 4px 0 0; font-size: 20px; font-weight: 600;
  font-variant-numeric: tabular-nums; }
.agent-calls { margin-top: 16px; border-top: 1px solid #E8DFE8; }
.mobile .call { flex-wrap: wrap; padding: 12px 0; }
.mobile .call:last-child { border-bottom: 0; padding-bottom: 0; }
.mobile .call strong, .mobile .call span { white-space: normal; overflow-wrap: anywhere; }
.mobile .call.long-call { padding: 12px; border-radius: 8px; }
.mobile .right-column { grid-template-rows: auto; align-content: start; }
.mobile .panel-heading h2 { font-size: 20px; margin: 0; }
.mobile .empty { padding: 24px; background: #FFFFFF; border: 1px solid #E8DFE8;
  border-radius: 12px; }
.mobile .ninja-alert-heading { flex-wrap: wrap; }
.mobile .ninja-alert-heading strong, .mobile .ninja-alert-device,
.mobile .ninja-alert-message { white-space: normal; overflow-wrap: anywhere; }
.mobile .metric small { color: #6B6470; }
.mobile footer a:focus-visible { outline: 3px solid #944E94; outline-offset: 4px; }
@media (max-width: 1200px) {
  .mobile .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mobile .content { grid-template-columns: minmax(0, 1fr); }
  .mobile .right-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .mobile main { padding: 16px; gap: 16px; }
  .mobile .topbar { height: auto; min-height: 72px; padding: 8px 16px; flex-wrap: wrap; gap: 8px; }
  .mobile .topbar img { width: 130px; }
  .mobile .top-right { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
  .mobile .metrics, .mobile .agent-grid, .mobile .right-column {
    grid-template-columns: minmax(0, 1fr); }
  .mobile .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile .metric strong { font-size: clamp(22px, 6vw, 29px); overflow-wrap: anywhere; }
  .mobile .board-date { font-size: 11px; }
}
.agent-period { margin-top: 16px; padding-top: 12px; border-top: 1px solid #E8DFE8;
  color: #6B6470; font-size: 13px; }
.agent-period + .agent-stats { border-top: 0; margin-top: 12px; padding-top: 0; }
/* Présentation commune inspirée du dashboard Technoclic de référence. */
.board {
  --readable-text: #292929;
  --readable-muted: #625d68;
  --danger: #a33f4b;
  --danger-surface: #fff3f3;
  --critical-accent: #b42332;
  --critical-surface: #ffc2c2;
  --critical-border: #df818c;
  --board-border: #e5e7eb;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-weight: 400;
  color: var(--readable-text);
  background: #f7f8fa;
}
.board :is(h1, h2, h3, strong, b, th) { font-weight: 600; }
.board :is(time, .metric strong, .tv-count, .tv-missing, .agent-stats dd) {
  font-variant-numeric: tabular-nums;
}
.board .panel, .board .metric {
  border-color: var(--board-border);
  box-shadow: 0 1px 3px #18203306;
}
.board .tv-state.unavailable, .mobile .agent-state.unavailable {
  background: #f1f1f4; color: var(--readable-muted); font-weight: 500;
}
.mobile .agent-state { display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px; border-radius: 6px; background: #f1f1f4; }
.mobile .agent-state::before { content: ""; width: 8px; height: 8px;
  background: currentColor; border-radius: 50%; flex: none; }
.mobile .agent-state.busy { background: #f1e8f2; color: #744077; }
.board .ninja-alert { border-left-width: 3px; }
.board .ninja-alert.critical {
  background: var(--critical-surface); color: var(--readable-text);
  border: 1px solid var(--critical-border); border-left: 3px solid var(--critical-accent);
}
.board .ninja-alert.critical .ninja-alert-heading span { color: var(--critical-accent); }
.board .ninja-alert.high { background: #fff6e9; border-left-color: #b78030; }
.board .ninja-alert.medium { background: #fffaed; border-left-color: #b69a45; }
.board .ninja-alert.low { background: #eef5fb; border-left-color: #5883a6; }
.board .ninja-alert-heading span { font-weight: 500; }
.board .tv-count.attention, .board .attention { color: var(--danger); }
.board .tv-operator.urgent {
  border-left: 3px solid #b78030; background: #fff8eb;
}
.board .agent.urgent { border-color: #dec99e; background: #fffdf8; }
.board .long-call {
  border-color: #d7acb1; background: var(--danger-surface);
  color: var(--danger); font-weight: 400;
}
.board .long-call :is(strong, span, b) { color: var(--danger); font-weight: 500; }
.board .long-call .tv-call-state, .board .long-call b { background: transparent; }
.board .tv-missing, .board .ninja-status, .board .tv-table-header,
.board .agent-period, .board .agent-stats dt, .board .metric small,
.board .ninja-alert-device, .board .backup-detail, .board .backup-freshness,
.board .board-date { color: var(--readable-muted); }
.board .announcement.warning { background: #fff3de; color: #80571c; }
.board .announcement.danger {
  background: var(--danger-surface); color: var(--danger); border: 1px solid #efdadd;
}
.board .announcement p strong { font-weight: 600; }
.board .pill { font-weight: 500; }
.pinned-alerts { margin-bottom: 12px; }
.pinned-alerts h3 { font-size: 14px; margin: 0 0 8px; color: var(--critical-accent); }
.alert-pagination { display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-top: 16px; font-size: 14px; font-weight: 500; }
.alert-pagination button { min-height: 44px; padding: 10px 12px; }
.alert-pagination button:focus-visible { outline: 3px solid #944e94; outline-offset: 3px; }
.alert-pagination button:disabled {
  opacity: 1; color: #6b6470; background: #f1f1f4; cursor: default;
}

/* TV : panneaux clairs, hiérarchie compacte et accents limités aux états utiles. */
.television .tv-content {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.1fr) minmax(0, .9fr);
}
.television .topbar { border-color: var(--board-border); }
.television .metric { padding: 10px 14px; }
.television .metric span { font-size: clamp(13px, .85vw, 16px); font-weight: 400; }
.television .metric strong { font-size: clamp(25px, 1.7vw, 34px); font-weight: 500; }
.television .metric.primary { background: #f5eef6; border-color: #e1d0e3; }
.television .metric.primary span { color: #744077; }
.television .metric.primary strong { color: #944e94; }
.television .tv-panel-heading h2 { font-size: clamp(17px, 1.15vw, 22px); }
.television .tv-panel-heading { border-color: var(--board-border); }
.television .tv-table-header, .television .tv-state,
.television .tv-panel-count, .television .pill, .television .ninja-status,
.television .tv-pagination { font-size: 13px; font-weight: 500; }
.television .tv-table-header, .television .tv-operator-row {
  grid-template-columns: minmax(100px, 1.8fr) minmax(105px, 1.3fr)
    repeat(5, minmax(36px, .6fr));
}
.television .tv-operator { background: #fafafa; border-bottom-color: var(--board-border); }
.television .tv-operator:nth-child(even) { background: #f3f4f6; }
.television .tv-operator.urgent { background: #fff8eb; }
.television .tv-operator-row {
  font-size: clamp(15px, .95vw, 18px); min-height: 36px; padding: 5px 10px;
}
.television .tv-operator-name strong { font-weight: 500; }
.television .tv-count { font-size: clamp(17px, 1.1vw, 21px); font-weight: 500; }
.television .tv-missing { font-weight: 400; }
.television .tv-operator-calls { background: #f8f9fb; gap: 6px; padding: 5px 8px; }
.television .tv-operator-call { background: white; border: 1px solid #e5e7eb; }
.television .tv-operator-call.long-call {
  background: var(--danger-surface); border-color: #d7acb1;
}
.television .tv-operator-call > span:first-child { font-size: 14px; font-weight: 500; }
.television .tv-operator-call .tv-call-state, .television .tv-transfer {
  font-size: 12px; font-weight: 500;
}
.television .ninja-alert-heading { flex-wrap: wrap; }
.television .ninja-alert-heading strong { font-size: 15px; font-weight: 500; }
.television .ninja-alert-heading span { font-size: 12px; }
.television .ninja-alert-device, .television .ninja-alert-message { font-size: 13px; }
.television .ninja-alert-message { white-space: normal; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.television .ninja-alert { padding: 8px 10px; }
.television .alert-pagination { margin-top: auto; padding-top: 12px; justify-content: flex-end; }
.television .backup-panel .backup-cycle, .television .backup-detail,
.television .backup-freshness, .television .backup-unknown { font-size: 13px; }
.television .tv-backup-stats span, .television .backup-breakdown thead { font-size: 12px; }
.television .tv-backup-stats strong { font-size: 25px; font-weight: 500; }
.television .backup-breakdown tbody { font-size: 15px; }
.television .backup-breakdown th { font-weight: 500; }
.television .backup-breakdown th, .television .backup-breakdown td { padding: 7px 2px; }
.television .announcement p { font-size: clamp(17px, 1.1vw, 22px); font-weight: 400; }
.television .board-date { font-size: 13px; }
.television .tv-unavailable { font-size: 14px; }
@media (max-width: 1500px) {
  .television .tv-table-header, .television .tv-operator-row {
    grid-template-columns: minmax(80px, 1.5fr) minmax(95px, 1.3fr)
      repeat(5, minmax(30px, .6fr));
  }
  .television .tv-table-header, .television .tv-state { font-size: 12px; }
}
@media (max-height: 850px) {
  .television .metric { padding: 6px 10px; }
  .television .tv-operator-row { min-height: 28px; padding-top: 2px; padding-bottom: 2px; }
  .television .ninja-alert { padding: 5px 8px; }
}
