/* Editor do Overview Semanal — modo edição sobre o relatório e janelas de edição. */
:root {
  --ed-blue: #2563eb;
  --ed-blue-soft: #eef3ff;
  --ed-navy: #002f6c;
  --ed-ink: #192231;
  --ed-body: #4d5868;
  --ed-muted: #7a8699;
  --ed-line: #e1e5eb;
  --ed-line-strong: #cfd5dd;
  --ed-surface: #fff;
  --ed-canvas: #f5f7fa;
  --ed-red: #c93434;
  --ed-red-soft: #fff1f1;
  --ed-green: #0d8a74;
}

/* ---------- Modo edição sobre o documento ---------- */
.ed-banner {
  display: flex; align-items: center; gap: 12px;
  margin: -6px 0 18px; padding: 10px 14px;
  border: 1px solid #c9d8fb; border-radius: 10px; background: var(--ed-blue-soft);
  color: var(--ed-ink); font-size: 12.5px;
  position: sticky; top: 8px; z-index: 5; box-shadow: 0 6px 18px #2563eb14;
}
.ed-banner[hidden] { display: none; }
.ed-banner p { margin: 0; flex: 1; }
.ed-banner-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ed-blue); box-shadow: 0 0 0 4px #2563eb2b; flex: none; }

.ed-block { position: relative; }
.ed-badge {
  display: none; position: absolute; top: 8px; right: 8px; z-index: 4;
  padding: 6px 11px; border: 0; border-radius: 999px;
  background: var(--ed-blue); color: #fff; font: 600 11px/1 'IBM Plex Sans', 'Segoe UI', Arial, sans-serif;
  letter-spacing: .02em; cursor: pointer; box-shadow: 0 6px 16px #2563eb40;
}
.ed-mode .ed-block {
  cursor: pointer; border-radius: 10px;
  outline: 2px dashed #2563eb33; outline-offset: 10px;
  transition: outline-color .15s, background-color .15s;
}
.ed-mode .ed-block:hover, .ed-mode .ed-block:focus-within { outline-color: var(--ed-blue); background-color: #2563eb06; }
.ed-mode .ed-block .ed-badge { display: inline-flex; }
.ed-mode .ed-block * { cursor: pointer; }
.ed-saved { animation: ed-saved 1.6s ease-out; }
@keyframes ed-saved { 0% { background-color: #0d8a7426; } 100% { background-color: transparent; } }

/* ---------- Janela ---------- */
.ed-dialog {
  width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  padding: 0; border: 0; border-radius: 16px; background: var(--ed-surface); color: var(--ed-ink);
  font: 400 13px/1.5 'IBM Plex Sans', 'Segoe UI', Arial, sans-serif;
  box-shadow: 0 30px 90px #0b1b3366;
}
.ed-dialog.ed-wide { width: min(920px, calc(100vw - 32px)); }
.ed-dialog::backdrop { background: #0d2038a8; backdrop-filter: blur(2px); }
.ed-dialog[open] { animation: ed-pop .18s ease-out; }
@keyframes ed-pop { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.ed-shell { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.ed-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 24px 14px; border-bottom: 1px solid var(--ed-line); }
.ed-head h2 { margin: 2px 0 0; font-size: 18px; font-weight: 600; color: var(--ed-navy); }
.ed-kicker { font: 500 10.5px 'IBM Plex Mono', monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--ed-blue); }
.ed-intro { margin: 6px 0 0; color: var(--ed-body); font-size: 12.5px; }
.ed-x { flex: none; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--ed-muted); font-size: 22px; line-height: 1; cursor: pointer; }
.ed-x:hover { background: var(--ed-canvas); color: var(--ed-ink); }
.ed-body { padding: 18px 24px 8px; overflow: auto; flex: 1; background: var(--ed-surface); }
.ed-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 24px; border-top: 1px solid var(--ed-line); background: var(--ed-canvas); border-radius: 0 0 16px 16px; }
.ed-hint { color: var(--ed-muted); font-size: 11px; }
.ed-actions { display: flex; gap: 8px; margin-left: auto; }
.ed-error { margin: 0 24px 12px; padding: 10px 12px; border-radius: 8px; background: var(--ed-red-soft); color: var(--ed-red); font-size: 12.5px; }
.ed-error[hidden] { display: none; }
.ed-discard { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 24px 12px; padding: 10px 12px; border-radius: 8px; background: #fff7e6; color: #7a5200; font-size: 12.5px; }
.ed-discard[hidden] { display: none; }
.ed-discard span { flex: 1; min-width: 180px; }

.ed-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 15px; border: 1px solid var(--ed-line-strong); border-radius: 8px;
  background: #fff; color: var(--ed-ink); font: 600 12px 'IBM Plex Sans', 'Segoe UI', Arial, sans-serif;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.ed-btn:hover { border-color: #aab4c2; background: #fafbfc; }
.ed-btn:disabled { opacity: .6; cursor: progress; }
.ed-primary { border-color: var(--ed-blue); background: var(--ed-blue); color: #fff; }
.ed-primary:hover { border-color: #1d4ed8; background: #1d4ed8; }
.ed-danger { border-color: var(--ed-red); background: var(--ed-red); color: #fff; }
.ed-danger:hover { border-color: #a82a2a; background: #a82a2a; }

/* ---------- Campos ---------- */
.ed-group { margin: 0 0 22px; }
.ed-group h3 { margin: 0 0 12px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ed-muted); }
.ed-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.dk-reprogram-editor{grid-column:1/-1;display:grid;gap:22px;min-width:0}
.dk-reprogram-section{padding:18px;border:1px solid var(--ed-line);border-radius:12px;background:#fff;min-width:0}
.dk-reprogram-section>header{margin-bottom:16px}
.dk-reprogram-section h3{margin:0 0 5px;font-size:15px;font-weight:600;color:var(--ed-ink)}
.dk-reprogram-section>header p{margin:0;font-size:12px;line-height:1.5;color:var(--ed-muted)}
.dk-reprogram-fronts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.dk-reprogram-front{display:grid;gap:12px;padding:16px;border-radius:10px;background:#f5f8fc;min-width:0}
.dk-reprogram-number{font-size:11px;font-weight:600;color:var(--ed-muted)}
.dk-reprogram-more{border-top:1px solid var(--ed-line);padding-top:16px}
.dk-reprogram-more>summary{cursor:pointer;color:var(--ed-blue);font-size:13px;font-weight:600}
.dk-reprogram-more>.ed-grid{margin-top:18px}
@media(max-width:640px){.dk-reprogram-fronts{grid-template-columns:1fr}.dk-reprogram-section{padding:14px}}
.ed-grid-3 { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto; align-items: start; }
.ed-span { grid-column: 1 / -1; }
.ed-field { display: grid; gap: 6px; min-width: 0; margin: 0 0 2px; }
.ed-field[hidden] { display: none; }
.ed-label { font-size: 11.5px; font-weight: 600; color: var(--ed-body); }
.ed-help { color: var(--ed-muted); font-size: 11px; line-height: 1.45; }
.ed-field-error { color: var(--ed-red); font-size: 11px; }
.ed-field-error[hidden] { display: none; }
.ed-dialog input[type=text], .ed-dialog input[type=url], .ed-dialog input[type=date], .ed-dialog textarea {
  width: 100%; min-width: 0; padding: 9px 11px; border: 1px solid var(--ed-line-strong); border-radius: 8px;
  background: #fff; color: var(--ed-ink); font: 400 13px/1.4 'IBM Plex Sans', 'Segoe UI', Arial, sans-serif;
}
.ed-dialog textarea { resize: vertical; min-height: 60px; }
.ed-dialog input:focus, .ed-dialog textarea:focus { outline: 3px solid #2563eb2e; outline-offset: 0; border-color: var(--ed-blue); }
.ed-dialog input.ed-invalid { border-color: var(--ed-red); }
.ed-more { margin: 4px 0 16px; }
.ed-more summary { cursor: pointer; color: var(--ed-blue); font-size: 12px; font-weight: 600; margin-bottom: 10px; }
.ed-check { display: flex; align-items: flex-start; gap: 9px; margin: 14px 0; font-size: 12.5px; color: var(--ed-body); cursor: pointer; }
.ed-check input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--ed-blue); }

/* Percentual: slider + caixa */
.ed-percent { display: flex; align-items: center; gap: 12px; }
.ed-slider { flex: 1; min-width: 80px; height: 6px; appearance: none; border-radius: 99px; background: linear-gradient(90deg, var(--ed-blue) var(--fill, 0%), #e2e7ee var(--fill, 0%)); cursor: pointer; }
.ed-slider::-webkit-slider-thumb { appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--ed-blue); box-shadow: 0 2px 6px #0003; }
.ed-slider::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--ed-blue); }
.ed-percent-box { display: flex; align-items: center; gap: 4px; flex: none; }
.ed-dialog .ed-percent-input { width: 74px; text-align: right; font-variant-numeric: tabular-nums; }
.ed-percent-box span { color: var(--ed-muted); font-weight: 600; }

/* Cores */
.ed-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-swatch { width: 22px; height: 22px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: var(--sw); box-shadow: 0 0 0 1px #0002; cursor: pointer; }
.ed-swatch[aria-checked=true] { box-shadow: 0 0 0 2px var(--ed-ink); }
.ed-swatch:focus-visible { outline: 3px solid #2563eb55; outline-offset: 2px; }
.ed-color-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ed-pill { display: inline-flex; padding: 2px 8px; border-radius: 3px; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--c); background: color-mix(in srgb, var(--c) 9%, #fff); border: .8px solid color-mix(in srgb, var(--c) 28%, #fff); }
.ed-pill-empty { opacity: .45; }

/* Listas */
.ed-list { display: grid; gap: 10px; }
.ed-list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 16px 0 8px; }
.ed-count { font-weight: 600; color: var(--ed-ink); }
.ed-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ed-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--ed-line); border-radius: 12px; background: #fff; transition: box-shadow .15s, border-color .15s; }
.ed-row:hover { border-color: var(--ed-line-strong); box-shadow: 0 4px 14px #1922310d; }
.ed-row.ed-dragging { opacity: .45; }
.ed-row.ed-drop { border-color: var(--ed-blue); box-shadow: 0 0 0 2px #2563eb33; }
.ed-row.ed-moved { animation: ed-saved 1s ease-out; }
.ed-row-side { display: grid; justify-items: center; gap: 4px; padding-top: 4px; }
.ed-handle { color: #a7b0bd; font-size: 14px; letter-spacing: -2px; cursor: grab; user-select: none; }
.ed-handle:active { cursor: grabbing; }
.ed-row-n { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--ed-canvas); color: var(--ed-muted); font: 600 10.5px 'IBM Plex Mono', monospace; }
.ed-row-tools { display: flex; flex-direction: column; gap: 4px; }
.ed-icon { width: 28px; height: 28px; padding: 0; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--ed-muted); font-size: 13px; cursor: pointer; }
.ed-icon:hover:not(:disabled) { background: var(--ed-canvas); border-color: var(--ed-line); color: var(--ed-ink); }
.ed-icon:disabled { opacity: .3; cursor: default; }
.ed-icon-danger:hover:not(:disabled) { background: var(--ed-red-soft); border-color: #f3caca; color: var(--ed-red); }
.ed-add { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 11px; border: 1.5px dashed var(--ed-line-strong); border-radius: 12px; background: transparent; color: var(--ed-blue); font: 600 12.5px 'IBM Plex Sans', 'Segoe UI', Arial, sans-serif; cursor: pointer; }
.ed-add span { font-size: 16px; line-height: 1; }
.ed-add:hover:not(:disabled) { border-color: var(--ed-blue); background: var(--ed-blue-soft); }
.ed-add:disabled { opacity: .5; cursor: default; }
.ed-empty { margin: 0; padding: 18px; border-radius: 12px; background: var(--ed-canvas); color: var(--ed-muted); text-align: center; font-size: 12.5px; }
.ed-empty[hidden] { display: none; }

/* Fotos */
.ed-paste-box { display: flex; gap: 10px; align-items: stretch; padding: 12px; border: 1.5px dashed #b8c8ee; border-radius: 12px; background: var(--ed-blue-soft); }
.ed-dialog .ed-paste { flex: 1; min-height: 44px; border-color: #c9d8fb; }
.ed-photo { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; align-items: start; }
.ed-thumb { aspect-ratio: 4 / 3; border-radius: 9px; overflow: hidden; background: #e4e9ef; display: grid; place-items: center; color: var(--ed-muted); font-size: 11px; text-align: center; }
.ed-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ed-photo-fields { display: grid; gap: 10px; }

/* Capa */
.ed-logo-row { display: flex; align-items: center; gap: 10px; }
.ed-logo-row input { flex: 1; }
.ed-logo-preview { flex: none; width: 72px; height: 40px; display: grid; place-items: center; border: 1px solid var(--ed-line); border-radius: 7px; background: #fff; color: var(--ed-muted); font-size: 9.5px; text-align: center; overflow: hidden; }
.ed-logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Avanço */
.ed-front { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 14px; align-items: start; }

/* HSE */
.ed-safety-layout { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 20px; align-items: start; }
.ed-safety-card { display: grid; gap: 10px; padding: 16px; border-radius: 12px; background: var(--ed-canvas); text-align: center; }
.ed-safety { display: grid; gap: 4px; }
.ed-safety strong { font-size: 40px; font-weight: 500; line-height: 1; color: var(--ed-green); letter-spacing: -.03em; }
.ed-safety span { font-size: 11.5px; color: var(--ed-body); }

/* Qualidade */
.ed-quality { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: start; }
.ed-q-icon { width: 36px; height: 36px; margin-top: 20px; display: grid; place-items: center; border-radius: 50%; color: #fff; font-size: 17px; font-weight: 600; }

/* Informativo, link público */
.ed-info p { margin: 0 0 10px; color: var(--ed-body); font-size: 13px; line-height: 1.6; }
.ed-link-row { display: flex; gap: 8px; margin: 10px 0 14px; }
.ed-dialog .ed-link { flex: 1; font: 400 12px 'IBM Plex Mono', monospace; background: var(--ed-canvas); }

/* Aviso rápido */
.ed-toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 1000; transform: translateX(-50%);
  padding: 11px 18px; border-radius: 10px; background: #13233a; color: #fff;
  font: 500 12.5px 'IBM Plex Sans', 'Segoe UI', Arial, sans-serif; box-shadow: 0 14px 40px #0b1b3355;
  animation: ed-toast-in .2s ease-out;
}
.ed-toast-ok::before { content: '✓'; margin-right: 8px; color: #5ee0c4; font-weight: 700; }
.ed-toast-out { opacity: 0; transition: opacity .4s; }
@keyframes ed-toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (max-width: 700px) {
  .ed-grid, .ed-grid-3, .ed-front, .ed-safety-layout { grid-template-columns: 1fr; }
  .ed-photo { grid-template-columns: 96px minmax(0, 1fr); }
  .ed-row { grid-template-columns: 26px minmax(0, 1fr) auto; padding: 10px; }
  .ed-head, .ed-body, .ed-foot { padding-left: 16px; padding-right: 16px; }
  .ed-hint { display: none; }
  .ed-paste-box, .ed-link-row { flex-direction: column; }
  .ed-q-icon { margin-top: 0; }
  .ed-banner { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .ed-dialog[open], .ed-saved, .ed-row.ed-moved, .ed-toast { animation: none; }
}
@media print {
  .ed-banner, .ed-badge, .ed-toast { display: none !important; }
  .ed-mode .ed-block { outline: none !important; background: none !important; }
}

/* ---------- Galeria ---------- */
.ed-btn-sm { padding: 6px 10px; font-size: 11.5px; }
.ed-btn-ghost { border-color: transparent; background: transparent; color: var(--ed-muted); }
.ed-btn-ghost:hover { background: var(--ed-canvas); border-color: var(--ed-line); }
.ed-source { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ed-source > input { flex: 1; min-width: 180px; }
.ed-source-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 7px; background: var(--ed-blue-soft); color: #1d4ed8; font-size: 12px; font-weight: 600; }
.ed-paste-box.ed-drag-over, .ed-dropzone.ed-drag-over { border-color: var(--ed-blue); background: #dfe8ff; }
.ed-gallery-btn { flex: none; }

.ed-tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 10px; border-radius: 10px; background: var(--ed-canvas); width: fit-content; }
.ed-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 0; border-radius: 7px; background: transparent; color: var(--ed-body); font: 600 12.5px 'IBM Plex Sans', 'Segoe UI', Arial, sans-serif; cursor: pointer; }
.ed-tab[aria-selected=true] { background: #fff; color: var(--ed-navy); box-shadow: 0 1px 4px #19223119; }
.ed-tab-n { min-width: 20px; padding: 1px 6px; border-radius: 99px; background: #e6eaf0; color: var(--ed-muted); font: 600 10.5px 'IBM Plex Mono', monospace; text-align: center; }
.ed-tab[aria-selected=true] .ed-tab-n { background: var(--ed-blue-soft); color: var(--ed-blue); }
.ed-gallery-note { margin: 0 0 12px; }

.ed-dropzone { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 18px; border: 1.5px dashed #b8c8ee; border-radius: 12px; background: var(--ed-blue-soft); color: var(--ed-ink); text-align: left; cursor: pointer; font: inherit; transition: background .15s, border-color .15s; }
.ed-dropzone:hover { border-color: var(--ed-blue); }
.ed-dropzone-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: none; border-radius: 10px; background: #fff; color: var(--ed-blue); font-size: 18px; box-shadow: 0 2px 6px #2563eb1f; }
.ed-dropzone strong { display: block; font-size: 13px; }
.ed-dropzone small { display: block; margin-top: 2px; color: var(--ed-muted); font-size: 11px; }

.ed-gallery-bar { display: flex; align-items: center; gap: 12px; margin: 14px 0 12px; flex-wrap: wrap; }
.ed-dialog .ed-search { flex: 0 1 300px; padding: 8px 11px; border: 1px solid var(--ed-line-strong); border-radius: 8px; font: 400 12.5px 'IBM Plex Sans', 'Segoe UI', Arial, sans-serif; }
.ed-gallery-status { flex: 1; margin: 0; font-size: 12px; color: var(--ed-muted); }
.ed-gallery-status[data-tone=ok] { color: var(--ed-green); }
.ed-gallery-status[data-tone=error] { color: var(--ed-red); }

.ed-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; min-height: 120px; }
.ed-gallery-grid > .ed-empty, .ed-gallery-grid > .ed-error { grid-column: 1 / -1; }
.ed-tile { position: relative; margin: 0; display: grid; border: 1px solid var(--ed-line); border-radius: 12px; overflow: hidden; background: #fff; transition: box-shadow .15s, border-color .15s; }
.ed-tile:hover { border-color: var(--ed-line-strong); box-shadow: 0 6px 18px #1922311a; }
.ed-tile.ed-selected { border-color: var(--ed-blue); box-shadow: 0 0 0 2px var(--ed-blue); }
.ed-tile-img { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; padding: 0; border: 0; background: #e8ecf1; cursor: pointer; overflow: hidden; }
.ed-tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ed-tile-check { position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; border: 2px solid #fff; background: #0005; color: #fff; font-size: 13px; font-weight: 700; box-shadow: 0 1px 4px #0004; }
.ed-selected .ed-tile-check { background: var(--ed-blue); }
.ed-tile-badge { position: absolute; top: 8px; right: 8px; padding: 3px 8px; border-radius: 99px; background: #0d8a74e6; color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .03em; pointer-events: none; }
.ed-tile figcaption { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 8px; }
.ed-dialog .ed-tile-caption { flex: 1; min-width: 0; padding: 5px 6px; border: 1px solid transparent; border-radius: 6px; background: transparent; font-size: 12px; }
.ed-dialog .ed-tile-caption:hover { border-color: var(--ed-line); }
.ed-tile-tools { display: flex; flex: none; }
.ed-tile-tools .ed-icon { width: 26px; height: 26px; font-size: 12px; }
.ed-tile-confirm { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px; background: var(--ed-red-soft); font-size: 12px; color: var(--ed-red); }
.ed-tile-confirm span { flex: 1; min-width: 100%; }
.ed-tile-busy figcaption { display: grid; gap: 2px; padding: 8px 10px; }
.ed-tile-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.ed-tile-busy small { color: var(--ed-blue); font-size: 11px; }
.ed-spinner { width: 26px; height: 26px; border: 3px solid #cfd9ea; border-top-color: var(--ed-blue); border-radius: 50%; animation: ed-spin .8s linear infinite; }
@keyframes ed-spin { to { transform: rotate(360deg); } }
.ed-preview img { display: block; max-width: 100%; max-height: 68vh; margin: 0 auto 12px; border-radius: 8px; object-fit: contain; }
.ed-preview p { text-align: center; }

@media (max-width: 700px) {
  .ed-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ed-tabs { width: 100%; }
  .ed-tab { flex: 1; justify-content: center; }
  .ed-dialog .ed-search { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { .ed-spinner { animation-duration: 2.4s; } }

/* Botão "Galeria da obra" na tela da obra: só para quem edita. */
.ed-work-actions { display: flex; align-items: center; gap: 16px; }
.ed-work-gallery { display: none; }
body.report-editor .ed-work-gallery { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Janelas com fotos: mais largas e em grade ---------- */
.ed-dialog.ed-xwide { width: min(1180px, calc(100vw - 32px)); }
.ed-xwide .ed-body { padding-left: 28px; padding-right: 28px; }

/* Fotos do relatório em cartões: miniatura grande em cima, campos embaixo. */
.ed-rows-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.ed-rows-grid .ed-row { position: relative; grid-template-columns: 1fr; gap: 0; padding: 0; overflow: hidden; }
.ed-rows-grid .ed-row-body { min-width: 0; }
.ed-rows-grid .ed-row-side { position: absolute; top: 8px; left: 8px; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 3px 7px 3px 5px; border-radius: 99px; background: #0d2038b3; }
.ed-rows-grid .ed-handle { color: #fff; }
.ed-rows-grid .ed-row-n { width: 20px; height: 20px; background: #fff; color: var(--ed-navy); }
.ed-rows-grid .ed-row-tools { position: absolute; top: 8px; right: 8px; z-index: 2; flex-direction: row; gap: 2px; padding: 2px; border-radius: 9px; background: #ffffffeb; box-shadow: 0 2px 8px #0d203833; opacity: .9; }
.ed-rows-grid .ed-row:hover .ed-row-tools, .ed-rows-grid .ed-row:focus-within .ed-row-tools { opacity: 1; }
.ed-rows-grid .ed-photo { grid-template-columns: 1fr; gap: 0; }
.ed-rows-grid .ed-thumb { width: 100%; aspect-ratio: 4 / 3; border-radius: 0; border: 0; padding: 0; cursor: zoom-in; }
.ed-rows-grid .ed-thumb:hover img { transform: scale(1.03); }
.ed-rows-grid .ed-thumb img { transition: transform .3s; }
.ed-rows-grid .ed-photo-fields { padding: 12px; gap: 10px; }
.ed-rows-grid .ed-source { gap: 6px; }
.ed-rows-grid .ed-source-chip { font-size: 11px; padding: 5px 8px; }
.ed-rows-grid .ed-source > input { min-width: 0; }
.ed-rows-grid + .ed-add { margin-top: 2px; }
.ed-thumb { display: grid; place-items: center; width: 100%; padding: 0; border: 0; font: inherit; cursor: zoom-in; }

/* Galeria: miniaturas maiores. */
.ed-xwide .ed-gallery-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }

@media (max-width: 700px) {
  .ed-rows-grid { grid-template-columns: 1fr; }
  .ed-xwide .ed-body { padding-left: 16px; padding-right: 16px; }
  .ed-xwide .ed-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { .ed-rows-grid .ed-thumb img { transition: none; } }

/* ---------- Dados automáticos (Curva S / efetivo) ---------- */
.ed-auto { display: grid; gap: 12px; }
.ed-note { display: grid; gap: 2px; padding: 10px 12px; border-radius: 9px; border-left: 3px solid; font-size: 12px; line-height: 1.5; }
.ed-note strong { font-size: 12.5px; }
.ed-note-ok { border-color: var(--ed-green); background: #eaf7f3; color: #0b5d4f; }
.ed-note-warn { border-color: #d9911a; background: #fff6e6; color: #7a5200; }
.ed-note-info { border-color: var(--ed-blue); background: var(--ed-blue-soft); color: #1d3f8f; }
.ed-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ed-stat { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--ed-line); border-radius: 10px; background: #fff; }
.ed-stat span { font-size: 11px; color: var(--ed-muted); font-weight: 600; }
.ed-stat strong { font-size: 22px; font-weight: 500; color: var(--ed-navy); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ed-stat-neg strong { color: var(--ed-red); }
.ed-stat-pos strong { color: var(--ed-green); }

.ed-weeks { display: grid; gap: 10px; }
.ed-week { display: grid; grid-template-columns: 150px minmax(0, 1fr) 170px; align-items: center; gap: 12px; font-size: 12.5px; }
.ed-week-label { display: grid; font-weight: 600; color: var(--ed-ink); }
.ed-week-label small { font-weight: 400; color: #946000; font-size: 10.5px; }
.ed-week-bar { display: flex; height: 18px; border-radius: 4px; background: #eef1f5; overflow: hidden; }
.ed-week-bar i, .ed-legend i { display: block; height: 100%; }
.ed-bar-mod { background: #002f6c; }
.ed-bar-moi { background: #00c8d7; }
.ed-week-n { color: var(--ed-muted); font-variant-numeric: tabular-nums; }
.ed-week-n b { color: var(--ed-ink); font-size: 14px; }
.ed-legend { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 11px; color: var(--ed-muted); }
.ed-legend i { width: 12px; height: 12px; border-radius: 3px; margin-left: 8px; }
.ed-legend i:first-child { margin-left: 0; }
.ed-dialog .ed-hours-input { max-width: 220px; text-align: right; font-variant-numeric: tabular-nums; }

.ed-banner-sync { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #1d3f8f; }
.ed-banner-sync:empty { display: none; }
.ed-publish-status { display: grid; gap: 8px; margin-top: 12px; }
.ed-toast-error { background: #7a1f1f; }

@media (max-width: 700px) {
  .ed-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ed-week { grid-template-columns: 1fr; gap: 4px; }
}

/* Horas do projeto */
.ed-stats-1 { grid-template-columns: minmax(0, 300px); }
.ed-calc { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: 12px; color: var(--ed-body); font-variant-numeric: tabular-nums; }
.ed-baseline { display: grid; gap: 10px; padding: 14px; border: 1px dashed var(--ed-line-strong); border-radius: 10px; background: var(--ed-canvas); }
.ed-baseline .ed-help { margin: 0; }

/* Avisos de limite do PDF (fotos/entregas) */
.ed-count-warn { color: #946000 !important; }

/* Presença, salvamento e reservas de edição. */
#detail-view { padding-bottom: 24px; }
.ed-presence { display: flex; gap: 4px; align-items: center; font-size: 12px; }
.ed-save-status { font-size: 12px; display: flex; align-items: center; gap: 6px; }
.dk-lock-owner { display: block; color: #865400; font-size: 11px; grid-column: 1 / -1; }
.ed-avatar { display: grid; place-items: center; border-radius: 50%; background: #002f6c; color: white; width: 30px; height: 30px; flex-shrink: 0; font-weight: 600; }

/* Menu de ações nos cards da lista (seletores com .document-bottom para vencer ".document-bottom button") */
.document-bottom{position:relative}
.document-bottom .ed-card-more{display:inline-flex;align-items:center;justify-content:center;flex:none;width:30px;height:30px;padding:0;border:1px solid var(--line,#e4e7ec);border-radius:6px;background:#fff;color:var(--ink,#192231);font-size:18px;line-height:1;cursor:pointer}
.document-bottom .ed-card-more:hover,.document-bottom .ed-card-more[aria-expanded="true"]{background:#f1f3f7}
.document-bottom .ed-card-more:focus-visible{outline:3px solid #2563eb33;outline-offset:0;border-color:var(--mse-blue,#2563eb)}
.document-bottom .ed-card-menu{position:absolute;right:0;bottom:38px;z-index:20;min-width:210px;display:grid;padding:5px;background:#fff;border:1px solid var(--line,#e4e7ec);border-radius:8px;box-shadow:0 10px 28px rgba(25,34,49,.16)}
.document-bottom .ed-card-menu button{display:block;width:100%;border:0;background:none;text-align:left;padding:9px 10px;border-radius:5px;font-size:12px;font-weight:500;color:var(--ink,#192231);cursor:pointer}
.document-bottom .ed-card-menu button:hover:not(:disabled){background:#f1f3f7}
.document-bottom .ed-card-menu button:disabled{color:#98a1b0;cursor:not-allowed}
.document-bottom .ed-card-menu .ed-danger:not(:disabled){color:#d23b3b}
