:root {
    --awamer-cyan: #00aeff;
    --awamer-lime: #8cc63f;
    --cs-blue: #1e4fd6;
    --navy: #0c2340;
    --navy-deep: #071628;
    --charcoal: #2d3436;
    --bg: #f4f8fc;
    --surface: #ffffff;
    --text: #1a2332;
    --muted: #5b6b7c;
    --border: #d7e3ef;
    --shadow: 0 12px 32px rgba(12, 35, 64, 0.08);
    --radius: 18px;
    --brand-gradient: linear-gradient(135deg, var(--awamer-cyan), var(--cs-blue) 55%, var(--awamer-lime));
}

html[data-theme="dark"] {
    --bg: #08111f;
    --surface: #101c2e;
    --text: #e8f0fa;
    --muted: #93a4b8;
    --border: #243447;
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Cairo", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 0% 0%, rgba(0, 174, 255, 0.10), transparent 32%),
        radial-gradient(circle at 100% 0%, rgba(140, 198, 63, 0.10), transparent 28%),
        linear-gradient(180deg, #eef6fc 0%, var(--bg) 42%);
}

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 300px;
    background:
        linear-gradient(180deg, rgba(0, 174, 255, 0.12), transparent 28%),
        linear-gradient(180deg, var(--navy) 0%, #102847 58%, var(--navy-deep) 100%);
    color: #fff;
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    border-left: 1px solid rgba(255,255,255,.06);
}

.brand-panel {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 20px;
    padding: 1rem;
    margin-bottom: 1.15rem;
}

.brand-logos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .65rem;
    margin-bottom: .85rem;
}

.brand-logo-card {
    background: #fff;
    border-radius: 14px;
    min-height: 72px;
    display: grid;
    place-items: center;
    padding: .45rem;
    box-shadow: inset 0 0 0 1px rgba(12, 35, 64, 0.06);
}

.brand-logo-card.cs {
    background: #0a0a0a;
}

.brand-logo-card img {
    width: 100%;
    height: 58px;
    object-fit: contain;
}

.brand-names {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.brand-name-row {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .92rem;
    font-weight: 700;
}

.brand-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.brand-dot.awamer { background: linear-gradient(135deg, var(--awamer-cyan), var(--awamer-lime)); }
.brand-dot.cs { background: var(--cs-blue); }

.brand-guide {
    margin-top: .75rem;
    padding-top: .7rem;
    border-top: 1px solid rgba(255,255,255,.12);
    color: rgba(255,255,255,.78);
    font-size: .82rem;
    font-weight: 600;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    overflow: auto;
    flex: 1;
}

.side-nav a {
    color: rgba(255,255,255,.86);
    text-decoration: none;
    padding: .72rem .9rem;
    border-radius: 12px;
    transition: .2s ease;
    border: 1px solid transparent;
}

.side-nav a:hover,
.side-nav a.active {
    background: linear-gradient(90deg, rgba(0,174,255,.22), rgba(140,198,63,.14));
    border-color: rgba(0,174,255,.22);
    color: #fff;
}

.sidebar-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,.1);
    text-align: center;
    color: rgba(255,255,255,.65);
    font-size: .78rem;
    line-height: 1.5;
}

.main-panel { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    padding: .9rem 1.4rem;
    background: rgba(255,255,255,.78);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}

html[data-theme="dark"] .topbar { background: rgba(16,28,46,.88); }

.topbar-brands {
    display: flex;
    align-items: center;
    gap: .55rem;
}

.topbar-brands img {
    height: 34px;
    width: auto;
    object-fit: contain;
    background: #fff;
    border-radius: 10px;
    padding: .2rem .35rem;
    border: 1px solid var(--border);
}

.topbar-brands img.cs-mark {
    width: 34px;
    background: #0a0a0a;
    object-fit: cover;
    padding: 0;
}

.search-form { flex: 1; max-width: 480px; }
.search-form .form-control {
    border-radius: 14px;
    border-color: var(--border);
    padding: .65rem 1rem;
}
.search-form .form-control:focus {
    border-color: var(--awamer-cyan);
    box-shadow: 0 0 0 .2rem rgba(0,174,255,.15);
}

.topbar-actions { display: flex; align-items: center; gap: .75rem; }
.user-chip { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.user-chip small { color: var(--muted); }
.btn-theme {
    width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border);
    background: var(--surface); color: var(--text);
}
.btn-outline-soft {
    border: 1px solid var(--border);
    color: var(--text);
    background: var(--surface);
    border-radius: 12px;
}
.content-area { padding: 1.5rem; }

.hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    border-radius: 28px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    background:
        radial-gradient(circle at 85% 15%, rgba(0,174,255,.35), transparent 28%),
        radial-gradient(circle at 10% 90%, rgba(140,198,63,.28), transparent 30%),
        linear-gradient(135deg, #0c2340 0%, #153a6b 48%, #1e4fd6 100%);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.04), transparent);
    pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; }

.partner-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .85rem;
    margin-bottom: 1.15rem;
}

.partner-card {
    display: flex;
    align-items: center;
    gap: .7rem;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 16px;
    padding: .55rem .8rem;
    backdrop-filter: blur(6px);
}

.partner-card img {
    height: 52px;
    width: 52px;
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
    padding: .25rem;
}

.partner-card img.cs-mark {
    background: #0a0a0a;
    object-fit: cover;
    object-position: center;
    padding: 0;
    width: 52px;
    height: 52px;
}

.partner-card strong {
    display: block;
    font-size: 1rem;
    font-weight: 800;
}

.partner-card span {
    display: block;
    font-size: .78rem;
    opacity: .8;
}

.partner-plus {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.14);
    font-weight: 800;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px;
    padding: .3rem .75rem;
    font-size: .82rem;
    margin-bottom: .85rem;
}

.hero h1 {
    font-weight: 800;
    font-size: clamp(1.55rem, 2.6vw, 2.25rem);
    margin-bottom: .75rem;
}

.hero p {
    max-width: 820px;
    opacity: .93;
    margin-bottom: 0;
    line-height: 1.85;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    width: 100%;
}

@media (max-width: 992px) {
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .card-grid { grid-template-columns: 1fr; }
}

.section-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
    position: relative;
    overflow: hidden;
}

.section-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--brand-gradient);
    opacity: 0;
    transition: .2s ease;
}

.section-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0,174,255,.45);
    color: inherit;
    box-shadow: 0 16px 36px rgba(0,174,255,.12);
}

.section-card:hover::before { opacity: 1; }

.section-icon {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(0,174,255,.16), rgba(140,198,63,.16));
    color: var(--navy);
    font-weight: 800;
    margin-bottom: .85rem;
}

html[data-theme="dark"] .section-icon { color: var(--awamer-cyan); }

.section-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: .4rem; }
.section-card p { color: var(--muted); margin-bottom: .8rem; min-height: 3rem; }

.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: rgba(30,79,214,.08);
    color: var(--cs-blue);
    border-radius: 999px;
    padding: .25rem .7rem;
    font-size: .85rem;
    font-weight: 600;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.breadcrumb { --bs-breadcrumb-divider: '›'; }
.toc a { color: var(--muted); text-decoration: none; display: block; padding: .35rem 0; }
.toc a.active, .toc a:hover { color: var(--cs-blue); }

.block { margin-bottom: 1rem; }
.block-heading { font-size: 1.25rem; font-weight: 800; margin: 1rem 0 .5rem; }
.block-note, .block-warning {
    border-radius: 14px;
    padding: .9rem 1rem;
    border: 1px solid transparent;
}
.block-note {
    background: rgba(0,174,255,.10);
    border-color: rgba(0,174,255,.28);
}
.block-warning {
    background: rgba(245,158,11,.12);
    border-color: rgba(245,158,11,.35);
}

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li {
    position: relative;
    padding: .75rem 3.4rem .75rem 1rem;
    margin-bottom: .5rem;
    background: rgba(30,79,214,.05);
    border-radius: 12px;
    line-height: 1.7;
}
.steps li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--awamer-cyan), var(--cs-blue));
    color: #fff;
    display: grid;
    place-items: center;
    font-size: .85rem;
    font-weight: 700;
    line-height: 1;
}

.block ol:not(.steps),
.block ul {
    padding-right: 1.4rem;
    padding-left: 0;
    margin-bottom: 1rem;
}
.block ol:not(.steps) li,
.block ul li {
    margin-bottom: .4rem;
    padding-right: .35rem;
    line-height: 1.7;
}

.table thead { background: rgba(12,35,64,.04); }

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at 20% 20%, rgba(0,174,255,.28), transparent 30%),
        radial-gradient(circle at 85% 75%, rgba(140,198,63,.22), transparent 28%),
        linear-gradient(155deg, #071628 0%, #0c2340 40%, #1e4fd6 100%);
}

.auth-card {
    width: min(460px, 100%);
    background: #fff;
    border-radius: 28px;
    padding: 2rem;
    box-shadow: 0 24px 60px rgba(0,0,0,.28);
}

.auth-partners {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: .7rem;
    align-items: center;
    margin-bottom: 1.25rem;
}

.auth-partner {
    text-align: center;
    background: #f7fafc;
    border: 1px solid #e6eef6;
    border-radius: 16px;
    padding: .7rem .5rem;
}

.auth-partner img {
    height: 56px;
    width: 100%;
    object-fit: contain;
    margin-bottom: .35rem;
}

.auth-partner.cs {
    background: #0a0a0a;
    border-color: #222;
}

.auth-partner.cs img {
    height: 72px;
    width: 72px;
    object-fit: cover;
    margin: 0 auto .35rem;
    border-radius: 14px;
    display: block;
}

.auth-partner.cs strong,
.auth-partner.cs span { color: #fff; }

.auth-partner strong {
    display: block;
    font-size: .92rem;
    font-weight: 800;
    color: var(--charcoal);
}

.auth-partner span {
    display: block;
    font-size: .72rem;
    color: var(--muted);
}

.auth-plus {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(0,174,255,.15), rgba(140,198,63,.15));
    color: var(--navy);
    font-weight: 800;
}

.btn-brand {
    background: linear-gradient(90deg, #0c2340, #1e4fd6 60%, #00aeff);
    border: 0;
    color: #fff;
    border-radius: 14px;
    font-weight: 700;
}
.btn-brand:hover { color: #fff; filter: brightness(1.05); }

.admin-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.admin-nav a {
    text-decoration: none;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .4rem .9rem;
}
.admin-nav a.active {
    background: linear-gradient(90deg, var(--navy), var(--cs-blue));
    color: #fff;
    border-color: transparent;
}

@media (max-width: 992px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: relative; }
    .side-nav { flex-direction: row; flex-wrap: wrap; }
    .topbar { flex-direction: column; align-items: stretch; }
    .topbar-brands { justify-content: center; }
    .partner-strip { justify-content: center; }
}
