:root {
  --brand: #1a3028; --brand-dark: #050606; --accent: #ea8224;
  --ink: #17251f; --muted: #5d6b63; --bg: #fbfbfb; --line: #d6dad8; --bad: #b3402f;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { font-family: 'Inter', 'Noto Sans Ethiopic', system-ui, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-dark); }
.muted, small { color: var(--muted); font-size: .82rem; }
.h2 { font-size: 1.3rem; margin-bottom: 16px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 40px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none; transition: background .2s, color .2s, border-color .2s;
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); }
.btn--ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--brand); }
.btn--danger { background: #fff; border-color: #e8c6c0; color: var(--bad); }
.btn--danger:hover { background: var(--bad); color: #fff; }
.btn--sm { min-height: 32px; padding: 0 12px; font-size: .8rem; border-radius: 8px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* Forms */
label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; font-weight: 600; }
input, select, textarea { padding: 10px 12px; border: 1px solid #cfdad1; border-radius: 10px; background: #fff; width: 100%; font-weight: 400; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(26,48,40,.35); border-color: var(--brand); }
textarea { resize: vertical; }
small { font-weight: 400; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, #050606, #1a3028); }
.login__card { width: min(380px, 100%); background: #fff; border-radius: 18px; padding: 32px 28px; display: grid; gap: 14px; box-shadow: 0 30px 60px rgba(0,0,0,.35); }
.login__logo { height: 44px; width: auto; }
.login__card h1 { font-size: 1.4rem; }
.msg { min-height: 1.2em; color: var(--bad); font-size: .85rem; }

/* Top bar */
.top { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 12px clamp(16px,3vw,32px); background: #1a3028; color: #fff; position: sticky; top: 0; z-index: 10; }
.top__brand { font-weight: 700; letter-spacing: .5px; }
.top__brand span { color: var(--accent); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { background: transparent; border: 0; color: #c4d3c8; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.tab:hover { color: #fff; }
.tab.is-active { background: rgba(255,255,255,.12); color: #fff; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--accent); color: #050606; font-size: .72rem; text-align: center; }
.top__right { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.top .muted { color: #9fb2a5; }
.session-timeout { color: #d7c58f; font-size: .72rem; font-weight: 600; }
.top .btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.top .btn--ghost:hover { border-color: #fff; }

.wrap { width: min(1200px, 100%); margin: 0 auto; padding: 24px clamp(16px,3vw,32px) 60px; }

/* Stats and toolbar */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-size: 1.6rem; color: var(--brand-dark); }
.stat span { font-size: .78rem; color: var(--muted); font-weight: 600; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input { flex: 1 1 200px; width: auto; }
.toolbar select { width: auto; }

/* Table */
.tablewrap { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid #eef3ef; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.thumb { width: 64px; height: 48px; border-radius: 8px; object-fit: cover; background: linear-gradient(135deg, #1a3028, #8c9c94); display: block; }
.name b { display: block; }
.name small { display: block; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: #e8f0e9; color: var(--brand-dark); white-space: nowrap; }
.pill--under_construction { background: var(--accent); color: #050606; }
.pill--completed { background: var(--brand); color: #fff; }
.pill--off { background: #eee; color: #666; }
.bar { width: 90px; height: 6px; border-radius: 999px; background: rgba(58,125,68,.15); overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 6px; }
.bar i { display: block; height: 100%; background: var(--brand); }
.actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.pill--for_sale { background: #e9f2ff; color: #24518a; }

/* Hero slide management */
.hero-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.hcard { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.hcard__img { display: block; width: 100%; height: 190px; object-fit: cover; background: #e8eee9; }
.hcard__body { display: grid; gap: 10px; padding: 14px; }
.hcard__body h3 { font-size: 1rem; }
.hcard__body h3 em { color: var(--brand); font-style: normal; }
.hcard__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hero-preview { display: grid; gap: 6px; min-height: 110px; align-content: center; padding: 18px; border-radius: 8px; background: #1a3028; color: #fff; }
.hero-preview small { color: var(--accent); text-transform: uppercase; }
.hero-preview strong { font-size: 1.2rem; }
.hero-preview em { color: #8fd49a; font-style: normal; }
.hero-preview p { color: #d3dfd5; font-size: .85rem; }
.hero-preview .hero__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-preview .hero__cta {
  display: inline-flex; width: fit-content; margin-top: 4px; padding: 8px 14px;
  border-radius: 999px; background: var(--accent); color: #050606;
  font-size: .8rem; font-weight: 700; text-decoration: none;
}
.hero-cta-editor { display: grid; gap: 12px; }
.hero-cta-editor__heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero-cta-editor__heading h3 { font-size: .95rem; }
.hero-cta-editor__heading p { margin-top: 3px; color: var(--muted); font-size: .78rem; font-weight: 400; }
.hero-cta-editor__list { display: grid; gap: 12px; }
.hero-cta-row { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.hero-cta-row__heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--brand-dark); font-size: .86rem; }
.hero-cta-row label { min-width: 0; gap: 6px; font-size: .78rem; }
.hero-cta-row__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hero-cta-row [hidden] { display: none !important; }
.project-preview-wrap { display: grid; justify-items: center; gap: 8px; }
.project-preview__label { width: min(100%, 390px); color: var(--muted); font-size: .75rem; font-weight: 700; }
.project-preview {
  --preview-accent: #ea8224;
  --preview-accent-ink: #050606;
  --preview-accent-soft: rgba(201,162,74,.2);
  display: flex; width: min(100%, 390px); flex-direction: column; gap: 14px;
  padding: 14px; border: 0; border-radius: 28px; background: #fff;
  box-shadow: 0 20px 40px -18px rgba(20,38,26,.28);
}
.project-preview[data-status="pre_launch"] { --preview-accent: #2f6f8f; --preview-accent-ink: #fff; --preview-accent-soft: rgba(47,111,143,.14); }
.project-preview[data-status="completed"] { --preview-accent: #1a3028; --preview-accent-ink: #fff; --preview-accent-soft: rgba(26,48,40,.14); }
.project-preview__thumb {
  position: relative; display: grid; aspect-ratio: 4 / 3; overflow: hidden;
  border-radius: 14px; background: linear-gradient(135deg, #1d4a27, #5fb36d);
}
.project-preview__thumb > img { grid-area: 1 / 1; width: 100%; height: 100%; object-fit: cover; }
.project-preview__location {
  position: absolute; top: 0; left: 0; z-index: 1; display: flex; align-items: center;
  max-width: calc(100% - 40px); min-height: 32px; gap: 6px; padding: 6px 14px;
  border-bottom-right-radius: 14px; background: #fff; color: var(--ink);
  font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.project-preview__location svg { width: 12px; height: 12px; flex: 0 0 auto; fill: var(--preview-accent); }
.project-preview__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 12px; padding: 6px 4px 0; }
.project-preview__row h3 { min-width: 0; color: #1a3028; font-size: 1.2rem; line-height: 1.25; }
.project-preview__status { flex-shrink: 0; padding: .5em 1em; border-radius: 999px; background: var(--preview-accent); color: var(--preview-accent-ink); font-size: .72rem; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.project-preview__desc { display: -webkit-box; overflow: hidden; padding: 0 4px; color: var(--muted); font-size: .88rem; line-height: 1.65; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.project-preview__tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 4px; list-style: none; }
.project-preview__tags li { padding: .5em 1em; border-radius: 999px; background: var(--preview-accent-soft); color: #33433a; font-size: .75rem; font-weight: 600; }
.project-preview__actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: auto; }
.project-preview__actions span { display: flex; min-width: 0; min-height: 42px; align-items: center; justify-content: center; padding: 0 .35rem; border: 1px solid #d9e3db; border-radius: 999px; color: #1a3028; }
.project-preview__actions svg { width: 1.25rem; height: 1.25rem; fill: currentColor; }
.project-preview__actions span:nth-child(2) svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.project-preview__more { display: flex; min-height: 48px; align-items: center; justify-content: center; padding: 0 1em; border-radius: 999px; background: var(--preview-accent); color: var(--preview-accent-ink); font-size: .92rem; font-weight: 700; }
.photo { display: flex; align-items: center; gap: 16px; }
.photo img { width: 180px; max-height: 120px; object-fit: cover; border-radius: 8px; }
.photo > div { display: grid; gap: 8px; }
.check { flex-direction: row; align-items: center; }
.check input { width: auto; }
.icon { width: 36px; height: 36px; border: 0; background: transparent; cursor: pointer; font-size: 1.5rem; }
@media (max-width: 520px) {
  .project-preview-wrap { grid-column: 1 / -1; }
}

/* Inquiries */
.inq { display: grid; gap: 12px; }
.inq__item { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.inq__item.is-new { border-left: 4px solid var(--accent); }
.inq__head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.inq__msg { margin: 8px 0 12px; white-space: pre-wrap; }
.inq__links { display: flex; gap: 8px; flex-wrap: wrap; }
.listing-admin-status { margin: 0 0 14px; color: var(--muted); font-size: .84rem; }
.listing-admin-status.is-error { color: var(--bad); }
.listing-admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.listing-admin-card { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.listing-admin-card__image { display: block; width: 100%; height: 180px; object-fit: cover; background: linear-gradient(135deg, #1a3028, #8c9c94); }
.listing-admin-card__body { display: grid; gap: 8px; padding: 14px; }
.listing-admin-card__heading, .listing-admin-card__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.listing-admin-card__heading h3 { min-width: 0; overflow-wrap: anywhere; font-size: 1rem; }
.listing-admin-card__body > p { color: var(--muted); font-size: .82rem; }
.listing-admin-card__body > strong { color: var(--brand-dark); }
.listing-admin-hot { flex: 0 0 auto; padding: 4px 9px; border-radius: 999px; background: #ffe500; color: #17221a; font-size: .7rem; font-weight: 800; }
.listing-photo img { width: min(220px, 42vw); max-height: 150px; }
.listing-card a:focus-visible, .listing-card button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (max-width: 700px) {
  .listing-admin-card__row { align-items: flex-start; flex-direction: column; }
  .listing-admin-card__row .actions { width: 100%; justify-content: flex-start; }
}

/* Notifications */
.toast {
  position: fixed; z-index: 100; left: 50%; bottom: 24px;
  width: min(560px, calc(100vw - 32px)); padding: 14px 18px;
  border: 1px solid #294b32; border-radius: 10px;
  background: #1a3028; color: #fff; box-shadow: 0 8px 28px rgba(0,0,0,.24);
  opacity: 0; visibility: hidden; transform: translate(-50%, 12px);
  transition: opacity .2s, transform .2s, visibility .2s;
  overflow-wrap: anywhere;
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast--bad { border-color: #e8c6c0; border-left: 4px solid var(--bad); background: #fff; color: #812b1e; }

/* Editor dialogs */
.editor {
  border: 0; border-radius: 20px; padding: 0; width: min(820px, 96vw);
  max-height: min(94vh, 1000px); color: var(--ink); background: #f8faf8;
  box-shadow: 0 30px 80px rgba(0,0,0,.32);
}
.editor::backdrop { background: rgba(11,25,16,.68); backdrop-filter: blur(4px); }
.editor__form { display: flex; flex-direction: column; max-height: min(94vh, 1000px); }
.editor__head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start;
  justify-content: space-between; gap: 16px; padding: 24px 28px 20px;
  border-bottom: 1px solid var(--line); background: #fff;
}
.editor__eyebrow { color: var(--brand); font-size: .68rem; font-weight: 800; letter-spacing: .14em; }
.editor__head h2 { margin-top: 4px; font-size: 1.45rem; letter-spacing: -.025em; }
.editor__head p { margin-top: 4px; color: var(--muted); font-size: .88rem; }
.editor__head .icon { flex: 0 0 36px; border-radius: 50%; color: var(--muted); }
.editor__head .icon:hover { background: var(--bg); color: var(--ink); }
.editor .grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px;
  min-height: 0; flex: 1; overflow-y: auto; padding: 22px 28px 28px;
}
.editor .full { grid-column: 1 / -1; }
.editor .project-preview { border-radius: 12px; }
.editor .grid > label { min-width: 0; gap: 7px; color: #33473a; font-size: .82rem; }
.editor input, .editor select, .editor textarea { border-color: #d6e0d8; border-radius: 9px; }
.editor input::placeholder, .editor textarea::placeholder { color: #9aa79d; }
.editor input:focus, .editor select:focus, .editor textarea:focus { outline: 3px solid rgba(58,125,68,.14); }
.editor-section {
  display: flex; align-items: center; gap: 12px; margin-top: 8px; padding-bottom: 10px;
  border-bottom: 1px solid #dfe8e1;
}
.editor-section > span {
  display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center;
  border-radius: 9px; background: #e8f1e9; color: var(--brand-dark);
  font-size: .72rem; font-weight: 800;
}
.editor-section h3 { font-size: .96rem; }
.editor-section p { margin-top: 2px; color: var(--muted); font-size: .78rem; }
.apartment-editor { display: grid; gap: 12px; }
.apartment-editor__heading h3 { font-size: .95rem; }
.apartment-editor__heading p { margin-top: 3px; color: var(--muted); font-size: .78rem; font-weight: 400; }
.apartment-editor__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.apartment-editor__card { display: grid; align-content: start; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.apartment-editor__card h4 { color: var(--brand-dark); font-size: .88rem; }
.apartment-editor__card label { min-width: 0; gap: 5px; font-size: .74rem; }
.apartment-editor__card input { padding: 8px 9px; font-size: .8rem; }
.editor .photo {
  min-height: 110px; padding: 14px; border: 1px dashed #cbd9ce;
  border-radius: 12px; background: #fff;
}
.editor .photo img { border-radius: 9px; }
.editor .check {
  align-self: end; min-height: 42px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 9px; background: #fff;
}
.editor .check input { accent-color: var(--brand); }
.editor__foot {
  position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 28px; border-top: 1px solid var(--line); background: #fff;
}
@media (max-width: 600px) {
  .editor { width: 100%; max-width: none; max-height: 96vh; border-radius: 18px 18px 0 0; margin: auto 0 0; }
  .editor__form { max-height: 96vh; }
  .editor__head { padding: 20px 18px 16px; }
  .editor .grid { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 18px; }
  .editor .grid > * { grid-column: 1 / -1; }
  .apartment-editor__grid { grid-template-columns: minmax(0, 1fr); }
  .hero-cta-row__fields { grid-template-columns: minmax(0, 1fr); }
  .hero-cta-editor__heading { align-items: flex-start; }
  .editor__foot { padding: 12px 18px max(12px, env(safe-area-inset-bottom)); }
  .editor__foot .btn { flex: 1; }
}