/* Variables & base */
:root {
    --font-sans: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
    --primary: #e65c00;
    --primary-hover: #cc5200;
    --primary-light: #fff4ed;
    --sidebar-bg: #111827;
    --sidebar-hover: #1f2937;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-muted: #64748b;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-sans);
}

body {
    background: linear-gradient(160deg, #f1f5f9 0%, #e2e8f0 100%);
    min-height: 100vh;
    color: var(--text);
}

/* ========== PAGE CONNEXION ========== */
body.login-page {
    background: linear-gradient(160deg, #f1f5f9 0%, #e2e8f0 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-brand {
    margin-bottom: 28px;
}

.login-logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(255, 122, 0, 0.3);
}

.login-logo svg {
    width: 100%;
    height: 100%;
    display: block;
}

.login-brand h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.login-tagline {
    font-size: 0.9rem;
    color: #6b7280;
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 32px 36px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.login-card h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 24px;
    text-align: left;
}

.login-form .form-group {
    margin-bottom: 18px;
    text-align: left;
}

.login-form label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 6px;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 14px;
    font-size: 1rem;
    color: #9ca3af;
    pointer-events: none;
}

.input-with-icon .form-input,
.login-form .form-input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.2s;
}

.input-with-icon .form-input:focus,
.login-form .form-input:focus {
    outline: none;
    border-color: #ff7a00;
}

.form-row-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #374151;
    cursor: pointer;
}

.checkbox-label input { width: auto; }

.link-forgot {
    color: #ff7a00;
    font-size: 0.9rem;
    text-decoration: none;
    font-weight: 500;
}

.link-forgot:hover { text-decoration: underline; }

.btn-login {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #ff7a00 0%, #e66d00 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    font-family: var(--font-sans);
}

.btn-login:hover { background: linear-gradient(135deg, #e66d00 0%, #cc5200 100%); transform: translateY(-1px); }

.login-footer-legal {
    margin-top: 20px;
    font-size: 0.8rem;
    color: #9ca3af;
}

.login-footer-legal a { color: #ff7a00; text-decoration: none; }

.login-help {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 20px;
    text-align: left;
}

.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; text-align: left; }
.alert-error { background: #fef2f2; color: #b91c1c; }
.field-error { font-size: 0.8rem; color: #b91c1c; margin-top: 4px; display: block; }

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 272px;
    background: var(--sidebar-bg);
    color: #fff;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,0.12);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    padding: 0 8px;
}

.sidebar-logo-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(255, 122, 0, 0.35);
}

.sidebar-logo-icon svg { width: 100%; height: 100%; display: block; }

.sidebar-logo-text h2 {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}

.sidebar-logo-text span {
    color: #94a3b8;
    font-size: 0.75rem;
    display: block;
    margin-top: 2px;
}

.sidebar-nav {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-nav a {
    text-decoration: none;
    color: #cbd5e1;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s, color 0.2s;
    font-weight: 500;
    font-size: 0.95rem;
}

.sidebar-nav a:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-nav a.active {
    background: linear-gradient(135deg, #ff7a00 0%, #e66d00 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 122, 0, 0.4);
}

.nav-icon { font-size: 1.15rem; opacity: 0.95; }

.sidebar-logout {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logout a {
    color: #94a3b8;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}

.sidebar-logout a:hover { color: #fff; background: var(--sidebar-hover); }

/* Main */
.main-content {
    flex: 1;
    padding: 28px 32px 40px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Page title (first h1 + p in main) */
.main-content > h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}
.main-content > h1 + p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 28px;
}

/* Topbar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -28px -32px 28px -32px;
    padding: 16px 32px;
    flex-wrap: wrap;
    gap: 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.topbar-welcome p { margin: 0; font-size: 0.95rem; color: var(--text-muted); }
.topbar-welcome strong { color: var(--text); }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-notif {
    position: relative;
    padding: 10px 14px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    transition: background 0.2s;
}
.topbar-notif:hover { background: var(--border); }

.notif-icon { font-size: 1.2rem; }
.notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px 10px 12px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    min-width: 200px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff7a00 0%, #e66d00 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.user-avatar svg {
    width: 22px;
    height: 22px;
}

.topbar-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.topbar-user-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
}
.topbar-pwd-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #ff7a00;
    margin-top: 6px;
    text-decoration: none;
    font-weight: 500;
    padding: 4px 0;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}
.topbar-pwd-link:hover {
    color: #cc5200;
    text-decoration: none;
    background: #fff4ed;
}

/* ========== Page Changer mot de passe ========== */
.password-change-page {
    max-width: 560px;
}
.password-change-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 28px;
}
.password-change-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #fff4ed 0%, #ffedd5 100%);
    border: 1px solid #ff7a00;
    color: #c2410c;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.password-change-icon svg {
    width: 28px;
    height: 28px;
}
.password-change-header h1 {
    margin: 0 0 8px 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}
.password-change-subtitle {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.45;
}
.password-change-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.password-change-card .form-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.password-change-card .helptext {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.messages { list-style: none; margin: 0 0 20px 0; padding: 0; }
.message {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}
.message-success { background: #dcfce7; color: #166534; }
.message-error { background: #fee2e2; color: #991b1b; }
.message-info { background: #dbeafe; color: #1e40af; }

/* Cards (dashboard) */
.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    margin-bottom: 32px;
}

.card {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card h2 { font-size: 1.85rem; font-weight: 700; margin: 6px 0; letter-spacing: -0.02em; }
.card p { font-size: 0.9rem; color: var(--text-muted); margin: 0; font-weight: 500; }
.card span { font-size: 0.8rem; color: var(--text-muted); }

.card-green { border-left: 4px solid #16a34a; }
.card-green h2 { color: #16a34a; }
.card-orange { border-left: 4px solid #ea580c; }
.card-orange h2 { color: #ea580c; }
.card-blue { border-left: 4px solid #2563eb; }
.card-blue h2 { color: #2563eb; }
.card-purple { border-left: 4px solid #7c3aed; }
.card-purple h2 { color: #7c3aed; }

.green { color: #16a34a; }
.orange { color: #ea580c; }
.blue { color: #2563eb; }

/* Bloc & tables */
.bloc {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.bloc h2, .bloc h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: var(--surface-soft);
    border-bottom: 2px solid var(--border);
}
td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: var(--surface-soft); }
tbody tr:last-child td { border-bottom: none; }

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}
.badge.green { background: #dcfce7; color: #166534; }
.badge.blue { background: #dbeafe; color: #1d4ed8; }

.charts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 28px 0;
}

.chart-box {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.chart-box h3 { margin-bottom: 18px; font-size: 1.05rem; font-weight: 600; color: var(--text); }

.form-main .form-group { margin-bottom: 14px; }
.form-main label { display: block; margin-bottom: 4px; font-weight: 500; }
.form-main input, .form-main select, .form-main textarea {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}
.form-actions { margin-top: 20px; display: flex; align-items: center; gap: 12px; }
.form-actions .btn-login { width: auto; padding: 10px 20px; }

.list-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }

/* Liens liste */
.main-content a.btn-add {
    display: inline-block;
    padding: 12px 20px;
    background: linear-gradient(135deg, #ff7a00 0%, #e66d00 100%);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(255, 122, 0, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
}

.main-content a.btn-add:hover {
    background: linear-gradient(135deg, #e66d00 0%, #cc5200 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 122, 0, 0.4);
}

/* ========== LISTE PROPRIÉTÉS (cartes, filtres) ========== */
.bien-filters { margin-bottom: 20px; }
.filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}
.filter-search {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
}
.filter-select {
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 160px;
}
.btn-filter {
    padding: 10px 18px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}
.btn-filter:hover { background: #374151; }
.bien-actions { margin-bottom: 24px; }

.bien-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}
.bien-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: box-shadow 0.2s, transform 0.2s;
}
.bien-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.bien-card-image {
    position: relative;
    height: 200px;
    background: #e5e7eb;
}
.bien-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.bien-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 0.9rem;
}
.bien-card-statut {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
}
.statut-disponible { background: #dcfce7; color: #166534; }
.statut-occupe { background: #ffedd5; color: #c2410c; }
.statut-loué { background: #ffedd5; color: #c2410c; }
.statut-vendu { background: #dbeafe; color: #1d4ed8; }
.statut-reserve { background: #fef9c3; color: #a16207; }
.bien-card-body { padding: 16px; }
.bien-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1a1a1a;
}
.bien-card-localisation {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 10px;
}
.bien-card-features {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: #4b5563;
    margin-bottom: 12px;
}
.bien-card-prix {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ff7a00;
    margin-bottom: 12px;
}
.bien-card-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.bien-card-actions .btn-contrat {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(230, 92, 0, 0.3);
}
.bien-card-actions .btn-contrat:hover {
    background: var(--primary);
    color: #fff;
}
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f3f4f6;
    color: #374151;
    text-decoration: none;
    font-size: 1.1rem;
}
.btn-icon:hover { background: #e5e7eb; }
.bien-empty { color: #6b7280; padding: 24px; }

/* ========== FORMULAIRE PROPRIÉTÉ (sections, dropzone) ========== */
.form-subtitle { color: #6b7280; margin-bottom: 20px; }
.form-errors-summary { margin-bottom: 24px; }
.form-errors-summary ul { margin: 10px 0 0 20px; padding: 0; }
.form-errors-summary li { margin: 6px 0; }
.form-errors-hint { margin: 12px 0 0 0; font-size: 0.9rem; opacity: 0.95; }
/* Erreurs par champ : bien visibles */
.form-bien .errorlist {
    list-style: none;
    margin: 6px 0 0 0;
    padding: 0;
    font-size: 0.9rem;
    color: #b91c1c;
    font-weight: 500;
}
.form-bien .errorlist li { margin: 0; }
.form-group-error label { color: #b91c1c; }
.form-group-error input,
.form-group-error select,
.form-group-error textarea {
    border-color: #b91c1c !important;
    background: #fef2f2;
}
.form-section { margin-bottom: 24px; }
.form-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.form-section-owner { padding-top: 0; overflow: hidden; }
.section-header-dark {
    background: #374151;
    color: #fff;
    margin: 0 -20px 16px -20px;
    padding: 12px 20px;
    font-size: 1rem;
    border: none;
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-weight: 500; color: #374151; }
.form-bien input[type="text"],
.form-bien input[type="number"],
.form-bien input[type="password"],
.form-bien select,
.form-bien textarea {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
}
.form-bien textarea { min-height: 100px; resize: vertical; }
.dropzone-intro {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 12px;
}
.dropzone-area {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    background: #f9fafb;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.dropzone-count {
    margin-top: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #ff7a00;
}
.dropzone-area:hover,
.dropzone-area.dropzone-active { border-color: #ff7a00; background: #fff7ed; }
.dropzone-input { display: none; }
.dropzone-icon { font-size: 2.5rem; display: block; margin-bottom: 8px; color: #9ca3af; }
.dropzone-text { color: #6b7280; margin-bottom: 8px; }
.btn-browse {
    padding: 10px 20px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    margin-bottom: 8px;
}
.btn-browse:hover { background: #f3f4f6; }
.dropzone-hint { font-size: 0.8rem; color: #9ca3af; }

/* ========== DÉTAIL PROPRIÉTÉ ========== */
/* Page détail propriété : bandeau Retour + Modifier, carte blanche avec galerie */
.bien-detail-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.bien-detail-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.btn-attribuer-contrat {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-attribuer-contrat:hover {
    background: var(--primary-hover);
    color: #fff;
    border-color: var(--primary-hover);
}
.btn-retour {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--surface-soft);
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    border: 1px solid var(--border);
    transition: background 0.2s;
}
.btn-retour:hover { background: var(--border); color: var(--text); }

.bien-detail-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.bien-detail-gallery-wrap {
    display: flex;
    gap: 0;
    min-height: 380px;
}
.bien-detail-main-image {
    flex: 1;
    position: relative;
    background: #e5e7eb;
    min-height: 380px;
}
.bien-detail-main-image img {
    width: 100%;
    height: 100%;
    min-height: 380px;
    object-fit: cover;
    display: block;
}
.bien-detail-statut-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: #16a34a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.bien-detail-statut-badge.statut-disponible { background: #16a34a; }
.bien-detail-statut-badge.statut-occupe { background: #ea580c; }
.bien-detail-statut-badge.statut-vendu { background: #2563eb; }
.bien-detail-statut-badge.statut-reserve { background: #ca8a04; }

.bien-detail-thumbnails {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 140px;
    padding: 12px;
    background: #f9fafb;
    overflow-y: auto;
}
.bien-thumb {
    flex-shrink: 0;
    width: 72%;
    margin: 0 auto;
    aspect-ratio: 1;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: #e5e7eb;
    transition: width 0.2s, border-color 0.2s;
}
.bien-thumb:hover { border-color: #d1d5db; }
.bien-thumb.active {
    width: 100%;
    margin: 0;
    border-color: #ff7a00;
}
.bien-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bien-detail-placeholder {
    width: 100%;
    min-height: 380px;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 1rem;
}

.bien-detail-infos { padding: 24px 28px; }
.bien-detail-section {
    margin-bottom: 24px;
}
.bien-detail-section:last-child { margin-bottom: 0; }
.bien-detail-section h2 {
    font-size: 1.1rem;
    color: #1a1a1a;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}
.bien-detail-dl {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 8px 24px;
}
.bien-detail-dl dt { color: #6b7280; font-weight: 500; }
.bien-detail-dl dd { margin: 0; }
.bien-prix { font-weight: 700; color: #ff7a00; font-size: 1.15rem; }

/* ========== GESTION CLIENTS & PROPRIÉTAIRES ========== */
.cp-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}
.cp-header-left { flex: 1; min-width: 0; }
.cp-header h1 { font-size: 1.5rem; margin-bottom: 4px; color: #1a1a1a; }
.cp-count { color: #6b7280; font-size: 0.95rem; margin: 0; }
.cp-header-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-add-secondary { background: #374151; }
.btn-add-secondary:hover { background: #4b5563; }

.cp-search {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    max-width: 400px;
}
.cp-search-icon { font-size: 1.2rem; color: #9ca3af; }
.cp-search-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
}

.cp-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}
.cp-tab {
    padding: 12px 20px;
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s, border-color 0.2s;
}
.cp-tab:hover { color: #1a1a1a; }
.cp-tab.active { color: #ff7a00; border-bottom-color: #ff7a00; }

/* ========== Contrats & Paiements (onglets, tableaux) ========== */
.page-contrats { max-width: 1200px; margin: 0 auto; }

.contrat-paiement-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.contrat-paiement-header-text .page-subtitle,
.contrat-paiement-header .page-subtitle { margin: 0 0 4px 0; }
.contrat-paiement-page .page-subtitle { color: var(--text-muted); font-size: 0.95rem; }

/* Barre de recherche contrats/paiements */
.contrat-paiement-search { margin-bottom: 24px; }
.contrat-paiement-search-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 640px;
}
.contrat-paiement-search-icon { font-size: 1.1rem; opacity: 0.8; }
.contrat-paiement-search-input {
    flex: 1;
    min-width: 180px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: var(--surface);
}
.contrat-paiement-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(255, 122, 0, 0.15);
}

/* Onglets Contrats / Paiements – style boutons */
.contrat-paiement-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px;
    width: fit-content;
    box-shadow: var(--shadow-sm);
}
.contrat-paiement-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: calc(var(--radius) - 4px);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    min-width: 140px;
}
.contrat-paiement-tab .tab-icon { font-size: 1.05rem; opacity: 0.9; }
.contrat-paiement-tab:hover {
    color: var(--text);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.contrat-paiement-tab.active {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.contrat-paiement-tab.active .tab-icon { opacity: 1; }
.contrat-paiement-tab.active:hover { color: #fff; background: var(--primary-hover); }

/* Blocs tableaux */
.bloc-contrats .contrat-paiement-table thead th { background: #fff7ed; color: #9a3412; }
.bloc-paiements .contrat-paiement-table thead th { background: #f0fdf4; color: #166534; }
.bloc-table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
.contrat-paiement-bloc { padding: 0; overflow: visible; }
.contrat-paiement-bloc .bloc-table-wrap { padding: 0 24px 24px; }
.contrat-paiement-table { min-width: 920px; }
.contrat-paiement-table thead th { padding: 16px 18px; font-size: 0.75rem; }
.contrat-paiement-table td { padding: 16px 18px; }
.contrat-paiement-table .table-ref-icon { margin-right: 8px; opacity: 0.85; vertical-align: middle; }
.contrat-paiement-table .table-ref-icon-paiement { font-size: 0.95rem; }
.contrat-paiement-table .montant-cell { font-weight: 600; color: var(--primary); }
.contrat-paiement-table .td-empty { color: var(--text-muted); font-style: italic; padding: 28px 18px; text-align: center; }
.contrat-paiement-table .td-actions { white-space: nowrap; }
.contrat-paiement-table .td-actions .btn-details { margin-right: 6px; }
.contrat-paiement-table .btn-details {
    display: inline-block;
    padding: 8px 16px;
    font-size: 0.85rem;
    background: var(--surface-soft);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s, border-color 0.2s;
}
.contrat-paiement-table .btn-details:hover { background: var(--border); border-color: var(--primary); color: var(--primary); }
.contrat-paiement-table .btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    font-size: 1rem;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}
.contrat-paiement-table .btn-icon:hover { background: #fff7ed; border-color: var(--primary); }

.contrat-detail-grid .montant-restant { font-weight: 700; color: var(--primary); }
.text-muted { color: var(--text-muted); font-size: 0.9rem; }

.badge-type { background: #ffedd5; color: #c2410c; }
.badge-statut.badge-statut-actif { background: #dcfce7; color: #166534; }
.badge-statut.badge-statut-termine { background: #f3f4f6; color: #6b7280; }
.badge-statut.badge-statut-resilie { background: #fee2e2; color: #991b1b; }
.badge-paiement-paye { background: #16a34a; color: #fff; }
.badge-paiement-en_attente { background: #eab308; color: #1a1a1a; }
.badge-paiement-en_retard { background: #dc2626; color: #fff; }

/* Page détail contrat – blocs en cartes */
.bloc-card { padding: 28px 32px; }
.contrat-detail-grid p strong { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); margin-bottom: 4px; }
.contrat-detail-grid p span:not(.badge):not(.montant-cell),
.contrat-detail-grid p a { font-size: 0.95rem; }
.paiement-detail-grid p strong { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); margin-bottom: 4px; }
.paiement-detail-grid p span, .paiement-detail-grid p a { font-size: 0.95rem; }

/* Pied de page détail contrat */
.contrat-detail-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.contrat-detail-footer .btn-retour { margin-right: 12px; }

/* Détail paiement */
.paiement-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.paiement-detail-header-text .page-subtitle { margin: 0; color: var(--text-muted); font-size: 0.95rem; }
.paiement-detail-header h1 { margin: 0 0 4px 0; }
.paiement-detail-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Formulaires paiement */
.paiement-form-header { margin-bottom: 24px; }
.paiement-form-header h1 { margin: 0 0 4px 0; }
.paiement-form-header .page-subtitle { margin: 0; color: var(--text-muted); font-size: 0.95rem; }
.bloc-paiement-info { margin-bottom: 20px; }
.bloc-paiement-info .form-hint { margin-top: 12px; margin-bottom: 0; }

/* Filtre type de contrat (liste contrats) */
.contrat-type-filter {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: var(--surface);
    min-width: 160px;
}
.contrat-paiement-search .contrat-type-filter { margin-right: 8px; }

/* Page détail contrat */
.contrat-detail-page { max-width: 960px; }
.contrat-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.contrat-detail-header h1 { margin: 0 0 4px 0; }
.contrat-detail-header .page-subtitle { margin: 0; color: var(--text-muted); }
.contrat-detail-header-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.contrat-detail-bloc { margin-bottom: 24px; }
.contrat-detail-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.contrat-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px 24px;
}
.contrat-detail-grid p { margin: 0; font-size: 0.95rem; }
.contrat-detail-grid .badge-type { margin-left: 6px; }
.contrat-detail-paiements-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.contrat-detail-paiements-header .contrat-detail-section-title { margin-top: 0; }
.contrat-detail-paiements-header .contrat-detail-paiements-intro { margin-bottom: 0; }
.contrat-detail-paiements-intro {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
}
.contrat-document-upload { margin-bottom: 20px; }
.contrat-document-upload .form-grid-doc { align-items: flex-end; }
.contrat-document-upload .form-group-submit { margin-top: 0; }
.contrat-documents-list { margin-top: 16px; }
.contrat-doc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface-soft);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border: 1px solid var(--border);
}
.contrat-doc-icon { font-size: 1.25rem; }
.contrat-doc-name { flex: 1; font-weight: 500; word-break: break-all; }
.contrat-doc-date { font-size: 0.85rem; color: var(--text-muted); }
.contrat-doc-empty { color: var(--text-muted); font-size: 0.9rem; margin: 0; }
.contrat-detail-paiement-list-wrapper,
.contrat-paiement-list-wrapper { overflow-x: auto; }

/* Page formulaire contrat */
.contrat-form-page .page-subtitle { margin-bottom: 24px; }
.contrat-form-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 28px 32px 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    max-width: 720px;
}
.contrat-form-card .form-hint { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 16px; }

.cp-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}
.cp-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    position: relative;
    transition: box-shadow 0.2s, transform 0.2s;
}
.cp-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.cp-card-actions {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 6px;
}
.cp-card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.cp-avatar-icon { font-size: 1.75rem; }
.cp-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}
.cp-card-statut {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 12px;
}
.statut-actif { background: #dcfce7; color: #166534; }
.statut-inactif { background: #f3f4f6; color: #6b7280; }
.btn-supprimer { background: #fee2e2; color: #991b1b; }
.btn-supprimer:hover { background: #fecaca; }
.cp-card-contact {
    font-size: 0.9rem;
    color: #4b5563;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cp-card-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}
.cp-metric { display: flex; flex-direction: column; gap: 2px; }
.cp-metric-label { font-size: 0.75rem; color: #9ca3af; }
.cp-metric-value { font-size: 0.95rem; font-weight: 700; color: #1a1a1a; }
.cp-metric-orange { color: #ff7a00; }
.cp-empty { color: #6b7280; padding: 24px; grid-column: 1 / -1; }

.cp-detail-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}
.cp-detail-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cp-detail-header .cp-avatar-icon { font-size: 2.25rem; }
.cp-detail-header h1 { margin-right: 12px; }
.cp-detail-contact { color: #6b7280; margin: 8px 0 0 0; }
.cp-detail-actions { margin-left: auto; }

/* Responsive */
@media (max-width: 1024px) {
    .cards { grid-template-columns: repeat(2, 1fr); }
    .charts-container { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; justify-content: space-between; }
    .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
    .sidebar-logout { width: 100%; }
    .cards { grid-template-columns: 1fr; }
    .topbar { flex-direction: column; align-items: flex-start; }
    .bien-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .filters-form { flex-direction: column; align-items: stretch; }
    .cp-header { flex-direction: column; }
    .cp-header-actions { width: 100%; }
    .cp-cards { grid-template-columns: 1fr; }
    .cp-card-metrics { grid-template-columns: 1fr; }
    .bien-detail-gallery-wrap { flex-direction: column; min-height: 0; }
    .bien-detail-main-image { min-height: 280px; }
    .bien-detail-main-image img { min-height: 280px; }
    .bien-detail-thumbnails { flex-direction: row; width: 100%; padding: 12px; }
    .bien-thumb { max-width: 80px; }
}

/* ========== GESTION DES VISITES ========== */
.visite-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}
.visite-page-title-block h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 4px 0;
}
.visite-page-subtitle {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0;
}
.visite-page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
.visite-view-toggle {
    display: flex;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}
.btn-visite-view {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    background: #fff;
    color: #4b5563;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.btn-visite-view:hover { background: #f3f4f6; color: #1a1a1a; }
.btn-visite-view.active {
    background: #ff7a00;
    color: #fff;
}
.visite-view-icon { font-size: 1rem; }
.btn-planifier-visite {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #ff7a00 0%, #e66d00 100%);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(255, 122, 0, 0.35);
    transition: background 0.2s, transform 0.2s;
}
.btn-planifier-visite:hover { background: linear-gradient(135deg, #e66d00 0%, #cc5200 100%); color: #fff; transform: translateY(-1px); }

.visite-calendrier { margin-top: 8px; }
.visite-date-group { margin-bottom: 28px; }
.visite-date-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: #1a1a1a;
}
.visite-date-header strong { font-size: 1.05rem; }
.visite-date-icon { font-size: 1.1rem; }
.visite-date-count {
    font-size: 0.9rem;
    font-weight: normal;
    color: #6b7280;
}
.visite-cards { display: flex; flex-direction: column; gap: 16px; }
.visite-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: box-shadow 0.2s;
}
.visite-card:hover { box-shadow: var(--shadow-md); }
.visite-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.visite-card-time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #ff7a00;
    font-size: 1rem;
}
.visite-card-time-icon { font-size: 0.95rem; }
.visite-card-bien {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px 0;
}
.visite-card-infos {
    font-size: 0.95rem;
    color: #4b5563;
    margin-bottom: 16px;
}
.visite-card-infos p { margin: 6px 0; display: flex; align-items: center; gap: 8px; }
.visite-info-icon { font-size: 0.9rem; }
.visite-card-agent { color: #ff7a00 !important; font-weight: 500; }
.visite-card-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-visite-card, .btn-visite-sm {
    display: inline-block;
    padding: 8px 16px;
    font-size: 0.9rem;
    background: #e5e7eb;
    color: #374151;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}
.btn-visite-card:hover, .btn-visite-sm:hover { background: #d1d5db; color: #1a1a1a; }
.btn-visite-card-secondary, .btn-visite-sm-secondary { background: #f3f4f6; }
.btn-visite-card-secondary:hover, .btn-visite-sm-secondary:hover { background: #e5e7eb; }

.badge-visite { font-size: 0.85rem; }
.badge-visite.badge-effectuee { background: #d6f5e3; color: #16a34a; }
.badge-visite.badge-planifiee { background: #dbe8ff; color: #2563eb; }
.badge-visite.badge-annulee { background: #f3f4f6; color: #6b7280; }

.visite-empty { color: #6b7280; padding: 24px; }
.visite-liste-mode .btn-visite-sm { margin-right: 4px; }

.visite-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.visite-detail-header h1 { margin: 0; }
.visite-compte-rendu { margin-top: 16px; padding-top: 16px; border-top: 1px solid #e5e7eb; }
.visite-compte-rendu p { margin: 8px 0 0 0; white-space: pre-wrap; }

/* ========== Page formulaire visite (Planifier / Modifier) ========== */
.visite-form-page {
    max-width: 720px;
}
.visite-form-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 28px;
}
.visite-form-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #fff4ed 0%, #ffedd5 100%);
    border: 1px solid #ff7a00;
    color: #c2410c;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.visite-form-icon svg {
    width: 28px;
    height: 28px;
}
.visite-form-header h1 {
    margin: 0 0 8px 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}
.visite-form-subtitle {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.45;
}
.visite-form-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 28px 32px 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.visite-form-section {
    margin-bottom: 28px;
}
.visite-form-section:last-of-type { margin-bottom: 0; }
.visite-form-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ff7a00;
    display: flex;
    align-items: center;
    gap: 8px;
}
.visite-form-fields .form-grid { margin-bottom: 0; }
.visite-form-section .form-group { margin-bottom: 0; }
.visite-form-section .form-grid + .form-group.full,
.visite-form-section .client-search-group { margin-top: 20px; }
.visite-form-actions {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* Recherche client (formulaire visite) */
.client-search-group { position: relative; }
.client-search-box {
    display: block;
    width: 100%;
    max-width: 520px;
    margin-bottom: 14px;
    padding: 18px;
    background: linear-gradient(135deg, #fffbf7 0%, #fff7ed 100%);
    border: 1px solid #ff7a00;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(255, 122, 0, 0.12);
}
.client-search-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #c2410c;
    margin-bottom: 12px;
}
.client-search-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.client-search-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    margin-bottom: 8px;
    font-size: 1rem;
    border: 2px solid #ff7a00;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.client-search-input::placeholder {
    color: #9ca3af;
}
.client-search-input:focus {
    outline: none;
    border-color: #e66d00;
    box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.25);
}
.client-search-hint {
    display: block;
    font-size: 0.85rem;
    color: #9a3412;
    margin: 0;
}
.client-select-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 8px;
    display: block;
}
.form-group-agent-you .agent-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.form-group-agent-you .agent-connected {
    margin: 0;
    padding: 10px 14px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-weight: 500;
    color: var(--text);
}
@media (max-width: 768px) {
    .visite-page-header { flex-direction: column; align-items: stretch; }
    .visite-page-actions { flex-direction: column; align-items: stretch; }
    .visite-view-toggle { justify-content: stretch; }
    .btn-visite-view { flex: 1; justify-content: center; }
}
