/* DYHIA eldjazair — back-office */
:root {
  --navy: #0f2a3d; --navy-2: #163a54; --gold: #c8a24a; --gold-2: #e3c574;
  --bg: #f4f6f9; --card: #fff; --text: #1d2733; --muted: #6b7785; --line: #e3e8ee;
  --green: #1f8a5b; --red: #c0392b; --orange: #d9822b; --blue: #2f6fb3; --violet: #6b4fbb;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --font: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
}
[dir="rtl"] { --font: Cairo, Tahoma, "Segoe UI", sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body.admin { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; display: flex; min-height: 100vh; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h3 { font-size: 15px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.icon { flex: none; vertical-align: middle; }

/* Sidebar */
.sidebar { width: 250px; flex: none; background: var(--navy); color: #c9d6e2; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 16px 10px 40px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 17px; padding: 6px 10px 18px; }
.brand:hover { text-decoration: none; }
.brand small { color: var(--gold-2); font-weight: 500; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--gold); color: var(--navy); display: grid; place-items: center; font-weight: 800; }
.nav-group { text-transform: uppercase; font-size: 11px; letter-spacing: .06em; color: #7f98ad; padding: 16px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; color: #c9d6e2; padding: 7px 10px; border-radius: 8px; margin: 1px 0; }
.nav-item:hover { background: var(--navy-2); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--gold); color: var(--navy); font-weight: 600; }
.nav-item span { flex: 1; }
.nav-badge { font-style: normal; background: var(--red); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 7px; line-height: 18px; }

/* Main */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 24px; position: sticky; top: 0; z-index: 5; }
.crumbs { flex: 1; display: flex; gap: 6px; align-items: center; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs strong { color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--text); cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--bg); }
.bell em { position: absolute; top: 2px; inset-inline-end: 0; background: var(--red); color: #fff; font-style: normal; font-size: 10px; border-radius: 8px; padding: 0 5px; line-height: 16px; }
.menu-toggle { display: none; }
.langs a { font-size: 12px; padding: 3px 6px; border-radius: 6px; color: var(--muted); }
.langs a.on { background: var(--navy); color: #fff; }
.user-menu { display: flex; align-items: center; gap: 8px; border-inline-start: 1px solid var(--line); padding-inline-start: 10px; }
.user-menu form { margin: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--gold); color: var(--navy); display: grid; place-items: center; font-weight: 700; }
.user-name { display: flex; flex-direction: column; line-height: 1.2; font-weight: 600; }
.user-name small { color: var(--muted); font-weight: 400; }
.content { padding: 24px; max-width: 1400px; width: 100%; }

/* Page head */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--text); padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; line-height: 1.2; }
.btn:hover { background: var(--bg); text-decoration: none; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn-danger { color: var(--red); border-color: #f0c9c4; }
.btn-danger:hover { background: #fdf0ee; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-xs { padding: 2px 7px; font-size: 12px; }
.inline-form { display: inline; margin: 0; }

/* Cards & grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; color: var(--text); box-shadow: var(--shadow); }
a.stat:hover { border-color: var(--gold); text-decoration: none; }
.stat-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 26px; font-weight: 700; }
.stat-hint { font-size: 12px; color: var(--muted); }

/* Tables */
.table-card { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; }
.table th { background: #fafbfc; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); white-space: nowrap; }
.table th a { color: inherit; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fbfcfd; }
.row-link { font-weight: 600; color: var(--text); }
.row-actions { text-align: end; white-space: nowrap; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.list-foot { display: flex; justify-content: space-between; align-items: center; margin-top: -6px; }
.pagination { display: flex; gap: 4px; }
.pagination a, .pagination span { padding: 5px 10px; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.pagination .current { background: var(--navy); color: #fff; border-color: var(--navy); }
.thumb { width: 64px; height: 44px; object-fit: cover; border-radius: 6px; }

/* Tabs & filters */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--navy); border-color: var(--gold); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs em { font-style: normal; background: var(--bg); border-radius: 10px; padding: 0 7px; font-size: 12px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input, .filters select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }
.filters input[type=search] { min-width: 240px; }

/* Badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; background: #eef1f5; color: #4a5767; white-space: nowrap; }
.badge-published, .badge-active, .badge-approved, .badge-paid, .badge-closed, .badge-verified, .badge-available, .badge-occupied, .badge-resolved, .badge-sent { background: #e3f4ec; color: var(--green); }
.badge-review, .badge-pending, .badge-new, .badge-open, .badge-due, .badge-under_review, .badge-reserved, .badge-prospect { background: #fff3df; color: #a8650f; }
.badge-draft, .badge-hidden, .badge-inactive, .badge-ended { background: #eef1f5; color: #5b6878; }
.badge-archived, .badge-rejected, .badge-lost, .badge-sold, .badge-cancelled, .badge-late, .badge-terminated, .badge-urgent { background: #fdecea; color: var(--red); }
.badge-contacted, .badge-in_progress, .badge-reviewed, .badge-rented, .badge-partial, .badge-maintenance, .badge-high { background: #e6effa; color: var(--blue); }
.badge-qualified, .badge-visit, .badge-negotiation { background: #efe9fb; color: var(--violet); }
.badge-create, .badge-login { background: #e3f4ec; color: var(--green); }
.badge-delete, .badge-login_failed, .badge-login_blocked, .badge-reject, .badge-file_delete, .badge-purge_demo { background: #fdecea; color: var(--red); }
.badge-download, .badge-password, .badge-settings, .badge-export { background: #fff3df; color: #a8650f; }
.badge-update, .badge-status, .badge-workflow, .badge-convert, .badge-approve { background: #e6effa; color: var(--blue); }
.badge-featured { background: #fbf3dc; color: #a07a12; }
.badge-demo { background: #fdecea; color: var(--red); letter-spacing: .05em; }
.badge-private { background: #fdecea; color: var(--red); }
.yes { color: var(--green); font-weight: 600; }

/* Details */
.details { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 8px 16px; margin: 0 0 16px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; word-break: break-word; }
.prose p { margin: 0 0 8px; }

/* Forms */
.form fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.form legend { font-weight: 700; font-size: 15px; margin-bottom: 10px; padding: 0; }
.form-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; grid-column: span 3; }
.field-full { grid-column: span 6; }
.field-third { grid-column: span 2; }
.field label { font-weight: 600; font-size: 13px; }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea { width: 100%; padding: 9px 11px; border: 1px solid #cfd7e0; border-radius: 8px; font: inherit; background: #fff; color: var(--text); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--gold-2); border-color: var(--gold); }
.field select.multi { min-height: 160px; }
.field .help { color: var(--muted); font-size: 12px; }
.field .error { color: var(--red); font-size: 12px; font-weight: 600; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red) !important; }
.req { color: var(--red); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 400 !important; cursor: pointer; }
.check-bool { margin-top: 24px; }
.current-image { display: flex; align-items: center; gap: 10px; }
.current-image img { width: 120px; height: 80px; object-fit: cover; border-radius: 8px; }
.form-actions { display: flex; gap: 8px; border-top: 1px solid var(--line); padding-top: 16px; }
.static { padding: 8px 0; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; }
.alert-success { background: #e9f7f0; border-color: #bfe5d1; color: #14653f; }
.alert-error { background: #fdf0ee; border-color: #f3c7c1; color: #8f2a1f; }
.alert-info { background: #eaf2fb; border-color: #c4daf2; color: #1f4e82; }
.alert-warning { background: #fff7e6; border-color: #f4d9a6; color: #7a4f06; }

/* Workflow */
.workflow { display: flex; flex-direction: column; gap: 12px; }
.wf-steps { display: flex; gap: 0; flex-wrap: wrap; }
.wf-step { padding: 6px 14px; background: #eef1f5; color: var(--muted); font-weight: 600; font-size: 13px; position: relative; margin-inline-end: 4px; border-radius: 6px; }
.wf-step.on { background: var(--navy); color: #fff; }
.wf-form { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.wf-form input[type=text] { flex: 1; min-width: 220px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }

/* Attachments */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.gallery figure { margin: 0; position: relative; border-radius: 8px; overflow: hidden; border: 2px solid transparent; }
.gallery figure.main { border-color: var(--gold); }
.gallery img { width: 100%; height: 80px; object-fit: cover; display: block; }
.gallery figcaption { position: absolute; top: 4px; inset-inline-end: 4px; display: flex; gap: 3px; }
.files { list-style: none; padding: 0; margin: 0; }
.files li { padding: 6px 0; border-bottom: 1px solid var(--line); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { color: var(--muted); font-size: 12px; }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(7, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.kanban-col { background: #eaeef3; border-radius: var(--radius); padding: 10px; min-height: 200px; }
.kanban-col h4 { margin: 0 0 10px; display: flex; justify-content: space-between; font-size: 13px; }
.kanban-card { background: #fff; border-radius: 8px; padding: 10px; margin-bottom: 8px; box-shadow: var(--shadow); font-size: 13px; }
.kanban-card a.title { font-weight: 600; color: var(--text); display: block; }
.kanban-card .meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.kanban-card form { margin-top: 6px; }
.kanban-card select { width: 100%; font: inherit; font-size: 12px; padding: 3px; border-radius: 6px; border: 1px solid var(--line); }
.overdue { color: var(--red); font-weight: 600; }

/* Bars (analytics) */
.bars { list-style: none; padding: 0; margin: 0; }
.bars li { display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; gap: 10px; align-items: center; padding: 5px 0; }
.bars .bar { height: 10px; background: #eef1f5; border-radius: 6px; overflow: hidden; }
.bars .bar span { display: block; height: 100%; background: var(--navy-2); border-radius: 0 4px 4px 0; }
.bars li:hover .bar span { background: var(--gold); }
.chart-cols { display: flex; align-items: flex-end; gap: 2px; height: 160px; padding-top: 10px; border-bottom: 1px solid var(--line); }
.chart-cols div { flex: 1; background: var(--navy-2); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.chart-cols div:hover { background: var(--gold); }
.chart-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 4px; }
.funnel li { grid-template-columns: minmax(110px, 30%) 1fr 90px; }

.notif-list { list-style: none; padding: 0; margin: 0; }
.notif-list li { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.notif-list li.unread { background: #fffbef; }
.notif-list li .t { flex: 1; }

.hp { position: absolute !important; left: -9999px !important; }

/* Login */
body.auth { font-family: var(--font); background: linear-gradient(135deg, var(--navy), #0b1f2d); min-height: 100vh; display: grid; place-items: center; margin: 0; padding: 16px; }
.auth-card { background: #fff; border-radius: 14px; padding: 32px; width: 100%; max-width: 400px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.auth-card h1 { text-align: center; margin-bottom: 4px; }
.auth-card .brand-mark { margin: 0 auto 12px; width: 48px; height: 48px; font-size: 22px; }
.auth-card .field { margin-bottom: 12px; }
.auth-card .btn { width: 100%; justify-content: center; padding: 11px; }

@media (max-width: 1100px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; z-index: 20; inset-inline-start: -260px; transition: inset-inline-start .2s; }
  body.sidebar-open .sidebar { inset-inline-start: 0; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .menu-toggle { display: inline-grid; }
  .content { padding: 16px; }
  .topbar { padding: 8px 16px; }
  .user-name, .langs { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .field, .field-full, .field-third { grid-column: span 1; }
  .details { grid-template-columns: 1fr; }
  .details dt { font-weight: 600; }
}
@media print {
  .sidebar, .topbar, .actions, .no-print { display: none !important; }
  .card { box-shadow: none; border: 0; }
}

/* ===== Property publishing ===== */
.small { font-size: 12px; }
.btn-publish { background: var(--green); border-color: var(--green); color: #fff; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; padding: 8px 16px; box-shadow: 0 1px 0 rgba(0,0,0,.08); }
.btn-publish:hover { background: #18734b; color: #fff; }
.btn-publish.is-incomplete { background: #fff; color: #a8650f; border-color: #e9c27d; }
.btn-publish.is-incomplete::after { content: " !"; font-weight: 800; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn.busy, button.busy { opacity: .6; pointer-events: none; }
.prop-table td, .prop-table th { padding: 9px 12px; }
.prop-table .sel { width: 28px; }
.prop-table .thumb { width: 74px; }
.prop-table .thumb img, .prop-table .no-thumb { width: 64px; height: 46px; border-radius: 6px; object-fit: cover; display: grid; place-items: center; background: #eef1f5; color: var(--muted); font-weight: 700; }
.prop-table .num { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.prop-table .prop { min-width: 180px; }
.prop-table tr.flash td { animation: rowflash 1.6s ease; }
@keyframes rowflash { from { background: #fff6d6; } to { background: transparent; } }
.status-cell { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.star-btn { border: 0; background: none; font-size: 18px; line-height: 1; color: #b9c2cc; cursor: pointer; padding: 2px; }
.star-btn.on { color: var(--gold); }
.star-btn:hover { color: var(--gold); }
.row-main { white-space: nowrap; text-align: end; }
.row-main > form, .row-main > a { vertical-align: middle; }
details.menu { display: inline-block; position: relative; vertical-align: middle; margin-inline-start: 4px; }
details.menu > summary { list-style: none; cursor: pointer; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-weight: 700; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu[open] > summary { background: var(--bg); }
.menu-list { position: absolute; inset-inline-end: 0; top: 36px; z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(16,24,40,.15); min-width: 200px; padding: 6px; text-align: start; }
.menu-list a, .menu-list button, .menu-list .menu-btn { display: block; width: 100%; text-align: start; padding: 8px 10px; border: 0; background: none; border-radius: 6px; color: var(--text); font: inherit; cursor: pointer; text-decoration: none; }
.menu-list a:hover, .menu-list button:hover { background: var(--bg); }
.menu-list form { display: block; margin: 0; }
.menu-list .danger { color: var(--red); }
.bulk-bar { position: sticky; top: 56px; z-index: 6; display: flex; gap: 12px; align-items: center; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; margin-bottom: 12px; }
.bulk-bar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); }
.bulk-bar[hidden] { display: none; }
dialog.modal { border: 0; border-radius: 14px; padding: 22px; width: min(640px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog.modal-sm { width: min(420px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(15,42,61,.45); }
dialog.modal h3 { margin-top: 0; }
.bulk-question { font-size: 16px; font-weight: 600; margin: 0 0 16px; }
.toasts { position: fixed; bottom: 20px; inset-inline-end: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.toast { position: relative; background: #fff; border-inline-start: 5px solid var(--green); border-radius: 10px; box-shadow: 0 10px 30px rgba(16,24,40,.2); padding: 12px 36px 12px 14px; font-weight: 600; animation: toastin .25s ease; transition: opacity .4s, transform .4s; }
.toast-error { border-color: var(--red); }
.toast.out { opacity: 0; transform: translateY(10px); }
.toast-links { font-weight: 400; margin-top: 6px; }
.toast-links a { font-weight: 600; }
.toast-close { position: absolute; top: 6px; inset-inline-end: 8px; border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--muted); }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.publish-panel { border-width: 2px; }
.publish-panel.status-published { border-color: #bfe5d1; background: #f6fcf9; }
.publish-panel .pp-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.publish-panel .pp-head h3 { margin: 0; font-size: 18px; }
.publish-panel .pp-head p { margin: 2px 0 0; }
.pp-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 18px; flex: none; }
.pp-icon.ok, .pp-icon.ready { background: #e3f4ec; color: var(--green); }
.pp-icon.warn { background: #fff3df; color: #a8650f; }
.checklist { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 14px; }
.checklist li.ok { color: var(--green); }
.checklist li.miss { color: #a8650f; font-weight: 600; }
.checklist li.miss a { color: #a8650f; text-decoration: underline; }
.pp-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.publish-form { display: inline-flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0; }
.seg { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px; background: #fff; }
.seg-label { color: var(--muted); font-size: 13px; margin-inline-end: 4px; }
.seg label { display: inline-flex; gap: 4px; align-items: center; padding: 4px 8px; border-radius: 6px; cursor: pointer; font-weight: 600; }
.seg label:has(input:checked) { background: var(--navy); color: #fff; }
.seg input { accent-color: var(--gold); }

/* Phones: the property table becomes a list of cards. */
@media (max-width: 860px) {
  .prop-table thead { display: none; }
  .prop-table, .prop-table tbody, .prop-table tr, .prop-table td { display: block; width: 100%; }
  .prop-table tr { position: relative; border-bottom: 1px solid var(--line); padding: 12px 12px 12px 92px; min-height: 96px; }
  .prop-table td { border: 0; padding: 2px 0; text-align: start; }
  .prop-table td.sel { position: absolute; top: 10px; inset-inline-start: 6px; width: auto; }
  .prop-table td.thumb { position: absolute; top: 12px; inset-inline-start: 22px; width: 64px; }
  .prop-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 12px; }
  .prop-table td.prop::before { content: none; }
  .prop-table td.num { text-align: start; }
  .prop-table td.row-main { text-align: start; padding-top: 8px; }
  .prop-table .btn-publish { padding: 10px 22px; }
  .prop-table .row-main .btn, .prop-table details.menu > summary { min-height: 40px; min-width: 40px; } /* touch targets */
  .menu-list { inset-inline-end: auto; inset-inline-start: 0; }
  .bulk-bar { top: 50px; flex-wrap: wrap; }
  .toasts { inset-inline: 12px; bottom: 12px; max-width: none; }
}

/* ===== Facebook integration ===== */
.fb-logo { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #1877F2; color: #fff; font-weight: 800; font-family: Arial, sans-serif; font-size: 14px; line-height: 1; vertical-align: -3px; }
h1 .fb-logo { width: 28px; height: 28px; font-size: 20px; vertical-align: -4px; }
.btn-fb { background: #1877F2; border-color: #1877F2; color: #fff; }
.btn-fb:hover { background: #1464cf; color: #fff; }
.btn-fb[disabled] { opacity: .5; cursor: not-allowed; }
.fb-chip { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: #1877F2; color: #fff !important; font: 700 11px Arial, sans-serif; text-decoration: none !important; vertical-align: 0; }
.fb-panel { border-inline-start: 4px solid #1877F2; }
.fb-auto { padding: 6px 10px; border: 1px dashed #b8cff5; border-radius: 10px; background: #f3f8ff; }
.toast-warning { border-color: var(--orange); }
.toast-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; font-weight: 400; }
.guide li { margin-bottom: 8px; }
.guide code { display: block; margin-top: 4px; white-space: normal; word-break: break-word; }
.fb-message { max-height: 260px; overflow: auto; background: var(--bg); padding: 10px 12px; border-radius: 8px; }
.badge-failed { background: #fdecea; color: var(--red); }
.badge-replaced, .badge-deleted { background: #eef1f5; color: #5b6878; }
.badge-publishing { background: #e6effa; color: var(--blue); }

/* Roles & permission matrices */
.perm-matrix { display: grid; gap: 14px; }
.perm-tools { position: sticky; top: 0; z-index: 2; background: var(--card, #fff); padding: 8px 0; }
.perm-search { min-width: 220px; }
.perm-group { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0; }
.perm-group legend { font-weight: 700; padding: 0 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.perm-group-tools { display: inline-flex; gap: 4px; font-weight: 400; }
.perm-table td, .perm-table th { padding: 6px 10px; }
.perm-table code { font-size: 11px; }
.perm-choice { white-space: nowrap; }
.perm-opt { margin-inline-end: 10px; font-size: 13px; cursor: pointer; }
.perm-opt input:disabled + * , .perm-opt input:disabled { cursor: not-allowed; }
.perm-opt-allow { color: var(--green); }
.perm-opt-deny { color: var(--red); }
.perm-yes { color: var(--green); font-weight: 700; }
.perm-no { color: var(--muted); }
tr.perm-custom td { background: #fffbea; }
.perm-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 14px; }
.perm-check code { display: block; font-size: 11px; }
.section-title { margin: 6px 0 10px; font-size: 15px; }
@media (max-width: 720px) {
  .perm-table thead { display: none; }
  .perm-table tr { display: grid; grid-template-columns: 1fr auto; padding: 6px 0; border-bottom: 1px solid var(--line); }
  .perm-table td { border: 0; }
  .perm-choice { grid-column: 1 / -1; white-space: normal; }
}

/* Property CRM: in-page section links (property file) and match stage bar */
.section-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; position: sticky; top: 0; z-index: 5; padding: 6px 0; background: var(--bg, #f4f6f9); }
.section-nav a { padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 13px; color: var(--text); text-decoration: none; }
.section-nav a:hover { border-color: var(--primary, #1f6feb); }
.content section[id], .content span[id] { scroll-margin-top: 64px; }
.match-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }

/* Customer requests */
.cr-form details.more { margin-top: 10px; border-top: 1px dashed #d8dde5; padding-top: 10px; }
.cr-form details.more > summary { cursor: pointer; font-weight: 600; color: var(--navy); padding: 6px 0; }
.cr-chain { margin: 0 0 16px; row-gap: 6px; }
.cr-phone { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.cr-phone .btn { white-space: nowrap; }
.tabs a.tab-alert em { background: #c62828; color: #fff; }
@media (max-width: 720px) { .cr-table .cr-phone .btn { padding: 4px 8px; } .cr-table th:nth-child(4), .cr-table td:nth-child(4), .cr-table th:nth-child(7), .cr-table td:nth-child(7) { display: none; } }
