/* ===========================================================
   Saif Security - Luxurious Corporate Theme (Light + Dark)
   =========================================================== */

:root {
    --saif-primary: #0d2545;       /* deep navy - trust */
    --saif-primary-dark: #081a33;
    --saif-accent: #922B21;        /* deep crimson - matches logo */
    --saif-accent-soft: #c0392b;
    --saif-bg: #ffffff;
    --saif-bg-alt: #f6f8fb;
    --saif-surface: #ffffff;
    --saif-text: #142036;
    --saif-text-muted: #5a6b85;
    --saif-border: #e6ebf2;
    --saif-shadow: 0 10px 30px rgba(13, 37, 69, 0.08);
    --saif-shadow-lg: 0 20px 60px rgba(13, 37, 69, 0.12);
    --saif-radius: 14px;
    --saif-transition: all .25s ease;
}

[data-bs-theme="dark"] {
    --saif-primary: #e87c76;
    --saif-primary-dark: #c0392b;
    --saif-accent: #c0392b;
    --saif-accent-soft: #e74c3c;
    --saif-bg: #0a1424;
    --saif-bg-alt: #0f1c33;
    --saif-surface: #112038;
    --saif-text: #e9eef7;
    --saif-text-muted: #93a3bf;
    --saif-border: #1d2c47;
    --saif-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --saif-shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}
@media (min-width: 768px) { html { font-size: 16px; } }

body {
    font-family: 'Tajawal', 'Cairo', 'Segoe UI', sans-serif;
    background: var(--saif-bg);
    color: var(--saif-text);
    margin: 0;
    min-height: 100vh;
    transition: background-color .3s ease, color .3s ease;
    padding-top: 72px; /* fixed navbar height offset */
    overflow-x: hidden;
    width: 100%;
}

a { color: var(--saif-primary); text-decoration: none; transition: var(--saif-transition); }
a:hover { color: var(--saif-accent); }

/* Override Bootstrap warning to use accent */
.text-accent, .text-warning { color: var(--saif-accent) !important; }

h1,h2,h3,h4,h5,h6 { font-weight: 800; color: var(--saif-text); letter-spacing: -.01em; }

.section { padding: 90px 0; }
.section-sm { padding: 60px 0; }
.section-title { position: relative; margin-bottom: 1.25rem; font-size: clamp(1.75rem, 3vw, 2.6rem); }
.section-subtitle { color: var(--saif-text-muted); max-width: 720px; margin: 0 auto 3rem; font-size: 1.05rem; }
.section-eyebrow {
    display: inline-flex; align-items: center; gap: .5rem;
    color: var(--saif-accent); font-weight: 700; letter-spacing: .12em;
    text-transform: uppercase; font-size: .8rem; margin-bottom: .75rem;
}
.section-eyebrow::before {
    content: ""; width: 28px; height: 2px; background: var(--saif-accent);
}

/* ===== Navbar ===== */
.saif-navbar {
    background: rgba(255,255,255,.92);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--saif-border);
    transition: var(--saif-transition);
    padding: .85rem 0;
    z-index: 1030;
}
[data-bs-theme="dark"] .saif-navbar {
    background: rgba(10,20,36,.85);
}
.saif-navbar.scrolled { box-shadow: var(--saif-shadow); padding: .5rem 0; }

.saif-navbar .navbar-brand {
    display: flex; align-items: center; gap: .65rem;
    font-weight: 900; color: var(--saif-text); font-size: 1.25rem;
}
.saif-navbar .brand-mark {
    width: 44px; height: 44px; border-radius: 12px;
    background: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: var(--saif-shadow);
    overflow: hidden;
    border: 1px solid rgba(0,0,0,.08);
}
[data-bs-theme="dark"] .saif-navbar .brand-mark {
    background: #fff;
    border-color: rgba(255,255,255,.12);
}
.saif-navbar .brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; }
.saif-navbar .brand-mark i { font-size: 1.4rem; color: var(--saif-primary); }

.saif-navbar .nav-link {
    color: var(--saif-text) !important;
    font-weight: 600; padding: .55rem 1rem !important;
    position: relative; border-radius: 8px;
}
.saif-navbar .nav-link:hover,
.saif-navbar .nav-link.active { color: var(--saif-accent) !important; }
.saif-navbar .nav-link.active::after {
    content: ""; position: absolute; left: 1rem; right: 1rem; bottom: -2px;
    height: 2px; background: var(--saif-accent); border-radius: 2px;
}

.theme-toggle {
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--saif-bg-alt); color: var(--saif-text);
    border: 1px solid var(--saif-border);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; transition: var(--saif-transition);
}
.theme-toggle:hover { background: var(--saif-accent); color: #fff; border-color: var(--saif-accent); }

/* ===== Buttons ===== */
.btn-saif-primary {
    background: linear-gradient(135deg, var(--saif-primary), var(--saif-primary-dark));
    color: #fff; border: none; padding: .8rem 1.8rem;
    border-radius: 50px; font-weight: 700; letter-spacing: .02em;
    box-shadow: var(--saif-shadow); transition: var(--saif-transition);
}
.btn-saif-primary:hover { transform: translateY(-2px); box-shadow: var(--saif-shadow-lg); color:#fff; }
[data-bs-theme="dark"] .btn-saif-primary { color: #fff; }

.btn-saif-accent {
    background: var(--saif-accent); color: #fff; border: none;
    padding: .8rem 1.8rem; border-radius: 50px; font-weight: 700;
    box-shadow: var(--saif-shadow);
}
.btn-saif-accent:hover { background: var(--saif-accent-soft); color:#fff; transform: translateY(-2px); }

/* CTA specific button — white outline on dark bg */
.cta-band .btn-saif-primary {
    background: #fff;
    color: var(--saif-primary-dark);
}
.cta-band .btn-saif-primary:hover { background: rgba(255,255,255,.88); color: var(--saif-primary-dark); }

.btn-saif-outline {
    background: transparent; color: var(--saif-text);
    border: 1.5px solid var(--saif-border);
    padding: .75rem 1.6rem; border-radius: 50px; font-weight: 700;
    transition: var(--saif-transition);
    display: inline-flex; align-items: center; gap: .35rem;
}
.btn-saif-outline:hover { border-color: var(--saif-accent); color: var(--saif-accent); background: rgba(146,43,33,.07); }
.btn-saif-outline.btn-sm { padding: .42rem .9rem; font-size: .85rem; border-radius: 50px; }
/* Icon inside btn-saif-outline always visible */
.btn-saif-outline i, .btn-saif-primary i { pointer-events: none; }

/* ===== Hero ===== */
.saif-hero {
    position: relative;
    padding: 100px 0 90px;
    background:
        radial-gradient(1200px 600px at 90% -10%, rgba(146,43,33,.12), transparent 60%),
        radial-gradient(900px 500px at -10% 20%, rgba(13,37,69,.08), transparent 60%),
        var(--saif-bg);
    overflow: hidden;
}
@media (max-width: 767.98px) {
    .saif-hero { padding: 60px 0 60px; }
}
[data-bs-theme="dark"] .saif-hero {
    background:
        radial-gradient(1200px 600px at 90% -10%, rgba(201,164,76,.18), transparent 60%),
        radial-gradient(900px 500px at -10% 20%, rgba(230,207,143,.08), transparent 60%),
        var(--saif-bg);
}
.saif-hero h1 {
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    line-height: 1.2; margin-bottom: 1.25rem;
}
.saif-hero h1 .accent { color: var(--saif-accent); }
.saif-hero p.lead {
    color: var(--saif-text-muted); font-size: 1.15rem; max-width: 620px;
}
.hero-badge {
    display: inline-flex; align-items: center; gap: .5rem;
    background: var(--saif-bg-alt); color: var(--saif-text);
    border: 1px solid var(--saif-border); padding: .45rem 1rem;
    border-radius: 50px; font-weight: 600; font-size: .9rem;
    margin-bottom: 1.5rem;
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.18); }

/* ===== Hero Visual – Premium Frame ===== */
.hero-visual-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 480px;
    margin-inline: auto;
}

/* حلقات دوّارة خلف الصورة */
.hero-ring {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid;
    opacity: .18;
    animation: heroRingSpin 18s linear infinite;
}
.hero-ring-1 { width: 100%; height: 100%; border-color: var(--saif-accent); animation-duration: 18s; }
.hero-ring-2 { width: 80%;  height: 80%;  border-color: var(--saif-primary); animation-direction: reverse; animation-duration: 12s; }
.hero-ring-3 { width: 60%;  height: 60%;  border-color: var(--saif-accent); animation-duration: 8s; opacity: .12; }

@keyframes heroRingSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* الإطار الرئيسي للصورة */
.hero-img-frame {
    position: relative;
    width: 72%;
    height: 72%;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--saif-primary-dark), var(--saif-primary));
    box-shadow:
        0 0 0 8px rgba(201,164,76,.18),
        0 0 0 16px rgba(201,164,76,.08),
        0 32px 80px rgba(0,0,0,.35),
        inset 0 2px 8px rgba(255,255,255,.06);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: transform .4s ease, box-shadow .4s ease;
}
.hero-img-frame:hover {
    transform: scale(1.03);
    box-shadow:
        0 0 0 10px rgba(201,164,76,.25),
        0 0 0 20px rgba(201,164,76,.1),
        0 40px 100px rgba(0,0,0,.4),
        inset 0 2px 8px rgba(255,255,255,.08);
}
.hero-img-inner {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    display: block;
    padding: 6%;
}
.hero-icon-fallback {
    font-size: 6rem;
    color: rgba(255,255,255,.9);
}

/* بادجات عائمة */
.hero-badge-float {
    position: absolute;
    display: flex;
    align-items: center;
    gap: .45rem;
    background: var(--saif-surface);
    border: 1px solid var(--saif-border);
    border-radius: 40px;
    padding: .55rem 1.1rem;
    font-size: .8rem;
    font-weight: 700;
    color: var(--saif-accent);
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    z-index: 3;
    animation: heroFloatBob 4s ease-in-out infinite;
    white-space: nowrap;
}
.hero-badge-float i { font-size: 1rem; }
.hero-badge-float-1 { bottom: 12%; left: -4%; animation-delay: 0s; }
.hero-badge-float-2 { top: 10%; right: -4%; animation-delay: -2s; }

@keyframes heroFloatBob {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

/* === القديم (للصفحات الأخرى كـ About) === */
.hero-visual {
    position: relative; aspect-ratio: 4/5; max-width: 460px; width: 100%; margin-inline: auto;
    border-radius: 28px; overflow: hidden;
    background: linear-gradient(135deg, var(--saif-primary), var(--saif-primary-dark));
    box-shadow: var(--saif-shadow-lg);
}
.hero-visual::after {
    content:""; position:absolute; inset:0;
    background: radial-gradient(400px 200px at 30% 30%, rgba(201,164,76,.45), transparent 60%);
}
.hero-visual i {
    position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
    color: rgba(255,255,255,.95); font-size: 7rem;
}
.hero-visual img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }

.hero-stats {
    display:grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 2.5rem;
}
.hero-stats .stat {
    background: var(--saif-surface); border:1px solid var(--saif-border);
    border-radius: var(--saif-radius); padding: 1.25rem; text-align:center;
    box-shadow: var(--saif-shadow);
}
.hero-stats .stat .num { font-size: 1.6rem; font-weight: 900; color: var(--saif-accent); }
.hero-stats .stat .lbl { font-size: .85rem; color: var(--saif-text-muted); }

/* ===== Cards ===== */
.saif-card {
    background: var(--saif-surface);
    border: 1px solid var(--saif-border);
    border-radius: var(--saif-radius);
    padding: 2rem;
    transition: var(--saif-transition);
    height: 100%;
    box-shadow: var(--saif-shadow);
    position: relative; overflow: hidden;
}
.saif-card::before {
    content: ""; position: absolute; top: 0; right: 0;
    width: 100%; height: 4px; background: linear-gradient(90deg, var(--saif-accent), transparent);
    transform: scaleX(0); transform-origin: right; transition: transform .35s ease;
}
.saif-card:hover { transform: translateY(-6px); box-shadow: var(--saif-shadow-lg); border-color: var(--saif-accent-soft); }
.saif-card:hover::before { transform: scaleX(1); }
.saif-card .icon-wrap {
    width: 60px; height: 60px; border-radius: 16px;
    background: linear-gradient(135deg, var(--saif-primary), var(--saif-primary-dark));
    color: #fff; display:inline-flex; align-items:center; justify-content:center;
    font-size: 1.6rem; margin-bottom: 1.25rem;
}
[data-bs-theme="dark"] .saif-card .icon-wrap {
    background: linear-gradient(135deg, var(--saif-accent), var(--saif-accent-soft));
    color: #fff;
}
.saif-card h3, .saif-card h5 { font-size: 1.2rem; margin-bottom: .65rem; }
.saif-card p { color: var(--saif-text-muted); margin: 0; line-height: 1.7; }

/* Project Card */
.project-card {
    border-radius: var(--saif-radius);
    overflow: hidden; background: var(--saif-surface);
    border: 1px solid var(--saif-border); box-shadow: var(--saif-shadow);
    transition: var(--saif-transition); height: 100%;
}
.project-card:hover { transform: translateY(-6px); box-shadow: var(--saif-shadow-lg); }
.project-card .thumb {
    aspect-ratio: 16/10; background: linear-gradient(135deg, var(--saif-primary), var(--saif-primary-dark));
    position: relative; display:flex; align-items:center; justify-content:center; color:#fff; font-size:3rem;
}
.project-card .thumb img { width:100%; height:100%; object-fit:cover; }
.project-card .body { padding: 1.5rem; }
.project-card .cat {
    display: inline-block; background: var(--saif-bg-alt); color: var(--saif-accent);
    font-weight: 700; font-size: .8rem; padding: .25rem .75rem; border-radius: 50px;
    margin-bottom: .75rem;
}
.project-card h5 { margin-bottom: .35rem; }
.project-card .client { color: var(--saif-text-muted); font-size: .9rem; }

/* ===== Stat Strip ===== */
.stats-strip {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0d1b2a 0%, #1a2744 100%);
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 20px 60px rgba(0,0,0,.25), 0 0 0 1px rgba(255,255,255,.05);
    isolation: isolate;
}
.stats-strip::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 50% 100% at 0% 50%, rgba(146,43,33,.3), transparent 60%),
        radial-gradient(ellipse 40% 80% at 100% 50%, rgba(146,43,33,.15), transparent 55%);
    pointer-events: none;
}
.stats-strip::after {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}
.stats-strip .stats-inner {
    position: relative; z-index: 1;
    display: flex; flex-wrap: wrap;
}
.stats-strip .stat-item {
    flex: 1; min-width: 140px;
    padding: 2.75rem 1.5rem;
    text-align: center;
    position: relative;
}
.stats-strip .stat-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20%; bottom: 20%; left: 0;
    width: 1px;
    background: rgba(255,255,255,.08);
}
.stats-strip .stat-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; border-radius: 14px;
    background: rgba(146,43,33,.25);
    border: 1px solid rgba(146,43,33,.4);
    color: var(--saif-accent);
    font-size: 1.3rem;
    margin-bottom: .85rem;
}
.stats-strip .stat-num {
    font-size: 2.6rem; font-weight: 900;
    color: #fff;
    line-height: 1;
    margin-bottom: .3rem;
    letter-spacing: -1px;
}
.stats-strip .stat-num span { color: var(--saif-accent); }
.stats-strip .stat-lbl {
    color: rgba(255,255,255,.55);
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
}
@media (max-width: 575.98px) {
    .stats-strip .stat-item { min-width: 50%; padding: 2rem 1rem; }
    .stats-strip .stat-item:not(:last-child)::after { display: none; }
    .hero-visual-wrap { max-width: 300px; }
    .hero-badge-float { font-size: .72rem; padding: .4rem .8rem; }
    .hero-badge-float-1 { bottom: 6%; left: -2%; }
    .hero-badge-float-2 { top: 6%;  right: -2%; }
}

/* ===== Team Cards ===== */
.team-section { background: var(--saif-bg-alt); }

.team-card {
    background: var(--saif-surface);
    border: 1px solid var(--saif-border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--saif-shadow);
    transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
    height: 100%;
    position: relative;
}
.team-card::before {
    content: "";
    position: absolute;
    top: 0; right: 0;
    width: 100%; height: 4px;
    background: linear-gradient(90deg, var(--saif-accent), transparent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .35s ease;
    z-index: 1;
}
.team-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0,0,0,.14);
    border-color: var(--saif-accent-soft);
}
.team-card:hover::before { transform: scaleX(1); }

/* صورة العضو */
.team-card-photo {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: linear-gradient(145deg, var(--saif-primary-dark), var(--saif-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.team-card-photo img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s ease;
}
.team-card:hover .team-card-photo img { transform: scale(1.06); }
.team-card-photo i {
    font-size: 4.5rem;
    color: rgba(255,255,255,.7);
}
.team-card-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(10,20,50,.55) 0%, transparent 55%);
    pointer-events: none;
}

/* محتوى البطاقة */
.team-card-body {
    padding: 1.4rem 1.4rem 1.6rem;
    text-align: center;
}
.team-card-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--saif-primary-dark);
    margin-bottom: .3rem;
}
[data-bs-theme="dark"] .team-card-name { color: #e8edf5; }
.team-card-pos {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--saif-accent);
    margin-bottom: .6rem;
}
.team-card-bio {
    font-size: .86rem;
    color: var(--saif-text-muted);
    line-height: 1.65;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer */
.saif-footer {
    background: var(--saif-primary-dark); color: #cfd8e8;
    padding: 70px 0 30px; margin-top: 80px;
}
[data-bs-theme="dark"] .saif-footer { background: #06101f; }
.saif-footer h5 { color: #fff; margin-bottom: 1.25rem; font-size: 1.05rem; }
.saif-footer a { color: #cfd8e8; }
.saif-footer a:hover { color: var(--saif-accent); }
.saif-footer .social a {
    display: inline-flex; width: 38px; height: 38px; align-items:center; justify-content:center;
    background: rgba(255,255,255,.06); border-radius: 50%; margin-inline-end: .5rem;
}
.saif-footer .social a:hover { background: var(--saif-accent); color:#0a1424; }
.saif-footer hr { border-color: rgba(255,255,255,.08); }
.saif-footer .copy { color: #97a3bb; font-size: .9rem; }

/* ===== CTA Band ===== */
.cta-band {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(135deg, #0d1b2a 0%, #1a2744 60%, #0f1e30 100%);
    border-radius: 20px;
    color: #fff;
    padding: 4rem 2rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.25), 0 0 0 1px rgba(255,255,255,.05);
}
.cta-band::before {
    content: "";
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 55% 90% at 5% 50%, rgba(146,43,33,.38), transparent 65%),
        radial-gradient(ellipse 40% 70% at 95% 50%, rgba(146,43,33,.2), transparent 60%);
    pointer-events: none;
}
.cta-band::after {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}
/* Accent top line */
.cta-band .cta-accent-line {
    position: absolute;
    top: 0; left: 15%; right: 15%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--saif-accent), transparent);
}
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 {
    color: #fff;
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    font-weight: 900;
    margin-bottom: .75rem;
    text-shadow: 0 2px 16px rgba(0,0,0,.3);
}
.cta-band p  {
    color: rgba(255,255,255,.68);
    margin-bottom: 2rem;
    font-size: 1.05rem;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}
[data-bs-theme="dark"] .cta-band {
    box-shadow: 0 20px 60px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.06);
}

/* Forms */
.form-control, .form-select {
    background: var(--saif-surface); border: 1.5px solid var(--saif-border);
    color: var(--saif-text); border-radius: 12px; padding: .75rem 1rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--saif-accent);
    box-shadow: 0 0 0 .2rem rgba(146,43,33,.18);
    background: var(--saif-surface); color: var(--saif-text);
}

/* Alerts */
.alert-saif { background: rgba(34,197,94,.1); color: #16a34a; border:1px solid rgba(34,197,94,.25); border-radius: 12px; padding: 1rem 1.25rem; }

/* Page header */
/* ===== Page Hero — luxury redesign ===== */
.page-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0d1b2a 0%, #1a2744 55%, #0f1e30 100%);
    color: #fff;
    padding: 110px 0 80px;
    text-align: center;
    isolation: isolate;
}

/* Decorative geometric shapes */
.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 700px 400px at 110% -10%, rgba(146,43,33,.35) 0%, transparent 60%),
        radial-gradient(ellipse 500px 350px at -10% 110%, rgba(146,43,33,.2) 0%, transparent 55%);
    z-index: 0;
}

/* Animated grid pattern */
.page-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
    background-size: 48px 48px;
    z-index: 0;
}

/* Accent bottom line */
.page-hero .page-hero-inner {
    position: relative;
    z-index: 1;
}

/* Glowing accent orb top-right */
.page-hero .hero-orb {
    position: absolute;
    top: -80px;
    right: -80px;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(146,43,33,.45) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}
.page-hero .hero-orb-2 {
    position: absolute;
    bottom: -60px;
    left: 5%;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(146,43,33,.2) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

/* Bottom accent bar */
.page-hero-accent {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--saif-accent), transparent);
    z-index: 2;
}

.page-hero h1 {
    color: #fff;
    font-size: clamp(2.2rem, 4.5vw, 3.2rem);
    font-weight: 900;
    margin-bottom: .85rem;
    text-shadow: 0 2px 20px rgba(0,0,0,.4);
    letter-spacing: -.5px;
}
.page-hero p {
    color: rgba(255,255,255,.75);
    max-width: 660px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.8;
}
.page-hero .breadcrumb-saif {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: rgba(255,255,255,.5);
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    padding: .3rem .9rem;
    border-radius: 50px;
    backdrop-filter: blur(4px);
}
.page-hero .breadcrumb-saif::before {
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--saif-accent);
    flex-shrink: 0;
}

/* Partner logo */
.partner-logo {
    background: var(--saif-surface); border:1px solid var(--saif-border);
    border-radius: var(--saif-radius); padding: 1.5rem; text-align:center;
    min-height: 140px; height: auto;
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.6rem;
    transition: var(--saif-transition); font-weight:700; color: var(--saif-text-muted);
}
.partner-logo:hover { border-color: var(--saif-accent); color: var(--saif-text); transform: translateY(-3px); }
.partner-logo img { max-height: 75px; max-width: 100%; object-fit:contain; }
.partner-logo a { display:flex; flex-direction:column; align-items:center; gap:.6rem; text-decoration:none; color:inherit; width:100%; }
.partner-name { font-size:.82rem; font-weight:600; color: var(--saif-text-muted); text-align:center; margin-top:.25rem; }

/* Job card */
.job-card {
    background: var(--saif-surface); border:1px solid var(--saif-border);
    border-radius: var(--saif-radius); padding: 1.75rem; box-shadow: var(--saif-shadow);
    transition: var(--saif-transition);
}
.job-card:hover { border-color: var(--saif-accent); transform: translateY(-3px); }
.job-meta { color: var(--saif-text-muted); font-size: .9rem; }
.job-meta i { color: var(--saif-accent); margin-inline-end: .25rem; }

/* ===== Admin Shell ===== */
.admin-shell {
    display: flex;
    min-height: 100vh;
    background: var(--saif-bg-alt);
    align-items: stretch;
    overflow: hidden;
    padding-top: 0 !important;
}

/* ---- Desktop Sidebar ---- */
.admin-sidebar {
    width: 250px;
    flex-shrink: 0;
    background: #1a2236;
    color: #cfd8e8;
    padding: 1.25rem 1rem;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 100;
}
.admin-sidebar .brand {
    color: #fff;
    font-weight: 900;
    font-size: 1rem;
    padding: .5rem .75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: .75rem;
}
.admin-sidebar .brand i { color: var(--saif-accent); font-size: 1.4rem; }

/* ---- Nav links (shared desktop + offcanvas) ---- */
.admin-nav { display: flex; flex-direction: column; }
.admin-nav a {
    color: #cfd8e8;
    padding: .65rem 1rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: .2rem;
    font-weight: 600;
    font-size: .92rem;
    transition: var(--saif-transition);
    text-decoration: none;
}
.admin-nav a i { font-size: 1.1rem; flex-shrink: 0; color: inherit; }
.admin-nav a:hover,
.admin-nav a.active {
    background: rgba(255,255,255,.08);
    color: #fff;
}
.admin-nav a.active {
    background: rgba(var(--saif-accent-rgb, 146,43,33),.25);
    color: #fff;
    border-right: 3px solid var(--saif-accent);
}

/* ---- Offcanvas sidebar ---- */
.admin-offcanvas {
    background: #1a2236 !important;
    width: 260px !important;
    max-width: 85vw !important;
}
.admin-offcanvas .admin-nav a { color: #cfd8e8; }
/* Ensure offcanvas renders above everything */
.offcanvas { z-index: 1055; }

/* ---- Content area ---- */
.admin-content {
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    overflow-x: hidden;
    margin-right: 250px;
}
@media (max-width: 991.98px) {
    .admin-content { margin-right: 0; }
}
@media (max-width: 575.98px) {
    .admin-content { padding: .75rem; }
}

/* ---- Topbar ---- */
.admin-topbar {
    background: var(--saif-surface);
    border: 1px solid var(--saif-border);
    border-radius: var(--saif-radius);
    padding: .85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--saif-shadow);
    margin-bottom: 1.25rem;
    flex-shrink: 0;
}

/* ---- Body scroll area ---- */
.admin-body { flex: 1; min-width: 0; }

/* ---- Cards / KPI ---- */
.admin-card {
    background: var(--saif-surface);
    border: 1px solid var(--saif-border);
    border-radius: var(--saif-radius);
    padding: 1.5rem;
    box-shadow: var(--saif-shadow);
}
.kpi-card { display: flex; align-items: center; gap: 1rem; }
.kpi-card .kpi-icon {
    width: 54px; height: 54px;
    border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.4rem; flex-shrink: 0;
}
.kpi-card .kpi-value { font-size: 1.6rem; font-weight: 900; color: var(--saif-text); line-height: 1; }
.kpi-card .kpi-label { color: var(--saif-text-muted); font-size: .88rem; margin-top: .2rem; }
/* legacy aliases */
.kpi-card .icon { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, var(--saif-primary), var(--saif-primary-dark)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
[data-bs-theme="dark"] .kpi-card .icon { background: linear-gradient(135deg, var(--saif-accent), var(--saif-accent-soft)); color: #fff; }
.kpi-card .num { font-size: 1.5rem; font-weight: 900; color: var(--saif-text); line-height: 1; }
.kpi-card .lbl { color: var(--saif-text-muted); font-size: .88rem; }

/* ---- Tables — responsive ---- */
.table-responsive-admin {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--saif-radius);
}
table.saif-table { width: 100%; min-width: 520px; }
table.saif-table th,
table.saif-table td {
    padding: .8rem .9rem;
    border-bottom: 1px solid var(--saif-border);
    text-align: start;
    white-space: nowrap;
}
table.saif-table thead th {
    background: var(--saif-bg-alt);
    color: var(--saif-text);
    font-weight: 700;
    font-size: .85rem;
}
table.saif-table tbody tr:hover { background: var(--saif-bg-alt); }
/* Keep badges and buttons fully visible on row hover */
table.saif-table tbody tr:hover .badge-saif,
table.saif-table tbody tr:hover .badge-soft,
table.saif-table tbody tr:hover .btn-saif-outline,
table.saif-table tbody tr:hover .btn-saif-primary { opacity: 1; }

/* Force badge icon/text color to stay white regardless of theme or hover */
.badge-saif,
.badge-saif i,
table.saif-table tbody tr:hover .badge-saif,
table.saif-table tbody tr:hover .badge-saif i { color: #fff !important; }

/* Wrap long text cells only */
table.saif-table td.wrap { white-space: normal; min-width: 160px; }

/* ---- Badges ---- */
.badge-saif { background: var(--saif-accent); color: #fff; font-weight: 700; padding: .38rem .75rem; border-radius: 50px; white-space: nowrap; }
.badge-soft  { background: var(--saif-bg-alt); color: var(--saif-text); border: 1px solid var(--saif-border); padding: .35rem .7rem; border-radius: 50px; font-weight: 600; white-space: nowrap; }

/* ---- Mobile table fallback — card style ---- */
@media (max-width: 575.98px) {
    table.saif-table,
    table.saif-table thead,
    table.saif-table tbody,
    table.saif-table th,
    table.saif-table td,
    table.saif-table tr { display: block; }

    table.saif-table thead tr { display: none; }

    table.saif-table tbody tr {
        background: var(--saif-surface);
        border: 1px solid var(--saif-border);
        border-radius: 12px;
        margin-bottom: .75rem;
        padding: .75rem;
    }

    table.saif-table td {
        border: none;
        padding: .3rem .5rem;
        white-space: normal;
        font-size: .9rem;
        display: flex;
        align-items: center;
        gap: .5rem;
    }

    table.saif-table td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: .8rem;
        color: var(--saif-text-muted);
        min-width: 90px;
        flex-shrink: 0;
    }

    table.saif-table td:last-child { border-bottom: none; }
    .admin-card.p-0 { padding: .5rem !important; }
}

.scroll-fade { opacity: 0; transform: translateY(20px); transition: opacity .8s ease, transform .8s ease; }

/* ===== Auth (Login) ===== */
.auth-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 20% 20%, rgba(201,164,76,.10), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(13,37,69,.08), transparent 40%),
        var(--saif-bg-alt);
    padding-top: 0 !important;
}
.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
}
.auth-section {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 60px 0;
}
.auth-card {
    background: var(--saif-surface);
    border: 1px solid var(--saif-border);
    border-radius: 20px;
    padding: 3rem 2.5rem;
    box-shadow: var(--saif-shadow-lg);
    position: relative;
    overflow: hidden;
}
.auth-card::before {
    content: "";
    position: absolute; top: 0; inset-inline-start: 0; right:0;
    height: 5px;
    background: linear-gradient(90deg, var(--saif-accent), var(--saif-primary), var(--saif-accent));
}
.auth-icon {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--saif-primary), var(--saif-primary-dark));
    color: var(--saif-accent);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 2.2rem;
    box-shadow: 0 10px 30px rgba(13,37,69,.25);
}
.auth-title { font-weight: 800; color: var(--saif-text); margin: 0; }
.auth-subtitle { color: var(--saif-text-muted); margin-top: .35rem; font-size: .95rem; }
.auth-card .form-floating > label { color: var(--saif-text-muted); }
.auth-card .form-control {
    border-radius: 12px;
    padding: 1rem .85rem;
    border: 1px solid var(--saif-border);
    background: var(--saif-bg);
}
.auth-card .form-control:focus { border-color: var(--saif-accent); }
[data-bs-theme="dark"] .auth-body { background:
    radial-gradient(circle at 20% 20%, rgba(201,164,76,.12), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(255,255,255,.04), transparent 40%),
    var(--saif-bg-alt);
}
.scroll-fade.visible { opacity: 1; transform: translateY(0); }
.scroll-fade.in-view { opacity: 1; transform: none; }

/* ===== Users Management ===== */
.user-avatar-sm {
    width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--saif-primary), var(--saif-accent));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.1rem;
}
.role-check-item {
    display: flex; align-items: center;
    border: 1px solid var(--saif-border);
    border-radius: 10px; padding: .6rem .85rem;
    cursor: pointer; transition: var(--saif-transition);
    background: var(--saif-bg);
    user-select: none;
}
.role-check-item:hover { border-color: var(--saif-accent); background: rgba(146,43,33,.05); }
.role-check-item.checked {
    border-color: var(--saif-accent);
    background: rgba(146,43,33,.08);
    color: var(--saif-accent);
}
.role-check-item input[type="checkbox"] { pointer-events: none; accent-color: var(--saif-accent); }
.role-admin-item {
    border-width: 2px;
    background: rgba(146,43,33,.04);
}
.role-admin-item.checked {
    border-color: var(--saif-accent);
    background: rgba(146,43,33,.12);
}
.role-check-item.role-disabled {
    opacity: .4;
    cursor: not-allowed;
    pointer-events: none;
}

