/* ==========================================================================
   localkw — admin styles
   ========================================================================== */
:root {
  --teal: #3b82f6;
  --teal-dark: #2f6fe0;
  --teal-darker: #0b1428;
  --amber: #22d3ee;
  --star: #f5a524;
  --bg: #e9eefb;
  --surface: #ffffff;
  --ink: #0d1526;
  --muted: #647088;
  --line: #dde4f0;
  --line-soft: #eaeff7;
  --ok-bg: #e6f5ed; --ok-fg: #14704c;
  --warn-bg: #fdf0d9; --warn-fg: #97600f;
  --danger: #c0392b; --danger-bg: #fbe9e6;
  --radius: 14px;
  --radius-sm: 10px;
  --glass: rgba(255, 255, 255, .7);
  --glass-border: rgba(255, 255, 255, .7);
  --glass-blur: saturate(160%) blur(14px);
  --shadow: 0 1px 2px rgba(13, 21, 38, .05), 0 12px 28px -16px rgba(30, 58, 138, .2);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Plus Jakarta Sans', var(--font);
}

* { box-sizing: border-box; }

body.admin {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal-dark); text-decoration: none; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.15; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; gap: .45em;
  font: inherit; font-weight: 600;
  padding: .6rem 1rem; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
  white-space: nowrap; line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn svg { flex: none; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal-dark); }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger-bg); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: .42rem .75rem; font-size: .85rem; }
.btn-xs { padding: .34rem .6rem; font-size: .8rem; }
.btn-lg { padding: .8rem 1.2rem; font-size: 1.02rem; }
.btn-block { width: 100%; justify-content: center; }

/* ------------------------------------------------------------------- pills */
.pill {
  display: inline-block; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em;
  padding: .18em .55em; border-radius: 999px;
  background: var(--line-soft); color: var(--muted); vertical-align: middle;
}
.pill-ok { background: var(--ok-bg); color: var(--ok-fg); }
.pill-warn { background: var(--warn-bg); color: var(--warn-fg); }
.pill-accent { background: #fbeccd; color: #8a5a12; }

/* ----------------------------------------------------------------- utility */
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.pad { padding: 1.1rem 1.25rem; }
.ta-right { text-align: right; }
.inline { display: inline; margin: 0; }
.narrow { max-width: 560px; }
.link-arrow { font-weight: 600; font-size: .9rem; }
.link-arrow:hover { text-decoration: underline; }

/* ------------------------------------------------------------------- flash */
.flash {
  border-radius: var(--radius-sm); padding: .7rem 1rem;
  font-weight: 500; margin-bottom: .6rem; border: 1px solid transparent;
}
.flash-success { background: var(--ok-bg); color: var(--ok-fg); border-color: #c5e6d6; }
.flash-error { background: var(--danger-bg); color: var(--danger); border-color: #f3cfc8; }
.flash-info { background: #e6eef4; color: #2c5575; border-color: #cfdded; }

/* =============================================================== app shell */
.admin-shell { display: flex; min-height: 100vh; }

.admin-side {
  width: 248px; flex: none;
  background: var(--teal-darker);
  color: #c3cee4;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.admin-brand {
  display: flex; align-items: center; gap: .55rem;
  padding: 1.15rem 1.25rem; color: #fff; font-family: var(--display);
  font-weight: 800; font-size: 1.18rem;
}
.admin-brand em { font-style: normal; font-weight: 600; opacity: .6; font-size: .8rem; }
.brand-pin { display: inline-flex; color: var(--amber); }

.admin-nav { display: flex; flex-direction: column; gap: 2px; padding: .5rem .65rem; flex: 1; }
.admin-nav a {
  display: flex; align-items: center; gap: .65rem;
  padding: .6rem .7rem; border-radius: 10px;
  color: #b9c5dd; font-weight: 500; position: relative;
}
.admin-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.admin-nav a.is-active { background: var(--teal); color: #fff; }
.admin-nav .dot {
  margin-left: auto; background: var(--amber); color: #3a2705;
  font-size: .72rem; font-weight: 800; min-width: 1.25rem; text-align: center;
  border-radius: 999px; padding: .05rem .3rem;
}
.admin-side-foot { padding: .85rem 1.1rem; border-top: 1px solid rgba(255,255,255,.1); }
.admin-side-foot a { display: inline-flex; align-items: center; gap: .5rem; color: #9aa8c4; font-size: .9rem; }
.admin-side-foot a:hover { color: #fff; }

.admin-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.admin-top {
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem 1.5rem; background: var(--surface);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.admin-h1 { font-size: 1.35rem; }
.admin-burger { display: none; background: none; border: 0; cursor: pointer; color: var(--ink); padding: .2rem; }
.admin-user { margin-left: auto; display: flex; align-items: center; gap: .9rem; }
.admin-user-name { font-size: .9rem; color: var(--muted); }
.admin-user-name em { font-style: normal; color: var(--teal-dark); font-weight: 600; text-transform: capitalize; }

.admin-flashes { padding: 1rem 1.5rem 0; }
.admin-main { padding: 1.5rem; max-width: 1100px; width: 100%; }

/* -------------------------------------------------------------- stat cards */
.stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1rem; margin-bottom: 1.4rem;
}
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.1rem 1.2rem;
  display: flex; flex-direction: column; gap: .15rem; box-shadow: var(--shadow);
  transition: border-color .15s, transform .08s;
}
.stat:hover { border-color: var(--teal); transform: translateY(-2px); }
.stat-ic { color: var(--teal); }
.stat-num { font-family: var(--display); font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-label { color: var(--muted); font-size: .9rem; }
.stat-alert { border-color: var(--warn-fg); background: #fffaf0; }
.stat-alert .stat-ic { color: var(--warn-fg); }

/* ------------------------------------------------------------------ panels */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 1.4rem; overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .95rem 1.25rem; border-bottom: 1px solid var(--line-soft);
}
.panel-head h2 { font-size: 1.05rem; }
.panel-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.panel-row .panel { margin-bottom: 0; }
.split { display: grid; grid-template-columns: 360px 1fr; gap: 1.4rem; align-items: start; }
.split .panel { margin-bottom: 0; }

/* ------------------------------------------------------------------- table */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: .74rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); font-weight: 700;
  padding: .7rem 1.25rem; border-bottom: 1px solid var(--line-soft);
}
.table td { padding: .85rem 1.25rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfa; }
.row-actions { display: inline-flex; gap: .4rem; justify-content: flex-end; flex-wrap: wrap; }
.cat-cell { display: inline-flex; align-items: center; gap: .5rem; }
.cat-ic { color: var(--teal); display: inline-flex; }

/* ------------------------------------------------------------- mini reviews */
.mini-reviews { list-style: none; margin: 0; padding: .4rem 0; }
.mini-reviews li { padding: .7rem 1.25rem; border-bottom: 1px solid var(--line-soft); }
.mini-reviews li:last-child { border-bottom: 0; }
.mini-top { display: flex; align-items: center; gap: .5rem; margin-bottom: .25rem; font-size: .85rem; }
.mini-reviews p { margin: 0; color: var(--muted); font-size: .9rem; }

/* ----------------------------------------------------------- quick actions */
.quick-actions { display: flex; flex-wrap: wrap; gap: .6rem; }

/* ----------------------------------------------------------------- toolbar */
.toolbar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.toolbar > p.muted { margin: 0; flex: 1; min-width: 220px; }
.tabs { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.tabs a { padding: .4rem .9rem; border-radius: 999px; font-weight: 600; font-size: .9rem; color: var(--muted); }
.tabs a.is-active { background: var(--teal); color: #fff; }
.toolbar-search {
  display: inline-flex; align-items: center; gap: .45rem;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: .35rem .85rem; color: var(--muted); flex: 1; max-width: 320px;
}
.toolbar-search input { border: 0; outline: 0; font: inherit; background: none; width: 100%; color: var(--ink); }
.toolbar .btn:last-child { margin-left: auto; }

/* ------------------------------------------------------------------- forms */
.form-panel { padding-bottom: .35rem; }
.form-panel.pad, .form-panel .pad { }
.field { margin-bottom: 1.05rem; display: flex; flex-direction: column; gap: .35rem; }
.field > label { font-weight: 600; font-size: .9rem; }
.field input[type=text], .field input[type=email], .field input[type=password],
.field select, .field textarea {
  font: inherit; color: var(--ink);
  padding: .6rem .75rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; width: 100%; transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 0; border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(31, 122, 109, .14);
}
.field-help { margin-top: .1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field-row .field { margin-bottom: 1.05rem; }

.field-check { flex-direction: row; align-items: flex-start; }
.check { display: inline-flex; align-items: center; gap: .55rem; font-weight: 500; cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--teal); }

.form-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; padding-top: .3rem; }
.form-errors {
  background: var(--danger-bg); border: 1px solid #f1cfc8; color: var(--danger);
  border-radius: var(--radius-sm); padding: .8rem 1.1rem; margin-bottom: 1.2rem;
}
.form-errors p { margin: .15rem 0; }

.form-panel.pad .field:last-child,
.form-panel .pad .field:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------- icon picker */
.icon-picker { display: flex; flex-wrap: wrap; gap: .4rem; }
.icon-opt input { position: absolute; opacity: 0; }
.icon-opt span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); color: var(--muted); cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
}
.icon-opt:hover span { color: var(--teal); border-color: var(--teal); }
.icon-opt input:checked + span { background: var(--teal); color: #fff; border-color: var(--teal); }

/* ----------------------------------------------------------- review rows */
.review-list { display: flex; flex-direction: column; }
.review-row {
  display: flex; gap: 1rem; padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--line-soft); align-items: flex-start;
}
.review-row:last-child { border-bottom: 0; }
.review-row-main { flex: 1; min-width: 0; }
.review-row-head { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; margin-bottom: .35rem; }
.review-row-body { margin: 0 0 .4rem; color: #33433f; }
.review-row-actions { display: flex; flex-direction: column; gap: .4rem; flex: none; }

/* stars (shared with public) */
.stars { display: inline-flex; gap: 1px; vertical-align: middle; }
.stars .star { color: #d6dcd8; display: inline-flex; }
.stars .star.is-on { color: var(--star); }

/* =============================================================== login page */
.admin-login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 1.5rem;
  background: radial-gradient(1200px 600px at 50% -10%, #1f7a6d22, transparent),
              var(--bg);
}
.login-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: var(--shadow);
  padding: 2.2rem 2rem; width: 100%; max-width: 400px;
}
.login-brand {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--display); font-weight: 800; font-size: 1.3rem;
  color: var(--ink); margin-bottom: 1.4rem;
}
.login-card h1 { font-size: 1.7rem; margin-bottom: .25rem; }
.login-sub { color: var(--muted); margin: 0 0 1.4rem; }
.stack { display: flex; flex-direction: column; }
.stack .field { margin-bottom: 1rem; }
.login-back { display: inline-block; margin-top: 1.2rem; color: var(--muted); font-size: .9rem; }
.login-back:hover { color: var(--teal-dark); }

/* ============================================================== responsive */
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-row, .split { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .admin-side {
    position: fixed; left: 0; top: 0; z-index: 40;
    transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.3);
  }
  .admin-side.open { transform: translateX(0); }
  .admin-burger { display: inline-flex; }
  .admin-main { padding: 1.1rem; }
  .review-row { flex-direction: column; }
  .review-row-actions { flex-direction: row; }
}

/* ------------------------------------------------------------------- maps */
.admin-map {
  height: 320px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); overflow: hidden; margin-top: 6px;
  box-shadow: var(--shadow);
}
.map-pick-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.leaflet-container { font: inherit; }

/* ------------------------------------------------------- homepage hero page */
.hero-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.hero-thumb { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.hero-thumb-img { display: block; width: 100%; aspect-ratio: 16 / 9; background-size: cover; background-position: center; background-color: #e9eefb; }
.hero-thumb form { padding: .55rem; display: flex; justify-content: flex-end; }
input[type=color] { border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; width: 100%; }
input[type=range] { width: 100%; accent-color: var(--teal); }
@media (max-width: 700px) { .hero-thumbs { grid-template-columns: 1fr; } }

/* Contain Leaflet map stacking under the admin top bar */
.admin-map { position: relative; z-index: 0; isolation: isolate; }
