@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #0B3D2E;
    --primary-600: #0E4A38;
    --primary-500: #0F5132;
    --primary-light: #17a35f;
    --accent: #10b981;
    --accent-600: #059669;
    --accent-soft: #d1fae5;
    --accent-softer: #ecfdf5;
    --bg: #f6f7f9;
    --card: #ffffff;
    --border: #e6e8ec;
    --border-strong: #d8dbe0;
    --ink: #0f172a;
    --text: #1e293b;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --danger: #dc2626;
    --danger-soft: #fee2e2;
    --warning: #d97706;
    --warning-soft: #fef3c7;
    --info: #2563eb;
    --info-soft: #dbeafe;
    --sidebar-w: 262px;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-md: 0 6px 20px -4px rgba(16, 24, 40, .10);
    --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, .18);
    --font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--primary); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-600); }
h1, h2, h3, h4, h5 { margin: 0 0 .5rem; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
p { margin: 0 0 .75rem; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

::selection { background: var(--accent-soft); color: var(--primary); }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; border: 2px solid transparent; background-clip: padding-box; }

/* ---------- App layout ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 55;
    opacity: 0; pointer-events: none; transition: opacity .25s; backdrop-filter: blur(2px);
}
.sidebar-backdrop.show { opacity: 1; pointer-events: auto; }

.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--primary-600) 0%, var(--primary) 100%);
    color: #eaf5ef;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: width .25s cubic-bezier(.4,0,.2,1), transform .25s;
    z-index: 60;
}
.sidebar.collapsed { width: 78px; }
.sidebar.collapsed .brand-text, .sidebar.collapsed .menu-label, .sidebar.collapsed .menu-text,
.sidebar.collapsed .fiscal, .sidebar.collapsed .collapse-text { display: none; }

.brand { padding: 1.4rem 1.35rem 1rem; display: flex; align-items: center; gap: .8rem; }
.brand-logo {
    width: 42px; height: 42px; border-radius: 12px;
    background: linear-gradient(135deg, var(--accent) 0%, #34d399 100%);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 19px; flex-shrink: 0;
    box-shadow: 0 4px 12px -2px rgba(16, 185, 129, .5);
}
.brand-title { font-weight: 800; font-size: 17px; line-height: 1.1; color: #fff; }
.brand-sub { font-size: 11px; color: #9ccbb6; }

.fiscal { margin: .3rem 1.35rem .8rem; }
.fiscal select {
    width: 100%; padding: .5rem .65rem; border-radius: 10px; border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.07); color: #eaf5ef; font-size: 12px; font-family: inherit; cursor: pointer;
}
.fiscal select:focus { outline: none; border-color: rgba(255,255,255,.25); }
.fiscal option { color: #0f172a; }

.nav { flex: 1; padding: 0 .7rem 1rem; }
.nav-section { margin-bottom: .4rem; }
.menu-label {
    text-transform: uppercase; font-size: 10px; letter-spacing: .1em;
    color: #79b197; padding: .75rem .7rem .3rem; font-weight: 700;
}
.nav-item {
    display: flex; align-items: center; gap: .75rem;
    padding: .6rem .75rem; border-radius: 10px; color: #cfe6da;
    margin-bottom: 2px; font-size: 13.5px; font-weight: 500;
    transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: #fff; color: var(--primary); font-weight: 700; box-shadow: 0 4px 14px -4px rgba(0,0,0,.35); }
.nav-item .ico { width: 22px; text-align: center; font-size: 15px; flex-shrink: 0; display: flex; justify-content: center; }

.collapse-btn { padding: 1rem .7rem; border-top: 1px solid rgba(255,255,255,.1); }
.collapse-btn button {
    width: 100%; background: transparent; border: none; color: #a9d3c0;
    display: flex; align-items: center; gap: .6rem; cursor: pointer; font-size: 13px; padding: .5rem .7rem; border-radius: 10px; font-family: inherit;
}
.collapse-btn button:hover { color: #fff; background: rgba(255,255,255,.06); }

/* ---------- Main ---------- */
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; transition: margin-left .25s cubic-bezier(.4,0,.2,1); }
.main.expanded { margin-left: 78px; }

.topbar {
    background: rgba(255,255,255,.85);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
    padding: .65rem 1.5rem; display: flex; align-items: center; gap: .9rem;
    position: sticky; top: 0; z-index: 40;
}
.icon-btn {
    width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--border);
    background: #fff; display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 16px; color: var(--muted); position: relative;
    transition: background .15s, border-color .15s, transform .1s;
}
.icon-btn:hover { background: var(--bg); border-color: var(--border-strong); }
.icon-btn:active { transform: scale(.96); }
.badge-dot {
    position: absolute; top: -5px; right: -5px; background: var(--accent); color: #fff;
    font-size: 10px; font-weight: 800; min-width: 18px; height: 18px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center; padding: 0 4px;
    box-shadow: 0 0 0 2px #fff;
}
.searchbar { flex: 1; max-width: 560px; position: relative; }
.searchbar input {
    width: 100%; padding: .62rem 2.6rem .62rem 1rem; border-radius: 12px;
    border: 1px solid var(--border); background: #f3f4f6; font-size: 13.5px; font-family: inherit;
    transition: background .15s, border-color .15s, box-shadow .15s;
}
.searchbar input:focus { outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16,185,129,.15); }
.searchbar .s-ico { position: absolute; right: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }

.profile { margin-left: auto; display: flex; align-items: center; gap: .75rem; }
.profile .avatar {
    width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft);
    color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px;
}
.profile .p-name { font-weight: 700; font-size: 13.5px; line-height: 1.1; color: var(--ink); }
.profile .p-role { font-size: 11px; color: var(--muted); }

.content { padding: 1.75rem; max-width: 1600px; margin: 0 auto; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.page-head h1 { font-size: 22px; font-weight: 800; margin-bottom: .25rem; }
.page-head .sub { color: var(--muted); margin: 0; font-size: 13.5px; }

/* ---------- Cards ---------- */
.card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.card-header h3 { margin: 0; font-size: 15px; font-weight: 700; }
.card-body { padding: 1.25rem; }
.card-footer { padding: .9rem 1.25rem; border-top: 1px solid var(--border); }

.grid { display: grid; gap: 1rem; }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* ---------- Stat cards ---------- */
.stat-card { padding: 1.15rem 1.2rem; transition: transform .18s ease, box-shadow .18s ease; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .65rem; }
.stat-ico {
    width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft);
    color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.stat-value { font-size: 25px; font-weight: 800; margin-bottom: .15rem; letter-spacing: -.02em; color: var(--ink); }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat-trend { font-size: 12px; color: var(--accent-600); font-weight: 700; margin-top: .35rem; }
.stat-trend.neg { color: var(--danger); }
.spark { height: 28px; margin-top: .6rem; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .58rem 1.1rem;
    border-radius: 11px; border: 1px solid transparent; font-size: 13.5px; font-weight: 700;
    cursor: pointer; transition: all .15s ease; line-height: 1.2; font-family: inherit;
    white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(11,61,46,.4); }
.btn-primary:hover { background: var(--primary-600); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 16px -6px rgba(11,61,46,.6); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-600); color: #fff; transform: translateY(-1px); }
.btn-outline { background: #fff; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { background: var(--bg); border-color: var(--muted-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-sm { padding: .38rem .75rem; font-size: 12.5px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn:active { transform: scale(.98); }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex; align-items: center; gap: .3rem; padding: .24rem .6rem;
    border-radius: 999px; font-size: 11px; font-weight: 700; background: #f1f5f9; color: #475569;
    white-space: nowrap;
}
.badge-green { background: var(--accent-soft); color: #065f46; }
.badge-red { background: var(--danger-soft); color: #991b1b; }
.badge-yellow { background: var(--warning-soft); color: #92400e; }
.badge-blue { background: var(--info-soft); color: #1e40af; }
.badge-gray { background: #f1f5f9; color: #475569; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left; padding: .75rem 1.1rem; font-size: 11px; text-transform: uppercase;
    letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--border); background: #fafbfc; font-weight: 700;
}
.table td { padding: .85rem 1.1rem; border-bottom: 1px solid #f1f5f9; font-size: 13.5px; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover td { background: #fafbfc; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: .35rem; color: #334155; }
.form-control {
    width: 100%; padding: .6rem .8rem; border: 1px solid var(--border-strong); border-radius: 10px;
    font-size: 13.5px; background: #fff; font-family: inherit; transition: border-color .15s, box-shadow .15s; color: var(--text);
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16,185,129,.15); }
textarea.form-control { min-height: 96px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-hint { font-size: 12px; color: var(--muted-2); margin-top: .3rem; }

/* ---------- List rows ---------- */
.list-item { display: flex; align-items: center; gap: .9rem; padding: .8rem 1.25rem; border-bottom: 1px solid #f1f5f9; }
.list-item:last-child { border-bottom: none; }
.date-chip {
    width: 48px; text-align: center; background: #f1f5f9; border-radius: 10px; padding: .35rem .1rem; flex-shrink: 0;
}
.date-chip .m { font-size: 9.5px; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.date-chip .d { font-size: 15px; font-weight: 800; color: var(--ink); }
.list-body { flex: 1; min-width: 0; }
.list-title { font-weight: 700; font-size: 13.5px; color: var(--ink); }
.list-sub { font-size: 12px; color: var(--muted); }

/* ---------- Quick access ---------- */
.quick-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 1rem; }
.quick-item { text-align: center; display: block; padding: .5rem; border-radius: 14px; transition: background .15s; }
.quick-item:hover { background: var(--accent-softer); }
.quick-ico {
    width: 62px; height: 62px; border-radius: 18px; background: var(--accent-soft);
    color: var(--primary); display: flex; align-items: center; justify-content: center;
    font-size: 23px; margin: 0 auto .55rem; transition: transform .15s;
}
.quick-item:hover .quick-ico { transform: translateY(-2px); }
.quick-label { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---------- Charts ---------- */
.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 1rem; }
.chart-bars .bar {
    flex: 1; background: linear-gradient(180deg, var(--accent) 0%, var(--accent-600) 100%);
    border-radius: 8px 8px 0 0; position: relative; min-height: 4px; transition: opacity .15s;
}
.chart-bars .bar:hover { opacity: .85; }
.chart-bars .bar span { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); font-weight: 600; }
.hbar-row { display: flex; align-items: center; gap: .8rem; padding: .5rem 0; }
.hbar-label { width: 190px; font-size: 12.5px; flex-shrink: 0; font-weight: 600; color: var(--text); }
.hbar-track { flex: 1; height: 10px; background: #f0fdf4; border-radius: 6px; overflow: hidden; }
.hbar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-600)); border-radius: 6px; }
.hbar-val { width: 46px; text-align: right; font-size: 12px; color: var(--muted); font-weight: 700; }

.donut { position: relative; width: 170px; height: 170px; border-radius: 50%; margin: 0 auto; }
.donut-center {
    position: absolute; inset: 34px; background: #fff; border-radius: 50%;
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.05);
}
.donut-center .val { font-weight: 800; font-size: 16px; color: var(--ink); }
.donut-center .lbl { font-size: 10.5px; color: var(--muted); }
.legend { display: flex; flex-direction: column; gap: .5rem; margin-top: 1rem; }
.legend-item { display: flex; align-items: center; gap: .6rem; font-size: 12.5px; color: var(--text); }
.legend-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }

/* ---------- Alerts ---------- */
.alert { padding: .85rem 1rem; border-radius: 12px; margin-bottom: 1rem; font-size: 13.5px; font-weight: 500; }
.alert-success { background: var(--accent-soft); color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: var(--danger-soft); color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: var(--info-soft); color: #1e40af; border: 1px solid #bfdbfe; }

.impersonation-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    background: linear-gradient(90deg, #fef3c7, #fde68a); border: 1px solid #fcd34d;
    border-radius: 12px; padding: .65rem 1rem; margin-bottom: 1rem; color: #92400e;
}
.impersonation-banner > div { display: flex; align-items: center; gap: .6rem; font-size: 13.5px; flex-wrap: wrap; }
.impersonation-banner span { font-size: 12px; opacity: .85; }

/* ---------- Empty states ---------- */
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty .ico { font-size: 40px; margin-bottom: .5rem; opacity: .6; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: .4rem; margin-top: 1.5rem; align-items: center; }
.pagination a, .pagination span {
    padding: .45rem .8rem; border: 1px solid var(--border-strong); border-radius: 9px; font-size: 13px;
    background: #fff; color: var(--text); font-weight: 600; transition: all .15s;
}
.pagination a:hover { background: var(--bg); }
.pagination span.bg-primary, .pagination .btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Auth ---------- */
.auth-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(1200px 600px at 10% -10%, #1a6a4b 0%, transparent 55%),
                radial-gradient(1000px 700px at 110% 110%, #0d4a35 0%, transparent 55%),
                linear-gradient(160deg, #0b3d2e 0%, #06261d 100%);
    padding: 1.5rem;
}
.auth-card {
    width: 100%; max-width: 430px; background: #fff; border-radius: var(--radius-lg); padding: 2.25rem;
    box-shadow: var(--shadow-lg);
}
.auth-card .brand-logo { margin: 0 auto 1.1rem; width: 58px; height: 58px; font-size: 26px; }
.auth-card h2 { text-align: center; font-size: 22px; }
.auth-card .lead { text-align: center; color: var(--muted); font-size: 13.5px; margin-bottom: 1.5rem; }

/* ============================================================
   MARKETPLACE
   ============================================================ */
body.mkt { background: #fff; }

.mkt-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    transition: background .25s ease, box-shadow .25s ease, padding .25s ease;
    padding: .8rem 0;
    background: transparent;
}
.mkt-header.is-scrolled {
    background: rgba(255,255,255,.92);
    backdrop-filter: saturate(180%) blur(12px);
    box-shadow: 0 1px 0 rgba(0,0,0,.05), 0 8px 24px -18px rgba(0,0,0,.25);
    padding: .5rem 0;
}
.mkt-nav-inner { max-width: 1240px; margin: 0 auto; padding: 0 1.5rem; display: flex; align-items: center; gap: 1.4rem; }
.mkt-brand { display: flex; align-items: center; gap: .65rem; }
.mkt-brand .wordmark { font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.mkt-header .wordmark, .mkt-header .brand-tag { color: #fff; transition: color .25s; }
.mkt-header .brand-tag { font-size: 11px; opacity: .75; display: block; line-height: 1; }
.mkt-header.is-scrolled .wordmark { color: var(--primary); }
.mkt-header.is-scrolled .brand-tag { color: var(--muted); }
.mkt-header .brand-logo { width: 38px; height: 38px; font-size: 16px; border-radius: 11px; }

.mkt-links { display: flex; gap: .5rem; margin-left: auto; align-items: center; }
.mkt-links .lnk {
    color: #fff; font-weight: 600; font-size: 13.5px; padding: .5rem .85rem; border-radius: 10px; transition: background .15s, color .25s;
}
.mkt-links .lnk:hover { background: rgba(255,255,255,.12); color: #fff; }
.mkt-header.is-scrolled .mkt-links .lnk { color: var(--text); }
.mkt-header.is-scrolled .mkt-links .lnk:hover { background: var(--bg); color: var(--primary); }
.mkt-btn-primary {
    background: #fff; color: var(--primary) !important; border-radius: 11px; font-weight: 700;
    box-shadow: 0 2px 8px -2px rgba(0,0,0,.3);
}
.mkt-header.is-scrolled .mkt-btn-primary { background: var(--primary); color: #fff !important; }

/* Hero — compact, 65vh */
.hero {
    min-height: 65vh;
    display: flex; align-items: center; justify-content: center; text-align: center;
    position: relative; overflow: hidden; color: #fff; padding: 8rem 1.5rem 4rem;
    background:
        radial-gradient(900px 500px at 85% -10%, rgba(16,185,129,.35) 0%, transparent 60%),
        radial-gradient(700px 500px at 0% 110%, rgba(52,211,153,.2) 0%, transparent 55%),
        linear-gradient(150deg, #0b3d2e 0%, #06261d 60%, #041a13 100%);
}
.hero::before {
    content: ''; position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 26px 26px;
}
.hero-inner { position: relative; z-index: 2; width: 100%; max-width: 820px; }
.hero .eyebrow {
    display: inline-flex; align-items: center; gap: .5rem; background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.18); padding: .4rem .9rem; border-radius: 999px;
    font-size: 12.5px; font-weight: 600; color: #d1fae5; margin-bottom: 1.3rem; backdrop-filter: blur(6px);
}
.hero h1 { color: #fff; font-size: clamp(2rem, 4.5vw, 3.4rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.08; margin-bottom: 1rem; }
.hero h1 .grad { background: linear-gradient(90deg, #34d399, #a7f3d0); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { color: #cfe6da; font-size: 16.5px; max-width: 620px; margin: 0 auto 1.75rem; }

.hero-search { max-width: 660px; margin: 0 auto; }
.hero-search form {
    display: flex; align-items: center; gap: .5rem; background: #fff; border-radius: 16px;
    padding: .45rem; box-shadow: 0 24px 60px -20px rgba(0,0,0,.5);
}
.hero-search input {
    flex: 1; border: none; outline: none; padding: .85rem 1.1rem; font-size: 15px; font-family: inherit;
    background: transparent; color: var(--ink); border-radius: 12px;
}
.hero-search .hs-btn {
    background: var(--primary); color: #fff; border: none; padding: .85rem 1.5rem; border-radius: 12px;
    font-weight: 700; font-size: 14.5px; cursor: pointer; font-family: inherit; display: flex; align-items: center; gap: .5rem;
    transition: background .15s, transform .1s;
}
.hero-search .hs-btn:hover { background: var(--primary-600); }
.hero-search .hs-btn:active { transform: scale(.97); }

.hero-chips { display: flex; flex-wrap: wrap; gap: .55rem; justify-content: center; margin-top: 1.4rem; }
.hero-chip {
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); color: #eaf5ef;
    padding: .45rem 1rem; border-radius: 999px; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all .15s; backdrop-filter: blur(4px); text-decoration: none;
}
.hero-chip:hover { background: #fff; color: var(--primary); }

.hero-stats { display: flex; gap: 2.25rem; justify-content: center; margin-top: 2.25rem; flex-wrap: wrap; }
.hero-stat { text-align: center; }
.hero-stat .n { font-size: 22px; font-weight: 800; color: #fff; }
.hero-stat .l { font-size: 12px; color: #9ccbb6; font-weight: 600; }

/* Sections */
.container { max-width: 1240px; margin: 0 auto; padding: 1.5rem; }
.section { padding: 3rem 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.section-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.section-head .sub { color: var(--muted); margin: .25rem 0 0; font-size: 14px; }
.section-head .see-all { font-weight: 700; font-size: 13.5px; display: inline-flex; align-items: center; gap: .3rem; }

/* Category cards */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.cat-card {
    display: flex; flex-direction: column; align-items: center; gap: .7rem; padding: 1.5rem 1rem;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius); text-align: center;
    transition: all .18s ease; text-decoration: none; color: var(--text);
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--accent-soft); }
.cat-ico {
    width: 52px; height: 52px; border-radius: 16px; background: var(--accent-softer); color: var(--accent-600);
    display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.cat-card .name { font-weight: 700; font-size: 13.5px; color: var(--ink); }
.cat-card .count { font-size: 12px; color: var(--muted); }

/* Listing cards — premium */
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 1.25rem; }
.listing-card {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
    display: flex; flex-direction: column; transition: transform .22s cubic-bezier(.4,0,.2,1), box-shadow .22s;
}
.listing-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }
.listing-thumb { position: relative; height: 200px; background: linear-gradient(135deg, #d1fae5, #a7f3d0); overflow: hidden; }
.listing-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.4,0,.2,1); }
.listing-card:hover .listing-thumb img { transform: scale(1.07); }
.listing-thumb .lt-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, transparent 40%); }
.listing-badges { position: absolute; top: .7rem; left: .7rem; right: .7rem; display: flex; justify-content: space-between; align-items: center; }
.listing-badge {
    background: #fff; color: var(--ink); padding: .28rem .6rem; border-radius: 999px; font-size: 11px; font-weight: 700;
    box-shadow: 0 2px 6px rgba(0,0,0,.15); display: inline-flex; align-items: center; gap: .25rem;
}
.listing-badge.feat { background: var(--accent); color: #fff; }
.listing-fav {
    width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.95); border: none;
    display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.15);
    transition: transform .15s, color .15s;
}
.listing-fav:hover { transform: scale(1.1); color: var(--danger); }
.listing-body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.listing-city { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: .3rem; }
.listing-title { font-size: 15.5px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.listing-title a:hover { color: var(--accent-600); }
.listing-tags { display: flex; flex-wrap: wrap; gap: .4rem; font-size: 11.5px; color: var(--muted); }
.listing-rating { display: flex; align-items: center; gap: .3rem; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.listing-rating .stars { color: #f59e0b; letter-spacing: 1px; }
.listing-foot { margin-top: auto; padding-top: .6rem; border-top: 1px solid #f1f5f9; display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.listing-price { font-size: 19px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.listing-price .unit { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---------- Filter & sort bar ---------- */
.filter-bar {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 1rem; box-shadow: var(--shadow-sm); margin-bottom: 1.25rem;
    position: sticky; top: 72px; z-index: 30;
}
.filter-form { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.filter-form .filter-search {
    flex: 1 1 220px; min-width: 180px; padding: .62rem 1rem; border: 1px solid var(--border-strong);
    border-radius: 11px; font-size: 13.5px; font-family: inherit; background: #f8fafc; transition: border-color .15s, box-shadow .15s, background .15s;
}
.filter-form .filter-search:focus { outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16,185,129,.15); }
.filter-form select {
    padding: .62rem 2.2rem .62rem .9rem; border: 1px solid var(--border-strong); border-radius: 11px;
    font-size: 13.5px; font-family: inherit; background: #fff; color: var(--text); cursor: pointer;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .7rem center;
}
.filter-form select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16,185,129,.15); }
.filter-form .price-range {
    display: flex; align-items: center; gap: .45rem; padding: .62rem .8rem;
    border: 1px solid var(--border-strong); border-radius: 11px; background: #fff;
}
.filter-form .price-range span { color: var(--muted-2); font-size: 13px; }
.filter-form .price-range input {
    width: 76px; border: none; outline: none; font-size: 13.5px; font-family: inherit; color: var(--text);
    background: transparent; padding: 0;
}
.filter-form .price-range input::-webkit-outer-spin-button,
.filter-form .price-range input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.filter-form .price-range input[type=number] { -moz-appearance: textfield; }

.sort-tabs { display: flex; align-items: center; gap: .4rem; margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--border); flex-wrap: wrap; }
.sort-label { font-size: 12px; color: var(--muted); font-weight: 700; margin-right: .3rem; text-transform: uppercase; letter-spacing: .05em; }
.sort-pill {
    padding: .4rem .85rem; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted);
    border: 1px solid var(--border); background: #fff; transition: all .15s; text-decoration: none;
}
.sort-pill:hover { border-color: var(--border-strong); color: var(--text); }
.sort-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.active-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.active-filters .chip {
    display: inline-flex; align-items: center; gap: .45rem; background: var(--accent-softer); color: var(--accent-600);
    border: 1px solid #a7f3d0; padding: .32rem .7rem; border-radius: 999px; font-size: 12.5px; font-weight: 600;
}
.active-filters .chip a { color: var(--accent-600); font-weight: 800; font-size: 14px; line-height: 1; }
.active-filters .chip a:hover { color: var(--danger); }

/* Result count bar */
.results-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    margin-bottom: 1rem; font-size: 13px; color: var(--muted);
}
.results-bar .count { font-weight: 700; color: var(--ink); }

.results-count-badge {
    background: var(--accent-softer); color: var(--accent-600); border: 1px solid #a7f3d0;
    padding: .45rem .95rem; border-radius: 999px; font-size: 13px; font-weight: 800;
}
.results-count-badge span { font-weight: 600; opacity: .75; }

/* Listing detail */
.listing-detail { display: grid; grid-template-columns: 1.9fr 1fr; gap: 1.75rem; align-items: start; }
.listing-hero-img { position: relative; border-radius: var(--radius-lg); overflow: hidden; height: 400px; background: linear-gradient(135deg, #d1fae5, #a7f3d0); }
.listing-hero-img img { width: 100%; height: 100%; object-fit: cover; }
.gallery-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .6rem; margin-top: .6rem; }
.gallery-strip img { width: 100%; height: 84px; object-fit: cover; border-radius: 12px; border: 2px solid transparent; cursor: pointer; transition: border-color .15s; }
.gallery-strip img:hover, .gallery-strip img.active { border-color: var(--accent); }
.detail-block { margin-top: 1.5rem; }
.detail-block h3 { font-size: 17px; font-weight: 800; margin-bottom: .75rem; }
.amenity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.amenity-item { display: flex; align-items: center; gap: .55rem; font-size: 13.5px; padding: .6rem .7rem; background: #f8fafc; border-radius: 10px; }
.amenity-item .a-ico { color: var(--accent-600); display: flex; }
.sticky-book { position: sticky; top: 90px; }
.price-panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.4rem; box-shadow: var(--shadow-md); }

/* ---------- Marketplace mobile burger ---------- */
.mkt-burger {
    display: none; flex-direction: column; gap: 5px; background: transparent; border: none;
    cursor: pointer; padding: 10px; margin-left: auto; border-radius: 10px;
}
.mkt-burger span { width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: all .25s; display: block; }
.mkt-header.is-scrolled .mkt-burger span { background: var(--ink); }
.mkt-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mkt-burger.open span:nth-child(2) { opacity: 0; }
.mkt-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Solid readable backdrop whenever the mobile menu is open */
.mkt-header.menu-open { background: linear-gradient(160deg, #0b3d2e 0%, #06261d 100%); backdrop-filter: blur(12px); }
.mkt-header.menu-open .mkt-links { background: transparent; box-shadow: none; }
.mkt-header.menu-open .mkt-links .lnk { color: #eaf5ef; }
.mkt-header.menu-open .mkt-burger span { background: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1300px) {
    .grid-6 { grid-template-columns: repeat(3, 1fr); }
    .grid-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
    .grid-3, .grid-2 { grid-template-columns: 1fr 1fr; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .quick-grid { grid-template-columns: repeat(4, 1fr); }
    .listing-detail { grid-template-columns: 1fr; }
    .sticky-book { position: static; }
}

/* ---------- Tablet ---------- */
@media (max-width: 900px) {
    .content { padding: 1.25rem; }
    .container { padding: 1.1rem; }
    .page-head h1 { font-size: 20px; }
    .stat-value { font-size: 22px; }
    .profile .p-name, .profile .p-role { display: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
    /* Touch targets */
    .btn, .nav-item, .icon-btn { min-height: 44px; }
    .btn-sm { min-height: 36px; }
    .form-control, .filter-form select { font-size: 16px; } /* prevent iOS zoom */

    /* Dashboard sidebar drawer */
    .sidebar { transform: translateX(-100%); width: var(--sidebar-w); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .sidebar.collapsed { width: var(--sidebar-w); }
    .main { margin-left: 0; }
    .main.expanded { margin-left: 0; }

    .topbar { padding: .55rem 1rem; gap: .6rem; }

    .grid-6, .grid-5 { grid-template-columns: 1fr 1fr; }
    .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; }
    .quick-grid { grid-template-columns: repeat(3, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .searchbar { display: none; }
    .listing-grid { grid-template-columns: 1fr 1fr; }

    /* Tables become horizontally scrollable */
    .card-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table { min-width: 640px; }

    /* Marketplace header → slide-down mobile menu */
    .mkt-burger { display: flex; }
    .mkt-nav-inner { flex-wrap: wrap; }
    .mkt-links {
        display: none; flex-direction: column; align-items: stretch; width: 100%;
        gap: .25rem; padding: .75rem 0 .5rem; order: 3;
    }
    .mkt-links.open { display: flex; }
    .mkt-links .lnk {
        display: block; width: 100%; padding: .85rem 1rem; border-radius: 12px;
        font-size: 15px; color: #fff;
    }
    .mkt-header.is-scrolled .mkt-links { background: #fff; border-radius: 16px; padding: .75rem; box-shadow: var(--shadow-md); }
    .mkt-header.is-scrolled .mkt-links .lnk { color: var(--text); }
    .mkt-links .mkt-btn-primary { text-align: center; }
    .mkt-header .mkt-links .lnk:hover { background: rgba(255,255,255,.12); }

    /* Hero scales down */
    .hero { min-height: 62vh; padding: 6.5rem 1.1rem 3rem; }
    .hero h1 { font-size: clamp(1.7rem, 7vw, 2.4rem); }
    .hero p { font-size: 15px; }
    .hero-search form { flex-direction: column; background: transparent; box-shadow: none; gap: .5rem; padding: 0; }
    .hero-search input { background: #fff; border-radius: 14px; padding: 1rem 1.1rem; width: 100%; }
    .hero-search .hs-btn { width: 100%; justify-content: center; padding: .95rem; }
    .hero-stats { gap: 1.4rem; }
    .hero-stat .n { font-size: 19px; }
    .hero-chips { gap: .45rem; }

    .section { padding: 2rem 0; }
    .section-head h2 { font-size: 21px; }
    .cat-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .75rem; }
    .cat-card { padding: 1.1rem .75rem; }
    .cat-ico { width: 44px; height: 44px; font-size: 19px; }

    /* Filter bar stacks */
    .filter-bar { position: static; border-radius: 14px; padding: .85rem; }
    .filter-form { flex-direction: column; align-items: stretch; }
    .filter-form .filter-search { flex: none; }
    .filter-form .price-range { justify-content: space-between; }
    .filter-form .price-range input { flex: 1; min-width: 0; }
    .filter-form select { width: 100%; }
    .filter-form .btn { width: 100%; }
    .sort-tabs { gap: .35rem; }
    .sort-pill { padding: .5rem .85rem; font-size: 13px; }
    .sort-label { width: 100%; margin-bottom: .2rem; }

    .listing-hero-img { height: 260px; }
    .gallery-strip img { height: 70px; }
    .amenity-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }

    /* Footer */
    .mkt-footer-col { flex-basis: 100%; }

    /* Auth card */
    .auth-card { padding: 1.75rem; border-radius: 16px; }
}

/* ---------- Small phones ---------- */
@media (max-width: 520px) {
    .listing-grid { grid-template-columns: 1fr; }
    .listing-thumb { height: 220px; }
    .quick-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-6, .grid-5 { grid-template-columns: 1fr; }
    .quick-ico { width: 54px; height: 54px; font-size: 20px; }
    .content { padding: 1rem; }
    .page-head { gap: .75rem; }
    .stat-value { font-size: 20px; }
    .hero { min-height: 68vh; }
    .hero-stats { gap: 1rem; }
    .results-count-badge { display: none; }
    .impersonation-banner { flex-direction: column; align-items: stretch; }
    .impersonation-banner .btn { width: 100%; }
}

/* ---------- Animations ---------- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .5s ease both; }
.fade-up-1 { animation-delay: .05s; }
.fade-up-2 { animation-delay: .1s; }
.fade-up-3 { animation-delay: .15s; }
.fade-up-4 { animation-delay: .2s; }
