/* PropCrowdy Admin — Phoenix-style (Bootstrap-5 aesthetic), PropCrowdy red. */
:root {
  --brand: #f40000;
  --brand-dark: #c40000;
  --brand-tint: #fdeaea;
  --ink: #141824;          /* primary text */
  --text2: #6e7891;        /* muted text */
  --text3: #8a94a6;
  --line: #e3e6ed;         /* borders */
  --bg: #f5f7fa;           /* app background */
  --card: #ffffff;
  --sidebar-w: 252px;
  --nav-h: 60px;
  --radius: 12px;
  --shadow: 0 7px 18px -6px rgba(43, 45, 66, .12);
  --shadow-sm: 0 2px 6px rgba(43, 45, 66, .06);

  --ok-bg: #d4f3e3; --ok-fg: #16794a;
  --warn-bg: #fdf0d5; --warn-fg: #a1690f;
  --err-bg: #fde3e0; --err-fg: #c0392b;
  --blue: #3874ff;
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  font-family: 'Plus Jakarta Sans', -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ── Top navbar ──────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h); z-index: 1030;
  background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
}
.nav-toggle {
  display: none; width: 40px; height: 40px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--ink);
  align-items: center; justify-content: center; cursor: pointer; font-size: 18px;
}
.navbar .brand-top { display: flex; align-items: center; gap: 8px; }
.navbar .brand-top img { height: 30px; }
.nav-search {
  flex: 1; max-width: 460px; display: flex; align-items: center; gap: 9px;
  background: var(--bg); border: 1px solid transparent; border-radius: 999px;
  padding: 9px 16px; color: var(--text2);
}
.nav-search:focus-within { border-color: var(--brand); background: #fff; }
.nav-search input { border: 0; background: none; outline: none; font: inherit; width: 100%; color: var(--ink); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 999px; background: none; border: 0;
  display: grid; place-items: center; color: var(--text2); cursor: pointer; font-size: 17px;
  position: relative; transition: background .15s;
}
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--brand); border: 1.5px solid #fff; }
.nav-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--brand-tint);
  color: var(--brand-dark); display: grid; place-items: center; font-weight: 800; font-size: 15px;
  cursor: pointer;
}

/* ── Sidebar ─────────────────────────────────────────────── */
/* Sidebar — dark panel, white text and icons. Its own colour variables so
   the nav can be reasoned about independently of the light app surface. */
.sidebar {
  --sidebar-bg: #17181c;          /* same charcoal the public site uses */
  --sidebar-line: rgba(255, 255, 255, .10);
  --sidebar-text: rgba(255, 255, 255, .72);
  --sidebar-hover: rgba(255, 255, 255, .08);
  --sidebar-active: rgba(244, 0, 0, .18);

  position: fixed; top: var(--nav-h); left: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--sidebar-bg); border-right: 1px solid var(--sidebar-line);
  padding: 10px 14px 20px; overflow-y: auto; z-index: 1020;
  display: flex; flex-direction: column; transition: transform .25s ease;
  color: var(--sidebar-text);
  /* Firefox scrollbar; the WebKit rules below cover the rest. */
  scrollbar-color: rgba(255, 255, 255, .22) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .22); border-radius: 3px; }
.nav-label {
  font-size: 10.5px; letter-spacing: 1.2px; color: rgba(255, 255, 255, .5);
  text-transform: uppercase; font-weight: 800; padding: 16px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px; color: var(--sidebar-text);
  font-weight: 600; transition: background .12s, color .12s; font-size: 14px;
  position: relative;
}
/* Icons are inline SVG drawn with currentColor, so they follow the text. */
.nav-item .ico { width: 20px; text-align: center; font-size: 16px; opacity: .9; flex-shrink: 0; }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; font-weight: 800; }
.nav-item.active::before {
  content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--brand);
}
.nav-item.active .ico { opacity: 1; }
.nav-badge {
  margin-left: auto; background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 8px; min-width: 20px; text-align: center;
}
.sidebar .spacer { flex: 1; min-height: 10px; }
.promo {
  background: linear-gradient(150deg, var(--brand), var(--brand-dark));
  border-radius: 14px; color: #fff; text-align: center; padding: 18px 14px; margin: 12px 2px 8px;
}
.promo b { display: block; font-size: 14px; margin-bottom: 3px; }
.promo p { font-size: 12px; color: rgba(255,255,255,.82); margin-bottom: 12px; }
.promo a { display: inline-block; background: #fff; color: var(--brand-dark); font-weight: 800;
  font-size: 12.5px; border-radius: 9px; padding: 8px 18px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 12px 8px 2px; border-top: 1px solid var(--sidebar-line); }
.sidebar-user b { display: block; font-size: 13.5px; color: #fff; }
.sidebar-user span { color: rgba(255, 255, 255, .55); font-size: 11.5px; }
.sidebar-user .chev { margin-left: auto; color: rgba(255, 255, 255, .45); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-tint);
  color: var(--brand-dark); display: grid; place-items: center; font-weight: 800; font-size: 14px; flex-shrink: 0; }

.backdrop { display: none; position: fixed; inset: 0; top: var(--nav-h); background: rgba(20,24,36,.4); z-index: 1010; }

/* ── Content ─────────────────────────────────────────────── */
.content {
  margin-left: var(--sidebar-w); margin-top: var(--nav-h);
  padding: 24px; min-height: calc(100vh - var(--nav-h));
}

.page-head { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -.3px; }
.page-head p { color: var(--text2); margin-top: 3px; font-size: 14px; }
.page-head .right { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.link { font-weight: 700; text-decoration: none; color: var(--brand-dark); font-size: 13.5px; }
.link:hover { text-decoration: underline; }
.muted { color: var(--text2); }

/* ── Cards & grid ────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm); }
.card h3 { font-size: 16px; font-weight: 800; margin-bottom: 16px; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1200px) { .grid.cols-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1000px) { .grid.cols-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

/* ── Stat cards (dashboard) ──────────────────────────────── */
.stat { display: flex; flex-direction: column; }
.stat .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.stat .label { color: var(--text2); font-size: 13.5px; font-weight: 700; }
.stat .sub { color: var(--text3); font-size: 12px; }
.stat .num { font-size: 30px; font-weight: 800; letter-spacing: -.5px; margin-top: 2px; }
.delta { font-size: 12px; font-weight: 800; border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.delta.up { background: var(--ok-bg); color: var(--ok-fg); }
.delta.down { background: var(--err-bg); color: var(--err-fg); }
.stat .spark { margin-top: 14px; }
.stat .spark svg { width: 100%; height: 54px; display: block; overflow: visible; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; flex-shrink: 0; }
.stat-icon.r { background: var(--brand-tint); color: var(--brand-dark); }
.stat-icon.b { background: #e6eeff; color: var(--blue); }
.stat-icon.g { background: var(--ok-bg); color: var(--ok-fg); }
.stat-icon.y { background: var(--warn-bg); color: var(--warn-fg); }

.mini-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; }
.mini-legend .row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text2); width: 100%; }
.mini-legend .row b { margin-left: auto; color: var(--ink); }
.dot-key { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }

/* Charts */
.chart svg { width: 100%; display: block; overflow: visible; }
.chart-x { display: flex; justify-content: space-between; color: var(--text3); font-size: 11.5px; margin-top: 8px; }
.donut-wrap { display: grid; place-items: center; position: relative; margin: 6px 0; }
.donut-wrap .center { position: absolute; text-align: center; }
.donut-wrap .center b { font-size: 26px; font-weight: 800; }
.donut-wrap .center small { display: block; color: var(--text2); font-size: 11px; }

/* ── Phoenix dashboard: top split + quickstats ───────────── */
.dash-top { display: grid; grid-template-columns: 1.12fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 1120px) { .dash-top { grid-template-columns: 1fr; } }

.dash-title h1 { font-size: 27px; font-weight: 800; letter-spacing: -.4px; }
.dash-title p { color: var(--text2); margin-top: 5px; font-size: 14.5px; }

.quickstats { display: flex; flex-wrap: wrap; gap: 14px 34px; margin: 22px 0 16px; }
.qs { display: flex; align-items: center; gap: 12px; }
.qs .qs-ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.qs .qs-ico.g { background: var(--ok-bg); color: var(--ok-fg); }
.qs .qs-ico.y { background: var(--warn-bg); color: var(--warn-fg); }
.qs .qs-ico.r { background: var(--err-bg); color: var(--err-fg); }
.qs b { font-size: 19px; font-weight: 800; display: block; line-height: 1.15; }
.qs span { color: var(--text2); font-size: 12.5px; }
.dash-divider { border: 0; border-top: 1px solid var(--line); margin: 6px 0 22px; }

.sells-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.sells-head h2 { font-size: 21px; font-weight: 800; letter-spacing: -.3px; }
.sells-head p { color: var(--text2); font-size: 13px; margin-top: 3px; }
.date-pill { display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 14px; font-weight: 700; font-size: 13px; color: var(--ink);
  background: #fff; white-space: nowrap; }
.date-pill svg { color: var(--text3); }

/* mini cards (right 2×2) */
.minicard { padding: 18px 20px; }
.mc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.mc-title { font-weight: 800; font-size: 15px; }
.mc-sub { color: var(--text3); font-size: 12px; margin-top: 2px; }
.mc-num { font-size: 25px; font-weight: 800; letter-spacing: -.5px; text-align: right; }
.mc-badge { display: inline-block; font-size: 11px; font-weight: 800; border-radius: 6px; padding: 2px 7px; margin-left: 8px; vertical-align: middle; }
.mc-badge.down { background: var(--warn-bg); color: var(--warn-fg); }
.mc-badge.up { background: var(--ok-bg); color: var(--ok-fg); }
.mc-chart { margin: 16px 0 12px; }
.mc-chart svg { width: 100%; display: block; overflow: visible; }
.mc-legend { display: flex; flex-direction: column; gap: 8px; }
.mc-legend .row { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--text2); }
.mc-legend .row b { margin-left: auto; color: var(--ink); font-weight: 800; }

/* main total-sells chart */
.big-chart svg { width: 100%; display: block; overflow: visible; }

/* reviews table header controls */
.tbl-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.tbl-head .titles h3 { margin: 0; }
.tbl-head .titles p { color: var(--text2); font-size: 13px; margin-top: 3px; }
.tbl-head .grow { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mini-search { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px; color: var(--text2); font-size: 13px; }
.mini-search input { border: 0; background: none; outline: none; font: inherit; width: 150px; }

/* review cells */
.cb { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.thumb { width: 46px; height: 38px; border-radius: 8px; object-fit: cover; background: var(--bg); flex-shrink: 0; }
.thumb.ph { display: grid; place-items: center; color: var(--text3); font-size: 15px; }
.cell-prod { display: flex; align-items: center; gap: 12px; }
.cell-prod a { color: var(--blue); font-weight: 700; }
.cell-user { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.uav { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-tint); color: var(--brand-dark);
  display: grid; place-items: center; font-weight: 800; font-size: 12px; flex-shrink: 0; }
.stars { color: #e3a008; letter-spacing: 1.5px; font-size: 13px; white-space: nowrap; }
.stars .off { color: #dde1e9; }
.review-txt { color: var(--text2); font-size: 13px; max-width: 380px; }

/* Listing cards (dashboard recent properties) */
.listing { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.listing img { width: 100%; height: 130px; object-fit: cover; display: block; background: var(--bg); }
.listing .body { padding: 12px 14px; }
.listing b.title { font-size: 15px; display: block; }
.listing .pricerow { margin: 5px 0 6px; font-size: 13.5px; }
.listing .pricerow .p { font-weight: 800; }
.listing .pricerow .r { color: var(--text2); }
.listing .pricerow .star { color: #f0a92e; }
.listing .meta { color: var(--text2); font-size: 12px; display: flex; gap: 12px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--brand); color: #fff; border: 0; border-radius: 10px;
  font: inherit; font-weight: 700; padding: 10px 18px; cursor: pointer;
  transition: filter .15s, transform .05s; white-space: nowrap;
}
.btn:hover { filter: brightness(.94); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); font-weight: 700; }
.btn.secondary:hover { background: var(--bg); filter: none; }
.btn.small { padding: 7px 13px; font-size: 12.5px; border-radius: 8px; }
.btn.ghost-danger { background: #fff; color: var(--err-fg); border: 1px solid #f4d3cf; }
.btn.ghost-danger:hover { background: var(--err-bg); filter: none; }
.btn.chip { border-radius: 999px; padding: 9px 16px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Tables ──────────────────────────────────────────────── */
.card > table, .table-wrap table { width: 100%; }
table { width: 100%; border-collapse: collapse; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--text2); font-weight: 800; padding: 11px 14px; border-bottom: 1px solid var(--line);
  white-space: nowrap; background: #fbfcfe; }
td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, tr:hover td { background: #fafbfd; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 800; line-height: 1.4; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.pill.pending { background: var(--warn-bg); color: var(--warn-fg); }
.pill.approved, .pill.available, .pill.completed, .pill.open, .pill.active, .pill.paid { background: var(--ok-bg); color: var(--ok-fg); }
.pill.rejected, .pill.hidden, .pill.failed { background: var(--err-bg); color: var(--err-fg); }
.pill.sold_out, .pill.closed, .pill.processing { background: #e7eaf0; color: #5a6377; }
.pill.mode { background: var(--brand-tint); color: var(--brand-dark); }

/* ── Forms ───────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
label.f { display: block; font-size: 12.5px; font-weight: 800; color: #4b5468; margin-bottom: 6px; }
input.f, select.f, textarea.f {
  width: 100%; font: inherit; padding: 11px 13px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; background: #fff; outline: none; transition: border-color .15s;
}
input.f:focus, select.f:focus, textarea.f:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.mode-toggle { display: flex; gap: 12px; flex-wrap: wrap; }
.mode-toggle label { flex: 1; min-width: 220px; border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; display: block; }
.mode-toggle input { display: none; }
.mode-toggle label:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.mode-toggle b { display: block; font-size: 14px; }
.mode-toggle small { color: var(--text2); }

.flash { border-radius: 12px; padding: 13px 16px; font-weight: 700; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.flash.ok { background: var(--ok-bg); color: var(--ok-fg); }
.flash.err { background: var(--err-bg); color: var(--err-fg); }

.slots-bar { background: var(--line); border-radius: 6px; height: 6px; width: 120px; overflow: hidden; }
.slots-bar i { display: block; height: 100%; background: var(--brand); }

/* ── Login ───────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--bg); padding: 20px; }
.login-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line);
  border-radius: 18px; padding: 40px 34px; text-align: center; box-shadow: var(--shadow); }
.login-card img { height: 54px; margin-bottom: 18px; }
.login-card h1 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.login-card p { color: var(--text2); margin-bottom: 24px; }
.login-card input.f { margin-bottom: 12px; text-align: left; }
.login-card .btn { width: 100%; padding: 13px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 992px) {
  .nav-toggle { display: grid; }
  .nav-search { max-width: none; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .backdrop.show { display: block; }
  .content { margin-left: 0; padding: 18px; }
}
@media (max-width: 560px) {
  .nav-search { display: none; }
  .content { padding: 14px; }
  .page-head h1 { font-size: 20px; }
}
