/* =========================================================
   Additions on top of css-main.css (the original theme):
   utility classes, the approval workflow, user admin, form rows.
   ========================================================= */

[hidden] { display: none !important; }

/* ---- utilities (replace the inline style="" attributes the old page used) ---- */
.muted { color: var(--text-muted); }
.small { font-size: 0.8125rem; }
.mb-10 { margin-bottom: 0.625rem; } .mb-15 { margin-bottom: 0.9375rem; } .mb-20 { margin-bottom: 1.25rem; } .mb-30 { margin-bottom: 1.875rem; }
.mt-10 { margin-top: 0.625rem; } .mt-15 { margin-top: 0.9375rem; } .mt-20 { margin-top: 1.25rem; } .mt-25 { margin-top: 1.5625rem; }
.btn-tall { padding: 0.875rem; font-size: 1rem; }
.footer-brand { display: flex; justify-content: center; margin-bottom: 0.625rem; }
.btn-danger-style { background: var(--danger); color: #fff; }
.btn-danger-style:hover { background: #DC2626; transform: translateY(-0.125rem); }
.btn-small { padding: 0.25rem 0.75rem; font-size: 0.6875rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---- layout bits that used to be inline ---- */
.paywall-overlay.open { display: flex; }
#loadingOverlay:not([hidden]) { display: flex; }
#loadingOverlay h2 { margin-bottom: 0.625rem; color: #fff; }
#loadingOverlay p { color: var(--primary); font-size: 0.875rem; }
.curved-modal.wide { max-width: 56.25rem; }
.curved-modal.medium { max-width: 46.875rem; }
.curved-modal.narrow { max-width: 28rem; }
#typesOverlay, #reviewOverlay, #passwordOverlay { z-index: 1100; }
.form-grid.single { grid-template-columns: 1fr; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9375rem; margin-bottom: 0.9375rem; }
.inline-pair { display: flex; gap: 0.5rem; }
.inline-pair > :first-child { flex: 2; }
.inline-pair > :last-child { flex: 1; }
.check-row { display: flex; flex-wrap: wrap; gap: 0.625rem 1.5rem; padding: 0.75rem 0.9375rem; background: var(--item-bg); border: 1px solid var(--border-color); border-radius: var(--radius-input); }
.check-row label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; font-weight: 700; color: var(--text-main); margin: 0; padding: 0; cursor: pointer; }
.check-row input { width: 1.125rem; height: 1.125rem; accent-color: var(--primary); padding: 0; }
.section-label.first { margin-top: 0; }
.panel-box { background: var(--item-bg); padding: 1.25rem; border-radius: var(--radius-card); border: 1px solid var(--border-color); margin-bottom: 1.25rem; }
.avg-field { max-width: 15rem; margin-bottom: 0.9375rem; }
.avg-field input { text-align: center; border: 1px solid var(--primary); background: transparent; color: var(--text-muted); }
.dashed-btn { border: 1px dashed var(--border-color); color: var(--text-muted); justify-content: center; font-size: 0.8125rem; }
.dashed-btn.open { border: 1px solid var(--danger); color: var(--danger); }
.adv-panel { background: var(--card-bg); padding: 1.25rem; border-radius: var(--radius-card); border: 1px solid var(--border-color); margin-top: 1rem; }
.price-row { background: rgba(0,0,0,0.12); padding: 0.9375rem; border-radius: var(--radius-input); margin-bottom: 0.75rem; border: 1px solid var(--border-color); }
.price-row .price-row-title { font-size: 0.8125rem; font-weight: 800; color: var(--text-main); margin-bottom: 0.625rem; }
.price-row .grid-3 { margin-bottom: 0; }
.price-row input { width: 100%; padding: 0.625rem 0.75rem; font-size: 0.75rem; color: var(--text-main); background: var(--item-bg); border: 1px solid var(--border-color); border-radius: var(--radius-input); outline: none; font-weight: 600; }
.price-row input:focus { border-color: var(--primary); }
.price-row input:disabled { background: transparent; color: var(--text-muted); text-align: center; border-style: dashed; }
.table-scroll { overflow-x: auto; }

/* ---- feedback boxes ---- */
.form-error, .login-error { background: rgba(239, 68, 68, 0.12); border: 1px solid var(--danger); color: var(--danger); padding: 0.75rem 1rem; border-radius: var(--radius-input); font-size: 0.8125rem; font-weight: 700; margin: 0.75rem 0; white-space: pre-line; text-align: right; }
.review-banner { background: rgba(245, 158, 11, 0.12); border: 1px solid #F59E0B; color: var(--text-main); padding: 0.875rem 1rem; border-radius: var(--radius-input); font-size: 0.8125rem; margin-bottom: 1rem; white-space: pre-line; }
.review-banner b { color: #F59E0B; display: block; margin-bottom: 0.25rem; }

/* ---- login ---- */
.remember-row { display: flex; align-items: center; gap: 0.5rem; margin: 0.9375rem 0 1.25rem; text-align: right; }
.remember-row label { font-size: 0.8125rem; color: var(--text-muted); cursor: pointer; }

/* ---- sidebar ---- */
.side-actions { margin-top: 0; padding-top: 0.5rem; }
.side-actions-tail { margin-top: auto; padding-top: 0.9375rem; }
#userEmailLabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 9rem; direction: ltr; }

/* ---- filters ---- */
.price-menu { width: 15.625rem; }
.price-pair { display: flex; gap: 0.625rem; margin-bottom: 0.9375rem; }
.mb-15.range-input { margin-bottom: 0.9375rem; }
.scroll-menu { max-height: 22rem; overflow-y: auto; min-width: 16rem; }
.menu-group-title { font-size: 0.6875rem; font-weight: 800; color: var(--primary); margin: 0.625rem 0 0.5rem; }
.menu-group-title:first-child { margin-top: 0; }

/* ---- approval status ---- */
.status-badge { display: inline-block; font-size: 0.625rem; font-weight: 800; padding: 0.25rem 0.625rem; border-radius: var(--radius-pill); border: 1px solid; white-space: nowrap; }
.status-draft { color: var(--text-muted); border-color: var(--border-color); background: var(--card-bg); }
.status-pending_review { color: #3B82F6; border-color: #3B82F6; background: rgba(59, 130, 246, 0.1); }
.status-changes_requested { color: #F59E0B; border-color: #F59E0B; background: rgba(245, 158, 11, 0.1); }
.status-approved { color: var(--success); border-color: var(--success); background: rgba(16, 185, 129, 0.1); }
.badge-row { display: flex; gap: 0.375rem; flex-wrap: wrap; align-items: center; margin-bottom: 0.9375rem; }
.badge-row .dossier-badge { margin-bottom: 0; }
.dossier:hover .badge-row .dossier-badge { transform: none; }
.stat-draft b { color: var(--text-muted); }
.stat-pending b { color: #3B82F6; }
.stat-changes b { color: #F59E0B; }
.stat-approved b { color: var(--success); }
.stat-danger b { color: var(--danger); }
.admin-stats-board { gap: 0.625rem; }
.stat-card { min-width: 7rem; }

/* ---- project details ---- */
.chip-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { font-size: 0.75rem; font-weight: 700; padding: 0.25rem 0.75rem; border-radius: var(--radius-pill); border: 1px solid var(--border-color); background: var(--card-bg); color: var(--text-muted); }
.chip.yes { color: var(--success); border-color: var(--success); }
.detail-item a { color: var(--primary); font-weight: 800; }
.link-btn { display: inline-block; margin-top: 0.3125rem; color: var(--primary); font-size: 0.75rem; font-weight: 800; background: var(--item-bg); padding: 0.375rem 0.75rem; border-radius: 0.25rem; border: 1px solid var(--primary); text-decoration: none; }
.history-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.75rem; }
.history-list li { background: var(--item-bg); border: 1px solid var(--border-color); border-radius: var(--radius-input); padding: 0.625rem 0.875rem; }
.history-list .when { color: var(--text-muted); font-family: 'IBM Plex Mono', monospace; direction: ltr; display: inline-block; }
.history-list .note { margin-top: 0.25rem; white-space: pre-line; }
.mr-auto { margin-right: auto; }
.modal-footer { flex-wrap: wrap; }

/* ---- users manager ---- */
.new-account-result { margin-top: 1.25rem; padding: 1.25rem; background: var(--item-bg); border: 1px solid var(--primary); border-radius: var(--radius-card); }
.new-account-result b { color: var(--primary); display: block; margin-bottom: 0.625rem; font-size: 1rem; }
.credentials { font-family: 'IBM Plex Mono', monospace; font-size: 0.875rem; line-height: 1.9; color: var(--text-main); }
.credentials span { font-weight: bold; direction: ltr; unicode-bidi: isolate; display: inline-block; }
#resPass { color: var(--danger); user-select: all; }
#usersTable td, #usersTable th { white-space: nowrap; }
.row-actions { display: flex; gap: 0.375rem; }
.tag { font-size: 0.6875rem; font-weight: 800; padding: 0.125rem 0.5rem; border-radius: var(--radius-pill); border: 1px solid var(--border-color); }
.tag.off { color: var(--danger); border-color: var(--danger); }
.tag.on { color: var(--success); border-color: var(--success); }

/* ---- unit types manager ---- */
.types-label { color: var(--primary); font-weight: 800; font-size: 0.8125rem; display: block; margin: 0.9375rem 0 0.5rem; }
.types-area { width: 100%; padding: 0.75rem; border-radius: var(--radius-input); border: 1px solid var(--border-color); background: var(--card-bg); color: var(--text-main); outline: none; line-height: 1.6; resize: vertical; }
.types-area:focus { border-color: var(--primary); }

/* ---- project form: repeating rows ---- */
.repeat-row.unit-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.unit-row select, .unit-row input { flex: 1; min-width: 5rem; }
.unit-row .u-type { flex: 1.5; min-width: 8rem; }
.unit-row .u-price { flex: 1.5; min-width: 7.5rem; color: var(--primary); font-weight: 700; }
.plan-card-header .p-name { flex: 2; min-width: 7.5rem; }
.plan-card-header .p-num { width: 4.75rem; flex-shrink: 0; }
.plan-card-header .p-ppm { width: 8.75rem; flex-shrink: 0; }
.plan-notes { width: 100%; margin-top: 0.625rem; padding: 0.5rem 0.75rem; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-input); color: var(--text-main); font-size: 0.8125rem; outline: none; height: 2.75rem; }
.bullet-row { display: flex; gap: 0.625rem; align-items: center; flex-wrap: wrap; }
.bullet-row select, .bullet-row input { padding: 0.375rem 0.75rem; background: var(--card-bg); border: 1px solid var(--border-color); height: 2.5rem; border-radius: var(--radius-input); color: var(--text-main); font-size: 0.8125rem; outline: none; font-weight: 600; }
.bullet-row select { flex: 1; min-width: 7rem; }
.bullet-row input { width: 5rem; flex-shrink: 0; }
.years-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; width: 100%; margin-top: 0.625rem; }
.bullets-title { font-size: 0.8125rem; font-weight: 800; color: var(--text-main); margin-bottom: 0.625rem; }
.file-row { background: var(--item-bg); border: 1px solid var(--border-color); border-radius: var(--radius-card); padding: 0.875rem 1rem; margin-bottom: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.625rem; align-items: center; }
.file-row .file-kind { font-weight: 800; font-size: 0.8125rem; flex: 1 1 100%; }
.file-row .file-current { font-size: 0.75rem; color: var(--text-muted); flex: 1 1 100%; display: flex; gap: 0.625rem; align-items: center; flex-wrap: wrap; }
.file-row .file-current a { color: var(--primary); font-weight: 800; }
.file-row input[type="text"] { flex: 2; min-width: 12rem; padding: 0.625rem 0.75rem; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-input); color: var(--text-main); font-size: 0.75rem; outline: none; direction: ltr; }
.file-row input[type="file"] { flex: 1; min-width: 10rem; font-size: 0.75rem; color: var(--text-muted); }
.file-row .remove-file { display: flex; align-items: center; gap: 0.375rem; font-size: 0.75rem; color: var(--danger); font-weight: 700; }

/* ---- detail tables on small screens ---- */
.category-box { overflow-x: auto; }

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
  .side-actions-tail { margin-top: 0; }
  .curved-modal { max-height: 92vh; }
}

/* ---- location tree + cards ---- */
.loc-tools { display: flex; align-items: center; gap: 0.375rem; }
.dossier-meta.single { grid-template-columns: 1fr; margin-top: 0.9375rem; }
.meta-chip.phases-hint { display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.05); border: 1px dashed var(--border-color); }
.meta-chip.phases-hint div { font-size: 1rem; }
.skeleton-line.sk-1 { width: 40%; height: 10px; margin-bottom: 10px; }
.skeleton-line.sk-2 { width: 75%; height: 16px; margin-bottom: 14px; }
.skeleton-line.sk-3 { width: 55%; height: 9px; margin-bottom: 8px; }
.skeleton-line.sk-4 { width: 45%; height: 9px; margin-bottom: 8px; }
.skeleton-line.sk-5 { width: 60%; height: 9px; margin-bottom: 14px; }
.sk-pair { display: flex; gap: 10px; }
.skeleton-line.sk-box { flex: 1; height: 34px; }

/* ---- detail view extras ---- */
.detail-lines { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.875rem; }
.detail-status { margin-bottom: 0.9375rem; }
.review-banner.info { border-color: #3B82F6; background: rgba(59, 130, 246, 0.1); }
.empty-note { text-align: center; padding: 1.25rem; color: var(--text-muted); border: 1px dashed var(--border-color); border-radius: var(--radius-input); margin-bottom: 1rem; }
.empty-note.danger { color: var(--danger); border-color: var(--danger); background: rgba(220, 38, 38, 0.05); }
.plan-meter-tag { color: var(--primary); font-size: 0.625rem; background: var(--item-bg); padding: 0.125rem 0.375rem; border-radius: 0.25rem; border: 1px dashed var(--primary); display: inline-block; margin-top: 0.25rem; }
.discount-tag { color: var(--danger); font-weight: 800; display: block; margin-top: 0.25rem; }
.plan-notes-text { display: block; color: var(--text-muted); font-weight: 600; margin-top: 0.25rem; max-width: 18rem; white-space: pre-line; }
.good { color: var(--success); font-weight: 800; }
.num.big { font-size: 1.125rem; }
td.primary, .primary { color: var(--primary); }
.calc-label { margin-top: 2.5rem; background: var(--success); }
.mini-calc { display: flex; gap: 0.625rem; background: var(--item-bg); padding: 0.9375rem; border-radius: var(--radius-card); border: 1px solid var(--border-color); margin-bottom: 1.25rem; flex-wrap: wrap; }
.mini-calc input { flex: 1; min-width: 7rem; padding: 0.625rem; border-radius: var(--radius-input); background: var(--card-bg); border: 1px solid var(--border-color); color: var(--text-main); outline: none; }
.phase-pick { cursor: pointer; margin-bottom: 0.625rem; transition: var(--transition); }
.phase-pick:hover { border-color: var(--primary); }
.phase-pick-name { color: var(--danger); font-size: 1.125rem; font-weight: 800; margin-bottom: 0.3125rem; }
.calc-item.span-all { grid-column: 1 / -1; text-align: right; }
.calc-item.bordered { border: 2px dashed var(--primary); padding: 0.75rem; border-radius: var(--radius-input); }
.grow { flex: 1; }
.repeat-row input[type="date"] { min-width: 9rem; }
.bullet-wrap { margin-bottom: 0.625rem; padding: 0.75rem; background: var(--item-bg); border-radius: var(--radius-input); border: 1px solid var(--border-color); }
.bullet-wrap .bullet-row { padding: 0; background: transparent; border: none; margin: 0; }
