/* ===== RESET & BASE (Theme Gold & Dark) ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

/* ===== CSS VARIABLES ===== */
:root {
    --gold: #C9A227;
    --gold-light: #E8BE35;
    --gold-dark: #a07c1a;
    --bg-dark: #0a0a0a;
    --bg-card: #0f0f1a;
    --bg-elevated: #1a1a2e;
    --bg-page: #0d0d14;
    --text-primary: #f0f0f0;
    --text-secondary: #b0b0c0;
    --text-muted: #777;
    --border-color: rgba(201, 162, 39, 0.18);
    --border-light: rgba(255,255,255,0.06);
    --radius: 12px;
    --radius-sm: 8px;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.3;
}

a {
    color: var(--gold);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--gold-light);
}

/* ===== NAVBAR ===== */
.cca-navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    height: 56px;
    background: var(--bg-dark);
    border-bottom: 2px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.cca-navbar .nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cca-navbar .nav-left a {
    display: flex;
    align-items: center;
}
.cca-navbar .nav-left img {
    height: 32px;
    width: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(201, 162, 39, 0.3);
}
.cca-navbar .nav-right {
    display: flex;
    align-items: center;
    gap: 4px;
}
.cca-navbar .mini-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: rgba(255,255,255,0.65);
    font-size: 15px;
    transition: all 0.25s ease;
    text-decoration: none;
}
.cca-navbar .mini-link:hover {
    background: rgba(201, 162, 39, 0.2);
    color: var(--gold-light);
}
.cca-navbar .separator {
    width: 1px;
    height: 24px;
    background: rgba(201, 162, 39, 0.25);
    margin: 0 6px;
}
.cca-navbar .portal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(201, 162, 39, 0.15);
    color: var(--gold);
    font-size: 16px;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
    cursor: pointer;
}
.cca-navbar .portal-btn:hover {
    background: rgba(201, 162, 39, 0.35);
    color: var(--gold-light);
    transform: scale(1.1);
}
.cca-navbar .logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.55);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
}
.cca-navbar .logout-btn:hover {
    background: rgba(201, 162, 39, 0.2);
    color: var(--gold-light);
}

/* ===== MENU TOGGLE (responsive) ===== */
.nav-toggle-btn {
    display: none;
    background: none;
    border: none;
    color: var(--gold);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
    align-items: center;
    justify-content: center;
}
.nav-toggle-btn:hover {
    background: rgba(201, 162, 39, 0.12);
}

/* Overlay plein écran pour nav mobile */
.nav-overlay {
    display: none;
    position: fixed;
    top: 56px; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9998;
    backdrop-filter: blur(2px);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: 56px;
}

/* ===== CONTAINER ===== */
.container {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    gap: 1rem;
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 1.7rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header h1 i {
    color: var(--gold);
}

.page-header > div {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* ===== STATS GRID ===== */
.stats-grid,
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    transition: all 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    border-color: var(--gold);
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.15), rgba(201, 162, 39, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(201, 162, 39, 0.25);
    flex-shrink: 0;
}

.stat-icon i {
    font-size: 1.55rem;
    color: var(--gold);
}

.stat-info h3 {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
    font-weight: 700;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

.stat-info small {
    color: #888;
    font-size: 0.78rem;
}

/* ===== DASHBOARD SECTIONS ===== */
.dashboard-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    transition: border-color 0.25s ease;
}

.dashboard-section:hover {
    border-color: rgba(201, 162, 39, 0.4);
}

.dashboard-section h2 {
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.dashboard-section h2 i {
    color: var(--gold);
}

.dashboard-section.full-width {
    grid-column: 1 / -1;
}

/* ===== DASHBOARD GRID ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* ===== CHART ===== */
.chart-container {
    height: 300px;
    position: relative;
    background: transparent;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.period-selector {
    display: flex;
    gap: 6px;
}

.period-btn {
    padding: 5px 13px;
    border: 2px solid var(--border-color);
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.period-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.period-btn.active {
    background: var(--gold);
    color: #1a1100;
    border-color: var(--gold);
    box-shadow: 0 2px 8px rgba(201, 162, 39, 0.25);
}

/* ===== TABLES ===== */
.table-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    margin-top: 1rem;
}

table,
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    border: none;
}

.data-table th,
table th {
    background: var(--bg-elevated);
    color: var(--gold);
    padding: 11px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.data-table td,
table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table tr:last-child td,
table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td,
table tr:hover td {
    background: rgba(255,255,255,0.03);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0.55rem 1.1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

button,
input[type="submit"] {
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: #1a1100;
    box-shadow: 0 2px 6px rgba(201, 162, 39, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 162, 39, 0.35);
    color: #1a1100;
}

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

.btn-secondary:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
}

.btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(34, 197, 94, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.btn-sm {
    padding: 0.3rem 0.65rem;
    font-size: 0.78rem;
    border-radius: 6px;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 0.77rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(5, 150, 105, 0.25);
    color: #6ee7b7;
}

.badge-warning {
    background: rgba(217, 119, 6, 0.25);
    color: #fbbf24;
}

.badge-danger {
    background: rgba(220, 38, 38, 0.25);
    color: #fca5a5;
}

.badge-info {
    background: rgba(37, 99, 235, 0.25);
    color: #93c5fd;
}

/* Badges MDB */
.badge-en_cours { background: #1e3a5f; color: #93c5fd; }
.badge-achete { background: #3b1f5e; color: #c4b5fd; }
.badge-termine { background: #14532d; color: #6ee7b7; }
.badge-abandonne { background: #5c1a1a; color: #fca5a5; }
.badge-acquisition { background: #1e3a5f; color: #93c5fd; }
.badge-renovation { background: #5c4a1a; color: #fde68a; }
.badge-vente { background: #14532d; color: #6ee7b7; }

/* ===== FILTERS ===== */
.filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-input,
.filter-select {
    padding: 0.55rem 0.9rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--bg-elevated);
    color: var(--text-primary);
    transition: border-color 0.25s, box-shadow 0.25s;
}

.search-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #C9A227;
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.12);
}

.search-input {
    flex: 1;
    min-width: 200px;
}

.filter-select {
    min-width: 175px;
}

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal[style*="block"] {
    display: flex !important;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 14px;
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalIn 0.2s ease;
    border: 1px solid var(--border-color);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(-10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-content.small {
    max-width: 440px;
}

.modal-header {
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-elevated);
    border-radius: 14px 14px 0 0;
}

.modal-header h3 {
    color: white;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header h3 i {
    color: #C9A227;
}

.close {
    font-size: 1.4rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.2s;
}

.close:hover {
    color: white;
}

.modal-body {
    padding: 1.5rem;
    background: var(--bg-card);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 0;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    background: var(--bg-elevated);
    border-radius: 0 0 14px 14px;
}

/* ===== FORMS ===== */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.55rem 0.85rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-primary);
    background: var(--bg-elevated);
    transition: border-color 0.25s, box-shadow 0.25s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.12);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23C9A227' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    appearance: none;
    padding-right: 30px;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* ===== ACTIVITIES ===== */
.activities-list {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
    color: var(--text-secondary);
}

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

.activity-item:hover {
    background: rgba(255,255,255,0.03);
}

.activity-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(201, 162, 39, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(201, 162, 39, 0.2);
}

.activity-icon i {
    color: #C9A227;
    font-size: 0.95rem;
}

.activity-details {
    flex: 1;
    min-width: 0;
}

.activity-details h4 {
    color: #1e293b;
    font-size: 0.875rem;
    margin-bottom: 0.15rem;
}

.activity-details p {
    color: #64748b;
    font-size: 0.82rem;
    margin: 0;
}

.activity-details small {
    color: #94a3b8;
    font-size: 0.77rem;
}

.activity-status {
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 0.77rem;
    font-weight: 600;
    flex-shrink: 0;
}

.activity-status.completed {
    background: #d1fae5;
    color: #065f46;
}

.activity-status.pending {
    background: #fef3c7;
    color: #92400e;
}

/* ===== ACTION BUTTONS ===== */
.action-buttons {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.action-btn {
    padding: 0.28rem 0.6rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.78rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.action-btn.edit {
    background: #dbeafe;
    color: #1e40af;
}

.action-btn.info {
    background: #d1fae5;
    color: #065f46;
}

.action-btn.info:hover {
    background: #a7f3d0;
}

.action-btn.edit:hover {
    background: #bfdbfe;
}

.action-btn.delete {
    background: #fee2e2;
    color: #991b1b;
}

.action-btn.delete:hover {
    background: #fecaca;
}

/* ===== ALERTS ===== */
.alert-success {
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* ===== STATES ===== */
.loading,
.empty {
    text-align: center;
    padding: 2.5rem;
    color: #94a3b8;
    font-size: 0.9rem;
    font-style: italic;
}

/* ===== FORM CONTAINER ===== */
.form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

/* ===== FOOTER ===== */
.footer {
    background: #0a0a0a;
    border-top: 3px solid #C9A227;
    color: #b0b0b0;
    padding: 2.5rem 2rem 1.5rem;
    margin-top: auto;
    flex-shrink: 0;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2.5rem;
    margin-bottom: 2rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.75rem;
}

.footer-logo img {
    height: 44px;
    width: auto;
    object-fit: contain;
}

.footer-tagline {
    color: #666;
    font-style: italic;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.footer-section h4 {
    color: #C9A227;
    font-size: 0.875rem;
    margin-bottom: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(201, 162, 39, 0.3);
    padding-bottom: 0.4rem;
}

.footer-section p {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0.5rem 0;
    color: #888;
    font-size: 0.85rem;
}

.footer-section i {
    color: #C9A227;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
    color: #555;
    font-size: 0.82rem;
}

.footer-bottom p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #C9A227;
}

/* ===== GOLD UTILITIES ===== */
.gold-text {
    color: #C9A227;
}

.gold-border {
    border: 2px solid #C9A227;
    border-radius: 8px;
}

.gold-bg {
    background: rgba(201, 162, 39, 0.08);
}

/* ===== HAMBURGER MENU ===== */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #C9A227;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.2s;
    align-items: center;
    justify-content: center;
}
.nav-toggle:hover {
    background: rgba(201, 162, 39, 0.12);
}

/* ===== TABLEAUX RESPONSIVE (card view) ===== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1rem;
    padding: 0 1rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .table-container {
        border-radius: 8px;
    }
}

@media (max-width: 900px) {
    .nav-links .nav-link span {
        display: none;
    }
    .nav-links {
        gap: 0.1rem;
    }
}

@media (max-width: 768px) {
    html { font-size: 15px; }

    .container {
        padding: 0.75rem;
    }

    /* ---- Navbar responsive ---- */
    .navbar {
        padding: 0 0.75rem;
        height: auto;
        min-height: 64px;
        flex-wrap: wrap;
    }
    .nav-toggle {
        display: inline-flex;
    }
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 0 0.75rem;
        border-top: 1px solid rgba(201, 162, 39, 0.15);
        margin-top: 0.5rem;
    }
    .nav-links.open {
        display: flex;
    }
    .nav-links .nav-link {
        padding: 10px 14px;
        width: 100%;
        border-radius: 6px;
        font-size: 0.95rem;
    }
    .nav-links .nav-link span {
        display: inline;
    }
    .nav-links .nav-link i {
        width: 22px;
        text-align: center;
    }
    .nav-user {
        font-size: 0.78rem;
        padding: 4px 10px;
    }
    .nav-user span {
        display: none;
    }
    .logo-img {
        height: 50px;
    }

    /* ---- Titres ---- */
    .page-header h1 {
        font-size: 1.25rem;
    }

    /* ---- Formulaires ---- */
    .form-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    /* ---- Stats ---- */
    .stats-grid,
    .quick-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .stat-card {
        padding: 0.9rem 1rem;
    }
    .stat-icon {
        width: 40px;
        height: 40px;
    }
    .stat-icon i {
        font-size: 1.15rem;
    }
    .stat-info h3 {
        font-size: 1.3rem;
    }

    /* ---- Tableaux ---- */
    .table-container {
        margin: 0.5rem -0.75rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .data-table th,
    .data-table td {
        padding: 8px 10px;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    /* ---- Page header actions ---- */
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .page-header > div {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.4rem;
    }
    .page-header > div .btn,
    .page-header > div button:not(.tab-btn),
    .page-header > div a {
        flex: 1;
        min-width: 0;
        justify-content: center;
        font-size: 0.8rem;
        padding: 0.45rem 0.7rem;
        white-space: nowrap;
    }
    .page-header input[type="month"] {
        width: 100%;
    }

    /* ---- Filtres ---- */
    .filters {
        flex-direction: column;
        gap: 0.5rem;
    }
    .filter-select {
        min-width: auto;
        width: 100%;
    }
    .search-input {
        min-width: auto;
        width: 100%;
    }

    /* ---- Graphiques ---- */
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .period-selector {
        width: 100%;
        justify-content: space-between;
    }
    .period-btn {
        flex: 1;
        text-align: center;
        font-size: 0.75rem;
        padding: 4px 8px;
    }
    .chart-container {
        height: 220px;
    }

    /* ---- Dashboard sections ---- */
    .dashboard-section {
        padding: 1rem;
    }

    /* ---- Boutons d'action dans les tableaux ---- */
    .action-buttons {
        flex-direction: column;
        gap: 0.2rem;
    }
    .action-btn {
        font-size: 0.72rem;
        padding: 0.2rem 0.4rem;
    }

    /* ---- Modals ---- */
    .modal {
        padding: 0.5rem;
        align-items: flex-end;
    }
    .modal-content {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 14px 14px 0 0;
        animation: modalSlideUp 0.25s ease;
    }
    @keyframes modalSlideUp {
        from { transform: translateY(40px); opacity: 0; }
        to   { transform: translateY(0); opacity: 1; }
    }
    .modal-header {
        padding: 0.9rem 1rem;
    }
    .modal-header h3 {
        font-size: 0.9rem;
    }
    .modal-body {
        padding: 1rem;
    }
    .modal-footer {
        padding: 0.8rem 1rem;
        flex-direction: column;
    }
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    /* ---- Footer ---- */
    .footer {
        padding: 1.5rem 1rem 1rem;
    }
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .footer-section {
        text-align: center;
    }
    .footer-logo {
        justify-content: center;
    }
    .footer-section p {
        justify-content: center;
    }

    /* ---- Rappels ---- */
    .rappel-item {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .rappel-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* ---- Groupes de rappels par logement ---- */
    .rappel-groupe {
        margin-bottom: 1.25rem;
    }
    .rappel-groupe-header {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.5rem;
        background: linear-gradient(90deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.02));
        border-left: 3px solid #d4af37;
        border-radius: 6px;
        font-weight: 600;
        color: #8a6d1b;
        letter-spacing: 0.02em;
    }
    .rappel-groupe-header i {
        color: #d4af37;
    }
    .rappel-groupe-titre {
        flex: 1;
        text-transform: uppercase;
        font-size: 0.82rem;
    }
    .rappel-groupe-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 1.4rem;
        height: 1.4rem;
        padding: 0 0.4rem;
        border-radius: 999px;
        background: #d4af37;
        color: #fff;
        font-size: 0.72rem;
        font-weight: 700;
    }
    .rappel-groupe-items {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        padding-left: 0.5rem;
        border-left: 2px solid rgba(212, 175, 55, 0.35);
        margin-left: 0.5rem;
    }
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* ---- Onglets ---- */
    .tab-btn {
        font-size: 0.78rem;
        padding: 0.4rem 0.8rem;
    }

    /* ---- Drop zone ---- */
    #drop-zone {
        padding: 1.5rem !important;
    }

    /* ---- Notifications ---- */
    .notify {
        max-width: calc(100vw - 2rem) !important;
        font-size: 0.85rem !important;
        padding: 0.7rem 1rem !important;
    }
}

@media (max-width: 480px) {
    html { font-size: 14px; }

    .container {
        padding: 0.5rem;
    }

    .stat-card {
        padding: 0.75rem;
    }

    .modal-content {
        padding: 0;
    }

    .data-table th,
    .data-table td {
        padding: 6px 8px;
        font-size: 0.75rem;
    }

    .page-header h1 {
        font-size: 1.1rem;
    }

    .stats-grid,
    .quick-stats {
        gap: 0.5rem;
    }

    .logo-img {
        height: 40px;
    }

    .form-actions {
        flex-direction: column;
    }
    .form-actions button {
        width: 100%;
    }

    #drop-zone {
        padding: 1rem !important;
    }
    #drop-zone i {
        font-size: 1.5rem !important;
    }
}

.btn-documents:hover {
    background: linear-gradient(135deg, #0d4d7a, #083353);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 107, 160, 0.3);
}

/* ===== RAPPELS ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.rappels-list {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.rappel-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s;
}

.rappel-item:hover {
    background-color: #f9fafb;
}

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

.rappel-checkbox {
    margin-right: 1rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.rappel-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
}

.btn-delete-rappel {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
    font-size: 0.9rem;
}

.btn-delete-rappel:hover {
    background-color: #fee2e2;
}

.btn-archiver-rappel,
.btn-desarchiver-rappel,
.btn-edit-rappel {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
    font-size: 0.9rem;
}

.btn-archiver-rappel:hover {
    background-color: #e0f2fe;
    color: #0284c7;
}

.btn-edit-rappel:hover {
    background-color: #fef9c3;
    color: #ca8a04;
}

.btn-desarchiver-rappel:hover {
    background-color: #f0fdf4;
    color: #16a34a;
}

.rappel-commentaire {
    font-size: 0.85rem;
    color: #64748b;
    font-style: italic;
    margin-top: 0.25rem;
    padding: 0.35rem 0.6rem;
    background: #f8fafc;
    border-radius: 6px;
    border-left: 3px solid #cbd5e1;
}

.rappel-commentaire i {
    color: #94a3b8;
    margin-right: 0.3rem;
    font-size: 0.75rem;
}

.rappel-archive {
    background: #f8fafc;
    border-left: 3px solid #94a3b8;
    opacity: 0.85;
}

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

.btn-secondary {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.btn-secondary i {
    margin-right: 0.4rem;
}

.rappel-content {
    flex: 1;
}

.rappel-titre {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.rappel-description {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.rappel-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #94a3b8;
}

.rappel-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.rappel-recurrence {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: #f1f5f9;
    border-radius: 4px;
}

.rappel-urgent {
    color: #dc2626;
    font-weight: 600;
}

.rappel-termine {
    opacity: 0.6;
    text-decoration: line-through;
}

.rappel-termine .rappel-titre {
    color: #94a3b8;
}

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

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

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

.modal-header h3 {
    margin: 0;
    color: #1e293b;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
}

.modal-close:hover {
    color: #1e293b;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #C9A227;
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.1);
}

.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-primary {
    padding: 0.75rem 1.5rem;
    background: #C9A227;
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background: #a07c1a;
}

/* ===== RESPONSIVE - très petits écrans ===== */
@media (max-width: 480px) {
    .container {
        padding: 0.75rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .page-header h1 {
        font-size: 1.3rem;
    }
    .page-header > div {
        width: 100%;
    }
    .page-header .btn {
        flex: 1;
        justify-content: center;
    }

    .stats-grid,
    .quick-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .dashboard-section {
        padding: 1rem;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table-container table {
        min-width: 600px;
    }
    .data-table th,
    .data-table td,
    table th,
    table td {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        padding: 1rem;
        width: 95%;
    }

    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
}

/* ===== NAVBAR RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav-toggle-btn {
        display: inline-flex;
    }
    .cca-navbar .nav-right {
        display: none;
        position: fixed;
        top: 56px; left: 0; right: 0;
        flex-direction: column;
        background: #0d0d14;
        border-bottom: 2px solid var(--gold);
        padding: 12px;
        gap: 4px;
        z-index: 9999;
        max-height: calc(100vh - 56px);
        overflow-y: auto;
    }
    .cca-navbar .nav-right.open {
        display: flex;
    }
    .cca-navbar .mini-link {
        width: 100%;
        height: auto;
        border-radius: 8px;
        font-size: 14px;
        padding: 10px 14px;
        justify-content: flex-start;
        gap: 12px;
        color: var(--text-secondary);
    }
    .cca-navbar .mini-link i {
        width: 20px;
        text-align: center;
    }
    .cca-navbar .mini-link:hover {
        color: var(--gold);
        background: rgba(201, 162, 39, 0.1);
    }
    .cca-navbar .separator {
        display: none;
    }
    .cca-navbar .portal-btn,
    .cca-navbar .logout-btn {
        width: 100%;
        height: auto;
        border-radius: 8px;
        padding: 10px 14px;
        font-size: 14px;
        justify-content: flex-start;
        gap: 12px;
        background: transparent;
        color: var(--text-secondary);
    }
    .cca-navbar .portal-btn i,
    .cca-navbar .logout-btn i {
        width: 20px;
        text-align: center;
    }
    .cca-navbar .portal-btn:hover,
    .cca-navbar .logout-btn:hover {
        background: rgba(201, 162, 39, 0.1);
        color: var(--gold);
    }

    .container {
        padding: 1rem;
    }
}

/* =============================================================
   PAGE iOS MODERNE — Cartes blanches arrondies, bordures fines
   Design moderne et épuré avec fond gris clair
   ============================================================= */

.page-ios {
    --bg-ios: #f2f2f7;
    --card-ios: #ffffff;
    --card-radius: 14px;
    --card-border: 1px solid rgba(60,60,67,0.08);
    --text-ios-primary: #1c1c1e;
    --text-ios-secondary: #636366;
    --text-ios-muted: #aeaeb2;
    --border-ios: rgba(60,60,67,0.1);
    --ios-gold: #C9A227;
    --ios-gold-light: #D4A930;
    --ios-separator: rgba(60,60,67,0.08);
}

.page-ios {
    background: var(--bg-ios);
    color: var(--text-ios-primary);
}

.page-ios .container {
    padding: 1.25rem;
    max-width: 1400px;
}

/* --- Page Header iOS --- */
.page-ios .page-header {
    background: transparent;
    border-bottom: none;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
}
.page-ios .page-header h1 {
    color: var(--text-ios-primary);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}
.page-ios .page-header h1 i {
    color: var(--ios-gold);
}
.page-ios .header-subtitle {
    gap: 0.5rem;
}
.page-ios .badge-gold {
    background: rgba(201,162,39,0.1);
    color: #7a6016;
    border: none;
}
.page-ios .badge-black {
    background: rgba(60,60,67,0.04);
    color: #3a3a3c;
    border: none;
}

/* --- Cartes/Sections iOS (blanc arrondi) --- */
.page-ios .dashboard-section,
.page-ios .card,
.page-ios .section-card {
    background: var(--card-ios);
    border-radius: var(--card-radius);
    padding: 1.25rem 1.5rem;
    border: var(--card-border);
    margin-bottom: 1rem;
    transition: box-shadow 0.2s ease;
}
.page-ios .dashboard-section:hover,
.page-ios .card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border-color: rgba(201,162,39,0.15);
}
.page-ios .dashboard-section h2 {
    color: var(--text-ios-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 0.75rem;
}
.page-ios .dashboard-section h2 i {
    color: var(--ios-gold);
}

/* --- Stat Cards iOS (blanc arrondi) --- */
.page-ios .stat-card {
    background: var(--card-ios);
    border: var(--card-border);
    border-radius: var(--card-radius);
    padding: 1rem 1.25rem;
    transition: box-shadow 0.2s ease;
}
.page-ios .stat-card:hover {
    border-color: rgba(201,162,39,0.15);
}
.page-ios .stat-icon {
    background: rgba(201,162,39,0.06);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 12px;
}
.page-ios .stat-icon i {
    color: var(--ios-gold);
    font-size: 1.3rem;
}
.page-ios .stat-info h3 {
    color: var(--text-ios-primary);
}
.page-ios .stat-info p {
    color: var(--text-ios-secondary);
    font-size: 0.82rem;
}
.page-ios .stat-info small {
    color: var(--text-ios-muted);
}

/* --- Tables iOS (conteneur arrondi) --- */
.page-ios .table-container {
    background: var(--card-ios);
    border: var(--card-border);
    border-radius: var(--card-radius);
    overflow: hidden;
    margin-top: 0.5rem;
}
.page-ios .data-table th,
.page-ios table th {
    background: #f8f8fa;
    color: var(--text-ios-secondary);
    font-size: 0.72rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    font-weight: 600;
    padding: 10px 14px;
    border-top: none;
    border-bottom: 1px solid var(--ios-separator);
}
.page-ios .data-table td,
.page-ios table td {
    background: var(--card-ios);
    color: var(--text-ios-primary);
    border-bottom: 1px solid var(--ios-separator);
    padding: 10px 14px;
    font-size: 0.85rem;
}
.page-ios .data-table tr:hover td,
.page-ios table tr:hover td {
    background: #f5f5f8;
}
.page-ios .data-table tr:last-child td,
.page-ios table tr:last-child td {
    border-bottom: none;
}

/* --- Filters iOS (carte blanche arrondie) --- */
.page-ios .filters-card,
.page-ios [class*="filters-card"] {
    background: var(--card-ios) !important;
    border: var(--card-border) !important;
    border-radius: var(--card-radius) !important;
    padding: 1.25rem 1.5rem !important;
    margin-bottom: 1rem !important;
    box-shadow: none !important;
}
.page-ios .filters {
    margin-bottom: 0.5rem;
    padding: 0 0.25rem;
}
.page-ios .search-input,
.page-ios .filter-select {
    background: rgba(255,255,255,0.85);
    border: 1.5px solid var(--ios-separator);
    color: var(--text-ios-primary);
    border-radius: 10px;
    padding: 0.55rem 0.85rem;
    font-size: 0.875rem;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: none;
}
.page-ios .search-input:focus,
.page-ios .filter-select:focus {
    border-color: var(--ios-gold);
    box-shadow: 0 0 0 3px rgba(201,162,39,0.1);
    background: rgba(255,255,255,1);
}
.page-ios .search-input::placeholder {
    color: var(--text-ios-muted);
}

/* --- Buttons iOS --- */
.page-ios .btn {
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
}
.page-ios .btn-primary {
    background: linear-gradient(135deg, var(--ios-gold) 0%, var(--ios-gold-light) 100%);
    color: #1a1100;
    box-shadow: 0 2px 8px rgba(201,162,39,0.15);
    border: none;
}
.page-ios .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(201,162,39,0.25);
}
.page-ios .btn-secondary {
    background: rgba(60,60,67,0.06);
    color: var(--text-ios-primary);
    border: none;
}
.page-ios .btn-secondary:hover {
    background: rgba(60,60,67,0.1);
    color: var(--text-ios-primary);
}

/* --- Badges iOS --- */
.page-ios .badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}
.page-ios .badge-warning {
    background: #fff8e1;
    color: #f57f17;
}
.page-ios .badge-danger {
    background: #fce4ec;
    color: #c62828;
}
.page-ios .badge-info {
    background: #e3f2fd;
    color: #1565c0;
}

/* --- Action Buttons iOS --- */
.page-ios .action-btn.edit {
    background: #e8f0fe;
    color: #1967d2;
}
.page-ios .action-btn.delete {
    background: #fce8e6;
    color: #c5221f;
}
.page-ios .action-btn:hover {
    transform: scale(1.05);
}

/* --- Modals iOS --- */
.page-ios .modal-content {
    background: #ffffff;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    border-radius: 16px;
}
.page-ios .modal-header {
    background: #ffffff;
    border-bottom: 1px solid var(--ios-separator);
    border-radius: 16px 16px 0 0;
}
.page-ios .modal-header h3 {
    color: var(--text-ios-primary);
}
.page-ios .modal-header h3 i {
    color: var(--ios-gold);
}
.page-ios .close {
    color: var(--text-ios-muted);
}
.page-ios .close:hover {
    color: var(--text-ios-primary);
}
.page-ios .modal-body {
    background: #ffffff;
    color: var(--text-ios-primary);
}
.page-ios .modal-footer {
    background: #ffffff;
    border-top: 1px solid var(--ios-separator);
    border-radius: 0 0 16px 16px;
}

/* --- Forms iOS (transparents, champs en verre) --- */
.page-ios .form-group label {
    color: var(--text-ios-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.page-ios .form-group input,
.page-ios .form-group select,
.page-ios .form-group textarea {
    background: rgba(255,255,255,0.85);
    border: 1.5px solid var(--ios-separator);
    color: var(--text-ios-primary);
    border-radius: 10px;
    padding: 0.55rem 0.85rem;
    font-size: 0.875rem;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: border-color 0.2s, background 0.2s;
}
.page-ios .form-group input:focus,
.page-ios .form-group select:focus,
.page-ios .form-group textarea:focus {
    border-color: var(--ios-gold);
    box-shadow: 0 0 0 3px rgba(201,162,39,0.1);
    background: #ffffff;
}
.page-ios .form-group input::placeholder,
.page-ios .form-group textarea::placeholder {
    color: var(--text-ios-muted);
}
.page-ios .form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23636366' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* --- Activities iOS (transparents) --- */
.page-ios .activities-list {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
}
.page-ios .activity-item {
    border-bottom: 1px solid var(--ios-separator);
    color: var(--text-ios-primary);
    background: transparent;
}
.page-ios .activity-item:last-child {
    border-bottom: none;
}
.page-ios .activity-item:hover {
    background: rgba(60,60,67,0.03);
}
.page-ios .activity-icon {
    background: rgba(201,162,39,0.06);
    border: none;
}
.page-ios .activity-icon i {
    color: var(--ios-gold);
}
.page-ios .activity-details h4 {
    color: var(--text-ios-primary);
}
.page-ios .activity-details p {
    color: var(--text-ios-secondary);
}
.page-ios .activity-details small {
    color: var(--text-ios-muted);
}

/* --- Période selector iOS --- */
.page-ios .period-btn {
    background: rgba(60,60,67,0.06);
    border: none;
    color: var(--text-ios-secondary);
    border-radius: 8px;
    padding: 5px 12px;
    font-weight: 600;
}
.page-ios .period-btn:hover {
    background: rgba(60,60,67,0.1);
    color: var(--text-ios-primary);
}
.page-ios .period-btn.active {
    background: var(--ios-gold);
    color: #1a1100;
    box-shadow: 0 2px 8px rgba(201,162,39,0.15);
}

/* --- Chart containers iOS --- */
.page-ios .chart-container {
    background: transparent;
}

/* --- Section Header avec actions --- */
.page-ios .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

/* --- Alerts iOS --- */
.page-ios .alert-success {
    background: #e8f5e9;
    border: none;
    color: #2e7d32;
    border-radius: 10px;
}
.page-ios .alert-error {
    background: #fce4ec;
    border: none;
    color: #c62828;
    border-radius: 10px;
}

/* --- Loading / Empty iOS --- */
.page-ios .loading,
.page-ios .empty {
    color: var(--text-ios-muted);
}

/* --- Rappels iOS --- */
.page-ios .rappels-list {
    color: var(--text-ios-primary);
}

/* --- Badges spécifiques MDB iOS --- */
.page-ios .badge-en_cours { background: #e3f2fd; color: #1565c0; }
.page-ios .badge-achete { background: #ede7f6; color: #4527a0; }
.page-ios .badge-termine { background: #e8f5e9; color: #2e7d32; }
.page-ios .badge-abandonne { background: #fce4ec; color: #c62828; }
.page-ios .badge-acquisition { background: #e3f2fd; color: #1565c0; }
.page-ios .badge-renovation { background: #fff8e1; color: #f57f17; }
.page-ios .badge-vente { background: #e8f5e9; color: #2e7d32; }

/* --- Styles spécifiques MDB (Marchand de Biens) --- */
/* Cartes blanches arrondies avec bordure fine */
.page-ios .mdb-stat-card {
    background: var(--card-ios) !important;
    border: var(--card-border) !important;
    border-radius: var(--card-radius) !important;
    padding: 1rem 1.25rem !important;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3) !important;
}
.page-ios .mdb-stat-card::before {
    display: none !important;
}
.page-ios .mdb-stat-card .stat-value {
    font-size: 1.6rem !important;
    font-weight: 700 !important;
    color: var(--ios-gold) !important;
}
.page-ios .mdb-stat-card .stat-label {
    font-size: 0.82rem !important;
    color: var(--text-ios-secondary) !important;
    margin-top: 0.2rem !important;
}

.page-ios .chart-box {
    background: var(--card-ios) !important;
    border: var(--card-border) !important;
    border-radius: var(--card-radius) !important;
    padding: 1.2rem !important;
}
.page-ios .chart-box h3 {
    color: var(--text-ios-secondary) !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
    margin-bottom: 0.75rem !important;
}

.page-ios .mdb-section {
    background: var(--card-ios) !important;
    border: var(--card-border) !important;
    border-radius: var(--card-radius) !important;
    padding: 1.2rem !important;
    margin-bottom: 1rem !important;
}
.page-ios .mdb-section h2 {
    color: var(--text-ios-secondary) !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
    margin-bottom: 0.75rem !important;
}
.page-ios .mdb-section h2 i {
    color: var(--ios-gold) !important;
}

.page-ios .mdb-stats {
    gap: 1rem !important;
    margin-bottom: 1rem !important;
}
.page-ios .mdb-charts {
    gap: 1rem !important;
    margin-bottom: 1rem !important;
}
/* Boutons MDB en mode clair */
.page-ios .btn-dark {
    background: rgba(60,60,67,0.06) !important;
    color: var(--text-ios-primary) !important;
    border: none !important;
}
.page-ios .btn-dark:hover {
    background: rgba(60,60,67,0.1) !important;
}

/* --- Dashboard extras (page-ios white theme) --- */
.page-ios .btn-documents {
    background: rgba(201,162,39,0.1);
    color: var(--ios-gold);
    border: none;
    border-radius: 10px;
    font-weight: 600;
    padding: 8px 16px;
    transition: all 0.2s ease;
}
.page-ios .btn-documents:hover {
    background: rgba(201,162,39,0.18);
}
.page-ios .dashboard-grid {
    background: transparent;
}
.page-ios .rappel-card {
    background: var(--card-ios);
    border: var(--card-border);
    border-radius: var(--card-radius);
    padding: 12px 16px;
    margin-bottom: 8px;
    transition: box-shadow 0.2s ease;
}
.page-ios .rappel-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border-color: rgba(201,162,39,0.15);
}
.page-ios .rappel-card .rappel-title {
    color: var(--text-ios-primary);
    font-weight: 600;
}
.page-ios .rappel-card .rappel-meta {
    color: var(--text-ios-muted);
    font-size: 0.82rem;
}
.page-ios .rappel-card label {
    color: var(--text-ios-secondary);
}
.page-ios .rappel-card.en-retard {
    border-left: 3px solid #e53935;
}
.page-ios .rappel-card.completed {
    border-left: 3px solid #43a047;
}
.page-ios .rappel-card .btn-rappel-action {
    color: var(--text-ios-muted);
    border: none;
    background: none;
}
.page-ios .rappel-card .btn-rappel-action:hover {
    color: var(--ios-gold);
}
.page-ios .btn-gold {
    background: var(--ios-gold);
    color: #1a1100;
    border: none;
    border-radius: 10px;
    padding: 8px 18px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}
.page-ios .btn-gold:hover {
    background: #d4af37;
    box-shadow: 0 2px 8px rgba(201,162,39,0.25);
}
.page-ios .modal-content {
    background: var(--card-ios);
    border: var(--card-border);
    border-radius: var(--card-radius);
}
.page-ios .modal-header {
    border-bottom: 1px solid rgba(60,60,67,0.08);
    color: var(--text-ios-primary);
}
.page-ios .modal-footer {
    border-top: 1px solid rgba(60,60,67,0.08);
}
.page-ios .stats-grid {
    gap: 0.75rem;
}

/* =============================================================
   TRI DES COLONNES
   ============================================================= */
th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    white-space: nowrap;
}
th.sortable:hover {
    background-color: rgba(255, 215, 0, 0.08);
}
.sort-indicator {
    font-size: 0.7em;
    color: var(--gold, #d4a843);
    margin-left: 2px;
}

/* =============================================================
   RESPONSIVE iOS
   ============================================================= */
@media (max-width: 768px) {
    .page-ios .container {
        padding: 0.85rem;
    }
    .page-ios .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .page-ios .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;

    }
}

/* ===== Checkbox personnalisée pour formulaire contact ===== */
.page-ios .checkbox-group {
    margin: 0.5rem 0;
}

.page-ios .checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-primary, #e0e0e0);
    user-select: none;
    padding: 0.4rem 0;
}

.page-ios .checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent, #c8a84e);
    cursor: pointer;
}

/* =============================================================
   TABLEAUX → CARTES SUR MOBILE (pas de scroll horizontal)
   Fonctionne pour toute .data-table dont les <td> ont un [data-label].
   ============================================================= */
@media (max-width: 768px) {
    /* On annule le scroll horizontal : plus rien ne déborde */
    .table-container {
        overflow-x: visible !important;
        margin: 0.5rem 0 !important;
        border-radius: var(--radius, 10px);
        border-left: 1px solid var(--border-color) !important;
        border-right: 1px solid var(--border-color) !important;
        background: transparent;
        box-shadow: none;
    }

    /* Uniquement les tables avec un <thead> (les tables "th/td par ligne" restent normales) */
    .data-table:has(thead),
    table.data-table:has(thead) {
        display: block;
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
    }
    .data-table:has(thead) thead {
        display: none;           /* les en-têtes sont remplacés par les labels */
    }
    .data-table:has(thead) tbody {
        display: block;
        width: 100%;
    }

    /* Chaque ligne devient une carte */
    .data-table:has(thead) tbody tr {
        display: block;
        background: var(--bg-card, #1c1c1e);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        padding: 0.5rem 0.85rem;
        margin-bottom: 0.75rem;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    }

    /* Chaque cellule devient une ligne "Label : valeur" */
    .data-table:has(thead) tbody td {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 0.75rem;
        width: 100%;
        padding: 0.45rem 0 !important;
        border: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        font-size: 0.9rem;
        text-align: right;
        word-break: break-word;
        overflow-wrap: anywhere;
        min-width: 0;
    }
    .data-table:has(thead) tbody td:last-child {
        border-bottom: none !important;
    }

    /* Le libellé (issu de data-label) */
    .data-table:has(thead) tbody td[data-label]::before {
        content: attr(data-label);
        flex: 0 0 auto;
        font-weight: 600;
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        color: var(--gold, #c8a84e);
        text-align: left;
        white-space: nowrap;
        opacity: 0.9;
    }

    /* Cellules sans data-label (ex: message vide / loading) */
    .data-table:has(thead) tbody td:not([data-label]) {
        justify-content: center;
        text-align: center;
        color: var(--text-secondary);
    }

    /* La cellule Actions : boutons alignés à droite sur une seule ligne */
    .data-table:has(thead) tbody td[data-label="Actions"] {
        justify-content: space-between;
    }
    .data-table:has(thead) tbody td[data-label="Actions"] .action-buttons {
        flex-direction: row !important;
        gap: 0.5rem !important;
    }
    .data-table:has(thead) tbody td[data-label="Actions"] .action-btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }

    /* Les cartes d'état (badges) restent lisibles */
    .data-table:has(thead) tbody td .category-badge {
        white-space: nowrap;
    }
}
