:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-main: #f8fafc;
    --text-main: #1e293b;
    --border-color: #e2e8f0;
    --header-bg: #0f172a;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    padding-bottom: 70px;
}

/* ===== HEADER ===== */
header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.brand-title {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.auth-badge {
    background: #e0f2fe;
    color: #0369a1;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    border: 1px solid #bae6fd;
}

.menu-container {
    position: relative;
}

.menu-btn {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 14px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 4px;
}

.menu-btn:hover {
    background: #f8fafc;
}

.menu-dropdown {
    display: none;
    position: absolute;
    top: 40px;
    left: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 500;
    min-width: 260px;
    padding: 8px 0;
}

.menu-dropdown.show {
    display: block;
}

.menu-item {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.menu-item:hover {
    background: #eff6ff;
    color: var(--primary);
}

.menu-item:last-child {
    border-bottom: none;
}

.unread-badge {
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: 6px;
    display: inline-block;
}

/* ===== HERO BANNER ===== */
.hero-banner {
    background: linear-gradient(135deg, var(--header-bg) 0%, #020617 100%);
    color: white;
    text-align: center;
    padding: 8px 16px;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

.hero-banner img {
    border-radius: 4px;
}

/* ===== LAYOUT ===== */
.container {
    max-width: 1350px;
    margin: 24px auto;
    padding: 0 16px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

footer {
    background: #fff;
    border-top: 1px solid var(--border-color);
    padding: 16px 20px;
    text-align: center;
    font-size: 12px;
    color: #64748b;
    margin-top: 40px;
}

footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 900;
    padding: 6px 0;
}

.bottom-nav button {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 4px;
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    position: relative;
}

.bottom-nav button span:first-child {
    font-size: 20px;
}

.bottom-nav .unread-badge {
    position: absolute;
    top: 2px;
    right: 20%;
    margin: 0;
}

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
    }
}

/* ===== FEATURED & FILTERS ===== */
.featured-section {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #f59e0b;
    padding: 16px 20px;
    border-radius: 14px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
}

.featured-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.filter-bar {
    background: #fff;
    padding: 20px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-select,
.filter-input {
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    color: #334155;
    outline: none;
}

.filter-select:focus,
.filter-input:focus {
    border-color: var(--primary);
}

.btn-search {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 16px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
}

.btn-adv {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: #475569;
}

.btn-reset {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: #475569;
}

.adv-filters {
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    margin-top: 4px;
}

/* ===== LISTINGS ===== */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.listing-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.listing-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.listing-card .duplicate-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 20px;
    z-index: 5;
}

.card-img-container {
    position: relative;
    height: 180px;
    background: #e2e8f0;
}

.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge-group {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 4px;
    flex-direction: column;
    align-items: flex-start;
}

.badge {
    font-size: 9px;
    font-weight: bold;
    text-transform: uppercase;
    padding: 3px 6px;
    border-radius: 4px;
    color: #fff;
}

.badge-cat {
    background: var(--primary);
}

.badge-lister.private {
    background: #16a34a;
}

.badge-lister.broker {
    background: #2563eb;
}

.badge-lister.company {
    background: #d97706;
}

.badge-fresh-green {
    background: #16a34a;
}

.badge-fresh-yellow {
    background: #d97706;
}

.badge-fresh-red {
    background: #dc2626;
}

.favorite-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.favorite-btn.active {
    background: #eff6ff;
}

.card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: #0f172a;
}

.card-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 4px;
}

.card-psf {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 6px;
}

.card-location {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
}

.card-stats {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 10px;
    display: flex;
    gap: 12px;
}

.card-footer-actions {
    display: flex;
    gap: 5px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.seller-info-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
}

.seller-info-bar:hover {
    color: var(--primary);
}

.seller-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 11px;
    text-transform: uppercase;
    overflow: hidden;
}

.seller-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-action-secondary {
    flex: 1;
    min-width: 70px;
    padding: 6px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: 11px;
    text-align: center;
}

.btn-action-secondary:hover {
    background: #f8fafc;
}

.btn-action-whatsapp {
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid #22c55e;
    background: #f0fdf4;
    color: #15803d;
    text-decoration: none;
    font-weight: 600;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.btn-action-chat {
    padding: 6px 10px;
    border-radius: 8px;
    border: none;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: 11px;
}

.btn-action-blog {
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid #f97316;
    background: #fff7ed;
    color: #c2410c;
    text-decoration: none;
    font-weight: 600;
    font-size: 11px;
    text-align: center;
}

.pagination-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.page-btn {
    padding: 6px 12px;
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 12px;
    color: #334155;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.recent-viewed-section {
    margin-top: 40px;
    background: #fff;
    padding: 20px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
}

/* ===== FORMS ===== */
.form-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    max-width: 750px;
    margin: 0 auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    color: #334155;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.gps-box {
    background: #f0fdf4;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid #bbf7d0;
    margin-bottom: 18px;
}

.dyn-fields {
    background: #f8fafc;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.img-upload-box {
    background: #f1f5f9;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    margin-bottom: 16px;
}

.ai-btn {
    background: #faf5ff;
    color: #7e22ce;
    border: 1px solid #d8b4fe;
    border-radius: 6px;
    padding: 4px 10px;
    font-weight: bold;
    font-size: 11px;
    cursor: pointer;
}

.btn-publish {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.btn-publish:hover {
    background: var(--primary-hover);
}

/* ===== DRAG & DROP ZONE ===== */
.drop-zone {
    margin-top: 10px;
    padding: 24px;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    background: #fff;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary);
    background: #eff6ff;
}

.drop-zone.dragover {
    transform: scale(1.01);
}

.img-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.img-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #e2e8f0;
    cursor: grab;
    transition: opacity 0.15s;
}

.img-preview-item:active {
    cursor: grabbing;
}

.img-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.img-preview-item .remove-img {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(220, 38, 38, 0.9);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.img-preview-item .main-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(22, 163, 74, 0.9);
    color: #fff;
    font-size: 8px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 3px;
}

/* ===== REQUESTS ===== */
.req-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    align-items: flex-end;
}

.req-lbl {
    font-size: 12px;
    font-weight: 600;
}

.req-count {
    font-size: 12px;
    font-weight: bold;
    background: #eff6ff;
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 6px;
}

.requests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.request-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
}

.request-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}

/* ===== CRM ===== */
.crm-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.crm-table th,
.crm-table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
}

.crm-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: bold;
}

/* ===== RESTRICTED ===== */
.restricted-banner {
    background: #fffbeb;
    border: 1px solid #f59e0b;
    padding: 30px;
    border-radius: 14px;
    text-align: center;
    max-width: 600px;
    margin: 40px auto;
}

/* ===== SELLERS ===== */
.sellers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.seller-profile-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.seller-card-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    overflow: hidden;
}

.seller-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.seller-card-meta {
    font-size: 12px;
    color: #64748b;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.verified-badge {
    background: #dbeafe;
    color: #1e40af;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 10px;
}

.profile-tab {
    padding: 9px 18px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.profile-tab.active {
    background: #eff6ff;
    color: var(--primary);
    border-color: #bfdbfe;
}

/* ===== STAR RATING ===== */
.star-display {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.star-display .stars {
    color: #f59e0b;
    letter-spacing: 1px;
}

.star-display .count {
    color: #94a3b8;
    font-weight: 400;
}

.star-rating {
    display: flex;
    gap: 8px;
    font-size: 32px;
    color: #cbd5e1;
    cursor: pointer;
    user-select: none;
}

.star-rating span {
    transition: color 0.15s;
}

.star-rating span:hover,
.star-rating span.active {
    color: #f59e0b;
}

/* ===== REVIEW CARD ===== */
.review-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.review-author {
    font-weight: bold;
    font-size: 13px;
    color: #1e293b;
}

.review-stars {
    color: #f59e0b;
    font-size: 14px;
}

.review-date {
    font-size: 11px;
    color: #94a3b8;
}

.review-comment {
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
    margin: 6px 0;
}

.review-reply {
    background: #f1f5f9;
    border-left: 3px solid var(--primary);
    padding: 8px 12px;
    margin-top: 8px;
    border-radius: 6px;
    font-size: 12px;
    color: #334155;
}

.review-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.review-actions button {
    background: none;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    cursor: pointer;
    color: #64748b;
}

.review-actions button:hover {
    background: #f8fafc;
}

/* ===== MARKET INSIGHT BOX ===== */
.market-insight-box {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 14px;
    font-size: 13px;
}

.market-insight-box h4 {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: var(--primary);
}

.market-insight-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

.market-insight-row .mi-label {
    color: #64748b;
}

.market-insight-row .mi-value {
    font-weight: 700;
    color: #1e293b;
}

.market-insight-na {
    color: #9ca3af;
    font-style: italic;
}

/* ===== TOOLS ACCORDION ===== */
.tools-accordion {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.tools-accordion-header {
    padding: 12px 14px;
    font-weight: bold;
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tools-accordion-header:hover {
    background: #eff6ff;
}

.tools-accordion-body {
    padding: 14px;
    display: none;
}

.tools-accordion.open .tools-accordion-body {
    display: block;
}

.tool-item {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.tool-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.tool-item-title {
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    color: #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.tool-item-title:hover {
    color: var(--primary);
}

.tool-item-body {
    display: none;
    padding-top: 8px;
}

.tool-item.open .tool-item-body {
    display: block;
}

.tool-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.tool-input-row label {
    font-size: 11px;
    color: #64748b;
    display: block;
    margin-bottom: 3px;
}

.tool-input-row input,
.tool-input-row select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 12px;
}

.tool-result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 10px;
}

.tool-result-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #f1f5f9;
}

.tool-result-table td:last-child {
    text-align: right;
    font-weight: bold;
}

.tool-result-table .total-row {
    background: #eff6ff;
    font-weight: bold;
}

.tool-buyer-type {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.tool-buyer-type button {
    flex: 1;
    min-width: 100px;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    color: #475569;
}

.tool-buyer-type button.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.tool-disclaimer {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 8px;
    line-height: 1.4;
}

/* ===== MODALS ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-container {
    background: #fff;
    width: 100%;
    max-width: 800px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.modal-footer {
    padding: 15px 20px;
    background: #f1f5f9;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.close-x {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
    line-height: 1;
}

.close-x:hover {
    color: #dc2626;
}

.modal-listing-id {
    font-size: 11px;
    color: #94a3b8;
    margin-left: 8px;
    font-family: monospace;
}

/* Gallery */
.gallery {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gallery-hero {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: 12px;
}

.gallery-thumbs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.gallery-thumbs img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.gallery-thumbs img.active {
    border-color: var(--primary);
}

/* Modal info */
.modal-price {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
}

.modal-psf {
    font-size: 12px;
    color: #64748b;
    margin-top: -6px;
}

.modal-loc {
    font-size: 13px;
    color: #475569;
    font-weight: 600;
}

.modal-stats {
    font-size: 12px;
    color: #64748b;
}

.modal-seller {
    font-size: 12px;
    color: #475569;
    font-weight: bold;
}

.modal-lister {
    font-size: 12px;
    color: #475569;
}

.specs-box {
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.specs-box h4 {
    margin: 0 0 8px;
    font-size: 13px;
    color: #64748b;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #334155;
    padding: 4px 0;
    border-bottom: 1px dashed #e2e8f0;
}

.spec-row:last-child {
    border-bottom: none;
}

.spec-row .spec-label {
    color: #64748b;
    font-weight: 600;
}

.spec-row .spec-value {
    font-weight: 600;
}

.dup-info {
    background: #fef3c7;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #f59e0b;
}

.co-agency-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 10px;
    border-radius: 8px;
}

.featured-box {
    background: #fffbeb;
    border: 1px solid #f59e0b;
    padding: 10px;
    border-radius: 8px;
}

.seller-dash {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 10px;
    border-radius: 8px;
}

/* Report button */
.report-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s;
}

.report-btn:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* Modal buttons */
.btn-wa {
    flex: 1;
    min-width: 120px;
    background: #22c55e;
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 13px;
    text-align: center;
    border: none;
    cursor: pointer;
}

.btn-chat {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
}

.btn-tg {
    background: #229ed9;
    color: #fff;
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
}

.btn-copy {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 14px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
}

.btn-coagency {
    background: #16a34a;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
}

.btn-featured {
    background: #f59e0b;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
}

.btn-repost {
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.btn-sold {
    background: #f0fdf4;
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.btn-del {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

/* ===== CHAT / MESSAGES ===== */
.chat-box-container {
    display: flex;
    flex-direction: column;
    height: 350px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.chat-messages-list {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-bubble {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-bubble.me {
    background: #eff6ff;
    color: var(--primary);
    align-self: flex-end;
}

.chat-bubble.other {
    background: #fff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    align-self: flex-start;
}

.chat-bubble .sender {
    font-weight: bold;
    font-size: 11px;
    color: #475569;
    margin-bottom: 2px;
}

.chat-input-area {
    display: flex;
    padding: 10px;
    background: #fff;
    border-top: 1px solid var(--border-color);
    gap: 8px;
}

.btn-send {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.chat-thread-item {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
}

.chat-thread-item:hover {
    background: #f8fafc;
}

.chat-thread-item.active {
    background: #eff6ff;
}

.msg-inbox {
    flex: 0 0 300px;
    min-width: 260px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    height: 600px;
}

.msg-inbox-header {
    padding: 12px 14px;
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.msg-thread {
    flex: 1;
    min-width: 320px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    height: 600px;
}

.msg-thread-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-weight: bold;
    font-size: 14px;
}

.messages-thread-item {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
}

.messages-thread-item:hover {
    background: #fff;
}

.messages-thread-item.active {
    background: #eff6ff;
    border-left: 3px solid var(--primary);
}

.sys-notif-item {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
}

.sys-notif-item:hover {
    background: #fffbeb;
}

.sys-notif-item.unread {
    background: #fef3c7;
}

/* ===== TOASTS ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 280px;
    max-width: 400px;
    padding: 14px 20px;
    border-radius: 10px;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideInRight 0.3s ease-out;
    transition: opacity 0.3s;
}

.toast.success {
    background: #16a34a;
}

.toast.error {
    background: #dc2626;
}

.toast.warning {
    background: #d97706;
}

.toast.info {
    background: #2563eb;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== CONFIRM ===== */
.confirm-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

.confirm-box {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.confirm-box p {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #334155;
}

.confirm-box button {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    margin: 0 6px;
}

.confirm-box .btn-cancel {
    background: #e2e8f0;
    color: #334155;
}

.confirm-box .btn-confirm {
    background: var(--primary);
    color: #fff;
}

/* ===== ADMIN ===== */
.admin-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
}

.admin-section {
    background: #f8fafc;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.admin-section h3 {
    margin: 0 0 12px 0;
    font-size: 15px;
}

/* Admin sub-tabs bar */
.admin-tabs-bar {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    background: #fff;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.admin-tab {
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.admin-tab:hover {
    background: #eff6ff;
    color: var(--primary);
}

.admin-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.schema-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}

.toolbar-right {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.schema-toolbar input,
.schema-toolbar select {
    width: 200px;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
}

.schema-grid {
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: auto;
    max-height: 700px;
}

.schema-header,
.schema-row {
    display: grid;
    grid-template-columns: 40px 130px 140px 160px 160px 120px 100px 70px 140px 70px 70px 140px;
}

.schema-header {
    position: sticky;
    top: 0;
    background: #f8fafc;
    font-weight: 700;
    z-index: 20;
}

.schema-header>div {
    padding: 8px;
    border-right: 1px solid #eee;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
}

.schema-header>div:hover {
    background: #e2e8f0;
}

.schema-row>div {
    padding: 8px;
    border-right: 1px solid #eee;
    border-bottom: 1px solid #eee;
    overflow: hidden;
}

.schema-row {
    background: #fff;
}

.schema-row:hover {
    background: #f9fafb;
}

.schema-row input,
.schema-row select {
    width: 100%;
    border: none;
    background: transparent;
    padding: 5px;
    font-size: 12px;
}

.schema-row input:focus,
.schema-row select:focus {
    outline: 2px solid #2563eb;
    background: #fff;
}

.schema-row.dirty {
    background: #fefce8 !important;
    border-left: 4px solid #eab308;
}

.docid {
    background: #f3f4f6;
    font-family: monospace;
    font-size: 11px;
    color: #555;
    user-select: all;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.deleteBtn,
.copyBtn,
.saveBtn {
    color: #fff;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin: 2px;
}

.saveBtn {
    background: #16a34a;
}

.deleteBtn {
    background: #ef4444;
}

.copyBtn {
    background: #3b82f6;
}

.permission-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 12px;
}

.queue-count {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 6px;
}

/* Admin org card */
.admin-org-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-org-card h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
}

.admin-org-card .org-meta {
    font-size: 12px;
    color: #64748b;
    line-height: 1.6;
}

.admin-org-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.admin-org-actions button {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    border: none;
}

/* ===== MODERATION QUEUE ===== */
.mod-queue-item {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
}

.mod-queue-item h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
}

.mod-queue-item .mod-meta {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
}

.mod-queue-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.mod-queue-actions button {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    border: none;
}

.btn-approve {
    background: #16a34a;
    color: #fff;
}

.btn-reject {
    background: #dc2626;
    color: #fff;
}

.btn-info {
    background: #2563eb;
    color: #fff;
}

.btn-secondary-sm {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
}

/* ===== ORG PUBLIC PAGE ===== */
.org-header-card {
    background: linear-gradient(135deg, #0f172a 0%, #2563eb 100%);
    color: #fff;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 24px;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.org-logo {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    background: #fff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: bold;
    overflow: hidden;
    flex-shrink: 0;
}

.org-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.org-meta {
    flex: 1;
    min-width: 200px;
}

.org-meta h1 {
    margin: 0 0 6px 0;
    font-size: 26px;
}

.org-meta p {
    margin: 4px 0;
    font-size: 13px;
    opacity: 0.9;
}

.org-verified {
    background: #dbeafe;
    color: #1e40af;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 10px;
    border-radius: 10px;
    display: inline-block;
    margin-top: 8px;
}

/* ===== GENERIC BUTTONS ===== */
.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: #fff;
    border: 1px solid #ddd;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.btn-secondary:hover {
    background: #f8fafc;
}

/* ===== TOOLS TABS ===== */
.tools-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.tool-tab {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.tool-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.bft-panel {
    display: block;
}

/* ===== LEDGER ===== */
.ledger-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 14px;
    border: 1px solid var(--border-color);
}

.ledger-row.sub {
    background: #fff;
}

.ledger-row.total {
    background: #eff6ff;
    border-color: #bfdbfe;
    font-weight: 800;
    font-size: 15px;
}

.ledger-row.total.negative {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.ledger-row .ledger-label {
    color: #475569;
    font-weight: 600;
}

.ledger-row .ledger-value {
    font-weight: 700;
}

.ledger-row .ledger-value.plus {
    color: #16a34a;
}

.ledger-row .ledger-value.minus {
    color: #dc2626;
}

.caution-box {
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-left: 4px solid #d97706;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: #78350f;
    line-height: 1.5;
}

.dsr-results-card {
    background: #f8fafc;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.tier-note {
    background: #f1f5f9;
    border-left: 3px solid var(--primary);
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 12px;
    color: #475569;
    line-height: 1.5;
    margin-top: 12px;
}

.panel-hidden {
    display: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .form-card {
        padding: 16px;
    }

    .req-form {
        grid-template-columns: 1fr;
    }

    .msg-inbox {
        flex: 1 1 100%;
        height: 300px;
    }

    .msg-thread {
        flex: 1 1 100%;
        height: 400px;
    }

    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-select,
    .filter-input {
        width: 100%;
    }

    .hero-banner h1 {
        font-size: 22px;
    }

    .modal-container {
        border-radius: 12px;
    }

    .schema-header,
    .schema-row {
        font-size: 11px;
    }

    .tool-input-row {
        grid-template-columns: 1fr;
    }

    .org-header-card {
        padding: 20px;
    }

    .org-logo {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }

    .org-meta h1 {
        font-size: 20px;
    }

    .admin-tabs-bar {
        gap: 2px;
    }

    .admin-tab {
        padding: 7px 12px;
        font-size: 11px;
    }
}