/* V2.8.11-53 — densité lisible, actions persistantes et états colorés. */
@media screen {
  #content { padding:12px 16px 34px; }
  #content>.panel { margin-bottom:10px; border-radius:12px; }
  #content>.panel>.panel-head { min-height:52px; padding:9px 12px; }
  #content>.panel>.panel-head h3 { font-size:17px; line-height:1.2; }
  #content>.panel>.panel-head p { margin-top:2px; font-size:12px; line-height:1.25; }
  #content>.panel>.panel-body { padding:9px 10px 10px; }
  #content>.panel>.panel-head .actions { align-items:center; }

  .toolbar { align-items:center; margin-bottom:6px; gap:7px; }
  .toolbar-left,.toolbar-right { gap:7px; }
  .toolbar-left { flex:1 1 520px; }
  .toolbar-left .field-search { flex:1 1 300px; }
  .toolbar-left .filter-select { flex:1 1 230px; }
  .toolbar-right { flex:0 0 auto; }
  .view-toolbar { align-items:end; gap:7px; margin-bottom:6px; }
  .view-toolbar label { display:flex; align-items:center; gap:6px; min-width:0; }
  .view-toolbar label>select { min-width:138px; }
  .request-health-legend { min-height:32px; margin:0 0 6px; padding:4px 9px; gap:5px 13px; font-size:12px; }
  .agent-help { margin:5px 0 7px; font-size:12px; line-height:1.3; }
  .column-tools-bar { min-height:46px; margin-bottom:5px; padding:5px 7px; }
  .column-tools-bar>span[role="status"] { font-size:12px; }
  .column-tools-actions,.entity-selection-actions { gap:6px; }
  .entity-selection-actions .btn { min-width:44px; padding-inline:9px; }
  .selection-context { min-height:32px; padding:5px 7px; font-size:12px; }

  .table-wrap { border-radius:9px; }
  .table-wrap table { font-size:13px; }
  .table-wrap thead>tr:first-child>th { height:38px; padding:6px 8px; }
  .table-wrap tbody>tr { height:44px; }
  .table-wrap td { height:44px; padding:5px 8px; line-height:1.2; }
  .table-wrap .row-select-col,.table-wrap .row-select-cell { width:54px; min-width:54px; text-align:left; }
  .column-filters th { height:40px; padding:4px 6px; }
  .column-filters input { height:32px; min-height:32px; padding:4px 8px; font-size:12px; }

  .health-cell { min-width:132px; }
  .health-cell .request-health { min-width:112px; min-height:28px; padding:4px 8px; border-radius:999px; font-size:12px; }
  .health-cell .request-health.red { color:var(--red)!important; background:color-mix(in srgb,var(--red) 11%,transparent); }
  .health-cell .request-health.yellow { color:#b97900!important; background:color-mix(in srgb,#d69600 14%,transparent); }
  .health-cell .request-health.green { color:var(--green)!important; background:color-mix(in srgb,var(--green) 11%,transparent); }
  .health-cell .request-health small { color:currentColor; }

  .sticky-list-toolbar { top:88px; padding:5px 7px; }

  #recordForm .record-head { display:flex; flex-wrap:nowrap; align-items:center; gap:10px; min-height:68px; height:68px; padding:9px 12px; overflow:hidden; }
  #recordForm .record-app-icon { width:38px; height:38px; border-radius:10px; }
  #recordForm .record-heading { flex:1 1 260px; min-width:180px; overflow:hidden; }
  #recordForm .record-heading small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  #recordForm .record-heading h2 { margin-top:3px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; overflow-wrap:normal; font-size:18px; }
  #recordForm .record-mode { padding:4px 8px; }
  #recordForm .record-head-actions { display:flex; flex:0 1 auto; min-width:0; align-items:center; justify-content:flex-end; gap:7px; margin-left:auto; }
  #recordForm .record-head-actions .btn { flex:0 1 auto; min-width:104px; max-width:180px; min-height:44px; padding:8px 11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; border:1px solid rgba(255,255,255,.28); }
  #recordForm .record-head-actions #recordBack { max-width:260px; }
  #recordForm .record-head>.icon-btn { flex:0 0 40px; width:40px; height:40px; }
  #recordForm .record-head-actions .btn.secondary,#recordForm .record-head-actions .btn.ghost { background:rgba(255,255,255,.13); color:#fff; }
  #recordForm .record-head-actions .btn.primary { background:linear-gradient(110deg,var(--teal),var(--blue)); color:#fff; border-color:transparent; }
  #recordForm .record-head-actions .btn[hidden] { display:none!important; }
  #recordForm .record-tabs { flex-wrap:nowrap; overflow-x:auto; padding:0 10px; }
  #recordForm .record-tab { flex:0 0 auto; padding:11px 10px 9px; }
  #recordForm .record-panel-grid { gap:12px 14px; padding:16px 18px; }
  #recordForm .record-catalogue { padding:12px; }
  #recordForm .record-catalogue-grid { gap:12px; }
  #recordForm .form-field { gap:5px; }
  #recordForm .form-field textarea { min-height:76px; }
  #recordForm .record-footer { padding:7px 16px; }
  #recordForm .record-footer .dialog-actions { min-height:22px; }
  #recordForm .record-footer .dialog-actions>small { margin:0; }
  #recordForm .record-print { margin:0 0 6px; }

  #detailDialog>.dialog-head { min-height:66px; padding:13px 16px; }
  #detailDialog>.detail-actions.detail-actionbar { position:sticky; top:66px; z-index:13; display:flex; justify-content:flex-end; align-items:center; gap:7px; margin:0; padding:8px 16px; border-top:0; border-bottom:1px solid var(--line); background:rgba(255,255,255,.97); box-shadow:0 5px 14px rgba(25,48,79,.08); backdrop-filter:blur(10px); }
  #detailDialog>.detail-actions.detail-actionbar>button { width:auto; min-width:112px; max-width:180px; height:44px; min-height:44px; white-space:nowrap; }
  #detailDialog .detail-more { position:relative; }
  #detailDialog .detail-more-toggle { min-width:92px; height:44px; }
  #detailDialog .detail-more-menu { position:absolute; top:calc(100% + 6px); right:0; z-index:30; display:grid; gap:4px; width:min(270px,76vw); padding:7px; border:1px solid var(--line); border-radius:10px; background:#fff; box-shadow:0 16px 38px rgba(16,39,65,.2); }
  #detailDialog .detail-more-menu[hidden] { display:none; }
  #detailDialog .detail-more-menu>button { width:100%; min-height:44px; justify-content:flex-start; text-align:left; }
  #detailDialog .detail-more-menu>button[hidden] { display:none!important; }
  .dark-mode #detailDialog>.detail-actions.detail-actionbar { background:rgba(23,34,49,.97); }
  .dark-mode #detailDialog .detail-more-menu { background:#172231; }
}

/* La police choisie dans les paramètres doit primer sur les feuilles de style
   thématiques chargées ensuite. Le nom de marque reste en Segoe UI. */
/* Xterm measures its own monospace glyphs: never override its font with the UI font. */
body :where(*):not(:where(.xterm,.xterm *)){font-family:var(--app-font,Inter,"Segoe UI",system-ui,-apple-system,Arial,sans-serif)!important}
body .brand strong{font-family:"Segoe UI",Arial,sans-serif!important}
body :where(pre,code,.automation-editor textarea[name="content"],.network-snmp-oids textarea,.agent-code input){font-family:ui-monospace,SFMono-Regular,Consolas,monospace!important}
.word-font-picker{position:relative;max-width:420px}.word-font-picker-button{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink);text-align:left;font-size:16px;cursor:pointer}.word-font-chevron{font-family:inherit;font-size:18px;color:var(--muted)}.word-font-picker-menu{position:absolute;z-index:20;top:calc(100% + 5px);left:0;width:min(520px,92vw);max-height:430px;overflow:auto;padding:8px;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 16px 40px rgba(18,42,73,.24)}.word-font-picker-menu[hidden]{display:none}.word-font-section{padding-bottom:7px;margin-bottom:7px;border-bottom:1px solid var(--line)}.word-font-section:last-child{border-bottom:0}.word-font-section-title{padding:7px 10px;color:var(--muted);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.06em}.word-font-option{display:flex;align-items:baseline;justify-content:space-between;width:100%;padding:8px 10px;border:0;border-radius:6px;background:transparent;color:var(--ink);font-size:17px;text-align:left;cursor:pointer}.word-font-option:hover{background:var(--pale)}.word-font-option small{font-family:var(--app-font)!important;color:var(--muted);font-size:10px}.dark-mode .word-font-picker-button,.dark-mode .word-font-picker-menu{background:#172231;color:#f1f5ff}.dark-mode .word-font-option{color:#f1f5ff}

/* Contrôles réseau : champs et boutons alignés sur la même hauteur. */
.network-check-form input:not([type=checkbox]),.network-check-form select{min-height:44px;height:44px;box-sizing:border-box}.network-form-actions{display:flex;justify-content:flex-end;align-items:center;gap:10px;margin-top:4px}.network-form-actions .btn{min-height:44px;height:44px;min-width:132px}.network-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.network-actions .btn{min-height:40px}
.dialog-head>.icon-btn,.about-head>.icon-btn,.server-panel-title>.icon-btn,.panel-head>.icon-btn{box-sizing:border-box;width:var(--control-height,44px);min-width:var(--control-height,44px);height:var(--control-height,44px);min-height:var(--control-height,44px);padding:0;display:inline-flex;align-items:center;justify-content:center;flex:0 0 var(--control-height,44px)}
.automation-form input:not([type=checkbox]):not([type=radio]),.automation-form select,.automation-form textarea,.network-check-form input:not([type=checkbox]):not([type=radio]),.network-check-form select,.network-check-form textarea{box-sizing:border-box;width:100%;min-height:44px;border:1px solid var(--line);border-radius:9px;background:var(--pale);color:var(--ink);padding:10px 12px;outline:0}.automation-form input:not([type=checkbox]):not([type=radio]),.automation-form select,.network-check-form input:not([type=checkbox]):not([type=radio]),.network-check-form select{height:44px;padding-block:0}.automation-form textarea,.network-check-form textarea{min-height:100px;resize:vertical;line-height:1.45}.automation-form input:focus,.automation-form select:focus,.automation-form textarea:focus,.network-check-form input:focus,.network-check-form select:focus,.network-check-form textarea:focus{border-color:var(--blue);box-shadow:0 0 0 3px color-mix(in srgb,var(--blue) 18%,transparent)}.automation-form label,.network-check-form>label{color:var(--ink);font-weight:650}.automation-form .field-help,.network-check-form small{color:var(--muted)}.dark-mode .automation-form input,.dark-mode .automation-form select,.dark-mode .automation-form textarea,.dark-mode .network-check-form input,.dark-mode .network-check-form select,.dark-mode .network-check-form textarea{background:#111b27;color:var(--ink);border-color:var(--line)}
.status-badge{gap:7px;min-width:112px;justify-content:center;padding:6px 10px;white-space:nowrap;text-align:center;vertical-align:middle}.status-badge i{display:inline-block;width:12px;height:12px;border-radius:50%;background:currentColor;flex:0 0 12px}.status-badge.red i{border-radius:2px}.status-badge.amber i{width:0;height:0;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:12px solid currentColor;border-radius:0;background:transparent;flex-basis:14px}.status-badge.neutral i{background:transparent;border:3px solid currentColor}.status-badge.sleep i{border-radius:2px;transform:rotate(45deg)}
.status-badge{box-sizing:border-box;min-width:170px;min-height:30px;font-family:Segoe UI,Inter,Arial,sans-serif;font-size:12px;line-height:1.2}
.status-badge.green,.status-badge.red,.status-badge.amber,.status-badge.neutral,.status-badge.sleep{font-size:12px}.table-wrap td:has(>.status-badge),.table-wrap td:has(>span.status-badge){text-align:center;vertical-align:middle}
.dialog-head>.icon-btn,.dialog-head>button[id*="Close"],.record-head>.icon-btn{width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important;padding:0!important;display:inline-flex;align-items:center;justify-content:center}.dialog-head>.btn,.record-head>.btn{min-height:44px;height:44px;padding:0 14px}

@media screen and (max-width:1100px) {
  #recordForm .record-app-icon,#recordForm .record-mode,#recordForm .record-heading small { display:none; }
  #recordForm .record-heading { flex-basis:180px; min-width:140px; }
  #recordForm .record-head-actions .btn { min-width:44px; max-width:132px; }
  #recordForm .record-head-actions #recordBack { max-width:150px; }
  #detailDialog>.detail-actions.detail-actionbar { justify-content:flex-start; overflow-x:auto; }
}

@media screen and (max-width:760px) {
  #content { padding:12px 10px 34px; }
  .view-toolbar label { align-items:stretch; flex-direction:column; gap:4px; }
  .view-toolbar label>select { width:100%; }
  .sticky-list-toolbar { position:static; }
  #recordForm .record-head { padding:10px; }
  #recordForm .record-app-icon,#recordForm .record-mode { display:none; }
  #recordForm .record-heading small { display:none; }
  #recordForm .record-heading h2 { font-size:16px; }
  #recordForm .record-head-actions { gap:5px; }
  #recordForm .record-head-actions .btn { width:44px; min-width:44px; height:44px; padding:0; }
  #recordForm .record-head-actions .btn-icon { margin:0; }
  #recordForm .record-head-actions .record-action-label { display:none; }
  #recordForm .record-head>.icon-btn { width:40px; height:40px; }
  #recordForm .record-panel-grid { padding:13px 12px; }
  #detailDialog>.detail-actions.detail-actionbar { position:sticky; top:62px; padding:7px 10px; flex-wrap:nowrap; }
  #detailDialog>.detail-actions.detail-actionbar>button { flex:0 0 auto; min-width:44px; }
}

/* Les cases de Ma société gardent leur taille, même avec les règles globales des champs. */
@media screen {
  #settingsForm .settings-fields.company-fields>.company-print-option {
    grid-column:1 / -1; display:flex; align-items:center; justify-content:flex-start;
    gap:10px; width:100%; min-width:0; max-width:100%; margin:0; line-height:1.4;
  }
  #settingsForm .settings-fields.company-fields>.company-print-option>input[type=checkbox] {
    flex:0 0 18px; width:18px; min-width:18px; max-width:18px;
    height:18px; min-height:18px; margin:0; padding:0;
  }
  #settingsForm .settings-fields.company-fields>.company-print-option>span {
    flex:1 1 auto; min-width:0; overflow-wrap:anywhere;
  }
  .agent-active-codes { display:grid; gap:10px; padding-left:0; list-style:none; }
  .agent-active-codes>li { padding:12px; border:1px solid var(--line); border-radius:9px; }
  .agent-code-actions,.agent-revealed-code { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-top:8px; }
  .agent-revealed-code[hidden] { display:none; }
  .agent-revealed-code input { flex:1 1 240px; min-width:0; max-width:480px; padding:9px; border:1px solid var(--line); border-radius:8px; font-family:monospace; }
  #rustdeskDialogBody #rustdeskOpen {
    width:min(130px,100%); min-width:0; max-width:100%; padding-inline:10px;
  }
  #rustdeskDialog {
    width:min(430px,92vw); max-width:92vw; max-height:90vh; overflow-y:auto;
  }
  #rustdeskDialog>.dialog-head { position:sticky; top:0; z-index:1; }
}

/* Base mobile layout: preserve readable columns and prevent controls from overlapping. */
@media screen and (max-width:760px) {
  .table-wrap { width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; border-radius:10px; }
  .table-wrap table { min-width:720px; }
  .table-wrap th,.table-wrap td { white-space:nowrap; }
  .table-wrap th:first-child,.table-wrap td:first-child { position:sticky; left:0; z-index:2; background:var(--surface,#fff); }
  .dark-mode .table-wrap th:first-child,.dark-mode .table-wrap td:first-child { background:var(--surface,#172231); }
  .panel-head,.panel-head h2 { min-width:0; }
  .panel-head { gap:10px; flex-wrap:wrap; }
  .panel-head p { flex:1 1 100%; margin:0; }
  .dialog { width:calc(100vw - 20px)!important; max-width:none!important; max-height:calc(100dvh - 20px); overflow:auto; }
  .dialog-head { position:sticky; top:0; z-index:5; }
  .dialog-actions { display:flex; flex-wrap:wrap; gap:8px; }
  .dialog-actions .btn { flex:1 1 140px; min-width:0; }
  .toolbar,.view-toolbar { gap:8px; }
  .toolbar .btn,.view-toolbar .btn { min-height:42px; }
  .pagination { flex-wrap:wrap; gap:6px; }
}

#networkCheckForm [hidden]{display:none!important}

/* V209 — standard logo commands share one row. */
@media screen{
 #settingsForm .logo-editor>div:last-child{min-width:0;flex:1}
 #settingsForm .logo-actions{display:flex;align-items:center;gap:8px;flex-wrap:nowrap}
 #settingsForm .logo-actions>.btn{flex:0 0 auto;width:auto;min-height:40px;white-space:nowrap;margin:0}
 #settingsForm #logoInput[hidden]{display:none!important}
}

/* Keep the font dropdown collapsed regardless of generic field styles. */
.word-font-picker-menu[hidden]{display:none!important}
