:root {
    --brand: #ec4899;
    --brand-dark: #db2777;
    --brand-soft: #fde7f3;
    --ink: #1f2937;
    --muted: #6b7280;
    --navy: #141a33;
    --radius: 14px;
    --shadow: 0 2px 10px rgba(17, 24, 39, .07);
    --shadow-lg: 0 18px 40px rgba(17, 24, 39, .14);
}

body { font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; color: var(--ink); background: #f6f7f9; }
html[dir="rtl"] body, html[lang="ar"] body { font-family: "Cairo", "Segoe UI", sans-serif; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

/* Buttons */
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-outline-brand { border-color: var(--brand); color: var(--brand); }
.btn-outline-brand:hover { background: var(--brand); color: #fff; }
.text-brand { color: var(--brand) !important; }
.bg-brand { background: var(--brand) !important; }
.bg-brand-soft { background: var(--brand-soft) !important; }

/* Navbar */
.navbar-main { background: #fff; box-shadow: 0 1px 8px rgba(0,0,0,.06); }
.navbar-brand { font-weight: 800; color: var(--brand) !important; letter-spacing: -.3px; }
.navbar-main .nav-link { font-weight: 600; color: #374151; }
.navbar-main .nav-link.active, .navbar-main .nav-link:hover { color: var(--brand); }
.lang-switch { display: inline-flex; border: 1px solid #e5e7eb; border-radius: 999px; overflow: hidden; }
.lang-switch a { padding: .2rem .7rem; font-size: .85rem; font-weight: 700; color: #6b7280; text-decoration: none; }
.lang-switch a.active { background: var(--brand); color: #fff; }
.notif-dot { position: absolute; top: 2px; inset-inline-end: 0; font-size: .65rem; }
.dropdown-notifications { width: 340px; max-width: 92vw; }
.dropdown-notifications .dropdown-item { white-space: normal; font-size: .9rem; }

/* Cards */
.card { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { background: transparent; border-bottom: 1px solid #f0f1f3; font-weight: 700; padding: 1rem 1.25rem; }
.card-hover { transition: transform .2s, box-shadow .2s; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.page-title { font-weight: 800; letter-spacing: -.4px; }
.icon-circle { width: 56px; height: 56px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; }

/* Footer */
.site-footer { background: #111827; color: #9ca3af; }
.site-footer a { color: #d1d5db; text-decoration: none; }

/* Step indicator */
.steps { display: flex; justify-content: center; align-items: flex-start; gap: 0; margin: 0 auto 2rem; max-width: 720px; }
.steps .step { flex: 1; text-align: center; position: relative; }
.steps .step:not(:last-child)::after { content: ""; position: absolute; top: 18px; inset-inline-start: 50%; width: 100%; height: 3px; background: #e5e7eb; z-index: 0; }
.steps .step.done:not(:last-child)::after { background: #28a745; }
.steps .dot { width: 38px; height: 38px; border-radius: 50%; background: #e5e7eb; color: #6b7280; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; position: relative; z-index: 1; }
.steps .step.active .dot { background: var(--brand); color: #fff; box-shadow: 0 0 0 5px var(--brand-soft); }
.steps .step.done .dot { background: #28a745; color: #fff; }
.steps .label { display: block; font-size: .85rem; margin-top: .4rem; color: var(--muted); font-weight: 600; }
.steps .step.active .label { color: var(--brand); }

/* Hero */
.hero { position: relative; overflow: hidden; color: #fff; padding: 6rem 0 8rem;
    background: radial-gradient(1200px 500px at 85% -10%, rgba(236,72,153,.35), transparent 60%),
                radial-gradient(900px 500px at -10% 110%, rgba(52,152,219,.28), transparent 60%),
                linear-gradient(135deg, #0f1430 0%, #1b2350 55%, #26164a 100%); }
.hero::before { content: ""; position: absolute; inset: 0; opacity: .08;
    background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px); background-size: 46px 46px; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 90px; background: #f6f7f9; clip-path: ellipse(75% 100% at 50% 100%); }
.hero .container { position: relative; z-index: 1; }
.hero-badge { display: inline-flex; gap: .4rem; align-items: center; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); padding: .35rem .9rem; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 900; line-height: 1.1; letter-spacing: -1px; }
.hero h1 span { background: linear-gradient(90deg, #ff8a7a, #f1c40f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { color: #cbd5e1; max-width: 560px; }
.particle { position: absolute; border-radius: 50%; background: rgba(255,255,255,.5); animation: floatUp linear infinite; }
@keyframes floatUp { from { transform: translateY(0); opacity: 0; } 10% { opacity: .8; } to { transform: translateY(-110vh); opacity: 0; } }
.mock-stack { position: relative; height: 380px; }
.mock-album { position: absolute; width: 230px; height: 290px; border-radius: 16px; box-shadow: 0 25px 50px rgba(0,0,0,.4); overflow: hidden; display: flex; align-items: flex-end; padding: 1rem; color: #fff; font-weight: 800; }
.mock-album.a1 { background: linear-gradient(160deg, #ff7e5f, #ec4899); transform: rotate(-10deg); top: 40px; inset-inline-start: 6%; }
.mock-album.a2 { background: linear-gradient(160deg, #6a82fb, #3b4cca); transform: rotate(4deg); top: 10px; inset-inline-start: 30%; z-index: 2; }
.mock-album.a3 { background: linear-gradient(160deg, #f6d365, #f39c12); transform: rotate(14deg); top: 70px; inset-inline-start: 55%; }
.mock-album .grid { position: absolute; inset: 14px 14px 56px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mock-album .grid i { background: rgba(255,255,255,.28); border-radius: 8px; }
.float-chip { position: absolute; z-index: 3; background: #fff; color: var(--ink); border-radius: 14px; padding: .6rem .9rem; box-shadow: var(--shadow-lg); font-size: .85rem; animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.stat-num { font-size: 2.2rem; font-weight: 900; color: var(--brand); }
.section { padding: 4.5rem 0; }
.section-title { font-weight: 900; letter-spacing: -.5px; }
.step-card .num { width: 46px; height: 46px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.feature-icon { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.dark-panel { background: linear-gradient(135deg, #111827, #1f2a4a); border-radius: 22px; padding: 1.5rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.dark-panel div { aspect-ratio: 3/4; border-radius: 10px; }
.cta-band { background: linear-gradient(135deg, var(--brand), #ff7e5f); color: #fff; border-radius: 24px; }
.animate-on-scroll { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.animate-on-scroll.visible { opacity: 1; transform: none; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }

/* Style cards */
.style-cover { aspect-ratio: 4/3; object-fit: cover; width: 100%; border-radius: var(--radius) var(--radius) 0 0; background: #eceef2; }
.style-cover-ph { aspect-ratio: 4/3; border-radius: var(--radius) var(--radius) 0 0; background: linear-gradient(135deg, #fde7f3, #e8eaf6); display: flex; align-items: center; justify-content: center; font-size: 3rem; color: var(--brand); }

/* Upload */
.dropzone { border: 2.5px dashed #d1d5db; border-radius: 18px; background: #fff; padding: 3rem 1rem; text-align: center; cursor: pointer; transition: all .2s; }
.dropzone.dragover, .dropzone:hover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone i { font-size: 3rem; color: var(--brand); }
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .75rem; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #e5e7eb; box-shadow: var(--shadow); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .remove { position: absolute; top: 6px; inset-inline-end: 6px; border: 0; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: flex; align-items: center; justify-content: center; }
.thumb .remove:hover { background: var(--brand); }
.thumb .num { position: absolute; bottom: 6px; inset-inline-start: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: .75rem; border-radius: 6px; padding: 0 .4rem; }
.thumb.uploading::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.55); }
.thumb.failed { outline: 3px solid #dc3545; }
.sortable-ghost { opacity: .35; }
.thumb.sortable { cursor: grab; }

/* Album pages */
.album-page { position: relative; width: 100%; background: #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.album-page .frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.album-page .frame.under { z-index: 0; }
.album-page .frame.over { z-index: 2; }
.album-page .slot { position: absolute; overflow: hidden; z-index: 1; background: #f3f4f6; }
.album-page .slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-page .slot.empty { border: 2px dashed #cbd5e1; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: .8rem; }
.album-page.grid-page { aspect-ratio: 297 / 210; display: grid; gap: 10px; padding: 18px; background: #fff; }
.album-page.grid-page .cell { overflow: hidden; border-radius: 4px; background: #f3f4f6; }
.album-page.grid-page .cell img { width: 100%; height: 100%; object-fit: cover; }
.album-cover { position: relative; aspect-ratio: 297 / 210; border-radius: 6px; overflow: hidden; background: #1c2030; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-cover .band { position: absolute; inset-inline: 0; bottom: 0; height: 26%; background: rgba(0,0,0,.55); color: #fff; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 0 1rem; }
.album-cover .band h3 { font-weight: 800; margin: 0; font-size: clamp(1rem, 3vw, 2rem); }
.album-cover .band small { color: #f1c40f; font-size: clamp(.7rem, 1.6vw, 1rem); }
.page-label { font-size: .8rem; color: var(--muted); font-weight: 600; margin-bottom: .35rem; }

/* Order tracker */
.tracker { display: flex; justify-content: space-between; position: relative; }
.tracker .t-step { flex: 1; text-align: center; position: relative; }
.tracker .t-step:not(:last-child)::after { content: ""; position: absolute; top: 20px; inset-inline-start: 50%; width: 100%; height: 4px; background: #e5e7eb; }
.tracker .t-step.done:not(:last-child)::after { background: #28a745; }
.tracker .t-dot { width: 42px; height: 42px; border-radius: 50%; background: #e5e7eb; color: #9ca3af; display: inline-flex; align-items: center; justify-content: center; position: relative; z-index: 1; font-size: 1.1rem; }
.tracker .t-step.done .t-dot { background: #28a745; color: #fff; }
.tracker .t-step.current .t-dot { background: var(--brand); color: #fff; box-shadow: 0 0 0 6px var(--brand-soft); }
.tracker .t-label { display: block; margin-top: .5rem; font-size: .85rem; font-weight: 600; color: var(--muted); }
.tracker .t-step.current .t-label { color: var(--brand); }

/* Badges */
.badge-status { font-weight: 700; padding: .4em .7em; border-radius: 999px; }
.st-pending { background: #fff4e5; color: #b45309; }
.st-processing { background: #e0f2fe; color: #0369a1; }
.st-printed { background: #ede9fe; color: #6d28d9; }
.st-shipped { background: #e0e7ff; color: #3730a3; }
.st-delivered { background: #dcfce7; color: #15803d; }
.st-cancelled { background: #f3f4f6; color: #6b7280; }
.st-draft { background: #f3f4f6; color: #4b5563; }
.st-confirmed { background: #e0f2fe; color: #0369a1; }
.st-ordered { background: #dcfce7; color: #15803d; }
.ps-unpaid { background: #fff4e5; color: #b45309; }
.ps-pending { background: #fef9c3; color: #a16207; }
.ps-paid { background: #dcfce7; color: #15803d; }
.ps-failed { background: #fee2e2; color: #b91c1c; }
.ps-refunded { background: #f3f4f6; color: #4b5563; }

/* Checkout options */
.option-card { border: 2px solid #e5e7eb; border-radius: 14px; padding: 1rem; cursor: pointer; transition: border-color .15s, background .15s; height: 100%; display: block; }
.option-card:hover { border-color: #f9a8d4; }
.btn-check:checked + .option-card { border-color: var(--brand); background: var(--brand-soft); }
.btn-check:disabled + .option-card { opacity: .5; cursor: not-allowed; }
.summary-sticky { position: sticky; top: 90px; }

/* Admin */
.admin-wrap { display: flex; min-height: 100vh; }
.admin-sidebar { width: 250px; flex: 0 0 250px; background: #1f2937; color: #cbd5e1; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-sidebar .brand { background: #111827; padding: 1.1rem 1.25rem; font-weight: 800; color: #fff; font-size: 1.15rem; }
.admin-sidebar .brand i { color: var(--brand); }
.admin-sidebar a.side-link { display: flex; align-items: center; gap: .7rem; padding: .75rem 1.25rem; color: #cbd5e1; text-decoration: none; border-inline-start: 4px solid transparent; font-weight: 600; }
.admin-sidebar a.side-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.admin-sidebar a.side-link.active { background: rgba(236,72,153,.12); color: #fff; border-inline-start-color: var(--brand); }
.admin-main { flex: 1; min-width: 0; }
.admin-topbar { background: #fff; padding: .85rem 1.5rem; box-shadow: 0 1px 6px rgba(0,0,0,.05); display: flex; align-items: center; justify-content: space-between; gap: 1rem; position: sticky; top: 0; z-index: 10; }
.kpi { padding: 1.25rem; }
.kpi .v { font-size: 1.6rem; font-weight: 900; }
.kpi .l { color: var(--muted); font-size: .85rem; font-weight: 600; }
.bar-chart { display: flex; align-items: flex-end; gap: 3px; height: 160px; }
.bar-chart .bar { flex: 1; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.bar-chart .bar:hover { opacity: 1; }
@media (max-width: 991px) {
    .admin-sidebar { position: fixed; z-index: 1040; inset-inline-start: -260px; transition: inset-inline-start .2s; }
    .admin-sidebar.open { inset-inline-start: 0; }
}

/* Template editor */
.editor-stage { position: relative; overflow: auto; background: repeating-conic-gradient(#f3f4f6 0% 25%, #fff 0% 50%) 50% / 20px 20px; border-radius: 12px; border: 1px solid #e5e7eb; max-height: 70vh; }
.editor-canvas { position: relative; transform-origin: 0 0; display: inline-block; user-select: none; }
.editor-canvas img { display: block; max-width: none; }
.editor-canvas.drawing { cursor: crosshair; }
.slot-box { position: absolute; border: 2px solid; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); cursor: pointer; font-size: 1.1rem; }
.slot-box.draft { border-style: dashed; }
.slot-card { border-inline-start: 5px solid; border-radius: 10px; }
.slot-card.highlight { box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow); }
.tpl-thumb { position: relative; }
.tpl-thumb img { width: 100%; display: block; border-radius: 8px; }
.tpl-thumb .ov { position: absolute; border: 2px solid; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.6); }

@media print { .no-print { display: none !important; } }

/* Flash messages over full-bleed pages */
.flash-floating { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 1050; width: min(640px, 92vw); }


/* App pages share the site's fonts */
.app-body { font-family: var(--font-body); }
.app-body .page-title { font-family: var(--font-display); }
html[dir="rtl"] .app-body .page-title { font-family: "Cairo", sans-serif; }
.navbar-main .navbar-brand { font-family: var(--font-display); }


/* Brand logo mark (public/images/logo-mark.svg) */
.brand-mark { width: 1.6em; height: 1.6em; border-radius: .42em; vertical-align: -.42em; margin-inline-end: .35em; box-shadow: 0 3px 10px rgba(236, 72, 153, .25); }
.brand-mark-lg { width: 1.9em; height: 1.9em; }
.site-footer-magic a.footer-brand { color: #fff !important; font-weight: 800; }

/* Admin order photos: low-quality / replaced flags */
.thumb-low { outline: 3px solid #dc3545; outline-offset: -3px; }
.thumb-flag { position: absolute; top: 6px; inset-inline-start: 6px; white-space: nowrap; max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; color: #fff; font-size: .68rem; font-weight: 700; padding: .1rem .45rem; border-radius: 999px; }
.replace-cell { display: flex; flex-direction: column; min-width: 0; }
.replace-cell .thumb { display: block; width: 100%; }
.replace-cell .btn-light { border: 1px solid #e5e7eb; }
.replace-cell .btn { font-size: .8rem; line-height: 1.6; border-radius: 8px; }
