.listings-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-primary);
}

.listings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--wa-teal);
    color: #fff;
    flex-shrink: 0;
    gap: 12px;
    flex-wrap: wrap;
}

.listings-header .header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-link {
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    text-decoration: none;
}

.back-link:hover {
    color: #fff;
}

.listings-header .header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-select {
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 0.8rem;
    cursor: pointer;
}

.filter-select option {
    color: var(--text-primary);
    background: #fff;
}

.btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-primary {
    background: var(--wa-green);
    color: #fff;
}

.btn-primary:hover {
    background: var(--wa-green-dark);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.72rem;
}

.btn-approve {
    background: var(--wa-green);
    color: #fff;
}

.btn-reject {
    background: #e74c3c;
    color: #fff;
}

.btn-move {
    background: #3498db;
    color: #fff;
}

.btn-delete {
    background: #e74c3c;
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: var(--bg-primary);
}

/* Grid */
.listings-grid {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
    align-content: start;
}

/* Property card */
.property-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.25s ease-out;
}

.card-header {
    padding: 14px 16px 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-id {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-family: monospace;
}

.card-status {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.status-pending_review {
    background: #fff3cd;
    color: #856404;
}

.status-approved {
    background: #d4edda;
    color: #155724;
}

.card-body {
    padding: 0 16px 12px;
    flex: 1;
}

.card-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-row {
    display: flex;
    gap: 8px;
    font-size: 0.82rem;
}

.detail-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 80px;
    flex-shrink: 0;
}

.detail-value {
    color: var(--text-primary);
    word-break: break-word;
}

.card-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--wa-teal);
    margin-bottom: 6px;
}

.card-sender {
    font-size: 0.72rem;
    color: var(--text-timestamp);
    margin-top: 8px;
}

/* Attachments section */
.card-attachments {
    border-top: 1px solid var(--border-color);
    padding: 10px 16px;
}

.attachments-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--bg-primary);
    font-size: 0.78rem;
}

.attachment-item:last-child {
    border-bottom: none;
}

.attachment-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--bg-primary);
    flex-shrink: 0;
}

.attachment-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: 4px;
    flex-shrink: 0;
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-weight: 700;
}

.attachment-info {
    flex: 1;
    min-width: 0;
}

.attachment-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-status {
    font-size: 0.68rem;
}

.attachment-approved {
    color: #155724;
}

.attachment-pending {
    color: #856404;
}

.attachment-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* Card footer */
.card-footer {
    border-top: 1px solid var(--border-color);
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-messages-toggle {
    font-size: 0.72rem;
    color: var(--wa-teal);
    cursor: pointer;
    border: none;
    background: none;
    font-weight: 600;
    padding: 0;
}

.card-messages-toggle:hover {
    text-decoration: underline;
}

.card-messages {
    border-top: 1px solid var(--border-color);
    padding: 10px 16px;
    background: var(--bg-primary);
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.card-messages.open {
    display: block;
}

.card-msg {
    font-size: 0.75rem;
    padding: 4px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    line-height: 1.4;
}

.card-msg:last-child {
    border-bottom: none;
}

.card-msg-type {
    font-size: 0.65rem;
    color: var(--text-secondary);
    background: #fff;
    padding: 1px 5px;
    border-radius: 3px;
    margin-right: 4px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.modal-field {
    margin-bottom: 12px;
}

.modal-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.modal-field input,
.modal-field textarea,
.modal-field select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
}

.modal-field textarea {
    min-height: 60px;
    resize: vertical;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}
