
/* Contact directory: groups first, one task per screen. */
.ace-contact-workspace {
  --contact-ink: var(--bs-gray-800, #1F2937);
  --contact-muted: var(--bs-gray-500, #6B7280);
  --contact-line: var(--bs-gray-200, #E5E7EB);
  --contact-accent: var(--bs-primary, #1F2937);
  --contact-soft: var(--bs-gray-100, #F2F4F6);
  container-type: inline-size;
  background: var(--bs-gray-50, #F9FAFB);
  border: 1px solid var(--contact-line);
  border-radius: .75rem;
  color: var(--contact-ink);
  overflow: clip;
}
.ace-contact-layout { min-width: 0; margin: 0; padding: 0; border: 0; }
.ace-contact-layout:disabled { opacity: .65; }
.ace-contact-workspace h2, .ace-contact-workspace h3, .ace-contact-workspace p { margin: 0; }
.ace-contact-workspace h2 { color: var(--contact-ink); font-size: 1.25rem; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.ace-contact-workspace h3 { color: var(--contact-ink); font-size: 1rem; font-weight: 600; line-height: 1.4; }
.ace-contact-workspace p { color: var(--contact-muted); font-size: .875rem; line-height: 1.65; }
.ace-contact-workspace .btn { display: inline-flex; justify-content: center; align-items: center; gap: .5rem; white-space: normal; }
.ace-contact-workspace button:focus-visible, .ace-contact-workspace summary:focus-visible { outline: 3px solid var(--contact-accent); outline-offset: 3px; }
.ace-contact-workspace #ace-right-pane:focus { outline: none; }
.ace-contact-workspace .form-label { font-size: .875rem; font-weight: 600; color: var(--contact-ink); }
.ace-contact-workspace .badge { white-space: normal; text-align: left; line-height: 1.4; margin-left: 0 !important; margin-right: .25rem; }
.ace-contact-home-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding: 1.25rem 1.5rem; background: #fff; border-bottom: 1px solid var(--contact-line); }
.ace-contact-home-heading p { margin-top: .35rem; }
.ace-contact-home-heading > .btn { flex-shrink: 0; }
.ace-contact-eyebrow { display: flex; align-items: center; gap: .5rem; color: var(--contact-muted); font-size: .72rem; font-weight: 650; margin-bottom: .35rem; }
.ace-contact-guide-disclosure { background: #fff; border-top: 1px solid var(--contact-line); }
.ace-contact-guide-disclosure > summary { display: flex; align-items: center; gap: .65rem; padding: .85rem 1.5rem; color: var(--contact-accent); font-size: .82rem; font-weight: 600; cursor: pointer; list-style: none; }
.ace-contact-guide-disclosure > summary::-webkit-details-marker { display: none; }
.ace-contact-guide-disclosure > summary .bi:last-child { font-size: .65rem; }
.ace-contact-guide-disclosure[open] > summary .bi:last-child { transform: rotate(180deg); }
.ace-contact-guide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin: 0; padding: .3rem 1.5rem 1.25rem; list-style: none; }
.ace-contact-guide li { display: flex; align-items: flex-start; gap: .8rem; }
.ace-contact-guide li > span, .ace-contact-step-number { flex-shrink: 0; display: inline-grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; color: var(--contact-accent); background: var(--contact-soft); font-size: .75rem; font-weight: 700; }
.ace-contact-guide strong { display: block; font-size: .85rem; margin-bottom: .2rem; }
.ace-contact-guide p { font-size: .78rem; }
.ace-contact-home-content { padding: 1.25rem 1.5rem; }
.ace-contact-section-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.3rem; }
.ace-contact-section-heading p { margin-top: .3rem; }
.ace-contact-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .75rem; margin-bottom: 1.4rem; position: relative; }
.ace-contact-search > .bi { position: absolute; top: 12px; left: 1rem; z-index: 1; color: var(--contact-muted); pointer-events: none; }
.ace-contact-search input { padding-left: 2.75rem; max-width: 34rem; min-width: 0; }
.ace-contact-search > span { margin-left: auto; color: var(--contact-muted); font-size: .75rem; flex-shrink: 0; }
.ace-contact-group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 1.15rem; }
.ace-contact-group-card, .ace-contact-person-card { display: flex; flex-direction: column; text-align: left; min-width: 0; width: 100%; border: 1px solid var(--contact-line); border-radius: 10px; background: #fff; color: var(--contact-ink); padding: 1.15rem; font: inherit; box-shadow: 0 3px 12px rgba(17, 24, 39, .02); transition: border-color .15s, box-shadow .15s; }
.ace-contact-group-card:hover, .ace-contact-person-card:hover { border-color: var(--bs-gray-400, #9CA3AF); box-shadow: 0 5px 20px rgba(17, 24, 39, .06); }
.ace-contact-group-top, .ace-contact-group-bottom, .ace-contact-person-bottom { display: flex; align-items: center; justify-content: space-between; gap: .75rem; width: 100%; }
.ace-contact-group-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; background: var(--contact-soft); color: var(--contact-accent); font-size: 1.45rem; flex-shrink: 0; }
.ace-contact-pill { border-radius: 20px; padding: .3rem .65rem; background: var(--contact-soft); color: var(--contact-muted); font-size: .72rem; font-weight: 500; }
.ace-contact-group-name { display: block; font-size: 1rem; line-height: 1.35; margin: .85rem 0 .4rem; overflow-wrap: anywhere; }
.ace-contact-group-description { color: var(--contact-muted); font-size: .82rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; min-height: 2.65em; }
.ace-contact-group-bottom { border-top: 1px solid var(--contact-line); padding-top: .75rem; margin-top: .85rem; }
.ace-contact-group-bottom > span:last-child, .ace-contact-person-bottom > span:last-child { display: inline-flex; gap: .65rem; align-items: center; color: var(--contact-accent); font-weight: 600; font-size: .78rem; }
.ace-contact-avatar { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 15px; background: var(--contact-soft); color: var(--contact-muted); font-size: .95rem; font-weight: 650; flex-shrink: 0; }
.ace-contact-avatar.is-internal { background: var(--contact-soft); color: var(--contact-accent); }
.ace-contact-avatar.is-small { width: 30px; height: 30px; border-radius: 50%; font-size: .65rem; }
.ace-contact-avatar-stack { display: inline-flex; padding-left: 5px; }
.ace-contact-avatar-stack > span { margin-left: -5px; border: 2px solid #fff; }
.ace-contact-avatar-stack > span:last-child:not(.ace-contact-avatar) { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--contact-soft); font-size: .65rem; color: var(--contact-muted); }
.ace-contact-empty { grid-column: 1 / -1; text-align: center; padding: 2.5rem 1.5rem; background: #fff; border: 1px dashed var(--contact-line); border-radius: 10px; }
.ace-contact-empty-icon { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 20px; background: var(--contact-soft); color: var(--contact-accent); font-size: 1.7rem; margin-bottom: 1.2rem; }
.ace-contact-empty p { max-width: 28rem; margin: .65rem auto 1.3rem; }
.ace-contact-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; padding: 1.2rem 2rem; background: #fff; border-bottom: 1px solid var(--contact-line); color: var(--contact-muted); font-size: .8rem; }
.ace-contact-breadcrumb button { display: inline-flex; gap: .65rem; align-items: center; background: transparent; border: 0; padding: .25rem 0; color: var(--contact-accent); font: inherit; text-align: left; overflow-wrap: anywhere; }
.ace-contact-breadcrumb > .bi { font-size: .55rem; }
.ace-contact-breadcrumb > span { overflow-wrap: anywhere; }
.ace-contact-detail-heading, .ace-contact-editor-heading { display: flex; align-items: center; gap: 1rem; padding: 2rem; background: #fff; border-bottom: 1px solid var(--contact-line); }
.ace-contact-detail-heading > div, .ace-contact-editor-heading > div { min-width: 0; }
.ace-contact-detail-heading > .btn { margin-left: auto; flex-shrink: 0; }
.ace-contact-detail-heading p, .ace-contact-editor-heading p { margin-top: .5rem; }
.ace-contact-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.ace-contact-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 285px; align-items: start; gap: 1.75rem; padding: 2rem; }
.ace-contact-people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 1rem; }
.ace-contact-person-card { padding: 1.15rem; }
.ace-contact-person-top { display: flex; gap: .85rem; align-items: center; }
.ace-contact-person-top > span:last-child { min-width: 0; }
.ace-contact-person-top strong { display: block; font-size: .94rem; line-height: 1.4; overflow-wrap: anywhere; }
.ace-contact-person-type { display: block; font-size: .73rem; color: var(--contact-muted); margin-top: .15rem; }
.ace-contact-coordinates { display: flex; flex-direction: column; gap: .55rem; width: 100%; padding: 1.2rem 0; color: var(--contact-muted); font-size: .8rem; flex-grow: 1; }
.ace-contact-coordinates > span { display: flex; align-items: baseline; gap: .55rem; overflow-wrap: anywhere; }
.ace-contact-coordinates i { flex-shrink: 0; }
.ace-contact-person-bottom { align-items: flex-end; padding-top: .85rem; border-top: 1px solid var(--contact-line); }
.ace-contact-person-bottom > span:last-child { flex-shrink: 0; }
.ace-contact-person-bottom .badge { font-size: .65rem; }
.ace-contact-readonly-notice { display: flex; align-items: flex-start; gap: .6rem; width: 100%; padding: .75rem; border: 1px solid var(--contact-line); border-left: 3px solid var(--contact-accent); border-radius: 6px; background: var(--contact-soft); color: var(--contact-ink); text-align: left; line-height: 1.5; }
.ace-contact-readonly-notice > .bi { flex-shrink: 0; font-size: 1rem; }
.ace-contact-readonly-notice > span { min-width: 0; overflow-wrap: anywhere; }
.ace-contact-readonly-notice strong { display: block; font-size: .875rem; font-weight: 600; }
.ace-contact-readonly-notice > span > span { display: block; margin-top: .2rem; font-size: .8125rem; }
.ace-contact-person-card > .ace-contact-readonly-notice { margin-top: .9rem; }
.ace-contact-readonly .ace-contact-readonly-notice > span > span { font-size: .875rem; }
.ace-contact-notification-card { padding: 1.15rem; background: #fff; border: 1px solid var(--contact-line); border-radius: 10px; }
.ace-contact-aside-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--contact-soft); color: var(--contact-accent); margin-bottom: .85rem; font-size: 1.15rem; }
.ace-contact-notification-card h3 { font-size: 1rem; }
.ace-contact-notification-card p { margin-top: .6rem; font-size: .8rem; }
.ace-contact-channel-list { list-style: none; padding: 0; margin: 1.2rem 0; }
.ace-contact-channel-list li { display: flex; align-items: center; gap: .6rem; padding: .6rem 0; font-size: .75rem; }
.ace-contact-channel-list li > .bi { color: var(--contact-muted); }
.ace-contact-channel-state { display: inline-flex; gap: .3rem; align-items: center; margin-left: auto; color: var(--contact-muted); font-size: .65rem; }
.ace-contact-channel-state.is-on { color: var(--bs-success, #10B981); }
.ace-contact-notification-card .btn { width: 100%; font-size: .8rem; }
.ace-contact-tip { display: flex; align-items: flex-start; gap: .75rem; margin-top: 1rem; padding: 1.15rem .35rem; }
.ace-contact-tip > .bi { color: var(--contact-muted); }
.ace-contact-tip strong { font-size: .8rem; }
.ace-contact-tip p { margin-top: .35rem; font-size: .78rem; }
.ace-contact-other-actions { padding: 0 2rem 1.5rem; font-size: .8rem; color: var(--contact-muted); }
.ace-contact-other-actions summary { cursor: pointer; width: fit-content; }
.ace-contact-other-actions p { margin: 1rem 0; }
.ace-contact-form-grid { display: grid; grid-template-columns: minmax(0, 700px) minmax(210px, 280px); justify-content: center; align-items: start; gap: 2rem; padding: 2rem; }
.ace-contact-form-main { min-width: 0; }
.ace-contact-form-section { padding: 1.6rem; background: #fff; border: 1px solid var(--contact-line); border-radius: 10px; margin-bottom: 1rem; }
.ace-contact-form-section h3 { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.3rem; }
.ace-contact-workspace .ace-contact-field-help { font-size: .79rem; margin: .5rem 0 .9rem; }
.ace-contact-form-section > h3 + .ace-contact-field-help { margin-top: -.6rem; margin-bottom: 1.3rem; }
.ace-contact-required { color: var(--bs-danger, #E11D48); }
.ace-contact-optional { color: var(--contact-muted); font-weight: 400; font-size: .75rem; margin-left: .5rem; }
.ace-contact-disclosure > summary { display: flex; align-items: center; gap: .75rem; cursor: pointer; list-style: none; }
.ace-contact-disclosure > summary::-webkit-details-marker { display: none; }
.ace-contact-disclosure > summary > span:not(.ace-contact-step-number) { flex: 1; }
.ace-contact-disclosure summary strong { display: block; font-size: .9rem; color: var(--contact-ink); font-weight: 600; }
.ace-contact-disclosure summary small { display: block; font-size: .75rem; color: var(--contact-muted); margin-top: .3rem; }
.ace-contact-disclosure > summary > .bi:last-child { font-size: .7rem; }
.ace-contact-disclosure[open] > summary > .bi:last-child { transform: rotate(180deg); }
.ace-contact-disclosure-content { margin-top: 1.3rem; }
.ace-contact-channel-options { display: grid; gap: .65rem; }
.ace-contact-channel-choice { position: relative; margin: 0; cursor: pointer; }
.ace-contact-channel-choice > input { position: absolute; top: 1.1rem; right: 1rem; accent-color: var(--contact-accent); width: 17px; height: 17px; }
.ace-contact-channel-choice > span { display: grid; grid-template-columns: 26px 1fr; gap: .25rem .65rem; padding: 1rem 3rem 1rem 1rem; border: 1px solid var(--contact-line); border-radius: 10px; }
.ace-contact-channel-choice > span > .bi { grid-row: 1 / 3; color: var(--contact-accent); padding-top: .15rem; }
.ace-contact-channel-choice strong { font-size: .83rem; font-weight: 600; }
.ace-contact-channel-choice small { color: var(--contact-muted); font-size: .75rem; line-height: 1.55; }
.ace-contact-channel-choice > input:checked + span { background: var(--contact-soft); border-color: var(--contact-accent); }
.ace-contact-channel-choice > input:focus-visible + span, .ace-contact-type-choice > input:focus-visible + span { outline: 3px solid var(--contact-accent); outline-offset: 2px; }
.ace-contact-form-actions { display: flex; justify-content: flex-end; gap: .75rem; padding: .5rem 0; }
.ace-contact-form-aside { padding: 1.5rem; background: #fff; border: 1px solid var(--contact-line); border-radius: 10px; }
.ace-contact-form-aside .ace-contact-aside-icon { background: var(--contact-soft); color: var(--contact-muted); }
.ace-contact-form-aside h3 { font-size: 1rem; margin-bottom: .65rem; }
.ace-contact-form-aside p { font-size: .82rem; }
.ace-contact-example { display: grid; grid-template-columns: 25px 1fr; gap: .5rem; margin: 1.2rem 0; padding: 1rem; background: var(--bs-gray-50, #F9FAFB); border: 1px solid var(--contact-line); border-radius: 10px; }
.ace-contact-example > .bi { grid-row: 1 / 3; color: var(--contact-muted); }
.ace-contact-example strong { font-size: .8rem; }
.ace-contact-example span { font-size: .75rem; line-height: 1.5; color: var(--contact-muted); }
.ace-contact-next-step { display: flex; gap: .6rem; align-items: baseline; }
.ace-contact-inline-note { display: flex; gap: .65rem; align-items: baseline; color: var(--contact-muted); font-size: .78rem; line-height: 1.65; padding: 1rem 0 0; }
.ace-contact-inline-note > .bi { flex-shrink: 0; }
.ace-contact-type-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.ace-contact-type-choice { position: relative; margin: 0; cursor: pointer; }
.ace-contact-type-choice > input { position: absolute; right: .9rem; top: .95rem; accent-color: var(--contact-accent); width: 16px; height: 16px; }
.ace-contact-type-choice > span { display: flex; flex-direction: column; height: 100%; border: 1px solid var(--contact-line); border-radius: 11px; padding: 1.1rem; }
.ace-contact-type-choice > span > .bi { font-size: 1.4rem; color: var(--contact-accent); margin-bottom: .7rem; }
.ace-contact-type-choice strong { font-size: .85rem; margin-bottom: .4rem; padding-right: .2rem; }
.ace-contact-type-choice small { color: var(--contact-muted); font-size: .75rem; line-height: 1.55; }
.ace-contact-type-choice > input:checked + span { background: var(--contact-soft); border-color: var(--contact-accent); box-shadow: 0 0 0 1px var(--contact-accent); }
.ace-contact-user-preview { display: flex; gap: .9rem; padding: 1rem; background: var(--contact-soft); border-radius: 9px; color: var(--contact-accent); }
.ace-contact-user-preview strong, .ace-contact-user-preview #ace-info-mail { display: block; font-size: .82rem; overflow-wrap: anywhere; }
.ace-contact-user-preview #ace-info-mail { color: var(--contact-muted); margin-top: .25rem; }
.ace-contact-preferences { margin-top: 1.3rem; border-top: 1px solid var(--contact-line); padding-top: 1.3rem; }
.ace-contact-form-section .iti { width: 100%; }
.ace-contact-remove-area { padding-top: 1.2rem; margin-top: 1.2rem; border-top: 1px solid var(--contact-line); }
.ace-contact-remove-area .btn { font-size: .75rem; width: 100%; }
.ace-contact-remove-area p { margin-top: .65rem; font-size: .75rem; }
.ace-contact-readonly { padding: 2rem; max-width: 850px; margin: auto; }
.ace-contact-readonly dl { padding: 1.5rem; margin-top: 1rem; background: #fff; border: 1px solid var(--contact-line); border-radius: 10px; }
.ace-contact-readonly dl > div { display: grid; grid-template-columns: 1fr 2fr; gap: 1rem; padding: .75rem 0; }
.ace-contact-readonly dt { font-size: .82rem; color: var(--contact-muted); }
.ace-contact-readonly dd { margin: 0; font-size: .9rem; overflow-wrap: anywhere; }
.ace-contact-saved { padding: .9rem 2rem; background: #eaf5ed; border-bottom: 1px solid #d8e9dc; }
@container (max-width: 1000px) {
  .ace-contact-guide { gap: 1rem; }
  .ace-contact-detail-grid { grid-template-columns: minmax(0, 1fr) 255px; gap: 1.2rem; }
  .ace-contact-form-grid { grid-template-columns: minmax(0, 1fr) 230px; gap: 1.2rem; }
}
@container (max-width: 760px) {
  .ace-contact-guide { grid-template-columns: minmax(0, 1fr); gap: .9rem; padding: .3rem 1.5rem 1.25rem; }
  .ace-contact-home-content { padding: 1.5rem; }
  .ace-contact-detail-grid, .ace-contact-form-grid { grid-template-columns: minmax(0, 1fr); padding: 1.5rem; }
  .ace-contact-detail-heading, .ace-contact-editor-heading { padding: 1.5rem; flex-wrap: wrap; }
  .ace-contact-detail-heading > .btn { margin-left: 0; }
  .ace-contact-breadcrumb { padding: 1rem 1.5rem; }
  .ace-contact-search { grid-template-columns: minmax(0, 1fr); }
  .ace-contact-search input { max-width: none; }
  .ace-contact-search > span { margin-left: 0; }
  .ace-contact-aside { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
  .ace-contact-tip { margin: 0; }
  .ace-contact-form-aside { padding: 1.2rem; }
}
@container (max-width: 480px) {
  .ace-contact-home-content, .ace-contact-detail-grid, .ace-contact-form-grid { padding: 1rem; }
  .ace-contact-guide { padding: 1.2rem 1.5rem; }
  .ace-contact-aside, .ace-contact-type-choices { grid-template-columns: minmax(0, 1fr); }
  .ace-contact-form-section { padding: 1.1rem; }
  .ace-contact-form-section .col-sm-6 { width: 100%; }
  .ace-contact-form-actions .btn { flex: 1; }
  .ace-contact-home-heading { padding: 1rem; }
  .ace-contact-other-actions { padding-left: 1rem; padding-right: 1rem; }
  .ace-contact-person-bottom { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .ace-contact-group-card, .ace-contact-person-card { transition: none; }
}

.ace-config-header-wrapper {
    position: relative;   
}

.ace-config-header-title {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;    
}

/* Configuration header: balanced identity, title and telemetry. */
.ace-card-config-header {
  container-type: inline-size;
}

.ace-card-config-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) fit-content(20rem) minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  min-height: 76px;
  padding: .85rem 1rem;
  background: #fff;
  border: 1px solid #e4e9f0;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(23, 32, 51, .035);
}

.ace-card-config-identity {
  display: flex;
  align-items: center;
  gap: .85rem;
  min-width: 0;
}

.ace-card-config-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  color: #526176;
  background: #fff;
  border: 1px solid #e4e9f0;
  border-radius: 10px;
  transition: background-color .15s, border-color .15s;
}

.ace-card-config-back:hover {
  color: #172033;
  background: #f5f7fa;
  border-color: #cbd5e1;
}

.ace-card-config-back:focus-visible {
  outline: 2px solid #007aff;
  outline-offset: 3px;
}

.ace-card-config-product {
  flex-direction: column;
  align-items: flex-start;
  gap: .15rem;
  min-width: 0;
  max-width: 100%;
}

.ace-card-config-caption {
  color: #78869a;
  font-size: .625rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .06em;
  text-transform: uppercase;
}

#card_config_product_id {
  min-width: 0;
  max-width: 100%;
  color: #526176;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .7rem;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
  user-select: all;
}

.ace-card-config-title {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .45rem .6rem;
  min-width: 0;
  max-width: 20rem;
  text-align: center;
}

.ace-card-config-title .ace-title {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  color: #172033;
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}

.ace-card-config-title .badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .5rem;
  border-radius: 6px;
  font-size: .65rem;
  font-weight: 600;
  line-height: 1.2;
}

.ace-card-config-title .badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.ace-card-config-title .bg-success { color: #177a52; background: #eaf8f0 !important; }
.ace-card-config-title .bg-danger { color: #b8404c; background: #fff0f1 !important; }
.ace-card-config-title .bg-secondary { color: #64748b; background: #f1f5f9 !important; }

.ace-card-config-stats {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  justify-self: end;
  flex-wrap: wrap;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
  padding: 3px;
  background: #f5f7fa;
  border: 1px solid #edf0f4;
  border-radius: 10px;
}

.ace-card-config-stats .ace-chip {
  flex-direction: column;
  justify-content: center;
  gap: .15rem;
  min-width: 3.25rem;
  max-width: 100%;
  padding: .3rem .55rem;
  color: #344054;
  background: transparent;
  border-radius: 7px;
  font-size: .75rem;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.ace-card-config-stats:not(:has(> .ace-chip:not(.d-none))) {
  display: none;
}

.ace-card-config-stats .ace-chip > span:last-child {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.ace-card-config-stat-label {
  display: flex;
  align-items: center;
  gap: .3rem;
  color: #78869a;
  font-size: .6rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .025em;
  text-transform: uppercase;
}

/* Keep the title centered when the content area cannot fit one toolbar row. */
@container (max-width: 980px) {
  .ace-card-config-topbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem 1rem;
  }

  .ace-card-config-identity { display: contents; }
  .ace-card-config-back { grid-column: 1; grid-row: 1; justify-self: start; }
  .ace-card-config-title { grid-column: 1 / -1; grid-row: 1; justify-self: center; max-width: calc(100% - 6rem); }
  .ace-card-config-product { grid-column: 1; grid-row: 2; align-self: center; }
  .ace-card-config-stats { grid-column: 2; grid-row: 2; }
}

@container (max-width: 680px) {
  .ace-card-config-topbar { padding: .85rem; gap: .75rem; }
  .ace-card-config-product { grid-column: 1 / -1; align-items: center; text-align: center; }
  .ace-card-config-stats { grid-column: 1 / -1; grid-row: 3; justify-self: stretch; justify-content: center; }
  .ace-card-config-stats { flex-wrap: nowrap; }
  .ace-card-config-topbar:not(:has(#card_config_product_id_div:not(.d-none))) .ace-card-config-stats { grid-row: 2; }
  .ace-card-config-stats .ace-chip { flex: 1 1 0; min-width: 0; padding: .3rem .2rem; text-align: center; }
  .ace-card-config-stats #uptime_div { flex-grow: 1.7; }
  .ace-card-config-stat-label { font-size: .8rem; }
  .ace-card-config-stat-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (max-width: 768px) {
  .ace-card-config-page {
    overflow: visible;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 7rem);
  }
}

.row-cols-7 > * {
  flex: 0 0 auto;
  width: 14.2857142857%; /* 100/7 */
}
.row-cols-8 > * {
  flex: 0 0 auto;
  width: 12.5%; /* 100/8 */
}
.row-cols-9 > * {
  flex: 0 0 auto;
  width: 11.1111111111%; /* 100/7 */
}
.row-cols-10 > * {
  flex: 0 0 auto;
  width: 10%; /* 100/8 */
}
.input-without-border {
  border: none;
  background-color: none;
  outline: 0;
  font-size: 25px;
  width: 300px;
  height: 30px;
}

.input-without-border:focus {
  border: none;
  background-color: none;
  outline: 0;
  width: 300px;
  height: 30px;
}

.ace-disabled-link {
    pointer-events: none;
    color: grey;
    cursor: not-allowed;
}

.ace-grey-overlay{
  filter: brightness(30%);
/*  pointer-events: none;*/
  cursor: move;
}

.ace-mr-1rem {
    margin-right: -1rem;
}

.ace-blink-color-red {
    
    animation: blinkingBackground 4s infinite;
}

.ace-highlight {
    background-color: #f3c78e !important;
    transition: background-color 1s ease;
}
.ace-highlight-card {
    border: 2px solid #666 !important; 
    box-shadow: 0 0 15px rgba(67, 75, 83, 0.5) !important; 
/*    transition: all 0.3s ease-in-out !important; */
}
.ace-dropzone {
  min-height: 39px;
  border: 1px dashed #4b5563;
  background: #fff;
  border-radius: .2rem!important;
  min-width: 150px;
  overflow-x: hidden;
  position: relative; 
}

.ace-dropzone:hover {
  background-color: #e5e7eb;
}

.ace-close-button {
  position: absolute; 
  top: 1px;
  right: 1px;
  background: none;
  border: none;
  font-size: 1rem; 
  cursor: pointer;
  color: #ff0000; 
  padding: 0; 
  line-height: 1; 
  z-index: 10;
}

.ace-badge{
  font-size: 0.875rem;
  font-weight: 500;
  padding: 4px 12px;
  background: #ffffff;
  background-color: rgb(255, 255, 255);
  border-radius: 0.35rem;
  box-shadow: 0 2px 5px rgba(140, 152, 164, 0.2);
  /*margin: 5px;*/
  cursor: pointer;
}

.left-column {
    width: calc(25% - 5px);
    float: left;
    padding-right: 5px;
}

.right-column {
    width: 75%;
    float: left;
}

.clearfix::after {
    content: "";
    clear: both;
    display: table;
}

.video-container {
  width: 100%;
  height: 100%;
  
}

.video-player {
  width: 100%;  
  height: 100%;
}

.timebar-wrap {
  position: relative;
  margin: 0 auto 1rem;
}
#timebar-absolute {
  width: 100%;
}

.timestamp-wrap {
  position: relative;
  margin: 0 auto 1rem;
  width: 100%;
  text-align: center;
}

.playbuttons-wrap
{
  text-align: center;
}

#listScenes {
  width: 100%;
}
.ace-video-fullscreen-active {
    padding: 0;
    border: none;
    background: black;
}

.ace-live-camera-item {
    position: relative;

}
.ace-alert-live-camera-item {
    position: relative;

}

.ace-video{
  
}

.ace-video-camera-name-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 5px;
}


.ace-video-camera-bottom-right-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 5px;
}
.ace-play-button {
    position: absolute;
    bottom: 50%;
    right: 50%;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 5px;
}


.ace-ptz-controls-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    z-index: 20;
}

.ace-joystick-container {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.2);
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}

.ace-joystick-handle {
    width: 20px;
    height: 20px;
    background-color: rgba(153, 155, 157, 0.8); 
    border-radius: 50%;
    position: absolute;
    transition: 0.1s ease;
    cursor: pointer;
}
.ace-search-input {
    max-width: 400px;
    margin: 0 auto;
}

.ace-contact-card {
    border-radius: 8px;
    overflow: hidden;
}

.ace-contact-card .card-header {
    background-color: #007bff;
    color: white;
    cursor: pointer;
    padding : 14px
}

.ace-contact-body.collapse {
    display: none;
}

.ace-contact-body:not(.collapse) {
    display: block;
    transition: all 0.3s ease-in-out;
}

.ace-text-muted {
    font-size: 0.85em;
    color: #6c757d;
}

.card-without-site {
  background-color: #fff9d6 !important; 
  border-left: 3px solid #f0ad4e !important;
}

.ace-video-timebar-wrapper {
  width: 100%;
  background: #1e293b;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Graduations */
.ace-video-timebar-graduations {
  position: relative;
  height: 20px;
}

.ace-video-timebar-graduation {
  position: absolute;
  transform: translateX(-50%); 
  bottom: 0;                  
  font-size: 11px;
  color: #9ca3af;
}
.ace-timebar-controls-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* centre réellement le bloc boutons */
  align-items: center;
  gap: 8px;
  padding: 2px 4px;
}
.ace-video-timebar-timeline {
  position: relative;
  width: 100%;
  height: 45px;
  background: #374151; /* Gris foncé */
  margin-top: 8px;
  cursor: pointer;
  overflow: hidden;
}
.ace-controls-left {
  justify-self: start;
  color: #9ca3af;
  font-weight: 600;
  padding: 0 6px;
}

.ace-controls-center {
  justify-self: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ace-controls-right { justify-self: end; }
.ace-video-timebar-sequences {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: transparent;
}

.ace-video-timebar-sequence {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 4px;
  background-color: #4caf50;
}

.ace-video-timebar-current-time {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: #2563eb; 
  pointer-events: none;
  z-index: 10;
}

.ace-video-timebar-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.ace-video-timebar-btn {
  background: #1e293b !important;
  border: none !important;
  color: #9ca3af !important; 
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  /*font-size: 18px !important;*/
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  cursor: pointer !important;
}

.ace-timebar-shifts {
display: flex;
flex-wrap: wrap;
gap: .5rem;
justify-content: center;
padding: .25rem 0 .5rem;
/* largeur uniforme configurable */
--chip-w: 72px; /* ajustez: 72–112px selon place */
}


.btn-time-shift {
/* Teintes neutres par défaut, s'adapte aux variables Bootstrap/Volt */
--_bg: var(--bs-gray-100);
--_fg: var(--bs-gray-800);
--_bd: var(--bs-gray-300);
background: var(--_bg);
color: #9ca3af;
border: 1px solid var(--_bd);
border-radius: 50rem;
padding: .25rem .625rem;
line-height: 1.2;
/*font-weight: 600;*/
box-shadow: 0 1px 1px rgba(0,0,0,.04);
transition: transform .05s ease, box-shadow .2s ease,
background-color .2s ease, color .2s ease, border-color .2s ease;
/* uniformiser : largeur fixe + centrage */
display: inline-flex;
align-items: center;
justify-content: center;
gap: .35rem;
/*inline-size: var(--chip-w);*/
font-size: 12px;
text-align: center;
white-space: nowrap; /* évite les retours sur '15mn' */
font-variant-numeric: tabular-nums; /* aligne visuellement les chiffres */
}
.btn-time-shift .bi { margin-right: .25rem; font-size: .85em; color: var(--_accent, currentColor); }
.btn-time-shift:hover { box-shadow: 0 .25rem .75rem rgba(0,0,0,.06); }
.btn-time-shift:active { transform: translateY(1px); }


/* Variantes sémantiques: négatif / positif */
.btn-time-shift[data-variant="neg"] {
/* moins agressif: texte neutre, léger tint en fond + bordure */
--_fg: var(--bs-body-color);
--_bg: rgba(var(--bs-danger-rgb), .05);
--_bd: rgba(var(--bs-danger-rgb), .18);
--_accent: rgba(var(--bs-danger-rgb), .70);
}
.btn-time-shift[data-variant="pos"] {
/* moins agressif: texte neutre, léger tint en fond + bordure */
--_fg: var(--bs-body-color);
--_bg: rgba(var(--bs-success-rgb), .05);
--_bd: rgba(var(--bs-success-rgb), .18);
--_accent: rgba(var(--bs-success-rgb), .70);
}
.ace-video-timebar-btn i {
  pointer-events: none;
  font-size: 16px; 
}

.ace-video-timebar-btn-play i,
.ace-video-timebar-btn-pause i {
  font-size: 16px;
}

.ace-video-timebar-btn-pause {
  display: none; 
}

.ace-video-timebar-highlight {
  position: absolute;
  top: 0;
  height: 50%;
  background-color: rgba(255, 0, 0, 0.4); 
  pointer-events: none; 
  transition: left 0.2s, width 0.2s; 
}

.ace-video-timebar-highlight-fs {
  height: 50%;
}

.ace-video-timebar-highlight-s3 {
  height: 50%;
  top:50%;
}

.datepicker-day-red-dot {
  background-color: rgba(255, 0, 0, 0.4) !important;
    border-radius: 50%;
}

.datepicker-day-orange-dot {
  background-color: orange !important;
    border-radius: 50%;
}

.ace-video-timebar-btn.highlight-effect {
    background-color: rgba(255, 255, 255, 0.2); 
    box-shadow: 0 0 1px rgba(255, 255, 255, 0.5); 
}


div.dt-container div.dt-length select {
    width: 80px !important
}
.ace-video-timebar-time-display-text {
    margin-right: 15px !important;
    
    color: #9ca3af !important;;
    font-size: 14px !important;
    padding: 5px 10px !important;
    border-radius: 4px !important;
/*    pointer-events: none !important;*/
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
@keyframes blinkingBackground {
    0%    { background-color: #fff; }
    25%   { background-color: #b81414; }
    50%   { background-color: #fff; }
    75%   { background-color: #b81414; }
    100%  { background-color: #fff; }
}
#ace-camera-service-parent-column {
  animation: fadeIn 0.5s ease-in-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

 @keyframes ace-blink {
    0%, 100% {
      opacity: 1;
    }
    50% {
      opacity: 0;
    }
  }

  .ace-blink-slow {
    animation: ace-blink 1s infinite;
  }
  .ace-blink-very-fast {
    animation: ace-blink 0.5s infinite;
  }

  .ace-video-indicators {
    position : absolute;
    top : 10px;
    right : 10px;
    display : flex;
    gap : 1px;
}

  .ace-video-label {
    color : #ff4d4d;
    font-weight : bold;
    font-size : 12px;
    background : rgba(0,0,0,0.5);
    padding : 1px 5px;
    border-radius : 4px;
    /*animation : ace-pulse 2s infinite;*/
  }
  .ace-video-label-orange {
    color : #faa54b;
    
  }
   @keyframes ace-pulse {
    0%, 100% {
      opacity: 1;
    }
    50% {
      opacity: 0;
    }
  }

  .ace-overlay-glass{
     display : none;
    position : absolute;
    bottom : 10px;
    right : 10px;
    padding : 7px 12px;
    backdrop-filter : blur(8px);
    background : rgba(30, 30, 30, 0.5);
    border-radius : 14px;
    display : flex;
    gap : 4px;
    z-index : 999;
    box-shadow : 0 6px 18px rgba(0,0,0,0.25);
  }

  .ace-glass-button{
     width : 28px;
      height : 28px;
      border-radius : 50%;
      border : 1px solid rgba(255,255,255,0.1);
      background : rgba(255, 255, 255, 0.04);
      backdrop-filter : blur(4px);
      color : white;
      font-size : 13px;
      display : flex;
      align-items : center;
      justify-content : center;
      cursor : pointer;
      transition : all 0.15s ease-in-out;
  }

/*.ace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 350px)); 
  justify-content: start; 

  margin-bottom: 1rem;
}

.ace-camera {
  position: relative;
  background: #000;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 0.5px solid transparent;
}*/
/* path: /assets/css/ace-multilive-grid.css */

/* Base grid */
.ace-grid {
  display: grid;
  /*gap: 0.75rem;        */      
  /*margin-bottom: 1rem;*/
  grid-template-columns: repeat(1, minmax(0, 1fr));
  justify-items: stretch;      /* éviter les trous */
  align-items: stretch;
}

/* Cartes: s'étirent pour remplir la cellule */
.ace-camera {
  position: relative;
  width: 100%;
  background: #000;
  aspect-ratio: 16 / 9;
  /* Pourquoi: garantir que le player/thumbnail prenne la largeur de la cellule */
}

@media (min-width: 769px) {
  .ace-multilive-page {
    overflow: hidden !important;
  }

  .ace-multilive-page #ace-container-multilive {
    overflow: hidden;
  }

  .ace-multireplay-page {
    overflow: hidden !important;
  }

  .ace-multireplay-page #multireplay_container,
  .ace-multireplay-page #multireplay_container > div,
  .ace-multireplay-page .card-body,
  .ace-multireplay-page .card-body > .row,
  .ace-multireplay-page .ace-video-replay-right-panel {
    min-height: 0;
  }

  .ace-multireplay-page .dashboard-plugin {
    height: var(--ace-multireplay-height, 90vh) !important;
  }

  .ace-multireplay-page .ace-video-replay-video-container {
    min-height: 0 !important;
    overflow: hidden;
  }

  .ace-replay-page.ace-replay-fit-viewport {
    overflow: hidden !important;
  }

  .ace-replay-fit-viewport #replay_container,
  .ace-replay-fit-viewport #replay_container > div,
  .ace-replay-fit-viewport .card-body,
  .ace-replay-fit-viewport .card-body > .row,
  .ace-replay-fit-viewport .ace-video-replay-right-panel {
    min-height: 0;
  }

  .ace-replay-fit-viewport .dashboard-plugin {
    height: var(--ace-replay-height, 90vh) !important;
  }

  .ace-replay-fit-viewport .ace-video-replay-video-container {
    min-height: 0 !important;
    overflow: hidden;
  }
}

#ace-filter-burger-menu .btn {
  min-width: 2.15rem;
  min-height: 2.15rem;
  padding: 0.25rem 0.45rem;
  line-height: 1;
}

#ace-filter-burger-menu .dropdown-toggle::after {
  margin-left: 0.25rem;
  vertical-align: 0.12em;
}

.ace-filter-fullscreen-btn {
  width: 2.15rem;
  height: 2.15rem;
  min-width: 2.15rem;
  padding: 0;
  justify-content: center;
  line-height: 1;
}

@media (max-width: 768px) {
  .ace-mobile-page {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .ace-mobile-page > .row {
    margin-left: 0;
    margin-right: 0;
  }

  .ace-mobile-page > .row > [class*="col-"] {
    padding-left: 0;
    padding-right: 0;
  }

  .ace-mobile-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0.5rem 0 1.5rem;
    padding: 0 0.25rem;
  }

  .ace-mobile-page-title {
    margin: 0;
    color: #1f2937;
    font-size: calc(1.275rem + 0.3vw);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
  }

  .ace-mobile-page-subtitle {
    margin: 0;
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
  }

  .ace-mobile-export-actions {
    display: flex;
    margin: -0.5rem 0 1rem;
    padding: 0 0.25rem;
  }

  .ace-mobile-export-actions #ace-camera-export-video-create {
    width: 100%;
    justify-content: center;
    border-radius: 0.5rem !important;
    padding: 0.65rem 1rem !important;
  }

  .ace-mobile-export-actions #ace-export-bulk-delete {
    display: none !important;
  }

  body.ace-multilive-body > main.content:not(.ace-multilive-page) {
    display: none !important;
  }

  .ace-multilive-page {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .ace-multilive-page #ace-container-multilive {
    padding: 0 !important;
  }

  .ace-multilive-page .ace-multilive-topbar,
  .ace-multilive-page #multilive_alertCamerasWrapper {
    margin: 0 !important;
  }

  .ace-multilive-page .ace-multilive-topbar .card {
    border-radius: 0;
    margin: 0 !important;
    border-left: 0;
    border-right: 0;
  }

  .ace-multilive-page .ace-multilive-topbar .card-body {
    align-items: stretch !important;
    gap: 0.45rem !important;
    padding: 0.45rem !important;
  }

  .ace-multilive-page .ace-multilive-topbar .card-body > .d-flex:first-child {
    width: 100%;
  }

  .ace-multilive-page .ace-filter-main-row {
    display: grid !important;
    grid-template-columns: 2rem minmax(0, 1fr) 2rem;
    align-items: center !important;
    gap: 0.45rem !important;
    width: 100%;
  }

  .ace-multilive-page .ace-multilive-topbar .card-body > .d-flex:last-child {
    gap: 0.35rem !important;
  }

  .ace-multilive-page .ace-multilive-topbar .input-group {
    min-width: 0;
    width: 100%;
  }

  .ace-multilive-page .ace-multilive-topbar .form-control,
  .ace-multilive-page .ace-multilive-topbar .input-group-text {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
  }

  .ace-multilive-page #ace-filter-burger-menu .btn {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    min-height: 2rem;
    padding: 0;
  }

  .ace-multilive-page .ace-filter-fullscreen-btn {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
  }

  .ace-multilive-page #ace-filter-burger-menu .dropdown-toggle::after {
    display: none;
  }

  .ace-multilive-page #multilive_alertCamerasWrapper h5 {
    margin: 0;
    padding: 0.4rem 0.5rem;
  }
}

/* Breakpoints (alignés sur Bootstrap) */
@media (min-width: 576px) {
  .ace-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 768px) {
  .ace-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 992px) {
  .ace-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (min-width: 1200px) {
  .ace-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)); /* max 5 par ligne */
  }
}

/* Plein écran: occuper 100% de l'espace, aligner avec les bordures */
#ace-container-multilive:fullscreen,
#ace-container-multilive:-webkit-full-screen,
#ace-container-multilive.is-fullscreen {
  /* Pourquoi: supprimer marges/paddings hérités pour un vrai plein écran */
  padding: 0 !important;
  margin: 0 !important;
  width: 100vw;
  height: 100vh;
  overflow: auto;                  /* ou overflow: overlay; si tu veux des barres flottantes (chromium) */
  scroll-behavior: smooth;
  overscroll-behavior: contain; 
     /* évite le "pull to refresh" sur mobile */
}

#ace-container-multilive.is-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
  background: #000;
}

@supports (-webkit-touch-callout: none) {
  #ace-container-multilive.is-fullscreen {
    height: -webkit-fill-available !important;
  }
}

.ace-multilive-fullscreen-exit {
  display: none;
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 0.65rem);
  right: calc(env(safe-area-inset-right, 0px) + 0.65rem);
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  z-index: 100000;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

#ace-container-multilive.is-fullscreen .ace-multilive-fullscreen-exit {
  display: flex;
}

@supports (height: 100dvh) {
  #ace-container-multilive:fullscreen,
  #ace-container-multilive:-webkit-full-screen,
  #ace-container-multilive.is-fullscreen {
    height: 100dvh; /* viewport dynamique = vrai plein écran mobile */
  }
}
/* Optionnel: si un parent impose un max-width, on le neutralise en fullscreen */
#ace-container-multilive:fullscreen .container,
#ace-container-multilive:fullscreen .container-fluid,
#ace-container-multilive:-webkit-full-screen .container,
#ace-container-multilive:-webkit-full-screen .container-fluid,
#ace-container-multilive.is-fullscreen .container,
#ace-container-multilive.is-fullscreen .container-fluid {
  max-width: 100% !important;
  padding: 0 !important;
}

/* En fullscreen, garder le max à 5 colonnes (déjà OK via breakpoint ≥1200px). 
   Si vous voulez FORCER 5 colonnes quelle que soit la largeur en fullscreen, dé-commentez: */
/*
#ace-container-multilive.is-fullscreen .ace-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
*/

    .ace-camera.alert {
      border-color: red;
      animation: blink 1s infinite;
    }
    @keyframes blink {
      0%, 100% { border-color: red; }
      50% { border-color: transparent; }
    }
    .ace-camera video {
      width: 100%;
      height: 100%;
      object-fit: cover;
      background: #111;
      transform: translateZ(0);
      backface-visibility: hidden;
    }
    .ace-camera canvas {
      transform: translateZ(0);
      backface-visibility: hidden;
    }
    .ace-camera-footer {
      position: absolute;
      bottom: 0;
      width: 100%;
      background: rgba(0, 0, 0, 0.4);
      padding: 0.25rem 0.5rem;
      font-size: 0.75rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
      opacity: 0;
      transition: opacity 0.2s ease-in-out;
    }
    .ace-camera:hover .ace-camera-footer {
      opacity: 1;
    }
    .ace-camera-controls button {
      font-size: 0.7rem;
      background: rgba(255,255,255,0.1);
      border: none;
      padding: 0.15rem 0.4rem;
      color: #fff;
      cursor: pointer;
      border-radius: 0.2rem;
    }
    .ace-camera-controls button:hover {
      background: rgba(255,255,255,0.25);
    }

    .link-arrow[data-bs-toggle="collapse"][aria-expanded="true"]  {
      transform: rotate(90deg);
      transition: all 0.2s ease;
    }

    .ace-fade-in {
      opacity: 0;
      transform: translateY(20px);
      animation: fadeInUp 0.6s ease forwards;
    }

    .ace-camera-menu {
      
      background: linear-gradient(135deg, #ffffff, #f1f3f5);
      transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
      cursor: pointer;
    }

    .ace-camera-menu:hover {
      transform: translateY(-5px) scale(1.05);
      box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.2) !important;
      background-color: #f8f9fa;
    }

    .ace-camera-menu i {
      transition: transform 0.3s ease;
    }

    .ace-camera-menu:hover i {
      transform: rotate(5deg) scale(1.1);
    }

    .ace-camera-menu h6 {
      text-transform: uppercase;
      font-size: 1.1rem;
    }

    @keyframes fadeInUp {
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .ace-menu-container {
  transform: translateY(-30px);
}

@media (min-width: 768px) {
  .ace-menu-container {
    transform: translateY(-50px);
  }
}

@media (min-width: 1200px) {
  .ace-menu-container {
    transform: translateY(-100px);
  }
}
.badge-pro {
  background-color: #ffc107;
  color: #000;
  font-size: 0.7rem;
  font-weight: bold;
  padding: 0.25em 0.5em;
  border-radius: 0.5rem;
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}
.ace-accordion-button {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: #0d6efd; /* Bootstrap primary */
  background-color: #f8f9fa;
  border: none;
  text-align: left;
  transition: background-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  cursor: pointer;
}

.ace-accordion-button:not(.collapsed) {
  /*background-color: #e7f1ff;*/
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.125);
  color: #0a58ca;
}

.ace-accordion-button::after {
  content: "";
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-left: auto;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%230d6efd' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 1rem;
  transition: transform 0.2s ease-in-out;
  transform: rotate(0deg);
}

.ace-accordion-button:not(.collapsed)::after {
  transform: rotate(180deg);
}
   .event-item {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
  background: #f9f9f9;
  transition: background 0.3s;
}
.event-item:hover {
  background: #f1f1f1;
}
.event-item .event-time {
  font-weight: bold;
  margin-right: 0.5rem;
  white-space: nowrap;
}
.event-item .event-icon {
  margin-right: 0.5rem;
}
.event-item .event-name {
  font-weight: 500;
  margin-right: 0.25rem;
}
.event-item .event-text {
  flex-grow: 1;
}
.event-item[data-visible="false"] {
  display: none;
}

   .ace-device-filter {
    padding: 1rem;
  }



  .ace-device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    padding: 1rem;
  }

  .ace-device-box {
    position: relative;
    background-color: #ffffff;
    border-radius: 0.75rem;
    padding: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .ace-device-box:hover {
    transform: scale(1.01);
  }

  .ace-alarm-active {
    border-color: #dc3545 !important;
  }

  .ace-inactive {
    background-color: #f1f3f5;
    color: #999;
    border-color: #ddd !important;
  }

  .ace-device-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ace-device-id, .ace-device-event, .ace-device-mail, .ace-device-event-time {
    font-size: 0.8rem;
    color: #555;
    line-height: 1.2;
  }

  .ace-device-icon {
    font-size: 1.2rem;
  }

  .ace-device-alert {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.1rem;
  }

  .ace-marker-icon {
  font-size: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: white;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.ace-marker-alarm {
  animation: ace-marker-pulse 1.5s infinite;
}

@keyframes ace-marker-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.6); /* Bootstrap danger */
  }
  70% {
    transform: scale(1.2);
    box-shadow: 0 0 0 15px rgba(220, 53, 69, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
  }
}
.hidden-important {
  display: none !important;
}
.ace-video-image-first-frame-contain{
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; 
  background-color: black;
  z-index: 5;
  display: block
}
.ace-video-image-first-frame-fill{
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill; 
  background-color: black;
  z-index: 5;
  display: block;
}

 @keyframes aceSpin { to { transform: rotate(360deg); } }
.ace-spinner {
  width: 42px; 
  height: 42px;
  border: 4px solid rgba(255,255,255,.25);
  border-top-color: #00E0FF;
  border-radius: 50%;
  animation: aceSpin 1s linear infinite;
}
.ace-loading-overlay{
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.25);
  z-index: 8;
  pointer-events: none;
  backdrop-filter: blur(1px);
}

.ace-hint{
  position: fixed;
  z-index: 16;
  /*pointer-events: none;*/
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.8);
  color: rgb(255, 255, 255);
  text-align: center;
  box-shadow: rgba(0, 0, 0, 0.35) 0px 6px 24px;
  /*width: 420px;
  left: 1760px;
  top: 218px;*/
}

.ace-hint-btn{
  padding: 6px 10px;
  margin-left: 10px;
  background: rgba(20, 20, 20, 0.75);
  color: rgb(255, 255, 255);
  cursor: pointer;
  backdrop-filter: blur(4px);
  border: none;
}


.ace-track-label {
  position: absolute;
  left: 8px;
  z-index: 2;
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  text-shadow: 0 1px 1px rgba(0,0,0,.4);
  padding: 2px 6px;
  border-radius: 6px;
  pointer-events: none;
  user-select: none;   /* optionnel : éviter la sélection du texte */
}
.ace-track-label-s3 {
  bottom: 0%;
}
.ace-track-label-fs {
  bottom: 51%;
}
.ace-track-label .clickable {
  pointer-events: auto;
}




.ace-table-nowrap td {
  white-space: nowrap;
}
.ace-table-nowrap th{
  white-space: nowrap;
}

.ace-opacity-50 {
  opacity: 0.6;
}




.ace-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: stretch; }
.ace-col { flex: 1 1 320px; display: flex; }
.ace-card { width: 100%; }




/* Chips d'infos */
.ace-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .55rem; border-radius: 10rem; background: #f8fafc; font-size: .85rem; }


/* Alarme : style amélioré (fond blanc Volt, anneau d'accent, halo léger) */
.ace-alarm { position: relative; }
.ace-alarm[data-state] { --ace-accent: #16a34a; --ace-contrast: #fff; }
.ace-alarm::after { /* anneau doux autour de la carte pour l'état */
content: ""; position: absolute; inset: -2px; border-radius: .75rem; pointer-events: none;
background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 100%);
}
.ace-alarm[data-state]::after {
background: linear-gradient(180deg, color-mix(in oklab, var(--ace-accent) 30%, transparent), transparent);
filter: saturate(1.1);
}

.ace-col.ace-alarm-col {
  flex: 2 1 480px; /* Plus large que la col info */
}

/* Logo */
.ace-logo { max-width: 160px; height: auto; }


/* Badge synchronisé avec l'état */
.ace-badge.ace-sync { background: var(--ace-accent); color: var(--ace-contrast); border: none; }


/* Actions */
.ace-actions { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }

.ace-alarm .ace-config-header-wrapper {
  position: static;
  justify-content: center;
  min-height: 0;
  margin-top: .25rem;
}

.ace-alarm .ace-config-header-title {
  position: static;
  transform: none;
  max-width: 100%;
  white-space: normal;
  text-align: center;
}

.ace-alarm-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 13rem));
  justify-content: center;
  justify-items: center;
  gap: .65rem;
  width: 100%;
  margin: .75rem 0 .75rem;
}

.ace-alarm-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  width: 100%;
  min-height: 2.75rem;
  padding: .55rem .85rem;
  font-weight: 600;
  white-space: normal;
  line-height: 1.15;
  border-radius: .5rem;
}

.ace-alarm-action i {
  flex: 0 0 auto;
  font-size: 1rem;
  line-height: 1;
}


/* Progress arming */
.ace-arming { display: none; }
.ace-arming .progress.ace-progress-narrow {
  width: 60%;         /* moins de largeur */
  margin: 0.25rem auto;
  height: 4px;        /* plus fine */
}
.ace-alarm[data-state="Arming"] .ace-arming { display: block; }


/* Etat → Couleurs */
.ace-alarm[data-state="unknown"] { --ace-accent:#6f6f6f; --ace-contrast:#fff; }
.ace-alarm[data-state="Disarmed"] { --ace-accent:#16a34a; --ace-contrast:#fff; }
.ace-alarm[data-state="Arming"] { --ace-accent:#f59e0b; --ace-contrast:#111827; }
.ace-alarm[data-state="Armed"] { --ace-accent:#ef4444; --ace-contrast:#fff; }
.ace-alarm[data-state="Alarm"] { --ace-accent:#ef4444; --ace-contrast:#fff; }


@media (max-width: 768px){ .ace-logo { max-width: 130px; } }
@media (max-width: 576px){
  .ace-col.ace-alarm-col { flex-basis: 100%; }
  .ace-alarm { padding: 1rem !important; }
  .ace-actions { justify-content: center; }
  .ace-alarm-controls {
    grid-template-columns: minmax(0, 13rem);
    gap: .5rem;
    margin: 1rem 0 .25rem;
  }
  .ace-alarm-action {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce){ .ace-arming .progress-bar { transition: none !important; } }

.ace-card-config-menu i { font-size: clamp(1.5rem, 3vw, 2.25rem); }
.ace-card-config-menu h6 { font-size: clamp(0.9rem, 1.8vw, 1rem); }
.ace-card-config-menu { padding: clamp(0.75rem, 2vw, 1rem) !important; }
  .ace-header {
    display:flex; align-items:center; gap:.75rem;
    padding:.6rem .8rem; border-radius:12px;
    background:#fff; box-shadow:0 2px 12px rgba(0,0,0,.06);
    margin-bottom:.8rem;
  }
  .ace-back {
    border:0; border-radius:10px; background:#f2f3f5;
    padding:.4rem .6rem; cursor:pointer;
  }
  .ace-title { font-weight:600 }
  .ace-view { animation:fade .18s ease-out; }
  @keyframes fade { from {opacity:.0; transform:translateY(4px)} to {opacity:1; transform:none} }
  .ace-loader {
    position:relative; border-radius:12px; background:#f5f6f8; height:120px; overflow:hidden;
  }
  .ace-loader::after {
    content:""; position:absolute; inset:0; transform:translateX(-100%);
    background:linear-gradient(90deg,transparent,rgba(0,0,0,.06),transparent);
    animation:shimmer 1.1s infinite;
  }
  @keyframes shimmer { to { transform:translateX(100%); } }

/* === Mode compact du sidebar (Volt) === */
#sidebarMenu.sidebar-collapsed {
    width: 70px !important;
    min-width: 70px !important;
    transition: width .25s ease;
}

/* cacher les textes partout */
#sidebarMenu.sidebar-collapsed .sidebar-text {
    display: none !important;
}

/* liens centrés */
#sidebarMenu.sidebar-collapsed .nav-link {
    justify-content: center !important;
}
#sidebarMenu.sidebar-collapsed .nav-link .sidebar-icon {
    margin-right: 0 !important;
}

/* liste de sites + filtre cachés */
#sidebarMenu.sidebar-collapsed #siteListContainer,
#sidebarMenu.sidebar-collapsed #menuInputFilterSite {
    display: none !important;
}

/* bloc compte caché */
#sidebarMenu.sidebar-collapsed .btn-upgrade-pro {
    display: none !important;
}

/* bouton + (create site) caché */
#sidebarMenu.sidebar-collapsed a[href*="create_site=true"] {
    display: none !important;
}

/* bouton + (create site) caché */
#sidebarMenu.sidebar-collapsed ul {
    overflow : hidden
}

#sidebarMenu.sidebar-collapsed .logo {
     display: none !important;
}

/* badges cachés */
#sidebarMenu.sidebar-collapsed .badge,
#sidebarMenu.sidebar-collapsed .menu-camera-notification-count {
    display: none !important;
}

/* ----- ADMIN quand collapsed ----- */
/* on ne le cache plus : on le laisse se dérouler, mais version icône-only */
#sidebarMenu.sidebar-collapsed #submenu-admin {
    justify-content: flex-start !important;
    padding-left: 0rem;   /* tu peux mettre 1.4rem ou 1.8rem selon ton goût */
}

/* les éléments du sous-menu admin centraux aussi */
#sidebarMenu.sidebar-collapsed #submenu-admin .nav-link {
    margin-right: 0 !important;
}

/* on cache les petites flèches du lien parent Admin */
#sidebarMenu.sidebar-collapsed a[data-bs-toggle="collapse"] .link-arrow {
    display: none !important;
}

/* le lien "Admin" lui-même reste centré */
#sidebarMenu.sidebar-collapsed a[data-bs-toggle="collapse"] {
    justify-content: center !important;
}

/* transitions */
#sidebarMenu.sidebar-collapsed .nav-link,
#sidebarMenu.sidebar-collapsed .sidebar-icon {
    transition: all .25s ease;
}

body.with-sidebar-collapsed .content {
    margin-left: 70px;
    transition: margin-left .25s ease;
}
/* grille sous la carte alarme */
.ace-alarm-external {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* petite carte d’état */
.ace-external-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.65rem;
  border-radius: 0.85rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
  transition: all .2s ease-out;
  min-height: 44px;
}

.ace-external-card .ace-ext-icon {
  width: 30px;
  height: 30px;
  border-radius: 9999px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
  font-size: 1rem;
  flex-shrink: 0;
}

.ace-external-card .ace-ext-content {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.ace-external-card .ace-ext-label {
  font-size: .72rem;
  font-weight: 500;
  color: #1f2937;
}

.ace-external-card .ace-ext-status {
  font-size: .68rem;
  color: #64748b;
}

/* quand l’état est actif */
.ace-external-card.is-active {
  background: rgba(239, 68, 68, 0.09);
  border-color: rgba(239, 68, 68, 0.55);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.18);
}

.ace-external-card.is-active .ace-ext-icon {
  background: #ef4444;
  color: #fff;
}

.ace-external-card.is-active .ace-ext-status {
  color: #b91c1c;
  font-weight: 600;
}

/* légère anim quand ça s’allume */
.ace-external-card.is-active {
  animation: aceExtPulse 1.4s ease-in-out infinite alternate;
}

@keyframes aceExtPulse {
  from { transform: translateY(0); }
  to   { transform: translateY(-1px); }
}
/* conteneur des états externes */
.ace-alarm-external {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .5rem;
}

/* badge externe */
.ace-external-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .6rem;
  border-radius: 9999px;
  background: #f8fafc;
  border: 1px solid rgba(148,163,184,.35);
  font-size: .74rem;
  color: #475569;
  transition: all .15s ease-out;
}

.ace-external-chip i {
  font-size: .8rem;
  line-height: 1;
}

/* état actif (alarme, batterie basse, etc.) */
.ace-external-chip.is-active {
  background: rgba(239, 68, 68, .12);
  border-color: rgba(239, 68, 68, .45);
  color: #b91c1c;
  font-weight: 600;
}
/* Scène image centrée, ne pas forcer 100% */
.ace-map-stage { display: inline-block; }
.ace-map-img {
  display: block;
  margin: 0 auto;         /* centre l’image */
  width: auto;            /* taille naturelle */
  max-width: 100%;        /* rétrécit si conteneur trop étroit */
  height: auto;           /* respecte le ratio */
  border-bottom-left-radius: .375rem;
  border-bottom-right-radius: .375rem;
}

/* L’overlay est dimensionné dynamiquement en JS pour matcher l’image */
#srs-layer { pointer-events: none; } /* les spots remettent les events */
#srs-layer > * { pointer-events: auto; }

/* safety-radio-spot */
.ace-safety-radio-spot-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: #0d6efd; box-shadow: 0 0 0 4px rgba(13,110,253,.25);
  border: 0; 
}
.ace-safety-radio-spot-dot:focus { outline: 0; box-shadow: 0 0 0 4px rgba(13,110,253,.35), 0 0 0 6px rgba(13,110,253,.15); }
.ace-safety-radio-spot-label {
  white-space: nowrap; font-size: 12px;
  background: rgba(255,255,255,.75); padding: 0 .35rem; border-radius: .35rem;
  backdrop-filter: blur(2px);
}

/* dots d’état */
.ace-dot-success, .ace-dot-default, .ace-dot-muted {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block;
}
.ace-dot-success { background: #198754; box-shadow: 0 0 0 3px rgba(25,135,84,.2); }
.ace-opacity-50 {
    opacity: 0.5 !important;
}


/* Suppression du fond gris/bleu par défaut de bootstrap sur l'accordéon ouvert */
.accordion-button:not(.collapsed) {
    color: #0d6efd; /* Couleur primaire Bootstrap */
    background-color: #fff; /* Fond blanc */
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.125); /* Légère bordure */
    border-bottom: 2px solid #0d6efd; /* Bordure active */
}

/* Capteur désactivé (is_hidden = true) */
.ace-sensor-item.disabled-sensor {
    opacity: 0.6;
    background-color: #f8f9fa;
}
.ace-sensor-item.disabled-sensor .accordion-button {
    background-color: #f8f9fa;
    color: #6c757d;
}

/* Alignement du switch dans le header */
.ace-sensor-header-switch {
    z-index: 5; /* S'assurer qu'il est cliquable au dessus de l'accordéon */
}

.ace-sensor-body-offline {
  filter: grayscale(100%);
  opacity: 0.3;
  pointer-events: none;
  transition: all 0.3s ease;
}

.ace-aranet-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: default;
  font-size: 0.85rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ace-aranet-card .card-body {
  flex: 1; 
}

/* Keep the chart's observed parent stable while switching measurements. */
.ace-aranet-card .ace-inline-history-frame,
.ace-aranet-card .ace-inline-history {
  height: 180px;
}

.ace-aranet-card .ace-inline-history {
  cursor: pointer;
}

.ace-aranet-card .ace-inline-history-status {
  min-height: calc(1.5em + .5rem);
}

.ace-aranet-card.ace-sensor-has-alert {
  outline: 2px solid #dc3545;
  outline-offset: -2px;
}

.ace-aranet-card .ace-sensor-body-offline {
  filter: none;
  opacity: 1;
  pointer-events: auto;
}

.ace-aranet-card .ace-sensor-body-offline .ace-metric-badge:not(.ace-status-alarm) {
  opacity: 0.55;
}

/* Badge Hors Ligne */
.ace-offline-badge {
  background-color: #e74a3b;
  color: white;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  animation: ace-pulse-offline 2s infinite;
}

@keyframes ace-pulse-offline {
  0% { opacity: 1; }
  50% { opacity: 0.8; }
  100% { opacity: 1; }
}

/* Animations */
@keyframes ace-slideInHighlight {
  0% { background-color: #ffe6e6; transform: scale(0.98); }
  50% { background-color: #ffe6e6; transform: scale(1.02); }
  100% { background-color: white; transform: scale(1); }
}
.ace-priority-move {
  animation: ace-slideInHighlight 1.5s ease-out;
}

/* Badges métriques */
.ace-metric-badge {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  border-radius: 6px;
  background-color: #f2f4f6;
  color: #555;
  border: 1px solid transparent;
  transition: all 0.3s;
  font-weight: 600;
}
.ace-metric-badge.ace-status-ok {
  background-color: #d1e7dd;
  color: #0f5132;
  border-color: #badbcc;
}
.ace-metric-badge.ace-status-alarm {
  background-color: #f8d7da;
  color: #842029;
  border-color: #f5c2c7;
  animation: ace-pulse-red 2s infinite;
}

.ace-aranet-card button.ace-metric-badge[aria-pressed="true"] {
  border-left: 3px solid currentColor;
}

.ace-aranet-card button.ace-metric-badge:focus-visible {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

@keyframes ace-pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

.ace-metric-value { font-size: 0.95rem; }
.ace-metric-unit { font-size: 0.7rem; opacity: 0.8; margin-left: 2px; }

/* Indicateurs icones */
.ace-icon-indicator { font-size: 1rem; }
.ace-text-rssi-good { color: #1cc88a; }
.ace-text-rssi-medium { color: #f6c23e; }
.ace-text-rssi-bad { color: #e74a3b; }

/* Batterie Text */
.ace-battery-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6c757d;
  margin-left: 4px;
}

/* Bouton Historique */
.ace-btn-history {
  font-size: 0.7rem;
  padding: 2px 0;
  color: #adb5bd;
  text-decoration: none;
  transition: color 0.2s;
}
.ace-btn-history:hover {
  color: #4e73df;
  text-decoration: underline;
}
.ace-alarm-time {
    font-size: 0.65rem;
    display: block;
    opacity: 0.9;
    font-weight: normal;
}
/* MODAL HISTORY STYLES */
/* --- Aranet History Modal CSS --- */

/* Le fond sombre (Backdrop) */

/* Zone du graphique */
.ace-chart-wrapper {
    position: relative;
    min-height: 350px; /* Hauteur minimale garantie pour le graphique */
    flex: 1; /* Prend l'espace restant */
}

/* Loader sur le graphique */
.ace-chart-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 10;
    display: none; /* Caché par défaut */
    align-items: center;
    justify-content: center;
}

         

.ace-chart-container { min-height: 350px; }

.ace-hist-tab {
    cursor: pointer; padding: 8px 16px; border-bottom: 2px solid transparent;
    font-weight: 600; color: #6c757d; transition: all 0.2s;
}
.ace-hist-tab:hover { color: #4e73df; background: #f8f9fa; }
.ace-hist-tab.active { color: #4e73df; border-bottom-color: #4e73df; background: #f0f4ff; }

.ace-date-input {
    border: 1px solid #ced4da; border-radius: 4px; padding: 4px 8px; font-size: 0.85rem;
}
.ace-no-accordion-icon::after {
                display: none !important;
                background-image: none !important;
                content: none !important;
            }
@keyframes ace-flash-highlight {
        0% { background-color: rgba(13, 110, 253, 0.25); } /* Primary color low opacity */
        100% { background-color: transparent; }
    }
    .ace-event-highlight {
        animation: ace-flash-highlight 3s ease-out forwards;
    }

    /* Camera List Item Improvements */
.ace-camera-item-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ace-badge-container {
    height: 20px; /* Fixe la hauteur pour éviter le saut au chargement */
    margin-top: 4px;
    display: flex;
    gap: 4px;
}

/* Timeline Style pour la liste des événements */
.ace-timeline-item {
    position: relative;
    padding-left: 20px;
}

.ace-timeline-item::before {
    content: '';
    position: absolute;
    left: 19px; /* Ajuster selon l'icône */
    top: 35px;
    bottom: -10px;
    width: 2px;
    background-color: #e9ecef;
    z-index: 0;
}

.ace-timeline-item:last-child::before {
    display: none;
}

.ace-event-icon-wrapper {
    z-index: 1; /* Au-dessus de la ligne */
    position: relative;
}
.sidebar.sidebar-collapsed .sidebar-footer {
    flex-direction: column !important;
}
.sidebar.sidebar-collapsed .sidebar-footer .btn {
    margin-right: 0 !important;
    margin-bottom: 10px;
}
.sidebar.sidebar-collapsed .sidebar-footer small {
    display: none;
}
.bg-info-soft {
    color: #0dcaf0;
    border: 1px solid rgba(13, 202, 240, 0.2);
}

.bg-secondary-soft {
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.2);
}
/* Le conteneur "Toast" */
#maintenance-toast {
    position: fixed;
    top: 24px;
    right: 24px; /* Placé en haut à droite, moins intrusif */
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid #f3f4f6;
    display: flex;
    align-items: flex-start;
    padding: 16px;
    gap: 16px;
    width: 340px;
    z-index: 9999;
    font-family: 'Segoe UI', system-ui, sans-serif;
    
    /* Animation douce */
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none; /* Inactif quand caché */
}

/* Classe ajoutée par le JS pour l'afficher */
#maintenance-toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* L'icône orange douce */
.toast-icon {
    color: #f59e0b; /* Ambre/Orange doux */
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Les textes */
.toast-content { flex: 1; }

.toast-title {
    color: #1f2937; /* Gris très foncé */
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.toast-desc {
    color: #6b7280; /* Gris clair */
    font-size: 13px;
    line-height: 1.4;
}

/* Le bouton fermer */
.toast-close {
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}
.toast-close:hover { background: #f3f4f6; color: #4b5563; }

#div_main {
        display: flex;
        flex-direction: column;
        gap: 1.25rem;
        padding: 1rem 0 10rem 0;
    }

    .table-responsive {
        min-height: 250px;
    }

    /* ==========================================
       2. TABLEAUX (Page Users)
       ========================================== */
    .saas-table {
        --bs-table-bg: transparent;
        --bs-table-hover-bg: #f8fafc;
    }
    .saas-table tbody tr {
        transition: background-color 0.2s ease;
    }
    .saas-table tbody td {
        padding: 0.75rem 0.5rem;
        border-bottom: 1px solid #f1f5f9;
        vertical-align: middle;
        font-size: 0.9rem;
    }
    .saas-table tbody tr:last-child td {
        border-bottom: none;
    }
    .saas-table tbody td:first-child {
        padding-left: 1.5rem;
    }
    .saas-table tbody td:last-child {
        padding-right: 1.5rem;
    }

    /* ==========================================
       3. COMPOSANTS SITES & CARTES (Page Sites)
       ========================================== */
    .saas-site-block {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    }
    .saas-site-header {
        background: #f8fafc;
        border-bottom: 1px solid #e2e8f0;
        border-radius: 10px 10px 0 0;
        padding: 0.5rem 1.25rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    /* Grille responsive stricte pour les cartes */
    .saas-cards-grid {
        display: grid;
        gap: 0.75rem;
        padding: 1rem 1.25rem;
        grid-template-columns: 1fr; /* Mobile : 1 carte */
    }
    @media (min-width: 768px) {
        .saas-cards-grid { grid-template-columns: repeat(2, 1fr); }
    }
    @media (min-width: 992px) {
        .saas-cards-grid { grid-template-columns: repeat(3, 1fr); }
    }
    @media (min-width: 1200px) {
        .saas-cards-grid { grid-template-columns: repeat(4, 1fr); }
    }

    .saas-mini-card {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 0.5rem 0.75rem;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        transition: all 0.2s ease;
    }
    .saas-mini-card:hover {
        border-color: #cbd5e1;
        box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    }
    .saas-mini-card.is-offline {
        background-color: #fef2f2;
        border-color: #fecaca;
    }

    /* Demandes d'export vidéo */
    .ace-export-list {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }
    .ace-export-group {
        grid-column: 1 / -1;
        overflow: hidden;
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 14px;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.035);
        transition: border-color 0.18s ease, box-shadow 0.18s ease;
    }
    .ace-export-group:hover {
        border-color: #cbd5e1;
        box-shadow: 0 5px 16px rgba(15, 23, 42, 0.055);
    }
    .ace-export-group.is-highlighted {
        border-color: #60a5fa;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14), 0 8px 24px rgba(15, 23, 42, 0.08);
    }
    .ace-export-group-header {
        padding: 1rem 1.1rem;
    }
    .ace-export-group-topline {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }
    .ace-export-group-heading {
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 0.8rem;
    }
    .ace-export-group-icon {
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #2563eb;
        background: #eff6ff;
        border-radius: 10px;
        font-size: 1.05rem;
    }
    .ace-export-group.is-local .ace-export-group-icon {
        color: #475569;
        background: #f1f5f9;
    }
    .ace-export-group-title-wrap,
    .ace-export-camera-header .min-w-0 {
        min-width: 0;
    }
    .ace-export-group-title {
        overflow: hidden;
        margin: 0;
        color: #172033;
        font-size: 0.95rem;
        font-weight: 700;
        line-height: 1.35;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .ace-export-group-reason {
        overflow: hidden;
        margin-top: 0.15rem;
        color: #64748b;
        font-size: 0.75rem;
        line-height: 1.35;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .ace-export-group-controls {
        display: flex;
        align-items: center;
        gap: 0.55rem;
        flex: 0 0 auto;
    }
    .ace-export-group-state,
    .ace-export-part-state {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        padding: 0.3rem 0.55rem;
        color: #475569;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 999px;
        font-size: 0.68rem;
        font-weight: 650;
        line-height: 1.2;
        white-space: nowrap;
    }
    .ace-export-group-state.is-ready,
    .ace-export-part-state.is-ready {
        color: #047857;
        background: #ecfdf5;
        border-color: #a7f3d0;
    }
    .ace-export-group-state.is-pending,
    .ace-export-part-state.is-pending {
        color: #9a6700;
        background: #fffbeb;
        border-color: #fde68a;
    }
    .ace-export-group-state.is-error,
    .ace-export-part-state.is-error {
        color: #b42318;
        background: #fff1f2;
        border-color: #fecdd3;
    }
    .ace-export-group-state.is-partial {
        color: #9a6700;
        background: #fffbeb;
        border-color: #fde68a;
    }
    .ace-export-group-state.is-empty,
    .ace-export-part-state.is-empty,
    .ace-export-group-state.is-neutral,
    .ace-export-part-state.is-neutral {
        color: #64748b;
        background: #f8fafc;
        border-color: #e2e8f0;
    }
    .ace-export-group-download {
        min-height: 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        padding: 0.35rem 0.7rem;
        color: #1d4ed8;
        background: #eff6ff;
        border: 1px solid #bfdbfe;
        border-radius: 9px;
        font-size: 0.72rem;
        font-weight: 700;
        line-height: 1;
        white-space: nowrap;
        transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
    }
    .ace-export-group-download:hover:not(:disabled) {
        color: #fff;
        background: #2563eb;
        border-color: #2563eb;
    }
    .ace-export-group-download:disabled {
        cursor: wait;
        opacity: 0.65;
    }
    .ace-export-group-delete {
        min-height: 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        padding: 0.35rem 0.7rem;
        color: #b42318;
        background: #fff1f2;
        border: 1px solid #fecdd3;
        border-radius: 9px;
        font-size: 0.72rem;
        font-weight: 700;
        line-height: 1;
        white-space: nowrap;
        transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
    }
    .ace-export-group-delete:hover:not(:disabled) {
        color: #fff;
        background: #dc2626;
        border-color: #dc2626;
    }
    .ace-export-group-delete:disabled {
        cursor: wait;
        opacity: 0.45;
    }
    .ace-export-group.is-downloading .ace-video-export-download-btn {
        pointer-events: none;
        opacity: 0.45;
    }
    .ace-export-group-toggle {
        width: 34px;
        height: 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        color: #64748b;
        background: transparent;
        border: 1px solid transparent;
        border-radius: 9px;
        transition: color 0.15s ease, background-color 0.15s ease;
    }
    .ace-export-group-toggle:hover {
        color: #1d4ed8;
        background: #f1f5f9;
    }
    .ace-export-group-summary {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.4rem 1rem;
        margin-top: 0.8rem;
        padding-left: 3.2rem;
        color: #64748b;
        font-size: 0.7rem;
    }
    .ace-export-group-summary > span {
        min-width: 0;
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
    }
    .ace-export-group-summary i {
        color: #94a3b8;
        font-size: 0.72rem;
    }
    .ace-export-group-summary .bi-arrow-right {
        font-size: 0.58rem;
    }
    .ace-export-group-expiration {
        color: #b45309;
        font-weight: 600;
    }
    .ace-export-group-expiration i {
        color: #d97706;
    }
    .ace-export-group-created {
        margin-left: auto;
        color: #94a3b8;
    }
    .ace-export-group-body {
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
        padding: 0 1.1rem 1rem;
        border-top: 1px solid #f1f5f9;
    }
    .ace-export-camera-group {
        overflow: hidden;
        margin-top: 0.8rem;
        background: #ffffff;
        border: 1px solid #e8edf3;
        border-radius: 11px;
    }
    .ace-export-camera-header {
        display: flex;
        align-items: center;
        gap: 0.65rem;
        padding: 0.65rem 0.8rem;
        background: #fafbfc;
        border-bottom: 1px solid #edf1f5;
    }
    .ace-export-camera-avatar {
        width: 30px;
        height: 30px;
        flex: 0 0 30px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #2563eb;
        background: #eff6ff;
        border-radius: 8px;
        font-size: 0.82rem;
    }
    .ace-export-camera-name {
        overflow: hidden;
        color: #263247;
        font-size: 0.78rem;
        font-weight: 700;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .ace-export-camera-location {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem 0.7rem;
        margin-top: 0.08rem;
        color: #94a3b8;
        font-size: 0.65rem;
    }
    .ace-export-camera-location span {
        display: inline-flex;
        align-items: center;
        gap: 0.28rem;
    }
    .ace-export-camera-count {
        margin-left: auto;
        color: #94a3b8;
        font-size: 0.65rem;
        white-space: nowrap;
    }
    .ace-export-parts {
        display: flex;
        flex-direction: column;
    }
    .ace-export-part {
        display: grid;
        gap: 0.7rem;
        align-items: center;
        min-height: 54px;
        padding: 0.55rem 0.8rem;
        border-bottom: 1px solid #f1f5f9;
        transition: background-color 0.15s ease;
    }
    .ace-export-part.has-one-part {
        grid-template-columns: 22px minmax(240px, 1.8fr) minmax(75px, 0.45fr) minmax(115px, auto) auto;
    }
    .ace-export-part.has-multiple-parts {
        grid-template-columns: 22px minmax(95px, 0.55fr) minmax(240px, 1.8fr) minmax(75px, 0.45fr) minmax(115px, auto) auto;
    }
    .ace-export-part:last-child {
        border-bottom: 0;
    }
    .ace-export-part:hover {
        background: #fafcff;
    }
    .ace-export-part-index {
        color: #475569;
        font-size: 0.68rem;
        font-weight: 650;
        white-space: nowrap;
    }
    .ace-export-part-period,
    .ace-export-part-size {
        display: flex;
        align-items: center;
        gap: 0.42rem;
        color: #64748b;
        font-size: 0.7rem;
    }
    .ace-export-part-period {
        white-space: nowrap;
    }
    .ace-export-part-period i {
        color: #94a3b8;
        font-size: 0.58rem;
    }
    .ace-export-part-size {
        white-space: nowrap;
    }
    .ace-export-part-size i {
        color: #94a3b8;
    }
    .ace-export-part-state {
        max-width: 220px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .ace-export-part-actions {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 0.2rem;
    }
    .ace-export-part-download-progress {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1.65rem;
        height: 1.65rem;
        flex: 0 0 1.65rem;
        border-radius: 50%;
    }
    .ace-export-part-download-progress[hidden] {
        display: none;
    }
    .ace-export-part-download-progress .spinner-border {
        width: 0.9rem;
        height: 0.9rem;
        border-width: 0.12em;
    }
    .ace-export-part-download-progress.is-queued {
        color: #94a3b8;
        background: #f8fafc;
    }
    .ace-export-part-download-progress.is-downloading {
        color: #2563eb;
        background: #eff6ff;
    }
    .ace-export-part-download-progress.is-completed {
        color: #15803d;
        background: #f0fdf4;
    }
    .ace-export-part-download-progress.is-failed {
        color: #b91c1c;
        background: #fef2f2;
    }
    .ace-export-part-checkbox-placeholder {
        width: 1rem;
    }

    @media (max-width: 991.98px) {
        .ace-export-part.has-one-part {
            grid-template-columns: 22px minmax(210px, 1fr) minmax(110px, auto) auto;
        }
        .ace-export-part.has-multiple-parts {
            grid-template-columns: 22px minmax(90px, 0.5fr) minmax(210px, 1fr) minmax(110px, auto) auto;
        }
        .ace-export-part-size {
            display: none;
        }
    }
    @media (max-width: 767.98px) {
        .ace-export-list {
            padding: 0.75rem;
        }
        .ace-export-group {
            border-radius: 12px;
            box-shadow: none;
        }
        .ace-export-group-header {
            padding: 0.85rem;
        }
        .ace-export-group-topline {
            align-items: flex-start;
            gap: 0.65rem;
        }
        .ace-export-group-icon {
            width: 36px;
            height: 36px;
            flex-basis: 36px;
        }
        .ace-export-group-controls {
            gap: 0.2rem;
        }
        .ace-export-group-state {
            padding: 0.27rem 0.45rem;
        }
        .ace-export-group-download span:not(.spinner-border) {
            display: none;
        }
        .ace-export-group-delete span:not(.spinner-border) {
            display: none;
        }
        .ace-export-group-download,
        .ace-export-group-delete {
            width: 34px;
            padding: 0;
        }
        .ace-export-group-summary {
            gap: 0.38rem 0.75rem;
            margin-top: 0.7rem;
            padding-left: 0;
        }
        .ace-export-group-summary > span:first-child {
            width: 100%;
        }
        .ace-export-group-created {
            width: 100%;
            margin-left: 0;
        }
        .ace-export-group-body {
            padding: 0 0.75rem 0.75rem;
        }
        .ace-export-camera-header {
            padding: 0.6rem 0.65rem;
        }
        .ace-export-camera-count {
            display: none;
        }
        .ace-export-part.has-one-part,
        .ace-export-part.has-multiple-parts {
            grid-template-columns: 22px minmax(0, 1fr) auto;
            gap: 0.45rem 0.55rem;
            padding: 0.65rem;
        }
        .ace-export-part > .form-check-input,
        .ace-export-part-checkbox-placeholder {
            grid-column: 1;
            grid-row: 1 / span 4;
        }
        .ace-export-part.has-multiple-parts .ace-export-part-index {
            grid-column: 2;
            grid-row: 1;
        }
        .ace-export-part.has-multiple-parts .ace-export-part-period {
            grid-column: 2;
            grid-row: 2;
        }
        .ace-export-part.has-multiple-parts .ace-export-part-state {
            grid-column: 2;
            grid-row: 3;
        }
        .ace-export-part.has-multiple-parts .ace-export-part-size {
            grid-column: 2;
            grid-row: 4;
        }
        .ace-export-part.has-one-part .ace-export-part-period {
            grid-column: 2;
            grid-row: 1;
        }
        .ace-export-part.has-one-part .ace-export-part-state {
            grid-column: 2;
            grid-row: 2;
        }
        .ace-export-part.has-one-part .ace-export-part-size {
            grid-column: 2;
            grid-row: 3;
        }
        .ace-export-part-period {
            flex-wrap: wrap;
            white-space: normal;
        }
        .ace-export-part-size {
            display: flex;
        }
        .ace-export-part-state {
            justify-self: start;
        }
        .ace-export-part-actions {
            grid-column: 3;
            grid-row: 1 / span 4;
            flex-direction: column;
        }
    }

    /* ==========================================
       4. AVATARS & STATUTS
       ========================================== */
    .status-dot {
        width: 10px; 
        height: 10px;
        border-radius: 50%; 
        display: inline-block; 
        flex-shrink: 0;
    }
    .status-dot.online { background-color: #10b981; box-shadow: 0 0 6px #10b98180; }
    .status-dot.offline { background-color: #ef4444; box-shadow: 0 0 6px #ef444480; }
    
    .status-avatar {
        width: 34px;
        height: 34px;
        border-radius: 50%; 
        display: flex; 
        align-items: center; 
        justify-content: center;
        font-weight: bold; 
        font-size: 0.85rem; 
        flex-shrink: 0;
    }

    /* ==========================================
       5. BOUTONS D'ACTION (Harmonisés à 32px)
       ========================================== */
    .btn-action-icon {
        color: #64748b;
        background: transparent; 
        border: 1px solid transparent; /* Bordure transparente pour éviter les sauts au hover */
        border-radius: 8px;
        width: 32px; 
        height: 32px; 
        display: inline-flex; 
        align-items: center; 
        justify-content: center;
        transition: all 0.15s ease-in-out;
        font-size: 0.9rem;
        padding: 0;
    }
    .btn-action-icon:hover { 
        background-color: #f1f5f9; 
        color: #0f172a; 
        border-color: #e2e8f0; 
    }
    /* Variantes de couleurs utilisées dans users.inc */
    .btn-action-icon.btn-danger-soft:hover { 
        background-color: #fef2f2; 
        color: #ef4444; 
        border-color: #fecaca; 
    }
    .btn-action-icon.btn-primary-soft:hover { 
        background-color: #eff6ff;
        color: #3b82f6; 
        border-color: #bfdbfe; 
    }

    /* ==========================================
       6. DASHBOARDS "SOFT" & STATISTIQUES
       ========================================== */
    .soft-dashboard {
        background: #ffffff;
        border: 1px solid rgba(226, 232, 240, 0.6);
        border-radius: 8px; 
        box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.04);
        transition: all 0.3s ease; 
        padding: 0.5rem;
    }
    .soft-stat-card {
        padding: 1rem 1.5rem;
        border-radius: 8px; 
        background: transparent; 
        transition: background-color 0.2s ease;
    }
    .soft-stat-card.filterable:hover {
        background: #f1f5f9;
        cursor: pointer;
    }
    
    .soft-icon-box {
        width: 48px; 
        height: 48px; 
        border-radius: 14px;
        display: flex; 
        align-items: center;
        justify-content: center; 
        font-size: 1.5rem; 
        flex-shrink: 0;
    }
    /* Couleurs spécifiques des icônes du dashboard */
    .icon-sites { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
    .icon-equipments { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
    .icon-cameras { background: rgba(16, 185, 129, 0.1); color: #10b981; }

    .stat-divider {
        width: 1px; 
        height: 40px;
        background: linear-gradient(to bottom, rgba(226,232,240,0), rgba(226,232,240,1), rgba(226,232,240,0));
        margin: 0 0.5rem;
    }

    /* ==========================================
       7. UTILITAIRES & BADGES
       ========================================== */
    .hover-badge {
        transition: all 0.2s ease;
    }
    .hover-badge:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    }
    
    .hover-filter {
        cursor: pointer; 
        padding: 2px 4px;
        border-radius: 4px; 
        transition: background-color 0.15s;
    }
    .hover-filter:hover { 
        background-color: rgba(0,0,0,0.05);
    }

    /* Masquage via JS */
    .filter-hidden { 
        display: none !important;
    }

/* Alarm clips: camera identity, media, then contextual and acknowledgement actions. */
.ace-clip-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  background: rgba(15, 23, 42, .7);
  backdrop-filter: blur(7px);
}
.ace-clip-overlay:focus { outline: none; }
.ace-clip-panel {
  width: min(100%, 860px);
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: #172033;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 20px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .3);
}
.ace-clip-header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px 24px;
  padding: 24px 28px 22px;
}
.ace-clip-eyebrow {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 40px;
  font-size: .69rem;
  font-weight: 650;
  letter-spacing: .035em;
}
.ace-clip-event { white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; color: #a74b26; }
.ace-clip-event::before { content: ''; flex: 0 0 6px; height: 6px; border-radius: 50%; background: #e58043; }
.ace-clip-counter { flex-shrink: 0; padding: 3px 8px; border: 1px solid #e7ebf1; border-radius: 6px; color: #768297; font-variant-numeric: tabular-nums; }
.ace-clip-close {
  position: absolute;
  right: 20px;
  top: 18px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
}
.ace-clip-close span { display: none; }
.ace-clip-identity { min-width: 0; }
.ace-clip-site { display: flex; align-items: baseline; gap: 6px; margin-bottom: 5px; color: #748197; font-size: .78rem; overflow-wrap: anywhere; }
.ace-clip-camera { margin: 0; color: #172033; font-size: 1.4rem; font-weight: 700; letter-spacing: -.035em; line-height: 1.3; overflow-wrap: anywhere; }
.ace-clip-time { padding-bottom: 3px; color: #748197; font-size: .75rem; font-variant-numeric: tabular-nums; }
.ace-clip-media { position: relative; display: grid; place-items: center; background: #0b101a; }
.ace-clip-media video { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: 50dvh; object-fit: contain; }
.ace-clip-detections { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ace-clip-fullscreen { position: absolute; right: 12px; top: 12px; z-index: 1; }
.ace-clip-fullscreen span { display: none; }
.ace-clip-media:fullscreen { width: 100%; height: 100%; }
.ace-clip-media:fullscreen video { width: 100%; height: 100%; max-height: none; }
.ace-clip-video-status { position: absolute; left: 16px; right: 16px; top: 16px; width: fit-content; max-width: calc(100% - 32px); margin: 0; padding: 7px 11px; border-radius: 7px; color: #e2e8f0; background: rgba(15, 23, 42, .85); font-size: .75rem; pointer-events: none; }
.ace-clip-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 15px 22px; }
.ace-clip-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 14px; border-radius: 9px; font-size: .8rem; font-weight: 600; line-height: 1.35; transition: background-color .15s, box-shadow .15s; }
.ace-clip-button[hidden] { display: none; }
.ace-clip-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 28px; border-top: 1px solid #e8edf3; background: #f8fafc; }
.ace-clip-next i { order: 1; }
.ace-clip-button:disabled, .ace-clip-close:disabled { opacity: .45; cursor: wait; }
.ace-clip-button:focus-visible, .ace-clip-close:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 3px; }
.ace-clip-action-status { margin: 0; padding: 0 28px 14px; color: #64748b; font-size: .78rem; }
.ace-clip-action-status:empty { display: none; }
@media (max-width: 576px) {
  .ace-clip-overlay { padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .ace-clip-panel { border-radius: 16px; }
  .ace-clip-header { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 20px; }
  .ace-clip-eyebrow { font-size: .64rem; gap: 8px; }
  .ace-clip-close { right: 12px; top: 12px; }
  .ace-clip-camera { font-size: 1.2rem; }
  .ace-clip-time { padding: 0; font-size: .7rem; }
  .ace-clip-tools { padding: 12px; gap: 6px; }
  .ace-clip-button { padding: 10px; min-height: 42px; font-size: .75rem; gap: 6px; }
  .ace-clip-footer { padding: 14px 20px; }
  .ace-clip-action-status { padding: 0 20px 12px; }
}

/* Compact site selection shared by Sensor Alert and Safety Alert. */
.ace-site-selection-search { width: 320px; max-width: 100%; }
.ace-site-selection-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.ace-site-selection-grid > div { flex: 0 1 200px; min-width: 0; max-width: 100%; }
.ace-site-selection-grid > .col-12 { flex-basis: 100%; }
.ace-site-choice .card-body {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 84px;
  padding: 14px;
}
.ace-site-choice-details { flex: 1; min-width: 0; }
.ace-site-choice .card-title { font-size: .9rem; line-height: 1.35; overflow-wrap: anywhere; }
.ace-site-choice .form-check-input { flex-shrink: 0; margin: 0; }

/* Safety Alert operations: preserve the alert/emission grids and live journal. */
#main_sfboard .sfboard-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
#main_sfboard .sfboard-heading-title { display: flex; align-items: center; gap: 12px; }
#main_sfboard .sfboard-heading h1 { font-weight: 700; letter-spacing: -.025em; }
#main_sfboard .sfboard-heading-icon {
  display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 14px; color: var(--bs-primary); background: #eaf0f8; font-size: 1.35rem;
}
#main_sfboard #sfboard-site-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-left: auto; font-size: .85rem; }
#main_sfboard .sfboard-selected-sites-details { position: relative; }
#main_sfboard .sfboard-selected-sites-details > summary {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px;
  list-style: none; cursor: pointer; color: #526279; border-radius: 9px;
}
#main_sfboard .sfboard-selected-sites-details > summary::-webkit-details-marker { display: none; }
#main_sfboard .sfboard-selected-sites-details > summary:hover { background: #e9eef5; }
#main_sfboard .sfboard-selected-sites-details > summary:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 2px; }
#main_sfboard .sfboard-selected-sites-details[open] > summary .bi-chevron-down { transform: rotate(180deg); }
#main_sfboard #sfboard-selected-sites {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 10;
  width: 360px; max-width: calc(100vw - 64px); max-height: 260px; overflow-y: auto;
  margin: 0; padding: 8px; list-style: none; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 8px 24px rgba(30, 50, 80, .1);
}
#main_sfboard #sfboard-selected-sites li { padding: 8px 10px; overflow-wrap: anywhere; color: #334155; }
#main_sfboard #sfboard-selected-sites li + li { border-top: 1px solid #edf0f4; }
#main_sfboard .sfboard-change-sites { padding: 9px 13px; border: 1px solid #d4dde8; border-radius: 9px; background: #fff; color: #334155; font-size: .85rem; white-space: nowrap; }
#main_sfboard .sfboard-change-sites:hover { background: #e9eef5; border-color: #b4c1d2; }
#main_sfboard .sfboard-equipment-details {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
}
#main_sfboard .sfboard-equipment-details > summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  padding: 15px 18px; cursor: pointer; list-style: none; font-size: .85rem;
}
#main_sfboard .sfboard-equipment-details > summary::-webkit-details-marker { display: none; }
#main_sfboard .sfboard-equipment-details > summary:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 3px; border-radius: 14px; }
#main_sfboard .sfboard-status-counts { display: flex; flex-wrap: wrap; gap: 8px; }
#main_sfboard .sfboard-status-count { padding: 4px 10px; border-radius: 20px; font-size: .78rem; font-weight: 600; }
#main_sfboard .sfboard-status-online { background: #edf7f1; color: #246447; }
#main_sfboard .sfboard-status-offline { background: #fff0ee; color: #a73529; }
#main_sfboard .sfboard-status-unavailable { background: #f0f2f5; color: #505d70; }
#main_sfboard .sfboard-details-label { margin-left: auto; color: #526279; }
#main_sfboard .sfboard-details-label i { display: inline-block; }
#main_sfboard details[open] .sfboard-details-label i { transform: rotate(180deg); }
#main_sfboard .sfboard-equipment-body { padding: 18px; border-top: 1px solid #e8edf3; }
#main_sfboard #sfboard-equipment-status-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 10px; }
#main_sfboard .sfboard-equipment-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px; border-radius: 10px; background: #f8fafc; border: 1px solid #edf0f4;
}
#main_sfboard .sfboard-equipment-item > div { min-width: 0; }
#main_sfboard #row_sfboard > .sfboard-plugin-main-alert:empty { display: none; }
#main_sfboard #row_sfboard > .sfboard-plugin-main-alert,
#main_sfboard #row_sfboard > .sfboard-plugin-main-logs { margin-bottom: 20px; }
#main_sfboard .sfboard-emission-row { margin-top: 0; margin-bottom: 4px; }
#main_sfboard .dashboard-plugin {
  border: 1px solid #e2e8f0 !important; border-radius: 16px;
  box-shadow: 0 4px 18px rgba(30, 50, 80, .045) !important;
}
#main_sfboard .dashboard-plugin > .row { margin: 0; }
#main_sfboard .dashboard-plugin > .row > .col-12 { padding: 0; margin-bottom: 0 !important; }
#main_sfboard .dashboard-plugin .card-header {
  padding: 18px 22px; border-bottom: 1px solid #e8edf3; border-radius: 16px 16px 0 0;
  background: #f8fafc;
}
#main_sfboard .dashboard-plugin .card-header h2 { font-size: 1rem !important; line-height: 1.45; overflow-wrap: anywhere; }
#main_sfboard .dashboard-plugin .card-body { padding: 20px 22px; }
#main_sfboard .sfboard-section-label { display: block; margin-bottom: 5px; font-size: .72rem; font-weight: 600; color: #64748b; }
#main_sfboard .sfboard-site-name { margin-top: 3px; color: #64748b; font-size: .8rem; overflow-wrap: anywhere; }
#main_sfboard .sfboard-message-heading { min-width: 0; }
#main_sfboard .dot { flex-shrink: 0; }
#main_sfboard .sfboard-radio-header { min-width: 0; }
#main_sfboard .sfboard-radio-list { min-width: 0; }
#main_sfboard .sfboard-transmitter {
  display: inline-flex; align-items: center; min-width: 0; gap: 4px;
  padding: 4px 8px; border: 1px solid #e3e9f0; border-radius: 7px; background: #fff; font-size: .75rem;
}
#main_sfboard .sfboard-transmitter > span:last-child { overflow-wrap: anywhere; min-width: 0; }
#main_sfboard .sfboard-alert-heading { margin-bottom: 10px; overflow-wrap: anywhere; }
#main_sfboard .sfboard-faults { margin-bottom: 26px; padding-bottom: 24px; border-bottom: 1px solid #e2e8f0; }
#main_sfboard .sfboard-faults-title { margin: 0 0 14px; color: #88550b; font-size: .95rem; font-weight: 700; }
#main_sfboard .sfboard-fault-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 12px; }
#main_sfboard .sfboard-fault-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 16px; min-width: 0;
  border: 1px solid #e8c68d; border-radius: 12px; background: #fffbf3; color: #334155;
  text-align: left; font: inherit; cursor: pointer;
}
#main_sfboard .sfboard-fault-item:hover { background: #fff4dc; border-color: #c78c30; }
#main_sfboard .sfboard-fault-item:focus-visible { outline: 2px solid #98610f; outline-offset: 3px; }
#main_sfboard .sfboard-fault-icon { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border-radius: 9px; background: #fcebc9; color: #88550b; }
#main_sfboard .sfboard-fault-content { min-width: 0; overflow-wrap: anywhere; }
#main_sfboard .sfboard-fault-content > span:not([hidden]) { display: block; }
#main_sfboard .sfboard-fault-category { color: #88550b; font-size: .78rem; font-weight: 600; }
#main_sfboard .sfboard-fault-word { margin-top: 3px; font-size: .95rem; font-weight: 700; }
#main_sfboard .sfboard-fault-source { margin-top: 6px; font-size: .82rem; }
#main_sfboard .sfboard-fault-date { margin-top: 6px; color: #626d7b; font-size: .78rem; }
#main_sfboard .sfboard-fault-history { margin-top: 12px; color: #88550b; font-size: .8rem; font-weight: 600; }
#main_sfboard .sfboard-alert-title { display: block; font-size: .95rem; }
#main_sfboard .ace-pocsag-alert-list { row-gap: 28px; }
#main_sfboard .sfboard-card-alerts + .sfboard-card-alerts { padding-top: 24px; border-top: 1px solid #dfe6ef; }
#main_sfboard .sfboard-card-alert-heading { margin-bottom: 16px; padding-left: 12px; border-left: 3px solid #94a8c1; }
#main_sfboard .sfboard-card-alert-name { margin: 0; font-size: 1rem; font-weight: 700; overflow-wrap: anywhere; }
#main_sfboard .sfboard-card-alert-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
#main_sfboard .sfboard-card-alert-body.has-summary { grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); }
#main_sfboard .sfboard-card-summary,
#main_sfboard .sfboard-card-keywords { min-width: 0; }
#main_sfboard .sfboard-alert-lane-title { margin: 0 0 10px; color: #526279; font-size: .78rem; font-weight: 600; }
#main_sfboard .sfboard-card-keyword-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; align-items: start; }
#main_sfboard .dashboard-plugin .ace-pocsag-alert-item {
  padding: 16px; border: 1px solid #e8edf3; border-radius: 12px; background: #f8fafc;
  box-shadow: inset 0 0 0 1px #e8edf3; font-size: .85rem; overflow-wrap: anywhere;
}
#main_sfboard .sfboard-card-summary .ace-pocsag-alert-item { border: 2px solid #91a6bf; background: #f0f4f9; box-shadow: none; }
#main_sfboard .sfboard-card-summary .ace-pocsag-alert-acknowledge-button { background: #26364b; border-color: #26364b; color: #fff; white-space: normal; }
#main_sfboard .sfboard-card-summary .ace-pocsag-alert-acknowledge-button:hover { background: #172539; border-color: #172539; }
#main_sfboard .ace-pocsag-alert-item .ace-pocsag-variable-alarm { margin-bottom: 12px; }
#main_sfboard .ace-pocsag-alert-item .ace-pocsag-variable-alarm i { font-size: 44px !important; }
#main_sfboard .ace-pocsag-msg-main label { font-size: .85rem; font-weight: 600; margin-bottom: 8px; }
#main_sfboard .ace-pocsag-msg-main .form-control { border-color: #dbe3ed; border-radius: 9px; }
#main_sfboard .ace-pocsag-msg-main .form-control:focus { border-color: var(--bs-primary); }
#main_sfboard .ace-pocsag-msg-main .btn { border-radius: 9px; min-height: 38px; }
#main_sfboard .ace-pocsag-msg-btn-preset,
#main_sfboard .ace-pocsag-msg-btn-message { white-space: normal; overflow-wrap: anywhere; font-weight: 600; }
#main_sfboard .ace-pocsag-msg-contact-group { border: 1px solid #dde5ee; border-radius: 10px; box-shadow: none !important; font-size: .85rem; }
#main_sfboard .ace-pocsag-msg-contact-group:hover { border-color: var(--bs-primary); }
#main_sfboard .ace-pocsag-msg-contact-group .flex-grow-1 { min-width: 0; overflow-wrap: anywhere; }
#main_sfboard .sfboard-compose { row-gap: 10px; padding-top: 16px; border-top: 1px solid #edf0f4; }
#main_sfboard .sfboard-compose-actions { display: flex; align-items: center; gap: 8px; }
#main_sfboard .ace-pocsag-msg-btn-input-clear { color: #566479; background: #f1f4f8; border-color: #dbe3ed; }
#main_sfboard .ace-pocsag-msg-btn-input-clear:hover { background: #e5eaf1; }
#main_sfboard .ace-pocsag-logs-main { font-size: .85rem; }
#main_sfboard .ace-pocsag-logs-main table.dataTable tbody td { padding-top: 12px; padding-bottom: 12px; vertical-align: middle; }
@media (max-width: 1199px) {
  #main_sfboard .sfboard-card-alert-body.has-summary { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
  #main_sfboard #sfboard-site-toolbar { margin-left: 0; }
  #main_sfboard #sfboard-selected-sites { left: 0; right: auto; }
  #main_sfboard .dashboard-plugin .card-header { padding: 16px; }
  #main_sfboard .dashboard-plugin .card-body { padding: 16px; }
  #main_sfboard .sfboard-radio-header { width: 100%; }
  #main_sfboard .sfboard-equipment-details > summary { gap: 10px; padding: 14px; }
  #main_sfboard .sfboard-status-counts { order: 2; width: 100%; }
}
