/* V2.8.11-46 — grille commune des contrôles et alignements. */
@media screen {
  :root { --control-height:44px; --control-radius:9px; }

  /* Toutes les barres d'en-tête utilisent la même police et le même rythme. */
  .topbar,.panel-head,.dialog-head,.server-panel-title,.record-head,
  .detail-heading,.detail-actions,.aw-record-header {
    font-family:Segoe UI,Inter,Arial,sans-serif;
  }
  .topbar {
    z-index:1000!important;
    isolation:isolate;
    background:rgba(255,255,255,.98)!important;
  }
  @media screen and (max-width:760px){
    body.mobile-device .topbar{z-index:1!important;position:relative!important}
    body.mobile-device .sidebar{z-index:2000!important}
  }
  .topbar h1,.panel-head h2,.panel-head h3,.dialog-head h2,
  .server-panel-title h2,.server-panel-title h3,.record-head h2,
  .detail-heading h2 { font-family:inherit; }
  .main .sticky-list-toolbar { z-index:20; }
  .main .table-wrap thead { position:relative; z-index:1; }

  .global-search,.global-clock,.field-search,.filter-select,.client-picker,
  .time-tracker-form input,.time-tracker-form select,
  .time-year-filter select,.time-year-control button,.time-year-control select,
  .agent-enrollment-grid input:not([type=checkbox]),.agent-enrollment-grid select,
  .agent-field-card input:not([type=checkbox]),.agent-field-card select,
  .catalog-import-commands input,.catalog-import-commands select,
  #recordForm .form-field input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
  #recordForm .form-field select,
  #monitorClient,#monitorChartAgent,#monitorChartPeriod {
    box-sizing:border-box;
    height:var(--control-height);
    min-height:var(--control-height);
    border-radius:var(--control-radius);
  }

  .form-field input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=hidden]),
  .settings-form input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=hidden]),
  .server-form input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=hidden]),
  .agent-controls input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
  .cw-toolbar input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
  .toolbox-filters input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
  .report-form input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
  .message-form input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
  .mfa-form input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
  .column-filters input,
  select:not([multiple]) {
    box-sizing:border-box;
    height:var(--control-height);
    min-height:var(--control-height);
    padding-block:0;
    padding-inline:12px;
    border-radius:var(--control-radius);
    text-align:left;
  }

  .btn:not(.icon-btn),.brand-logout {
    box-sizing:border-box;
    min-height:var(--control-height);
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    line-height:1.2;
    text-align:center;
  }
  .square-btn { width:var(--control-height); height:var(--control-height); padding:0; }
  #detailDialog>.detail-actions>button { height:var(--control-height); min-height:var(--control-height); }
  /* Tous les boutons de fermeture ont la même empreinte que les autres
     contrôles, y compris les formulaires et les fenêtres secondaires. */
  button.icon-btn[id*="close" i],button.icon-btn[id*="Close"],
  .dialog-head>.icon-btn,.record-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)!important;
    min-width:var(--control-height,44px)!important;
    height:var(--control-height,44px)!important;
    min-height:var(--control-height,44px)!important;
    padding:0!important;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 var(--control-height,44px);
    font-size:22px;
    line-height:1;
  }

  .toolbar,.toolbar-left,.toolbar-right,.toolbox-filters,.cw-toolbar,
  .agent-controls,.settings-actions,.dialog-actions,.detail-actions,.actions {
    align-items:center;
  }
  .toolbox-filters,.cw-toolbar,.server-form,.time-tracker-form,
  .agent-enrollment-grid,.settings-fields { align-items:end; }
  .toolbox-filters label,.cw-toolbar label,.server-form label,
  .time-tracker-form .form-field,.agent-controls label,
  .agent-enrollment-grid label,.settings-fields label {
    min-width:0;
  }
  .toolbox-filters select,.cw-toolbar input,.cw-toolbar select,
  .agent-controls input:not([type=checkbox]),.agent-controls select,
  .server-form input,.server-form select,.settings-fields input,.settings-fields select {
    width:100%;
    min-width:0;
  }

  .time-project-tab { min-height:var(--control-height); }
}

@media screen and (max-width:760px) {
  .toolbar-right,.settings-actions,.dialog-actions,.detail-actions { flex-wrap:wrap; }
  .toolbar-right>.btn,.settings-actions>.btn { flex:1 1 150px; }
}

/* E-mails des rapports : activation lisible et diagnostic serveur intégré. */
@media screen {
  .email-settings-form { gap:18px; }
  .email-enabled-field {
    display:inline-flex!important;
    align-items:center;
    justify-content:flex-start;
    gap:10px;
    width:max-content;
    max-width:100%;
    min-height:44px;
    cursor:pointer;
  }
  .email-enabled-field input[type=checkbox] {
    flex:0 0 18px;
    width:18px!important;
    height:18px!important;
    margin:0;
    accent-color:var(--blue);
  }
  .email-enabled-field span { white-space:nowrap; }
  .email-settings-grid { grid-template-columns:minmax(260px,2fr) minmax(100px,.55fr) minmax(260px,1.35fr); }
  .email-settings-grid label { display:grid; gap:7px; }
  .email-server-log { margin-top:24px;padding-top:18px;border-top:1px solid var(--line); }
  .email-server-log-head { display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:10px; }
  .email-server-log-head h3,.email-server-log-head p { margin:0; }
  .email-server-log-head p { margin-top:4px;color:var(--muted);font-size:12px; }
  #emailServerLog { min-height:180px;max-height:360px;margin:0;overflow:auto;padding:14px;border:1px solid var(--line);border-radius:10px;background:#111b27;color:#dce8f5;font:12px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere; }
  #emailServerLogMeta { margin:7px 0 18px; }
}
@media screen and (max-width:900px) {
  .email-settings-grid { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
}
@media screen and (max-width:600px) {
  .email-settings-grid { grid-template-columns:minmax(0,1fr); }
  .email-enabled-field span { white-space:normal; }
  .email-server-log-head { align-items:stretch;flex-direction:column; }
  .email-server-log-head .btn { width:100%; }
}

/* V172 — aide et fermeture réunies à droite, sans remplacer leurs événements. */
@media screen {
 .dialog-head-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex:0 0 auto;margin-left:auto}
 .dialog-head-actions>.icon-btn{box-sizing:border-box;width:var(--control-height,40px);min-width:var(--control-height,40px);height:var(--control-height,40px);min-height:var(--control-height,40px);padding:0;display:inline-flex;align-items:center;justify-content:center;font-size:22px;line-height:1}
 #bulkEditDialog .dialog-head{align-items:center;gap:16px;flex-wrap:nowrap}
 #bulkEditDialog .dialog-head>div:first-child{min-width:0;flex:1 1 auto}
 #bulkEditDialog .dialog-body{padding:20px 24px;max-height:60dvh;overflow:auto}
 #bulkEditDialog .bulk-edit-grid{gap:16px}
 #bulkEditDialog .bulk-edit-field{padding:14px;gap:8px;min-width:0}
 #bulkEditDialog .bulk-edit-field>label{display:flex;align-items:center;gap:8px}
 #bulkEditDialog .bulk-edit-field input[type=checkbox]{flex:none;margin:0}
}
@media screen and (max-width:600px){#bulkEditDialog .dialog-body{padding:16px}#bulkEditDialog .dialog-head{padding:14px 16px}#bulkEditDialog .dialog-head h2{font-size:17px}}
