/* =========================================================
   Developer panel (developers.php + js/developers.js), body.dp-page.
   Loaded after theme.css / home.css / pages.css: palette and fonts are the
   brand's (TG green + gold, AP blue + gold), nothing is hard-coded here.
   ========================================================= */

.dp-page { background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
.dp-page .footer { margin-top: auto; }
.dp-page [hidden] { display: none !important; }

/* ---------- Top bar ---------- */
.dp-top {
  position: sticky; top: 0; z-index: 60; padding-top: env(safe-area-inset-top);
  background: rgba(255, 255, 255, 0.9); -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--divider);
}
.dp-top-in { max-width: var(--container); margin: 0 auto; padding: 0 20px; height: 64px; display: flex; align-items: center; gap: 18px; }
.dp-logo img { height: 38px; width: auto; }
.dp-product {
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-600);
  padding: 4px 10px; border-radius: 999px; background: var(--gold-soft); white-space: nowrap;
}
.dp-nav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.dp-nav::-webkit-scrollbar { display: none; }
.dp-nav a {
  padding: 8px 12px; border-radius: 10px; font-size: 14.5px; font-weight: 600; color: var(--muted); white-space: nowrap;
  transition: background-color 0.2s, color 0.2s;
}
.dp-nav a:hover { color: var(--text); background: var(--bg); }
.dp-nav a.active { color: var(--forest-deep); background: var(--forest-soft); }
.dp-account { margin-left: auto; position: relative; }
.dp-account-btn {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--divider); background: var(--surface);
  padding: 5px 10px 5px 5px; border-radius: 999px; max-width: 260px;
}
.dp-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: var(--forest); color: #fff; font-weight: 700; font-size: 13px; overflow: hidden;
}
.dp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dp-account-btn span.who { display: flex; flex-direction: column; line-height: 1.15; text-align: left; min-width: 0; }
.dp-account-btn b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-account-btn small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); border: 1px solid var(--divider);
  border-radius: 14px; box-shadow: var(--shadow-md); padding: 6px; z-index: 70;
}
.dp-menu a, .dp-menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; border-radius: 9px; font-size: 14px; color: var(--text); }
.dp-menu a:hover, .dp-menu button:hover { background: var(--bg); }
.dp-menu hr { border: 0; border-top: 1px solid var(--divider); margin: 6px 4px; }

/* ---------- Layout ---------- */
.dp-main { width: 100%; max-width: var(--container); margin: 0 auto; padding: 28px 20px 56px; flex: 1; }
.dp-boot { text-align: center; padding: 80px 0; color: var(--muted); }
.dp-spin { width: 40px; height: 40px; margin: 0 auto 16px; border-radius: 50%; border: 4px solid var(--forest-soft); border-top-color: var(--forest); border-right-color: var(--gold); animation: dp-sp 0.9s linear infinite; }
.dp-spin.sm { width: 18px; height: 18px; border-width: 3px; margin: 0; display: inline-block; vertical-align: -3px; }
@keyframes dp-sp { to { transform: rotate(360deg); } }

.dp-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.dp-head h1 { font-family: var(--font-display); font-size: clamp(26px, 3vw, 34px); font-weight: 600; letter-spacing: -0.015em; color: var(--forest-deeper); }
.dp-head p { color: var(--muted); margin-top: 4px; }
.dp-head .dp-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dp-crumb { font-size: 13.5px; color: var(--muted); margin-bottom: 6px; display: inline-flex; gap: 6px; align-items: center; }
.dp-crumb a { color: var(--forest); font-weight: 600; }

.dp-card { background: var(--surface); border: 1px solid var(--divider); border-radius: 20px; padding: 24px; box-shadow: var(--shadow-sm); }
.dp-card + .dp-card { margin-top: 18px; }
.dp-card h2 { font-family: var(--font-display); font-size: 21px; font-weight: 600; color: var(--forest-deeper); margin-bottom: 4px; }
.dp-card h3 { font-size: 15.5px; font-weight: 700; margin: 18px 0 8px; }
.dp-card .dp-lead { color: var(--muted); font-size: 14.5px; margin-bottom: 16px; }
.dp-narrow { max-width: 520px; margin: 0 auto; }
.dp-grid { display: grid; gap: 14px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dp-grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dp-grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dp-grid .span2 { grid-column: span 2; }
.dp-grid .full { grid-column: 1 / -1; }
.dp-muted { color: var(--muted); }
.dp-small { font-size: 13px; }
.dp-empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.dp-empty svg { width: 54px; height: 54px; color: var(--gold); margin: 0 auto 12px; }
.dp-empty h3 { color: var(--text); font-size: 18px; margin-bottom: 6px; }

/* ---------- Forms ---------- */
.dp-field { display: block; min-width: 0; }
.dp-field > label, .dp-field > .lbl { display: block; font-weight: 600; font-size: 13.5px; color: var(--text); margin-bottom: 6px; }
.dp-field .opt { font-weight: 500; color: var(--muted); font-size: 12px; }
.dp-page input[type=text], .dp-page input[type=email], .dp-page input[type=tel], .dp-page input[type=number], .dp-page input[type=url],
.dp-page input[type=month], .dp-page input[type=search], .dp-page input:not([type]), .dp-page select, .dp-page textarea {
  width: 100%; padding: 11px 13px; border: 1px solid #cfd9cf; border-radius: 11px; font: inherit; font-size: 15px;
  color: var(--text); background: #fff; transition: border-color 0.2s, box-shadow 0.2s; min-width: 0;
}
.dp-page textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.dp-page select {
  -webkit-appearance: none; appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23667' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
.dp-page input:focus, .dp-page select:focus, .dp-page textarea:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 4px rgba(var(--brand-rgb), 0.14); }
.dp-page input:disabled, .dp-page select:disabled, .dp-page textarea:disabled { background: #f4f6f4; color: #8a948c; }
.dp-field .hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; line-height: 1.45; }
.dp-field .ferr { display: none; font-size: 13px; color: #b3261e; margin-top: 5px; font-weight: 600; }
.dp-field.has-error input, .dp-field.has-error select, .dp-field.has-error textarea, .has-error .dp-map { border-color: #d93025 !important; box-shadow: 0 0 0 4px rgba(217, 48, 37, 0.12); }
.dp-field.has-error .ferr, .has-error > .ferr { display: block; }
.dp-prefix { display: flex; align-items: stretch; }
.dp-prefix > span { display: grid; place-items: center; padding: 0 11px; border: 1px solid #cfd9cf; border-right: 0; border-radius: 11px 0 0 11px; background: var(--bg); color: var(--muted); font-size: 14px; font-weight: 600; }
.dp-prefix > input { border-radius: 0 11px 11px 0 !important; }
.dp-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; cursor: pointer; }
.dp-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--forest); flex-shrink: 0; }
.dp-code-input { font-size: 28px !important; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.dp-count { float: right; font-weight: 500; font-size: 12px; color: var(--muted); }
.dp-count.low { color: #b3261e; }

/* ---------- Buttons ---------- */
.dp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 12px;
  border: 1.5px solid transparent; font-weight: 700; font-size: 14.5px; line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: linear-gradient(135deg, var(--forest), var(--forest-deep)); color: #fff; transition: transform 0.2s var(--ease), box-shadow 0.2s, opacity 0.2s, background-color 0.2s;
}
.dp-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 22px -12px rgba(var(--deeper-rgb), 0.7); }
.dp-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.dp-btn.gold { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #2b2105; }
.dp-btn.secondary { background: #fff; color: var(--forest-deep); border-color: var(--forest); }
.dp-btn.secondary:hover:not(:disabled) { background: var(--forest-soft); }
.dp-btn.ghost { background: transparent; color: var(--forest-deep); border-color: var(--divider); }
.dp-btn.ghost:hover:not(:disabled) { background: var(--bg); box-shadow: none; }
.dp-btn.danger { background: #fff; color: #b3261e; border-color: #f0c4c0; }
.dp-btn.danger:hover:not(:disabled) { background: #fdecea; box-shadow: none; }
.dp-btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.dp-btn.block { width: 100%; }
.dp-link { background: none; border: 0; padding: 0; color: var(--forest); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.dp-link:disabled { color: var(--muted); cursor: default; text-decoration: none; }

/* ---------- Notices ---------- */
.dp-note { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; margin-bottom: 16px; }
.dp-note svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.dp-note b { font-weight: 700; }
.dp-note.info { background: var(--forest-soft); border: 1px solid var(--info-border); color: var(--forest-deep); }
.dp-note.warn { background: #fff8e6; border: 1px solid #f3d98f; color: #6d5410; }
.dp-note.error { background: #fdecea; border: 1px solid #f5c2bd; color: #8c1d18; }
.dp-note.ok { background: #e7f6ea; border: 1px solid #b9e0c1; color: #1f5d2c; }
.dp-note .dp-btn { margin-top: 8px; }
.dp-err { display: none; color: #8c1d18; font-size: 14px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #fdecea; border: 1px solid #f5c2bd; }
.dp-err.show { display: block; }

/* ---------- Badges ---------- */
.dp-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; border: 1px solid transparent; }
.dp-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dp-badge.nodot::before { display: none; }
.dp-badge.draft { background: #eef1ee; color: #4b564e; }
.dp-badge.in_review { background: #e8f0fe; color: #1a4fa0; }
.dp-badge.rejected { background: #fdecea; color: #a1231b; }
.dp-badge.awaiting_plan { background: #fff4dc; color: #7a5600; }
.dp-badge.live { background: #e3f4e5; color: #1d6b2b; }
.dp-badge.expired { background: #f1ecf7; color: #5b3d82; }
.dp-badge.hidden { background: #3a3f3c; color: #fff; }
.dp-badge.suspended { background: #fdecea; color: #a1231b; border-color: #f5c2bd; }
.dp-badge.tier { background: var(--gold-soft); color: #6b5212; }
.dp-badge.sponsored { background: #fff; color: var(--muted); border-color: var(--divider); }

/* ---------- Dashboard ---------- */
.dp-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.dp-tile { background: var(--surface); border: 1px solid var(--divider); border-radius: 16px; padding: 14px 16px; }
.dp-tile small { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.dp-tile b { display: block; font-family: var(--font-display); font-size: 30px; font-weight: 600; color: var(--forest-deeper); line-height: 1.2; font-variant-numeric: tabular-nums; }
.dp-projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.dp-proj { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--divider); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow 0.25s, transform 0.25s var(--ease); }
.dp-proj:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.dp-proj-cover { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(140deg, var(--forest-deep), var(--forest-deeper)); overflow: hidden; display: block; }
.dp-proj-cover img { width: 100%; height: 100%; object-fit: cover; }
.dp-proj-cover .ph { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(var(--on-dark-rgb), 0.6); font-size: 13px; }
.dp-proj-cover .ph svg { width: 44px; height: 44px; margin: 0 auto 6px; display: block; color: var(--gold-light); }
.dp-proj-cover .dp-badge { position: absolute; left: 12px; top: 12px; box-shadow: 0 4px 12px -4px rgba(0,0,0,0.35); }
.dp-proj-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.dp-proj-body h3 { font-size: 18px; font-weight: 700; line-height: 1.25; color: var(--forest-deeper); }
.dp-proj-body h3 a:hover { color: var(--forest); }
.dp-proj-meta { font-size: 13.5px; color: var(--muted); }
.dp-proj-status { font-size: 13.5px; padding: 9px 11px; border-radius: 11px; background: var(--bg); line-height: 1.45; }
.dp-proj-status.warn { background: #fff8e6; color: #6d5410; }
.dp-proj-status.error { background: #fdecea; color: #8c1d18; }
.dp-proj-status.ok { background: #e7f6ea; color: #1f5d2c; }
.dp-proj-nums { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.dp-proj-nums b { color: var(--text); font-variant-numeric: tabular-nums; }
.dp-proj-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }

/* ---------- Editor ---------- */
.dp-editor { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; align-items: start; }
.dp-index { position: sticky; top: 140px; display: grid; gap: 2px; }
.dp-index a { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
.dp-index a:hover { background: var(--surface); color: var(--text); }
.dp-index a .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--divider); flex-shrink: 0; }
.dp-index a.done .dot { background: var(--forest); }
.dp-index a.bad .dot { background: #d93025; }
.dp-sec { scroll-margin-top: 140px; }
.dp-savebar {
  position: sticky; top: 64px; z-index: 40; margin: -6px 0 18px; padding: 10px 14px; border-radius: 16px;
  background: rgba(255,255,255,0.95); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--divider); box-shadow: var(--shadow-sm); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
}
.dp-savebar .title { font-weight: 700; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.dp-savebar .status { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.dp-savebar .status.dirty { color: #7a5600; }
.dp-savebar .status.err { color: #b3261e; }
.dp-savebar .spacer { flex: 1; }
.dp-savebar .btns { display: flex; flex-wrap: wrap; gap: 8px; }
.dp-checklist { display: grid; gap: 6px; margin: 4px 0 0; }
.dp-checklist li { display: flex; gap: 9px; align-items: center; font-size: 14px; }
.dp-checklist li::before { content: ""; width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; border: 2px solid var(--divider); }
.dp-checklist li.ok { color: var(--muted); }
.dp-checklist li.ok::before { background: var(--forest) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 12px no-repeat; border-color: var(--forest); }
.dp-checklist li a { color: var(--forest); font-weight: 600; }

.dp-rows { display: grid; gap: 10px; }
.dp-row { display: grid; gap: 8px; grid-template-columns: minmax(130px, 1.4fr) repeat(2, minmax(70px, 0.8fr)) minmax(90px, 0.8fr) repeat(2, minmax(90px, 1fr)) minmax(64px, 0.6fr) 40px; align-items: end; padding: 12px; border: 1px solid var(--divider); border-radius: 14px; background: var(--row-alt); }
.dp-row.survey { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px; }
.dp-row .dp-field > label { font-size: 12px; margin-bottom: 4px; }
.dp-row input, .dp-row select { padding: 9px 10px !important; font-size: 14px !important; }
.dp-row.has-error { border-color: #d93025; background: #fff6f5; }
.dp-row .ferr { grid-column: 1 / -1; display: none; font-size: 13px; color: #b3261e; font-weight: 600; }
.dp-row.has-error .ferr { display: block; }
.dp-iconbtn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--divider); background: #fff; color: var(--muted); }
.dp-iconbtn:hover { color: #b3261e; border-color: #f0c4c0; background: #fdecea; }
.dp-iconbtn svg { width: 17px; height: 17px; }

.dp-amen-group + .dp-amen-group { margin-top: 14px; }
.dp-amen-group h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold-600); margin-bottom: 8px; }
.dp-amen { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.dp-amen label { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid var(--divider); border-radius: 11px; font-size: 14px; cursor: pointer; background: #fff; transition: border-color 0.15s, background-color 0.15s; }
.dp-amen label:hover { border-color: var(--forest); }
.dp-amen input { width: 17px; height: 17px; accent-color: var(--forest); }
.dp-amen label:has(input:checked) { border-color: var(--forest); background: var(--forest-soft); font-weight: 600; }

.dp-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 7px; border: 1px solid #cfd9cf; border-radius: 11px; background: #fff; min-height: 46px; align-items: center; }
.dp-chips:focus-within { border-color: var(--forest); box-shadow: 0 0 0 4px rgba(var(--brand-rgb), 0.14); }
.dp-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 11px; border-radius: 999px; background: var(--forest-soft); color: var(--forest-deep); font-size: 13.5px; font-weight: 600; }
.dp-chip button { width: 20px; height: 20px; border-radius: 50%; border: 0; background: transparent; color: inherit; display: grid; place-items: center; font-size: 15px; line-height: 1; }
.dp-chip button:hover { background: rgba(0,0,0,0.08); }
.dp-chips input { border: 0 !important; box-shadow: none !important; flex: 1; min-width: 140px; padding: 6px !important; }

/* Map */
/* Leaflet 1.9 blends tiles with plus-lighter, which draws bright hairlines
   along tile edges on hi-DPI screens: blend normally instead. */
.dp-map.leaflet-container img.leaflet-tile { mix-blend-mode: normal; }
.dp-map.leaflet-container { background: #24332a; }
.dp-map { height: 440px; border-radius: 16px; border: 1px solid var(--divider); overflow: hidden; background: #dfe7dd; z-index: 0; }
.dp-maptools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.dp-seg { display: inline-flex; border: 1px solid var(--divider); border-radius: 11px; overflow: hidden; background: #fff; }
.dp-seg button { border: 0; background: none; padding: 8px 13px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.dp-seg button + button { border-left: 1px solid var(--divider); }
.dp-seg button.on { background: var(--forest); color: #fff; }
.dp-maphint { font-size: 13px; color: var(--muted); margin-top: 8px; }
.dp-locate { margin-top: 10px; font-size: 14px; }
.dp-pin-vertex { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--gold); box-shadow: 0 1px 3px rgba(0,0,0,0.4); }
.dp-pin-vertex.first { width: 18px; height: 18px; border-width: 4px; cursor: pointer; animation: dp-pulse 1.4s ease-in-out infinite; }
@keyframes dp-pulse { 50% { transform: scale(1.25); } }

/* Media */
.dp-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.dp-tilemedia { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: #e9eee8; border: 1px solid var(--divider); cursor: grab; user-select: none; }
.dp-tilemedia img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.dp-tilemedia.dragging { opacity: 0.4; }
.dp-tilemedia.over { outline: 3px dashed var(--gold); outline-offset: 2px; }
.dp-tilemedia .cover { position: absolute; left: 8px; top: 8px; background: var(--gold); color: #2b2105; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; letter-spacing: 0.04em; }
.dp-tilemedia .tools { position: absolute; right: 6px; bottom: 6px; display: flex; gap: 4px; }
.dp-tilemedia .tools button { width: 30px; height: 30px; border-radius: 9px; border: 0; background: rgba(255,255,255,0.92); color: #333; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
.dp-tilemedia .tools button:hover { background: #fff; color: #b3261e; }
.dp-tilemedia .tools svg { width: 15px; height: 15px; }
.dp-tilemedia.uploading { cursor: default; display: grid; place-items: center; padding: 10px; text-align: center; font-size: 12px; color: var(--muted); }
.dp-tilemedia.uploading.failed { background: #fdecea; color: #8c1d18; }
.dp-progress { width: 100%; height: 6px; border-radius: 6px; background: #d5ddd4; overflow: hidden; margin-top: 8px; }
.dp-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--forest), var(--gold)); transition: width 0.2s; }
.dp-drop {
  aspect-ratio: 4 / 3; border-radius: 12px; border: 2px dashed #c3d0c2; display: grid; place-items: center; text-align: center;
  color: var(--forest-deep); font-size: 13px; font-weight: 600; cursor: pointer; background: #fff; padding: 10px; transition: border-color 0.2s, background-color 0.2s;
}
.dp-drop:hover, .dp-drop.over { border-color: var(--forest); background: var(--forest-soft); }
.dp-drop svg { width: 26px; height: 26px; margin: 0 auto 4px; display: block; color: var(--gold-600); }
.dp-drop small { display: block; font-weight: 500; color: var(--muted); margin-top: 2px; }
.dp-filebox { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--divider); border-radius: 12px; background: #fff; }
.dp-filebox .ic { width: 44px; height: 44px; border-radius: 10px; background: var(--gold-soft); color: var(--gold-600); display: grid; place-items: center; flex-shrink: 0; overflow: hidden; }
.dp-filebox .ic img { width: 100%; height: 100%; object-fit: cover; }
.dp-filebox .nm { flex: 1; min-width: 0; font-size: 14px; }
.dp-filebox .nm a { color: var(--forest); font-weight: 600; word-break: break-all; }

/* ---------- Tables ---------- */
.dp-tablewrap { overflow-x: auto; border: 1px solid var(--divider); border-radius: 16px; background: var(--surface); }
.dp-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.dp-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--row-alt); padding: 11px 14px; border-bottom: 1px solid var(--divider); white-space: nowrap; }
.dp-table td { padding: 12px 14px; border-bottom: 1px solid var(--divider); vertical-align: top; }
.dp-table tr:last-child td { border-bottom: 0; }
.dp-table td.num, .dp-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.dp-table .msg { max-width: 320px; white-space: pre-wrap; word-break: break-word; color: var(--body-text); font-size: 13.5px; }
.dp-table select { padding: 6px 30px 6px 9px !important; font-size: 13.5px !important; width: auto !important; }
.dp-contact { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.dp-contact a { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 8px; font-size: 12.5px; font-weight: 700; border: 1px solid var(--divider); }
.dp-contact a.call { color: var(--forest-deep); }
.dp-contact a.wa { color: #12723a; border-color: #bfe5cc; background: #effaf2; }
.dp-contact svg { width: 13px; height: 13px; }
.dp-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.dp-filters select { width: auto; min-width: 180px; }
.dp-filters .spacer { flex: 1; }
.dp-pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: 14px; color: var(--muted); }

/* ---------- Plans ---------- */
.dp-tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.dp-tier { background: var(--surface); border: 1.5px solid var(--divider); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.dp-tier.featured { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(var(--gold-rgb), 0.15); }
.dp-tier.spotlight { background: radial-gradient(circle at 90% 0%, rgba(var(--gold-rgb), 0.18), transparent 50%), var(--surface); border-color: var(--forest); }
.dp-tier h3 { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--forest-deeper); margin: 0; }
.dp-tier .what { font-size: 14px; color: var(--muted); line-height: 1.5; }
.dp-plan { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--divider); border-radius: 14px; cursor: pointer; background: #fff; transition: border-color 0.15s, background-color 0.15s; }
.dp-plan:hover { border-color: var(--forest); }
.dp-plan.sel { border-color: var(--forest); background: var(--forest-soft); }
.dp-plan input { width: 18px; height: 18px; accent-color: var(--forest); flex-shrink: 0; }
.dp-plan .pl { flex: 1; min-width: 0; }
.dp-plan .pl b { display: block; font-size: 15px; }
.dp-plan .pl small { display: block; font-size: 12.5px; color: var(--muted); }
.dp-plan .pr { font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--forest-deep); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dp-paybar { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; justify-content: space-between; padding: 16px 18px; border-radius: 18px; color: #fff; background: radial-gradient(circle at 90% 0%, rgba(var(--gold-rgb), 0.45), transparent 50%), linear-gradient(140deg, var(--forest-deep), var(--forest-deeper)); }
.dp-paybar .sum { font-size: 14px; color: rgba(var(--on-dark-rgb), 0.85); }
.dp-paybar .sum b { display: block; font-family: var(--font-display); font-size: 28px; font-weight: 600; color: var(--gold-light); }
.dp-success { text-align: center; padding: 30px 10px 10px; }
.dp-success .tick { width: 64px; height: 64px; border-radius: 50%; background: #e3f4e5; color: #1d6b2b; display: grid; place-items: center; margin: 0 auto 14px; }
.dp-success .tick svg { width: 34px; height: 34px; }

/* ---------- Stats chart (small multiples, one axis each) ---------- */
.dp-charts { display: grid; gap: 18px; }
.dp-chart { position: relative; }
.dp-chart h3 { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 6px; font-size: 14.5px; font-weight: 700; }
.dp-chart h3 span { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--forest-deeper); font-variant-numeric: tabular-nums; }
.dp-chart svg { width: 100%; height: 130px; display: block; overflow: visible; }
.dp-chart .grid line { stroke: var(--divider); stroke-width: 1; }
.dp-chart .axis text { font-size: 10.5px; fill: var(--muted); font-family: var(--font-sans); }
.dp-chart rect.bar { fill: var(--forest); }
.dp-chart rect.hit { fill: transparent; cursor: crosshair; }
.dp-chart rect.bar.on { fill: var(--gold); }
.dp-tip { position: absolute; pointer-events: none; transform: translate(-50%, -100%); background: var(--forest-deeper); color: #fff; padding: 6px 10px; border-radius: 9px; font-size: 12.5px; white-space: nowrap; box-shadow: var(--shadow-md); z-index: 5; }
.dp-tip b { font-variant-numeric: tabular-nums; }

/* ---------- Auth ---------- */
.dp-auth { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 40px; align-items: center; padding: 20px 0; }
.dp-pitch .pill { display: inline-flex; padding: 6px 14px; border-radius: 999px; background: var(--gold-soft); color: #6b5212; font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 16px; }
.dp-pitch h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(32px, 4.2vw, 50px); line-height: 1.08; letter-spacing: -0.02em; color: var(--forest-deeper); }
.dp-pitch > p { font-size: 17px; color: var(--muted); margin: 16px 0 24px; max-width: 560px; }
.dp-pitch ul { display: grid; gap: 14px; }
.dp-pitch li { display: flex; gap: 12px; align-items: flex-start; }
.dp-pitch li .ic { width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px; display: grid; place-items: center; background: var(--forest-soft); color: var(--forest-deep); }
.dp-pitch li .ic svg { width: 20px; height: 20px; }
.dp-pitch li b { display: block; font-size: 15.5px; }
.dp-pitch li span { color: var(--muted); font-size: 14px; }
.dp-authcard { background: var(--surface); border: 1px solid var(--divider); border-radius: 26px; padding: 30px 28px; box-shadow: var(--shadow-md); }
.dp-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border-radius: 13px; padding: 4px; margin-bottom: 22px; }
.dp-tabs a { text-align: center; padding: 9px; border-radius: 10px; font-weight: 700; font-size: 14.5px; color: var(--muted); }
.dp-tabs a.on { background: #fff; color: var(--forest-deep); box-shadow: var(--shadow-sm); }
.dp-authcard h2 { font-family: var(--font-display); font-size: 25px; font-weight: 600; color: var(--forest-deeper); margin-bottom: 6px; }
.dp-authcard .dp-lead { color: var(--muted); font-size: 14.5px; margin-bottom: 18px; }
.dp-authcard form { display: grid; gap: 14px; }
.dp-authcard .fine { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin-top: 4px; }
.dp-authcard .fine a { color: var(--forest); font-weight: 600; }
.dp-invite-co { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; background: var(--forest-soft); margin-bottom: 18px; }
.dp-invite-co .ic { width: 46px; height: 46px; border-radius: 12px; background: var(--forest); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; flex-shrink: 0; }
.dp-invite-co b { display: block; font-size: 17px; color: var(--forest-deeper); }
.dp-invite-co span { font-size: 13.5px; color: var(--muted); }

/* ---------- Profile / team ---------- */
.dp-logo-edit { display: flex; gap: 16px; align-items: center; }
.dp-logo-edit .lg { width: 84px; height: 84px; border-radius: 18px; background: var(--bg); border: 1px solid var(--divider); display: grid; place-items: center; overflow: hidden; color: var(--muted); font-size: 12px; text-align: center; }
.dp-logo-edit .lg img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.dp-team li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--divider); }
.dp-team li:last-child { border-bottom: 0; }
.dp-team .who { flex: 1; min-width: 0; }
.dp-team .who b { display: block; }
.dp-team .who small { color: var(--muted); font-size: 13px; word-break: break-all; }

/* ---------- Invoice ---------- */
.dp-invoice { max-width: 820px; margin: 0 auto; background: #fff; border: 1px solid var(--divider); border-radius: 18px; padding: 40px 44px; color: #1d231f; font-size: 14px; line-height: 1.5; }
.dp-invoice .ihead { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; border-bottom: 2px solid var(--forest-deeper); padding-bottom: 18px; margin-bottom: 18px; }
.dp-invoice .ihead img { height: 44px; width: auto; margin-bottom: 8px; }
.dp-invoice h1 { font-size: 22px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--forest-deeper); text-align: right; }
.dp-invoice .meta { text-align: right; font-size: 13.5px; }
.dp-invoice .parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 20px; }
.dp-invoice .parties h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: #6b736d; margin-bottom: 4px; }
.dp-invoice .parties p { white-space: pre-line; }
.dp-invoice table { width: 100%; border-collapse: collapse; margin: 6px 0 14px; }
.dp-invoice th, .dp-invoice td { border: 1px solid #d5dad6; padding: 9px 11px; text-align: left; vertical-align: top; }
.dp-invoice th { background: #f2f5f2; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.dp-invoice .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dp-invoice tr.total td { font-weight: 800; font-size: 15px; background: #f7f9f7; }
.dp-invoice .words { font-size: 13.5px; margin-bottom: 14px; }
.dp-invoice .foot { margin-top: 26px; font-size: 12px; color: #6b736d; border-top: 1px solid #e1e6e2; padding-top: 12px; }

/* ---------- Modal + toasts ---------- */
.dp-modal-wrap { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(10, 25, 18, 0.5); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); animation: dp-fade 0.2s ease; }
@keyframes dp-fade { from { opacity: 0; } to { opacity: 1; } }
.dp-modal { background: #fff; border-radius: 22px; width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow: auto; padding: 26px 24px 22px; box-shadow: var(--shadow-lg); animation: dp-pop 0.3s var(--ease); }
@keyframes dp-pop { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.dp-modal h3 { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--forest-deeper); margin-bottom: 8px; }
.dp-modal p { color: var(--body-text); font-size: 14.5px; margin-bottom: 12px; line-height: 1.55; }
.dp-modal form { display: grid; gap: 14px; }
.dp-modal .btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.dp-modal.center { text-align: center; }
.dp-modal.center .btns { justify-content: center; }
.dp-toasts { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.dp-toast { pointer-events: auto; background: var(--forest-deeper); color: #fff; padding: 12px 16px; border-radius: 14px; font-size: 14.5px; box-shadow: var(--shadow-lg); animation: dp-pop 0.3s var(--ease); display: flex; gap: 10px; align-items: flex-start; }
.dp-toast.error { background: #8c1d18; }
.dp-toast.ok::before { content: "✓"; font-weight: 900; color: var(--gold-light); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .dp-editor { grid-template-columns: minmax(0, 1fr); }
  .dp-index { display: none; }
  .dp-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dp-auth { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .dp-pitch ul { display: none; }
  .dp-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dp-row > .dp-field:first-child { grid-column: 1 / -1; }
  .dp-row > .dp-iconbtn { justify-self: end; }
}
@media (max-width: 760px) {
  .dp-top-in { gap: 10px; padding: 0 12px; height: auto; min-height: 56px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 0; }
  .dp-logo img { height: 32px; }
  .dp-product { font-size: 10.5px; padding: 3px 8px; }
  .dp-nav { order: 3; flex-basis: 100%; padding-bottom: 8px; }
  .dp-account-btn span.who { display: none; }
  .dp-account-btn { padding: 4px; }
  .dp-savebar { top: 96px; }
  .dp-index, .dp-sec { scroll-margin-top: 180px; }
  .dp-main { padding: 18px 12px 40px; }
  .dp-card { padding: 18px 16px; border-radius: 18px; }
  .dp-grid, .dp-grid.c3, .dp-grid.c4 { grid-template-columns: minmax(0, 1fr); }
  .dp-grid .span2 { grid-column: auto; }
  .dp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dp-tile b { font-size: 24px; }
  .dp-projects { grid-template-columns: minmax(0, 1fr); }
  .dp-map { height: 340px; }
  .dp-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dp-row.survey { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px; }
  .dp-authcard { padding: 22px 18px; border-radius: 22px; }
  /* Compact on phones: the project name is in the breadcrumb already. */
  .dp-savebar { padding: 8px 10px; gap: 6px 8px; margin-bottom: 12px; }
  .dp-savebar .title { display: none; }
  .dp-savebar .spacer { display: none; }
  .dp-savebar .btns { flex-basis: 100%; gap: 6px; }
  .dp-savebar .btns .dp-btn { padding: 6px 10px; font-size: 12.5px; }
  .dp-invoice { padding: 22px 18px; }
  .dp-invoice .parties { grid-template-columns: 1fr; }
  /* Leads: rows become cards */
  .dp-table.cards thead { display: none; }
  .dp-table.cards, .dp-table.cards tbody, .dp-table.cards tr, .dp-table.cards td { display: block; width: 100%; }
  .dp-table.cards tr { padding: 12px 14px; border-bottom: 1px solid var(--divider); }
  .dp-table.cards td { border: 0; padding: 3px 0; }
  .dp-table.cards td[data-l]::before { content: attr(data-l); display: inline-block; min-width: 92px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
  .dp-table.cards td.num { text-align: left; }
  .dp-filters select { min-width: 0; flex: 1 1 40%; }
  .dp-filters .spacer { display: none; }
}

/* ---------- Print: invoices only ---------- */
@media print {
  .dp-page { background: #fff; }
  .dp-top, .footer, .dp-toasts, .dp-modal-wrap, .dp-noprint, .to-top { display: none !important; }
  .dp-main { padding: 0; max-width: none; }
  .dp-invoice { border: 0; border-radius: 0; padding: 0; max-width: none; }
  .dp-invoice th, .dp-invoice tr.total td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
