@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Readex+Pro:wght@400;500;600;700&display=swap');

:root {
  --paper: #f7f4ee;
  --paper-deep: #eee9df;
  --surface: #fffdf8;
  --surface-alt: #f2eee6;
  --ink: #20251f;
  --muted: #6f746d;
  --line: #d9d5cc;
  --line-strong: #bcb8ae;
  --olive: #4d6048;
  --olive-dark: #354534;
  --olive-light: #e4eadf;
  --ochre: #bd762f;
  --ochre-light: #f4e3c9;
  --red: #a24d43;
  --red-light: #f4dfda;
  --blue: #536b7a;
  --shadow: 0 8px 22px rgba(49, 56, 46, .07);
  --radius: 14px;
  --display: "Readex Pro", sans-serif;
  --body: "IBM Plex Sans Arabic", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.7;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner, .main-shell, .footer-inner { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.header-inner {
  min-height: 132px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-logo { display: block; width: 160px; height: 120px; object-fit: contain; }
.nav { display: none; align-items: center; gap: 4px; }
.nav a, .nav button { background: transparent; border: 0; color: var(--muted); padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.nav a:hover, .nav button:hover, .nav a.active { background: var(--olive-light); color: var(--olive-dark); }
.header-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
.auth-chip { color: var(--olive-dark); background: var(--olive-light); border: 1px solid #c8d4c1; padding: 4px 9px; border-radius: 20px; font-size: 11px; }

.main-shell { padding: 30px 0 64px; min-height: calc(100dvh - 132px); }
.hero {
  display: grid; gap: 26px; align-items: end;
  padding: 28px 0 24px;
  border-bottom: 1px solid var(--line);
}
.eyebrow { color: var(--ochre); font-size: 12px; font-weight: 700; letter-spacing: .04em; margin: 0 0 9px; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.25; }
h1 { font-size: clamp(30px, 7vw, 58px); letter-spacing: -.04em; max-width: 680px; }
h1 span { color: var(--olive); }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
.hero-copy { color: var(--muted); max-width: 580px; margin: 15px 0 0; font-size: 16px; }
.hero-note { color: var(--muted); border-right: 3px solid var(--ochre); padding-right: 13px; font-size: 13px; }

.search-panel {
  background: var(--olive-dark); color: var(--surface);
  border-radius: var(--radius); padding: 16px;
  margin: 22px 0 30px;
}
.search-panel form { display: grid; gap: 9px; }
.field, .select, textarea, input[type="text"], input[type="number"], input[type="password"], input[type="tel"], input[type="url"], input[type="date"], input[type="file"] {
  width: 100%; min-height: 43px; background: var(--surface);
  color: var(--ink); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; outline: none;
}
.search-panel input, .search-panel select { background: #fbfcf7; border-color: #9ba796; }
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--olive); box-shadow: 0 0 0 2px rgba(77, 96, 72, .12); }
.form-label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 4px; }
.search-panel .form-label { color: #cbd5c6; }
.search-actions { display: flex; gap: 8px; align-items: end; }
.button {
  border: 1px solid transparent; min-height: 40px; padding: 8px 15px; border-radius: 8px;
  background: var(--olive); color: var(--surface); font-weight: 600; font-size: 13px;
}
.button:hover { background: var(--olive-dark); }
.button.secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.button.secondary:hover { background: var(--surface-alt); }
.button.ochre { background: var(--ochre); }
.button.danger { background: var(--red); }
.button.small { min-height: 33px; padding: 5px 10px; font-size: 12px; }
.button:disabled { opacity: .5; cursor: not-allowed; }

.section { margin-top: 34px; }
.section-head { display: flex; justify-content: space-between; gap: 14px; align-items: end; margin-bottom: 14px; }
.section-head p { color: var(--muted); margin: 4px 0 0; font-size: 13px; }
.categories { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.category-link {
  padding: 13px 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; display: flex; justify-content: space-between; align-items: center; font-size: 13px;
}
.category-link:hover { border-color: var(--olive); color: var(--olive-dark); }
.category-link b { color: var(--ochre); font-family: var(--display); font-size: 18px; }
.cards-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 17px; box-shadow: var(--shadow);
}
.card:hover { border-color: #adb9a8; }
.card-top { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.card-title { font-size: 17px; margin-bottom: 5px; }
.card-subtitle { color: var(--muted); font-size: 12px; margin: 0 0 12px; }
.tag {
  display: inline-flex; align-items: center; border-radius: 5px; padding: 3px 7px;
  font-size: 11px; color: var(--olive-dark); background: var(--olive-light); white-space: nowrap;
}
.tag.request { color: #7a4a16; background: var(--ochre-light); }
.tag.status { color: var(--blue); background: #e2e9ec; }
.meta-grid { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); padding-top: 11px; gap: 8px 14px; }
.meta-item { display: flex; flex-direction: column; }
.meta-item span:first-child { color: var(--muted); font-size: 11px; }
.meta-item span:last-child { font-size: 13px; font-weight: 600; }
.card-actions { display: flex; gap: 7px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 13px; padding-top: 12px; }
.photo-strip { display: flex; gap: 6px; overflow: hidden; margin: -3px -3px 12px; border-radius: 8px; }
.photo-strip img { height: 112px; flex: 1; min-width: 0; object-fit: cover; background: var(--paper-deep); }
.photo-strip img:first-child { flex: 2; }

.detail-layout { display: grid; gap: 20px; }
.detail-main, .detail-aside { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.detail-main h1 { font-size: clamp(25px, 5vw, 43px); margin-bottom: 10px; }
.detail-description { white-space: pre-line; color: #454b45; font-size: 15px; }
.detail-aside { height: fit-content; background: var(--olive-dark); color: var(--surface); border-color: var(--olive-dark); }
.detail-aside .muted { color: #c7d1c5; }
.detail-aside .form-label { color: #c7d1c5; }
.detail-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 15px; }
.detail-photo { width: 100%; height: 190px; object-fit: cover; border-radius: 9px; }
.detail-gallery .detail-photo:first-child { grid-column: 1 / -1; height: min(50vw, 430px); min-height: 220px; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.back-link { display: inline-flex; color: var(--olive); font-size: 13px; margin-bottom: 16px; }
.locked { padding: 12px; border: 1px dashed #80907b; border-radius: 8px; color: #d5dfd2; font-size: 13px; }

.admin-bar { background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px; margin-bottom: 18px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; }
.admin-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 1px; margin-bottom: 16px; }
.tab { white-space: nowrap; border: 1px solid var(--line); background: var(--surface); padding: 8px 13px; border-radius: 8px; color: var(--muted); }
.tab.active { background: var(--olive); color: var(--surface); border-color: var(--olive); }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.admin-table { width: 100%; border-collapse: collapse; min-width: 700px; font-size: 13px; }
.admin-table th { text-align: right; color: var(--muted); font-weight: 500; background: var(--surface-alt); }
.admin-table td, .admin-table th { padding: 11px 13px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table tr:last-child td { border-bottom: 0; }
.row-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.status-select { min-height: 30px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 12px; }
.form-card { background: var(--surface); border: 1px solid var(--line); padding: 18px; border-radius: 12px; margin-bottom: 17px; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 11px; }
.field-full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.upload-preview { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.upload-preview img { width: 76px; height: 58px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }

.notice { border: 1px solid #d9b67f; background: #fbf0dd; color: #6d4a1d; border-radius: 10px; padding: 12px 14px; margin: 12px 0; font-size: 13px; }
.notice.error { border-color: #d8aaa4; background: var(--red-light); color: #743c36; }
.notice.success { border-color: #b8cdb1; background: var(--olive-light); color: var(--olive-dark); }
.state { border: 1px dashed var(--line-strong); border-radius: 12px; text-align: center; padding: 30px 18px; color: var(--muted); background: rgba(255,253,248,.55); }
.state strong { color: var(--ink); display: block; margin-bottom: 4px; }
.skeleton { height: 125px; background: var(--paper-deep); border-radius: var(--radius); }
.error-page { text-align: center; padding: 70px 20px; }
.muted { color: var(--muted); }
.footer { background: var(--olive-dark); color: #e2e9df; padding: 26px 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12px; }
.footer p { margin: 0; color: #bdc9b9; }
.toast { position: fixed; bottom: 18px; right: 18px; left: 18px; z-index: 30; padding: 11px 14px; border-radius: 9px; background: var(--ink); color: var(--surface); font-size: 13px; text-align: center; }
.hidden { display: none !important; }
.modal-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(32,37,31,.36); display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; width: min(430px, 100%); padding: 21px; }
.modal-head { display:flex; justify-content:space-between; align-items:start; gap:12px; margin-bottom: 14px; }
.icon-button { border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; }
.contact-card { display: grid; gap: 4px; }
.contact-name { font-family: var(--display); font-size: 18px; font-weight: 600; }
.contact-actions { display:flex; gap:7px; flex-wrap:wrap; margin-top:11px; }
.link-button { color: var(--olive); border: 0; background: transparent; padding: 0; font-weight: 600; }

@media (min-width: 680px) {
  .nav { display: flex; }
  .hero { grid-template-columns: minmax(0, 1.3fr) minmax(230px, .7fr); }
  .search-panel form { grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto; }
  .search-actions { display: block; }
  .categories { grid-template-columns: repeat(4, 1fr); }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .header-inner, .main-shell, .footer-inner { width: min(1180px, calc(100% - 64px)); }
  .detail-layout { grid-template-columns: minmax(0, 1.5fr) minmax(290px, .5fr); align-items: start; }
  .cards-grid.three { grid-template-columns: repeat(3, 1fr); }
  .toast { left: auto; min-width: 270px; }
}