/* ============================================================
   CLIENT PORTAL — petzerhiel.lu
   Dark/blur theme matching the main site aesthetic
   ============================================================ */

/* ─── Base ───────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body.portal-page {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    color: #fff;
    background: #0a1628;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(0, 159, 203, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(0, 80, 120, 0.1) 0%, transparent 50%);
}

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

/* ─── Sidebar ────────────────────────────────────────────── */
.portal-sidebar {
    width: 280px;
    min-width: 280px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-profile {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-profile-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0, 159, 203, 0.25);
    border: 2px solid rgba(0, 159, 203, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 2rem;
    color: #fff;
}

.sidebar-profile h3 {
    color: #fff;
    font-size: 1.05rem;
    margin: 0 0 4px;
    font-weight: 600;
}

.sidebar-profile .profile-role {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.82rem;
    text-transform: capitalize;
}

.sidebar-admin-btn {
    display: block;
    margin: 14px auto 0;
    padding: 10px 18px;
    background: #dc2626;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s, transform 0.15s;
    letter-spacing: 0.02em;
}
.sidebar-admin-btn:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

.sidebar-roles {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin-top: 8px;
}
.sidebar-roles-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.35);
    margin-bottom: 8px;
}
.sidebar-role-item {
    display: flex;
    flex-direction: column;
    padding: 4px 0;
}
.sidebar-role-label {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
}
.sidebar-role-scope {
    font-size: 0.7rem;
    color: #009FCB;
}

.sidebar-property {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-property .prop-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.sidebar-property .prop-ref {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.78rem;
    margin-bottom: 6px;
}

.sidebar-property .prop-address {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.82rem;
    line-height: 1.4;
}

/* Navigation */
.sidebar-nav {
    padding: 12px 0;
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.92rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.sidebar-nav a.active {
    background: rgba(0, 159, 203, 0.15);
    color: #009FCB;
    border-left-color: #009FCB;
    font-weight: 600;
}

.sidebar-nav a .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 8px 20px;
}

/* Sidebar toggle for mobile */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 48px;
    left: 16px;
    z-index: 200;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #009FCB;
    color: #fff;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

/* ─── Main Content ───────────────────────────────────────── */
.portal-content {
    flex: 1;
    margin-left: 280px;
    padding: 30px 40px 60px;
    min-height: calc(100vh - 56px);
}

.portal-page-title {
    color: #fff;
    font-size: 1.6rem;
    font-weight: 600;
    margin: 0 0 24px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-page-title .title-icon {
    font-size: 1.4rem;
}

/* ─── Cards / Boxes ──────────────────────────────────────── */
.portal-card {
    background: rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 24px;
    margin-bottom: 20px;
    color: #fff;
}

.portal-card h3 {
    font-size: 1.1rem;
    margin: 0 0 16px;
    font-weight: 600;
    color: #fff;
}

/* ─── Dashboard Cards Grid ───────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dash-stat {
    text-align: center;
    padding: 30px 24px;
}

.dash-stat .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #009FCB;
    margin-bottom: 6px;
}

.dash-stat .stat-label {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.88rem;
}

/* Manager info card */
.manager-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.manager-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 159, 203, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.manager-info h4 {
    margin: 0 0 4px;
    font-size: 1rem;
    color: #fff;
}

.manager-info p {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.manager-info a {
    color: #009FCB;
    text-decoration: none;
}

.manager-info a:hover {
    text-decoration: underline;
}

/* ─── Tables ─────────────────────────────────────────────── */
.portal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.portal-table thead th {
    text-align: left;
    padding: 12px 14px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.portal-table tbody td {
    padding: 12px 14px;
    color: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.portal-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.portal-table .amount {
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}

.portal-table .amount.negative {
    color: #f87171;
}

.portal-table .amount.positive {
    color: #4ade80;
}

/* ─── Status badges ──────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-open {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-in_progress {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-closed {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.badge-upcoming {
    background: rgba(0, 159, 203, 0.2);
    color: #009FCB;
    border: 1px solid rgba(0, 159, 203, 0.3);
}

.badge-completed {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.badge-cancelled {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

/* ─── Document Category Grid ─────────────────────────────── */
.doc-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.doc-cat-card {
    background: rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 24px 20px;
    text-align: center;
    text-decoration: none;
    color: #fff;
    transition: all 0.25s;
    cursor: pointer;
    display: block;
}

.doc-cat-card:hover {
    background: rgba(0, 159, 203, 0.12);
    border-color: rgba(0, 159, 203, 0.3);
    transform: translateY(-2px);
}

.doc-cat-card .cat-icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
    display: block;
    color: #009FCB;
}

.doc-cat-card .cat-label {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
}

.doc-cat-card .cat-updated {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
}

/* Document list within a category */
.doc-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.doc-list-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.doc-list-info .doc-icon {
    font-size: 1.3rem;
    color: #009FCB;
    flex-shrink: 0;
}

.doc-list-info .doc-title {
    font-size: 0.9rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-list-info .doc-date {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 2px;
}

.doc-download-btn {
    padding: 6px 14px;
    background: rgba(0, 159, 203, 0.2);
    color: #009FCB;
    border: 1px solid rgba(0, 159, 203, 0.3);
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

.doc-download-btn:hover {
    background: rgba(0, 159, 203, 0.35);
}

/* ─── Request Thread ─────────────────────────────────────── */
.request-thread {
    margin-top: 20px;
}

.thread-message {
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: 10px;
    border-left: 3px solid;
}

.thread-message.msg-client {
    background: rgba(0, 159, 203, 0.08);
    border-left-color: #009FCB;
}

.thread-message.msg-manager {
    background: rgba(74, 222, 128, 0.08);
    border-left-color: #4ade80;
}

.thread-message .msg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.82rem;
}

.thread-message .msg-sender {
    font-weight: 600;
    color: #fff;
}

.thread-message .msg-date {
    color: rgba(255, 255, 255, 0.45);
}

.thread-message .msg-body {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    line-height: 1.6;
}

.thread-attachment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    color: #009FCB;
    font-size: 0.82rem;
    text-decoration: none;
}

.thread-attachment:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ─── Property Cards ─────────────────────────────────────── */
.property-card {
    margin-bottom: 20px;
}

.property-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.property-header h3 {
    margin: 0;
}

.property-header .prop-ref-badge {
    background: rgba(0, 159, 203, 0.15);
    color: #009FCB;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.lots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.lot-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 14px;
}

.lot-card .lot-number {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 8px;
    color: #009FCB;
}

.lot-card .lot-detail {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 3px;
}

/* ─── Forms ──────────────────────────────────────────────── */
.portal-form {
    max-width: 600px;
}

.portal-form .form-group {
    margin-bottom: 18px;
}

.portal-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

.portal-form input[type="text"],
.portal-form input[type="email"],
.portal-form input[type="password"],
.portal-form select,
.portal-form textarea {
    width: 100%;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.portal-form input:focus,
.portal-form select:focus,
.portal-form textarea:focus {
    outline: none;
    border-color: #009FCB;
    box-shadow: 0 0 0 2px rgba(0, 159, 203, 0.2);
}

.portal-form textarea {
    min-height: 120px;
    resize: vertical;
}

.portal-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: #009FCB;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

.portal-btn:hover {
    background: #0087ad;
}

.portal-btn-outline {
    background: transparent;
    border: 1px solid rgba(0, 159, 203, 0.4);
    color: #009FCB;
}

.portal-btn-outline:hover {
    background: rgba(0, 159, 203, 0.1);
}

.portal-btn-sm {
    padding: 6px 14px;
    font-size: 0.82rem;
}

/* ─── Login Page ─────────────────────────────────────────── */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 40px 36px;
}

.login-box h1 {
    text-align: center;
    color: #fff;
    font-size: 1.5rem;
    margin: 0 0 6px;
}

.login-box .login-subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.88rem;
    margin-bottom: 28px;
}

.login-box .login-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 18px;
    text-align: center;
}

.login-box .form-group {
    margin-bottom: 18px;
}

.login-box label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

.login-box input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.login-box input:focus {
    outline: none;
    border-color: #009FCB;
    box-shadow: 0 0 0 2px rgba(0, 159, 203, 0.2);
}

.login-box .login-submit {
    width: 100%;
    padding: 12px;
    background: #009FCB;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
    transition: background 0.2s;
}

.login-box .login-submit:hover {
    background: #0087ad;
}

.login-box .login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.45);
}

.login-box .login-footer a {
    color: #009FCB;
    text-decoration: none;
}

/* ─── Balance display ────────────────────────────────────── */
.balance-display {
    text-align: center;
    padding: 20px;
}

.balance-label {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.balance-amount {
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
}

.balance-amount.positive {
    color: #4ade80;
}

.balance-amount.negative {
    color: #f87171;
}

/* ─── Section: recent operations ─────────────────────────── */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
}

.section-header a {
    color: #009FCB;
    text-decoration: none;
    font-size: 0.85rem;
}

/* ─── Assembly cards ─────────────────────────────────────── */
.assembly-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.assembly-info h4 {
    margin: 0 0 6px;
    color: #fff;
    font-size: 1rem;
}

.assembly-info p {
    margin: 0 0 4px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.assembly-docs {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ─── Empty state ────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.45);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    display: block;
}

.empty-state p {
    font-size: 0.92rem;
    margin: 0;
}

/* ─── Back link ──────────────────────────────────────────── */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #009FCB;
    text-decoration: none;
    font-size: 0.88rem;
    margin-bottom: 20px;
}

.back-link:hover {
    text-decoration: underline;
}

/* ─── Filters ────────────────────────────────────────────── */
.portal-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.portal-filters select {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #fff;
    font-size: 0.85rem;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
    .portal-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .portal-sidebar.open {
        transform: translateX(0);
    }

    .portal-content {
        margin-left: 0;
        padding: 20px 16px 60px;
    }

    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

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

    .doc-categories {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .portal-table {
        font-size: 0.8rem;
    }

    .portal-table thead th,
    .portal-table tbody td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .login-box {
        padding: 28px 20px;
    }

    .doc-categories {
        grid-template-columns: 1fr 1fr;
    }

    .lots-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════
   SYNDIC DASHBOARD
   ═══════════════════════════════════════ */

/* ── Syndic stats bar (compact, single line) ── */
.syndic-stats-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 6px;
}

.syndic-stat {
    flex: 1;
    text-align: center;
    padding: 4px 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.syndic-stat:last-child { border-right: none; }

.syndic-stat-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: #00d4ff;
    line-height: 1.2;
}

.syndic-stat-value.negative { color: #f59e0b; }

.syndic-stat-label {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
}

.syndic-viewer-notice {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

/* ── Residence tiles (compact, 3 columns) ── */
.syndic-residences-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 4px;
}

.syndic-residence-tile {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.syndic-residence-tile:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 159, 203, 0.4);
    box-shadow: 0 6px 24px rgba(0, 159, 203, 0.15);
}

.residence-photo {
    height: 110px;
    overflow: hidden;
    background: linear-gradient(135deg, #0a1628 0%, #1a2744 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.residence-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.residence-photo-placeholder {
    font-size: 2.5rem;
    opacity: 0.2;
}

.residence-info {
    padding: 12px 14px;
}

.residence-name {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 2px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.residence-address {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.residence-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.res-stat {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.65);
    white-space: nowrap;
}

.res-stat-alert {
    color: #f59e0b;
    font-weight: 600;
}

.residence-lot-breakdown {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.lot-type-badge {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(0, 159, 203, 0.12);
    border: 1px solid rgba(0, 159, 203, 0.2);
    border-radius: 20px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.65);
    white-space: nowrap;
}

/* ── Category tiles (residence view) ── */
.syndic-category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 4px;
}

.syndic-category-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 24px 16px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.syndic-category-tile:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 159, 203, 0.4);
    box-shadow: 0 6px 24px rgba(0, 159, 203, 0.15);
}

.category-tile-icon {
    font-size: 2.2rem;
    margin-bottom: 8px;
    opacity: 0.7;
}

.category-tile-label {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.category-tile-count {
    font-size: 1.6rem;
    font-weight: 700;
    color: #00d4ff;
    line-height: 1.2;
}

.category-tile-desc {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
}

/* ── Virtual intercom ── */
.intercom-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.intercom-back {
    display: inline-block;
    color: #00d4ff;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.intercom-back:hover { text-decoration: underline; }

.intercom-header {
    text-align: center;
    padding: 24px 20px 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px 12px 0 0;
    border-bottom: none;
}

.intercom-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px;
}

.intercom-header .intercom-building-name {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
}

.intercom-floor-label {
    padding: 6px 16px;
    background: rgba(0, 159, 203, 0.1);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Column headers */
.intercom-colheaders {
    display: flex;
    align-items: center;
    padding: 6px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.intercom-colh-name { flex: 2; }
.intercom-colh-unit { flex: 1; }
.intercom-colh-role { flex: 1.2; }
.intercom-colh-actions { flex: 0 0 110px; text-align: center; }

.intercom-entry {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
    gap: 12px;
}

/* Compact single-line layout */
.intercom-entry-compact {
    padding: 6px 16px;
    gap: 0;
}

.intercom-entry-compact .intercom-entry-name { flex: 2; }
.intercom-entry-compact .intercom-entry-unit { flex: 1; }
.intercom-entry-compact .intercom-entry-role { flex: 1.2; }
.intercom-entry-compact .intercom-actions    { flex: 0 0 110px; justify-content: center; }

.intercom-entry:hover {
    background: rgba(255, 255, 255, 0.05);
}

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

.intercom-entry-name {
    font-weight: 600;
    color: #fff;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.intercom-entry-unit {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
}

.intercom-entry-role {
    font-size: 0.7rem;
    color: rgba(0, 159, 203, 0.8);
    text-transform: uppercase;
}

.intercom-btn-disabled {
    opacity: 0.15;
    cursor: default;
    pointer-events: none;
}

.intercom-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.intercom-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    cursor: pointer;
}

.intercom-btn:hover {
    background: rgba(0, 159, 203, 0.2);
    border-color: rgba(0, 159, 203, 0.5);
    color: #00d4ff;
}

.intercom-btn-email:hover { background: rgba(59, 130, 246, 0.2); border-color: #3b82f6; color: #60a5fa; }
.intercom-btn-sms:hover   { background: rgba(34, 197, 94, 0.2);  border-color: #22c55e; color: #4ade80; }
.intercom-btn-call:hover  { background: rgba(234, 179, 8, 0.2);  border-color: #eab308; color: #facc15; }

.intercom-footer {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 12px 12px;
    border-top: none;
    background: rgba(255, 255, 255, 0.03);
}

.intercom-bulk-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    background: rgba(0, 159, 203, 0.12);
    border: 1px solid rgba(0, 159, 203, 0.25);
    border-radius: 8px;
    color: #00d4ff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s;
}

.intercom-bulk-btn:hover {
    background: rgba(0, 159, 203, 0.25);
}

.intercom-empty {
    text-align: center;
    padding: 24px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

/* Syndic residence — buildings grid */
.syndic-buildings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.syndic-building-tile {
    display: block;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.syndic-building-tile:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 159, 203, 0.4);
    box-shadow: 0 6px 24px rgba(0, 159, 203, 0.15);
}

.building-tile-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    opacity: 0.6;
}

.building-tile-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.building-tile-stats {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Phone popup */
.phone-popup-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.phone-popup-overlay.active { display: flex; }

.phone-popup {
    background: #1a2744;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    padding: 28px 32px;
    text-align: center;
    min-width: 280px;
}

.phone-popup-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: #00d4ff;
    margin: 12px 0;
    letter-spacing: 0.05em;
}

.phone-popup-name {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 4px;
}

.phone-popup-close {
    display: inline-block;
    margin-top: 16px;
    padding: 8px 24px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
}

.phone-popup-close:hover { background: rgba(255,255,255,0.18); }

@media (max-width: 1200px) {
    .syndic-residences-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .syndic-residences-grid {
        grid-template-columns: 1fr;
    }

    .syndic-stats-bar {
        flex-wrap: wrap;
    }

    .syndic-stat {
        flex: 0 0 calc(33% - 4px);
        border-right: none;
    }

    .residence-photo {
        height: 100px;
    }

    .intercom-footer {
        flex-direction: column;
    }

    .syndic-category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
