/* Quote popup: the Tekst and Izgled tabs, the template picker and the page preview. */
#quoteModal [hidden] { display: none !important; }
#confirmModal.open { z-index: 200; }

.modal-quote { transition: width var(--duration-normal, 200ms) ease; }
.modal-quote.is-look { width: min(1280px, 96vw); }

.quote-tabs { display: flex; gap: 4px; padding: 10px 24px 0; border-bottom: 1px solid var(--border); }
.quote-tab { position: relative; padding: 8px 14px 10px; border: 0; background: none; color: var(--text2); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.quote-tab:hover { color: var(--fg); }
.quote-tab.active { color: var(--indigo); }
.quote-tab.active::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--indigo); }
.quote-tab:focus-visible { outline: 2px solid var(--indigo); outline-offset: -2px; border-radius: 6px; }

.quote-arrange { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.quote-arrange-status { color: var(--text2); font-size: 12.5px; }
.quote-arrange-hint { margin: 8px 0 0; color: var(--text2); font-size: 12px; line-height: 1.5; }

.quote-look-empty { max-width: 460px; margin: 0 auto; padding: 56px 16px; text-align: center; }
.quote-look-empty h3 { margin: 0 0 8px; font-size: 16px; }
.quote-look-empty p { margin: 0; color: var(--text2); font-size: 13.5px; line-height: 1.55; }
.quote-look-empty .quote-arrange { justify-content: center; margin-top: 18px; }

/* Side panel beside the pages */
.modal-body.quote-look { padding: 0; overflow: hidden; }
.quote-look-work { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: min(74vh, 860px); }
.quote-look-side { padding: 16px 18px 20px; border-right: 1px solid var(--border); overflow-y: auto; }
.quote-look-side h3 { margin: 18px 0 8px; color: var(--text2); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.quote-look-side h3:first-child { margin-top: 0; }

.q-thumbs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.q-thumb { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 6px 7px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--fg); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease; }
.q-thumb:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.q-thumb:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }
.q-thumb.is-selected { border-color: var(--indigo); box-shadow: 0 0 0 1px var(--indigo); color: var(--indigo); }
.q-thumb-page { display: block; width: 111px; height: 157px; overflow: hidden; border-radius: 4px; background: #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.08); pointer-events: none; }
.q-thumb-page .quote-doc { zoom: 0.14; }

.q-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.q-preset { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px 0 7px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--fg); font: inherit; font-size: 12px; cursor: pointer; }
.q-preset:hover { border-color: var(--border-strong); }
.q-preset:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }
.q-preset.is-selected { border-color: var(--indigo); box-shadow: 0 0 0 1px var(--indigo); }
.q-preset-dots { width: 24px; height: 12px; border-radius: 999px; background: linear-gradient(90deg, var(--dot-a) 0 34%, var(--dot-b) 34% 67%, var(--dot-c) 67%); }
.q-color-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.q-color-input { display: flex; flex-direction: column; gap: 4px; color: var(--text2); font-size: 11.5px; cursor: pointer; }
.q-color-input input { width: 100%; height: 30px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; }

.q-notice { margin-top: 14px; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.45; }
.q-notice-warn { background: color-mix(in srgb, var(--amber) 12%, var(--surface)); color: var(--fg); }
.q-notice-bad { background: color-mix(in srgb, var(--rose) 12%, var(--surface)); color: var(--fg); }
.q-notice-check { border: 1px solid color-mix(in srgb, var(--rose) 45%, var(--border)); background: color-mix(in srgb, var(--rose) 6%, var(--surface)); }
.q-notice-check h4 { margin: 0 0 8px; font-size: 13px; }
.q-notice-check .btn-secondary { margin-top: 8px; }
.q-check-row { margin-top: 6px; }
.q-check-row strong { display: block; margin-bottom: 3px; font-weight: 600; }
.q-check-item { display: inline-block; margin: 0 2px 2px 0; padding: 0 6px; border-radius: 5px; font-variant-numeric: tabular-nums; }
.q-check-bad .q-check-item { background: color-mix(in srgb, var(--rose) 18%, var(--surface)); font-weight: 600; }
.q-check-warn .q-check-item { background: color-mix(in srgb, var(--amber) 16%, var(--surface)); }

.quote-side-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* The pages */
.quote-preview { position: relative; padding: 20px; overflow: auto; background: #6b6b74; }
.quote-preview-pages .q-page { margin: 0 auto 18px; box-shadow: 0 6px 24px rgb(0 0 0 / 0.28); }
.quote-preview-pages .q-page:last-child { margin-bottom: 0; }
.q-block { display: contents; }
.q-edit { border-radius: 2px; outline: 1px solid transparent; outline-offset: 1px; cursor: text; }
.q-edit:hover { outline: 1px dashed currentColor; }
.q-edit:focus { outline: 2px solid currentColor; }
.q-edit:empty { display: inline-block; min-width: 24px; min-height: 1em; }

.quote-block-bar { position: absolute; z-index: 3; display: flex; gap: 1px; padding: 2px; border-radius: 8px; background: #1b1b22; box-shadow: 0 4px 14px rgb(0 0 0 / 0.35); transform: translateY(-60%); }
.quote-block-bar button { width: 26px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: none; color: #fff; font-size: 13px; line-height: 1; cursor: pointer; }
.quote-block-bar button:hover { background: rgb(255 255 255 / 0.18); }
.quote-block-bar button.is-danger:hover { background: #be123c; }
.quote-block-bar button:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }

@media (max-width: 900px) {
  .quote-look-work { display: block; height: auto; }
  .modal-body.quote-look { overflow: auto; }
  .quote-look-side { border-right: 0; border-bottom: 1px solid var(--border); overflow: visible; }
  .q-thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .q-thumb-page { width: 100%; max-width: 111px; }
  .quote-preview { padding: 12px; overflow: hidden auto; max-height: 80vh; }
}

@media (prefers-reduced-motion: reduce) {
  .modal-quote, .q-thumb { transition: none; }
  .q-thumb:hover { transform: none; }
}
