:root {
    --bg: #06070b;
    --panel: rgba(18, 20, 28, 0.82);
    --panel-strong: rgba(16, 18, 24, 0.96);
    --line: rgba(255, 255, 255, 0.1);
    --text: #f6f8ff;
    --muted: rgba(246, 248, 255, 0.66);
    --gold: #ffc107;
    --gold-deep: #b8860b;
    --mint: #00e8a0;
    --danger: #ff6d7c;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100vh;
    font-family: "Tajawal", sans-serif;
    position: relative;
    /* overflow-x: removed to fix sticky */
    box-sizing: border-box;
}

/* --- AUTHORITATIVE THEME SYSTEM --- */
/* --- AUTHORITATIVE THEME SYSTEM --- */
body.ios-market-body {
    --bg: #ffffff;
    --panel: rgba(0, 0, 0, 0.03); /* كروت فاتحة جداً للمتجر */
    --panel-strong: #ffffff;
    --line: rgba(0, 0, 0, 0.06);
    --text: #000000;
    --muted: rgba(0, 0, 0, 0.45);
    background: var(--bg) !important;
    color: var(--text) !important;
}

body.ios-market-body .apple-list-card, 
body.ios-market-body .apple-card,
body.ios-market-body .apple-list-item {
    background: var(--panel) !important;
    color: var(--text) !important;
    box-shadow: none !important; /* إزالة أي ظل مظلم */
}

body.ios-market-body .fx-grid, 
body.ios-market-body .fx-glow {
    display: none !important;
}

body.ios-admin-body {
    background: #000000 !important;
    color: #ffffff !important;
}
body.ios-admin-body .fx-grid, 
body.ios-admin-body .fx-glow {
    display: block !important;
}

body.ios-market-body .top-nav {
    display: none !important;
}

body.ios-market-body .page-shell {
    width: min(760px, 100%);
    margin: 0 auto;
    padding: 0 12px;
    box-sizing: border-box;
    /* overflow-x: removed to fix sticky */
}

.fx-grid {
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: radial-gradient(circle at center, black 20%, transparent 85%);
    z-index: -4;
}

.fx-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: -3;
}

.fx-gold {
    width: 400px;
    height: 400px;
    background: rgba(255, 193, 7, 0.22);
    top: -140px;
    right: -120px;
}

.fx-mint {
    width: 420px;
    height: 420px;
    background: rgba(0, 232, 160, 0.16);
    bottom: -150px;
    left: -130px;
}

.top-nav {
    width: min(1200px, calc(100% - 28px));
    margin: 14px auto 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(12, 13, 18, 0.78);
    backdrop-filter: blur(18px);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    position: sticky;
    top: 10px;
    z-index: 40;
    color: #ffffff !important;
}

.top-nav-center {
    color: #ffffff !important;
    font-family: "Orbitron", "Tajawal", sans-serif;
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: 0.95px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: min(54vw, 560px);
    padding: 0;
}

body.ios-market-body .top-nav {
    display: none !important;
}

body.ios-market-body .page-shell {
    width: min(760px, 100%);
    margin: 0 auto;
    padding: 0 12px;
    box-sizing: border-box;
    /* overflow-x: removed to fix sticky */
}

.top-logo-link {
    justify-self: start;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.brand-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white !important;
}

/* Catch-all for white text across elements */
h1, h2, h3, h4, h5, h6, p, span, label, div, b, strong, th, td, a {
    color: inherit; /* Rely on container color or var(--text) from body */
}

.brand-badge {
    font-family: "Orbitron", sans-serif;
    font-weight: 900;
    letter-spacing: 2px;
    font-size: 0.78rem;
    color: #171717;
    background: linear-gradient(135deg, var(--gold), var(--gold-deep));
    padding: 4px 10px;
    border-radius: 8px;
}

.brand-text {
    font-family: "Orbitron", sans-serif;
    font-size: 0.82rem;
    letter-spacing: 1px;
}

.nav-links {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-link,
.nav-button {
    text-decoration: none;
    color: var(--muted);
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 7px 11px;
    transition: .2s ease;
    background: transparent;
    font-family: "Tajawal", sans-serif;
    font-size: 0.86rem;
    cursor: pointer;
}

.nav-link:hover,
.nav-button:hover {
    color: white;
    border-color: var(--line);
    background: rgba(255,255,255,.03);
}

.nav-form { margin: 0; }

.page-shell {
    width: min(1200px, calc(100% - 28px));
    margin: 22px auto 30px;
}

.hero-card {
    border: 1px solid var(--line);
    border-radius: 26px;
    background: linear-gradient(150deg, rgba(21, 24, 32, .88), rgba(13, 15, 20, .85));
    padding: 24px;
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 20px;
}

.label-kicker {
    margin: 0 0 7px;
    color: var(--gold);
    font-family: "Orbitron", sans-serif;
    font-size: .73rem;
    letter-spacing: 2.4px;
    text-transform: uppercase;
}

h1 {
    margin: 0 0 10px;
    font-size: clamp(1.5rem, 2.8vw, 2.2rem);
}

.text-sub {
    margin: 0;
    line-height: 1.8;
    color: var(--muted);
}

.hero-side {
    display: grid;
    gap: 10px;
}

.kpi-box {
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 14px;
    background: rgba(255,255,255,.03);
}

.kpi-box span {
    display: block;
    color: var(--muted);
    font-size: .85rem;
    margin-bottom: 7px;
}

.kpi-box strong {
    font-family: "Orbitron", sans-serif;
    color: var(--gold);
    font-size: .95rem;
    overflow-wrap: anywhere;
}

.search-row { margin-top: 14px; }

.search-box {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel-strong);
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 12px;
}

.search-icon {
    width: 19px;
    height: 19px;
    color: var(--muted);
}

.search-box input {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: white;
    padding: 13px 0;
    font-size: .94rem;
    font-family: "Tajawal", sans-serif;
}

.featured-wrap { margin-top: 14px; }

.featured-card {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(20, 22, 30, 0.95), rgba(12, 14, 19, 0.9));
    padding: 20px;
    display: grid;
    grid-template-columns: 135px 1fr;
    gap: 18px;
}

.featured-icon {
    width: 135px;
    height: 135px;
    border-radius: 30px;
    object-fit: cover;
    border: 1px solid var(--line);
}

.label-pill {
    margin: 0 0 7px;
    display: inline-block;
    border-radius: 999px;
    border: 1px solid rgba(255,193,7,.4);
    background: rgba(255,193,7,.14);
    color: var(--gold);
    font-family: "Orbitron", sans-serif;
    font-size: .72rem;
    padding: 5px 11px;
}

.featured-content h2 { margin: 0 0 6px; }
.featured-content p { margin: 0 0 10px; color: var(--muted); }

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 12px;
}

.tag-row span {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 9px;
    font-size: .73rem;
    background: rgba(255,255,255,.03);
}

.section-block { margin-top: 18px; }

.section-head h3 {
    margin: 0;
    font-size: 1.3rem;
}

.section-head p {
    margin: 4px 0 0;
    color: var(--muted);
}

.apps-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
    gap: 12px;
}

.app-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
    padding: 12px;
    transition: .18s ease;
}

.app-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255,193,7,.35);
}

.app-icon {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 18px;
    object-fit: cover;
    border: 1px solid var(--line);
}

.app-body h4 {
    margin: 11px 0 3px;
    font-size: 1.08rem;
}

.app-desc {
    margin: 0;
    color: var(--muted);
    min-height: 40px;
    font-size: .9rem;
}

.bundle-code {
    display: block;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 7px;
    overflow-wrap: anywhere;
    color: var(--gold);
    font-size: .72rem;
    background: rgba(255,255,255,.02);
}

.btn-row,
.btn-col {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-col { flex-direction: column; }

.btn {
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 9px 12px;
    font-size: .84rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: .18s ease;
    background: rgba(255,255,255,.03);
    cursor: pointer;
    font-family: "Tajawal", sans-serif;
}

.btn-primary {
    color: #121212;
    background: linear-gradient(135deg, var(--gold), var(--gold-deep));
    border-color: rgba(255,193,7,.5);
}

.btn-primary:hover { filter: brightness(1.07); }

.btn-soft {
    border-color: var(--line);
    background: rgba(255,255,255,.05);
}

.btn-soft:hover { border-color: rgba(255,193,7,.35); }

.btn-danger {
    border-color: rgba(255,109,124,.4);
    color: #ffc0c7;
    background: rgba(255,109,124,.12);
}

.btn-lg { padding: 13px 16px; font-size: .92rem; }
.btn-sm { padding: 5px 8px; font-size: .73rem; }

.empty-box {
    margin-top: 12px;
    border: 1px dashed var(--line);
    border-radius: 14px;
    padding: 14px;
    text-align: center;
    background: rgba(255,255,255,.02);
}

.empty-box h4 { margin: 0 0 5px; }
.empty-box p { margin: 0; color: var(--muted); }

.hidden { display: none; }

.install-wrap {
    display: flex;
    justify-content: center;
}

.install-card {
    width: min(650px, 100%);
    border: 1px solid var(--line);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(20,22,30,.94), rgba(12,14,19,.93));
    padding: 22px;
    position: relative;
}

.status-chip {
    position: absolute;
    top: -11px;
    right: 23px;
    padding: 5px 11px;
    border-radius: 999px;
    font-family: "Orbitron", sans-serif;
    font-size: .7rem;
    color: #121212;
    background: linear-gradient(135deg, var(--gold), var(--gold-deep));
}

.install-head {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 14px;
    align-items: center;
}

.install-icon {
    width: 96px;
    height: 96px;
    border-radius: 24px;
    object-fit: cover;
    border: 1px solid var(--line);
}

.install-metas {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.meta-item {
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 10px;
    background: rgba(255,255,255,.02);
}

.meta-item span {
    color: var(--muted);
    font-size: .8rem;
    display: block;
    margin-bottom: 6px;
}

.meta-item strong {
    color: var(--gold);
    font-family: "Orbitron", sans-serif;
    font-size: .76rem;
    overflow-wrap: anywhere;
}

.span-2 { grid-column: span 2; }

.auth-wrap {
    display: flex;
    justify-content: center;
}

.auth-card {
    width: min(480px, 100%);
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel-strong);
    padding: 20px;
}

.auth-card label,
.form-grid label {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: .9rem;
}

.auth-card input,
.form-grid input,
.form-grid select,
.form-grid textarea {
    width: 100%;
    margin-top: 4px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255,255,255,.03);
    color: white;
    padding: 10px;
    outline: none;
    font-family: "Tajawal", sans-serif;
}

.switch-line {
    margin: 10px 0 0;
    text-align: center;
    color: var(--muted);
}

.switch-line a { color: var(--gold); text-decoration: none; }

.alert {
    margin-top: 10px;
    border-radius: 11px;
    border: 1px solid;
    padding: 10px 12px;
}

.alert-ok {
    color: #a9f7d3;
    background: rgba(0,232,160,.12);
    border-color: rgba(0,232,160,.4);
}

.alert-error {
    color: #ffc4cb;
    background: rgba(255,109,124,.14);
    border-color: rgba(255,109,124,.35);
}

.alert-warn {
    color: #ffe0a9;
    background: rgba(255,193,7,.14);
    border-color: rgba(255,193,7,.36);
}

.alert-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.admin-head { margin-bottom: 8px; }

.admin-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.admin-grid.single { grid-template-columns: 1fr; }

.panel {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    padding: 14px;
}

.panel h3 { margin: 0 0 9px; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid var(--line);
    text-align: right;
    padding: 8px 6px;
    vertical-align: top;
    font-size: .83rem;
}

th {
    color: var(--muted);
    font-weight: 700;
}

.foot-bar {
    width: min(760px, calc(100% - 28px));
    margin: 40px auto 20px;
    color: #64748b;
    padding: 15px;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    border-top: 1px solid #ebedf0;
    font-family: 'Outfit', 'Tajawal', sans-serif;
}

body.ios-market-body .foot-bar {
    border-top: 1px solid #ebedf0;
    background: transparent;
}

@media (max-width: 980px) {
    .hero-card { grid-template-columns: 1fr; }
    .featured-card { grid-template-columns: 1fr; }
    .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
    .top-nav { flex-wrap: wrap; }
    .install-head { grid-template-columns: 1fr; }
    .install-metas { grid-template-columns: 1fr; }
    .span-2 { grid-column: span 1; }
    .form-grid { grid-template-columns: 1fr; }
    .alert-grid { grid-template-columns: 1fr; }
}

/* iOS-style store page */
/* Cleaned up redundant store rule block 2 */

.ios-store-shell {
    max-width: 980px;
    margin: 0 auto;
    padding: 10px 0 90px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Tajawal", sans-serif;
}

.ios-store-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.ios-store-kicker {
    margin: 0 0 4px;
    color: #6b7280;
    font-size: 0.82rem;
    font-weight: 700;
}

.ios-store-title h1 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(1.7rem, 4.2vw, 2.6rem);
    font-weight: 900;
    letter-spacing: -0.5px;
}

.ios-store-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(140deg, #0ea5e9, #0284c7);
    color: white;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(2, 132, 199, 0.25);
}

.ios-msg {
    margin: 8px 0 12px;
    border: 1px solid rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 0.92rem;
    font-weight: 600;
}

.ios-search-wrap {
    margin-bottom: 12px;
}

.ios-search-box {
    height: 42px;
    border-radius: 12px;
    background: #e8ecf3;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid #dce3ec;
}

.ios-search-icon {
    width: 18px;
    height: 18px;
    color: #64748b;
}

.ios-search-box input {
    width: 100%;
    border: 0;
    background: transparent;
    outline: none;
    font-size: 1rem;
    color: #1f2937;
    font-family: inherit;
}

.ios-featured-wrap {
    margin-bottom: 18px;
}

.ios-featured-card {
    position: relative;
    height: min(56vw, 300px);
    min-height: 230px;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 14px 38px rgba(15, 23, 42, 0.2);
}

.ios-featured-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ios-featured-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.08));
}

.ios-featured-meta {
    position: absolute;
    right: 16px;
    left: 16px;
    bottom: 64px;
    color: #fff;
}

.ios-featured-caption {
    margin: 0 0 4px;
    font-size: 0.85rem;
    opacity: 0.92;
}

.ios-featured-meta h2 {
    margin: 0 0 6px;
    font-size: clamp(1.15rem, 2.9vw, 1.6rem);
    font-weight: 800;
    letter-spacing: -0.2px;
}

.ios-featured-meta p {
    margin: 0;
    font-size: 0.93rem;
    opacity: 0.95;
}

.ios-featured-actions {
    position: absolute;
    right: 14px;
    left: 14px;
    bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ios-download-btn {
    min-width: 88px;
    border-radius: 999px;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.92);
    color: #111827;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 800;
    text-align: center;
}

.ios-info-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.9);
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.ios-list-section {
    background: #fff;
    border-radius: 22px;
    border: 1px solid #e5e9f0;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
    padding: 14px;
}

.ios-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.ios-section-head h3 {
    margin: 0;
    color: #0f172a;
    font-size: 1.55rem;
    letter-spacing: -0.2px;
}

.ios-section-head a {
    text-decoration: none;
    color: #2563eb;
    font-weight: 700;
    font-size: 0.9rem;
}

.ios-app-list {
    display: grid;
    gap: 10px;
}

.ios-app-row {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #edf1f6;
    padding-bottom: 10px;
}

.ios-app-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.ios-app-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    object-fit: cover;
    border: 1px solid #e3e8ef;
}

.ios-app-copy h4 {
    margin: 0 0 4px;
    color: #111827;
    font-size: 1.1rem;
}

.ios-app-copy p {
    margin: 0 0 2px;
    color: #4b5563;
    font-size: 0.9rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ios-app-copy span {
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 600;
}

.ios-app-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.ios-pill-btn {
    text-decoration: none;
    background: #eef2f7;
    color: #2563eb;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 800;
    min-width: 76px;
    padding: 8px 0;
    text-align: center;
}

.ios-mini-btn {
    text-decoration: none;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 700;
}

.ios-empty {
    margin-top: 14px;
    border: 1px dashed #d8e0ea;
    border-radius: 14px;
    padding: 14px;
    text-align: center;
    color: #475569;
    background: #f8fafc;
}

.ios-empty h4 {
    margin: 0 0 4px;
}

.ios-empty p {
    margin: 0;
    font-size: 0.9rem;
}

.ios-bottom-tabs {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 10px;
    width: min(620px, calc(100% - 20px));
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e5eaf2;
    border-radius: 16px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 6px;
    gap: 6px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(10px);
}

.tab-link {
    text-decoration: none;
    color: #64748b;
    font-size: 0.82rem;
    text-align: center;
    padding: 10px 6px;
    border-radius: 10px;
    font-weight: 700;
}

.tab-link.active {
    background: #e8f0ff;
    color: #2563eb;
}

@media (max-width: 860px) {
    .ios-store-shell {
        padding-bottom: 94px;
    }

    .ios-featured-card {
        min-height: 210px;
    }

    .ios-section-head h3 {
        font-size: 1.35rem;
    }
}

@media (max-width: 620px) {
    .ios-store-shell {
        padding: 6px 0 95px;
    }

    .ios-store-title h1 {
        font-size: 2rem;
    }

    .ios-app-row {
        grid-template-columns: 64px 1fr auto;
        gap: 9px;
    }

    .ios-app-icon {
        width: 64px;
        height: 64px;
        border-radius: 15px;
    }

    .ios-pill-btn {
        min-width: 68px;
        font-size: 0.82rem;
    }
}

/* Apple store style v2 (current template classes) */
/* Removed light mode overrides to ensure total dark mode consistency */
/* Cleaned up redundant store rule block 3 */

body.ios-market-body .page-shell {
    width: min(760px, calc(100% - 14px));
    margin: 0 auto;
}

.apple-store {
    padding: 8px 0 90px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Tajawal", sans-serif;
}

.apple-store-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 10px 10px;
    border-bottom: 1px solid var(--line);
    position: sticky !important;
    top: 0 !important;
    z-index: 9999 !important; /* ضمان بقاء الهيدر فوق كافة العناصر دائماً */
}

/* هيدر المتجر (فاتح) */
body.ios-market-body .apple-store-head {
    background: #ffffff !important; /* خلفية بيضاء معتمة لضمان الوضوح عند التمرير */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.08); /* حدود أوضح */
}
body.ios-market-body .apple-store-head h1, 
body.ios-market-body .apple-store-date, 
body.ios-market-body .apple-store-name { 
    color: #000000 !important; 
}

/* هيدر الإدارة (مظلم) */
body.ios-admin-body .apple-store-head {
    background: rgba(6, 7, 11, 0.9);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    color: #ffffff !important;
}
body.ios-admin-body .apple-store-head h1, 
body.ios-admin-body .apple-store-date, 
body.ios-admin-body .apple-store-name, 
body.ios-admin-body .apple-head-center span, 
body.ios-admin-body .apple-head-right p { 
    color: #ffffff !important; 
    opacity: 1 !important;
}

body.ios-admin-body .apple-store-name {
    border: 0;
    background: transparent;
    box-shadow: none;
    text-shadow: none;
}

.apple-head-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.as-back-wrapper {
    margin: 2px 0 6px;
    padding: 0 5px;
}

.as-footer-rights {
    margin-top: 50px;
    padding: 20px 10px;
    text-align: center;
    border-top: 1px solid #f1f5f9;
    color: #94a3b8;
    font-size: 0.8rem; line-height: 1.6;
}

.as-footer-rights p { margin: 2px 0; }

.as-rights-links {
    margin-top: 8px;
    font-size: 0.75rem;
    color: #cbd5e1;
}

.as-rights-links span { cursor: pointer; transition: color 0.2s; }
.as-rights-links span:hover { color: #2563eb; }

.as-back-link {
    font-size: 0.95rem;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.as-back-link::before {
    content: "‹";
    font-size: 1.4rem;
    line-height: 1;
}

.apple-store-name {
    font-family: "Orbitron", "Tajawal", sans-serif;
    font-size: clamp(1.58rem, 2.45vw, 2.05rem);
    font-weight: 900;
    color: #0f172a;
    letter-spacing: 1.35px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: min(60vw, 460px);
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}

.apple-head-center {
    flex: 2;
    text-align: center;
    transform: translateX(12px);
}

.apple-head-left {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    padding-right: 10px;
}

.apple-head-logo {
    width: 50px;
    height: 50px;
    border-radius: 0 !important;
    object-fit: contain;
    box-shadow: none !important;
    border: 0 !important;
    transition: transform 0.3s ease;
    transform: translateX(-15px);
}

.apple-head-logo:hover {
    transform: translateX(-15px) scale(1.05);
}

.apple-store-date {
    margin: 0 0 -2px;
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.apple-store-head h1 {
    margin: 0;
    font-size: clamp(1.4rem, 4vw, 2.3rem);
    color: #111827;
    letter-spacing: -0.8px;
    font-weight: 900;
}

.apple-inline-msg {
    margin-bottom: 10px;
    border-radius: 12px;
    border: 1px solid rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
    padding: 10px 12px;
    font-size: 0.9rem;
    font-weight: 700;
}

.apple-search-wrap {
    margin-bottom: 14px;
}

.apple-search-box {
    height: 42px;
    border-radius: 12px;
    background: #e9edf3;
    border: 1px solid #dbe3ee;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
}

.apple-search-icon {
    width: 18px;
    height: 18px;
    min-width: 18px;
    color: #64748b;
}

.apple-search-box input {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: #1f2937;
    font-size: 1rem;
    font-family: inherit;
}

.apple-featured-wrap {
    margin-bottom: 16px;
}

.apple-block-title {
    margin: 0 0 8px;
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 700;
}

.apple-featured {
    position: relative;
    height: min(52vw, 285px);
    min-height: 210px;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

.apple-featured-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.apple-featured-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.64), rgba(0, 0, 0, 0.1));
}

.apple-featured-copy {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 64px;
    color: #fff;
}

.apple-featured-copy p {
    margin: 0 0 5px;
    font-size: 0.85rem;
    opacity: 0.92;
}

.apple-featured-copy h2 {
    margin: 0 0 6px;
    font-size: clamp(1.14rem, 2.8vw, 1.6rem);
    font-weight: 800;
}

.apple-featured-copy span {
    display: block;
    font-size: 0.9rem;
    opacity: 0.96;
}

.apple-featured-actions {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.apple-get-btn {
    text-decoration: none;
    min-width: 82px;
    border-radius: 999px;
    background: #eef2f8;
    color: #2563eb;
    text-align: center;
    font-size: 0.86rem;
    font-weight: 800;
    padding: 8px 14px;
}

.apple-featured .apple-get-btn {
    background: rgba(255, 255, 255, 0.93);
    color: #111827;
}

.apple-mini-link {
    text-decoration: none;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 700;
}

.apple-featured .apple-mini-link {
    color: #fff;
}

.apple-list-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    padding: 16px;
}

.apple-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.apple-block-header h3 {
    margin: 0;
    color: var(--text);
    font-size: 1.35rem;
    letter-spacing: -0.2px;
}

.apple-block-header a {
    text-decoration: none;
    color: var(--gold);
    font-size: 0.9rem;
    font-weight: 700;
}

.apple-block-sub {
    margin: 2px 0 0;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 600;
}

.apple-table-wrap {
    border: 1px solid #e6ecf3;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.apple-apps-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.apple-apps-table thead th {
    background: #f8fafd;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 800;
    text-align: right;
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.apple-apps-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.apple-apps-table tbody tr:last-child td {
    border-bottom: 0;
}

.apple-apps-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.apple-col-cover {
    width: 84px;
}

.apple-table-cover {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
    display: block;
}

.apple-col-main h4 {
    margin: 0 0 4px;
    font-size: 1rem;
    color: var(--text);
}

.apple-col-main p {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 0.87rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.apple-table-bundle {
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 600;
    word-break: break-word;
}

.apple-col-meta strong {
    display: block;
    color: var(--text);
    font-size: 0.92rem;
    margin-bottom: 3px;
}

.apple-col-meta span {
    color: #94a3b8;
    font-size: 0.75rem;
}

.apple-col-cta {
    width: 98px;
    text-align: left;
}

.apple-col-cta .apple-get-btn {
    min-width: 76px;
}

.apple-pagination {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.apple-page-btn,
.apple-page-num {
    text-decoration: none;
    min-width: 38px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--gold);
    font-size: 0.84rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
}

.apple-page-num.active {
    background: #e8efff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.apple-page-btn.disabled {
    color: #9ca3af;
    border-color: #e5e7eb;
    background: #f8fafc;
}

.apple-app-list {
    display: grid;
    gap: 10px;
}

.apple-app-row {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 10px;
    align-items: center;
    border-bottom: 1px solid #eef2f7;
    padding-bottom: 10px;
}

.apple-app-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.apple-app-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
}

.apple-app-info h4 {
    margin: 0 0 4px;
    color: #111827;
    font-size: 1.08rem;
}

.apple-app-info p {
    margin: 0 0 3px;
    color: #4b5563;
    font-size: 0.9rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.apple-app-info span {
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 600;
}

.apple-app-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.apple-empty {
    margin-top: 14px;
    border-radius: 14px;
    border: 1px dashed #d6dfeb;
    background: #f8fafc;
    color: #475569;
    text-align: center;
    padding: 14px;
}

.apple-empty h4 {
    margin: 0 0 5px;
}

.apple-empty p {
    margin: 0;
    font-size: 0.9rem;
}

.apple-tabs {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 10px;
    width: min(640px, calc(100% - 20px));
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(10px);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 6px;
}

.apple-tab {
    text-decoration: none;
    text-align: center;
    border-radius: 10px;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 10px 6px;
}

.apple-tab.active {
    background: #e8efff;
    color: #2563eb;
}

@media (max-width: 620px) {
    .apple-store {
        padding-bottom: 94px;
    }

    .apple-store-head {
        padding-inline: 6px;
    }

    .apple-table-wrap {
        overflow-x: auto;
    }

    .apple-apps-table {
        min-width: 690px;
    }

    .apple-app-row {
        grid-template-columns: 64px 1fr auto;
        gap: 8px;
    }

    .apple-app-icon {
        width: 64px;
        height: 64px;
        border-radius: 15px;
    }

    .apple-get-btn {
        min-width: 68px;
        font-size: 0.82rem;
        padding: 8px 10px;
    }
}

.dns-card {
    background: #000;
    position: relative;
    overflow: hidden;
    height: 180px !important;
}

.dns-gradient-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, #3b82f6 0%, #1e3a8a 50%, #000 100%);
    opacity: 0.8;
}

.sign-btn-premium {
    background: linear-gradient(90deg, #3b82f6, #60a5fa) !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
    transition: transform 0.2s;
}

.sign-btn-premium:hover {
    transform: scale(1.05);
}

.header-site-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
}

.header-site-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.28rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .top-nav-center {
        min-width: 0;
        width: 100%;
        font-size: 0.86rem;
        letter-spacing: 0.55px;
        padding: 6px 10px;
    }

    .apple-store-head {
        margin-bottom: 22px;
        padding: 5px 6px;
    }

    .apple-head-center {
        transform: translateX(8px);
    }

    .apple-store-name {
        font-size: 1.2rem;
        min-width: min(68vw, 290px);
        padding: 6px 12px;
        letter-spacing: 0.9px;
    }

    .apple-store-head h1 {
        font-size: 1.75rem;
    }

    .apple-head-logo {
        width: 55px;
        height: 55px;
        border-radius: 0 !important;
        transform: translateX(-12px);
        border: 0 !important;
        box-shadow: none !important;
    }

    .apple-head-logo:hover {
        transform: translateX(-12px) scale(1.05);
    }
}

.btn-xs {
    padding: 4px 7px;
    font-size: .68rem;
}

.settings-form-mini {
    display: grid;
    gap: 6px;
}

.settings-form-mini label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: .76rem;
}

.settings-form-mini input[type="text"],
.settings-form-mini input[type="number"],
.settings-form-mini input:not([type]) {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    padding: 7px 8px;
    font-family: inherit;
    font-size: .8rem;
}

.settings-form-mini .btn {
    width: max-content;
}

.shots-admin-box {
    min-width: 220px;
}

/* التنسيقات الجديدة لجدول الإدارة */
.admin-app-complex-form {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    margin: 8px 0;
}

.admin-app-header-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.admin-app-body-grid {
    margin-bottom: 15px;
}

.admin-app-footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
}

.field-item label {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 5px;
}

.admin-input-modern, .admin-textarea-modern {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: white;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.admin-input-modern:focus, .admin-textarea-modern:focus {
    border-color: var(--gold);
}

.checks-group {
    display: flex;
    gap: 15px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    cursor: pointer;
}

.stats-group {
    display: flex;
    gap: 12px;
}

.stat-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-field span {
    font-size: 0.7rem;
    color: var(--muted);
}

.stat-field input {
    width: 80px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--gold);
    padding: 4px;
    font-family: "Orbitron", sans-serif;
    font-size: 0.8rem;
    text-align: center;
}

.admin-app-sub-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 12px;
}

.shots-admin-section {
    flex: 1;
}

.shots-upload-inline {
    display: inline-flex;
    gap: 10px;
    margin-right: 15px;
}

.shots-upload-inline input {
    font-size: 0.75rem;
}

.shots-admin-list-new {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.admin-app-complex-card .apple-app-row.no-border {
    border-bottom: 0;
    padding-bottom: 0;
    align-items: flex-start;
}

.media-upload-zone {
    margin-top: 9px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.admin-inline-settings { 
    display: grid; 
    gap: 14px;
    margin-top: 13px; 
    background: rgba(255, 255, 255, 0.015); 
    padding: 14px; 
    border-radius: 12px; 
    border: 1px solid var(--line); 
}

.settings-stack {
    display: grid;
    gap: 9px;
}

.settings-field {
    display: grid;
    gap: 5px;
}

.settings-field span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.settings-field textarea {
    min-height: 88px;
    resize: vertical;
}

.settings-lower-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    gap: 12px;
    flex-wrap: wrap; 
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.check-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.check-options label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--muted);
    font-size: 0.72rem;
    white-space: nowrap;
}

.fake-stats {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.fake-stats input {
    width: 86px;
    text-align: center;
}

.admin-card-actions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 8px;
}

.admin-card-actions form { margin: 0; }

.admin-card-actions .apple-get-btn {
    min-width: 74px;
    padding: 6px 10px;
    font-size: 0.74rem;
}

.action-btn-save {
    background: #dbeafe;
    color: #1d4ed8;
}

.action-btn-delete {
    background: #fee2e2;
    color: #b91c1c;
}

.admin-shot-item { position: relative; min-width: 60px; height: 40px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.admin-shot-item img { width: 100%; height: 100%; object-fit: cover; }
.admin-shot-item button { position: absolute; top: 0; left: 0; background: rgba(255, 109, 124, 0.95); color: #fff; border: 0; width: 16px; height: 16px; font-size: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

.admin-shots-manager {
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.015);
    padding: 10px;
}

.shots-scroller {
    display: flex;
    align-items: center;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.shots-upload-zone {
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px solid var(--line);
}

.mini-upload {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mini-upload input[type="file"] {
    max-width: 250px;
    font-size: 0.68rem;
}

.mini-upload button {
    border: 0;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 6px 10px;
    cursor: pointer;
}

.shot-thumb {
    position: relative;
    width: 80px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--line);
}

.shot-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shot-thumb button {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: rgba(239, 68, 68, 0.85);
    color: white;
    border: 0;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.row-spacer {
    height: 20px;
}

.admin-app-row-main td {
    border-bottom: 0 !important;
}

.admin-app-row-subs td {
    padding-top: 0 !important;
    border-bottom: 1px solid var(--line) !important;
}

.shots-admin-list {
    margin-top: 8px;
    display: grid;
    gap: 6px;
}

.shots-admin-item {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 4px;
}

.shots-admin-item img {
    width: 62px;
    height: 38px;
    border-radius: 7px;
    object-fit: cover;
    border: 1px solid var(--line);
}

.shots-admin-empty {
    color: var(--muted);
    font-size: .78rem;
}

.as-install-page {
    max-width: 860px;
    margin: 0 auto 44px;
    padding: 6px 0 84px;
    color: #0f172a;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Tajawal", sans-serif;
}

.as-topbar {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 8px;
    min-height: 30px;
}

.as-back-link {
    text-decoration: none;
    color: #007aff;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.1px;
}

.as-head-card {
    border: 0;
    border-bottom: 1px solid #ebedf0;
    border-radius: 0;
    background: transparent;
    padding: 8px 0 14px;
    display: grid;
    grid-template-columns: 118px 1fr 34px;
    gap: 13px;
    align-items: center;
}

.as-app-icon {
    width: 118px;
    height: 118px;
    border-radius: 26px;
    object-fit: cover;
    border: 1px solid #e4e8ee;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.as-app-main h1 {
    margin: 0 0 4px;
    font-size: clamp(1.56rem, 3.25vw, 2.2rem);
    line-height: 1.06;
    font-weight: 800;
    letter-spacing: -0.42px;
}

.as-app-sub {
    margin: 0;
    color: #6b7280;
    font-size: .92rem;
    line-height: 1.35;
    word-break: break-word;
}

.as-app-meta {
    margin: 3px 0 11px;
    color: #9ca3af;
    font-size: .8rem;
    letter-spacing: 0;
}

.as-actions-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.as-get-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    height: 32px;
    padding: 0 14px;
    border-radius: 999px;
    background: #007aff;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: .84rem;
    line-height: 1;
    border: 0;
}

.as-get-btn-soft {
    background: #eef2f7;
    color: #0f172a;
}

.as-get-btn-disabled {
    background: #e5e7eb;
    color: #6b7280;
}

.as-facts-row {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.as-fact {
    text-align: center;
    border-left: 1px solid #eceff3;
    padding: 0 8px;
}

.as-fact:last-child {
    border-left: 0;
}

.as-fact small {
    display: block;
    color: #9ca3af;
    font-size: .72rem;
    margin-bottom: 4px;
}

.as-fact strong {
    display: block;
    color: #111827;
    font-size: 1.22rem;
    margin-bottom: 2px;
    line-height: 1.08;
    letter-spacing: -0.3px;
}

.as-fact span {
    color: #64748b;
    font-size: .72rem;
}

.as-screenshots-section,
.as-description-section,
.as-promo-section {
    margin-top: 24px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 16px;
}

.as-sign-section {
    margin-top: 24px;
    background: #f8fafc;
    border: 1px solid #e4e7eb;
    border-radius: 20px;
    padding: 16px;
}

.as-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 8px;
}

.as-section-head h3 {
    margin: 0;
    font-size: 1.24rem;
    color: #111827;
    letter-spacing: -0.2px;
}

.as-section-head span {
    color: #64748b;
    font-size: .8rem;
    padding-top: 4px;
    white-space: nowrap;
}

.as-screenshots-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(175px, 1fr);
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.as-screenshots-strip.single-shot {
    grid-auto-columns: clamp(150px, 42vw, 228px);
    justify-content: center;
    overflow-x: hidden;
}

.as-shot-card {
    scroll-snap-align: start;
    border-radius: 22px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.as-shot-card img {
    width: 100%;
    aspect-ratio: 9 / 19.5;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}
.as-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(7, 10, 18, 0.86);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.as-lightbox.hidden {
    display: none;
}

.as-lightbox img {
    max-width: min(92vw, 560px);
    max-height: 82vh;
    border-radius: 18px;
    object-fit: contain;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.as-lb-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(15, 23, 42, 0.5);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.as-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(15, 23, 42, 0.5);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 800;
    cursor: pointer;
}

.as-lb-prev {
    right: max(14px, calc(50% + 290px));
}

.as-lb-next {
    left: max(14px, calc(50% + 290px));
}

.as-lb-counter {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.95);
    font-size: .86rem;
    font-weight: 700;
    letter-spacing: .4px;
}

.as-empty-note {
    border: 1px dashed #cfd8e3;
    border-radius: 14px;
    background: #f8fafc;
    color: #64748b;
    padding: 12px;
    font-size: .9rem;
}

.as-description-section p {
    margin: 0;
    color: #334155;
    line-height: 1.82;
    font-size: .97rem;
    white-space: pre-line;
}

.as-sign-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 11px;
}

.as-sign-grid label {
    color: #64748b;
    font-size: .82rem;
    display: grid;
    gap: 6px;
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.as-sign-grid .as-sign-bundle-field {
    width: 33.33% !important;
    min-width: 240px;
}

.as-sign-grid .as-sign-cert-field {
    width: 25% !important;
    min-width: 180px;
}

.as-sign-grid input,
.as-sign-grid select {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 11px;
    padding: 10px 11px;
    background: #fff;
    color: #0f172a;
    outline: none;
    font-family: inherit;
}

.as-sign-grid .as-sign-bundle-field input,
.as-sign-grid .as-sign-cert-field select {
    text-align: center;
    text-align-last: center;
}

.as-sign-grid input:focus,
.as-sign-grid select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.as-sign-btn {
    margin-top: 13px;
    width: min(220px, 100%);
    display: block;
    margin-right: auto;
    margin-left: auto;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(90deg, #0a84ff, #2563eb);
    color: #fff;
    font-weight: 800;
    font-size: .87rem;
    padding: 9px 14px;
    cursor: pointer;
}

.as-promo-section {
    margin-top: 14px;
}

.as-promo-section .as-section-head {
    justify-content: center;
}

.as-promo-section .as-section-head h3 {
    width: 100%;
    text-align: center;
}

.as-promo-copy {
    margin: 2px 0 0;
    color: #334155;
    line-height: 1.65;
    font-size: .9rem;
}

.as-promo-links {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.as-promo-chip {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: .8rem;
    font-weight: 700;
}

.as-promo-chip:hover {
    background: #dbeafe;
}

.as-promo-chip-soft {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
}

.as-overlay {
    position: fixed;
    inset: 0;
    background: rgba(241, 245, 249, 0.82);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.as-overlay.hidden {
    display: none;
}

.as-overlay-card {
    min-width: 220px;
    background: #fff;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    padding: 18px;
    text-align: center;
}

.as-overlay-card p {
    margin: 6px 0 0;
    color: #334155;
    font-size: .88rem;
    font-weight: 700;
}

.as-loader-ring {
    --progress: 0;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    margin: 0 auto 10px;
    position: relative;
    display: grid;
    place-items: center;
    background: conic-gradient(#0a84ff calc(var(--progress) * 1%), #dbeafe 0);
}

.as-loader-ring::before {
    content: "";
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 1px #e2e8f0;
}

.as-loader-ring span {
    position: relative;
    z-index: 1;
    font-family: "Orbitron", sans-serif;
    font-size: .78rem;
    font-weight: 800;
    color: #1d4ed8;
    letter-spacing: .3px;
}

@media (max-width: 760px) {
    .as-install-page {
        padding-bottom: 98px;
    }

    .as-head-card {
        grid-template-columns: 76px 1fr 28px;
        gap: 9px;
        padding-top: 2px;
        padding-bottom: 10px;
    }

    .as-app-icon {
        width: 76px;
        height: 76px;
        border-radius: 18px;
    }

    .as-app-main h1 {
        font-size: 1.25rem;
        line-height: 1.12;
    }

    .as-app-sub {
        font-size: .84rem;
    }

    .as-app-meta {
        margin-bottom: 8px;
    }

    .as-facts-row {
        grid-auto-flow: column;
        grid-auto-columns: minmax(82px, 1fr);
        overflow-x: auto;
        margin-top: 10px;
        border-top: 1px solid #eceff3;
        border-bottom: 1px solid #eceff3;
        padding: 8px 0 9px;
        scroll-snap-type: x mandatory;
    }

    .as-fact {
        min-width: 82px;
        border-left: 1px solid #eceff3;
        border-bottom: 0;
        padding: 0 6px;
        scroll-snap-align: start;
    }

    .as-fact:last-child {
        border-left: 0;
    }

    .as-fact strong {
        font-size: 1.08rem;
    }

    .as-fact span {
        font-size: .68rem;
    }

    .as-screenshots-strip {
        grid-auto-columns: minmax(136px, 1fr);
        gap: 8px;
    }

    .as-shot-nav {
        display: none;
    }

    .as-section-head h3 {
        font-size: 1.14rem;
    }

    .as-sign-section {
        padding: 12px;
        border-radius: 16px;
    }

    .as-sign-grid .as-sign-bundle-field,
    .as-sign-grid .as-sign-cert-field {
        width: auto !important;
        max-width: 280px;
    }

    .as-promo-links {
        gap: 6px;
    }

    .as-lightbox img {
        max-width: 92vw;
        max-height: 76vh;
        border-radius: 14px;
    }

    .as-lb-nav {
        width: 32px;
        height: 32px;
    }

    .as-lb-prev {
        right: 12px;
    }

    .as-lb-next {
        left: 12px;
    }
}

/* --- ADMIN PRO REDESIGN 2026 --- */
.admin-full-redesign {
    font-size: 0.88rem; /* تصغير الخط العام للإدارة */
}

.admin-full-redesign .apple-admin-form { display: flex; flex-direction: column; gap: 10px; margin-top: 15px; }
.admin-full-redesign .apple-admin-form input, 
.admin-full-redesign .apple-admin-form select,
.admin-full-redesign .admin-inline-settings input,
.admin-full-redesign .status-pill { 
    padding: 10px; 
    border-radius: 8px; 
    font-size: 0.7rem; 
    background: rgba(255, 255, 255, 0.04) !important; 
    color: #ffffff !important; 
    border: 1px solid rgba(255, 215, 0, 0.12); 
}

.admin-full-redesign .admin-inline-settings textarea {
    background: rgba(0, 0, 0, 0.6) !important; 
    border: 1px solid rgba(255, 215, 0, 0.15); 
    border-radius: 8px; 
    padding: 10px; 
    color: #ffffff !important;
    font-family: inherit; 
    font-size: 0.82rem; 
}

.admin-full-redesign .apple-admin-form label { 
    font-size: 0.72rem; 
    color: var(--gold); 
    margin-bottom: -5px; 
    opacity: 0.9; /* زيادة الوضوح */
}

/* تخفيف الخطوط العريضة في الإدارة */
.admin-full-redesign h1, 
.admin-full-redesign h2, 
.admin-full-redesign h3, 
.admin-full-redesign h4, 
.admin-full-redesign b, 
.admin-full-redesign strong {
    color: #ffffff !important;
    font-weight: 500 !important; /* خط "فاتح" ورشيق بدلاً من العريض المكتم */
}

.admin-pro-card {
    background: rgba(30, 33, 40, 0.85); /* تفتيح بسيط لزيادة التباين */
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(12px);
}

.upload-progress-panel {
    margin-top: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 193, 7, 0.28);
    background: linear-gradient(180deg, rgba(17, 22, 31, 0.94), rgba(9, 13, 20, 0.94));
    padding: 11px 12px;
    display: grid;
    gap: 7px;
}

.upload-progress-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.upload-progress-head strong {
    font-size: 0.78rem;
    color: #f8fafc;
}

.upload-progress-head span {
    font-family: "Orbitron", sans-serif;
    font-size: 0.76rem;
    color: #facc15;
    letter-spacing: 0.6px;
}

.upload-progress-track {
    width: 100%;
    height: 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.upload-progress-fill {
    position: relative;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #f59e0b, #22d3ee 72%, #38bdf8 100%);
    transition: width 0.25s ease;
}

.upload-progress-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.24;
    background-image: repeating-linear-gradient(45deg, #ffffff 0 8px, transparent 8px 16px);
}

.upload-progress-panel small {
    font-size: 0.72rem;
    color: rgba(226, 232, 240, 0.9);
}

.upload-progress-panel.upload-processing .upload-progress-fill::after {
    animation: upload-progress-stripes 0.9s linear infinite;
}

.upload-progress-panel.upload-error {
    border-color: rgba(248, 113, 113, 0.5);
    background: linear-gradient(180deg, rgba(53, 17, 24, 0.93), rgba(34, 11, 16, 0.93));
}

.upload-progress-panel.upload-error .upload-progress-head span {
    color: #fca5a5;
}

@keyframes upload-progress-stripes {
    from { transform: translateX(0); }
    to { transform: translateX(24px); }
}

.admin-app-complex-card {
    background: rgba(35, 38, 45, 0.92); 
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 22px; 
    margin-bottom: 40px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    gap: 18px; 
    max-width: 100%; /* ضمان عدم التجاوز */
}

.mini-icon-upload {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.mini-icon-upload input[type="file"] {
    max-width: 220px;
    font-size: 0.68rem;
}

.mini-icon-upload .apple-get-btn {
    min-width: auto;
    padding: 6px 10px;
    font-size: 0.72rem;
}

@media (max-width: 768px) {
    .admin-full-redesign { font-size: 0.82rem; }
    .admin-main-actions-grid, .admin-secondary-grid, .admin-lists-grid { grid-template-columns: 1fr; gap: 15px; }
    .apple-admin-form.horizontal { flex-direction: column; }
    .admin-app-complex-card { 
        padding: 12px; /* تقليل الحشوة في الجوال لاستعادة العرض */
        margin-bottom: 30px; 
        gap: 15px;
    }
    .apple-app-row { 
        padding-right: 0 !important;
        flex-direction: column; 
        align-items: flex-start !important; /* ضمان المحاذاة للأعلى مقابل العنوان */
        gap: 12px;
        overflow: hidden; /* منع الخروج */
    }
    .apple-app-info { width: 100%; overflow-wrap: break-word; }
    .apple-app-info h4 { font-size: 0.8rem !important; }
    .apple-app-info p { font-size: 0.72rem !important; opacity: 0.7; }
    .apple-app-cta { width: 100%; border-top: 1px solid var(--line); padding-top: 10px; justify-content: space-between; flex-direction: row; }
    .fake-stats input { width: 78px; }
    .admin-card-actions .apple-get-btn { flex: 1; text-align: center; }
    .mini-upload input[type="file"] { max-width: 100%; }
}

@media (max-width: 768px) {
    .admin-main-actions-grid, .admin-secondary-grid, .admin-lists-grid { grid-template-columns: 1fr; }
    .apple-admin-form.horizontal { flex-direction: column; }
    .settings-lower-row { flex-direction: column; align-items: stretch; }
    .apple-app-row { padding: 10px 0; }
}

/* --- END ADMIN --- */

/* --- RESPONSIVE ADMIN (MOBILE) --- */
@media (max-width: 768px) {
    .admin-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    .admin-apps-modern-table thead {
        display: none; /* إخفاء رؤوس الجداول على الجوال */
    }

    .admin-apps-modern-table tbody, 
    .admin-apps-modern-table tr, 
    .admin-apps-modern-table td {
        display: block;
        width: 100%;
    }

    .admin-app-row-main {
        border: 0 !important;
        padding: 0 !important;
        margin-bottom: 0px;
    }

    .admin-app-row-main td:first-child {
        background: var(--gold);
        color: #000;
        width: fit-content;
        padding: 2px 10px;
        border-radius: 4px;
        font-weight: 700;
        font-size: 0.7rem;
        margin-bottom: -10px;
        position: relative;
        z-index: 2;
        margin-right: 15px;
    }

    .admin-app-complex-form {
        padding: 12px;
        border-radius: 12px;
    }

    .admin-app-header-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    .admin-app-footer-grid {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .checks-group {
        flex-direction: column;
        gap: 8px;
    }

    .stats-group {
        justify-content: space-between;
    }

    .stat-field input {
        width: 100%;
    }

    .admin-app-sub-flex {
        flex-direction: column;
        gap: 15px;
        padding: 12px !important;
    }

    .shots-upload-inline {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .shots-upload-inline button {
        width: 100%;
    }

    .delete-app-section {
        width: 100%;
    }

    .delete-app-section button {
        width: 100%;
    }

    /* تحسين بقية الجداول البسيطة في الإدارة */
    .table-wrap table, .table-wrap thead, .table-wrap tbody, .table-wrap th, .table-wrap td, .table-wrap tr {
        display: block;
    }
    
    .table-wrap thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .table-wrap tr { border: 1px solid var(--line); margin-bottom: 10px; border-radius: 8px; background: rgba(255,255,255,0.02); }
    
    .table-wrap td {
        border: none;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        position: relative;
        padding-right: 50% !important;
        text-align: left;
        min-height: 40px;
        display: flex;
        align-items: center;
    }
    
    .table-wrap td:before {
        position: absolute;
        right: 10px;
        width: 45%;
        padding-left: 10px;
        white-space: nowrap;
        color: var(--muted);
        font-size: 0.75rem;
        content: attr(data-label);
        text-align: right;
    }
}
