/* ===== سجل المهتمين بالعقار — التصميم ===== */
:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --border: #e3e8ec;
  --text: #13222e;
  --muted: #64748b;
  --primary: #0f766e;
  --primary-2: #14b8a6;
  --primary-soft: #e6f6f4;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --warn: #b45309;
  --warn-soft: #fff4e0;
  --ok: #15803d;
  --ok-soft: #e7f7ec;
  --info: #1d4ed8;
  --info-soft: #e8efff;
  --violet: #7c3aed;
  --violet-soft: #f1eafe;
  --wa: #1fa855;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --radius: 14px;
  --sidebar: 248px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d1419;
  --surface: #141e25;
  --surface-2: #1a262e;
  --border: #26343e;
  --text: #e6edf2;
  --muted: #8ea0ae;
  --primary: #2dd4bf;
  --primary-2: #5eead4;
  --primary-soft: #11302e;
  --danger: #f87171;
  --danger-soft: #3a1b1b;
  --warn: #fbbf24;
  --warn-soft: #36290f;
  --ok: #4ade80;
  --ok-soft: #12301d;
  --info: #93b4ff;
  --info-soft: #18264a;
  --violet: #c4b5fd;
  --violet-soft: #2a2145;
  --wa: #34d27a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Tajawal', system-ui, 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; font-weight: 800; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
.num, .ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.grow { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.between { justify-content: space-between; }
.mt { margin-top: 14px; }

/* ===== الهيكل ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar);
  background: var(--surface);
  border-inline-end: 1px solid var(--border);
  position: fixed; inset-block: 0; inset-inline-start: 0;
  display: flex; flex-direction: column;
  padding: 18px 12px;
  z-index: 40;
  transition: transform .2s ease;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand img { width: 38px; height: 38px; border-radius: 10px; }
.brand b { font-size: 1.02rem; line-height: 1.2; }
.brand small { display: block; color: var(--muted); font-weight: 500; font-size: .75rem; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--text); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.nav a .ico { width: 20px; height: 20px; flex: none; }
.nav .count { margin-inline-start: auto; background: var(--danger); color: #fff; border-radius: 999px; font-size: .72rem; padding: 0 7px; font-weight: 700; }
.nav-sep { height: 1px; background: var(--border); margin: 10px 8px; }
.user-chip { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-top: 1px solid var(--border); }
.user-chip .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; flex: none; }
.user-chip b { display: block; line-height: 1.2; }
.user-chip small { color: var(--muted); }
.user-chip + .sidebar-foot { margin-top: 0; }
.sidebar-foot { margin-top: auto; display: flex; gap: 6px; padding: 8px 4px 0; }

.main { flex: 1; margin-inline-start: var(--sidebar); min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 1.2rem; }
.menu-btn { display: none; }
.content { padding: 22px 24px 60px; max-width: 1400px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.backdrop { display: none; }

/* ===== المكونات ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  font: inherit; font-weight: 600; font-size: .92rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
  text-decoration: none !important;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #062420; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 5px 10px; font-size: .84rem; border-radius: 8px; }
.btn.icon { padding: 6px; width: 34px; height: 34px; }
.btn.icon.sm { width: 30px; height: 30px; padding: 5px; }
.btn .ico { width: 18px; height: 18px; }
.icon-link { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); }
.icon-link:hover { background: var(--surface-2); }
.icon-link .ico { width: 17px; height: 17px; }
.icon-link.wa { color: var(--wa); }
.icon-link.tel { color: var(--info); }

.ico { display: inline-block; vertical-align: middle; width: 1.15em; height: 1.15em; flex: none; }

label.field { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .9rem; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  width: 100%;
  min-width: 0;
}
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent); border-color: var(--primary); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--primary); padding: 0; flex: none; }
input.invalid, select.invalid, textarea.invalid { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .8rem; font-weight: 500; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }

.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin: 0; min-width: 0; }
legend { font-weight: 800; padding: 0 6px; color: var(--primary); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 9px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; white-space: nowrap;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.badge.teal { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge.red { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.amber { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.green { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.blue { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.violet { background: var(--violet-soft); color: var(--violet); border-color: transparent; }
.badge.by { background: var(--surface); color: var(--muted); font-weight: 600; }
.badge.by .ico { width: 12px; height: 12px; }
.suhail-wrap { position: relative; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.suhail-loading { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; color: var(--muted); }
.suhail-frame { position: relative; width: 100%; height: min(72vh, 640px); border: 0; display: block; background: transparent; }
.modal.xl { width: min(1100px, 100%); }
.price-box { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.price-lines { padding: 6px 14px; }
.price-line { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: .92rem; }
.price-line:last-child { border-bottom: 0; }
.price-line span { color: var(--muted); }
.price-line.ok b { color: var(--ok); }
.price-total { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px;
  background: linear-gradient(135deg, #0f766e, #14b8a6); color: #fff; }
.price-total span { font-weight: 600; }
.price-total b { font-size: 1.35rem; font-weight: 800; }
.price-box.compact .price-lines { padding: 2px 10px; }
.price-box.compact .price-line { padding: 3px 0; font-size: .82rem; }
.price-box.compact .price-total { padding: 8px 10px; }
.price-box.compact .price-total b { font-size: 1.05rem; }
.total-line { background: var(--primary-soft); color: var(--primary); border-radius: 8px; padding: 3px 8px; font-weight: 700; }
.print-only { display: none; }
.deal-card { border-inline-start: 4px solid var(--warn); }
.deal-card.sold { border-inline-start-color: var(--danger); }
.deal-card.cancelled { border-inline-start-color: var(--muted); }
.status-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.suhail-btn { color: #1d4ed8; border-color: #bfd0ff; }
:root[data-theme="dark"] .suhail-btn { color: var(--info); border-color: var(--border); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--border); border-radius: 10px; padding: 6px 8px; background: var(--surface); }
.chip-input:focus-within { outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent); border-color: var(--primary); }
.chip-input input { border: 0; padding: 3px 4px; flex: 1; min-width: 120px; outline: none !important; background: transparent; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--primary-soft); color: var(--primary); border-radius: 999px; padding: 2px 6px 2px 10px; font-size: .85rem; font-weight: 600; }
.chip button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 2px; }
.chip.suggest { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--border); cursor: pointer; padding: 2px 10px; }

.alert { border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; border: 1px solid transparent; }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.danger { background: var(--danger-soft); color: var(--danger); }
.alert.info { background: var(--info-soft); color: var(--info); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert b { font-weight: 800; }

/* ===== الجداول ===== */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data th { background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: .8rem; white-space: nowrap; position: sticky; top: 0; }
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--text); }
table.data th .arrow { opacity: .4; margin-inline-start: 4px; }
table.data th.sorted { color: var(--primary); }
table.data th.sorted .arrow { opacity: 1; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tr:last-child td { border-bottom: 0; }
td .sub { display: block; color: var(--muted); font-size: .8rem; }
td.actions, td.nowrap { white-space: nowrap; text-align: end; }
td.nowrap { text-align: start; }
select.inline-status { width: auto; padding: 3px 8px; font-size: .82rem; border-radius: 999px; font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.empty .ico { width: 42px; height: 42px; opacity: .5; display: block; margin: 0 auto 8px; }

.status-new { color: var(--info); background: var(--info-soft); border-color: transparent !important; }
.status-contacted { color: var(--violet); background: var(--violet-soft); border-color: transparent !important; }
.status-offer_sent { color: var(--primary); background: var(--primary-soft); border-color: transparent !important; }
.status-negotiating { color: var(--warn); background: var(--warn-soft); border-color: transparent !important; }
.status-purchased { color: var(--ok); background: var(--ok-soft); border-color: transparent !important; }
.status-closed { color: var(--muted); background: var(--surface-2); }

/* ===== الفلاتر ===== */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.search { position: relative; flex: 1; min-width: 200px; }
.search input { padding-inline-start: 36px; }
.search .ico { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.filters .pair { display: flex; gap: 6px; }

/* ===== لوحة التحكم ===== */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { display: flex; gap: 12px; align-items: center; padding: 16px; }
.stat .ico-box { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.stat .ico-box .ico { width: 22px; height: 22px; }
.stat b { font-size: 1.55rem; display: block; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .85rem; }
a.stat:hover { text-decoration: none; border-color: var(--primary); }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.chart-box { position: relative; height: 260px; }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }

/* ===== العروض ===== */
.offers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.offer-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; color: var(--text); }
.offer-card:hover { text-decoration: none; border-color: var(--primary); }
.offer-card .thumb { aspect-ratio: 16 / 10; background: var(--surface-2); object-fit: cover; width: 100%; display: block; }
.offer-card .body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.price { font-weight: 800; color: var(--primary); font-size: 1.1rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.gallery .img { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.gallery .tools { position: absolute; inset-inline: 4px; bottom: 4px; display: flex; gap: 4px; justify-content: flex-end; }
.gallery .tools .btn { background: rgba(0,0,0,.6); color: #fff; border: 0; }
.gallery .cover-badge { position: absolute; top: 6px; inset-inline-start: 6px; }
.dropzone { border: 2px dashed var(--border); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); cursor: pointer; }
.dropzone.over { border-color: var(--primary); background: var(--primary-soft); }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.kv div { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; }
.kv span { display: block; color: var(--muted); font-size: .78rem; }
.kv b { font-weight: 700; }

.match-row { display: flex; gap: 12px; align-items: center; padding: 12px; border-bottom: 1px solid var(--border); }
.match-row:last-child { border-bottom: 0; }
.score { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; flex: none; font-size: .95rem;
  background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--border) 0); position: relative; }
.score::before { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.score span { position: relative; }
.match-thumb { width: 74px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--surface-2); flex: none; }

/* ===== النوافذ والتنبيهات ===== */
.modal-root { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(8, 15, 20, .55); }
.modal { background: var(--surface); border-radius: 16px; width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; position: sticky; bottom: 0; background: var(--surface); }
.toasts { position: fixed; bottom: 18px; inset-inline-start: 50%; transform: translateX(50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #13222e; color: #fff; padding: 10px 18px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 600; animation: pop .2s ease; max-width: 90vw; }
.toast.error { background: var(--danger); }
.toast.ok { background: #15803d; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }
.wa-preview { background: #e7ffdb; color: #111b21; border-radius: 10px 0 10px 10px; padding: 10px 12px; white-space: pre-wrap; font-size: .9rem; box-shadow: 0 1px 1px rgba(0,0,0,.1); }
:root[data-theme="dark"] .wa-preview { background: #005c4b; color: #e9edef; }
.wa-bg { background: #efe7de; border-radius: 12px; padding: 14px; }
:root[data-theme="dark"] .wa-bg { background: #0b141a; }
.progress { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress div { height: 100%; background: var(--primary); transition: width .2s; }
.var-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.var-chips button { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 8px; padding: 2px 8px; font: inherit; font-size: .8rem; cursor: pointer; }
.var-chips button:hover { border-color: var(--primary); color: var(--primary); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: 0; background: none; font: inherit; font-weight: 700; color: var(--muted); padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.type-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.type-pick label { border: 1px solid var(--border); border-radius: 10px; padding: 8px 16px; cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.type-pick input { display: none; }
.type-group { font-size: .8rem; color: var(--muted); font-weight: 700; min-width: 48px; align-self: center; }
.type-pick label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.timeline .list-item { align-items: flex-start; }
.timeline .dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.timeline .dot .ico { width: 16px; height: 16px; }
.tpl-layout { grid-template-columns: minmax(0, 260px) minmax(0, 1fr); }
.loading { display: flex; justify-content: center; padding: 50px; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== الجوال ===== */
@media (max-width: 960px) {
  .sidebar { transform: translateX(100%); box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; }
  .main { margin-inline-start: 0; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .content { padding: 16px 16px 60px; }
  .charts { grid-template-columns: 1fr; }
  .grid.c3, .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .grid.c2, .grid.c3, .grid.c4, .tpl-layout { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 12px; gap: 10px; }
  .stat .ico-box { width: 38px; height: 38px; }
  .stat b { font-size: 1.25rem; }
  /* الجدول يتحول إلى بطاقات */
  table.data.responsive thead { display: none; }
  table.data.responsive, table.data.responsive tbody, table.data.responsive tr, table.data.responsive td { display: block; width: 100%; }
  table.data.responsive tr { border-bottom: 1px solid var(--border); padding: 10px 12px; }
  table.data.responsive td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
  table.data.responsive td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 600; flex: none; }
  table.data.responsive td.primary-cell { font-size: 1rem; }
  table.data.responsive td.primary-cell::before { display: none; }
  table.data.responsive td.actions { justify-content: flex-end; padding-top: 8px; }
  table.data.responsive td.actions::before { display: none; }
  .modal-root { padding: 0; align-items: end; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92vh; }
  .page-head h1 { font-size: 1.2rem; }
  .filters { grid-template-columns: 1fr 1fr; }
  .match-row { flex-wrap: wrap; }
}

@media print {
  .sidebar, .topbar, .toolbar, .actions, .no-print, .status-actions, .page-head .btn, .toasts, .modal-root, .backdrop { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  .print-only { display: block; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; break-inside: avoid; }
  .price-total { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  table.data.responsive thead { display: table-header-group !important; }
  table.data.responsive { display: table !important; width: 100%; }
  table.data.responsive tbody { display: table-row-group !important; }
  table.data.responsive tr { display: table-row !important; }
  table.data.responsive td { display: table-cell !important; }
  table.data.responsive td::before { display: none !important; }
}
