/* ============================================================
   Boardany – Main Stylesheet
   Primary: Navy Light Blue  #0ea5e9 / #0284c7
   ============================================================ */

/* ---------- Reset & Variables ---------- */
:root {
    --primary:        #0284c7;
    --primary-dark:   #0369a1;
    --primary-light:  #e0f2fe;
    --primary-xlight: #f0f9ff;
    --accent:         #0ea5e9;

    --bg:       #f0f9ff;
    --surface:  #ffffff;
    --surface2: #f8fafc;

    --text:     #0f172a;
    --text-2:   #334155;
    --muted:    #64748b;
    --line:     #e2e8f0;

    --success-bg:  #dcfce7;
    --success-txt: #14532d;
    --error-bg:    #fee2e2;
    --error-txt:   #7f1d1d;
    --warn-bg:     #fff7ed;
    --warn-border: #fed7aa;

    --danger:      #dc2626;
    --danger-dark: #b91c1c;

    --radius:   10px;
    --radius-sm: 6px;
    --shadow:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --shadow-md:0 4px 12px rgba(2,132,199,.12);
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.6 -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; color: var(--text); }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; margin-top: 1.6rem; }
h3 { font-size: 1.05rem; }

p { margin: 0 0 .75em; }

/* ---------- Layout ---------- */
.container {
    margin: 0 auto;
    max-width: 1200px;
    padding: 20px 16px;
}

.admin-area .container { max-width: 1400px; }

/* ---------- Header ---------- */
.site-header {
    background: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(2,105,161,.25);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1200px;
    padding: 0 16px;
    position: relative;
    height: 72px;
}

.brand {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -.5px;
    text-decoration: none;
}
.brand:hover { color: #e0f2fe; text-decoration: none; }

.brand span {
    color: #7dd3fc;
}

.logo-brand {
    align-items: center;
    display: inline-flex;
    gap: 9px;
}

.brand-logo {
    display: block;
    height: 60px;
    object-fit: cover;
    object-position: center;
    width: 220px;
}

.admin-brand {
    font-size: 1rem;
}

.admin-brand-label {
    color: #e2e8f0 !important;
    font-weight: 700;
    letter-spacing: 0;
}

.site-header nav {
    align-items: center;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.site-header nav a {
    color: #bae6fd;
    font-size: .9rem;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: background .15s, color .15s;
}

.site-header nav a:hover {
    background: rgba(255,255,255,.12);
    color: #fff;
    text-decoration: none;
}

.site-header nav a.is-active {
    background: #fff;
    color: var(--primary-dark);
    font-weight: 700;
}

.admin-signout-form {
    align-items: center;
    color: #e0f2fe;
    display: inline-flex;
    gap: 6px;
    margin-left: 6px;
}

.admin-signout-form span {
    font-size: .82rem;
    font-weight: 700;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-signout-form button {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.25);
    box-shadow: none;
    color: #fff;
    font-size: .82rem;
    padding: 6px 10px;
}

.admin-signout-form button:hover {
    background: rgba(255,255,255,.2);
    box-shadow: none;
}

.nav-toggle {
    align-items: center;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: var(--radius-sm);
    display: none;
    height: 40px;
    justify-content: center;
    padding: 0;
    position: relative;
    width: 42px;
}

.nav-toggle:hover {
    background: rgba(255,255,255,.2);
    box-shadow: none;
}

.nav-toggle span {
    background: #fff;
    border-radius: 999px;
    display: block;
    height: 2px;
    position: absolute;
    width: 18px;
}

.nav-toggle span:nth-child(1) { transform: translateY(-6px); }
.nav-toggle span:nth-child(3) { transform: translateY(6px); }

.admin-area .site-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    box-shadow: 0 2px 10px rgba(2,105,161,.28);
}

.admin-area .header-inner {
    max-width: 1400px;
}

.post-link {
    background: #fff !important;
    color: var(--primary-dark) !important;
    font-weight: 700 !important;
    padding: 7px 14px !important;
    border-radius: var(--radius-sm) !important;
    font-size: .88rem !important;
    transition: background .15s, box-shadow .15s !important;
}
.post-link:hover {
    background: #e0f2fe !important;
    box-shadow: 0 2px 6px rgba(0,0,0,.12) !important;
    text-decoration: none !important;
}

.sponsor-strip {
    background: #e0f2fe;
    border-bottom: 1px solid #bae6fd;
    padding: 12px 16px;
}

.sponsor-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 auto;
    max-width: 1200px;
}

.sponsor-slot {
    background: #fff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius-sm);
    color: var(--text);
    display: block;
    height: clamp(82px, 8vw, 118px);
    overflow: hidden;
    padding: 0;
    text-decoration: none;
}

.sponsor-slot:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.sponsor-slot img {
    display: block;
    height: 100%;
    object-fit: contain;
    width: 100%;
}

/* ---------- Buttons ---------- */
button, .button {
    align-items: center;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font: 600 .9rem/1 inherit;
    gap: 6px;
    justify-content: center;
    padding: 10px 18px;
    text-decoration: none;
    transition: background .15s, box-shadow .15s, transform .1s;
    white-space: nowrap;
}

button:hover, .button:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: #fff;
}

button:active, .button:active { transform: translateY(1px); }

button:disabled, .button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.button-icon {
    flex: 0 0 auto;
    height: 18px;
    width: 18px;
}

.button.secondary {
    background: var(--surface);
    border: 1.5px solid var(--line);
    color: var(--text-2);
}
.button.secondary:hover {
    background: var(--primary-xlight);
    border-color: var(--primary);
    color: var(--primary-dark);
    box-shadow: none;
}

.button.danger, button.danger {
    background: var(--danger);
}
.button.danger:hover, button.danger:hover {
    background: var(--danger-dark);
}

.button.whatsapp-button {
    background: #25d366;
    color: #fff;
}
.button.whatsapp-button:hover {
    background: #1ebe5d;
    color: #fff;
}

.button.google-button {
    background: #fff;
    border: 1.5px solid var(--line);
    color: var(--text);
    width: 100%;
}
.button.google-button:hover {
    background: var(--surface2);
    border-color: #cbd5e1;
    box-shadow: none;
    color: var(--text);
}

.button.report-button {
    background: #fef9c3;
    border: 1.5px solid #fde68a;
    color: #713f12;
}
.button.report-button:hover {
    background: #fef3c7;
    border-color: #facc15;
    box-shadow: none;
    color: #713f12;
}

.button.edit-button {
    background: #e0f2fe;
    border: 1.5px solid #bae6fd;
    color: var(--primary-dark);
}
.button.edit-button:hover {
    background: #bae6fd;
    border-color: var(--primary);
    box-shadow: none;
    color: var(--primary-dark);
}

.button.pin-button {
    background: #fef9c3;
    border: 1.5px solid #fde68a;
    color: #713f12;
}
.button.pin-button:hover {
    background: #fef3c7;
    border-color: #facc15;
    box-shadow: none;
    color: #713f12;
}

.button.sm { padding: 6px 12px; font-size: .82rem; }

.inline-form { display: inline; margin: 0; }

/* ---------- Flash / Alerts ---------- */
.flash {
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    padding: 11px 14px;
    font-size: .9rem;
}
.has-js .flash { display: none; }
.flash.success { background: var(--success-bg); color: var(--success-txt); }
.flash.error   { background: var(--error-bg);   color: var(--error-txt); }

.notice {
    background: var(--warn-bg);
    border: 1px solid var(--warn-border);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-size: .9rem;
}

/* ---------- Hero / Search ---------- */
.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    border-radius: var(--radius);
    color: #fff;
    padding: 32px 28px 28px;
    margin-bottom: 4px;
}

.hero h1 { color: #fff; font-size: 1.9rem; margin-bottom: .3em; }
.hero .sub { color: #bae6fd; font-size: 1rem; margin-bottom: 1.2rem; }

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.hero .button {
    background: #fff;
    color: var(--primary-dark);
    font-weight: 700;
}
.hero .button:hover {
    background: #e0f2fe;
    box-shadow: 0 3px 10px rgba(0,0,0,.15);
}
.hero .button.secondary {
    background: rgba(255,255,255,.15);
    border: 1.5px solid rgba(255,255,255,.5);
    color: #fff;
}
.hero .button.secondary:hover {
    background: rgba(255,255,255,.25);
    border-color: #fff;
}

/* Search bar inside hero */
.search-box {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: var(--radius);
    padding: 16px;
    backdrop-filter: blur(4px);
}

.search-row {
    align-items: flex-end;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(200px, 1.5fr) minmax(160px, 1fr) minmax(160px, 1fr) auto;
}

.search-row label {
    color: #e0f2fe;
    font-size: .82rem;
    font-weight: 600;
    display: grid;
    gap: 5px;
}

.search-row input,
.search-row select {
    background: #fff;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    padding: 10px 12px;
    width: 100%;
}

.search-row button {
    background: #fff;
    color: var(--primary-dark);
    font-weight: 700;
    min-height: 42px;
    padding: 10px 20px;
}
.search-row button:hover {
    background: #e0f2fe;
    box-shadow: none;
}

/* ---------- Section headings ---------- */
.section-title {
    align-items: center;
    border-bottom: 2px solid var(--primary-light);
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin: 24px 0 14px;
    padding-bottom: 8px;
}

.section-title h2 {
    color: var(--primary-dark);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.section-title a:not(.button) {
    color: var(--primary);
    font-size: .85rem;
    font-weight: 600;
}

/* ---------- Cards / Grid ---------- */
.grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.home-countries-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-cities-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.link-card {
    align-items: center;
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--text-2);
    display: flex;
    gap: 10px;
    min-height: 52px;
    padding: 10px 14px;
    transition: border-color .15s, box-shadow .15s, transform .1s;
    text-decoration: none;
}

.link-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    color: var(--primary-dark);
    text-decoration: none;
    transform: translateY(-1px);
}

.link-card strong {
    flex: 1;
    font-size: .92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-card .count {
    background: var(--primary-light);
    border-radius: 999px;
    color: var(--primary-dark);
    font-size: .75rem;
    font-weight: 700;
    padding: 2px 8px;
    white-space: nowrap;
}

.stat-card {
    align-items: center;
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    gap: 10px;
    min-height: 52px;
    padding: 10px 14px;
}

/* ---------- Admin dashboard ---------- */
.dashboard-header {
    align-items: flex-end;
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.metric-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    margin-bottom: 18px;
}

.metric-card {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    color: var(--text);
    display: grid;
    gap: 5px;
    min-height: 116px;
    padding: 16px;
    text-decoration: none;
}

.metric-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    color: var(--text);
    text-decoration: none;
}

.metric-card.attention {
    border-color: #f59e0b;
}

.metric-card.warning {
    border-color: var(--warn-border);
}

.metric-label {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.metric-card strong {
    color: var(--text);
    font-size: 2rem;
    line-height: 1;
}

.metric-note {
    color: var(--muted);
    font-size: .85rem;
}

.admin-dashboard-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 16px;
}

.admin-dashboard-grid.wide {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
}

.admin-panel {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    padding: 16px;
}

.settings-form {
    display: grid;
    gap: 14px;
}

.settings-card {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    padding: 16px;
}

.settings-card-head {
    border-bottom: 1px solid var(--line);
    margin-bottom: 14px;
    padding-bottom: 10px;
}

.settings-card-head h2 {
    color: var(--primary-dark);
    font-size: 1rem;
    margin: 0 0 4px;
}

.settings-card-head p {
    color: var(--muted);
    font-size: .85rem;
    margin: 0;
}

.status-list,
.recent-list {
    display: grid;
    gap: 8px;
}

.status-row,
.recent-row {
    align-items: center;
    background: var(--surface2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 10px 12px;
    text-decoration: none;
}

a.status-row:hover,
.recent-row a:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

.recent-row span,
.recent-meta {
    color: var(--muted);
    display: block;
    font-size: .82rem;
}

.recent-meta {
    text-align: right;
    white-space: nowrap;
}

.status-badge {
    background: var(--primary-light);
    border-radius: 999px;
    color: var(--primary-dark) !important;
    display: inline-flex !important;
    font-weight: 700;
    margin-bottom: 4px;
    padding: 2px 8px;
}

/* ---------- Category Groups ---------- */
.category-groups {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.category-group {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
}

.category-group h3 {
    color: var(--primary-dark);
    font-size: .9rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.category-pill {
    background: var(--primary-xlight);
    border: 1px solid var(--primary-light);
    border-radius: 999px;
    color: var(--primary-dark);
    font-size: .82rem;
    font-weight: 500;
    padding: 5px 12px;
    transition: background .15s, border-color .15s;
    text-decoration: none;
}

.category-pill:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
    text-decoration: none;
}

/* ---------- Listing List ---------- */
.listing-list {
    display: grid;
    gap: 10px;
}

.listing-row {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    gap: 14px;
    padding: 14px;
    transition: border-color .15s, box-shadow .15s;
    text-decoration: none;
    color: inherit;
}

.listing-row:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.listing-thumb {
    background: var(--primary-xlight);
    border-radius: var(--radius-sm);
    flex: 0 0 100px;
    height: 82px;
    overflow: hidden;
}

.listing-thumb img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.listing-body { flex: 1; min-width: 0; }

.listing-row h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.listing-meta {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: .8rem;
    gap: 4px 10px;
    margin-bottom: 5px;
}

.meta-item {
    align-items: center;
    display: inline-flex;
    gap: 3px;
}

.meta-icon { flex: 0 0 auto; height: 13px; width: 13px; }

.listing-row p {
    color: var(--text-2);
    font-size: .88rem;
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.price {
    color: #15803d;
    font-size: .95rem;
    font-weight: 700;
}

/* ---------- Ad Detail ---------- */
.detail {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.detail-meta {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: .85rem;
    gap: 6px 14px;
    margin-bottom: 12px;
}

.gallery {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    margin: 16px 0;
}

.gallery-item {
    background: transparent;
    border: 0;
    cursor: zoom-in;
    padding: 0;
}

.gallery img, .gallery-item img {
    aspect-ratio: 4/3;
    border-radius: var(--radius-sm);
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.listing-details {
    background: var(--surface2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    margin: 16px 0;
    padding: 14px;
}

.listing-details h3,
.dynamic-fields h3 {
    color: var(--primary-dark);
    font-size: .95rem;
    margin-bottom: 10px;
}

.listing-details dl {
    display: grid;
    gap: 8px 14px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin: 0;
}

.listing-details dl > div {
    min-width: 0;
}

.listing-details dt {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.listing-details dd {
    color: var(--text-2);
    margin: 2px 0 0;
}

.safety-alert {
    background: #fef9c3;
    border: 1px solid #fde68a;
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 2px rgba(113,63,18,.06);
    color: #713f12;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.45;
    margin: 16px 0 0;
    padding: 8px 12px;
    overflow-wrap: anywhere;
}

/* ---------- Forms ---------- */
.form {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: grid;
    gap: 16px;
    padding: 20px;
}

.form.narrow { max-width: 520px; }
.form.borderless { background: transparent; border: none; box-shadow: none; padding: 0; }

label {
    display: grid;
    font-size: .88rem;
    font-weight: 600;
    gap: 5px;
    color: var(--text-2);
}

.field-hint {
    color: var(--muted);
    font-size: .8rem;
    font-weight: 400;
    line-height: 1.4;
}

.check-row {
    align-items: center;
    display: flex;
    gap: 8px;
    font-weight: 500;
}
.check-row input { width: auto; }

input, select, textarea {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    padding: 10px 12px;
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2,132,199,.12);
    outline: none;
}

textarea { min-height: 140px; resize: vertical; }

.two-col {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.settings-row {
    display: grid;
    gap: 12px;
    grid-column: 1 / -1;
    grid-template-columns: minmax(170px, .7fr) minmax(220px, 1.3fr) minmax(220px, 1.3fr);
}

.dynamic-fields {
    background: var(--surface2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px;
}

/* ---------- Search page ---------- */
.search-panel {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 4px;
}

.search-panel .search-row {
    grid-template-columns: minmax(200px, 1.5fr) minmax(160px, 1fr) minmax(160px, 1fr) auto;
}

.search-panel .search-row label { color: var(--text-2); }

.search-panel .search-row input,
.search-panel .search-row select {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 10px 12px;
}

.search-panel .search-row input:focus,
.search-panel .search-row select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2,132,199,.12);
    outline: none;
}

.search-panel .search-row button {
    background: var(--primary);
    color: #fff;
    min-height: 42px;
}
.search-panel .search-row button:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

.listing-filter-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-top: 12px;
}

.listing-filter-primary {
    margin-top: 0;
}

.listing-filter-grid label {
    color: var(--text-2);
    display: grid;
    font-size: .82rem;
    font-weight: 600;
    gap: 5px;
}

.listing-filter-check {
    align-content: end;
    align-items: center;
    display: flex !important;
    min-height: 42px;
}

.filter-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.listing-advanced-filters {
    border-top: 1px solid var(--line);
    margin-top: 12px;
    padding-top: 10px;
}

.listing-advanced-filters summary {
    color: var(--primary);
    cursor: pointer;
    font-size: .88rem;
    font-weight: 700;
}

/* ---------- Pagination ---------- */
.pagination {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
}

.pagination a, .pagination span {
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    min-width: 34px;
    padding: 5px 10px;
    text-decoration: none;
    transition: border-color .15s, background .15s;
}

.pagination a:hover {
    background: var(--primary-xlight);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.pagination .current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 700;
}

.pagination a.button:not(.secondary) {
    color: #fff;
}

.page-gap { border: none !important; color: var(--muted); }

/* ---------- 404 ---------- */
.not-found-page {
    display: grid;
    gap: 14px;
}

.not-found-page > .muted {
    font-size: 1rem;
    max-width: 680px;
}

.not-found-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 6px;
}

/* ---------- Tables ---------- */
table { border-collapse: collapse; width: 100%; }

th {
    background: var(--primary-xlight);
    color: var(--primary-dark);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

th, td {
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--primary-xlight); }

.admin-table-wrap {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.admin-users-table {
    min-width: 1120px;
    table-layout: fixed;
}

.admin-users-table th:nth-child(1) { width: 6%; }
.admin-users-table th:nth-child(2) { width: 27%; }
.admin-users-table th:nth-child(3) { width: 10%; }
.admin-users-table th:nth-child(4) { width: 11%; }
.admin-users-table th:nth-child(5) { width: 11%; }
.admin-users-table th:nth-child(6) { width: 13%; }
.admin-users-table th:nth-child(7) { width: 22%; }

.admin-users-table th:nth-child(1),
.admin-users-table th:nth-child(3),
.admin-users-table th:nth-child(4),
.admin-users-table th:nth-child(5),
.admin-users-table th:nth-child(6),
.admin-users-table td:nth-child(1),
.admin-users-table td:nth-child(3),
.admin-users-table td:nth-child(4),
.admin-users-table td:nth-child(5),
.admin-users-table td:nth-child(6) {
    text-align: center;
    vertical-align: middle;
}

.admin-users-table td:nth-child(2) {
    overflow-wrap: anywhere;
}

.my-listings-table strong a {
    color: var(--primary-dark);
}

.my-listings-table th:nth-child(2),
.my-listings-table th:nth-child(3),
.my-listings-table td:nth-child(2),
.my-listings-table td:nth-child(3) {
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.my-listings-table th:nth-child(1) { width: 36%; }
.my-listings-table th:nth-child(2) { width: 12%; }
.my-listings-table th:nth-child(3) { width: 14%; }
.my-listings-table th:nth-child(4) {
    text-align: center;
    width: 38%;
}

.my-listings-table td:nth-child(4) {
    vertical-align: middle;
}

.my-listings-table td:nth-child(4) .actions {
    flex-wrap: nowrap;
    justify-content: center;
    white-space: nowrap;
}

.my-listings-table td:nth-child(4) .button,
.my-listings-table td:nth-child(4) button {
    padding-left: 10px;
    padding-right: 10px;
}

/* ---------- Admin filter ---------- */
.admin-filter-form { margin: 14px 0; }

.admin-filter-grid {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(200px, 1.2fr) repeat(3, minmax(150px, 1fr)) auto;
}

.admin-user-ad-action {
    flex-basis: 100%;
    font-size: .8rem;
    margin-top: 2px;
}

.admin-user-change-form {
    align-items: center;
}

.admin-user-status-select {
    min-width: 120px;
    width: auto;
}

/* ---------- Muted / Meta helpers ---------- */
.muted, .meta { color: var(--muted); }
.meta-category { color: var(--muted); }
.featured-label {
    background: #fef3c7;
    border-radius: 999px;
    color: #92400e;
    font-weight: 700;
    padding: 1px 8px;
}

.account-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-summary {
    display: grid;
    gap: 12px;
}

.trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.trust-badge {
    background: var(--surface2);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    display: inline-flex;
    font-size: .78rem;
    font-weight: 700;
    padding: 3px 9px;
}

.trust-badge.verified {
    background: var(--success-bg);
    border-color: #86efac;
    color: var(--success-txt);
}

.contact-trust {
    margin: -4px 0 12px;
}

.limit-strip {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.limit-strip span {
    background: var(--primary-xlight);
    border: 1px solid var(--primary-light);
    border-radius: 999px;
    color: var(--primary-dark);
    font-size: .82rem;
    font-weight: 700;
    padding: 4px 10px;
}

.subtle-divider {
    border-top: 1px solid var(--line);
    margin: 14px 0;
}

.verification-panel,
.verification-nudge {
    margin-top: 14px;
}

.status-pill {
    border-radius: 999px;
    display: inline-flex;
    font-size: .78rem;
    font-weight: 700;
    padding: 3px 10px;
}

.status-active { background: var(--success-bg); color: var(--success-txt); }
.status-paused { background: #fef3c7; color: #92400e; }
.status-expired { background: #fee2e2; color: #7f1d1d; }
.status-pending_review,
.status-pending_email { background: var(--primary-xlight); color: var(--primary-dark); }
.status-deleted,
.status-rejected { background: var(--surface2); color: var(--muted); }

/* ---------- Actions row ---------- */
.actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.contact-actions {
    flex-wrap: nowrap;
    gap: 6px;
}

.contact-actions .button {
    flex: 1 1 0;
    min-width: 0;
    padding-left: 10px;
    padding-right: 10px;
}

.contact-actions .report-button {
    flex-grow: .85;
    font-size: .82rem;
}

.contact-actions .button-icon {
    height: 16px;
    width: 16px;
}

.share-panel {
    align-items: center;
    border-top: 1px solid var(--line);
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: .86rem;
    font-weight: 600;
    gap: 8px;
    margin: 18px 0 0;
    padding: 16px 0;
}

.share-panel span {
    margin-right: 4px;
}

.share-icon {
    align-items: center;
    background: var(--surface2);
    border: 1.5px solid var(--line);
    border-radius: 50%;
    color: var(--text-2);
    display: inline-flex;
    height: 38px;
    justify-content: center;
    transition: background .15s, border-color .15s, color .15s, transform .1s;
    width: 38px;
}

.share-icon:hover {
    background: var(--primary-xlight);
    border-color: var(--primary);
    color: var(--primary-dark);
    text-decoration: none;
}

.share-icon:active {
    transform: translateY(1px);
}

.share-icon .button-icon {
    height: 17px;
    width: 17px;
}

/* ---------- Lightbox ---------- */
.lightbox {
    align-items: center;
    background: rgba(0,0,0,.9);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 54px 72px;
    position: fixed;
    z-index: 1000;
}
.lightbox[hidden] { display: none; }

.lightbox-stage {
    align-items: center;
    display: flex;
    height: calc(100vh - 108px);
    justify-content: center;
    max-width: 1280px;
    position: relative;
    width: min(100%, 1280px);
}

.lightbox-image {
    height: 100%;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    width: 100%;
}

.lightbox-close, .lightbox-nav {
    align-items: center;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 999px;
    color: #fff;
    display: flex;
    height: 56px;
    justify-content: center;
    padding: 0;
    width: 56px;
    z-index: 2;
}
.lightbox-close {
    font-size: 28px;
    position: fixed;
    right: 18px;
    top: 18px;
    z-index: 3;
}
.lightbox-nav {
    font-size: 40px;
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
}
.lightbox-prev  { left: 18px; }
.lightbox-next  { right: 18px; }
.lightbox-open  { overflow: hidden; }

/* ---------- Footer ---------- */
.site-footer {
    background: #0c1a2e;
    border-top: none;
    color: #94a3b8;
    font-size: .85rem;
    margin-top: 40px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.site-footer nav { display: flex; gap: 12px; flex-wrap: wrap; }
.site-footer nav a { color: #94a3b8; }
.site-footer nav a:hover { color: #fff; }

.site-footer-brand {
    align-items: center;
    display: inline-flex;
    gap: 10px;
    margin: 0;
}

.site-footer-logo {
    display: block;
    height: 44px;
    object-fit: cover;
    object-position: center;
    width: 156px;
}

.public-footer {
    background: #0c1a2e;
    border-top: none;
    color: #94a3b8;
    margin-top: 40px;
    padding: 0;
}

.footer-inner {
    display: grid;
    gap: 32px;
    grid-template-columns: minmax(200px, 1.2fr) minmax(260px, 2fr) minmax(160px, .9fr);
    margin: 0 auto;
    max-width: 1200px;
    padding: 40px 16px 28px;
}

.footer-logo-link {
    display: inline-block;
    margin-bottom: 12px;
}

.footer-logo-link:hover {
    text-decoration: none;
}

.footer-logo {
    display: block;
    height: 92px;
    object-fit: cover;
    object-position: center;
    width: 300px;
}

.footer-brand p {
    color: #94a3b8;
    font-size: .88rem;
    line-height: 1.6;
    margin-bottom: 16px;
    max-width: 320px;
}

.public-footer h3 {
    color: #e2e8f0;
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .05em;
    margin-bottom: 14px;
    text-transform: uppercase;
}

.footer-links {
    display: grid;
    gap: 8px;
}

.footer-links.columns {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
}

.public-footer a {
    color: #94a3b8;
    font-size: .85rem;
    transition: color .15s;
}
.public-footer a:hover { color: #fff; text-decoration: none; }

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.social-links a {
    align-items: center;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 50%;
    color: #94a3b8 !important;
    display: inline-flex;
    height: 36px;
    justify-content: center;
    padding: 0;
    transition: background .15s, color .15s;
    width: 36px;
}
.social-links a:hover {
    background: rgba(255,255,255,.12);
    color: #fff !important;
}

.social-links .button-icon {
    height: 17px;
    width: 17px;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.07);
    color: #64748b;
    font-size: .82rem;
    margin: 0 auto;
    max-width: 1200px;
    padding: 16px;
    text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .search-row,
    .search-panel .search-row {
        grid-template-columns: 1fr 1fr;
    }
    .search-row button { grid-column: span 2; }

    .footer-inner { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: span 2; }
    .account-grid { grid-template-columns: 1fr; }
    .home-countries-grid,
    .home-cities-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    h1 { font-size: 1.4rem; }
    body { overflow-x: hidden; }
    .container {
        overflow-x: hidden;
        padding-left: 12px;
        padding-right: 12px;
        width: 100%;
    }
    .hero { padding: 22px 16px 18px; }
    .hero h1 { font-size: 1.4rem; }
    .home-countries-grid,
    .home-cities-grid { grid-template-columns: 1fr; }

    .header-inner { height: 64px; }
    .brand { font-size: 1.2rem; }
    .brand-logo { height: 52px; width: 180px; }
    .admin-brand .brand-logo { width: 150px; }
    .admin-brand-label { font-size: .86rem; }

    .nav-toggle { display: inline-flex; }

    .site-header nav {
        align-items: stretch;
        background: #075985;
        border: 1px solid rgba(224,242,254,.28);
        border-radius: var(--radius-sm);
        box-shadow: 0 14px 30px rgba(3,105,161,.28);
        display: none;
        flex-direction: column;
        gap: 4px;
        left: auto;
        min-width: 190px;
        padding: 8px;
        position: absolute;
        right: 12px;
        top: calc(100% + 6px);
        width: max-content;
        max-width: calc(100vw - 24px);
    }

    .admin-area .site-header nav {
        background: #075985;
    }

    .site-header nav.is-open {
        display: flex;
    }

    .site-header nav a {
        font-size: .9rem;
        padding: 10px 12px;
        width: auto;
    }

    .site-header nav .post-link {
        align-self: flex-start;
        margin-top: 4px;
        min-width: 0;
        padding-left: 12px !important;
        padding-right: 12px !important;
        text-align: center;
        width: auto;
    }

    .admin-signout-form {
        align-items: stretch;
        flex-direction: column;
        margin: 4px 0 0;
    }

    .admin-signout-form span {
        max-width: none;
        padding: 0 4px;
    }

    .search-row,
    .search-panel .search-row {
        grid-template-columns: 1fr;
    }
    .search-row button { grid-column: span 1; }
    .sponsor-grid { grid-template-columns: 1fr; }

    .listing-list {
        min-width: 0;
        width: 100%;
    }
    .listing-row {
        gap: 10px;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
        padding: 12px;
        width: 100%;
    }
    .listing-thumb {
        flex: 0 0 76px;
        height: 64px;
    }
    .listing-body,
    .listing-meta,
    .meta-item {
        min-width: 0;
    }
    .meta-item {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .admin-filter-grid { grid-template-columns: 1fr; }
    .admin-dashboard-grid,
    .admin-dashboard-grid.wide { grid-template-columns: 1fr; }
    .recent-row { align-items: flex-start; }
    .recent-meta { text-align: left; white-space: normal; }

    .footer-inner,
    .footer-links.columns {
        grid-template-columns: 1fr;
    }
    .footer-brand { grid-column: span 1; }

    .lightbox { padding: 54px 12px; }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }

    .two-col { grid-template-columns: 1fr; }
    .settings-row { grid-template-columns: 1fr; }
    .my-listings-table {
        background: transparent;
        border: none;
        box-shadow: none;
        overflow-x: visible;
    }
    .my-listings-table table,
    .my-listings-table thead,
    .my-listings-table tbody,
    .my-listings-table tr,
    .my-listings-table td {
        display: block;
    }
    .my-listings-table thead {
        display: none;
    }
    .my-listings-table tr {
        background: var(--surface);
        border: 1.5px solid var(--line);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        display: grid;
        gap: 8px;
        grid-template-columns: 1fr auto;
        margin-bottom: 10px;
        padding: 12px;
    }
    .my-listings-table td {
        border: none;
        min-width: 0;
        padding: 0;
    }
    .my-listings-table td:first-child,
    .my-listings-table td:last-child {
        grid-column: 1 / -1;
    }
    .my-listings-table td:first-child strong {
        display: block;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }
    .my-listings-table td:nth-child(2),
    .my-listings-table td:nth-child(3) {
        align-self: center;
    }
    .my-listings-table td:nth-child(2) {
        text-align: left;
    }
    .my-listings-table td:nth-child(3) {
        color: var(--muted);
        font-size: .82rem;
        text-align: right;
    }
    .my-listings-table td:nth-child(3)::before {
        content: "EXP: ";
        color: var(--danger);
        font-weight: 700;
    }
    .my-listings-table td:last-child {
        border-top: 1px solid var(--line);
        padding-top: 10px;
    }
    .my-listings-table .actions {
        display: grid;
        gap: 6px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .my-listings-table .actions .button,
    .my-listings-table .actions button {
        min-width: 0;
        width: 100%;
    }
    .my-listings-table .actions .inline-form {
        display: block;
        min-width: 0;
    }
    .my-listings-table .actions .inline-form button {
        width: 100%;
    }
}
