/* ============================================================
   IMMOGEST — Main Stylesheet
   ============================================================ */

:root {
    --primary: #6C63FF;
    --primary-dark: #574fd6;
    --primary-light: #a89dff;
    --primary-glow: rgba(108, 99, 255, 0.3);
    --secondary: #FF6584;
    --accent: #43D9AD;
    --accent2: #FFB84C;
    --bg: #0f1117;
    --bg2: #161b27;
    --bg3: #1e2535;
    --card: rgba(255,255,255,0.04);
    --card-border: rgba(255,255,255,0.08);
    --text: #e8eaf6;
    --text-muted: #8892a4;
    --text-light: #c5cae9;
    --sidebar-w: 260px;
    --topbar-h: 64px;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 40px rgba(108, 99, 255, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 99px; }

/* ── Links ── */
a { color: var(--primary-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary); }

/* ── Layout ── */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg2);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    overflow: hidden;
    transition: transform 0.3s ease, width 0.3s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--card-border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 16px var(--primary-glow);
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 6px;
    border-radius: 8px;
    transition: var(--transition);
}
.sidebar-toggle:hover { color: var(--text); background: var(--card); }

.sidebar-nav {
    flex: 1;
    padding: 10px 10px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 14px;
}

.nav-label {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0 8px;
    display: block;
    margin-bottom: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 1px;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--primary-glow), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.nav-item:hover, .nav-item.active {
    color: var(--text);
    background: rgba(108,99,255,0.12);
}

.nav-item.active {
    color: var(--primary-light);
    background: rgba(108,99,255,0.18);
    border-left: 3px solid var(--primary);
}

.nav-item.active::before { opacity: 1; }

.nav-item i {
    font-size: 14px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.user-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    color: var(--text-muted);
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
    flex-shrink: 0;
}
.btn-logout:hover { color: var(--secondary); background: rgba(255,101,132,0.1); }

/* ── Main Content ── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Topbar ── */
.topbar {
    height: var(--topbar-h);
    background: var(--bg2);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 6px;
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-bell {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: var(--card);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}
.notification-bell:hover { color: var(--text); border-color: var(--primary); }

/* ── Page Content ── */
.page-content {
    flex: 1;
    padding: 28px 28px 40px;
}

/* ── Cards ── */
.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
    backdrop-filter: blur(8px);
}

.card:hover {
    border-color: rgba(108,99,255,0.3);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

/* ── Stat Cards ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--stat-color, var(--primary));
    opacity: 0.06;
    transition: var(--transition);
}

.stat-card:hover::after { transform: scale(1.5); }
.stat-card:hover { border-color: var(--stat-color, var(--primary)); box-shadow: 0 0 30px rgba(0,0,0,0.2); transform: translateY(-3px); }

.stat-link {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 11px;
    color: var(--stat-color, var(--primary));
    font-weight: 600;
    opacity: 0.8;
    z-index: 1;
}
.stat-link:hover { opacity: 1; }

.stat-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    background: rgba(var(--stat-rgb, 108,99,255), 0.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    color: var(--stat-color, var(--primary));
    flex-shrink: 0;
}

.stat-info { flex: 1; }

.stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 4px;
}

.stat-change {
    font-size: 11px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.up { color: var(--accent); }
.stat-change.down { color: var(--secondary); }

/* ── Grid Layouts ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

/* ── Forms ── */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg3);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(108,99,255,0.05);
}

.form-control::placeholder { color: var(--text-muted); }

textarea.form-control { resize: vertical; min-height: 90px; }

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238892a4' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    color-scheme: dark;
}

select.form-control option,
select.form-control optgroup {
    background-color: #1e2535;
    color: #e8eaf6;
}

select.form-control optgroup {
    color: #8892a4;
    font-style: normal;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.form-help {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--primary-glow); color: #fff; }

.btn-secondary {
    background: var(--card);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary-light); }

.btn-success {
    background: linear-gradient(135deg, var(--accent), #2ea88a);
    color: #fff;
}
.btn-success:hover { transform: translateY(-2px); color: #fff; }

.btn-danger {
    background: linear-gradient(135deg, var(--secondary), #d64e6a);
    color: #fff;
}
.btn-danger:hover { transform: translateY(-2px); color: #fff; }

.btn-warning {
    background: linear-gradient(135deg, var(--accent2), #e09530);
    color: #fff;
}
.btn-warning:hover { transform: translateY(-2px); color: #fff; }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-icon { padding: 8px; min-width: 36px; justify-content: center; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Tables ── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    background: var(--bg3);
    border-bottom: 1px solid var(--card-border);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--card-border);
    transition: var(--transition);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(108,99,255,0.06); }

tbody td {
    padding: 14px 16px;
    color: var(--text-light);
    vertical-align: middle;
}

/* ── Badges & Tags ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-success { background: rgba(67,217,173,0.15); color: var(--accent); }
.badge-danger  { background: rgba(255,101,132,0.15); color: var(--secondary); }
.badge-warning { background: rgba(255,184,76,0.15); color: var(--accent2); }
.badge-info    { background: rgba(108,99,255,0.15); color: var(--primary-light); }
.badge-muted   { background: rgba(136,146,164,0.15); color: var(--text-muted); }

/* ── Alerts ── */
.alert {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.alert-success { background: rgba(67,217,173,0.12); border: 1px solid rgba(67,217,173,0.3); color: var(--accent); }
.alert-error   { background: rgba(255,101,132,0.12); border: 1px solid rgba(255,101,132,0.3); color: var(--secondary); }
.alert-info    { background: rgba(108,99,255,0.12); border: 1px solid rgba(108,99,255,0.3); color: var(--primary-light); }

/* ── Page Header ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* ── Property Card ── */
.property-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.property-card:hover {
    transform: translateY(-4px);
    border-color: rgba(108,99,255,0.4);
    box-shadow: 0 16px 40px rgba(0,0,0,0.3);
}

.property-photo {
    height: 180px;
    background: var(--bg3);
    position: relative;
    overflow: hidden;
}

.property-photo img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.property-photo-placeholder {
    height: 180px;
    background: linear-gradient(135deg, var(--bg3), var(--bg2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--card-border);
}

.property-status {
    position: absolute;
    top: 12px;
    right: 12px;
}

.property-body {
    padding: 18px;
}

.property-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text);
}

.property-address {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.property-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.property-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-muted);
}

.property-meta-item i { color: var(--primary-light); }

.property-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.5px;
}

.property-price span {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.property-actions {
    padding: 12px 18px;
    border-top: 1px solid var(--card-border);
    display: flex;
    gap: 8px;
}

/* ── Tenant Card ── */
.tenant-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
}

.tenant-card:hover {
    border-color: rgba(108,99,255,0.3);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.tenant-avatar {
    width: 54px; height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    font-size: 18px;
    flex-shrink: 0;
}

.tenant-avatar img {
    width: 54px; height: 54px;
    border-radius: 50%;
    object-fit: cover;
}

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

.tenant-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.tenant-contact {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tenant-contact span { display: flex; align-items: center; gap: 5px; }

/* ── Quittance / Receipt ── */
.receipt-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
}

.receipt-card:hover {
    border-color: rgba(108,99,255,0.3);
    box-shadow: var(--shadow);
}

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg2);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 28px;
    max-width: 480px;
    width: 90%;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s;
}

.modal-overlay.open .modal {
    transform: scale(1) translateY(0);
}

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

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    border-radius: 6px;
    transition: var(--transition);
}
.modal-close:hover { color: var(--secondary); }

/* ── Auth Pages ── */
.auth-body {
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-bg-orbs {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
}

.orb-1 { width: 500px; height: 500px; background: var(--primary); top: -200px; left: -200px; animation: orbFloat1 12s ease-in-out infinite; }
.orb-2 { width: 400px; height: 400px; background: var(--secondary); bottom: -150px; right: -100px; animation: orbFloat2 15s ease-in-out infinite; }
.orb-3 { width: 300px; height: 300px; background: var(--accent); top: 50%; left: 50%; transform: translate(-50%,-50%); animation: orbFloat3 10s ease-in-out infinite; }

.auth-card {
    background: rgba(22, 27, 39, 0.9);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    backdrop-filter: blur(20px);
    position: relative;
    z-index: 1;
    box-shadow: 0 32px 64px rgba(0,0,0,0.5);
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo .logo-icon {
    width: 60px; height: 60px;
    margin: 0 auto 12px;
    font-size: 26px;
    border-radius: 18px;
}

.auth-logo h1 {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.auth-logo p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.auth-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
}

/* ── Charts ── */
.chart-container {
    position: relative;
    width: 100%;
    height: 240px;
}

/* ── Progress ── */
.progress {
    background: var(--bg3);
    border-radius: 99px;
    height: 6px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 56px;
    opacity: 0.3;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 20px;
}

/* ── Divider ── */
.divider {
    height: 1px;
    background: var(--card-border);
    margin: 20px 0;
}

/* ── Input icon wrapper ── */
.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper .icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

.input-icon-wrapper .form-control {
    padding-left: 38px;
}

/* ── Section header ── */
.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.section-header .section-icon {
    width: 32px; height: 32px;
    background: rgba(108,99,255,0.15);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary-light);
    font-size: 14px;
}

/* ── Tab navigation ── */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg3);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 24px;
    width: fit-content;
}

.tab-btn {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: none;
    color: var(--text-muted);
    transition: var(--transition);
}

.tab-btn.active {
    background: var(--bg2);
    color: var(--primary-light);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ── Quittance print ── */
.receipt-print {
    background: white;
    color: #1a1a2e;
    padding: 40px;
    max-width: 700px;
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
    border-radius: var(--radius);
}

.receipt-print * { color: #1a1a2e; }

/* ── Timeline ── */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--card-border);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -21px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg2);
}

.timeline-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.timeline-text {
    font-size: 13px;
    color: var(--text-light);
}

.timeline-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Market price widget ── */
.market-widget {
    background: linear-gradient(135deg, rgba(108,99,255,0.12), rgba(67,217,173,0.08));
    border: 1px solid rgba(108,99,255,0.25);
    border-radius: var(--radius);
    padding: 20px;
}

/* ── Tooltip ── */
[data-tooltip] {
    position: relative;
    cursor: default;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg3);
    border: 1px solid var(--card-border);
    color: var(--text);
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 999;
}

[data-tooltip]:hover::after { opacity: 1; }

/* ── Pagination ── */
.pagination {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    margin-top: 24px;
}

.page-btn {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    background: var(--card);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.page-btn:hover, .page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ── Search bar ── */
.search-bar {
    position: relative;
    max-width: 320px;
}

.search-bar input {
    padding-left: 38px;
}

.search-bar .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

/* ── Info list ── */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--card-border);
    font-size: 14px;
}

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

.info-label { color: var(--text-muted); }
.info-value { color: var(--text); font-weight: 500; }

/* ── Responsive ── */
@media (max-width: 1024px) {
    .grid-2 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .form-row-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1000;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content { margin-left: 0; }
    .mobile-menu-btn { display: block; }
    .page-content { padding: 16px 12px 30px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .grid-3, .form-row-3 { grid-template-columns: 1fr; }
    .auth-card { padding: 28px 20px; }

    /* Tables : scroll horizontal + colonnes secondaires masquées */
    .table-wrapper { border-radius: var(--radius-sm); -webkit-overflow-scrolling: touch; }
    table { min-width: 600px; }
    th, td { padding: 10px 10px; font-size: 12px; }
    th:last-child, td:last-child { position: sticky; right: 0; background: var(--bg2); z-index: 1; }

    /* Filtres : empilement vertical */
    .card form[method="GET"],
    .card form[style*="display:flex"],
    div[style*="display:flex"][style*="gap"] { flex-wrap: wrap; }
    .card form[method="GET"] .form-control,
    .card form[method="GET"] select { width: 100%; min-width: 0; }

    /* Boutons filtre logement FEC / waitlist */
    .btn-sm { font-size: 12px; padding: 5px 10px; }

    /* Page header : bouton en dessous du titre */
    .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .page-header > a.btn,
    .page-header > div > a.btn { align-self: stretch; justify-content: center; }

    /* Modals */
    .modal { padding: 20px 16px; width: 96%; max-width: 100%; }

    /* Stat cards : icône + valeur côte à côte */
    .stat-card { flex-direction: row; align-items: center; gap: 12px; padding: 14px; }
    .stat-icon { width: 40px; height: 40px; font-size: 16px; flex-shrink: 0; }
    .stat-value { font-size: 20px; }

    /* Boutons d'action dans les tables : empilés */
    td > div[style*="display:flex"] { flex-wrap: wrap; gap: 4px; }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99;
        display: none;
    }
    .sidebar-overlay.open { display: block; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .page-content { padding: 12px 10px 24px; }

    /* Stats grid minwidth réduit pour 320px */
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

    /* Formulaire de connexion */
    .auth-card { padding: 24px 16px; margin: 12px; }

    /* Tables encore plus petites : réduire la largeur min */
    table { min-width: 480px; }
    th, td { padding: 8px 8px; font-size: 11px; }

    /* Sections FEC filtres : boutons pleine largeur */
    .btn-sm { width: 100%; justify-content: center; text-align: center; }

    /* Section header */
    .section-header { flex-wrap: wrap; gap: 8px; }

    /* Cards : padding réduit */
    .card { padding: 14px; border-radius: var(--radius-sm); }

    /* Topbar */
    .topbar { padding: 0 12px; }
    .topbar-title { font-size: 14px; }
}

/* ── charte gaetanmorvan.fr (2026-10) : palette alignée sur le site ── */
:root{--primary:#8b5cf6;--primary-dark:#7c3aed;--primary-light:#a78bfa;--primary-glow:rgba(139,92,246,.3);--secondary:#f472b6;--accent:#22d3ee;--bg:#08080d;--bg2:#101019;--bg3:#1b1b29;--text:#f3f2ee;--text-muted:#a5a3b3;--shadow-glow:0 0 40px rgba(139,92,246,.15)}
