/* NetBaze — light, minimal, Artlogic-inspired. Lots of whitespace, thin lines. */
:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --line: #e5e7eb;
  --line-soft: #f0f1f3;
  --text: #111827;
  --muted: #6b7280;
  --accent: #2563eb;
  --lock: #b45309;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.55 -apple-system, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* Top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; border-bottom: 1px solid var(--line); background: var(--bg);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; letter-spacing: 1px; font-size: 17px; }
.view-as { color: var(--muted); font-size: 13px; }
.view-as select {
  margin-left: 8px; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px;
}

/* Layout */
.layout {
  display: grid; grid-template-columns: 1fr 300px; gap: 40px;
  max-width: 1160px; margin: 28px auto; padding: 0 28px;
}
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }
h2 { font-size: 15px; margin: 0; font-weight: 600; letter-spacing: .2px; }
h2 small { color: var(--muted); font-weight: 400; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 18px; }
.section-head { display: flex; align-items: center; justify-content: space-between; }

/* Buttons */
.btn {
  background: var(--text); color: #fff; border: 0; border-radius: 6px;
  padding: 8px 15px; font-size: 13px; cursor: pointer; font-weight: 500;
}
.btn:hover { opacity: .9; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: #b91c1c; border: 1px solid #fecaca; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.create-panel .form-actions button[type="button"] { padding: 9px 16px; font-size: 14px; border-radius: 6px; cursor: pointer; }

/* Cards — gallery list */
.cards { display: flex; flex-direction: column; gap: 14px; min-height: 60px; }
.card {
  display: flex; gap: 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; cursor: grab; transition: box-shadow .15s, border-color .15s;
}
.card:hover { box-shadow: 0 1px 6px rgba(17,24,39,.06); border-color: #d1d5db; }
.card.dragging { opacity: .5; border-color: var(--accent); }
.card-body { flex: 1; min-width: 0; }
.thumb {
  width: 92px; height: 92px; flex: 0 0 92px; border-radius: 8px;
  display: flex; align-items: flex-end; justify-content: center;
  font-size: 9px; color: rgba(255,255,255,.9); padding-bottom: 5px;
  text-transform: uppercase; letter-spacing: 1px;
}
.thumb-art { background: linear-gradient(135deg, #7c6ba8, #4b3f78); }
.thumb-estate { background: linear-gradient(135deg, #4a8f86, #2f5d6b); }
.card-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.card .type { color: var(--accent); font-weight: 500; }
.card .state {
  text-transform: uppercase; letter-spacing: .5px; font-size: 10px;
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; color: var(--muted);
}
.artist { font-weight: 600; font-size: 14px; margin-top: 6px; }
.card h3 { margin: 6px 0 12px; font-size: 16px; font-weight: 600; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 20px; }
.f { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.f span { color: var(--muted); }
.hidden {
  margin-top: 12px; font-size: 12px; color: var(--lock);
  border-top: 1px dashed var(--line); padding-top: 9px;
}
.offers { margin-top: 10px; font-size: 12px; color: var(--muted); }
.offers a.mkoffer { color: var(--accent); text-decoration: none; margin-left: 10px; }

/* Create / edit form */
.create-panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 20px 22px; margin: 12px 0 18px;
}
.create-panel .row { display: flex; align-items: center; gap: 12px; margin-bottom: 7px; }
.create-panel label { width: 150px; flex: 0 0 150px; color: var(--muted); font-size: 12.5px; text-align: left; }
.create-panel input, .create-panel select, .create-panel textarea {
  flex: 1; padding: 7px 10px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: 13.5px; font-family: inherit;
}
.create-panel input.chk { flex: 0 0 auto; width: 17px; height: 17px; accent-color: var(--accent); }
.create-panel input:focus, .create-panel select:focus, .create-panel textarea:focus {
  outline: none; border-color: var(--accent);
}
.create-panel button[type="submit"] {
  background: var(--accent); color: #fff; border: 0; border-radius: 6px;
  padding: 9px 18px; cursor: pointer; font-size: 14px; font-weight: 500;
}

/* Tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); margin: 4px 0 18px; }
.create-panel .tab {
  background: transparent; border: 0; border-bottom: 2px solid transparent;
  color: var(--muted); padding: 9px 14px; font-size: 13px; cursor: pointer; border-radius: 0;
}
.create-panel .tab:hover { color: var(--text); }
.create-panel .tab.active { color: var(--text); border-bottom-color: var(--text); font-weight: 500; }
.tabpanel { display: none; }
.tabpanel.active { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 32px; align-items: start; }
.tabpanel .row--full { grid-column: 1 / -1; }
@media (max-width: 720px) { .tabpanel.active { grid-template-columns: 1fr; } }
#create-msg { color: var(--lock); font-size: 13px; }

/* Sensitivity badges */
.sens {
  font-size: 10px; padding: 1px 7px; border-radius: 999px; margin-left: 6px;
  border: 1px solid var(--line); text-transform: lowercase; letter-spacing: 0; font-weight: 500;
}
.sens-public { color: #047857; border-color: #a7f3d0; background: #ecfdf5; }
.sens-internal { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
.sens-restricted { color: #b45309; border-color: #fde68a; background: #fffbeb; }
.sens-confidential { color: #c2410c; border-color: #fed7aa; background: #fff7ed; }
.sens-secret { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }

/* Upload dropzone */
/* Toolbar: view modes, filters, group, hide-prices */
.toolbar { margin: 6px 0 18px; }
.tb-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tb-modes { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.tb-modes button { background: transparent; border: 0; padding: 7px 13px; font-size: 13px; cursor: pointer; color: var(--muted); }
.tb-modes button.on { background: var(--text); color: #fff; }
.toolbar input[type="search"], .toolbar select {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px;
  background: var(--bg); color: var(--text);
}
.toolbar #tb-search { flex: 1; min-width: 150px; }
.tb-hp { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.tb-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.tb-filters select { font-size: 12.5px; }

/* Import box */
.import-box textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 14px; background: var(--bg); color: var(--text); line-height: 1.5;
}
.import-box .row { margin-bottom: 10px; }
.import-box label { color: var(--muted); font-size: 13px; }
.adjust-box textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 14px; background: var(--bg); color: var(--text); line-height: 1.5; margin-bottom: 4px; }
.create-panel .tab.tab-ai { color: var(--accent); font-weight: 500; }

/* Price */
.price { font-weight: 700; }
.muted-price { color: var(--muted); font-weight: 600; letter-spacing: 1px; }
.card h3 .price { color: var(--accent); font-size: 16px; margin-left: 8px; }
.card-thumb { width: 120px; height: 120px; flex: 0 0 120px; }
.card-price { font-weight: 700; color: var(--accent); font-size: 17px; margin-left: 6px; }
.card-eurm2 { font-weight: 400; font-size: 13px; }
.card-summary { color: var(--muted); font-size: 14px; margin: 2px 0 0; }
.card-desc { color: #374151; font-size: 13px; margin-top: 8px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Group headers */
.group-h { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase;
  letter-spacing: .6px; margin: 20px 0 8px; }

/* List mode */
.cards.mode-list { gap: 0; }
.row-card { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border-bottom: 1px solid var(--line-soft); }
.row-card .thumb.tiny { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 6px; }
/* Property rows are photo-forward: larger 3:2 thumbnail (Idealista-style). */
.row-card .thumb.tiny.t-estate { width: 78px; height: 52px; flex: 0 0 78px; }
.rc-main { flex: 1; min-width: 0; }
.rc-title { font-weight: 600; font-size: 14px; }
.rc-sub { color: var(--muted); font-size: 12px; }
.rc-price { width: 120px; text-align: right; font-weight: 700; }
.rc-status { width: 90px; text-align: right; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.row-card .edit { color: var(--accent); text-decoration: none; font-size: 13px; }

/* Gallery grid (Artlogic-style, image-forward) */
.cards.mode-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.cards.mode-gallery .group-h { grid-column: 1 / -1; }
.gallery-card { cursor: pointer; }
.g-img { position: relative; width: 100%; aspect-ratio: 1 / 1; background-size: cover; background-position: center;
  border-radius: 8px; border: 1px solid var(--line); display: flex; align-items: flex-end; }
.g-img .sel { position: absolute; top: 8px; left: 8px; }
.g-ph { color: rgba(255,255,255,.9); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; padding: 8px; }
.g-body { padding: 10px 2px 0; }
.g-artist { font-weight: 700; font-size: 13.5px; }
.g-title { font-size: 14px; margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-title em { font-style: italic; }
.g-sub { color: var(--muted); font-size: 12px; }
.g-meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-top: 6px; }
.g-meta .edit { color: var(--accent); text-decoration: none; }

/* Detail ficha */
.dt-actions { display: flex; gap: 10px; margin-bottom: 18px; }
.dt-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; }
@media (max-width: 720px) { .dt-grid { grid-template-columns: 1fr; } }
.dt-media { border-radius: 12px; min-height: 320px; display: flex; align-items: flex-end;
  justify-content: center; color: rgba(255,255,255,.9); font-size: 11px; letter-spacing: 1px;
  text-transform: uppercase; padding-bottom: 12px; }
.dt-artist { font-weight: 700; font-size: 21px; }
.dt-title { font-size: 18px; margin: 4px 0 10px; }
.dt-line { color: var(--muted); font-size: 14px; margin: 2px 0; }
.dt-price { font-size: 25px; font-weight: 700; margin: 16px 0 4px; }
.dt-facts { font-size: 15px; margin: 6px 0; }
.dt-status { display: inline-block; text-transform: uppercase; font-size: 11px; letter-spacing: .5px;
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; margin-top: 8px; }
.dt-block { margin-top: 18px; }
.dt-block h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 0 0 6px; }
.dt-block p { margin: 0; font-size: 14px; line-height: 1.6; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; }
.muted { color: var(--muted); }
.shared-tag { font-size: 11px; color: #1d4ed8; background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: 999px; padding: 2px 9px; }
.dt-company { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px;
  background: var(--bg); color: var(--text); }
.card h3, .card .thumb, .row-card .rc-main, .gallery-card .g-img, .gallery-card .g-title { cursor: pointer; }

/* Real images — show the whole image, never cropped */
.thumb.has-img { background-size: contain; background-repeat: no-repeat; background-position: center; background-color: #f3f4f6; }
.dt-media.has-img { background-size: contain; background-repeat: no-repeat; background-position: center; background-color: #f3f4f6; }
.g-img.has-img { background-size: contain; background-repeat: no-repeat; background-color: #f3f4f6; }
.dt-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.dt-gthumb { padding-top: 68%; background-size: contain; background-repeat: no-repeat; background-position: center; background-color: #f3f4f6;
  border-radius: 6px; border: 1px solid var(--line); }

/* Media uploader */
.media-field { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.media-list { display: flex; flex-wrap: wrap; gap: 8px; }
.media-thumb { position: relative; width: 74px; height: 74px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.media-thumb img { width: 100%; height: 100%; object-fit: contain; background: #f3f4f6; display: block; }
.media-rm { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.6); color: #fff;
  border: 0; border-radius: 50%; width: 18px; height: 18px; cursor: pointer; font-size: 12px; line-height: 1; }
.media-add { display: flex; gap: 8px; align-items: center; }
.media-add .media-url { flex: 1; }
.media-upload { display: inline-flex; align-items: center; cursor: pointer; }

.dropzone {
  border: 1.5px dashed var(--line); border-radius: 10px; padding: 34px 16px;
  text-align: center; color: var(--muted); transition: .15s; font-size: 14px;
}
.dropzone.over { border-color: var(--accent); color: var(--text); background: #f8faff; }
.uploads { list-style: none; padding: 0; margin: 14px 0 0; }
.uploads li { font-size: 13px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.uploads a { color: var(--accent); text-decoration: none; }

/* ── Matching: requirement ⇄ listings ── */
.matchbtn { color: var(--accent); text-decoration: none; font-weight: 500; white-space: nowrap; }
.matchbtn:hover { text-decoration: underline; }
.match-modal { position: fixed; inset: 0; background: rgba(20,24,28,.42); display: flex;
  align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 1000; }
.mm-box { background: #fff; border-radius: 12px; width: 100%; max-width: 720px; max-height: 84vh;
  display: flex; flex-direction: column; box-shadow: 0 18px 50px rgba(0,0,0,.22); overflow: hidden; }
.mm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--line); }
.mm-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.mm-close { border: 0; background: transparent; font-size: 18px; cursor: pointer; color: var(--muted); line-height: 1; }
.mm-body { padding: 8px 18px 18px; overflow-y: auto; }
.mm-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.mm-item:last-child { border-bottom: 0; }
.mm-score { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 10px; display: flex;
  align-items: center; justify-content: center; font-size: 18px; font-weight: 700; color: #fff; }
.mm-score small { font-size: 10px; font-weight: 600; margin-left: 1px; opacity: .9; }
.mm-score.good { background: #1a8a4a; }
.mm-score.mid { background: #b7791f; }
.mm-score.low { background: #9aa0a6; }
.mm-main { flex: 1; min-width: 0; }
.mm-title { font-weight: 600; font-size: 15px; }
.mm-price { color: var(--muted); font-weight: 500; margin-left: 6px; }
.mm-specs { color: var(--muted); font-size: 13px; margin: 2px 0 6px; }
.mm-reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.mm-reason { font-size: 12px; padding: 2px 8px; border-radius: 20px; border: 1px solid var(--line); }
.mm-reason.ok { color: #1a6b3c; border-color: #bfe3cd; background: #f1f9f4; }
.mm-reason.no { color: #9a3535; border-color: #ecc9c9; background: #fbf2f2; }
.mm-actions { flex: 0 0 auto; }

/* Media uploader note + busy state */
.media-note { color: var(--muted); font-size: 11.5px; margin: 6px 0 0; line-height: 1.4; }
.dropzone.busy { opacity: .6; pointer-events: none; }
.dropzone.busy::after { content: " · optimizing…"; color: var(--accent); }

/* ── Media library ── */
.media-lib { position: fixed; inset: 0; background: rgba(20,24,28,.5); display: flex;
  align-items: flex-start; justify-content: center; padding: 4vh 16px; z-index: 1000; }
.ml-box { background: #fff; border-radius: 12px; width: 100%; max-width: 1180px; height: 90vh;
  display: flex; flex-direction: column; box-shadow: 0 18px 50px rgba(0,0,0,.24); overflow: hidden; }
.ml-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.ml-head h3 { margin: 0; font-size: 16px; font-weight: 600; text-transform: capitalize; }
.ml-close { border: 0; background: transparent; font-size: 18px; cursor: pointer; color: var(--muted); }
.ml-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.ml-tools input[type="search"], .ml-tools select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: var(--bg); color: var(--text); }
.ml-tools #ml-q { flex: 1; min-width: 160px; }
.ml-spacer { flex: 1; }
.ml-selall { font-size: 13px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.ml-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.ml-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.ml-card { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #fff; }
.ml-pick { position: absolute; top: 8px; left: 8px; z-index: 2; background: rgba(255,255,255,.85); border-radius: 4px; padding: 2px; line-height: 0; }
.ml-badge { position: absolute; top: 6px; right: 6px; z-index: 2; background: #1a8a4a; color: #fff; border-radius: 6px; font-size: 12px; padding: 2px 5px; }
.ml-thumb { width: 100%; aspect-ratio: 1 / 1; border-radius: 8px; background-color: #f3f4f6; background-size: contain; background-repeat: no-repeat; background-position: center; }
.ml-name { font-size: 12.5px; font-weight: 500; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.ml-used { font-size: 12px; margin-top: 7px; display: flex; align-items: center; gap: 6px; }
.ml-used .dot { width: 8px; height: 8px; border-radius: 50%; background: #cbd0d6; display: inline-block; }
.ml-used .dot.on { background: #1a8a4a; }
.ml-links { font-size: 12px; margin-top: 3px; line-height: 1.5; }
.ml-links a { color: var(--accent); text-decoration: none; }
.ml-links a:hover { text-decoration: underline; }
.ml-field { color: var(--muted); font-size: 10.5px; text-transform: lowercase; }

/* ── Idealista-style spec strips (beds / baths / m²) ── */
.specs, .card-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.spec { display: inline-flex; align-items: center; gap: 4px; color: var(--text); font-size: 13px; white-space: nowrap; }
.spec .ic { width: 15px; height: 15px; color: var(--muted); flex: 0 0 auto; }
.spec-type { font-weight: 500; color: var(--text); font-size: 13px; text-transform: capitalize; }
.spec-loc { color: var(--muted); font-size: 13px; }
.rc-sub.specs { margin-top: 3px; }
.card-summary .spec, .card-summary .spec-type, .card-summary .spec-loc { font-size: 13px; }
.g-sub.specs { gap: 4px 10px; }
.g-sub.specs .spec { font-size: 12.5px; }

/* ── Lightbox ── */
.dt-media.clickable, .dt-gthumb.clickable { cursor: zoom-in; }
.dt-media { position: relative; }
.dt-zoom { position: absolute; right: 10px; bottom: 10px; background: rgba(17,24,39,.6); color: #fff;
  width: 26px; height: 26px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.lightbox { position: fixed; inset: 0; background: rgba(10,12,15,.9); z-index: 1100;
  display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; }
.lb-stage { grid-column: 2; height: 90vh; display: flex; align-items: center; justify-content: center; padding: 2vh 0; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 8px 40px rgba(0,0,0,.5); }
.lb-nav { background: transparent; border: 0; color: #fff; font-size: 44px; cursor: pointer; opacity: .8; line-height: 1; }
.lb-nav:hover { opacity: 1; }
.lb-prev { grid-column: 1; } .lb-next { grid-column: 3; }
.lb-close { position: absolute; top: 18px; right: 22px; background: transparent; border: 0; color: #fff; font-size: 26px; cursor: pointer; opacity: .85; }
.lb-count { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.8); font-size: 13px; }
@media (max-width: 640px) { .lightbox { grid-template-columns: 40px 1fr 40px; } .lb-nav { font-size: 32px; } }

/* ── Ficha uploader ── */
.dt-photos { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.dt-photos .dt-url { flex: 1; min-width: 140px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: var(--bg); color: var(--text); }
.dt-upmsg { margin: 0; }

/* Photos surfaced at top of the create/edit form */
.media-top { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 4px 0 16px; background: #fafbfc; }
.media-top .row { margin-bottom: 0; align-items: flex-start; }
.media-top .media-thumb { width: 92px; height: 92px; }

/* ── Contracts ── */
.dt-contracts { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.ct-new { display: flex; gap: 8px; margin-bottom: 12px; }
.ct-new select { flex: 1; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: var(--bg); color: var(--text); }
.ct-list { display: flex; flex-direction: column; }
.ct-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.ct-item a { color: var(--accent); text-decoration: none; font-weight: 500; font-size: 14px; }
.ct-meta { color: var(--muted); font-size: 12px; }
.cstat { text-transform: uppercase; letter-spacing: .4px; font-size: 10px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); }
.cstat-draft { color: #6b7280; background: #f3f4f6; }
.cstat-sent { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.cstat-signed { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.cstat-void { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.ct-badge { font-size: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; }
/* Contract modal / editor */
.ct-modal { position: fixed; inset: 0; background: rgba(20,24,28,.5); z-index: 1100; display: flex; align-items: flex-start; justify-content: center; padding: 4vh 16px; }
.ct-box { background: #fff; border-radius: 12px; width: 100%; max-width: 820px; max-height: 92vh; overflow-y: auto; padding: 18px 20px; box-shadow: 0 18px 50px rgba(0,0,0,.24); }
.ct-box.ct-repo { max-width: 720px; }
.ct-head { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 10px; }
.ct-head h3 { margin: 0; font-size: 16px; }
.ct-title { flex: 1; font-size: 15px; font-weight: 600; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; }
.ct-close { border: 0; background: transparent; font-size: 18px; cursor: pointer; color: var(--muted); }
.ct-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.ct-tools .ct-q { flex: 1; min-width: 150px; }
.ct-tools input, .ct-tools select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: var(--bg); color: var(--text); }
.ct-spacer { flex: 1; }
.ct-body, .ct-nt-body, .ct-nt-name { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.6; background: var(--bg); color: var(--text); }
.ct-nt-name { font-family: inherit; margin-bottom: 4px; }
.ct-box code { background: #f3f4f6; padding: 0 4px; border-radius: 4px; font-size: 12px; }
