.operation-reports-page,
.operation-reports-page * {
  box-sizing: border-box;
}

.operation-reports-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 4px;
  color: rgba(255,255,255,.94);
  min-height: 100%;
}

.operation-reports-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.operation-reports-header h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.operation-reports-header p {
  margin: 6px 0 0;
  color: rgba(255,255,255,.62);
  font-size: 13px;
}

.operation-reports-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.operation-reports-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 14px;
}

.operation-stat-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03)),
    rgba(12,18,28,.72);
  box-shadow: 0 18px 40px rgba(0,0,0,.24);
  padding: 16px 18px;
}

.operation-stat-card::after {
  content: "";
  position: absolute;
  inset: auto -20px -35px auto;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,.18), transparent 70%);
  pointer-events: none;
}

.operation-stat-card.danger::after {
  background: radial-gradient(circle, rgba(239,68,68,.18), transparent 70%);
}

.operation-stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(255,255,255,.54);
  margin-bottom: 10px;
}

.operation-stat-value {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.operation-stat-sub {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255,255,255,.56);
}

.operation-reports-toolbar {
  display: grid;
  grid-template-columns: 1.6fr repeat(5, minmax(0, .72fr)) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.operation-reports-table-wrap {
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.06);
}

.operation-reports-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1240px;
}

.operation-reports-table thead th {
  padding: 14px 14px;
  text-align: left;
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.62);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,.07);
  white-space: nowrap;
}

.operation-reports-table tbody td {
  padding: 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  vertical-align: middle;
}

.operation-reports-table tbody tr:hover {
  background: rgba(255,255,255,.025);
}

.operation-report-number {
  font-weight: 800;
  color: #dbeafe;
}

.operation-report-title {
  font-weight: 700;
  color: #fff;
}

.operation-report-sub {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255,255,255,.55);
}

.operation-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.operation-badge.status-draft {
  background: rgba(148,163,184,.14);
  border-color: rgba(148,163,184,.22);
  color: #e2e8f0;
}

.operation-badge.status-final {
  background: rgba(34,197,94,.14);
  border-color: rgba(34,197,94,.22);
  color: #bbf7d0;
}

.operation-badge.status-archived {
  background: rgba(107,114,128,.18);
  border-color: rgba(107,114,128,.24);
  color: #e5e7eb;
}

.operation-badge.priority-low {
  background: rgba(96,165,250,.14);
  border-color: rgba(96,165,250,.22);
  color: #bfdbfe;
}

.operation-badge.priority-normal {
  background: rgba(148,163,184,.14);
  border-color: rgba(148,163,184,.22);
  color: #e2e8f0;
}

.operation-badge.priority-high {
  background: rgba(245,158,11,.16);
  border-color: rgba(245,158,11,.24);
  color: #fde68a;
}

.operation-badge.priority-critical {
  background: rgba(239,68,68,.16);
  border-color: rgba(239,68,68,.24);
  color: #fecaca;
}

.operation-actions-cell {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.operation-report-modal-xxl {
  max-width: 1540px;
  width: calc(100vw - 120px);
}

.operation-report-modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(520px, .95fr);
  gap: 18px;
  align-items: start;
  max-height: 78vh;
  overflow: hidden;
}

.operation-report-form-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  padding-right: 4px;
}

.operation-report-form-col::-webkit-scrollbar,
.operation-report-view-body::-webkit-scrollbar,
.operation-preview-sheet-wrap::-webkit-scrollbar,
.operation-reports-table-wrap::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.operation-report-form-col::-webkit-scrollbar-thumb,
.operation-report-view-body::-webkit-scrollbar-thumb,
.operation-preview-sheet-wrap::-webkit-scrollbar-thumb,
.operation-reports-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.16);
  border-radius: 999px;
}

.operation-form-section {
  border: 1px solid rgba(255,255,255,.07);
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.025));
  border-radius: 18px;
  padding: 16px;
}

.operation-form-section-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.68);
  margin-bottom: 14px;
}

.operation-report-preview-col {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.operation-preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(10,15,24,.76);
}

.preview-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  color: #bfdbfe;
}

.preview-hint {
  font-size: 12px;
  color: rgba(255,255,255,.55);
}

.operation-preview-sheet-wrap {
  overflow: auto;
  min-height: 0;
  max-height: calc(78vh - 72px);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02)),
    rgba(7,11,18,.82);
  padding: 18px;
}

.operation-a4-sheet {
  width: 794px;
  min-height: 1123px;
  margin: 0 auto;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 30px 70px rgba(0,0,0,.28);
  padding: 56px 54px 60px;
  font-family: "Times New Roman", Georgia, serif;
  line-height: 1.45;
  border-radius: 8px;
}

.operation-a4-sheet.view {
  margin-top: 0;
}

.operation-doc-topline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.operation-doc-agency {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.operation-doc-agency-main {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.operation-doc-agency-sub {
  font-size: 12px;
  color: #475569;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.operation-doc-meta {
  min-width: 245px;
  font-size: 12px;
  border: 1px solid #cbd5e1;
}

.operation-doc-meta-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  border-bottom: 1px solid #cbd5e1;
}

.operation-doc-meta-row:last-child {
  border-bottom: 0;
}

.operation-doc-meta-k {
  background: #f8fafc;
  font-weight: 700;
  padding: 7px 9px;
  border-right: 1px solid #cbd5e1;
}

.operation-doc-meta-v {
  padding: 7px 9px;
}

.operation-doc-title {
  text-align: center;
  margin: 18px 0 26px;
}

.operation-doc-title-main {
  font-size: 25px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.operation-doc-title-sub {
  margin-top: 6px;
  font-size: 13px;
  color: #475569;
}

.operation-doc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  margin-bottom: 22px;
}

.operation-doc-card {
  border: 1px solid #cbd5e1;
}

.operation-doc-card.full {
  grid-column: 1 / -1;
}

.operation-doc-card-head {
  background: #eef2f7;
  color: #0f172a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-bottom: 1px solid #cbd5e1;
}

.operation-doc-card-body {
  padding: 12px 13px;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
}

.operation-doc-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px dashed #dbe3ec;
}

.operation-doc-row:last-child {
  border-bottom: 0;
}

.operation-doc-row-k {
  font-weight: 700;
}

.operation-doc-list {
  margin: 0;
  padding-left: 18px;
}

.operation-doc-list li {
  margin-bottom: 5px;
}

.operation-doc-footer {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.operation-signature-box {
  padding-top: 34px;
  border-top: 1px solid #334155;
  font-size: 13px;
}

.operation-signature-line {
  font-weight: 700;
}

.operation-signature-sub {
  margin-top: 4px;
  color: #475569;
  font-size: 12px;
}

.operation-doc-watermark {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.operation-report-view-modal,
.operation-report-preview-modal {
  max-width: 1080px;
  width: calc(100vw - 150px);
}

.operation-report-view-body {
  max-height: 78vh;
  overflow: auto;
  padding: 18px;
  background: rgba(10,15,24,.88);
}

.operation-report-modal-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

@media (max-width: 1440px) {
  .operation-reports-stats {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .operation-report-modal-body {
    grid-template-columns: 1fr;
  }

  .operation-preview-sheet-wrap {
    max-height: 560px;
  }
}

@media (max-width: 1100px) {
  .operation-reports-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .operation-reports-header {
    flex-direction: column;
    align-items: stretch;
  }

  .operation-reports-header-actions {
    justify-content: flex-start;
  }

  .operation-reports-stats {
    grid-template-columns: 1fr;
  }
}

/* =========================
   FIX TOOLBAR RECHERCHE
========================= */

.operation-reports-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1.8fr) repeat(5, minmax(140px, .72fr)) auto;
  gap: 10px;
  margin-bottom: 14px;
  align-items: center;
}

.operation-reports-toolbar .input,
.operation-reports-toolbar input,
.operation-reports-toolbar select {
  width: 100%;
  height: 44px;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(11,18,33,.96), rgba(8,14,28,.96));
  color: rgba(255,255,255,.92);
  padding: 0 14px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.operation-reports-toolbar .input::placeholder,
.operation-reports-toolbar input::placeholder {
  color: rgba(255,255,255,.42);
}

.operation-reports-toolbar .input:focus,
.operation-reports-toolbar input:focus,
.operation-reports-toolbar select:focus {
  border-color: rgba(96,165,250,.45);
  box-shadow:
    0 0 0 3px rgba(59,130,246,.12),
    inset 0 1px 0 rgba(255,255,255,.05);
}

.operation-reports-toolbar select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 38px;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,.72) 50%),
    linear-gradient(135deg, rgba(255,255,255,.72) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 19px,
    calc(100% - 12px) 19px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.operation-reports-toolbar button {
  height: 44px;
  white-space: nowrap;
}


/* =========================
   FIX MODALE CREATE SCROLL
========================= */

.operation-report-modal-xxl {
  max-width: 1540px;
  width: calc(100vw - 120px);
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.operation-report-modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(520px, .95fr);
  gap: 18px;
  align-items: start;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.operation-report-form-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  max-height: 100%;
  padding-right: 8px;
}

.operation-report-preview-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.operation-preview-sheet-wrap {
  overflow: auto;
  min-height: 0;
  flex: 1;
  max-height: 100%;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02)),
    rgba(7,11,18,.82);
  padding: 18px;
}

.operation-report-modal-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}


/* =========================
   FIX SCROLLBARS
========================= */

.operation-report-form-col::-webkit-scrollbar,
.operation-preview-sheet-wrap::-webkit-scrollbar,
.operation-report-view-body::-webkit-scrollbar,
.operation-reports-table-wrap::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.operation-report-form-col::-webkit-scrollbar-track,
.operation-preview-sheet-wrap::-webkit-scrollbar-track,
.operation-report-view-body::-webkit-scrollbar-track,
.operation-reports-table-wrap::-webkit-scrollbar-track {
  background: rgba(255,255,255,.04);
  border-radius: 999px;
}

.operation-report-form-col::-webkit-scrollbar-thumb,
.operation-preview-sheet-wrap::-webkit-scrollbar-thumb,
.operation-report-view-body::-webkit-scrollbar-thumb,
.operation-reports-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.16);
  border-radius: 999px;
}

.operation-report-form-col::-webkit-scrollbar-thumb:hover,
.operation-preview-sheet-wrap::-webkit-scrollbar-thumb:hover,
.operation-report-view-body::-webkit-scrollbar-thumb:hover,
.operation-reports-table-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,.24);
}


/* =========================
   FIX APERCU A4 OVERFLOW
========================= */

.operation-a4-sheet {
  width: 794px;
  max-width: 794px;
  min-height: 1123px;
  margin: 0 auto;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 30px 70px rgba(0,0,0,.28);
  padding: 40px 36px 48px;
  font-family: "Times New Roman", Georgia, serif;
  line-height: 1.45;
  border-radius: 8px;
  overflow: hidden;
  word-break: break-word;
}

.operation-a4-sheet *,
.operation-a4-sheet *::before,
.operation-a4-sheet *::after {
  box-sizing: border-box;
}

.operation-doc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px 18px;
  margin-bottom: 22px;
}

.operation-doc-card {
  border: 1px solid #cbd5e1;
  min-width: 0;
  overflow: hidden;
}

.operation-doc-card.full {
  grid-column: 1 / -1;
}

.operation-doc-card-body {
  padding: 12px 13px;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
}

.operation-doc-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px dashed #dbe3ec;
  min-width: 0;
}

.operation-doc-row:last-child {
  border-bottom: 0;
}

.operation-doc-row-k {
  font-weight: 700;
  min-width: 0;
}

.operation-doc-topline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.operation-doc-agency {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.operation-doc-meta {
  width: 245px;
  min-width: 245px;
  max-width: 245px;
  font-size: 12px;
  border: 1px solid #cbd5e1;
  flex-shrink: 0;
}

.operation-doc-footer {
  margin-top: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 30px;
}

.operation-signature-box {
  padding-top: 34px;
  border-top: 1px solid #334155;
  font-size: 13px;
  min-width: 0;
  overflow-wrap: anywhere;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1440px) {
  .operation-report-modal-body {
    grid-template-columns: 1fr;
  }

  .operation-report-form-col {
    max-height: 48vh;
  }

  .operation-preview-sheet-wrap {
    min-height: 420px;
    max-height: 48vh;
  }
}

@media (max-width: 1100px) {
  .operation-reports-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .operation-a4-sheet {
    transform: scale(.88);
    transform-origin: top center;
    margin-bottom: -120px;
  }
}

.operation-report-modal input[type="date"],
.operation-report-modal input[type="datetime-local"] {
  color-scheme: dark;
}

/* =========================
   FIX MODALE DE VUE
========================= */

.operation-report-view-modal,
.operation-report-preview-modal {
  max-width: 1080px;
  width: calc(100vw - 150px);
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.operation-report-view-body {
  flex: 1;
  min-height: 0;
  max-height: unset;
  overflow: auto;
  padding: 18px;
  background: rgba(10,15,24,.88);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.operation-report-view-body .operation-a4-sheet.view {
  width: 794px;
  max-width: 794px;
  min-height: 1123px;
  margin: 0 auto;
  flex-shrink: 0;
  overflow: hidden;
}

/* scrollbar propre dans la vue */
.operation-report-view-body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.operation-report-view-body::-webkit-scrollbar-track {
  background: rgba(255,255,255,.04);
  border-radius: 999px;
}

.operation-report-view-body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.16);
  border-radius: 999px;
}

.operation-report-view-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,.24);
}


/* si écran un peu plus petit, on réduit légèrement la feuille */
@media (max-width: 1100px) {
  .operation-report-view-body .operation-a4-sheet.view {
    transform: scale(.92);
    transform-origin: top center;
    margin-bottom: -90px;
  }
}

@media (max-width: 980px) {
  .operation-report-view-body .operation-a4-sheet.view {
    transform: scale(.82);
    transform-origin: top center;
    margin-bottom: -180px;
  }
}