/* YallaGooo — website admin panel */
@font-face { font-family: "Tajawal"; src: url("/fonts/Tajawal-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Tajawal"; src: url("/fonts/Tajawal-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Tajawal"; src: url("/fonts/Tajawal-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Tajawal"; src: url("/fonts/Tajawal-ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap; }

:root {
    --red-50: #FFF1F2; --red-100: #FFE1E4; --red-200: #FFC7CE; --red-300: #FB9DA9; --red-400: #F2697D;
    --red-500: #E34C61; --red-600: #CC3550; --red-700: #A82842; --red-900: #5E1A2C;
    --ink: #2E2127; --ink-2: #5A4A50; --muted: #8A767D; --line: #EFE3E6; --bg: #FAF6F7; --card: #fff;
    --side: #2A1D23; --ok: #2E9E6A; --warn: #B7791F; --info: #2B6CB0;
    --grad: linear-gradient(135deg, var(--red-400), var(--red-600));
    --radius: 16px; --shadow: 0 4px 18px rgba(94, 26, 44, .07);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Tajawal", "Segoe UI", Tahoma, sans-serif; font-size: 15.5px; color: var(--ink); background: var(--bg); line-height: 1.6; }
a { color: var(--red-600); text-decoration: none; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.3; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.center { text-align: center; justify-content: center; }

/* layout */
.side { position: fixed; inset-block: 0; right: 0; width: 250px; background: var(--side); color: #E8DADF; display: flex; flex-direction: column; z-index: 50; transition: transform .3s; }
.side-brand { display: block; padding: 22px 22px 18px; }
.side-brand img { height: 38px; }
.side nav { flex: 1; overflow-y: auto; padding: 6px 12px; display: grid; gap: 2px; align-content: start; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; color: #D9C8CD; font-weight: 600; transition: background .2s, color .2s; }
.side nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side nav a.active { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(227, 76, 97, .35); }
.side nav .badge { margin-inline-start: auto; background: #fff; color: var(--red-600); border-radius: 999px; font-size: 12px; padding: 0 8px; }
.side-foot { padding: 16px 22px; border-top: 1px solid rgba(255, 255, 255, .08); }
.side-foot a { color: #D9C8CD; display: flex; gap: 8px; align-items: center; }
.main { margin-right: 250px; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 14px 28px; background: rgba(250, 246, 247, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 20px; margin: 0; flex: 1; }
.topbar-user { display: flex; align-items: center; gap: 14px; }
.topbar-user a { color: var(--ink-2); display: flex; align-items: center; gap: 6px; font-weight: 600; }
.burger { display: none; border: 0; background: var(--red-50); color: var(--red-600); width: 40px; height: 40px; border-radius: 12px; cursor: pointer; }
.content { padding: 24px 28px 90px; max-width: 1300px; }
.side-backdrop { display: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; transition: transform .15s, box-shadow .15s, background .15s; }
.btn:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.btn.primary { background: var(--grad); color: #fff; border: 0; box-shadow: 0 6px 16px rgba(227, 76, 97, .28); }
.btn.danger { color: #B42318; border-color: #F5C2C0; background: #FFF5F5; }
.btn.wa { color: #128C4A; border-color: #BFE8CF; background: #F0FBF4; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.block { width: 100%; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink-2); font-size: 12px; }
.icon-btn:hover { background: var(--red-50); color: var(--red-600); }
.icon-btn.danger:hover { background: #FFF5F5; color: #B42318; }
.link-btn { border: 0; background: none; color: var(--red-600); font: inherit; font-weight: 700; cursor: pointer; padding: 6px 4px; }
.link-btn.danger { color: #B42318; }
form { margin: 0; }

/* panels */
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 22px 24px; margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar p { margin: 0; }
.toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-side { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
.sticky { position: sticky; top: 84px; }
.empty { padding: 40px; text-align: center; color: var(--muted); background: #fff; border: 2px dashed var(--line); border-radius: var(--radius); }

/* kpis */
.cards4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); border: 1px solid var(--line); color: var(--ink); transition: transform .2s; }
.kpi:hover { transform: translateY(-3px); }
.kpi b { display: block; font-size: 26px; line-height: 1.1; }
.kpi small { color: var(--muted); }
.kpi-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--red-50); color: var(--red-500); }
.mini-stats { display: flex; gap: 12px; flex-wrap: wrap; margin: 10px 0; }
.mini-stats > div { flex: 1; min-width: 100px; padding: 12px 14px; border-radius: 12px; background: var(--red-50); text-align: center; }
.mini-stats b { display: block; font-size: 22px; color: var(--red-600); }
.mini-stats small { color: var(--ink-2); }
.quick-links { display: flex; flex-wrap: wrap; gap: 10px; }
.quick-links a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; background: var(--red-50); color: var(--red-700); font-weight: 700; }
.quick-links a:hover { background: var(--red-100); }

/* pills */
.pill { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--red-50); color: var(--red-600); vertical-align: middle; }
.pill.ok { background: #E8F7EF; color: var(--ok); }
.pill.warn { background: #FFF7E6; color: var(--warn); }
.pill.info { background: #EBF4FF; color: var(--info); }
.pill.muted { background: #F1ECEE; color: var(--muted); }

/* table */
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { padding: 12px 14px; text-align: right; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: #FCF8F9; font-size: 13.5px; color: var(--ink-2); }
.table tr.unread td { font-weight: 700; }
.table tr.off td { opacity: .55; }
.table td.actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.panel .table { box-shadow: none; }

/* row cards */
.card-list { display: grid; gap: 12px; }
.row-card { display: flex; align-items: center; gap: 16px; padding: 14px 16px; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.row-card.off { opacity: .6; }
.row-main { flex: 1; min-width: 0; }
.row-main h3 { margin: 0 0 2px; }
.row-main p { margin: 0 0 4px; }
.row-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; background: var(--red-50); flex-shrink: 0; }
.thumb.wide { width: 120px; height: 68px; }
.type-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: var(--red-50); color: var(--red-500); flex-shrink: 0; }
.ad-stats { display: flex; gap: 8px; }
.ad-stats > div { text-align: center; min-width: 58px; padding: 6px 8px; border-radius: 10px; background: #FCF8F9; }
.ad-stats b { display: block; font-size: 17px; }
.ad-stats small { color: var(--muted); font-size: 11.5px; }
details.more { position: relative; }
details.more summary { list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more > div { position: absolute; left: 0; top: 40px; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px 10px; min-width: 170px; display: grid; }

/* master switch */
.panel.master { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-inline-start: 6px solid var(--ok); }
.panel.master.off { border-inline-start-color: var(--muted); background: #FBF9FA; }
.panel.master p { margin: 0; }

/* forms */
.form .f, .f { display: grid; gap: 6px; margin-bottom: 14px; }
.f > span { font-weight: 700; font-size: 14px; color: var(--ink-2); }
input[type=text], input:not([type]), input[type=number], input[type=email], input[type=password], input[type=datetime-local], input[type=time], input[type=url], select, textarea {
    width: 100%; font: inherit; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: #FFFCFC; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red-300); box-shadow: 0 0 0 4px rgba(227, 76, 97, .1); background: #fff; }
textarea.code { font-family: Consolas, monospace; font-size: 13px; }
input[type=file] { font: inherit; font-size: 13.5px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.switches { display: flex; flex-wrap: wrap; gap: 20px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; }
.switch i { position: relative; width: 46px; height: 26px; border-radius: 99px; background: #E3D5DA; transition: background .2s; flex-shrink: 0; }
.switch i::after { content: ""; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked + i { background: var(--red-500); }
.switch input:checked + i::after { transform: translateX(-20px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 4px rgba(227, 76, 97, .2); }
.switch em { font-style: normal; font-weight: 600; color: var(--ink-2); }
.chk { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; }
.seg { display: flex; gap: 10px; flex-wrap: wrap; }
.seg label { flex: 1; min-width: 150px; display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); cursor: pointer; background: #fff; }
.seg.small label { min-width: 110px; flex: 0 1 auto; }
.seg.wrap label { flex: 0 1 auto; min-width: 0; }
.seg input { position: absolute; opacity: 0; }
.seg label:has(input:checked) { border-color: var(--red-400); background: var(--red-50); color: var(--red-700); }
.seg small { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip { cursor: pointer; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-block; padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-weight: 600; }
.chip input:checked + span { background: var(--red-500); border-color: var(--red-500); color: #fff; }
.custom-time { margin-top: 10px; }
.custom-time.hidden { display: none; }
[data-pages].disabled { opacity: .45; pointer-events: none; }
.prefix-input { display: flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: #FFFCFC; }
.prefix-input em { font-style: normal; padding: 10px 12px; background: #F6EEF0; color: var(--muted); }
.prefix-input input { border: 0; border-radius: 0; }
.sticky-actions { position: sticky; bottom: 0; display: flex; gap: 10px; justify-content: flex-start; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 30%); z-index: 10; }
.form-actions { display: flex; gap: 10px; }
.narrow-form { max-width: 520px; }

/* image pickers */
.img-pick { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.img-pick.center { flex-direction: column; margin-bottom: 14px; }
.logo-prev { height: 54px; width: auto; max-width: 220px; object-fit: contain; padding: 6px; border-radius: 12px; background: #FCF8F9; border: 1px solid var(--line); }
.avatar-prev { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; border: 4px solid var(--red-100); }
.img-drop { display: grid; gap: 10px; padding: 12px; border: 2px dashed var(--red-200); border-radius: var(--radius); background: #FFFAFB; }
.img-drop img { width: 100%; max-height: 280px; object-fit: contain; border-radius: 12px; background: #fff; }

/* placements */
.placement-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.placement { display: grid; gap: 8px; justify-items: center; padding: 12px; border-radius: 14px; border: 1.5px solid var(--line); cursor: pointer; background: #fff; }
.placement input { position: absolute; opacity: 0; }
.placement:has(input:checked) { border-color: var(--red-400); background: var(--red-50); }
.pl-art { position: relative; width: 120px; height: 76px; border-radius: 8px; background: #F3ECEE; border: 1px solid #E6DADE; overflow: hidden; }
.pl-art i { position: absolute; background: var(--grad); border-radius: 4px; }
.pl-popup i { inset: 18px 28px; }
.pl-topbar i { inset: 0 0 auto 0; height: 12px; border-radius: 0; }
.pl-inlinebanner i { left: 10px; right: 10px; top: 32px; height: 16px; }
.pl-corner i { right: 8px; bottom: 8px; width: 40px; height: 30px; }

/* items editor */
.items { display: grid; gap: 8px; margin-bottom: 12px; }
.item-row { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 12px; background: #FCF8F9; border: 1px solid var(--line); }
.item-row input { flex: 1; min-width: 0; }
.item-row input.grow { flex: 2.4; }
.item-icon { display: flex; align-items: center; gap: 6px; }
.item-icon select { width: 120px; }
.icon-preview { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: #fff; color: var(--red-500); }
.rich-editor { min-height: 220px; background: #fff; border-radius: 0 0 12px 12px; font-family: inherit; font-size: 16px; }
.ql-toolbar.ql-snow { border-radius: 12px 12px 0 0; border-color: var(--line) !important; }
.ql-container.ql-snow { border-color: var(--line) !important; }
.ql-editor { text-align: right; direction: rtl; font-family: "Tajawal", sans-serif; }

/* modal */
dialog.modal { border: 0; border-radius: 20px; padding: 0; width: min(860px, 94vw); box-shadow: 0 30px 80px rgba(0, 0, 0, .25); }
dialog.modal::backdrop { background: rgba(42, 29, 35, .5); backdrop-filter: blur(3px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; padding: 18px 22px 22px; max-height: 70vh; overflow-y: auto; }
.type-card { display: grid; gap: 4px; text-align: right; padding: 14px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font: inherit; color: var(--ink); }
.type-card:hover { border-color: var(--red-300); background: var(--red-50); }
.type-card span { color: var(--red-500); }
.type-card small { color: var(--muted); line-height: 1.4; }

/* team */
.team-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.team-tile { text-align: center; padding: 18px 14px; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.team-tile.off { opacity: .55; }
.team-tile img { width: 86px; height: 86px; border-radius: 50%; object-fit: cover; margin: 0 auto 10px; display: block; border: 3px solid var(--red-100); }
.team-tile h3 { margin: 0; }

/* messages */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; border-radius: 10px; color: var(--ink-2); font-weight: 700; background: #fff; border: 1px solid var(--line); }
.tabs a.active { background: var(--grad); color: #fff; border-color: transparent; }
.messages { display: grid; gap: 12px; }
.msg { background: #fff; border-radius: var(--radius); border: 1px solid var(--line); padding: 16px 18px; box-shadow: var(--shadow); }
.msg.unread { border-inline-start: 5px solid var(--red-500); }
.msg header { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.msg h3 { display: inline; margin-inline-end: 8px; }
.msg p { white-space: pre-wrap; margin: 10px 0 0; }

/* media */
.upload-box { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.upload-box > div { flex: 1; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.media-item { margin: 0; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow); }
.media-item img { width: 100%; height: 140px; object-fit: cover; display: block; background: var(--red-50); }
.media-item .file-icon { height: 140px; display: grid; place-items: center; color: var(--red-400); font-weight: 800; background: var(--red-50); }
.media-item figcaption { padding: 10px 12px; display: grid; gap: 4px; }
.media-item figcaption > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* flash */
.flash { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 700; }
.flash.ok { background: #E8F7EF; color: #1F7A50; }
.flash.err { background: #FFF1F1; color: #B42318; }
.flash.err ul { margin: 0; padding-inline-start: 18px; }
.empty-hide.validation-summary-valid { display: none; }

/* login */
.login-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #FFF1F2, #FFD9DE); padding: 20px; overflow: hidden; }
.login-bg i { position: fixed; border-radius: 50%; background: rgba(227, 76, 97, .12); }
.login-bg i:nth-child(1) { width: 460px; height: 460px; top: -160px; left: -120px; }
.login-bg i:nth-child(2) { width: 300px; height: 300px; bottom: -100px; right: -60px; }
.login-bg i:nth-child(3) { width: 120px; height: 120px; top: 30%; right: 20%; }
.login-card { position: relative; width: min(420px, 100%); background: #fff; padding: 36px 32px; border-radius: 26px; box-shadow: 0 30px 70px rgba(94, 26, 44, .16); }
.login-logo { height: 44px; display: block; margin: 0 auto 18px; }
.login-card h1 { text-align: center; font-size: 22px; }
.login-card > p { text-align: center; margin-top: 0; }
.login-card .back { display: block; text-align: center; margin-top: 16px; color: var(--muted); }

/* responsive */
@media (max-width: 1100px) {
    .grid-side { grid-template-columns: 1fr; }
    .sticky { position: static; }
    .cards4 { grid-template-columns: repeat(2, 1fr); }
    .placement-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
    .side { transform: translateX(100%); }
    .side-open .side { transform: none; }
    .side-open .side-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 40; }
    .main { margin-right: 0; }
    .burger { display: grid; place-items: center; }
    .content { padding: 18px 14px 90px; }
    .topbar { padding: 12px 14px; }
    .grid2, .row2, .row3 { grid-template-columns: 1fr; }
    .row-card { flex-wrap: wrap; }
    .row-actions { width: 100%; }
    .ad-stats { width: 100%; }
    .item-row { flex-wrap: wrap; }
    .table { display: block; overflow-x: auto; }
    .topbar-user a { display: none; }
}
