/* Styles for the extension modules (modal, portal, wizard, map, payments, consultations, notifications, viewer, fact sheet, admin) */

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 30, 55, .45); display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal { background: var(--card); border-radius: 12px; width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { width: min(820px, 100%); }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-h .icon-btn { border: 0; background: none; cursor: pointer; font-size: 15px; }
.modal-b { padding: 16px 18px; overflow-y: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: #fafbfd; border-radius: 0 0 12px 12px; }
.modal .docs, .modal .doc-row { margin-top: 12px; }
button.icon-btn { border: 0; background: transparent; cursor: pointer; }
.icon-btn.sm { width: 26px; height: 26px; }
.icon-btn.sm .ic { width: 15px; height: 15px; }
.icon-btn:disabled { opacity: .3; cursor: default; }

/* ---------- forms ---------- */
.field.wide { grid-column: 1 / -1; }
.field textarea, .stack textarea, .card > textarea { border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; width: 100%; min-height: 70px; resize: vertical; }
.field textarea:disabled { background: #f7f8fb; border-color: var(--line-2); }
.field.err input, .field.err select, .field.err textarea, .doc-row.err { border-color: var(--bad) !important; background: #fff6f5; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 4px; font-size: 13px; color: var(--ink-2); }
.check input { margin-top: 4px; }
.actions.end { justify-content: flex-end; margin-top: 16px; }
.inline-field { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.inline-field input { border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; }
.note.inset { margin: 0 18px 12px; }
.pad { padding: 14px 18px; }
.full-sel { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
tr.dim td { opacity: .5; }
.tabs em.hot { background: var(--warn); color: #fff; }
.clip { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c { text-align: center !important; }

/* ---------- public signup ---------- */
.signup-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px dashed #9db4d6; border-radius: 10px; color: var(--ink); background: var(--primary-soft); margin-top: 6px; }
.signup-link .ic { color: var(--primary); }
.signup-link span { flex: 1; font-size: 13px; }
.public { width: 100%; min-height: 100vh; background: var(--bg); }
.public-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand-inline { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand-inline .brand-mark { width: 30px; height: 30px; }
.signup { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 32px; max-width: 1180px; margin: 0 auto; padding: 36px 24px; align-items: start; }
.signup h1 { font-size: 26px; margin: 6px 0 10px; line-height: 1.4; }
.steps-v { list-style: none; padding: 0; margin: 20px 0; display: flex; flex-direction: column; gap: 12px; }
.steps-v li { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.steps-v span { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; }
.success-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px; }
.success-card .checklist { text-align: left; margin: 8px 0; }
.big-check { width: 56px; height: 56px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-size: 28px; font-weight: 700; margin-bottom: 6px; }

/* ---------- wizard ---------- */
.wiz-steps { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.wiz-steps > div { flex: 1; min-width: 140px; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 9px; background: var(--card); border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.wiz-steps span { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 11.5px; font-weight: 700; flex: none; }
.wiz-steps .cur { border-color: var(--primary-2); color: var(--primary); font-weight: 600; box-shadow: 0 0 0 3px var(--primary-soft); }
.wiz-steps .cur span { border-color: var(--primary); }
.wiz-steps .done { color: var(--ink); }
.wiz-steps .done span { background: var(--ok); border-color: var(--ok); color: #fff; }
.wiz-card { max-width: 920px; }

/* ---------- consultations ---------- */
.q-text { font-size: 14px; line-height: 1.7; white-space: pre-wrap; margin: 4px 0 12px; }
.card.reply { border-left: 4px solid var(--info); }
.clist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.clist a { display: block; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; color: var(--ink); font-size: 13px; }
.clist a:hover { background: #f7f9fc; }
.clist small { display: block; margin-top: 3px; }

/* ---------- features ---------- */
.completeness { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; }
.completeness > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.completeness .meter { width: 160px; }
.completeness.ok { background: var(--ok-soft); } .completeness.warn { background: var(--warn-soft); }
.feat-in { width: 100%; min-width: 120px; border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; text-align: right; font-weight: 600; }
.feat-in.missing { border-color: #e0b44a; background: #fffaf0; }
.blank.miss { color: #946400; }
.note.link-note.warn { background: var(--warn-soft); color: #7a5200; }

/* ---------- map ---------- */
.map-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.map-side { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.map-side select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; }
.seg.full { display: flex; } .seg.full button { flex: 1; }
.map-list { display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow-y: auto; border-top: 1px solid var(--line-2); padding-top: 8px; }
.map-item { display: flex; gap: 10px; align-items: center; text-align: left; border: 0; background: transparent; padding: 7px 8px; border-radius: 7px; cursor: pointer; }
.map-item:hover, .map-item.on { background: var(--primary-soft); }
.map-item i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.map-item b { display: block; font-size: 13px; font-weight: 500; }
.map-card { margin: 0; }
#map { height: 640px; width: 100%; background: #e8eef6; }
.map-offline { height: 100%; display: grid; place-items: center; align-content: center; color: var(--muted); gap: 6px; }
.map-offline .ic { width: 40px; height: 40px; }
.map-pop { font-family: inherit; font-size: 12.5px; line-height: 1.6; }
.map-pop span { color: #666; }
.leaflet-container { font-family: inherit; }

/* ---------- cooperation ---------- */
.mini-sel { border: 1px solid var(--line); border-radius: 20px; padding: 2px 8px; font-size: 12px; font-weight: 600; background: #fff; }
.mini-sel.st-approved { background: var(--ok-soft); color: var(--ok); } .mini-sel.st-review { background: var(--warn-soft); color: #946400; }
.mini-sel.st-submitted { background: var(--info-soft); color: var(--info); }
.coop .btn.full { margin-top: 10px; }
.alloc-sum { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; background: var(--primary-soft); border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.alloc-sum.bad { background: var(--bad-soft); color: var(--bad); }
.alloc-sum .meter { width: 180px; }
.mw-in { width: 90px; border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; text-align: right; }
.alloc-add { display: flex; gap: 8px; margin-top: 12px; }
.alloc-add select { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }

/* ---------- notifications ---------- */
.nlist { list-style: none; margin: 0; padding: 0; }
.nlist li { border-top: 1px solid var(--line-2); }
.nlist a { display: flex; align-items: center; gap: 12px; padding: 12px 18px; color: var(--ink); }
.nlist a:hover { background: #f7f9fc; }
.nlist li.read a { color: var(--ink-2); }
.nlist li:not(.read) .n-t { font-weight: 600; }
.n-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.n-ic.bad { background: var(--bad-soft); color: var(--bad); } .n-ic.warn { background: var(--warn-soft); color: #946400; }
.n-ic.info { background: var(--info-soft); color: var(--info); } .n-ic.ok { background: var(--ok-soft); color: var(--ok); }
.n-t { flex: 1; font-size: 13.5px; } .n-t small { display: block; font-weight: 400; }
.dot-new { width: 9px; height: 9px; border-radius: 50%; background: var(--primary-2); }
.tpl-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.email { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.email-h { padding: 10px 14px; background: #fafbfd; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; }
.email-h span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; }
.email-b { padding: 16px; font-size: 13.5px; line-height: 1.8; }
.email mark, .sms mark { background: #fff1c2; color: #7a5200; border-radius: 3px; padding: 0 2px; }
.sms { margin-top: 12px; padding: 10px 14px; background: #eef4ec; border-radius: 14px; font-size: 13px; display: flex; gap: 10px; align-items: baseline; max-width: 520px; }
.sms span { font-size: 11px; font-weight: 700; color: var(--ok); }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 20px; transition: .15s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--primary-2); }
.switch input:checked + span::before { transform: translateX(16px); }
.switch input:disabled + span { opacity: .5; cursor: default; }

/* ---------- document viewer ---------- */
.doc-view { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.viewer { background: #525a66; border-radius: var(--radius); padding: 0 0 24px; overflow: hidden; }
.viewer-bar { display: flex; gap: 18px; justify-content: center; color: #e6e9ef; font-size: 12.5px; padding: 8px; background: #3d444f; }
.paper { position: relative; background: #fff; width: min(620px, 92%); aspect-ratio: 1 / 1.414; margin: 24px auto 0; padding: 7% 8%; box-shadow: 0 4px 20px rgba(0,0,0,.3); overflow: hidden; display: flex; flex-direction: column; gap: 9px; }
.paper .watermark { position: absolute; inset: 0; display: grid; place-items: center; font-size: 72px; font-weight: 800; color: rgba(194, 55, 43, .08); transform: rotate(-30deg); pointer-events: none; }
.paper-org { font-weight: 700; color: var(--primary); text-align: center; margin: 0; }
.paper-no { font-size: 11.5px; color: var(--muted); text-align: right; margin: 0 0 8px; }
.paper-title { text-align: center; font-size: 17px; margin: 6px 0 0; }
.paper-sub { text-align: center; color: var(--ink-2); font-size: 12.5px; margin: 0 0 10px; }
.paper .line { display: block; height: 7px; border-radius: 4px; background: #e3e8f0; }
.paper-sign { margin-top: auto; align-self: flex-end; width: 50%; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.dwg { flex: 1; display: grid; place-items: center; }
.dwg svg { width: 100%; }
.versions { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 6px; }
.versions button { width: 100%; text-align: left; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; background: #fff; cursor: pointer; }
.versions li.on button { border-color: var(--primary-2); background: var(--primary-soft); }
.versions small { display: block; }
.tok { color: var(--ok); }

/* ---------- fact sheet ---------- */
.fs-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.factsheet { background: #fff; max-width: 900px; margin: 0 auto; padding: 32px 36px; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.factsheet header { display: flex; justify-content: space-between; gap: 16px; border-bottom: 3px solid var(--primary); padding-bottom: 14px; margin-bottom: 16px; }
.factsheet header h1 { font-size: 26px; margin-top: 4px; }
.factsheet header p { color: var(--ink-2); margin: 2px 0 0; }
.fs-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.fs-badges b { font-size: 22px; }
.fs-steps { margin-bottom: 18px; }
.fs-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.fs-cols h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--primary); margin: 0 0 6px; }
.fs-cols h3:not(:first-child) { margin-top: 16px; }
.fs-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.fs-tbl th { text-align: left; font-weight: 500; color: var(--ink-2); padding: 6px 8px 6px 0; width: 42%; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.fs-tbl td { padding: 6px 0; border-bottom: 1px solid var(--line-2); font-weight: 600; }
.factsheet footer { margin-top: 20px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  .side, .top, .no-print, .toast, .crumb, .page-head .actions, .viewer-bar, .doc-view aside { display: none !important; }
  #app { display: block; }
  .content { padding: 0; max-width: none; }
  .factsheet { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .stepper .st { min-width: 30px; }
  .doc-view { display: block; } .viewer { background: none; padding: 0; } .paper { box-shadow: none; width: 100%; margin: 0; }
}

/* ---------- admin ---------- */
.se-tbl input:not([type="checkbox"]), .se-tbl select { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; background: #fff; }
.se-tbl input:disabled { background: #f7f8fb; }
.se-tbl td { padding: 5px 6px; }
.import-drop { text-align: center; padding: 40px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; border: 2px dashed #b9c9e3; }
.import-drop > .ic { width: 40px; height: 40px; color: var(--primary); }

@media (max-width: 1180px) {
  .doc-view, .map-layout, .tpl-layout { grid-template-columns: 1fr; }
  #map { height: 480px; }
}
@media (max-width: 860px) {
  .signup, .fs-cols, .form-grid.three { grid-template-columns: 1fr; }
  .public-top { padding: 10px 16px; }
  .signup { padding: 20px 16px; }
  .factsheet { padding: 18px; }
  .factsheet header { flex-direction: column; }
  .fs-badges { align-items: flex-start; }
  .modal-b .form-grid { grid-template-columns: 1fr; }
  .clip { max-width: 180px; }
}
.pay-tbl td:first-child { min-width: 190px; }
.pay-tbl td:nth-child(2) { min-width: 150px; }
