:root {
    --ink: #0f1f17;
    --muted: #6b7a70;
    --bg: #f2f5f0;
    --surface: #ffffff;
    --line: #e3e9e1;
    --forest: #0b3d2e;
    --forest-2: #145a43;
    --emerald: #14815b;
    --emerald-2: #1fa374;
    --gold: #c9a24b;
    --gold-soft: #f6efdc;
    --danger: #b3261e;
    --danger-bg: #fdecea;
    --ok: #17613a;
    --ok-bg: #e4f4ea;
    --radius: 18px;
    --shadow: 0 1px 2px rgba(16, 40, 28, .05), 0 14px 34px -14px rgba(16, 40, 28, .18);
    --shadow-lg: 0 2px 6px rgba(16, 40, 28, .06), 0 28px 60px -20px rgba(16, 40, 28, .35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: "Segoe UI", "Noto Sans Arabic", Tahoma, "Noto Sans", Arial, sans-serif;
    line-height: 1.6;
    background:
        radial-gradient(900px 420px at 100% -80px, rgba(201, 162, 75, .13), transparent 60%),
        radial-gradient(800px 420px at -5% 0, rgba(31, 163, 116, .10), transparent 60%),
        var(--bg);
    background-attachment: fixed;
}

a { color: var(--emerald); }
h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -.01em; margin: 0; }
h2 { font-size: 1.1rem; font-weight: 700; margin: 0 0 16px; }
img { max-width: 100%; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 860px; }
.muted { color: var(--muted); }
.block { display: block; }
.inline { display: inline; margin: 0; }

/* ---------- Top bar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 20;
    margin-bottom: 32px;
    color: #fff;
    background: linear-gradient(115deg, var(--forest) 0%, var(--forest-2) 100%);
    box-shadow: 0 10px 30px -12px rgba(11, 61, 46, .55);
    border-bottom: 1px solid rgba(201, 162, 75, .55);
}
.topbar .container { display: flex; align-items: center; gap: 20px; min-height: 68px; flex-wrap: wrap; }
.brand {
    display: inline-flex; align-items: center; gap: 12px;
    font-weight: 800; font-size: 1.2rem; color: #fff; text-decoration: none; letter-spacing: .01em;
}
.brand::before {
    content: ""; width: 14px; height: 14px; flex: none;
    background: linear-gradient(135deg, #e7c872, var(--gold));
    transform: rotate(45deg); border-radius: 3px;
    box-shadow: 0 0 0 4px rgba(201, 162, 75, .22);
}
.topbar nav { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; flex-wrap: wrap; }
.topbar nav a, .link-btn {
    color: rgba(255, 255, 255, .88); text-decoration: none; font-size: .95rem; font-weight: 500;
    padding: 8px 14px; border-radius: 999px; transition: background .2s, color .2s;
}
.topbar nav a:hover, .link-btn:hover { background: rgba(255, 255, 255, .13); color: #fff; }
.link-btn { background: none; border: 0; font-family: inherit; cursor: pointer; }
.who {
    font-size: .88rem; padding: 6px 14px; border-radius: 999px; margin-inline: 6px;
    background: rgba(201, 162, 75, .18); color: #f3e2ae; border: 1px solid rgba(201, 162, 75, .35);
}

/* ---------- Layout ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1::after {
    content: ""; display: block; width: 44px; height: 4px; margin-top: 8px; border-radius: 4px;
    background: linear-gradient(90deg, var(--gold), #e7c872);
}
.count {
    display: inline-block; vertical-align: middle; margin-inline-start: 10px;
    font-size: .8rem; font-weight: 600; color: var(--emerald);
    background: rgba(20, 129, 91, .1); padding: 3px 12px; border-radius: 999px;
}
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 26px; margin-bottom: 20px; box-shadow: var(--shadow);
    animation: rise .45s ease both;
}
.empty { text-align: center; color: var(--muted); padding: 60px 20px; font-size: 1.05rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 11px 20px; border-radius: 12px; border: 1px solid var(--line);
    background: #fff; color: var(--ink); font: inherit; font-size: .95rem; font-weight: 600;
    text-decoration: none; cursor: pointer; line-height: 1.3;
    transition: transform .15s, box-shadow .2s, background .2s, border-color .2s;
}
.btn:hover { border-color: var(--emerald); transform: translateY(-1px); box-shadow: 0 8px 18px -10px rgba(20, 129, 91, .5); }
.btn:active { transform: none; }
.btn-primary {
    color: #fff; border-color: transparent;
    background: linear-gradient(135deg, var(--emerald) 0%, var(--forest-2) 100%);
    box-shadow: 0 10px 22px -10px rgba(11, 61, 46, .7);
}
.btn-primary:hover { border-color: transparent; background: linear-gradient(135deg, var(--emerald-2) 0%, var(--emerald) 100%); box-shadow: 0 14px 26px -10px rgba(20, 129, 91, .75); }
.btn-danger { color: var(--danger); border-color: #efcbc7; background: #fff; }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); box-shadow: 0 8px 18px -10px rgba(179, 38, 30, .5); }
.btn-ghost { background: rgba(255, 255, 255, .6); }
.btn-sm { padding: 7px 13px; font-size: .84rem; border-radius: 10px; }
.btn-block { display: flex; width: 100%; padding: 13px 20px; font-size: 1rem; }

/* ---------- Forms ---------- */
.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 700; margin-bottom: 8px; font-size: .92rem; color: #24372c; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="search"], select {
    width: 100%; padding: 12px 16px; border: 1.5px solid #d6dfd4; border-radius: 12px;
    font: inherit; background: #fbfcfa; color: var(--ink);
    transition: border-color .2s, box-shadow .2s, background .2s;
}
input::placeholder { color: #9aa79e; }
select {
    -webkit-appearance: none; appearance: none; cursor: pointer;
    padding-inline-end: 44px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2324372c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 16px center;
}
html[dir="ltr"] select { background-position: right 16px center; }
.input-suffix { position: relative; }
.input-suffix input { padding-inline-end: 52px; }
.input-suffix span {
    position: absolute; inset-block: 0; inset-inline-end: 16px; display: flex; align-items: center;
    color: var(--muted); font-weight: 700; pointer-events: none;
}
input:hover, select:hover { border-color: #b9c8b6; }
input:focus, select:focus { outline: 0; border-color: var(--emerald); background-color: #fff; box-shadow: 0 0 0 4px rgba(20, 129, 91, .15); }
.btn:focus-visible, .link-btn:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
input[type="file"] {
    width: 100%; padding: 14px; border: 1.5px dashed #bfd0bd; border-radius: 12px; background: #f7faf6; font: inherit; cursor: pointer;
}
input[type="file"]:hover { border-color: var(--emerald); background: #f1f7f2; }
input[type="file"]::file-selector-button {
    margin-inline-end: 14px; padding: 8px 16px; border: 0; border-radius: 9px; cursor: pointer;
    background: var(--forest-2); color: #fff; font: inherit; font-size: .88rem; font-weight: 600;
}
.hint { margin: 8px 0 0; font-size: .84rem; color: var(--muted); }
.field-error { margin: 8px 0 0; font-size: .86rem; font-weight: 600; color: var(--danger); }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.current-deed { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.deed-preview { display: block; max-width: 280px; margin-top: 14px; border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.deed-preview[hidden] { display: none; }

/* ---------- Filters ---------- */
.filters {
    display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; position: relative; overflow: hidden;
    padding-top: 30px;
}
.filters::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 5px;
    background: linear-gradient(90deg, var(--emerald), var(--gold));
}
.filters .field { margin-bottom: 0; min-width: 190px; }
.filters .field.grow { flex: 1 1 280px; }
.filter-actions { display: flex; gap: 10px; min-width: 0 !important; }

/* ---------- Alerts ---------- */
.alert { padding: 14px 20px; border-radius: 14px; margin-bottom: 20px; font-weight: 600; border: 1px solid transparent; animation: rise .4s ease both; }
.alert-success { background: var(--ok-bg); color: var(--ok); border-color: #bfe3cc; }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: #f2c5c1; }

/* ---------- Table ---------- */
.table-wrap { padding: 0; overflow-x: auto; }
table.lands { width: 100%; border-collapse: separate; border-spacing: 0; }
table.lands th, table.lands td { padding: 16px 20px; vertical-align: middle; border-bottom: 1px solid var(--line); }
table.lands th {
    background: linear-gradient(180deg, #f7faf6, #eef3ec); color: #4a5d51;
    font-size: .78rem; font-weight: 700; letter-spacing: .04em; white-space: nowrap;
    position: sticky; top: 0;
}
table.lands tbody tr { transition: background .15s; }
table.lands tbody tr:hover { background: #f7fbf6; }
table.lands tbody tr:last-child td { border-bottom: 0; }
table.lands td strong { font-weight: 700; }
html[dir="rtl"] table.lands th, html[dir="rtl"] table.lands td { text-align: right; }
html[dir="ltr"] table.lands th, html[dir="ltr"] table.lands td { text-align: left; }
.row-actions { white-space: nowrap; }
.row-actions .btn { margin-inline-end: 4px; }
.thumb {
    width: 88px; height: 62px; object-fit: cover; display: block; border-radius: 12px;
    border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line), 0 6px 14px -6px rgba(16, 40, 28, .35);
    transition: transform .2s, box-shadow .2s;
}
a:hover > .thumb { transform: scale(1.08); box-shadow: 0 0 0 1px var(--gold), 0 14px 24px -8px rgba(16, 40, 28, .45); }
.pagination { display: flex; gap: 16px; justify-content: center; align-items: center; margin: 26px 0 40px; }

/* ---------- Details ---------- */
.detail-grid { display: grid; grid-template-columns: 210px 1fr; margin: 0; }
.detail-grid dt, .detail-grid dd { padding: 15px 0; border-bottom: 1px solid var(--line); margin: 0; }
.detail-grid dt { color: var(--muted); font-weight: 600; font-size: .92rem; }
.detail-grid dd { font-weight: 600; }
.detail-grid dt:nth-last-of-type(1), .detail-grid dd:last-of-type { border-bottom: 0; }
html[dir="rtl"] .detail-grid dd { text-align: right; }
html[dir="ltr"] .detail-grid dd { text-align: left; }
.deed-full {
    display: block; width: 100%; min-height: 160px; border-radius: 16px; background: #eef2ec;
    border: 1px solid var(--line); box-shadow: var(--shadow); transition: box-shadow .2s;
}
a:hover > .deed-full { box-shadow: var(--shadow-lg); }

/* ---------- Login / error pages ---------- */
.auth-page {
    background:
        radial-gradient(900px 520px at 85% -10%, rgba(201, 162, 75, .28), transparent 60%),
        radial-gradient(800px 560px at -10% 110%, rgba(31, 163, 116, .35), transparent 55%),
        linear-gradient(160deg, #0b3d2e 0%, #0d2a20 100%);
    background-attachment: fixed;
}
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card {
    width: 100%; max-width: 430px; background: rgba(255, 255, 255, .97); border-radius: 24px;
    padding: 44px 38px 36px; box-shadow: var(--shadow-lg); border: 1px solid rgba(255, 255, 255, .6);
    position: relative; animation: rise .55s ease both;
}
.auth-card::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; border-radius: 24px 24px 0 0;
    background: linear-gradient(90deg, var(--emerald), var(--gold));
}
.auth-card h1 { font-size: 1.7rem; margin-bottom: 6px; }
.auth-card .muted { margin: 0 0 26px; }
.lang-switch { text-align: center; margin: 24px 0 0; }
.lang-switch a { color: var(--muted); text-decoration: none; font-weight: 600; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); }
.lang-switch a:hover { color: var(--emerald); border-color: var(--emerald); }
.error-card { text-align: center; }
.error-code {
    font-size: 4.5rem; font-weight: 800; margin: 0; line-height: 1;
    background: linear-gradient(135deg, var(--emerald), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.error-card h1 { margin: 12px 0 24px; font-size: 1.25rem; }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
    .container { padding: 0 16px; }
    .topbar .container { min-height: 60px; padding-block: 8px; }
    .topbar nav { margin-inline-start: 0; width: 100%; }
    .card { padding: 20px; border-radius: 16px; }
    .grid-2 { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-grid dt { padding: 12px 0 0; border: 0; font-size: .8rem; }
    .detail-grid dd { padding: 2px 0 12px; }

    .table-wrap { background: transparent; border: 0; box-shadow: none; }
    table.lands, table.lands tbody, table.lands tr, table.lands td { display: block; width: 100%; }
    table.lands thead { display: none; }
    table.lands tr {
        background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 10px 16px;
        margin-bottom: 14px; box-shadow: var(--shadow);
    }
    table.lands td { border: 0; padding: 7px 0; display: flex; justify-content: space-between; gap: 14px; align-items: center; }
    table.lands td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 700; flex: none; }
    .row-actions { flex-wrap: wrap; justify-content: flex-end !important; }
    .auth-card { padding: 38px 24px 30px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- تصدير ---------- */
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bulk-bar { display: flex; align-items: center; gap: 10px; padding: 12px 18px; margin-bottom: 12px; }
.bulk-bar .muted { margin-inline-end: auto; }
th.sel, td.sel { width: 36px; text-align: center; }
.print-toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 14px 20px; background: #f4f1e8; border-bottom: 1px solid #d9d3c0; }
.print-doc { max-width: 820px; margin: 0 auto; padding: 24px 20px; }
.print-doc h1 { font-size: 1.3rem; margin: 0 0 4px; }
.print-land { border: 1px solid #d9d3c0; border-radius: 10px; padding: 18px; margin: 0 0 18px; break-inside: avoid; page-break-inside: avoid; }
.print-land h2 { font-size: 1.1rem; margin: 0 0 12px; }
.print-land .deed-print { display: block; max-width: 100%; max-height: 420px; margin-top: 12px; border: 1px solid #d9d3c0; }
@media print {
    .print-toolbar { display: none !important; }
    .print-doc { padding: 0; max-width: none; }
    body { background: #fff; }
    .print-land { break-after: auto; }
}

/* ---------- قائمة الأراضي: المرفق والإجراءات ---------- */
.att-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: inherit; text-decoration: none; font-weight: 700; font-size: .84rem; }
.att-link:hover { border-color: var(--gold); }
.actions-wrap { display: inline-flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.actions-wrap form.inline { margin: 0; }
.row-actions .actions-wrap .btn { margin-inline-end: 0; }

/* ---------- PDF: جدول لعدة أراضي ---------- */
.print-doc.wide { max-width: none; }
.print-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.print-table th, .print-table td { border: 1px solid #d9d3c0; padding: 7px 9px; text-align: start; vertical-align: top; word-break: break-word; }
.print-table th { background: #f4f1e8; font-weight: 700; }
.print-table thead { display: table-header-group; }
.print-table tr { break-inside: avoid; page-break-inside: avoid; }

/* ---------- Compact lands table (no horizontal scroll on desktop) ---------- */
.container.wide { max-width: 1480px; }
@media (min-width: 761px) {
    .table-wrap { overflow-x: visible; }
    table.lands { font-size: .84rem; table-layout: auto; }
    table.lands th, table.lands td { padding: 10px 7px; word-break: break-word; }
    table.lands th { font-size: .8rem; white-space: normal; }
    table.lands .btn-sm { padding: 5px 9px; font-size: .78rem; }
    table.lands .actions-wrap { display: flex; flex-wrap: wrap; gap: 4px; }
    table.lands .att-link span { display: none; }
}

/* مسافة بين المحافظة/المديرية والقرية */
@media (min-width: 761px) {
    table.lands th:nth-child(2), table.lands td:nth-child(2) { padding-inline-end: 26px; min-width: 110px; }
    table.lands th:nth-child(3), table.lands td:nth-child(3) { padding-inline-start: 26px; min-width: 100px; }
}


/* =====================================================================
   Premium theme
   ===================================================================== */
:root {
    --gold-2: #e7c872;
    --paper: #fbfaf6;
    --shadow: 0 1px 2px rgba(16, 40, 28, .04), 0 18px 40px -18px rgba(16, 40, 28, .22);
}
body {
    background:
        radial-gradient(1000px 460px at 100% -100px, rgba(201, 162, 75, .16), transparent 60%),
        radial-gradient(900px 460px at -8% 0, rgba(31, 163, 116, .12), transparent 60%),
        linear-gradient(180deg, #f4f6f1 0%, #eef2ec 100%);
    background-attachment: fixed;
}
h1 { font-size: 2rem; letter-spacing: -.015em; color: var(--forest); }

.topbar {
    background:
        linear-gradient(115deg, rgba(11, 61, 46, .98) 0%, rgba(20, 90, 67, .98) 100%);
    border-bottom: 0;
    box-shadow: 0 14px 34px -16px rgba(11, 61, 46, .6);
}
.topbar::after {
    content: ""; display: block; height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold-2) 50%, var(--gold) 80%, transparent);
}
.topbar nav a { border: 1px solid transparent; }
.topbar nav a:hover { border-color: rgba(231, 200, 114, .35); }

.card {
    border-radius: 22px; border: 1px solid rgba(214, 223, 212, .9);
    background: linear-gradient(180deg, #fff 0%, var(--paper) 100%);
}
.btn { border-radius: 12px; letter-spacing: .01em; }
.btn-primary {
    background: linear-gradient(135deg, var(--emerald) 0%, var(--forest-2) 60%, var(--forest) 100%);
    border: 1px solid rgba(231, 200, 114, .35);
    box-shadow: 0 12px 24px -12px rgba(11, 61, 46, .8), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--emerald-2) 0%, var(--emerald) 100%); border-color: var(--gold-2); }
input:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201, 162, 75, .2); }

.filters { border-radius: 22px; }
.bulk-bar { border-radius: 18px; }

/* ---------- Table ---------- */
.table-wrap.card { border-radius: 22px; overflow: hidden; background: #fff; }
table.lands th {
    background: linear-gradient(180deg, var(--forest-2) 0%, var(--forest) 100%);
    color: #f6efdc; font-size: .8rem; font-weight: 700; letter-spacing: .02em;
    border-bottom: 3px solid var(--gold); position: static;
}
table.lands tbody tr:nth-child(even) { background: #f8faf6; }
table.lands tbody tr:hover { background: #f1f7ee; box-shadow: inset 4px 0 0 var(--gold); }
html[dir="rtl"] table.lands tbody tr:hover { box-shadow: inset -4px 0 0 var(--gold); }
table.lands td { color: #1b2e24; border-bottom: 1px solid #e8eee6; }
table.lands td strong { color: var(--forest); font-size: .95rem; }
table.lands td small.muted { font-size: .76rem; }
.num { font-weight: 700; font-variant-numeric: tabular-nums; }
.pill {
    display: inline-block; min-width: 54px; padding: 3px 11px; border-radius: 999px; font-weight: 700; font-size: .8rem;
    color: var(--forest); background: linear-gradient(180deg, #fbf3dc, var(--gold-soft)); border: 1px solid rgba(201, 162, 75, .55);
}
.att-link {
    display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 12px;
    color: var(--forest-2); background: #f1f7ee; border: 1px solid #cfe0cf; transition: all .2s;
}
.att-link:hover { background: var(--forest-2); color: #fff; border-color: var(--forest-2); }
table.lands input[type="checkbox"] { accent-color: var(--forest-2); width: 16px; height: 16px; }

@media (min-width: 761px) {
    table.lands th, table.lands td { text-align: center !important; vertical-align: middle; padding: 13px 7px; }
    table.lands .actions-wrap { justify-content: center; }
    table.lands .btn-sm { border-radius: 9px; }
}

/* ---------- Print / PDF ---------- */
.print-toolbar { background: linear-gradient(115deg, var(--forest), var(--forest-2)); border-bottom: 3px solid var(--gold); }
.print-doc { max-width: 900px; font-family: "Segoe UI", "Noto Sans Arabic", Tahoma, Arial, sans-serif; color: #14241b; }
.print-doc.wide { max-width: none; }
.print-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
    padding-bottom: 14px; margin-bottom: 18px; border-bottom: 3px solid var(--gold);
}
.print-head h1 { font-size: 1.5rem; color: var(--forest); margin: 0; }
.print-head h1::after { display: none; }
.print-head .meta { text-align: end; font-size: .85rem; color: var(--muted); line-height: 1.7; }
.print-head .meta strong { color: var(--forest); }
.print-table { border-collapse: collapse; width: 100%; font-size: .8rem; table-layout: auto; }
.print-table th {
    background: var(--forest); color: #fff; font-weight: 700; text-align: center; padding: 9px 5px;
    border: 1px solid var(--forest-2); -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.print-table td { text-align: center; padding: 8px 5px; border: 1px solid #d5ddd3; vertical-align: middle; }
.print-table tbody tr:nth-child(even) td { background: #f5f8f3; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.print-table td.n, .print-table th.n { width: 28px; }
.print-land { border: 1px solid #cfd8cc; border-radius: 14px; padding: 0; overflow: hidden; }
.print-land h2 {
    margin: 0; padding: 14px 20px; font-size: 1.1rem; color: #fff; background: var(--forest);
    border-bottom: 3px solid var(--gold); -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.print-land .detail-grid { padding: 6px 20px; grid-template-columns: 180px 1fr; }
.print-land .detail-grid dt, .print-land .detail-grid dd { padding: 9px 0; }
.print-land .deed-print { margin: 14px 20px 20px; max-width: calc(100% - 40px); border-radius: 10px; }
@media print {
    body { background: #fff !important; }
    .print-doc.wide { padding: 0; }
}

/* PDF: لا تترك صفحة فاضية — البطاقة تبدأ بنفس الصفحة وتنكسر إذا لزم */
.print-land { break-inside: auto !important; page-break-inside: auto !important; }
.print-land h2, .print-land .detail-grid { break-inside: avoid; page-break-inside: avoid; }
.print-land .deed-print { max-height: 100mm; width: auto; max-width: calc(100% - 40px); object-fit: contain; break-inside: avoid; }
@media print {
    .print-doc { margin: 0; }
    .print-head { margin-bottom: 10px; }
}

/* ---------- Multiple attachments ---------- */
.file-grid { display: flex; flex-wrap: wrap; gap: 14px; margin: 12px 0 4px; }
.file-grid:empty { display: none; }
.file-item { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 112px; }
.file-thumb {
    display: flex; align-items: center; justify-content: center; width: 112px; height: 84px; overflow: hidden;
    border-radius: 14px; border: 1px solid var(--line); background: #f1f6ee; box-shadow: var(--shadow);
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-ext { font-weight: 800; color: var(--forest-2); letter-spacing: .04em; }
.file-name { max-width: 112px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .74rem; }
.file-remove { display: flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 600; color: var(--danger); cursor: pointer; }
.file-remove input { accent-color: var(--danger); }
.file-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.file-gallery .deed-full { min-height: 0; }
.att-group { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.att-group .pill { text-decoration: none; min-width: 0; }
