﻿/* ============================================================
   Modern Store - Cpanel (admin) styles
   RTL / responsive / theme neutral
   ============================================================ */

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: #f3f5f7;
    color: #1f2937;
    font-family: 'Almarai', 'Segoe UI', Tahoma, Arial, sans-serif;
    font-size: 15px;
    direction: rtl;
}

a { color: #0f766e; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- top bar ---------- */
.cp-top {
    background: #0f172a;
    color: #fff;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .15);
}
.cp-brand {
    font-weight: 800;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.cp-brand .dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: #22c55e; display: inline-block;
}
.cp-top .spacer { flex: 1 1 auto; }
.cp-top a.link, .cp-top button.link {
    color: #cbd5e1;
    background: transparent;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: .85rem;
    cursor: pointer;
    font-family: inherit;
}
.cp-top a.link:hover, .cp-top button.link:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }

/* ---------- tabs ---------- */
.cp-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 14px 18px 0;
    max-width: 1200px;
    margin: 0 auto;
}
.cp-tabs a {
    padding: 8px 16px;
    border-radius: 10px 10px 0 0;
    background: #e5e7eb;
    color: #374151;
    font-weight: 700;
    font-size: .88rem;
    white-space: nowrap;
    border: 1px solid #d1d5db;
    border-bottom: 0;
}
.cp-tabs a.active { background: #fff; color: #0f766e; }
.cp-tabs a:hover { text-decoration: none; background: #eef1f4; }

/* ---------- layout ---------- */
.cp-wrap { max-width: 1200px; margin: 0 auto; padding: 0 18px 60px; }
.cp-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0 0 14px 14px;
    padding: 22px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}
.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 18px;
}
.card h2, .card h3 { margin: 0 0 14px; font-size: 1.05rem; font-weight: 800; }
.muted { color: #6b7280; font-size: .88rem; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- forms ---------- */
label.field { display: block; margin-bottom: 12px; font-size: .85rem; font-weight: 700; color: #374151; }
label.field span { display: block; margin-bottom: 5px; }
input[type=text], input[type=password], input[type=number], input[type=file], select, textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #d1d5db;
    border-radius: 9px;
    background: #fff;
    font-family: inherit;
    font-size: .95rem;
    color: #111827;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 8px 0 16px; }
.checks label {
    display: flex; align-items: center; gap: 8px;
    background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 9px;
    padding: 9px 11px; font-size: .88rem; cursor: pointer;
}
.checks input { width: auto; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 18px; border-radius: 9px; border: 1px solid transparent;
    background: #0f766e; color: #fff; font-weight: 700; font-size: .9rem;
    cursor: pointer; font-family: inherit;
}
.btn:hover { background: #115e59; }
.btn.secondary { background: #e5e7eb; color: #111827; border-color: #d1d5db; }
.btn.secondary:hover { background: #d1d5db; }
.btn.danger { background: #dc2626; }
.btn.danger:hover { background: #b91c1c; }
.btn.small { padding: 5px 10px; font-size: .8rem; }

/* ---------- tables ---------- */
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th, table.tbl td {
    padding: 9px 10px;
    border-bottom: 1px solid #eef0f2;
    text-align: right;
    vertical-align: middle;
    font-size: .9rem;
}
table.tbl th { background: #f8fafc; font-size: .8rem; color: #4b5563; font-weight: 800; }
table.tbl tr:hover td { background: #fafcff; }

/* ---------- flash ---------- */
.flash {
    margin: 14px 18px 0;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 700;
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}
.flash.err { border-color: #fecaca; background: #fef2f2; color: #991b1b; }

/* ---------- stats ---------- */
.stat {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}
.stat b { display: block; font-size: 1.6rem; color: #0f766e; }
.stat span { font-size: .82rem; color: #6b7280; }

/* ---------- previews ---------- */
.thumbs-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.thumb-box {
    width: 150px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 8px;
    background: #fafafa;
    text-align: center;
}
.thumb-box img {
    width: 132px; height: 176px;
    object-fit: cover; object-position: center top;
    border-radius: 8px; background: #eee;
    display: block; margin: 0 auto 6px;
}
.thumb-box .cap { font-size: .78rem; color: #6b7280; }
.thumb-box.banner img { width: 220px; height: 90px; object-fit: cover; }
.thumb-box.logo img { width: 120px; height: 90px; object-fit: contain; background: #fff; }

.gallery-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.gallery-item {
    width: 120px; border: 1px solid #e5e7eb; border-radius: 10px;
    padding: 6px; text-align: center; background: #fafafa;
}
.gallery-item img { width: 106px; height: 142px; object-fit: cover; object-position: center top; border-radius: 7px; display: block; margin-bottom: 5px; background: #eee; }
.gallery-item form { margin: 0; }

/* ---------- login ---------- */
.login-wrap {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at 20% 20%, #0f766e 0%, #0f172a 60%, #020617 100%);
}
.login-card {
    width: 100%; max-width: 390px;
    background: #fff; border-radius: 18px;
    padding: 30px 26px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.login-card h1 { margin: 0 0 4px; font-size: 1.3rem; color: #0f172a; }
.login-card p.sub { margin: 0 0 22px; color: #6b7280; font-size: .88rem; }
.login-card .err { margin: 0 0 14px; padding: 10px 12px; border-radius: 9px; background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; font-size: .87rem; font-weight: 700; }
.login-card .btn { width: 100%; margin-top: 6px; }
.login-card .hint { margin-top: 16px; font-size: .78rem; color: #9ca3af; text-align: center; }

@media (max-width: 900px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .cp-panel { padding: 14px; }
    .cp-tabs { padding: 10px 12px 0; }
    .cp-wrap { padding: 0 12px 50px; }
    .flash { margin: 10px 12px 0; }
}

/* ---------- image refresh progress ---------- */
.progress {
    height: 16px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}
.progress > span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #0f766e, #22c55e);
    transition: width .25s ease;
}
.sync-log {
    margin-top: 10px;
    max-height: 180px;
    overflow: auto;
    white-space: pre-wrap;
    font-size: .8rem;
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 8px 10px;
    display: none;
}
.sync-log:not(:empty) { display: block; }
