:root {
    --primary: #1971c2;
    --primary-dark: #145591;
    --bg: #f4f6f8;
    --card-bg: #ffffff;
    --border: #e1e4e8;
    --text: #212529;
    --muted: #6c757d;
    --success: #2f9e44;
    --error: #e03131;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.topbar {
    background: var(--primary);
    color: white;
}
.topbar-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.brand { color: white; font-weight: bold; font-size: 1.2rem; text-decoration: none; }
.topbar nav a { color: white; text-decoration: none; margin-left: 14px; font-size: 0.95rem; }
.topbar nav a:hover { text-decoration: underline; }
.user-info { margin-left: 14px; opacity: 0.9; }

.container {
    max-width: 1000px;
    margin: 24px auto;
    padding: 0 16px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 14px;
    font-weight: 600;
    font-size: 0.9rem;
}
input, select, textarea {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}

.btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-block;
}
.btn:hover { background: var(--primary-dark); }
.btn-secondary {
    background: var(--muted);
    margin-top: 8px;
}
.btn-link {
    background: none;
    border: none;
    color: var(--error);
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: 0.85rem;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}
.alert-success { background: #d3f9d8; color: #2b8a3e; }
.alert-error { background: #ffe3e3; color: #c92a2a; }

.filters { margin-bottom: 16px; }
.filters a {
    display: inline-block;
    padding: 6px 14px;
    margin-right: 8px;
    border-radius: 20px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    font-size: 0.9rem;
}
.filters a.active { background: var(--primary); color: white; border-color: var(--primary); }

.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.listing-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    text-decoration: none;
    color: var(--text);
    display: block;
    transition: box-shadow 0.15s;
}
.listing-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
.listing-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.listing-desc { margin: 8px 0; }
.listing-meta { color: var(--muted); font-size: 0.85rem; }
.listing-price { font-weight: 700; color: var(--primary-dark); margin: 4px 0; }
.listing-price-big { font-size: 1.4rem; font-weight: 700; color: var(--primary-dark); margin: 6px 0 16px; }

.hidden { display: none; }
.sort-form { display: inline-block; margin-left: 12px; }
.inline-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.inline-label select { display: inline-block; width: auto; margin-top: 0; }

.badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: white;
}
.badge-meuble { background: var(--success); }
.badge-non-meuble { background: var(--primary); }

.note { font-weight: 600; font-size: 0.9rem; }

.contacts-fieldset {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 16px;
}
.contact-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}
.contact-list { list-style: none; padding: 0; }
.contact-list li { padding: 8px 0; border-bottom: 1px solid var(--border); }

.appointment-list, .comment-list { list-style: none; padding: 0; }
.appointment-list li, .comment-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.inline-form { margin-top: 16px; }

#calendar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}

.footer {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    padding: 24px 0;
}
