/* =========================================
   عز للتصميم والبرمجة (Ezz Design & Programming) - Main Stylesheet
   Fully Responsive: Mobile / Tablet / Desktop
   ========================================= */

/* Force Western Arabic numerals (0-9) everywhere */
* { font-variant-numeric: normal !important; -webkit-font-feature-settings: "locl" 0; font-feature-settings: "locl" 0; }

:root {
    --ca-primary: #14283f;
    --ca-secondary: #1f8fcc;
    --ca-accent: #f59e0b;
    --ca-success: #10b981;
    --ca-danger: #ef4444;
    --ca-warning: #f59e0b;
    --ca-info: #3b82f6;
    --ca-light: #f8fafc;
    --ca-dark: #0f172a;
    --ca-gray: #64748b;
    --ca-border: #e2e8f0;
    --ca-sidebar-width: 260px;
    --ca-header-height: 66px;
    --ca-content-padding: 1.5rem;
    --ca-font-ar: 'Cairo', 'Tajawal', sans-serif;
    --ca-font-en: 'Inter', 'Segoe UI', sans-serif;
    --ca-radius: 12px;
    --ca-radius-sm: 8px;
    --ca-shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
    --ca-shadow-lg: 0 4px 24px rgba(0,0,0,.12);
    --ca-transition: all .25s ease;
}

/* Tablet */
@media (max-width: 991.98px) {
    :root {
        --ca-header-height: 62px;
        --ca-content-padding: 1rem;
    }
}

/* Mobile */
@media (max-width: 575.98px) {
    :root {
        --ca-header-height: 58px;
        --ca-content-padding: .875rem;
        --ca-radius: 10px;
    }
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; }

@media (max-width: 575.98px) {
    html { font-size: 14.5px; }
}

body {
    font-family: var(--ca-font-ar);
    color: #1e293b;
    background: var(--ca-light);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

body[dir="ltr"] { font-family: var(--ca-font-en); }

/* ---- Typography ---- */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.3; color: var(--ca-dark); }
a { color: var(--ca-secondary); text-decoration: none; transition: var(--ca-transition); }
a:hover { color: var(--ca-primary); }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--ca-secondary); }

/* =========================================
   LANDING PAGE
   ========================================= */

/* Navbar */
.ca-navbar {
    background: rgba(26, 41, 66, .97);
    backdrop-filter: blur(12px);
    padding: 0;
    min-height: var(--ca-header-height);
    box-shadow: 0 2px 20px rgba(0,0,0,.15);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.ca-navbar .navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff !important;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

@media (max-width: 575.98px) {
    .ca-navbar .navbar-brand { font-size: 1.2rem; }
}

.ca-navbar .navbar-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--ca-secondary), #4fc3f7);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
}

.ca-navbar .nav-link {
    color: rgba(255,255,255,.8) !important;
    padding: .45rem .9rem !important;
    font-weight: 500;
    transition: var(--ca-transition);
    border-radius: 7px;
    font-size: .95rem;
    min-height: 44px;
    display: flex;
    align-items: center;
}

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

/* Collapse menu on mobile */
@media (max-width: 991.98px) {
    .ca-navbar .navbar-collapse {
        padding: .75rem 0 1rem;
        border-top: 1px solid rgba(255,255,255,.08);
        margin-top: .25rem;
    }
    .ca-navbar .nav-link { padding: .6rem 1rem !important; }
}

/* Hero Section */
.ca-hero {
    min-height: calc(100vh - var(--ca-header-height));
    background: linear-gradient(135deg, var(--ca-primary) 0%, #1e3a5f 50%, #1a4a7a 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 3rem 0;
}

@media (max-width: 767.98px) {
    .ca-hero {
        min-height: auto;
        padding: 3.5rem 0 2.5rem;
        text-align: center;
    }
}

@media (max-width: 575.98px) {
    .ca-hero { padding: 2.5rem 0 2rem; }
}

.ca-hero::before {
    content: '';
    position: absolute;
    width: clamp(250px, 50vw, 600px);
    height: clamp(250px, 50vw, 600px);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(31,143,204,.3) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    animation: float 8s ease-in-out infinite;
}

.ca-hero::after {
    content: '';
    position: absolute;
    width: clamp(200px, 35vw, 400px);
    height: clamp(200px, 35vw, 400px);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245,158,11,.15) 0%, transparent 70%);
    bottom: -80px;
    left: -80px;
    animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.04); }
}

.ca-hero .hero-content { position: relative; z-index: 2; }

.ca-hero h1 {
    font-size: clamp(1.75rem, 4.5vw, 3.5rem);
    font-weight: 900;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 1.25rem;
}

.ca-hero h1 span {
    background: linear-gradient(135deg, var(--ca-accent), #fb923c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ca-hero p {
    color: rgba(255,255,255,.8);
    font-size: clamp(.9rem, 2vw, 1.1rem);
    max-width: 540px;
}

@media (max-width: 767.98px) {
    .ca-hero p { margin-inline: auto; }
}

.ca-hero-visual { position: relative; z-index: 2; }

.ca-hero-card {
    background: rgba(255,255,255,.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 18px;
    padding: clamp(1.25rem, 3vw, 2rem);
    color: #fff;
}

/* Buttons */
.btn-ca-primary {
    background: linear-gradient(135deg, var(--ca-secondary), #156ca6);
    border: none;
    color: #fff;
    padding: .7rem 1.75rem;
    border-radius: 9px;
    font-weight: 600;
    font-size: .92rem;
    transition: var(--ca-transition);
    box-shadow: 0 4px 15px rgba(31,143,204,.4);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-ca-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(31,143,204,.5);
    color: #fff;
}

@media (max-width: 575.98px) {
    .btn-ca-primary { padding: .65rem 1.4rem; font-size: .88rem; }
}

.btn-ca-outline {
    background: transparent;
    border: 2px solid rgba(255,255,255,.4);
    color: #fff;
    padding: .68rem 1.75rem;
    border-radius: 9px;
    font-weight: 600;
    transition: var(--ca-transition);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-ca-outline:hover {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.8);
    color: #fff;
    transform: translateY(-2px);
}

.btn-ca-accent {
    background: linear-gradient(135deg, var(--ca-accent), #d97706);
    border: none;
    color: #fff;
    padding: .7rem 1.75rem;
    border-radius: 9px;
    font-weight: 600;
    transition: var(--ca-transition);
    box-shadow: 0 4px 15px rgba(245,158,11,.4);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-ca-accent:hover { transform: translateY(-2px); color: #fff; }

/* Stats — Landing page style (centered, icon+number+label stacked) */
.ca-stat-card {
    background: #fff;
    border-radius: var(--ca-radius);
    padding: 1.25rem;
    box-shadow: var(--ca-shadow);
    transition: var(--ca-transition);
    border: 1px solid var(--ca-border);
    display: flex;
    align-items: center;
    gap: 1rem;
}

@media (min-width: 768px) {
    .ca-stat-card { padding: 1.4rem 1.5rem; }
}

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

/* Icon inside ca-stat-card */
.ca-stat-card .ca-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .ca-stat-card .ca-stat-icon { width: 52px; height: 52px; font-size: 1.5rem; }
}

/* Body */
.ca-stat-card .ca-stat-body { flex: 1; min-width: 0; }

.ca-stat-card .ca-stat-value {
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 900;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ca-stat-card .ca-stat-label {
    font-size: .8rem;
    color: var(--ca-gray);
    margin-top: .2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Backward compat — old .stat-number / .stat-label selectors */
.ca-stat-card .stat-number {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 900;
    color: var(--ca-secondary);
    line-height: 1;
}

.ca-stat-card .stat-label { color: var(--ca-gray); font-size: .88rem; margin-top: .25rem; }

/* Color variants for ca-stat-card */
.ca-stat-card.ca-stat-primary { background: linear-gradient(135deg, #eff6ff, #dbeafe); }
.ca-stat-card.ca-stat-primary .ca-stat-icon { background: rgba(31,143,204,.12); color: var(--ca-secondary); }
.ca-stat-card.ca-stat-primary .ca-stat-value { color: var(--ca-secondary); }

.ca-stat-card.ca-stat-success { background: linear-gradient(135deg, #f0fdf4, #dcfce7); }
.ca-stat-card.ca-stat-success .ca-stat-icon { background: rgba(16,185,129,.12); color: var(--ca-success); }
.ca-stat-card.ca-stat-success .ca-stat-value { color: var(--ca-success); }

.ca-stat-card.ca-stat-warning { background: linear-gradient(135deg, #fffbeb, #fef3c7); }
.ca-stat-card.ca-stat-warning .ca-stat-icon { background: rgba(245,158,11,.12); color: var(--ca-warning); }
.ca-stat-card.ca-stat-warning .ca-stat-value { color: var(--ca-warning); }

.ca-stat-card.ca-stat-danger { background: linear-gradient(135deg, #fef2f2, #fee2e2); }
.ca-stat-card.ca-stat-danger .ca-stat-icon { background: rgba(239,68,68,.12); color: var(--ca-danger); }
.ca-stat-card.ca-stat-danger .ca-stat-value { color: var(--ca-danger); }

/* Section */
.ca-section { padding: clamp(3rem, 8vw, 80px) 0; }
.ca-section-alt { background: #f1f5f9; }

.ca-section-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(31,143,204,.1);
    color: var(--ca-secondary);
    padding: .35rem .9rem;
    border-radius: 99px;
    font-size: .83rem;
    font-weight: 600;
    margin-bottom: .875rem;
    border: 1px solid rgba(31,143,204,.2);
}

.ca-section-title {
    font-size: clamp(1.4rem, 3vw, 2.25rem);
    font-weight: 900;
    color: var(--ca-dark);
}

.ca-section-title span { color: var(--ca-secondary); }

/* Package Cards */
.ca-package-card {
    background: #fff;
    border-radius: 18px;
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 2px solid var(--ca-border);
    transition: var(--ca-transition);
    position: relative;
    overflow: hidden;
    height: 100%;
}

.ca-package-card:hover {
    border-color: var(--ca-secondary);
    transform: translateY(-6px);
    box-shadow: var(--ca-shadow-lg);
}

.ca-package-card.featured {
    border-color: var(--ca-secondary);
    background: linear-gradient(160deg, #eff6ff 0%, #fff 60%);
}

.ca-package-card .package-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: linear-gradient(135deg, var(--ca-secondary), #156ca6);
    color: #fff;
    padding: .25rem .75rem;
    border-radius: 99px;
    font-size: .78rem;
    font-weight: 700;
}

.ca-package-card.featured .package-badge {
    background: linear-gradient(135deg, var(--ca-accent), #d97706);
}

.ca-package-card .package-price {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 900;
    color: var(--ca-primary);
    line-height: 1;
}

.ca-package-card .package-price span { font-size: .95rem; font-weight: 400; color: var(--ca-gray); }

.ca-package-card .package-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: .375rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: .88rem;
}

.ca-package-card .package-feature:last-child { border-bottom: none; }

.ca-package-card .feature-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(16,185,129,.1);
    color: var(--ca-success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    flex-shrink: 0;
}

/* Testimonials */
.ca-testimonial-card {
    background: #fff;
    border-radius: 15px;
    padding: clamp(1.1rem, 2.5vw, 1.75rem);
    box-shadow: var(--ca-shadow);
    border: 1px solid var(--ca-border);
    transition: var(--ca-transition);
    height: 100%;
}

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

.ca-testimonial-card .quote-icon {
    font-size: 2.25rem;
    color: var(--ca-secondary);
    opacity: .2;
    line-height: 1;
    font-family: Georgia, serif;
}

.ca-testimonial-card .stars { color: var(--ca-accent); }

.ca-testimonial-card .client-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ca-secondary), #4fc3f7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: .95rem;
    flex-shrink: 0;
}

/* FAQ */
.ca-faq-item {
    background: #fff;
    border-radius: 11px;
    border: 1px solid var(--ca-border);
    margin-bottom: .625rem;
    overflow: hidden;
    transition: var(--ca-transition);
}

.ca-faq-item:hover { border-color: var(--ca-secondary); }

.ca-faq-header {
    padding: 1rem 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-weight: 600;
    font-size: .92rem;
    color: var(--ca-dark);
    transition: var(--ca-transition);
    min-height: 52px;
}

@media (max-width: 575.98px) {
    .ca-faq-header { padding: .875rem 1rem; font-size: .88rem; }
}

.ca-faq-header:hover { color: var(--ca-secondary); }
.ca-faq-header.active { color: var(--ca-secondary); }

.ca-faq-body {
    padding: 0 1.25rem;
    color: var(--ca-gray);
    font-size: .9rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease, padding .35s ease;
}

.ca-faq-body.open { max-height: 300px; padding-bottom: 1rem; }

.ca-faq-icon { transition: transform .3s ease; }
.ca-faq-header.active .ca-faq-icon { transform: rotate(180deg); }

/* Footer */
.ca-footer {
    background: #0b1526;
    color: rgba(255,255,255,.6);
    padding: 64px 0 0;
}

.ca-footer-brand-box {
    width: 56px; height: 56px;
    background: var(--ca-secondary);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 900; font-size: 1.3rem;
    flex-shrink: 0;
}

.ca-footer-brand-name {
    color: #fff;
    font-size: 1.9rem;
    font-weight: 900;
    letter-spacing: -.5px;
    line-height: 1;
}

.ca-footer-desc {
    font-size: .88rem;
    line-height: 1.75;
    color: rgba(255,255,255,.5);
    max-width: 300px;
    margin-top: .75rem;
}

.ca-footer-heading {
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 1.1rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.ca-footer a.ca-footer-link {
    color: rgba(255,255,255,.55);
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: .55rem;
    font-size: .88rem;
    text-decoration: none;
    transition: color .18s, padding-right .18s;
}

.ca-footer a.ca-footer-link::before {
    content: '';
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--ca-secondary);
    flex-shrink: 0;
    opacity: .5;
    transition: opacity .18s;
}

.ca-footer a.ca-footer-link:hover { color: #fff; padding-right: 4px; }
.ca-footer a.ca-footer-link:hover::before { opacity: 1; }

.ca-footer-socials {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

.ca-footer-social-btn {
    width: 42px; height: 42px;
    border-radius: 11px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.1);
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.7);
    font-size: 1.05rem;
    text-decoration: none;
    transition: background .2s, color .2s, transform .2s, border-color .2s;
}

.ca-footer-social-btn:hover {
    background: var(--ca-secondary);
    border-color: var(--ca-secondary);
    color: #fff;
    transform: translateY(-3px);
}

.ca-footer-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,.07);
    margin: 48px 0 0;
}

.ca-footer-bottom {
    padding: 18px 0;
    font-size: .82rem;
    color: rgba(255,255,255,.35);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
}

/* =========================================
   DASHBOARD LAYOUT
   ========================================= */

.ca-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.ca-sidebar {
    width: var(--ca-sidebar-width);
    background: var(--ca-primary);
    height: 100vh;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 200;
    transition: transform .3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
}

[dir="ltr"] .ca-sidebar { right: auto; left: 0; }

.ca-sidebar-brand {
    padding: 1.1rem .5rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.ca-sidebar-brand .brand-logo {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--ca-secondary), #4fc3f7);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    flex-shrink: 0;
}

.ca-sidebar-brand .brand-name { color: #fff; font-size: 1.2rem; font-weight: 800; }
.ca-sidebar-brand .brand-sub { color: rgba(255,255,255,.5); font-size: .68rem; display: block; }

/* Sidebar Nav */
.ca-sidebar-nav { padding: .75rem 0; flex: 1; }

.ca-nav-section { padding: .4rem 1.1rem .2rem; }
.ca-nav-section-title {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,.35);
}

.ca-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: .6rem 1.1rem;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    border-radius: 0;
    transition: var(--ca-transition);
    margin: 1px 0;
    font-size: .9rem;
    position: relative;
    min-height: 44px;
}

.ca-sidebar-link:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}

.ca-sidebar-link.active {
    background: rgba(31,143,204,.25);
    color: #fff;
    border-inline-end: 3px solid var(--ca-secondary);
}

.ca-sidebar-link .ca-nav-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: rgba(255,255,255,.06);
    font-size: .88rem;
    flex-shrink: 0;
    transition: var(--ca-transition);
}

.ca-sidebar-link:hover .ca-nav-icon,
.ca-sidebar-link.active .ca-nav-icon {
    background: rgba(31,143,204,.4);
    color: var(--ca-secondary);
}

.ca-sidebar-link .ca-nav-badge {
    margin-inline-start: auto;
    background: var(--ca-danger);
    color: #fff;
    font-size: .68rem;
    padding: .12rem .45rem;
    border-radius: 99px;
    font-weight: 700;
}

/* Sidebar submenu */
.ca-sidebar-submenu {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
    background: rgba(0,0,0,.15);
}

.ca-sidebar-submenu.open { max-height: 400px; }

.ca-sidebar-submenu .ca-sidebar-link {
    padding-inline-start: 2.75rem;
    font-size: .85rem;
}

/* Main Content */
/* margin-inline-start = margin-right in RTL (sidebar is on the right)
   margin-inline-start = margin-left in LTR (sidebar is on the left)
   Both cases are correct with this single rule */
.ca-main {
    margin-inline-start: var(--ca-sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Top Header */
.ca-topbar {
    height: var(--ca-header-height);
    background: #fff;
    border-bottom: 1px solid var(--ca-border);
    display: flex;
    align-items: center;
    padding: 0 var(--ca-content-padding);
    gap: .75rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 8px rgba(0,0,0,.06);
    flex-shrink: 0;
}

.ca-topbar .topbar-left { flex: 1; }

.ca-topbar .topbar-right {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.ca-topbar-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: #f8fafc;
    border: 1px solid var(--ca-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ca-gray);
    cursor: pointer;
    transition: var(--ca-transition);
    flex-shrink: 0;
}

.ca-topbar-btn:hover { background: var(--ca-secondary); color: #fff; border-color: var(--ca-secondary); }

.ca-topbar-btn .badge-dot {
    position: absolute;
    top: -3px;
    left: -3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--ca-danger);
    border: 2px solid #fff;
    font-size: .52rem;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.ca-user-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: .35rem .65rem;
    border-radius: 9px;
    border: 1px solid var(--ca-border);
    background: #f8fafc;
    cursor: pointer;
    transition: var(--ca-transition);
    text-decoration: none;
    min-height: 38px;
}

.ca-user-btn:hover { border-color: var(--ca-secondary); background: #eff6ff; }

.ca-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: linear-gradient(135deg, var(--ca-secondary), #4fc3f7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: .78rem;
    overflow: hidden;
    flex-shrink: 0;
}

.ca-user-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Page Content */
.ca-content { padding: var(--ca-content-padding); flex: 1; }

/* Page Header */
.ca-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: .75rem;
    flex-wrap: wrap;
}

.ca-page-title { font-size: clamp(1.1rem, 2.5vw, 1.5rem); font-weight: 800; color: var(--ca-dark); margin: 0; }
.ca-page-sub { font-size: .82rem; color: var(--ca-gray); margin-top: .1rem; }

/* Breadcrumb */
.ca-breadcrumb {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .82rem;
    color: var(--ca-gray);
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.ca-breadcrumb li + li::before { content: '/'; margin-inline-end: .4rem; color: #cbd5e1; }
.ca-breadcrumb a { color: var(--ca-secondary); }

/* =========================================
   CARDS
   ========================================= */

.ca-card {
    background: #fff;
    border-radius: var(--ca-radius);
    border: 1px solid var(--ca-border);
    box-shadow: var(--ca-shadow);
    overflow: hidden;
}

.ca-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--ca-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    background: #fff;
    flex-wrap: wrap;
}

@media (min-width: 768px) {
    .ca-card-header { padding: 1.1rem 1.5rem; }
}

.ca-card-title { font-size: .95rem; font-weight: 700; color: var(--ca-dark); margin: 0; }

.ca-card-body { padding: 1.1rem; }

@media (min-width: 768px) {
    .ca-card-body { padding: 1.5rem; }
}

.ca-card-footer {
    padding: .875rem 1.1rem;
    border-top: 1px solid var(--ca-border);
    background: #f8fafc;
}

@media (min-width: 768px) {
    .ca-card-footer { padding: 1rem 1.5rem; }
}

/* Stat Cards */
.ca-stat {
    border-radius: var(--ca-radius);
    padding: 1.1rem;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--ca-border);
}

@media (min-width: 576px) {
    .ca-stat { padding: 1.25rem; }
}

@media (min-width: 992px) {
    .ca-stat { padding: 1.5rem; }
}

.ca-stat .stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-bottom: .875rem;
}

@media (min-width: 768px) {
    .ca-stat .stat-icon { width: 52px; height: 52px; font-size: 1.5rem; margin-bottom: 1rem; }
}

.ca-stat .stat-value { font-size: clamp(1.4rem, 3vw, 1.875rem); font-weight: 900; line-height: 1; }
.ca-stat .stat-label { color: var(--ca-gray); font-size: .82rem; margin-top: .2rem; }
.ca-stat .stat-change { font-size: .78rem; margin-top: .4rem; display: flex; align-items: center; gap: 4px; }
.ca-stat .stat-change.up { color: var(--ca-success); }
.ca-stat .stat-change.down { color: var(--ca-danger); }
a:hover .ca-stat { transform: translateY(-3px); box-shadow: var(--ca-shadow-lg); }

/* ca-stat color variants (used on admin dashboard with .stat-icon / .stat-value) */
.ca-stat.ca-stat-primary { background: linear-gradient(135deg, #eff6ff, #dbeafe); }
.ca-stat.ca-stat-primary .stat-icon { background: rgba(31,143,204,.1); color: var(--ca-secondary); }
.ca-stat.ca-stat-primary .stat-value { color: var(--ca-secondary); }

.ca-stat.ca-stat-success { background: linear-gradient(135deg, #f0fdf4, #dcfce7); }
.ca-stat.ca-stat-success .stat-icon { background: rgba(16,185,129,.1); color: var(--ca-success); }
.ca-stat.ca-stat-success .stat-value { color: var(--ca-success); }

.ca-stat.ca-stat-warning { background: linear-gradient(135deg, #fffbeb, #fef3c7); }
.ca-stat.ca-stat-warning .stat-icon { background: rgba(245,158,11,.1); color: var(--ca-warning); }
.ca-stat.ca-stat-warning .stat-value { color: var(--ca-warning); }

.ca-stat.ca-stat-danger { background: linear-gradient(135deg, #fef2f2, #fee2e2); }
.ca-stat.ca-stat-danger .stat-icon { background: rgba(239,68,68,.1); color: var(--ca-danger); }
.ca-stat.ca-stat-danger .stat-value { color: var(--ca-danger); }

/* =========================================
   TABLE
   ========================================= */

.ca-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0 0 var(--ca-radius) var(--ca-radius);
}

.ca-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
    min-width: 500px;
}

@media (min-width: 768px) {
    .ca-table { font-size: .9rem; min-width: unset; }
}

.ca-table th {
    padding: .75rem .875rem;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--ca-gray);
    background: #f8fafc;
    border-bottom: 2px solid var(--ca-border);
    white-space: nowrap;
}

@media (min-width: 768px) {
    .ca-table th { padding: .875rem 1rem; font-size: .75rem; }
}

.ca-table td {
    padding: .75rem .875rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #374151;
}

@media (min-width: 768px) {
    .ca-table td { padding: .875rem 1rem; }
}

.ca-table tr:last-child td { border-bottom: none; }
.ca-table tbody tr { transition: background .15s; }
.ca-table tbody tr:hover { background: #f8fafc; }

/* =========================================
   BADGES
   ========================================= */

.ca-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: .25rem .625rem;
    border-radius: 99px;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .ca-badge { padding: .3rem .7rem; font-size: .78rem; }
}

.badge-primary { background: rgba(31,143,204,.1); color: #156ca6; }
.badge-success { background: rgba(16,185,129,.1); color: #059669; }
.badge-warning { background: rgba(245,158,11,.1); color: #b45309; }
.badge-danger { background: rgba(239,68,68,.1); color: #dc2626; }
.badge-info { background: rgba(59,130,246,.1); color: #1f8fcc; }
.badge-secondary { background: rgba(100,116,139,.1); color: #475569; }
.badge-dark { background: rgba(15,23,42,.1); color: #0f172a; }

/* =========================================
   FORMS
   ========================================= */

.ca-form-label {
    font-size: .85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: .375rem;
    display: block;
}

.ca-form-control {
    width: 100%;
    padding: .575rem .9rem;
    border: 2px solid var(--ca-border);
    border-radius: 9px;
    font-size: .9rem;
    font-family: inherit;
    color: #1e293b;
    background: #fff;
    transition: var(--ca-transition);
    outline: none;
    min-height: 44px;
}

@media (min-width: 768px) {
    .ca-form-control { padding: .625rem 1rem; }
}

.ca-form-control:focus {
    border-color: var(--ca-secondary);
    box-shadow: 0 0 0 3px rgba(31,143,204,.1);
}

.ca-form-control.is-invalid {
    border-color: var(--ca-danger);
    box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}

.ca-form-group { margin-bottom: 1rem; }

@media (min-width: 768px) {
    .ca-form-group { margin-bottom: 1.25rem; }
}

.ca-form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: left 0.75rem center;
    background-size: 1.2em;
    background-repeat: no-repeat;
    padding-left: 2.5rem;
}

[dir="rtl"] .ca-form-select {
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
    padding-left: 1rem;
}

/* =========================================
   PROGRESS BAR
   ========================================= */

.ca-progress {
    height: 7px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
}

.ca-progress-bar {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(135deg, var(--ca-secondary), #4fc3f7);
    transition: width .6s ease;
}

.ca-progress-bar.success { background: linear-gradient(135deg, var(--ca-success), #34d399); }
.ca-progress-bar.warning { background: linear-gradient(135deg, var(--ca-warning), #fbbf24); }
.ca-progress-bar.danger { background: linear-gradient(135deg, var(--ca-danger), #f87171); }

/* =========================================
   AUTH PAGES
   ========================================= */

.ca-auth-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--ca-primary) 0%, #1e3a5f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    position: relative;
    overflow: hidden;
}

@media (min-width: 576px) {
    .ca-auth-wrapper { padding: 2rem 1rem; }
}

.ca-auth-wrapper::before {
    content: '';
    position: absolute;
    width: clamp(250px, 40vw, 500px);
    height: clamp(250px, 40vw, 500px);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(31,143,204,.2) 0%, transparent 70%);
    top: -100px;
    right: -100px;
}

.ca-auth-card {
    background: #fff;
    border-radius: 20px;
    padding: clamp(1.5rem, 5vw, 2.5rem);
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    position: relative;
    z-index: 2;
}

.ca-auth-logo {
    text-align: center;
    margin-bottom: 1.75rem;
}

.ca-auth-logo .logo-mark {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--ca-primary), var(--ca-secondary));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 900;
    margin: 0 auto .875rem;
}

@media (min-width: 576px) {
    .ca-auth-logo .logo-mark { width: 60px; height: 60px; }
}

.ca-auth-logo h2 { font-size: clamp(1.25rem, 3vw, 1.5rem); color: var(--ca-dark); }
.ca-auth-logo p { color: var(--ca-gray); font-size: .88rem; }

/* =========================================
   NOTIFICATIONS
   ========================================= */

.ca-notification-item {
    display: flex;
    align-items: flex-start;
    gap: .875rem;
    padding: .875rem 1.1rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background .15s;
    cursor: pointer;
}

@media (min-width: 768px) {
    .ca-notification-item { padding: 1rem 1.25rem; }
}

.ca-notification-item:hover { background: #f8fafc; }
.ca-notification-item.unread { background: #eff6ff; }
.ca-notification-item:last-child { border-bottom: none; }

.ca-notification-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: .95rem;
}

.ca-notification-text .title { font-weight: 600; font-size: .88rem; color: var(--ca-dark); }
.ca-notification-text .desc { font-size: .8rem; color: var(--ca-gray); margin-top: 2px; }
.ca-notification-text .time { font-size: .73rem; color: #94a3b8; margin-top: 3px; }

/* =========================================
   SUPPORT CHAT
   ========================================= */

.ca-chat-container {
    max-height: clamp(320px, 50vh, 500px);
    overflow-y: auto;
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .875rem;
}

@media (min-width: 768px) {
    .ca-chat-container { padding: 1.5rem; gap: 1rem; }
}

.ca-message { display: flex; gap: .75rem; max-width: 85%; }

@media (min-width: 576px) {
    .ca-message { max-width: 80%; }
}

.ca-message.sent { margin-inline-start: auto; flex-direction: row-reverse; }

.ca-message-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ca-secondary), #4fc3f7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.ca-message-bubble {
    background: #f1f5f9;
    border-radius: 14px;
    border-top-right-radius: 4px;
    padding: .65rem .9rem;
    font-size: .88rem;
    line-height: 1.5;
}

.ca-message.sent .ca-message-bubble {
    background: linear-gradient(135deg, var(--ca-secondary), #156ca6);
    color: #fff;
    border-radius: 14px;
    border-top-left-radius: 4px;
}

.ca-message.internal .ca-message-bubble { background: #fffbeb; border: 1px dashed var(--ca-accent); }
.ca-message-time { font-size: .72rem; color: #94a3b8; margin-top: 3px; text-align: end; }

/* =========================================
   RESPONSIVE BREAKPOINTS
   ========================================= */

/* === Tablet & Mobile Sidebar === */
@media (max-width: 991.98px) {
    .ca-sidebar {
        transform: translateX(100%);
        box-shadow: none;
    }

    [dir="ltr"] .ca-sidebar { transform: translateX(-100%); }

    .ca-sidebar.open {
        transform: translateX(0);
        box-shadow: -4px 0 24px rgba(0,0,0,.2);
    }

    [dir="ltr"] .ca-sidebar.open {
        box-shadow: 4px 0 24px rgba(0,0,0,.2);
    }

    .ca-main {
        margin-inline-start: 0 !important;
    }

    .ca-sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.45);
        z-index: 199;
        backdrop-filter: blur(2px);
    }

    .ca-sidebar-overlay.show { display: block; }
}

/* === Tablet (576px – 991px) specific === */
@media (min-width: 576px) and (max-width: 991.98px) {
    .ca-page-header { gap: 1rem; }
}

/* === Mobile (< 576px) === */
@media (max-width: 575.98px) {
    /* Layout */
    .ca-content { padding: .875rem; }
    .ca-page-header { flex-direction: column; align-items: flex-start; gap: .625rem; }

    /* Auth */
    .ca-auth-card { border-radius: 16px; }

    /* Tables — allow scrolling */
    .ca-table { font-size: .82rem; }
    .ca-table th,
    .ca-table td { padding: .625rem .75rem; }

    /* Stats grid: 2 columns on mobile */
    .ca-stat { padding: .875rem; }
    .ca-stat .stat-icon { width: 40px; height: 40px; font-size: 1.1rem; margin-bottom: .75rem; }

    /* Cards */
    .ca-card-header { padding: .875rem 1rem; }
    .ca-card-body { padding: .875rem 1rem; }
    .ca-card-footer { padding: .75rem 1rem; }

    /* Chat */
    .ca-chat-container { padding: .875rem; }
    .ca-message { max-width: 92%; }
    .ca-message-bubble { font-size: .84rem; padding: .6rem .8rem; }

    /* Topbar */
    .ca-topbar { padding: 0 .875rem; gap: .5rem; }

    /* Buttons */
    .btn-ca-primary, .btn-ca-outline, .btn-ca-accent {
        padding: .6rem 1.25rem;
        font-size: .86rem;
    }

    /* Hero buttons */
    .ca-hero .d-flex.gap-3 { gap: .5rem !important; flex-wrap: wrap; }

    /* FAQ */
    .ca-faq-header { min-height: 48px; }

    /* Notifications */
    .ca-notification-item { padding: .75rem .875rem; gap: .75rem; }
    .ca-notification-icon { width: 34px; height: 34px; }
}

/* === Very small phones (< 400px) === */
@media (max-width: 399.98px) {
    html { font-size: 13.5px; }
    .ca-content { padding: .75rem; }
    .ca-card-body { padding: .75rem; }
    .ca-topbar { padding: 0 .75rem; }
}

/* =========================================
   UTILITIES
   ========================================= */

.text-ca-primary { color: var(--ca-primary) !important; }
.text-ca-secondary { color: var(--ca-secondary) !important; }
.text-ca-accent { color: var(--ca-accent) !important; }
.bg-ca-primary { background: var(--ca-primary) !important; }
.bg-ca-secondary { background: var(--ca-secondary) !important; }
.cursor-pointer { cursor: pointer; }
.hover-lift { transition: transform .2s ease; }
.hover-lift:hover { transform: translateY(-3px); }
.rounded-xl { border-radius: 16px !important; }
.rounded-2xl { border-radius: 20px !important; }
.fw-800 { font-weight: 800 !important; }
.fw-900 { font-weight: 900 !important; }

/* Animations */
.fade-in { animation: fadeIn .4s ease forwards; }
.slide-up { animation: slideUp .4s ease forwards; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Alert Toasts */
.ca-toast-container {
    position: fixed;
    top: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    width: calc(100% - 2rem);
    max-width: 420px;
}

@media (min-width: 576px) {
    .ca-toast-container { min-width: 320px; width: auto; }
}

.ca-toast {
    background: #fff;
    border-radius: 11px;
    padding: .875rem 1.1rem;
    box-shadow: 0 8px 30px rgba(0,0,0,.15);
    display: flex;
    align-items: center;
    gap: .75rem;
    border-inline-start: 4px solid var(--ca-secondary);
    animation: slideUp .3s ease;
    font-size: .9rem;
}

.ca-toast.success { border-color: var(--ca-success); }
.ca-toast.error { border-color: var(--ca-danger); }
.ca-toast.warning { border-color: var(--ca-warning); }

/* =========================================
   Brand Logo Images (new identity: عز للتصميم والبرمجة)
   Use a transparent-background PNG (white wordmark + azure icon).
   ========================================= */
/* The logo is enlarged visually with transform:scale so it does NOT grow the
   navbar/header height or reflow the page. The (smaller) height is the layout
   box; scale only changes the painted size. */
.ca-navbar .navbar-brand .brand-logo-img {
    height: 52px;
    width: auto;
    max-width: 420px;
    object-fit: contain;
    display: block;
    transform: scale(1.55);
    transform-origin: center right;
}

@media (max-width: 575.98px) {
    .ca-navbar .navbar-brand .brand-logo-img { height: 40px; max-width: 300px; transform: scale(1.45); }
}

/* Full-width navbar so the brand hugs the right edge (RTL) */
.ca-navbar > .container {
    max-width: 100%;
    padding-inline: clamp(1rem, 4vw, 3rem);
}
.ca-navbar .navbar-brand { margin-inline-end: 0; }

.ca-sidebar-brand .ca-sidebar-logo-img {
    height: 64px;
    width: auto;
    max-width: 92%;
    object-fit: contain;
    display: block;
    image-rendering: -webkit-optimize-contrast;
}

.ca-footer-logo-img {
    height: 104px;
    width: auto;
    max-width: 360px;
    object-fit: contain;
    display: block;
}

/* On the white auth card the white wordmark needs a dark plate to stay visible */
.ca-auth-logo .ca-auth-logo-img {
    height: 86px;
    width: auto;
    max-width: 92%;
    object-fit: contain;
    display: block;
    margin: 0 auto 1.1rem;
    background: var(--ca-primary);
    padding: 14px 22px;
    border-radius: 16px;
    box-sizing: content-box;
}

/* =========================================
   Global Modal System (Add/Edit iframe modal + Delete confirm)
   ========================================= */
/* Chrome-less mode when a page is rendered inside the form modal (?modal=1) */
.ca-main-modal{margin:0 !important;}
body.ca-modal-mode{background:#f3f6fb;}
body.ca-modal-mode .ca-content{padding:1.25rem 1.4rem 2.2rem;max-width:none;}

/* Form modal (iframe) */
.ca-form-modal .modal-dialog{max-width:1120px;}
.ca-fm-content{border:none;border-radius:16px;overflow:hidden;box-shadow:0 24px 70px rgba(2,6,23,.35);}
.ca-fm-header{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.85rem 1.3rem;background:linear-gradient(135deg,#0f172a,#1e3a5f);color:#fff;flex-shrink:0;}
.ca-fm-title{display:flex;align-items:center;gap:.55rem;font-weight:800;font-size:1rem;}
.ca-fm-title i{opacity:.7;}
.ca-fm-close{width:34px;height:34px;border-radius:9px;border:none;background:rgba(255,255,255,.12);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background .15s;font-size:.85rem;}
.ca-fm-close:hover{background:rgba(255,255,255,.25);}
.ca-fm-body{position:relative;background:#f3f6fb;min-height:300px;padding:0;}
.ca-fm-body iframe{width:100%;height:80vh;border:0;display:block;background:#f3f6fb;}
.ca-fm-loader{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#f3f6fb;z-index:3;}
@media (max-width:991.98px){
    .ca-fm-body iframe{height:calc(100dvh - 54px);}
}

/* Delete confirmation modal */
.ca-del-icon{width:66px;height:66px;border-radius:50%;background:#fff1f2;display:flex;align-items:center;justify-content:center;margin:0 auto 1.1rem;}
.ca-del-icon i{font-size:1.7rem;color:#e11d48;}
.ca-del-confirm{background:#e11d48;color:#fff;border:none;}
.ca-del-confirm:hover{background:#be123c;color:#fff;}

/* =========================================
   CLIENT PORTAL — PROFESSIONAL REFINEMENTS
   Scoped to .ca-client so the Admin area is untouched.
   ========================================= */

.ca-client { background: #eef2f7; }

/* ---- Sidebar: depth + gradient ---- */
.ca-client .ca-sidebar {
    background: linear-gradient(190deg, #1a3149 0%, #14283f 55%, #0e1d2e 100%);
    box-shadow: -2px 0 0 rgba(0,0,0,.18);
}

.ca-client .ca-sidebar-brand {
    padding: .75rem .25rem .85rem;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.ca-client .ca-sidebar-logo-img {
    height: 92px;
    max-width: 100%;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.3));
}

.ca-client .ca-nav-section-title { color: rgba(255,255,255,.42); }

.ca-client .ca-sidebar-link {
    margin: 2px .55rem;
    padding: .58rem .8rem;
    border-radius: 11px;
    font-weight: 500;
    min-height: 46px;
}

.ca-client .ca-sidebar-link:hover { background: rgba(255,255,255,.07); }

.ca-client .ca-sidebar-link.active {
    background: linear-gradient(135deg, rgba(31,143,204,.38), rgba(31,143,204,.14));
    color: #fff;
    border-inline-end: none;
    box-shadow: 0 8px 20px rgba(31,143,204,.22);
}

.ca-client .ca-sidebar-link.active .ca-nav-icon {
    background: var(--ca-secondary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(31,143,204,.45);
}

/* ---- Topbar: frosted glass ---- */
.ca-client .ca-topbar {
    background: rgba(255,255,255,.82);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid rgba(15,23,42,.07);
    box-shadow: 0 1px 14px rgba(2,6,23,.05);
}

.ca-client .ca-topbar-greet {
    font-size: .9rem;
    font-weight: 600;
    color: #1e293b;
}
.ca-client .ca-topbar-greet small { color: var(--ca-gray); font-weight: 500; }

/* ---- Readable content width ---- */
.ca-client .ca-content { max-width: 1380px; margin-inline: auto; width: 100%; }

/* ---- Welcome hero band ---- */
.ca-welcome {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    padding: 1.6rem 1.85rem;
    margin-bottom: 1.4rem;
    color: #fff;
    background: linear-gradient(120deg, #14283f 0%, #1c3d63 52%, #1f6196 100%);
    box-shadow: 0 14px 34px rgba(20,40,63,.28);
}
.ca-welcome::before {
    content: '';
    position: absolute;
    inset-inline-end: -50px;
    top: -60px;
    width: 230px;
    height: 230px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(31,143,204,.45) 0%, transparent 70%);
}
.ca-welcome::after {
    content: '';
    position: absolute;
    inset-inline-start: -40px;
    bottom: -70px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245,158,11,.18) 0%, transparent 70%);
}
.ca-welcome > * { position: relative; z-index: 1; }
.ca-welcome h1 {
    color: #fff;
    font-size: clamp(1.25rem, 2.6vw, 1.7rem);
    font-weight: 800;
    margin: 0;
}
.ca-welcome p {
    color: rgba(255,255,255,.78);
    margin: .4rem 0 0;
    font-size: .9rem;
}
.ca-welcome-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.1rem; }
.ca-welcome-chip {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .5rem .95rem;
    border-radius: 99px;
    font-size: .83rem;
    font-weight: 600;
    text-decoration: none;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.18);
    color: #fff;
    transition: var(--ca-transition);
}
.ca-welcome-chip:hover {
    background: rgba(255,255,255,.22);
    color: #fff;
    transform: translateY(-2px);
}
.ca-welcome-chip.solid {
    background: var(--ca-accent);
    border-color: var(--ca-accent);
    box-shadow: 0 6px 16px rgba(245,158,11,.4);
}
.ca-welcome-chip.solid:hover { background: #e58e09; }

@media (max-width: 575.98px) {
    .ca-welcome { padding: 1.3rem 1.25rem; border-radius: 15px; }
}

/* ---- Stat cards: leading accent + softer depth ---- */
.ca-client .ca-stat-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(15,23,42,.06);
    box-shadow: 0 1px 2px rgba(2,6,23,.04), 0 8px 22px rgba(2,6,23,.05);
}
.ca-client .ca-stat-card::after {
    content: '';
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 4px;
}
.ca-client .ca-stat-primary::after { background: var(--ca-secondary); }
.ca-client .ca-stat-success::after { background: var(--ca-success); }
.ca-client .ca-stat-warning::after { background: var(--ca-warning); }
.ca-client .ca-stat-danger::after  { background: var(--ca-danger); }
.ca-client .ca-stat-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(2,6,23,.1); }
.ca-client .ca-stat-card .ca-stat-icon { border-radius: 13px; }

/* ---- Cards: subtle header tint + hover lift ---- */
.ca-client .ca-card {
    border: 1px solid rgba(15,23,42,.06);
    box-shadow: 0 1px 2px rgba(2,6,23,.04), 0 8px 24px rgba(2,6,23,.05);
    transition: box-shadow .25s ease, transform .25s ease;
}
.ca-client .ca-card:hover { box-shadow: 0 6px 30px rgba(2,6,23,.09); }
.ca-client .ca-card-header { background: linear-gradient(180deg, #fbfdff, #fff); }
.ca-client .ca-card-title { font-size: .98rem; }

/* ---- Professional empty state ---- */
.ca-empty { text-align: center; padding: 2.4rem 1rem; color: var(--ca-gray); }
.ca-empty i { font-size: 2.5rem; opacity: .22; display: block; margin-bottom: .65rem; }
.ca-empty .ca-empty-title { font-weight: 600; font-size: .92rem; color: #475569; }
.ca-empty .ca-empty-sub { font-size: .82rem; margin-top: .2rem; }

/* ---- Subtle entrance ---- */
.ca-client .ca-stat-card,
.ca-client .ca-card,
.ca-client .ca-welcome { animation: caRise .45s cubic-bezier(.22,.61,.36,1) both; }
@keyframes caRise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .ca-client .ca-stat-card,
    .ca-client .ca-card,
    .ca-client .ca-welcome { animation: none; }
}

/* ---- Professional page header with branded icon ---- */
.ca-client .ca-ph-title { display: flex; align-items: center; gap: .85rem; min-width: 0; }
.ca-client .ca-ph-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: #fff;
    background: linear-gradient(135deg, var(--ca-secondary), #156ca6);
    box-shadow: 0 8px 18px rgba(31,143,204,.3);
}
.ca-client .ca-ph-icon.amber { background: linear-gradient(135deg, var(--ca-accent), #d97706); box-shadow: 0 8px 18px rgba(245,158,11,.3); }
.ca-client .ca-ph-icon.green { background: linear-gradient(135deg, var(--ca-success), #059669); box-shadow: 0 8px 18px rgba(16,185,129,.3); }
.ca-client .ca-ph-icon.navy  { background: linear-gradient(135deg, #1e3a5f, var(--ca-primary)); box-shadow: 0 8px 18px rgba(20,40,63,.3); }

@media (max-width: 575.98px) {
    .ca-client .ca-ph-icon { width: 42px; height: 42px; font-size: 1.2rem; border-radius: 12px; }
}

/* Count chip used in page sub */
.ca-client .ca-count-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: rgba(31,143,204,.1);
    color: #156ca6;
    border: 1px solid rgba(31,143,204,.18);
    padding: .12rem .6rem;
    border-radius: 99px;
    font-size: .76rem;
    font-weight: 700;
}

/* =========================================
   PORTAL LIST PAGES — Contracts-style hero + tile grid
   Shared so "خدماتي" screens look consistent.
   ========================================= */

.ca-client .ca-phero {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    padding: 1.85rem 2.1rem;
    margin-bottom: 1.6rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    box-shadow: 0 14px 34px rgba(15,23,42,.25);
}
.ca-client .ca-phero::before {
    content: '';
    position: absolute;
    top: -40px;
    inset-inline-start: -40px;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,.04);
    border-radius: 50%;
}
.ca-client .ca-phero::after {
    content: '';
    position: absolute;
    bottom: -70px;
    inset-inline-end: -30px;
    width: 190px;
    height: 190px;
    background: radial-gradient(circle, rgba(31,143,204,.22) 0%, transparent 70%);
    border-radius: 50%;
}
.ca-client .ca-phero > * { position: relative; z-index: 1; }

.ca-phero-title {
    font-size: 1.45rem;
    font-weight: 900;
    color: #fff;
    display: flex;
    align-items: center;
    gap: .6rem;
}
.ca-phero-title i { opacity: .72; }
.ca-phero-sub { color: rgba(255,255,255,.55); font-size: .85rem; margin-top: .25rem; }

.ca-phero-stats { display: flex; gap: .9rem; margin-top: 1.35rem; flex-wrap: wrap; }
.ca-phero-stat {
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 13px;
    padding: .65rem 1.15rem;
    min-width: 92px;
}
.ca-phero-stat .num { font-size: 1.4rem; font-weight: 900; color: #fff; line-height: 1; }
.ca-phero-stat .lbl { font-size: .7rem; color: rgba(255,255,255,.5); margin-top: .22rem; }
.ca-phero-stat.amber .num { color: #fbbf24; }
.ca-phero-stat.green .num { color: #34d399; }
.ca-phero-stat.blue  .num { color: #60a5fa; }
.ca-phero-stat.red   .num { color: #f87171; }

@media (max-width: 575.98px) {
    .ca-client .ca-phero { padding: 1.4rem 1.3rem; border-radius: 16px; }
    .ca-phero-title { font-size: 1.2rem; }
    .ca-phero-stat { min-width: 0; flex: 1; padding: .55rem .7rem; }
}

/* Tile grid */
.ca-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.2rem; }

.ca-client .ca-tile {
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(15,23,42,.07);
    box-shadow: 0 2px 10px rgba(2,6,23,.05);
    overflow: hidden;
    transition: box-shadow .2s ease, transform .15s ease;
    text-decoration: none;
    display: flex;
    flex-direction: column;
}
.ca-client .ca-tile:hover { box-shadow: 0 10px 30px rgba(2,6,23,.12); transform: translateY(-3px); }

.ca-tile-top { padding: 1.2rem 1.25rem; border-bottom: 1px solid #f1f5f9; flex: 1; }
.ca-tile-num { font-family: monospace; font-size: .72rem; color: var(--ca-secondary); font-weight: 700; margin-bottom: .3rem; letter-spacing: .5px; }
.ca-tile-title { font-size: .95rem; font-weight: 800; color: #0f172a; line-height: 1.35; }
.ca-tile-meta { font-size: .77rem; color: #94a3b8; margin-top: .4rem; display: flex; align-items: center; gap: .4rem; }
.ca-tile-bottom { padding: .85rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }

.ca-status-pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; padding: .24rem .7rem; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.ca-status-pill .dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.ca-tile-amount { font-size: .95rem; font-weight: 800; color: #0f172a; }
.ca-tile-link { font-size: .82rem; color: var(--ca-secondary); font-weight: 700; display: inline-flex; align-items: center; gap: .3rem; }

/* =========================================
   PROJECT DETAILS — professional components
   ========================================= */

/* Circular progress ring summary */
.ca-client .ca-proj-summary { padding: 1.6rem 1.25rem; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.ca-proj-ring { position: relative; width: 150px; height: 150px; }
.ca-proj-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
[dir="rtl"] .ca-proj-ring svg { transform: rotate(-90deg) scaleX(-1); }
.ca-proj-ring .track { fill: none; stroke: #eef2f7; stroke-width: 11; }
.ca-proj-ring .bar { fill: none; stroke-width: 11; stroke-linecap: round; transition: stroke-dashoffset .9s cubic-bezier(.22,.61,.36,1); }
.ca-proj-ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ca-proj-ring-label .pct { font-size: 1.9rem; font-weight: 900; color: #0f172a; line-height: 1; }
.ca-proj-ring-label .cap { font-size: .72rem; color: #94a3b8; margin-top: .25rem; }
.ca-proj-summary-foot { width: 100%; border-top: 1px solid #f1f5f9; padding-top: .9rem; margin-top: .2rem; text-align: center; }
.ca-proj-summary-foot .lbl { font-size: .72rem; color: #94a3b8; }
.ca-proj-summary-foot .val { font-size: .9rem; font-weight: 700; color: #1e293b; margin-top: .15rem; }

/* Info rows with icon chips */
.ca-info-row { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid #f1f5f9; }
.ca-info-row:last-child { border-bottom: none; }
.ca-info-ic { width: 34px; height: 34px; border-radius: 9px; background: rgba(31,143,204,.1); color: var(--ca-secondary); display: flex; align-items: center; justify-content: center; font-size: .95rem; flex-shrink: 0; }
.ca-info-row .lbl { font-size: .78rem; color: #94a3b8; flex: 1; }
.ca-info-row .val { font-size: .86rem; font-weight: 700; color: #1e293b; text-align: left; }

/* Timeline (updates / stages) */
.ca-timeline { position: relative; padding-inline-start: 1.6rem; }
.ca-timeline::before { content: ''; position: absolute; inset-inline-start: 6px; top: .35rem; bottom: .35rem; width: 2px; background: #e8edf5; }
.ca-tl-item { position: relative; padding-bottom: 1.2rem; }
.ca-tl-item:last-child { padding-bottom: 0; }
.ca-tl-dot { position: absolute; inset-inline-start: -1.6rem; top: .1rem; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--ca-secondary); box-shadow: 0 0 0 3px #fff; }
.ca-tl-dot.done { background: var(--ca-success); border-color: var(--ca-success); }
.ca-tl-dot.pending { border-color: #cbd5e1; }
.ca-tl-title { font-weight: 700; font-size: .9rem; color: #0f172a; }
.ca-tl-text { font-size: .85rem; color: #64748b; margin: .3rem 0; line-height: 1.7; white-space: pre-wrap; }
.ca-tl-time { font-size: .74rem; color: #94a3b8; display: inline-flex; align-items: center; gap: .3rem; }

/* File rows */
.ca-file-row { display: flex; align-items: center; gap: .85rem; padding: .75rem 0; border-bottom: 1px solid #f1f5f9; }
.ca-file-row:last-child { border-bottom: none; }
.ca-file-ic { width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0; background: rgba(31,143,204,.1); color: var(--ca-secondary); }
.ca-file-name { font-size: .86rem; font-weight: 600; color: #1e293b; word-break: break-word; }

/* =========================================
   PROJECT HERO — premium, calm palette
   ========================================= */
.ca-proj-hero {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    padding: 1.7rem 2rem;
    margin-bottom: 1.5rem;
    color: #fff;
    background: linear-gradient(135deg, #0f172a 0%, #14283f 55%, #1e3a5f 100%);
    box-shadow: 0 16px 38px rgba(15,23,42,.28);
}
.ca-proj-hero::before {
    content: '';
    position: absolute;
    inset-inline-end: -60px;
    top: -70px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(31,143,204,.28) 0%, transparent 70%);
}
.ca-proj-hero > * { position: relative; z-index: 1; }

.ca-proj-hero-top { display: flex; align-items: center; gap: 1.4rem; justify-content: space-between; flex-wrap: wrap; }
.ca-proj-hero-id { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.ca-proj-hero-ic {
    width: 54px; height: 54px; border-radius: 15px;
    background: rgba(31,143,204,.18); border: 1px solid rgba(96,165,250,.35);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.55rem; color: #60a5fa; flex-shrink: 0;
}
.ca-proj-hero-title { font-size: 1.45rem; font-weight: 900; color: #fff; line-height: 1.25; }
.ca-proj-hero-sub { font-size: .82rem; color: rgba(255,255,255,.6); margin-top: .35rem; display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.ca-proj-hero-sub .ca-status-pill { box-shadow: none; }

/* Ring on dark */
.ca-proj-hero-ring { position: relative; width: 98px; height: 98px; flex-shrink: 0; }
.ca-proj-hero-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ca-proj-hero-ring .track { fill: none; stroke: rgba(255,255,255,.14); stroke-width: 9; }
.ca-proj-hero-ring .bar { fill: none; stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .9s cubic-bezier(.22,.61,.36,1); }
.ca-proj-hero-ring .lbl { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ca-proj-hero-ring .lbl .pct { font-size: 1.35rem; font-weight: 900; color: #fff; line-height: 1; }
.ca-proj-hero-ring .lbl .cap { font-size: .58rem; color: rgba(255,255,255,.55); margin-top: .15rem; letter-spacing: .5px; }

/* Stat strip */
.ca-proj-hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .8rem; margin-top: 1.5rem; }
.ca-proj-hero-stat {
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
    border-radius: 13px; padding: .7rem .85rem;
    display: flex; align-items: center; gap: .7rem;
}
.ca-proj-hero-stat .ic {
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center;
    font-size: 1rem; color: #93c5fd; flex-shrink: 0;
}
.ca-proj-hero-stat .num { font-size: 1.02rem; font-weight: 800; color: #fff; line-height: 1.1; }
.ca-proj-hero-stat .cap { font-size: .68rem; color: rgba(255,255,255,.55); margin-top: .1rem; }

@media (max-width: 575.98px) {
    .ca-proj-hero { padding: 1.35rem 1.25rem; border-radius: 16px; }
    .ca-proj-hero-title { font-size: 1.2rem; }
    .ca-proj-hero-ring { width: 84px; height: 84px; }
}

/* =========================================
   CLIENT FILE UPLOAD (drop zone)
   ========================================= */
.ca-upload-drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; gap: .25rem;
    padding: 1.6rem 1rem;
    border: 2px dashed #cbd5e1;
    border-radius: 14px;
    cursor: pointer;
    background: #f8fafc;
    transition: border-color .2s ease, background .2s ease;
}
.ca-upload-drop:hover, .ca-upload-drop.drag { border-color: var(--ca-secondary); background: #eff6ff; }
.ca-upload-drop > i { font-size: 2.1rem; color: var(--ca-secondary); }
.ca-upload-title { font-size: .86rem; font-weight: 700; color: #334155; }
.ca-upload-sub { font-size: .73rem; color: #94a3b8; }
.ca-upload-file { font-size: .8rem; font-weight: 700; color: var(--ca-secondary); margin-top: .35rem; word-break: break-all; }
.ca-upload-mine { margin-top: 1rem; padding-top: .9rem; border-top: 1px dashed #e2e8f0; }
.ca-upload-mine-title { font-size: .75rem; font-weight: 700; color: #94a3b8; margin-bottom: .5rem; }
.ca-pending-tag { font-size: .68rem; color: #b45309; background: rgba(245,158,11,.12); border-radius: 99px; padding: .12rem .5rem; font-weight: 700; }
