:root {
    --brand-primary: #0f766e;
    --brand-secondary: #134e4a;
    --brand-accent: #14b8a6;
    --brand-primary-rgb: 15, 118, 110;
    --surface: #f8fafc;
    --surface-elevated: #ffffff;
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --border-subtle: rgba(15, 23, 42, 0.06);
    --card-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 4px 16px rgba(15, 23, 42, 0.06);
    --card-shadow-hover: 0 4px 24px rgba(var(--brand-primary-rgb), 0.12);
    --radius-lg: 1rem;
    --radius-md: 0.625rem;
}

/* ── Base ─────────────────────────────────────────────── */
body {
    background: var(--surface);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* ── Navigation & Footer ──────────────────────────────── */
.custom-navbar {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-navbar .nav-link {
    border-radius: var(--radius-md);
    margin: 0 0.15rem;
    padding: 0.5rem 0.85rem !important;
    transition: background 0.2s ease;
}

.custom-navbar .nav-link:hover,
.custom-navbar .nav-link.active {
    background: rgba(255, 255, 255, 0.12);
}

.custom-footer {
    background: linear-gradient(135deg, var(--brand-secondary) 0%, #0c4a44 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-text-logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}

/* ── Breadcrumbs ──────────────────────────────────────── */
.portal-breadcrumb {
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
    box-shadow: var(--card-shadow);
}

.portal-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}

.portal-breadcrumb a {
    color: var(--brand-primary);
    font-weight: 500;
}

.portal-breadcrumb .breadcrumb-item.active {
    color: var(--text-muted);
    font-weight: 500;
}

/* ── Global Bootstrap overrides (all templates) ───────── */
.card {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    background: var(--surface-elevated);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 600;
    color: var(--text-primary);
    padding: 1rem 1.25rem;
}

.card-header h5,
.card-header h6 {
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: transparent;
    border-top: 1px solid var(--border-subtle);
}

/* Primary colour system */
.text-primary { color: var(--brand-primary) !important; }
.bg-primary { background-color: var(--brand-primary) !important; }
.border-primary { border-color: var(--brand-primary) !important; }

.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    border: none;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--brand-secondary) 0%, var(--brand-primary) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(var(--brand-primary-rgb), 0.35);
}

.btn-outline-primary {
    border: 2px solid var(--brand-primary);
    color: var(--brand-primary);
    font-weight: 600;
    border-radius: var(--radius-md);
}

.btn-outline-primary:hover {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

.btn-secondary,
.btn-info,
.btn-success,
.btn-warning,
.btn-danger {
    border-radius: var(--radius-md);
    font-weight: 500;
}

.btn {
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-sm { border-radius: 0.5rem; }
.btn-lg { border-radius: 0.75rem; }

/* Forms */
.form-control,
.form-select {
    border-radius: var(--radius-md);
    border: 1px solid rgba(15, 23, 42, 0.12);
    padding: 0.6rem 0.85rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 0.2rem rgba(var(--brand-primary-rgb), 0.15);
}

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

.form-check-input:checked {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

/* Tables */
.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.table thead th {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom-width: 1px;
    padding: 0.85rem 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-color: var(--border-subtle);
}

.table-hover tbody tr:hover {
    background-color: rgba(var(--brand-primary-rgb), 0.04);
}

.table-responsive {
    border-radius: var(--radius-md);
}

/* Badges */
.badge {
    font-weight: 500;
    border-radius: 0.375rem;
    padding: 0.35em 0.65em;
    letter-spacing: 0.01em;
}

/* Pagination */
.pagination .page-link {
    border-radius: var(--radius-md);
    margin: 0 0.15rem;
    border: 1px solid var(--border-subtle);
    color: var(--brand-primary);
    font-weight: 500;
}

.pagination .page-item.active .page-link {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
}

/* Dropdowns */
.dropdown-menu {
    border: 1px solid var(--border-subtle);
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.12);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 0.5rem;
    padding: 0.5rem 0.85rem;
    font-weight: 500;
}

.dropdown-item:hover {
    background: rgba(var(--brand-primary-rgb), 0.08);
    color: var(--brand-primary);
}

/* Modals */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.15);
}

.modal-header {
    border-bottom: 1px solid var(--border-subtle);
}

.modal-footer {
    border-top: 1px solid var(--border-subtle);
}

/* List groups */
.list-group-item {
    border-color: var(--border-subtle);
    padding: 0.85rem 1.25rem;
}

.list-group-item-action:hover {
    background: rgba(var(--brand-primary-rgb), 0.04);
}

/* Alerts */
.alert {
    border-radius: var(--radius-md);
    border: none;
    font-weight: 500;
}

/* Nav tabs / pills */
.nav-tabs {
    border-bottom: 1px solid var(--border-subtle);
}

.nav-tabs .nav-link {
    border: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    color: var(--brand-primary);
    border-bottom: 2px solid var(--brand-primary);
    background: transparent;
}

.nav-pills .nav-link {
    border-radius: var(--radius-md);
    font-weight: 500;
}

.nav-pills .nav-link.active {
    background: var(--brand-primary);
}

/* Progress */
.progress {
    border-radius: 999px;
    height: 0.5rem;
    background: rgba(var(--brand-primary-rgb), 0.1);
}

.progress-bar {
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
    border-radius: 999px;
}

/* ── Portal component classes ─────────────────────────── */
.stat-card {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
}

.stat-card .stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.stat-card .stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.portal-card {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    background: var(--surface-elevated);
}

.portal-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 600;
    color: var(--text-primary);
}

.btn-brand {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    border: none;
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-brand:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(var(--brand-primary-rgb), 0.35);
}

.btn-brand-outline {
    border: 2px solid var(--brand-primary);
    color: var(--brand-primary);
    font-weight: 600;
    border-radius: var(--radius-md);
    background: transparent;
}

.btn-brand-outline:hover {
    background: var(--brand-primary);
    color: #fff;
}

.hero-card {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--card-shadow-hover);
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.page-header p {
    color: var(--text-muted);
}

/* ── Property-specific (used across property templates) ─ */
.filter-card {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--card-shadow-hover);
}

.filter-card .form-control,
.filter-card .form-select {
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: var(--radius-md);
}

.filter-card .form-label,
.filter-card .form-check-label {
    color: white;
    font-weight: 500;
    margin-bottom: 0.35rem;
}

.property-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.property-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
}

.property-card img {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

.property-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-primary);
}

.property-info-card {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--card-shadow-hover);
}

.property-info-card .property-price {
    font-size: 2.25rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.feature-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.85rem;
    margin: 0.25rem;
    display: inline-block;
    transition: background 0.2s ease, transform 0.2s ease;
}

.feature-badge:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.gallery-thumbnail.active {
    border-color: var(--brand-primary) !important;
}

.gallery-main-image {
    border-radius: var(--radius-lg);
}

.gallery-thumbnail {
    border-radius: var(--radius-md);
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    opacity: 0.35;
    margin-bottom: 1rem;
    display: block;
}

/* Action bar (top of list pages) */
.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* Search/filter toolbar */
.filter-toolbar {
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--card-shadow);
}

/* Detail page sections */
.detail-section {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--surface-elevated);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--card-shadow);
}

.detail-section h6 {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

/* Login page */
.login-page {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    min-height: 100vh;
}

.login-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1.25rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.login-glass .form-control {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
    border-radius: var(--radius-md) !important;
}

.login-glass .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.login-glass .form-control:focus {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: var(--brand-accent) !important;
    box-shadow: 0 0 0 0.2rem rgba(var(--brand-primary-rgb), 0.25) !important;
}

/* Crispy forms */
.asteriskField { color: #ef4444; }

/* Responsive tweaks */
@media (max-width: 768px) {
    .card-header .row {
        gap: 0.75rem;
    }

    .card-header .col-auto {
        width: 100%;
    }

    .card-header .col-auto .btn {
        width: 100%;
    }

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