/* ─── CSS Variables & Theme ─────────────────────────────────────── */

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --bg-hover: #f0f0f0;
    --text-primary: #1a1a2e;
    --text-secondary: #333;
    --text-muted: #6c757d;
    --border: #e0e0e0;
    --border-light: #f0f0f0;
    --primary: #4361ee;
    --primary-hover: #3a56d4;
    --primary-light: #e8ecfc;
    --danger: #e63946;
    --danger-light: #fde8ea;
    --success: #2ec4b6;
    --success-light: #e6f9f7;
    --warning: #ff9f1c;
    --warning-light: #fff4e5;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --star-filled: #ffc107;
    --star-empty: #ddd;
    --client-warning-bg: #fff3cd;
    --client-warning-border: #ffc107;
    --new-badge-bg: #e63946;
    --transition: all 0.2s ease;
}

[data-theme="dark"] {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-card: #1c2333;
    --bg-input: #21262d;
    --bg-hover: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #c9d1d9;
    --text-muted: #8b949e;
    --border: #30363d;
    --border-light: #21262d;
    --primary: #58a6ff;
    --primary-hover: #79b8ff;
    --primary-light: #1c2f4a;
    --danger: #f85149;
    --danger-light: #3d1518;
    --success: #3fb950;
    --success-light: #1a3524;
    --warning: #d29922;
    --warning-light: #3d2f13;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --star-empty: #444;
    --client-warning-bg: #3d2f13;
    --client-warning-border: #d29922;
}

@media (prefers-color-scheme: dark) {
    [data-theme="auto"] {
        --bg-primary: #0d1117;
        --bg-secondary: #161b22;
        --bg-card: #1c2333;
        --bg-input: #21262d;
        --bg-hover: #30363d;
        --text-primary: #e6edf3;
        --text-secondary: #c9d1d9;
        --text-muted: #8b949e;
        --border: #30363d;
        --border-light: #21262d;
        --primary: #58a6ff;
        --primary-hover: #79b8ff;
        --primary-light: #1c2f4a;
        --danger: #f85149;
        --danger-light: #3d1518;
        --success: #3fb950;
        --success-light: #1a3524;
        --warning: #d29922;
        --warning-light: #3d2f13;
        --shadow: 0 2px 8px rgba(0,0,0,0.3);
        --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
        --star-empty: #444;
        --client-warning-bg: #3d2f13;
        --client-warning-border: #d29922;
    }
}

/* ─── Reset & Base ──────────────────────────────────────────────── */

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* ─── Navbar ────────────────────────────────────────────────────── */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    height: 56px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-left {
    display: flex;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
    text-decoration: none !important;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-user {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0 0.5rem;
}

@media (max-width: 480px) {
    .nav-brand-text { display: none; }
    .nav-user { display: none; }
}

/* ─── Container ─────────────────────────────────────────────────── */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.main-content {
    min-height: calc(100vh - 56px);
}

.center-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 56px);
    padding: 1rem;
}

/* ─── Buttons ───────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none !important;
}

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

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

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

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

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none !important;
    font-size: 1rem;
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-active {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}

/* ─── Forms ─────────────────────────────────────────────────────── */

.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.form-input, .form-select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

textarea.form-input {
    resize: vertical;
    min-height: 60px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--text-secondary);
}

/* ─── Page Header ───────────────────────────────────────────────── */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .page-header h1 { font-size: 1.2rem; }
    .hide-mobile { display: none; }
    .header-actions { width: 100%; justify-content: flex-end; }
}

/* ─── Sessions Grid ─────────────────────────────────────────────── */

.sessions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.session-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    position: relative;
}

.session-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.session-card.has-new {
    border-left: 4px solid var(--new-badge-bg);
}

.session-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.session-card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.session-badges {
    display: flex;
    gap: 0.3rem;
}

.session-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.session-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.session-actions {
    display: flex;
    gap: 0.3rem;
    margin-top: 0.5rem;
    justify-content: flex-end;
}

/* ─── Badges ────────────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-new {
    background: var(--new-badge-bg);
    color: #fff;
}

.badge-auto {
    background: var(--success-light);
    color: var(--success);
}

.badge-rent {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-sale {
    background: var(--success-light);
    color: var(--success);
}

.badge-other {
    background: var(--bg-secondary);
    color: var(--text-muted);
}

/* ─── Search ────────────────────────────────────────────────────── */

.search-section {
    margin-bottom: 1.5rem;
}

.search-bar {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    font-size: 1rem !important;
    padding: 0.8rem 1rem !important;
}

.search-btn {
    flex-shrink: 0;
    padding: 0.8rem 1.5rem;
}

.search-status {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.8rem;
    padding: 0.8rem 1rem;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    color: var(--primary);
    font-size: 0.9rem;
}

.search-result {
    margin-top: 0.8rem;
}

.search-success {
    padding: 1rem;
    background: var(--success-light);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--success);
}

.search-filters-display {
    margin-bottom: 0.5rem;
}

.search-filter-line {
    font-size: 0.85rem;
    padding: 0.1rem 0;
    color: var(--text-secondary);
}

.search-stats {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.search-error {
    padding: 1rem;
    background: var(--danger-light);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--danger);
    color: var(--danger);
}

.search-history {
    margin-top: 0.8rem;
}

.search-history details summary {
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.3rem 0;
}

.history-list {
    margin-top: 0.5rem;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.history-item:hover {
    background: var(--bg-hover);
}

.history-query {
    color: var(--text-primary);
}

.history-meta {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ─── Toolbar ───────────────────────────────────────────────────── */

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.toolbar-right {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-select {
    width: auto;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
}

.listing-count {
    font-weight: 500;
}

/* ─── Listings Grid ─────────────────────────────────────────────── */

.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

@media (max-width: 480px) {
    .listings-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── Listing Card ──────────────────────────────────────────────── */

.listing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.listing-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.listing-card.listing-hidden {
    opacity: 0.5;
}

.listing-image-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.listing-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.listing-card:hover .listing-img {
    transform: scale(1.05);
}

.listing-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-muted);
    opacity: 0.3;
}

.img-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 0.2rem 0.5rem;
    border-radius: 100px;
    font-size: 0.75rem;
}

.listing-image-container .badge-new {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
}

.listing-body {
    padding: 1rem;
    flex: 1;
}

.listing-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
}

.listing-type {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.listing-adv-type {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 100px;
}

.listing-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.listing-location {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.listing-location i {
    color: var(--danger);
    margin-right: 0.2rem;
}

.listing-details {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.listing-details span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.listing-details i {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.listing-text-preview {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.listing-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.3rem;
}

.source-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    text-decoration: none !important;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.source-link:hover {
    opacity: 1;
    text-decoration: none !important;
}

.source-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.listing-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border-light);
}

.listing-stars {
    display: flex;
    gap: 0.15rem;
}

.listing-stars .fa-star {
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.star-filled {
    color: var(--star-filled);
}

.star-empty {
    color: var(--star-empty);
}

.listing-stars .fa-star:hover {
    transform: scale(1.2);
}

.listing-actions {
    display: flex;
    gap: 0.2rem;
}

/* ─── Detail Modal ──────────────────────────────────────────────── */

.detail-gallery {
    margin-bottom: 1rem;
}

.gallery-main {
    position: relative;
    width: 100%;
    max-height: 500px;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-main img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition);
    z-index: 2;
}

.gallery-nav:hover {
    background: rgba(0,0,0,0.8);
}

.gallery-prev { left: 10px; }
.gallery-next { right: 10px; }

.gallery-counter {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.8rem;
}

.gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    overflow-x: auto;
    padding: 0.3rem 0;
    -webkit-overflow-scrolling: touch;
}

.gallery-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    opacity: 0.5;
    transition: var(--transition);
    flex-shrink: 0;
    border: 2px solid transparent;
}

.gallery-thumb.active, .gallery-thumb:hover {
    opacity: 1;
    border-color: var(--primary);
}

.detail-info {
    padding: 0;
}

.detail-price {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.detail-ppsm {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.detail-location {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.detail-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.feature {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: var(--bg-secondary);
    border-radius: 100px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.feature i {
    color: var(--primary);
    font-size: 0.8rem;
}

.detail-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.detail-text-section {
    margin-bottom: 1rem;
}

.detail-text-section summary {
    font-weight: 500;
    cursor: pointer;
    padding: 0.3rem 0;
    color: var(--text-secondary);
}

.detail-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
    margin-top: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.8rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.detail-comments {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.comment-section {
    margin-bottom: 1rem;
}

.comment-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.comment-client-section {
    border: 2px solid var(--client-warning-border);
    border-radius: var(--radius-sm);
    padding: 0.8rem;
    background: var(--client-warning-bg);
}

.comment-client-label {
    color: var(--warning) !important;
}

.client-warning {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    background: var(--warning);
    color: #000;
    border-radius: 4px;
}

.client-textarea {
    border-color: var(--client-warning-border) !important;
}

.client-comments-list {
    margin-top: 1rem;
}

.client-comment {
    padding: 0.8rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.client-comment strong {
    font-size: 0.85rem;
}

.comment-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.client-comment p {
    margin-top: 0.3rem;
    font-size: 0.9rem;
}

/* Shared view realtor note */
.realtor-note {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary);
}

.realtor-note h4 {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    color: var(--primary);
}

.client-comment-form {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.client-comment-form h4 {
    margin-bottom: 0.5rem;
}

/* ─── 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;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.modal-large {
    max-width: 750px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 1.1rem;
}

.modal-body {
    padding: 1.2rem;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.2rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

/* ─── Fields Grid ───────────────────────────────────────────────── */

.fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.8rem;
}

@media (max-width: 480px) {
    .fields-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ─── Image Upload ──────────────────────────────────────────────── */

.image-upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    transition: var(--transition);
    cursor: pointer;
}

.image-upload-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
}

.image-upload-zone i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.image-upload-zone p {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.image-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.pending-image {
    position: relative;
    width: 80px;
    height: 80px;
}

.pending-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.pending-image .btn-icon {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    background: var(--danger);
    color: #fff;
    border-radius: 50%;
    font-size: 0.65rem;
}

/* ─── Spinner ───────────────────────────────────────────────────── */

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    padding: 3rem;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.parse-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--primary);
}

/* ─── Empty State ───────────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* ─── Toast ─────────────────────────────────────────────────────── */

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 0.8rem 1.5rem;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    transition: transform 0.3s ease;
    white-space: nowrap;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* ─── Flash Messages ────────────────────────────────────────────── */

.flash-messages {
    margin-bottom: 1rem;
}

.flash {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.flash-error {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.flash-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success);
}

/* ─── Settings ──────────────────────────────────────────────────── */

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.settings-card h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.theme-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ─── Shared View ───────────────────────────────────────────────── */

.shared-body {
    background: var(--bg-primary);
}

.shared-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.shared-header h1 {
    font-size: 1.3rem;
}

/* ─── Utility ───────────────────────────────────────────────────── */

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }

/* ─── Responsive ────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .container { padding: 0.5rem; }
    .listings-grid { gap: 0.5rem; }
    .listing-image-container { height: 180px; }
    .listing-body { padding: 0.8rem; }
    .listing-price { font-size: 1.1rem; }
    .modal { margin: 0; border-radius: var(--radius) var(--radius) 0 0; max-height: 95vh; }
    .modal-overlay { align-items: flex-end; padding: 0; }
    .gallery-main img { max-height: 300px; }
    .detail-price { font-size: 1.4rem; }
    .search-bar { flex-direction: column; }
    .search-btn { width: 100%; justify-content: center; }
    .sessions-grid { grid-template-columns: 1fr; }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Selection */
::selection {
    background: var(--primary);
    color: #fff;
}
