:root {
    --mohe-primary: #1e3a8a;
    --mohe-primary-dark: #172554;
    --mohe-primary-light: #1e40af;
    --bs-primary: #1e3a8a;
    --bs-primary-rgb: 30, 58, 138;
    --bs-body-font-family: 'Cairo', sans-serif;
    --bs-border-radius: 0.75rem;
    --bs-border-radius-lg: 1rem;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: #f8fafc;
}

/* ── Auth layout ── */
.auth-grid-bg {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
}

.auth-brand-panel {
    background: linear-gradient(135deg, var(--mohe-primary-dark) 0%, var(--mohe-primary) 50%, #1d4ed8 100%);
}

.auth-brand-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(80px);
}

.auth-feature-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--bs-border-radius-lg);
}

.auth-form-card {
    border-radius: 1.25rem;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
}

.btn-mohe {
    background: linear-gradient(to left, var(--mohe-primary), var(--mohe-primary-light));
    border: none;
    color: #fff;
    font-weight: 700;
}

.btn-mohe:hover,
.btn-mohe:focus {
    background: linear-gradient(to left, var(--mohe-primary-dark), var(--mohe-primary));
    color: #fff;
}

/* ── Navbar ── */
.navbar-mohe {
    background-color: var(--mohe-primary) !important;
}

.navbar-mohe .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    border-radius: 0.5rem;
    padding: 0.4rem 0.85rem !important;
    font-size: 0.9rem;
}

.navbar-mohe .nav-link:hover,
.navbar-mohe .nav-link.active {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.12);
}

.navbar-mohe .navbar-brand {
    color: #fff !important;
}

.navbar-mohe .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.4);
}

.navbar-mohe .navbar-toggler-icon {
    filter: invert(1);
}

/* ── Cards & stats ── */
.stat-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08) !important;
}

.hero-banner {
    background: linear-gradient(to left, var(--mohe-primary-dark), var(--mohe-primary-light));
    border-radius: 1.25rem;
}

.page-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

/* ── Forms ── */
.form-control:focus,
.form-select:focus {
    border-color: var(--mohe-primary-light);
    box-shadow: 0 0 0 0.2rem rgba(30, 58, 138, 0.15);
}

.input-group-text {
    background-color: #f8fafc;
    color: #94a3b8;
}

/* ── Tables ── */
.table thead th {
    background-color: #f8fafc;
    font-weight: 600;
    font-size: 0.875rem;
    border-bottom-width: 1px;
}

/* ── Welcome page ── */
.welcome-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--mohe-primary-dark) 0%, var(--mohe-primary) 45%, #1d4ed8 100%);
    color: #fff;
}

.welcome-feature {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--bs-border-radius-lg);
    backdrop-filter: blur(6px);
}

/* ── Settings hub ── */
.settings-hero {
    background: linear-gradient(to left, var(--mohe-primary-dark), var(--mohe-primary-light));
    border-radius: 1.25rem;
    padding: 1.5rem 2rem;
    color: #fff;
}

.settings-hero-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
}

.settings-card {
    display: block;
    border-radius: 1.25rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    height: 100%;
}

.settings-card:hover:not(.settings-card-disabled) {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.1);
    border-color: transparent;
}

.settings-card-body {
    padding: 1.75rem;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.settings-card-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.settings-card-primary .settings-card-icon { background: rgba(30, 58, 138, 0.1); }
.settings-card-success .settings-card-icon { background: rgba(22, 163, 74, 0.1); }
.settings-card-warning .settings-card-icon { background: rgba(234, 179, 8, 0.15); }
.settings-card-info .settings-card-icon { background: rgba(14, 165, 233, 0.1); }
.settings-card-danger .settings-card-icon { background: rgba(239, 68, 68, 0.1); }

.settings-card-primary:hover { border-color: var(--mohe-primary); }
.settings-card-success:hover { border-color: #16a34a; }
.settings-card-warning:hover { border-color: #ca8a04; }
.settings-card-info:hover { border-color: #0ea5e9; }
.settings-card-danger:hover { border-color: #ef4444; }

.settings-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.settings-card-desc {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.6;
    flex-grow: 1;
    margin-bottom: 1rem;
}

.settings-card-stat {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.settings-card-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--mohe-primary);
}

.settings-card-stat-label {
    font-size: 0.8rem;
    color: #94a3b8;
}

.settings-card-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--mohe-primary);
}

.settings-card-disabled {
    opacity: 0.65;
    cursor: not-allowed;
    background: #f8fafc;
}

.settings-card-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 2rem;
    background: #e2e8f0;
    color: #64748b;
    align-self: flex-start;
}

.role-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.role-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08) !important;
}

.role-card-icon {
    font-size: 2rem;
    line-height: 1;
}

/* ── Estate map picker ── */
.estate-map-picker {
    height: 420px;
    min-height: 280px;
    width: 100%;
    z-index: 0;
}

/* ── Statistics / Reports page ── */
.reports-hero {
    background: linear-gradient(135deg, var(--mohe-primary-dark) 0%, var(--mohe-primary) 55%, #1d4ed8 100%);
    border-radius: 1.25rem;
    padding: 1.75rem 2rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.reports-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    left: -10%;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.reports-hero-icon {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.reports-hero-meta {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
}

.reports-filter-card {
    border-radius: 1.25rem;
    border: 1px solid #e2e8f0;
    background: #fff;
}

.reports-filter-card .card-header {
    background: linear-gradient(to left, #f8fafc, #fff);
    border-bottom: 1px solid #e2e8f0;
    border-radius: 1.25rem 1.25rem 0 0 !important;
    padding: 1rem 1.25rem;
}

.report-kpi-card {
    background: #fff;
    border-radius: 1.25rem;
    border: 1px solid #e2e8f0;
    padding: 1.35rem 1.5rem;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.report-kpi-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--mohe-primary);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.report-kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.report-kpi-card:hover::after {
    opacity: 1;
}

.report-kpi-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.85rem;
}

.report-kpi-value {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
    margin-bottom: 0.25rem;
}

.report-kpi-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.35rem;
}

.report-kpi-sub {
    font-size: 0.78rem;
    color: #94a3b8;
}

.report-mini-stat {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1rem 1.15rem;
    text-align: center;
    height: 100%;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.report-mini-stat:hover {
    border-color: var(--mohe-primary-light);
    box-shadow: 0 4px 16px rgba(30, 58, 138, 0.08);
}

.report-progress-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.report-progress-fill {
    height: 100%;
    background: linear-gradient(to left, var(--mohe-primary), #3b82f6);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.reports-page .card {
    border-radius: 1.25rem;
}

.reports-page .card-header {
    border-radius: 1.25rem 1.25rem 0 0 !important;
    padding: 0.9rem 1.25rem;
}

.report-footer {
    border-top: 1px dashed #e2e8f0;
    margin-top: 0.5rem;
}

.reports-active-filters .badge {
    font-weight: 500;
    padding: 0.45rem 0.75rem;
}

/* ── Reports ── */
.reports-hero {
    background: linear-gradient(to left, var(--mohe-primary-dark), var(--mohe-primary-light));
    border-radius: 1.25rem;
    padding: 1.75rem 2rem;
    color: #fff;
}

.reports-hero-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.reports-hero-meta {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1rem;
    padding: 1.25rem;
}

.report-kpi-card {
    background: #fff;
    border-radius: 1rem;
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
    height: 100%;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.report-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.report-kpi-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
}

.report-kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.report-kpi-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
    margin-top: 0.25rem;
}

.report-kpi-sub {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.35rem;
}

.report-mini-stat {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 1rem;
    text-align: center;
    height: 100%;
}

.report-progress-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.report-progress-fill {
    height: 100%;
    background: linear-gradient(to left, var(--mohe-primary), var(--mohe-primary-light));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.report-footer {
    border-top: 1px dashed #e2e8f0;
}

/* ── Estate show page ── */
.estate-show-page {
    background: #f8fafc;
}

.estate-registry-badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.3rem 0.75rem;
    border-radius: 2rem;
    background: rgba(30, 58, 138, 0.1);
    color: var(--mohe-primary);
    letter-spacing: 0.02em;
}

.estate-hero {
    background: linear-gradient(135deg, var(--mohe-primary-dark) 0%, var(--mohe-primary) 55%, #1d4ed8 100%);
    border-radius: 1.25rem;
    padding: 1.75rem 2rem;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(30, 58, 138, 0.2);
}

.estate-hero::before {
    content: '';
    position: absolute;
    top: -30%;
    left: -5%;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.estate-hero-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.estate-hero-meta {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1rem;
    padding: 1.25rem;
}

.estate-meta-value {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
}

.estate-meta-label {
    font-size: 0.72rem;
    opacity: 0.85;
    margin-top: 0.2rem;
}

.estate-pill {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.estate-pill-muted {
    background: rgba(255, 255, 255, 0.08);
}

.estate-section-card {
    background: #fff;
    border-radius: 1.25rem;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.2s ease;
}

.estate-section-card:hover {
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.07);
}

.estate-section-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 1.25rem;
    font-weight: 700;
    font-size: 0.95rem;
    border-bottom: 1px solid #e2e8f0;
}

.estate-section-header i {
    font-size: 1.1rem;
}

.estate-section-primary { background: rgba(30, 58, 138, 0.06); color: var(--mohe-primary); }
.estate-section-info { background: rgba(14, 165, 233, 0.08); color: #0369a1; }
.estate-section-success { background: rgba(22, 163, 74, 0.08); color: #15803d; }
.estate-section-warning { background: rgba(234, 179, 8, 0.12); color: #a16207; }
.estate-section-danger { background: rgba(239, 68, 68, 0.08); color: #b91c1c; }
.estate-section-secondary { background: #f8fafc; color: #475569; }
.estate-section-dark { background: #0f172a; color: #fff; }

.estate-section-body {
    padding: 0.5rem 0;
}

.estate-field {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    align-items: start;
}

.estate-field:last-child {
    border-bottom: none;
}

.estate-field-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
}

.estate-field-label i {
    color: #94a3b8;
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.estate-field-value {
    font-size: 0.9rem;
    color: #0f172a;
    font-weight: 500;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.6;
}

.estate-doc-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    height: 100%;
}

.estate-doc-card:hover {
    border-color: var(--mohe-primary-light);
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.1);
    transform: translateY(-2px);
    color: inherit;
}

.estate-doc-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.65rem;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.estate-doc-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f172a;
}

.estate-doc-type {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.15rem;
}

.estate-doc-link {
    color: #94a3b8;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.estate-official-footer {
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
}

@media (max-width: 576px) {
    .estate-field {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .estate-hero {
        padding: 1.25rem;
    }
}
