/* ===== Design tokens - shared across the whole app ===== */
:root {
    --brand: #4f6df5;
    --brand-dark: #3b53c4;
    --brand-light: #eef1ff;
    --accent: #f5a524;
    --accent-light: #fef3e2;
    --ink: #1f2430;
    --muted: #6b7280;
    --surface: #ffffff;
    --bg: #f4f6fb;
    --border: #e6e8f0;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 6px 18px rgba(16, 24, 40, 0.08);
    --shadow-lg: 0 14px 34px rgba(16, 24, 40, 0.14);
}

body {
    background-color: var(--bg);
    color: var(--ink);
}

/* Override Bootstrap's default blue with the app's brand color, everywhere */
.btn-primary {
    background-color: var(--brand);
    border-color: var(--brand);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--brand-dark);
    border-color: var(--brand-dark);
}
.btn-outline-primary {
    color: var(--brand);
    border-color: var(--brand);
}
.btn-outline-primary:hover {
    background-color: var(--brand);
    border-color: var(--brand);
}
.text-primary { color: var(--brand) !important; }
.bg-primary { background-color: var(--brand) !important; }
a { color: var(--brand); }

/* Navbar */
.app-navbar {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    box-shadow: var(--shadow-md);
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}
.app-navbar .navbar-brand {
    font-weight: 700;
    letter-spacing: 0.2px;
}
.app-navbar .nav-link {
    font-weight: 500;
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.85rem;
    transition: background-color 0.15s ease;
}
.app-navbar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.12);
}
.app-navbar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.18);
    color: #fff;
}

/* Mobile offcanvas menu */
.app-offcanvas {
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    width: 280px;
}
.app-offcanvas .offcanvas-title {
    color: #fff;
}
.app-offcanvas .nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    padding: 0.75rem 0.5rem;
    border-radius: var(--radius-sm);
}
.app-offcanvas .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.12);
}
.app-offcanvas .nav-link.active {
    background-color: rgba(255, 255, 255, 0.18);
    color: #fff;
}

/* Page hero header used on index.php */
.page-hero {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    padding: 2.25rem 0 2.75rem;
    margin-bottom: -1.5rem;
    border-radius: 0 0 24px 24px;
}
.page-hero-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}
.page-hero-subtitle {
    opacity: 0.9;
    margin-bottom: 0;
    font-size: 0.95rem;
}

.contact-card {
            transition: all 0.25s ease;
            border-radius: var(--radius);
            border: 1px solid var(--border);
            box-shadow: var(--shadow-sm);
        }
        .contact-card:hover {
            transform: translateY(-3px);
            box-shadow: var(--shadow-md);
        }
        .notice-card {
            border: 1px solid var(--border);
            border-left: 4px solid var(--accent);
            background-color: var(--accent-light);
            border-radius: var(--radius);
        }
        .floor-badge {
            position: absolute;
            top: 10px;
            left: 10px;
            font-size: 0.8rem;
        }
        .contact-details {
            transition: all 0.3s ease;
        }
        .contact-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
            margin-top: 15px;
        }
        .contact-info {
            flex-grow: 1;
            padding-right: 15px;
        }

.tenant-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    margin: 0.5rem;
}

.tenant-section {
    background-color: var(--accent-light);
    border-radius: 0.5rem;
    padding: 0.75rem;

}

.floor-badge {
    position: absolute;
    top: 0;
    left: 0;
    margin: 0.5rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}


/* notificari */

        .notification-board {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 1.5rem;
        }
        .notification-card {
            transition: all 0.3s ease;
            border-left: 4px solid transparent;
            display: flex;
            flex-direction: column;
            height: 100%;
        }
        .card-body {
            flex: 1;
            display: flex;
            flex-direction: column;
        }
        .card-content {
            flex: 1;
        }
        .pinned-card {
            border-left-color: #ffc107;
            background-color: rgba(255, 193, 7, 0.05);
            grid-column: 1 / -1;
        }
        .notification-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        }
        .attachment-preview {
            max-height: 200px;
            border-radius: 8px;
            object-fit: contain;
            cursor: pointer;
            margin-bottom: 1rem;
            width: 100%;
        }
        .badge-pinned {
            background-color: #ffc107;
            color: #000;
        }
        .notification-title {
            font-weight: 600;
            margin-bottom: 0.5rem;
        }
        .notification-date {
            font-size: 0.85rem;
            color: #6c757d;
        }
        .modal-pdf {
            max-width: 90%;
        }
        .card-footer {
            background: transparent;
            border-top: none;
            padding-top: 0;
        }



/* bloc */

        .floor-plan {
            background-color: var(--surface);
            border-radius: var(--radius);
            box-shadow: var(--shadow-sm);
            margin-bottom: 30px;
            padding: 20px;
            position: relative;
        }
        .floor-label {
            font-weight: bold;
            font-size: 1.5rem;
            margin-bottom: 1rem;
            text-align: center;
            color: #333;
        }
        .apartment {
            border: 2px solid #999;
            border-radius: 8px;
            background: #f8f9fa;
            padding: 10px;
            margin-bottom: 15px;
            min-height: 100px;
            position: relative;
            transition: all 0.3s;
            cursor: pointer;
        }
        .apartment:hover {
            transform: translateY(-3px);
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        }
        .apartment.highlight {
            background: #d4edda;
            border-color: #28a745;
            box-shadow: 0 0 0 3px rgba(40,167,69,0.3);
        }

        .apartment.identificare {
            background: #ebefc4;
            border-color: #a79328;
            box-shadow: 0 0 0 3px rgba(205, 213, 167, 0.3);
        }


        .apartment.empty {
            background: repeating-linear-gradient(
                45deg,
                #f1f1f1,
                #f1f1f1 10px,
                #e5e5e5 10px,
                #e5e5e5 20px
            );
            border: 2px dashed #999;
        }
        .resident-name {
            font-size: 0.85rem;
            color: #555;
            margin: 3px 0;
        }
        .position-number {
            position: absolute;
            bottom: 5px;
            right: 5px;
            font-size: 0.7rem;
            color: #666;
            background: rgba(255,255,255,0.7);
            padding: 2px 5px;
            border-radius: 3px;
        }
        .filter-controls {
            background: white;
            padding: 15px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
            margin-bottom: 20px;
            text-align: center;
        }
        .btn-filter {
            margin: 0 5px 10px;
           /* min-width: 100px; */
        }

        .floor-grid {
            display: grid;
            grid-template-columns: repeat(var(--cols, 1), minmax(110px, 1fr));
            gap: 10px;
        }
        @media (max-width: 768px) {
            .floor-grid {
                grid-auto-flow: column;
                grid-auto-columns: minmax(120px, 1fr);
                overflow-x: auto;
                padding-bottom: 6px;
            }
        }

        /* Floor shape: two apartment rows wrapped around a central stairwell,
           mirroring the real staircase plan. */
        .floor-shape {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            grid-template-rows: auto auto auto;
            grid-template-areas:
                "tl tm tr"
                "bl ss br"
                ".  bm .";
            gap: 10px;
        }
        .slot-tl { grid-area: tl; }
        .slot-tm { grid-area: tm; }
        .slot-tr { grid-area: tr; }
        .slot-bl { grid-area: bl; }
        .slot-br { grid-area: br; }
        .slot-bm { grid-area: bm; min-height: 60px; }
        .stairwell {
            grid-area: ss;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: #888;
            font-size: 0.8rem;
            background: repeating-linear-gradient(
                135deg,
                #eef0f2,
                #eef0f2 8px,
                #e4e6e9 8px,
                #e4e6e9 16px
            );
            border: 2px dashed #bbb;
            border-radius: 8px;
            min-height: 100px;
        }
        .stairwell i {
            font-size: 1.3rem;
            margin-bottom: 4px;
        }
        @media (max-width: 576px) {
            .floor-shape { gap: 6px; }
            .apartment { padding: 6px; min-height: 70px; font-size: 0.85rem; }
            .stairwell { min-height: 70px; }
        }

        /* Ground floor (parter): two columns of 3 units around a full-height
           entrance hall - a different shape from the floors above. */
        .ground-shape {
            display: grid;
            grid-template-columns: 1fr 0.8fr 1fr;
            grid-template-rows: repeat(3, auto);
            grid-template-areas:
                "back-left  lobby back-right"
                "mid-left   lobby mid-right"
                "front-left lobby front-right";
            gap: 10px;
        }
        .gslot-back-left   { grid-area: back-left; }
        .gslot-mid-left    { grid-area: mid-left; }
        .gslot-front-left  { grid-area: front-left; }
        .gslot-back-right  { grid-area: back-right; }
        .gslot-mid-right   { grid-area: mid-right; }
        .gslot-front-right { grid-area: front-right; }
        .lobby {
            grid-area: lobby;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: space-between;
            text-align: center;
            color: #888;
            font-size: 0.75rem;
            background: repeating-linear-gradient(
                135deg,
                #eef0f2,
                #eef0f2 8px,
                #e4e6e9 8px,
                #e4e6e9 16px
            );
            border: 2px dashed #bbb;
            border-radius: 8px;
            padding: 10px 4px;
        }
        @media (max-width: 576px) {
            .ground-shape { grid-template-columns: 1fr 0.6fr 1fr; gap: 6px; }
        }
        .apartment.vecin {
            background: #fff3cd;
            border-color: #ff9800;
            box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.25);
        }
        .mini-badge {
            display: inline-block;
            margin-top: 4px;
            font-size: 0.7rem;
            font-weight: 600;
            padding: 2px 6px;
            border-radius: 10px;
        }
        .mini-badge.mine {
            background: #a79328;
            color: #fff;
        }
        .mini-badge.neighbor {
            background: #ff9800;
            color: #fff;
        }
        .legend {
            font-size: 0.85rem;
            color: #444;
        }
        .legend-swatch {
            display: inline-block;
            width: 14px;
            height: 14px;
            border-radius: 3px;
            vertical-align: middle;
            margin-right: 4px;
            border: 2px solid #999;
        }
        .legend-swatch.identificare {
            background: #ebefc4;
            border-color: #a79328;
        }
        .legend-swatch.vecin {
            background: #fff3cd;
            border-color: #ff9800;
        }
        .legend-swatch.highlight {
            background: #d4edda;
            border-color: #28a745;
        }

        /* neighbors widget (index.php) */
        .neighbors-card {
            border-left: 4px solid #4e73df;
        }
        .neighbor-slot {
            padding: 10px 12px;
            border-radius: 8px;
            background: #f8f9fa;
        }
        .neighbor-slot.empty {
            color: #888;
            font-style: italic;
        }

