/* =========================================================
   RentX — local rental marketplace
   Design tokens
   ========================================================= */
:root{
  --paper:      #EDF2EC;
  --paper-dim:  #E4ECE3;
  --ink:        #14231A;
  --ink-soft:   #52635A;
  --line:       #D0DBD0;
  --line-soft:  #E1E9E0;

  --forest:       #1E6B47;
  --forest-dark:  #14452E;
  --forest-tint:  #DAEDE1;

  --mustard:      #F0A93A;
  --mustard-dark: #B06F0C;
  --mustard-tint: #FCEBC9;

  --rust:       #C4452B;
  --rust-tint:  #FBE0D8;

  --white: #FFFFFF;

  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 18px;

  --shadow-card: 0 1px 2px rgba(20,35,26,0.06), 0 4px 14px rgba(20,35,26,0.06);
  --shadow-pop:  0 14px 34px rgba(20,35,26,0.18);

  --font-head: "Plus Jakarta Sans", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-body: "Inter", "Segoe UI", Helvetica, Arial, sans-serif;

  --maxw: 1180px;
}

*, *::before, *::after{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  margin:0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4{
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.4em;
  color: var(--forest-dark);
}
h1{ font-size: clamp(2rem, 3.2vw, 2.8rem); }
h2{ font-size: clamp(1.5rem, 2.2vw, 2rem); }
h3{ font-size: 1.2rem; }
p{ margin: 0 0 1em; color: var(--ink-soft); max-width: 62ch; }

a{ color: var(--forest); text-decoration: none; }
a:hover{ text-decoration: underline; }

img{ max-width: 100%; display:block; }

button, input, select, textarea{ font-family: inherit; font-size: 1rem; }

:focus-visible{
  outline: 2px solid var(--mustard-dark);
  outline-offset: 2px;
}

.container{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Buttons ---------- */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  padding: 11px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn-primary{ background: var(--forest); color: var(--white); }
.btn-primary:hover{ background: var(--forest-dark); text-decoration:none; }
.btn-accent{ background: var(--mustard); color: var(--forest-dark); }
.btn-accent:hover{ background: var(--mustard-dark); color:var(--white); text-decoration:none; }
.btn-ghost{ background: transparent; color: var(--forest-dark); border-color: var(--line); }
.btn-ghost:hover{ background: var(--forest-tint); text-decoration:none; }
.btn-danger{ background: var(--rust-tint); color: var(--rust); }
.btn-danger:hover{ background: var(--rust); color: var(--white); text-decoration:none; }
.btn-sm{ padding: 7px 14px; font-size: 0.85rem; }
.btn-block{ width: 100%; }
.btn[disabled]{ opacity: .5; cursor: not-allowed; }

/* ---------- Top navigation ---------- */
.topbar{
  position: sticky; top:0; z-index: 40;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner{
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  height: 64px; display:flex; align-items:center; gap: 32px;
}
.wordmark{
  font-family: var(--font-head); font-weight: 800; font-size: 1.25rem;
  letter-spacing: -0.02em; color: var(--forest-dark);
  display:flex; align-items:center; gap:10px;
}
.wordmark:hover{ text-decoration:none; }
.logo-mark{
  width:32px; height:32px; border-radius:9px; background: var(--forest); color:#fff;
  display:grid; place-items:center; font-size:1rem; font-weight:800;
  box-shadow: inset 0 -3px 0 var(--mustard);
}
.nav-links{ display:flex; gap:4px; align-items:center; flex:1; }
.nav-links a{
  color: var(--ink-soft); font-weight:500; font-size:.92rem;
  padding: 8px 12px; border-radius: var(--radius-s);
}
.nav-links a:hover{ background: var(--paper-dim); color: var(--forest-dark); text-decoration:none; }
.nav-links a.active{ background: var(--forest-tint); color: var(--forest-dark); font-weight:600; }

.nav-actions{ display:flex; align-items:center; gap: 10px; }
.nav-user{ display:flex; align-items:center; gap:10px; font-size:.9rem; font-weight:600; color: var(--ink); padding-right:6px; }
.avatar{
  width:32px; height:32px; border-radius:50%;
  background: var(--forest); color:#fff;
  display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:.8rem; flex-shrink:0;
}
.mobile-toggle{
  display:none; width:40px; height:40px; border:1px solid var(--line);
  background:#fff; border-radius: var(--radius-s); font-size:1.2rem;
  cursor:pointer; color: var(--forest-dark);
}
@media (max-width: 880px){
  .topbar-inner{ gap:12px; }
  .wordmark{ margin-right:auto; }
  .mobile-toggle{ display:inline-flex; align-items:center; justify-content:center; }
  .nav-links{
    display:none; position:absolute; top:64px; left:0; right:0;
    flex-direction:column; align-items:stretch; gap:2px;
    background:#fff; border-bottom:1px solid var(--line);
    padding: 10px 24px 16px; box-shadow: var(--shadow-pop);
  }
  .topbar.open .nav-links{ display:flex; }
  .nav-user span:last-child{ display:none; }
}

/* ---------- Hero ---------- */
.hero{
  padding: 64px 0 56px;
  background: linear-gradient(180deg, #DCEBDF 0%, var(--paper) 100%);
  border-bottom: 1px solid var(--line);
}
.hero-grid{
  display:grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items:center;
}
@media (max-width: 900px){
  .hero-grid{ grid-template-columns: 1fr; }
}
.hero-eyebrow{
  color: var(--mustard-dark);
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 0.95rem;
}
.hero h1{ margin-bottom: 18px; }
.hero p.lede{ font-size: 1.08rem; max-width: 46ch; }

.search-card{
  margin-top: 26px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 16px;
  display:grid;
  grid-template-columns: 1.3fr 1fr auto;
  gap: 10px;
  box-shadow: var(--shadow-card);
}
@media (max-width: 620px){
  .search-card{ grid-template-columns: 1fr; }
}
.field{ display:flex; flex-direction:column; gap:4px; }
.field label{ font-size: 0.75rem; color: var(--ink-soft); font-weight:600; }
.field input, .field select{
  border:1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 10px 12px;
  background: var(--paper);
}

.hero-stack{ position:relative; }
.stack-card{
  box-shadow: var(--shadow-card);
  background: var(--white);
  border:1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 14px;
  display:flex; gap:12px; align-items:center;
  box-shadow: var(--shadow-card);
  margin-bottom: 14px;
}
.stack-card:nth-child(2){ margin-left: 28px; }
.stack-card:nth-child(3){ margin-left: 56px; margin-bottom:0; }
.stack-thumb{ width:56px; height:56px; border-radius: var(--radius-s); flex-shrink:0; }
.stack-meta{ min-width:0; }
.stack-meta strong{ display:block; font-size:.92rem; }
.stack-meta span{ font-size:.82rem; color: var(--ink-soft); }

/* ---------- Sections ---------- */
.section{ padding: 56px 0; }
.section-head{
  display:flex; align-items:flex-end; justify-content:space-between;
  gap: 16px; margin-bottom: 28px; flex-wrap:wrap;
}
.section-head p{ margin:6px 0 0; }

.categories{
  display:flex; gap:12px; flex-wrap:wrap; margin-bottom: 40px;
}
.chip{
  border:1px solid var(--line);
  transition: all .15s ease;
  background: var(--white);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight:600;
  color: var(--ink-soft);
  cursor:pointer;
}
.chip.active, .chip:hover{
  border-color: var(--forest);
  color: var(--forest-dark);
  background: var(--forest-tint);
}

/* ---------- Listing grid & cards ---------- */
.grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}
.card-listing{
  background: var(--white);
  border:1px solid var(--line);
  border-radius: var(--radius-m);
  overflow:hidden;
  display:flex; flex-direction:column;
  box-shadow: var(--shadow-card);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card-listing:hover{ border-color: var(--forest); transform: translateY(-3px); box-shadow: var(--shadow-pop); text-decoration:none; }
.card-thumb{
  aspect-ratio: 4/3;
  display:flex; align-items:center; justify-content:center;
  position:relative;
  border-bottom: 1px solid var(--line-soft);
}
.card-thumb svg{ width: 52%; height: 52%; }
.card-body{ padding: 14px 16px 16px; display:flex; flex-direction:column; gap:6px; flex:1; }
.card-body h3{ margin:0; font-size: 1rem; font-family: var(--font-body); font-weight:700; color:var(--ink); }
.card-meta{ font-size:.82rem; color: var(--ink-soft); }
.card-price{ margin-top:auto; display:flex; align-items:baseline; justify-content:space-between; padding-top:8px; }
.card-price strong{ font-size:1.05rem; color: var(--forest-dark); }
.card-price span{ font-size:.78rem; color: var(--ink-soft); }
.badge{
  display:inline-flex; align-items:center;
  font-size: .72rem; font-weight:700; letter-spacing:.02em;
  padding: 3px 9px; border-radius: 999px;
  background: var(--forest-tint); color: var(--forest-dark);
}
.badge.pending{ background: var(--mustard-tint); color: var(--mustard-dark); }
.badge.rejected, .badge.cancelled{ background: var(--rust-tint); color: var(--rust); }
.badge.completed{ background: var(--line-soft); color: var(--ink-soft); }

.card-thumb .badge{ position:absolute; top:10px; left:10px; }

/* ---------- How it works ---------- */
.steps{
  display:grid; grid-template-columns: repeat(3,1fr); gap: 28px;
}
@media (max-width: 780px){ .steps{ grid-template-columns:1fr; } }
.step{ background:#fff; border:1px solid var(--line); border-top:3px solid var(--mustard); border-radius: var(--radius-m); padding: 22px; box-shadow: var(--shadow-card); }
.step .num{ font-family: var(--font-head); font-size: 1.6rem; color: var(--mustard-dark); }

/* ---------- Role panels on landing ---------- */
.role-grid{ display:grid; grid-template-columns: repeat(3,1fr); gap: 22px; }
@media (max-width: 900px){ .role-grid{ grid-template-columns:1fr; } }
.role-card{
  box-shadow: var(--shadow-card);
  background: var(--white); border:1px solid var(--line); border-radius: var(--radius-l);
  padding: 26px; display:flex; flex-direction:column; gap:10px;
}
.role-card .icon{
  width:44px; height:44px; border-radius: var(--radius-s);
  background: var(--forest-tint); display:flex; align-items:center; justify-content:center;
  margin-bottom:6px;
}
.role-card h3{ font-family: var(--font-head); font-size:1.2rem; }

/* ---------- Footer ---------- */
.site-footer{ background:#fff; border-top:1px solid var(--line); margin-top:40px; padding: 48px 0 24px; }
.footer-top{ display:grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap:32px; }
@media (max-width: 780px){ .footer-top{ grid-template-columns:1fr 1fr; } .footer-brand{ grid-column:1/-1; } }
.footer-brand p{ margin:14px 0 0; font-size:.9rem; max-width:34ch; }
.footer-col{ display:flex; flex-direction:column; gap:10px; }
.footer-col h4{ font-family: var(--font-body); font-size:.75rem; text-transform:uppercase; letter-spacing:.08em; color: var(--ink-soft); margin:0 0 4px; }
.footer-col a{ color: var(--ink); font-size:.92rem; }
.footer-col a:hover{ color: var(--forest); }
.footer-bottom{
  display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap;
  margin-top:40px; padding-top:20px; border-top:1px solid var(--line-soft);
  font-size:.82rem; color: var(--ink-soft);
}

/* ---------- Auth pages ---------- */
.auth-wrap{
  min-height: calc(100vh - 64px);
  display:flex; align-items:center; justify-content:center;
  padding: 40px 20px;
}
.auth-card{
  width: 100%; max-width: 420px;
  background: var(--white);
  border:1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 32px;
  box-shadow: var(--shadow-card);
}
.role-tabs{ display:flex; border:1px solid var(--line); border-radius: var(--radius-s); overflow:hidden; margin-bottom: 22px; }
.role-tabs button{
  flex:1; padding:10px; background: var(--paper); border:none; cursor:pointer;
  font-weight:600; color: var(--ink-soft); border-right:1px solid var(--line);
}
.role-tabs button:last-child{ border-right:none; }
.role-tabs button.active{ background: var(--forest); color:var(--white); }

.form-group{ margin-bottom: 16px; display:flex; flex-direction:column; gap:6px; }
.form-group label{ font-size: .85rem; font-weight:600; color: var(--ink); }
.form-group input, .form-group select, .form-group textarea{
  border:1px solid var(--line); border-radius: var(--radius-s);
  padding: 10px 12px; background: var(--paper);
}
.form-row{ display:grid; grid-template-columns: 1fr 1fr; gap:12px; }
@media (max-width:520px){ .form-row{ grid-template-columns:1fr; } }
.form-hint{ font-size:.78rem; color: var(--ink-soft); }
.form-error{
  background: var(--rust-tint); color: var(--rust);
  border-radius: var(--radius-s); padding: 10px 12px; font-size: .85rem; margin-bottom: 16px; display:none;
}
.form-error.show{ display:block; }
.form-success{
  background: var(--forest-tint); color: var(--forest-dark);
  border-radius: var(--radius-s); padding: 10px 12px; font-size: .85rem; margin-bottom: 16px; display:none;
}
.form-success.show{ display:block; }

.auth-switch{ text-align:center; margin-top: 18px; font-size:.9rem; color: var(--ink-soft); }
.seed-note{
  margin-top: 18px; padding-top:16px; border-top:1px dashed var(--line);
  font-size: .78rem; color: var(--ink-soft);
}
.seed-note code{ background: var(--paper-dim); padding: 1px 6px; border-radius:4px; }

/* ---------- Dashboards ---------- */
.dash-shell{ display:grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 64px); }
@media (max-width: 820px){ .dash-shell{ grid-template-columns: 1fr; } }
.dash-side{
  border-right: 1px solid var(--line-soft);
  padding: 26px 18px;
  background: var(--paper-dim);
}
@media (max-width: 820px){ .dash-side{ border-right:none; border-bottom:1px solid var(--line-soft); display:flex; overflow-x:auto; gap:6px; padding: 14px 18px; } }
.dash-side .side-title{ font-size:.75rem; text-transform: none; color: var(--ink-soft); font-weight:700; margin: 6px 0 10px 10px; }
.side-link{
  display:flex; align-items:center; gap:10px;
  padding: 10px 12px; border-radius: var(--radius-s);
  color: var(--ink-soft); font-weight:600; font-size:.92rem;
  margin-bottom: 4px; white-space:nowrap;
}
.side-link:hover{ background: var(--forest-tint); text-decoration:none; }
.side-link.active{ background: var(--forest); color: var(--white); }
.dash-main{ padding: 30px 32px 60px; }
@media (max-width: 620px){ .dash-main{ padding: 22px 18px 50px; } }

.dash-header{ display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom: 26px; flex-wrap:wrap; }
.dash-header p{ margin-top:4px; }

.stat-row{ display:grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 30px; }
@media (max-width: 780px){ .stat-row{ grid-template-columns: repeat(2,1fr); } }
.stat-card{ box-shadow: var(--shadow-card); background: var(--white); border:1px solid var(--line); border-radius: var(--radius-m); padding: 18px; }
.stat-card .stat-num{ font-family: var(--font-head); font-size: 1.7rem; color: var(--forest-dark); }
.stat-card .stat-label{ font-size:.82rem; color: var(--ink-soft); }

.panel{ box-shadow: var(--shadow-card); background: var(--white); border:1px solid var(--line); border-radius: var(--radius-m); padding: 22px; margin-bottom: 24px; }
.panel-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom: 16px; gap:10px; flex-wrap:wrap; }
.panel-head h2{ font-size: 1.1rem; margin:0; }

table{ width:100%; border-collapse: collapse; font-size: .92rem; }
th, td{ text-align:left; padding: 12px 10px; border-bottom: 1px solid var(--line-soft); }
th{ color: var(--ink-soft); font-weight:600; font-size:.72rem; text-transform:uppercase; letter-spacing:.05em; }
tr:last-child td{ border-bottom:none; }
.table-empty{ padding: 30px 10px; text-align:center; color: var(--ink-soft); }
.row-thumb{ width:40px; height:40px; border-radius: var(--radius-s); display:inline-flex; align-items:center; justify-content:center; margin-right:10px; vertical-align:middle; }
.row-thumb svg{ width:60%; height:60%; }
.cell-actions{ display:flex; gap:8px; }

/* ---------- Listing detail ---------- */
.detail-grid{ display:grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; }
@media (max-width: 880px){ .detail-grid{ grid-template-columns:1fr; } }
.detail-thumb{ aspect-ratio: 4/3; border-radius: var(--radius-l); display:flex; align-items:center; justify-content:center; border:1px solid var(--line); }
.detail-thumb svg{ width:38%; height:38%; }
.owner-line{ display:flex; align-items:center; gap:10px; margin: 16px 0; }
.booking-box{ box-shadow: var(--shadow-card); background: var(--white); border:1px solid var(--line); border-radius: var(--radius-l); padding: 22px; position: sticky; top: 90px; }
.price-line{ display:flex; align-items:baseline; justify-content:space-between; margin-bottom:14px; }
.price-line strong{ font-family: var(--font-head); font-size: 1.6rem; color: var(--forest-dark); }
.divider{ height:1px; background: var(--line-soft); margin: 16px 0; }
.total-line{ display:flex; justify-content:space-between; font-weight:700; margin: 10px 0 18px; }

/* ---------- Modal ---------- */
.modal-backdrop{
  position:fixed; inset:0; background: rgba(32,42,34,0.4);
  display:none; align-items:center; justify-content:center; z-index: 100; padding: 20px;
}
.modal-backdrop.open{ display:flex; }
.modal{
  background: var(--white); border-radius: var(--radius-l); padding: 28px;
  width: 100%; max-width: 560px; max-height: 88vh; overflow:auto;
  box-shadow: var(--shadow-pop);
}
.modal-head{ display:flex; justify-content:space-between; align-items:center; margin-bottom: 18px; }
.modal-close{ background:none; border:none; font-size:1.3rem; cursor:pointer; color: var(--ink-soft); line-height:1; }

/* ---------- Toast ---------- */
.toast{
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  background: var(--forest-dark); color: var(--white);
  padding: 13px 18px; border-radius: var(--radius-s);
  font-size: .9rem; box-shadow: var(--shadow-pop);
  transform: translateY(12px); opacity:0; pointer-events:none;
  transition: all .2s ease;
}
.toast.show{ transform: translateY(0); opacity:1; }
.toast.error{ background: var(--rust); }

/* ---------- Empty state ---------- */
.empty-state{ text-align:center; padding: 50px 20px; color: var(--ink-soft); }
.empty-state .icon{ font-size: 2.2rem; margin-bottom: 10px; }

/* ---------- Utility ---------- */
.text-center{ text-align:center; }
.mt-0{ margin-top:0; }
.flex{ display:flex; }
.gap-8{ gap:8px; }
.small{ font-size:.85rem; color: var(--ink-soft); }
.hidden{ display:none !important; }
