/* ────────────────────────────────────────────────
   Zahmah Global Styles — Unified & Modern
   ──────────────────────────────────────────────── */

/* ── Base ── */
body {
    direction: rtl;
    text-align: right;
    font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
    background: #f8fafc;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Fonts ── */
.font_Cairo   { font-family: 'Cairo', sans-serif; }
.font_Amiri   { font-family: 'Amiri', serif; }
.font_Tajawal { font-family: 'Tajawal', sans-serif; }

@font-face {
    font-family: Cairo;
    src: url(../fonts/Cairo/Cairo-Regular.ttf);
    font-display: swap;
}
@font-face {
    font-family: Amiri;
    src: url(../fonts/Amiri/Amiri-Regular.ttf);
    font-display: swap;
}
@font-face {
    font-family: Tajawal;
    src: url(../fonts/Tajawal/Tajawal-Regular.ttf);
    font-display: swap;
}

/* ── Buttons ── */
.btn {
    margin: 2px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
}

/* ── web2py legacy ── */
#w2p_query_fields {
    float: right !important;
}

/* ────────────────────────────────────────────────
   Shared Component: Nav Cards (used in index, setup, reports)
   ──────────────────────────────────────────────── */
.nav-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding: 10px 0 20px;
}
.nav-card {
    border-radius: 14px;
    padding: 14px 10px 10px;
    text-align: center;
    text-decoration: none;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(0,0,0,.12);
    transition: transform .25s, box-shadow .25s, filter .25s;
    position: relative;
    overflow: hidden;
}
.nav-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 60%);
    pointer-events: none;
}
.nav-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 28px rgba(0,0,0,.2);
    filter: brightness(1.06);
    color: #fff;
}
.nav-card i {
    font-size: 1.6rem;
    position: relative;
    z-index: 1;
}
.nav-card span {
    font-size: .78rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

/* Nav card color variants */
.card-persons   { background: linear-gradient(135deg, #1e3a8a, #3b82f6); }
.card-payment   { background: linear-gradient(135deg, #065f46, #10b981); }
.card-reports   { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.card-revenues  { background: linear-gradient(135deg, #92400e, #f59e0b); }
.card-movements { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.card-files     { background: linear-gradient(135deg, #1d4ed8, #60a5fa); }
.card-messages  { background: linear-gradient(135deg, #9d174d, #f472b6); }
.card-settings  { background: linear-gradient(135deg, #374151, #6b7280); }
.card-login     { background: linear-gradient(135deg, #059669, #34d399); }
.card-member    { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.card-families  { background: linear-gradient(135deg, #0f766e, #2dd4bf); }
.card-config    { background: linear-gradient(135deg, #374151, #6b7280); }
.card-users     { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.card-groups    { background: linear-gradient(135deg, #92400e, #f59e0b); }

/* ── Section Title ── */
.section-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1e293b;
    border-right: 4px solid #3b82f6;
    padding-right: 12px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ────────────────────────────────────────────────
   Skeleton / Shimmer Loading
   ──────────────────────────────────────────────── */
@keyframes shimmer {
    0%   { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}
.skeleton {
    background: #e2e8f0;
    background-image: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.6s ease-in-out infinite;
    border-radius: 16px;
}

/* ────────────────────────────────────────────────
   Animations
   ──────────────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes float {
    0%,100% { transform: translateY(0); }
    50%     { transform: translateY(-10px); }
}
@keyframes pulse-glow {
    0%,100% { box-shadow: 0 0 0 0 rgba(37,99,235,0.4); }
    50%     { box-shadow: 0 0 0 12px rgba(37,99,235,0); }
}
.animate-fadeInUp {
    animation: fadeInUp 0.8s ease-out both;
}
.animate-float {
    animation: float 4s ease-in-out infinite;
}

/* ────────────────────────────────────────────────
   Breadcrumb
   ──────────────────────────────────────────────── */
.app-breadcrumb {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
.app-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    float: right;
    padding-left: 0.5rem;
    color: #94a3b8;
    content: var(--bs-breadcrumb-divider, "/");
}
.app-breadcrumb a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}
.app-breadcrumb a:hover {
    text-decoration: underline;
}

/* ────────────────────────────────────────────────
   Footer Enhanced
   ──────────────────────────────────────────────── */
.site-footer {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #cbd5e1;
    font-size: 0.85rem;
    padding-top: 2.5rem;
    padding-bottom: 1.5rem;
    margin-top: auto;
}
.site-footer h6 {
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.site-footer a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
    display: block;
    margin-bottom: 0.4rem;
}
.site-footer a:hover {
    color: #60a5fa;
}
.site-footer .footer-brand {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.site-footer .footer-brand i {
    color: #60a5fa;
}
.site-footer .footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 2rem;
    padding-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: #64748b;
}

/* ────────────────────────────────────────────────
   Notification Bell
   ──────────────────────────────────────────────── */
.notif-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    color: rgba(255,255,255,0.75);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
}
.notif-bell:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}
.notif-bell .notif-badge {
    position: absolute;
    top: -2px;
    left: -2px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 10px;
    border: 2px solid #0f172a;
    line-height: 1;
    min-width: 18px;
    text-align: center;
}

/* ────────────────────────────────────────────────
   Error Pages
   ──────────────────────────────────────────────── */
.error-page {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}
.error-page .error-code {
    font-size: 7rem;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, #1e3a8a, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}
.error-page .error-icon {
    font-size: 4rem;
    color: #94a3b8;
    margin-bottom: 1rem;
}
.error-page .error-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}
.error-page .error-desc {
    color: #64748b;
    margin-bottom: 1.5rem;
    max-width: 400px;
}

/* ────────────────────────────────────────────────
   Dashboard Utilities
   ──────────────────────────────────────────────── */
.dash-stat {
    border: none;
    border-radius: 20px;
    color: #fff;
    padding: 20px 22px;
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    transition: transform .2s, box-shadow .2s;
    position: relative;
    overflow: hidden;
}
.dash-stat::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    pointer-events: none;
}
.dash-stat:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,.18);
}
.dash-stat .ds-label {
    font-size: .75rem;
    opacity: .85;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}
.dash-stat .ds-val {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    position: relative;
    z-index: 1;
}
.dash-stat .ds-sub {
    font-size: .7rem;
    opacity: .75;
    margin-top: 4px;
    position: relative;
    z-index: 1;
}
.dash-stat .ds-icon {
    font-size: 2.2rem;
    opacity: .15;
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}
.dash-stat .ds-trend {
    font-size: 0.68rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(255,255,255,0.15);
}

.net-card {
    border-radius: 20px;
    padding: 20px 22px;
    color: #fff;
    background: linear-gradient(135deg, #1e3a8a, #7c3aed);
    box-shadow: 0 6px 20px rgba(0,0,0,.18);
    position: relative;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}
.net-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 50%);
    pointer-events: none;
}
.net-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,.25);
}

.dash-section {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,.06);
    padding: 22px;
    border: 1px solid #f1f5f9;
}

/* Timeline */
.timeline {
    position: relative;
    padding-right: 20px;
}
.timeline::before {
    content: '';
    position: absolute;
    right: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}
.timeline-item {
    position: relative;
    padding-right: 24px;
    padding-bottom: 16px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    right: 0;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #cbd5e1;
    background: #94a3b8;
}
.timeline-item.success::before { background: #22c55e; box-shadow: 0 0 0 2px #86efac; }
.timeline-item.warning::before { background: #f59e0b; box-shadow: 0 0 0 2px #fde68a; }
.timeline-item.danger::before  { background: #ef4444; box-shadow: 0 0 0 2px #fecaca; }
.timeline-item.info::before    { background: #3b82f6; box-shadow: 0 0 0 2px #bfdbfe; }
.timeline-item .time {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-bottom: 2px;
}
.timeline-item .text {
    font-size: 0.85rem;
    color: #334155;
    font-weight: 500;
}

/* Quick Actions */
.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.6rem 1.1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.quick-action-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    color: #1e3a8a;
}
.quick-action-btn i {
    font-size: 1rem;
}

/* ────────────────────────────────────────────────
   Outline Stat Cards (Dashboard)
   ──────────────────────────────────────────────── */
.outline-card {
  background: #fff;
  border: 2px solid var(--oc-color, #cbd5e1);
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.outline-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.outline-card .oc-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  background: var(--oc-bg, #f1f5f9);
  margin-bottom: 2px;
}
.outline-card .oc-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: #64748b;
}
.outline-card .oc-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.2;
}
.outline-card .oc-sub {
  font-size: 0.58rem;
  color: #94a3b8;
}

/* ────────────────────────────────────────────────
   Guest Landing Utilities
   ──────────────────────────────────────────────── */
.guest-hero {
    position: relative;
    min-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 40%, #3730a3 100%);
    border-radius: 0 0 40px 40px;
    margin: -1rem -0.75rem 0;
    padding: 2rem 1rem;
}
.guest-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(99,102,241,0.25) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(59,130,246,0.2) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(139,92,246,0.1) 0%, transparent 60%);
    pointer-events: none;
}
.guest-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
}

.hero-icon-wrap {
    width: 110px;
    height: 110px;
    margin: 0 auto 1.5rem;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.hero-icon-wrap i { font-size: 3.2rem; color: #60a5fa; }

.hero-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 200px;
    padding: 2rem 1.25rem;
    border-radius: 24px;
    text-decoration: none;
    color: #fff;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
    position: relative;
    overflow: hidden;
}
.hero-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #60a5fa, #a78bfa);
    transform: scaleX(0);
    transition: transform 0.35s ease;
}
.hero-card:hover::before { transform: scaleX(1); }
.hero-card:hover {
    transform: translateY(-8px) scale(1.03);
    background: rgba(255,255,255,0.14);
    box-shadow: 0 20px 48px rgba(0,0,0,0.3);
    color: #fff;
}
.hero-card i { font-size: 2.4rem; transition: transform 0.3s; }
.hero-card:hover i { transform: scale(1.15); }

/* Feature cards */
.feature-card {
    background: #fff;
    border-radius: 14px;
    padding: 10px 8px;
    text-align: center;
    border: 2px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}
.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
}
.feature-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 4px;
    font-size: 0.85rem;
    color: #fff;
}
.feature-card h6 {
    font-size: 0.72rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.1rem;
}
.feature-card p {
    font-size: 0.62rem;
    color: #64748b;
    margin: 0;
}

/* FAQ */
.faq-item {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 0.75rem;
    background: #fff;
}
.faq-btn {
    width: 100%;
    text-align: right;
    padding: 1rem 1.25rem;
    font-weight: 700;
    font-size: 0.92rem;
    color: #1e293b;
    background: #fff;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.faq-btn:hover { background: #f8fafc; }
.faq-btn:focus { box-shadow: none; }
.faq-btn i { transition: transform 0.3s; color: #3b82f6; }
.faq-btn[aria-expanded="true"] i { transform: rotate(180deg); }
.faq-body {
    padding: 0 1.25rem 1rem;
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.7;
}

/* ────────────────────────────────────────────────
   Responsive
   ──────────────────────────────────────────────── */
@media (max-width: 576px) {
    .guest-hero {
        border-radius: 0 0 24px 24px;
        min-height: 65vh;
    }
    .hero-icon-wrap { width: 80px; height: 80px; border-radius: 20px; }
    .hero-icon-wrap i { font-size: 2.2rem; }
    .hero-card { width: 160px; padding: 1.5rem 1rem; }
    .nav-cards-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .error-page .error-code { font-size: 4rem; }
    .site-footer { text-align: center; }
    .site-footer .footer-bottom { justify-content: center; }
}
