:root {
    --app-bg: linear-gradient(135deg, #eef5ff 0%, #f7f4ea 100%);
    --app-primary: #1a5fd0;
    --app-card: rgba(255, 255, 255, 0.92);
    --app-border: rgba(16, 57, 120, 0.08);
}

body {
    min-height: 100vh;
    background: var(--app-bg);
    font-family: 'Cairo', sans-serif;
    color: #1f3552;
}

.app-navbar {
    background: rgba(16, 57, 120, 0.9);
    backdrop-filter: blur(14px);
    box-shadow: 0 16px 38px rgba(16, 57, 120, 0.18);
}

.app-navbar .navbar-brand,
.app-navbar .nav-link {
    color: rgba(255, 255, 255, 0.94);
}

.app-brand-logo {
    height: 54px;
    width: auto;
    display: block;
}

.app-navbar .nav-link {
    border-radius: 999px;
    padding: 0.65rem 1rem;
}

.app-navbar .nav-link.active,
.app-navbar .nav-link:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.app-navbar .dropdown-menu.app-nav-dropdown {
    border: 1px solid rgba(16, 57, 120, 0.14);
    border-radius: 16px;
    box-shadow: 0 16px 32px rgba(16, 57, 120, 0.18);
    padding: 0.45rem;
}

.app-navbar .dropdown-menu.app-nav-dropdown .dropdown-item {
    border-radius: 10px;
    font-weight: 700;
    color: #1f3552;
    padding: 0.55rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.app-navbar .dropdown-menu.app-nav-dropdown .dropdown-item i {
    font-size: 0.95rem;
    width: 1.1rem;
    text-align: center;
    color: #46668d;
}

.app-navbar .dropdown-menu.app-nav-dropdown .dropdown-item.active,
.app-navbar .dropdown-menu.app-nav-dropdown .dropdown-item:hover {
    background: rgba(26, 95, 208, 0.1);
    color: #103978;
}

.hero-card,
.metric-card,
.app-card,
.soft-card {
    border: 1px solid var(--app-border);
    border-radius: 24px;
    background: var(--app-card);
    box-shadow: 0 18px 45px rgba(16, 57, 120, 0.08);
}

.hero-card {
    background: linear-gradient(135deg, #103978 0%, #1a5fd0 100%);
    color: #fff;
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
}

.login-logo {
    width: min(220px, 100%);
    height: auto;
    display: block;
}

.metric-card {
    padding: 1.2rem;
}

.metric-value {
    font-weight: 800;
    font-size: 1.9rem;
}

.metric-primary { background: linear-gradient(135deg, #1a5fd0, #4d8eff); color: #fff; }
.metric-success { background: linear-gradient(135deg, #0f766e, #14b8a6); color: #fff; }
.metric-warning { background: linear-gradient(135deg, #b45309, #f59e0b); color: #fff; }
.metric-danger { background: linear-gradient(135deg, #b91c1c, #ef4444); color: #fff; }

.app-card .card-body,
.soft-card {
    padding: 1.35rem;
}

.table thead th {
    background: #f5f8fd;
    border-bottom: 0;
    white-space: nowrap;
}

.table > :not(caption) > * > * {
    padding: 0.9rem 0.75rem;
    vertical-align: middle;
}

.form-control,
.form-select {
    min-height: 48px;
    border-radius: 14px;
    border-color: #d9e4ef;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(26, 95, 208, 0.55);
    box-shadow: 0 0 0 0.25rem rgba(26, 95, 208, 0.15);
}

.btn-filter-picker {
    min-height: 48px;
    border-radius: 14px;
    border: 1px solid #d9e4ef;
    background: #fff;
    color: #1f3552;
}

.btn-filter-picker:hover,
.btn-filter-picker:focus {
    border-color: rgba(26, 95, 208, 0.55);
    background: #fff;
    color: #1f3552;
}

.category-filter-panel {
    border: 1px solid #d9e4ef;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    padding: 0.9rem;
}

.category-filter-list {
    display: grid;
    gap: 0.6rem;
    max-height: 230px;
    overflow-y: auto;
    padding-inline-end: 0.25rem;
}

.category-filter-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    border: 1px solid #e3ebf5;
    border-radius: 14px;
    padding: 0.7rem 0.8rem;
    background: #fff;
    cursor: pointer;
}

.category-filter-item input {
    margin: 0;
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--app-primary);
    flex-shrink: 0;
}

.category-filter-item span {
    font-weight: 700;
    color: #1f3552;
    flex: 1;
}

.category-filter-item small {
    color: #6b7f96;
    white-space: nowrap;
}

.task-quick-filters .card-body {
    padding: 1rem 1.2rem;
}

.task-pill-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.8rem;
    padding: 0.1rem 0.45rem;
    margin-inline-start: 0.35rem;
    border-radius: 999px;
    background: rgba(26, 95, 208, 0.12);
    font-size: 0.78rem;
    font-weight: 800;
}

.task-section-title {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 800;
    font-size: 1.1rem;
}

.task-section-count {
    font-size: 0.85rem;
    color: #49627f;
    background: #eef5ff !important;
}

.task-stack {
    display: grid;
    gap: 1rem;
}

.task-item {
    border: 1px solid #dbe7f3;
    border-radius: 22px;
    padding: 1rem 1.05rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 10px 26px rgba(16, 57, 120, 0.05);
}

.task-item-completed {
    background: linear-gradient(180deg, #f8fbfd 0%, #f2f7fb 100%);
    border-color: #d4e1ec;
}

.task-item-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #173a61;
}

.task-item-completed .task-item-title {
    color: #5f7490;
}

.task-item-text {
    color: #45617f;
    line-height: 1.75;
}

.task-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: flex-start;
    justify-content: flex-end;
}

.task-empty-state {
    padding: 1.5rem 1rem;
}

.wallet-total-box {
    border: 1px solid #dce7f4;
    border-radius: 18px;
    padding: 0.85rem 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
}

.wallet-total-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: #173a61;
}

.wallet-row-muted {
    opacity: 0.58;
}

.wallet-toggle-btn {
    min-width: 34px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn { border-radius: 14px; }
.btn-primary { background: var(--app-primary); border-color: var(--app-primary); }
.btn-soft { background: rgba(26, 95, 208, 0.08); color: var(--app-primary); }

.hero-actions .btn,
.quick-actions .btn {
    min-height: 48px;
    font-weight: 700;
}

.btn-hero-soft {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.32);
}

.btn-hero-soft:hover,
.btn-hero-soft:focus {
    background: rgba(255, 255, 255, 0.24);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.5);
}

.hero-card .soft-card .btn-light {
    color: #16365c;
    border-color: rgba(255, 255, 255, 0.5);
}

.hero-card .soft-card {
    color: #1f3552;
}

.hero-card .soft-card .text-muted,
.hero-card .soft-card .small {
    color: #5f7490 !important;
}

.hero-card .soft-card strong,
.hero-card .soft-card span,
.hero-card .soft-card div {
    color: inherit;
}

.hero-card .soft-card .btn-soft {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.hero-card .soft-card .btn-soft:hover,
.hero-card .soft-card .btn-soft:focus {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.42);
}

.list-clean { list-style: none; padding: 0; margin: 0; }
.app-notification-menu { min-width: 320px; }

@media (max-width: 991.98px) {
    .app-navbar .navbar-collapse {
        padding-top: 0.5rem;
    }

    .app-navbar .nav-item.dropdown .dropdown-menu.app-nav-dropdown {
        position: static;
        transform: none;
        float: none;
        width: 100%;
        margin-top: 0.35rem;
        margin-bottom: 0.45rem;
    }

    .app-navbar .nav-item + .nav-item {
        margin-top: 0.2rem;
    }
}

.timeline-item {
    padding: 1rem 0;
    border-bottom: 1px dashed #dbe5f0;
}

.timeline-item:last-child { border-bottom: 0; }

.empty-state {
    padding: 2rem 1rem;
    text-align: center;
    color: #6c7f95;
}

.app-footer {
    padding: 0 0 1.5rem;
}

.app-footer-card {
    border: 1px solid var(--app-border);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 14px 34px rgba(16, 57, 120, 0.06);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.setup-panel,
.setup-user-card {
    border: 1px solid #e1e9f3;
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    padding: 1.4rem;
}

.setup-user-card-primary {
    border-color: rgba(26, 95, 208, 0.18);
    box-shadow: 0 16px 34px rgba(26, 95, 208, 0.08);
}

.setup-panel-label {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(26, 95, 208, 0.08);
    color: var(--app-primary);
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.setup-user-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.setup-user-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 95, 208, 0.1);
    color: var(--app-primary);
    font-size: 1.35rem;
    flex-shrink: 0;
}

.chart-box {
    position: relative;
    min-height: 280px;
}

.invite-hero {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    padding: 2rem;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.16), transparent 32%),
        radial-gradient(circle at bottom right, rgba(255, 215, 140, 0.24), transparent 30%),
        linear-gradient(135deg, #103978 0%, #1a5fd0 58%, #3f83f8 100%);
    color: #fff;
    box-shadow: 0 24px 52px rgba(16, 57, 120, 0.2);
}

.invite-hero::after {
    content: '';
    position: absolute;
    inset-inline-start: -4rem;
    bottom: -4rem;
    width: 11rem;
    height: 11rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.invite-hero-text {
    max-width: 38rem;
    color: rgba(255, 255, 255, 0.86);
    line-height: 1.9;
}

.invite-hero-points {
    display: grid;
    gap: 0.7rem;
    color: rgba(255, 255, 255, 0.92);
}

.invite-hero-points div {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
}

.invite-hero-badge-card {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.12);
    padding: 1.5rem;
    text-align: center;
    backdrop-filter: blur(10px);
}

.invite-hero-badge-icon {
    width: 70px;
    height: 70px;
    border-radius: 22px;
    margin: 0 auto 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.16);
    font-size: 1.8rem;
}

.invite-summary-card {
    border: 1px solid #dfe8f3;
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    padding: 1.35rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.invite-summary-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.invite-summary-label {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(26, 95, 208, 0.08);
    color: var(--app-primary);
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
}

.invite-summary-seal {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(26, 95, 208, 0.12), rgba(63, 131, 248, 0.24));
    color: var(--app-primary);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.invite-summary-metric {
    height: 100%;
    border: 1px solid #e6edf5;
    border-radius: 18px;
    background: #fff;
    padding: 0.95rem 1rem;
}

.invite-phone-note {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border-radius: 18px;
    padding: 0.85rem 1rem;
    background: rgba(180, 83, 9, 0.08);
    color: #8a4c12;
    font-weight: 700;
}

.invite-manage-card {
    border: 1px solid #e2eaf4;
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    padding: 1rem 1.05rem;
    margin-bottom: 0.9rem;
}

.invite-link-box {
    border: 1px dashed #cfdced;
    border-radius: 16px;
    background: #fff;
    padding: 0.85rem 0.95rem;
    overflow-x: auto;
}

.invite-link-box code {
    color: #1f3552;
    white-space: nowrap;
}

.quran-latest-card {
    min-height: 120px;
}

.quran-ref-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(26, 95, 208, 0.08);
    color: #184378;
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .app-notification-menu { min-width: 290px; }
    .metric-value { font-size: 1.6rem; }
    .hero-actions .btn { width: 100%; }
    .app-brand-logo { height: 46px; }
    .setup-user-head {
        flex-direction: column;
    }
    .chart-box {
        min-height: 240px;
    }
    .app-footer-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .invite-hero {
        padding: 1.35rem;
        border-radius: 24px;
    }
    .invite-summary-head {
        flex-direction: column;
    }
    .invite-link-box code {
        white-space: normal;
        word-break: break-all;
    }
}
