﻿/* ============================================================
   ميدان السرعة للصناعة — لوحة الإدارة
   Premium / luxury UI • RTL • Navy + Gold on warm ivory
   ============================================================ */

:root {
    --navy: #0f2745;
    --navy-2: #0a1c34;
    --navy-soft: #1b3a63;
    --gold: #c9a24b;
    --gold-2: #b1863a;
    --ivory: #f6f2ea;
    --card: #ffffff;
    --line: #ece6da;
    --ink: #1f2a37;
    --muted: #8a8578;
    --green: #2f8f5b;
    --red: #c0453f;
    --shadow: 0 10px 34px rgba(15, 39, 69, .06);
    --shadow-hover: 0 18px 44px rgba(15, 39, 69, .12);
    --radius: 18px;
    --side-w: 280px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--ivory);
    color: var(--ink);
    font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

h1, h2, h3, .display {
    font-family: 'El Messiri', 'Tajawal', serif;
}

/* ---------- Shell ---------- */
.adm-shell {
    display: flex;
    min-height: 100vh;
}

/* ---------- Sidebar (right / RTL) ---------- */
.adm-side {
    width: var(--side-w);
    background: radial-gradient(120% 60% at 100% 0%, rgba(201,162,75,.10), transparent 60%), linear-gradient(180deg, var(--navy), var(--navy-2));
    color: #d7ddea;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 20;
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    border-left: 1px solid rgba(255,255,255,.05);
}

.adm-brand {
    padding: 30px 24px 24px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

    .adm-brand img {
        width: 92px;
        height: auto;
        margin-bottom: 12px;
        filter: drop-shadow(0 6px 14px rgba(0,0,0,.35));
    }

    .adm-brand .name {
        font-family: 'El Messiri', serif;
        font-size: 18px;
        font-weight: 700;
        color: #fff;
        letter-spacing: .3px;
    }

    .adm-brand .sub {
        font-size: 11px;
        color: var(--gold);
        letter-spacing: 3px;
        margin-top: 4px;
        text-transform: uppercase;
    }

.adm-nav {
    list-style: none;
    margin: 0;
    padding: 18px 14px;
    flex: 1;
    overflow-y: auto;
}

    .adm-nav li a {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 14px 16px;
        margin: 3px 0;
        color: #c3cbdb;
        font-size: 15px;
        font-weight: 500;
        border-radius: 12px;
        position: relative;
        transition: background .18s, color .18s, transform .18s;
    }

        .adm-nav li a i {
            width: 22px;
            text-align: center;
            font-size: 17px;
            color: #8fa0bd;
            transition: color .18s;
        }

        .adm-nav li a:hover {
            background: rgba(255,255,255,.05);
            color: #fff;
        }

            .adm-nav li a:hover i {
                color: var(--gold);
            }

        .adm-nav li a.active {
            background: linear-gradient(90deg, rgba(201,162,75,.16), rgba(201,162,75,.02));
            color: #fff;
        }

            .adm-nav li a.active i {
                color: var(--gold);
            }

            .adm-nav li a.active::before {
                content: "";
                position: absolute;
                right: -14px;
                top: 18%;
                bottom: 18%;
                width: 4px;
                border-radius: 4px;
                background: var(--gold);
            }

.adm-side-foot {
    padding: 18px 24px;
    font-size: 12px;
    color: #7d89a3;
    border-top: 1px solid rgba(255,255,255,.07);
    text-align: center;
}

/* ---------- Main ---------- */
.adm-main {
    flex: 1;
    margin-right: var(--side-w);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.adm-top {
    height: 74px;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 10;
}

    .adm-top .left {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .adm-top h1 {
        font-size: 21px;
        margin: 0;
        font-weight: 700;
        color: var(--navy);
    }

.adm-burger {
    display: none;
    background: none;
    border: none;
    font-size: 21px;
    color: var(--navy);
    cursor: pointer;
}

.adm-user {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--muted);
}

    .adm-user .who {
        display: flex;
        flex-direction: column;
        line-height: 1.3;
        text-align: left;
    }

        .adm-user .who b {
            color: var(--ink);
            font-size: 14px;
        }

        .adm-user .who span {
            font-size: 11px;
            color: var(--gold);
            letter-spacing: 1px;
        }

.adm-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy-soft), var(--navy));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    border: 2px solid var(--gold);
}

.adm-logout {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
    width: 40px;
    height: 40px;
    border-radius: 11px;
    cursor: pointer;
    font-size: 15px;
    transition: all .18s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .adm-logout:hover {
        background: #f7ecec;
        border-color: #e2c2c0;
        color: var(--red);
    }

.adm-content {
    padding: 32px 30px;
    animation: rise .4s cubic-bezier(.2,.7,.2,1);
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.page-head {
    margin-bottom: 26px;
}

    .page-head h2 {
        font-size: 26px;
        margin: 0 0 4px;
        color: var(--navy);
        font-weight: 700;
    }

    .page-head p {
        margin: 0;
        color: var(--muted);
        font-size: 14px;
    }

/* ---------- Cards ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: var(--shadow);
}

    .card + .card {
        margin-top: 22px;
    }

.card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

    .card-title i {
        color: var(--gold);
    }

/* ---------- Stat cards ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    margin-bottom: 26px;
}

.stat {
    position: relative;
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 18px;
    transition: transform .2s, box-shadow .2s;
}

    .stat::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        height: 3px;
        background: linear-gradient(90deg, var(--gold), transparent);
        opacity: .8;
    }

    .stat:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-hover);
    }

    .stat .ico {
        width: 58px;
        height: 58px;
        border-radius: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        flex-shrink: 0;
    }

        .stat .ico.navy {
            background: rgba(15,39,69,.08);
            color: var(--navy);
        }

        .stat .ico.gold {
            background: rgba(201,162,75,.14);
            color: var(--gold-2);
        }

        .stat .ico.green {
            background: rgba(47,143,91,.12);
            color: var(--green);
        }

        .stat .ico.red {
            background: rgba(192,69,63,.10);
            color: var(--red);
        }

    .stat .num {
        font-size: 30px;
        font-weight: 800;
        color: var(--ink);
        line-height: 1;
        font-family: 'Tajawal';
    }

    .stat .lbl {
        font-size: 13px;
        color: var(--muted);
        margin-top: 6px;
    }

/* ---------- Buttons ---------- */
.btn {
    background: var(--navy);
    color: #fff;
    border: none;
    padding: 12px 22px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    letter-spacing: .3px;
    transition: all .18s;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    box-shadow: 0 6px 16px rgba(15,39,69,.16);
}

    .btn:hover {
        background: var(--navy-2);
        transform: translateY(-1px);
        box-shadow: 0 10px 22px rgba(15,39,69,.22);
    }

.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-2));
    color: #2a2410;
    box-shadow: 0 6px 16px rgba(201,162,75,.3);
}

    .btn-gold:hover {
        filter: brightness(1.04);
        background: linear-gradient(135deg, var(--gold), var(--gold-2));
    }

.btn-ghost {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink);
    box-shadow: none;
}

    .btn-ghost:hover {
        background: #f3efe6;
        box-shadow: none;
    }

/* ---------- Forms ---------- */
.field {
    margin-bottom: 18px;
}

    .field label {
        display: block;
        font-size: 13px;
        font-weight: 700;
        color: var(--navy);
        margin-bottom: 8px;
    }

.input, select.input, textarea.input {
    width: 100%;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    background: #fdfcf9;
    color: var(--ink);
    transition: border-color .18s, box-shadow .18s, background .18s;
}

    .input:focus, select.input:focus, textarea.input:focus {
        outline: none;
        border-color: var(--gold);
        background: #fff;
        box-shadow: 0 0 0 4px rgba(201,162,75,.14);
    }

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

    .filter-bar .field {
        margin-bottom: 0;
    }

/* ---------- Table ---------- */
.table-wrap {
    overflow-x: auto;
    border-radius: 14px;
}

table.grid {
    width: 100%;
    border-collapse: collapse;
}

    table.grid th {
        text-align: right;
        background: #faf7f1;
        color: var(--muted);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 1px;
        padding: 15px 16px;
        border-bottom: 1px solid var(--line);
        white-space: nowrap;
        text-transform: uppercase;
    }

    table.grid td {
        padding: 16px;
        border-bottom: 1px solid var(--line);
        font-size: 14px;
    }

    table.grid tbody tr {
        transition: background .15s;
    }

        table.grid tbody tr:hover td {
            background: #fbf9f4;
        }

        table.grid tbody tr:last-child td {
            border-bottom: none;
        }

    table.grid .empty {
        text-align: center;
        color: var(--muted);
        padding: 54px;
        font-size: 15px;
    }

    table.grid .order-id {
        font-weight: 800;
        color: var(--navy);
    }

/* ---------- Badge ---------- */
.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 30px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 3px 8px rgba(0,0,0,.12);
}

/* ---------- Alerts ---------- */
.alert {
    border-radius: 12px;
    padding: 13px 16px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}

.alert-error {
    background: #f9eae9;
    color: #a1332e;
    border: 1px solid #e6c2c0;
}

.alert-ok {
    background: #e9f4ee;
    color: #216c45;
    border: 1px solid #bfe3cd;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .adm-side {
        transform: translateX(100%);
        box-shadow: -20px 0 50px rgba(0,0,0,.3);
    }

        .adm-side.open {
            transform: translateX(0);
        }

    .adm-main {
        margin-right: 0;
    }

    .adm-burger {
        display: inline-block;
    }

    .adm-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(10,20,35,.5);
        backdrop-filter: blur(2px);
        z-index: 15;
        display: none;
    }

        .adm-backdrop.show {
            display: block;
        }
}

/* ============================================================
   Login — split-screen, world-class
   ============================================================ */
.login-page {
    display: flex;
    min-height: 100vh;
}

.login-brand {
    flex: 1.15;
    position: relative;
    overflow: hidden;
    background: radial-gradient(90% 70% at 80% 15%, rgba(201,162,75,.16), transparent 55%), linear-gradient(150deg, var(--navy), var(--navy-2));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    padding: 40px;
    text-align: center;
}

    .login-brand::before, .login-brand::after {
        content: "";
        position: absolute;
        border: 1px solid rgba(201,162,75,.18);
        border-radius: 50%;
    }

    .login-brand::before {
        width: 560px;
        height: 560px;
        top: -160px;
        right: -160px;
    }

    .login-brand::after {
        width: 380px;
        height: 380px;
        bottom: -120px;
        left: -120px;
        border-color: rgba(255,255,255,.06);
    }

    .login-brand .inner {
        position: relative;
        z-index: 2;
    }

    .login-brand img {
        width: 190px;
        height: auto;
        margin-bottom: 26px;
        filter: drop-shadow(0 14px 30px rgba(0,0,0,.4));
    }

    .login-brand h1 {
        font-family: 'El Messiri', serif;
        font-size: 34px;
        margin: 0 0 10px;
        font-weight: 700;
    }

    .login-brand .tag {
        color: #c3cbdb;
        font-size: 16px;
        max-width: 360px;
        line-height: 1.9;
        margin: 0 auto;
    }

    .login-brand .rule {
        width: 70px;
        height: 3px;
        background: var(--gold);
        border-radius: 3px;
        margin: 22px auto 0;
    }

.login-form {
    flex: .85;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ivory);
    padding: 40px;
}

.login-box {
    width: 520px;
    max-width: 100%;
    animation: rise .45s ease;
}

    .login-box .welcome {
        font-size: 13px;
        color: var(--gold-2);
        font-weight: 700;
        letter-spacing: 2px;
        text-transform: uppercase;
    }

    .login-box h2 {
        font-family: 'El Messiri', serif;
        font-size: 30px;
        color: var(--navy);
        margin: 6px 0 6px;
    }

    .login-box .hint {
        color: var(--muted);
        font-size: 14px;
        margin: 0 0 30px;
    }

    .login-box .btn-login {
        width: 100%;
        background: linear-gradient(135deg, var(--gold), var(--gold-2));
        color: #2a2410;
        border: none;
        padding: 15px;
        border-radius: 13px;
        font-weight: 800;
        font-size: 16px;
        cursor: pointer;
        font-family: inherit;
        margin-top: 8px;
        letter-spacing: .5px;
        box-shadow: 0 10px 26px rgba(201,162,75,.32);
        transition: all .18s;
    }

        .login-box .btn-login:hover {
            transform: translateY(-2px);
            box-shadow: 0 14px 32px rgba(201,162,75,.42);
        }

@media (max-width: 820px) {
    .login-page {
        flex-direction: column;
    }

    .login-brand {
        flex: none;
        padding: 46px 24px;
    }

        .login-brand img {
            width: 130px;
            margin-bottom: 18px;
        }

        .login-brand h1 {
            font-size: 26px;
        }

        .login-brand .tag {
            display: none;
        }

    .login-form {
        flex: none;
        padding: 34px 24px 54px;
    }

    .login-box {
        margin: 0 auto;
    }
}

/* ---------- Sidebar section groups ---------- */
.adm-nav .nav-group {
    padding: 16px 20px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #6c7a94;
    text-transform: uppercase;
}

    .adm-nav .nav-group:first-child {
        padding-top: 6px;
    }

.adm-nav .badge-soon {
    margin-right: auto;
    background: rgba(201,162,75,.16);
    color: var(--gold);
    font-size: 9px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 1px;
}

/* ---------- Sidebar custom scrollbar (matches navy + gold) ---------- */
.adm-nav {
    scrollbar-width: thin;
    scrollbar-color: rgba(201,162,75,.45) transparent;
}

    .adm-nav::-webkit-scrollbar {
        width: 7px;
    }

    .adm-nav::-webkit-scrollbar-track {
        background: transparent;
        margin: 6px 0;
    }

    .adm-nav::-webkit-scrollbar-thumb {
        background: linear-gradient(180deg, rgba(201,162,75,.55), rgba(201,162,75,.25));
        border-radius: 10px;
        border: 1px solid rgba(255,255,255,.05);
    }

        .adm-nav::-webkit-scrollbar-thumb:hover {
            background: rgba(201,162,75,.75);
        }

/* ---------- Login form wrapped in a raised card ---------- */
.login-box .login-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 34px 32px;
    box-shadow: 0 22px 60px rgba(15,39,69,.14);
}


.ord-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 22px;
    align-items: start;
}

.info-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 14px;
}

    .info-row:last-child {
        border-bottom: none;
    }

    .info-row .k {
        color: var(--muted);
    }

    .info-row .v {
        font-weight: 600;
        color: var(--ink);
        text-align: left;
    }

.timeline {
    position: relative;
    padding-right: 22px;
}

    .timeline::before {
        content: "";
        position: absolute;
        right: 6px;
        top: 6px;
        bottom: 6px;
        width: 2px;
        background: var(--line);
    }

.tl-item {
    position: relative;
    padding: 0 0 20px;
}

    .tl-item:last-child {
        padding-bottom: 0;
    }

.tl-dot {
    position: absolute;
    right: -22px;
    top: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--line);
}

.tl-status {
    font-weight: 700;
    color: var(--navy);
    font-size: 14px;
}

.tl-meta {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

@media (max-width:900px) {
    .ord-grid {
        grid-template-columns: 1fr;
    }
}

.ord-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 22px;
    align-items: start;
}

.info-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 14px;
}

    .info-row:last-child {
        border-bottom: none;
    }

    .info-row .k {
        color: var(--muted);
    }

    .info-row .v {
        font-weight: 600;
        color: var(--ink);
        text-align: left;
    }

.timeline {
    position: relative;
    padding-right: 22px;
}

    .timeline::before {
        content: "";
        position: absolute;
        right: 6px;
        top: 6px;
        bottom: 6px;
        width: 2px;
        background: var(--line);
    }

.tl-item {
    position: relative;
    padding: 0 0 20px;
}

    .tl-item:last-child {
        padding-bottom: 0;
    }

.tl-dot {
    position: absolute;
    right: -22px;
    top: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--line);
}

.tl-status {
    font-weight: 700;
    color: var(--navy);
    font-size: 14px;
}

.tl-meta {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

@media (max-width:900px) {
    .ord-grid {
        grid-template-columns: 1fr;
    }
}

.grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.img-preview {
    width: 150px;
    height: 150px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid var(--line);
    background: #faf7f1;
}

.upload-note {
    font-size: 12px;
    color: var(--muted);
    margin-top: 8px;
}

@media (max-width:760px) {
    .grid2 {
        grid-template-columns: 1fr;
    }
}
/* ============================================================
   [إضافة] منطقة رفع احترافية (dropzone) + معاينة
   ============================================================ */
.uploader {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}

.dropzone {
    flex: 1;
    min-width: 260px;
    position: relative;
    border: 2px dashed #d9d0be;
    border-radius: 14px;
    background: #fdfbf6;
    padding: 26px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s, transform .1s;
}

    .dropzone:hover {
        border-color: var(--gold);
        background: #fbf7ee;
    }

    .dropzone.dragover {
        border-color: var(--gold);
        background: #f8f1e0;
        transform: scale(1.01);
    }

    .dropzone input[type=file] {
        position: absolute;
        inset: 0;
        opacity: 0;
        cursor: pointer;
    }

    .dropzone .dz-ico {
        font-size: 34px;
        color: var(--gold);
        margin-bottom: 10px;
    }

    .dropzone .dz-title {
        font-weight: 700;
        color: var(--navy);
        font-size: 15px;
    }

    .dropzone .dz-sub {
        font-size: 12px;
        color: var(--muted);
        margin-top: 6px;
    }

    .dropzone .dz-file {
        font-size: 13px;
        color: var(--green);
        font-weight: 700;
        margin-top: 10px;
        display: none;
    }

        .dropzone .dz-file.show {
            display: block;
        }

.up-preview-wrap {
    text-align: center;
}

.up-preview {
    width: 150px;
    height: 150px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid var(--line);
    background: #faf7f1;
    box-shadow: var(--shadow);
}

.up-preview-lbl {
    font-size: 11px;
    color: var(--muted);
    margin-top: 8px;
    letter-spacing: 1px;
}

/* ============================================================
   [إضافة] المحرّر المُقيّد (governed content editor)
   ============================================================ */
.ge-wrap {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.ge-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    background: #faf7f1;
    border-bottom: 1px solid var(--line);
}

.ge-btn {
    background: #fff;
    border: 1px solid var(--line);
    color: var(--navy);
    padding: 7px 12px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

    .ge-btn:hover {
        background: var(--navy);
        color: #fff;
        border-color: var(--navy);
    }

    .ge-btn i {
        color: var(--gold);
        font-size: 12px;
    }

    .ge-btn:hover i {
        color: var(--gold);
    }

.ge-toggle {
    margin-right: auto;
    background: rgba(201,162,75,.12);
    border-color: transparent;
    color: var(--gold-2);
}

    .ge-toggle:hover {
        background: var(--gold);
        color: #2a2410;
    }

.ge-wrap textarea.governed-editor {
    width: 100%;
    border: none;
    border-radius: 0;
    padding: 14px;
    font-size: 13px;
    font-family: 'Consolas','Courier New',monospace;
    line-height: 1.7;
    resize: vertical;
    background: #fff;
    direction: ltr;
    text-align: left;
}

    .ge-wrap textarea.governed-editor:focus {
        outline: none;
        box-shadow: none;
    }

.ge-preview {
    padding: 20px;
    border-top: 1px dashed var(--line);
    background: #fff;
    direction: rtl;
}

    .ge-preview img {
        max-width: 100%;
    }

/* ============================================================
   [إضافة] المحرّر المحكوم (Quill) + جدول المواصفات المُنظَّم
   خط واحد وستايل واحد — لا خطوط/أحجام/ألوان حرة
   ============================================================ */
.q-editor .q-surface {
    min-height: 150px;
}

.ql-toolbar.ql-snow {
    border: 1px solid var(--line);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    background: #faf7f1;
    direction: ltr;
}

.ql-container.ql-snow {
    border: 1px solid var(--line);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}
/* نفرض خط الموقع داخل المحرّر والمعاينة — لا يتغيّر أبداً */
.ql-editor {
    font-family: 'Tajawal','Segoe UI',sans-serif !important;
    font-size: 15px !important;
    line-height: 1.9 !important;
    color: var(--ink) !important;
    direction: rtl;
    text-align: right;
    min-height: 150px;
}

    .ql-editor h2 {
        font-family: 'El Messiri',serif !important;
        color: var(--navy) !important;
        font-weight: 800 !important;
        font-size: 20px !important;
    }

    .ql-editor h3 {
        font-family: 'El Messiri',serif !important;
        color: var(--navy) !important;
        font-weight: 700 !important;
        font-size: 17px !important;
    }

    .ql-editor p, .ql-editor li {
        font-family: 'Tajawal',sans-serif !important;
        font-size: 15px !important;
        color: var(--ink) !important;
    }

    .ql-editor strong {
        font-weight: 700 !important;
    }

    .ql-editor .ql-align-right {
        text-align: right;
    }

/* جدول المواصفات المُنظَّم */
.specs-builder {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    background: #fff;
}

.sb-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.sb-row {
    display: grid;
    grid-template-columns: 1fr 1.4fr auto;
    gap: 10px;
    align-items: center;
}

    .sb-row .input {
        margin: 0;
    }

.sb-del {
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--red);
    border-radius: 10px;
    cursor: pointer;
    transition: all .15s;
}

    .sb-del:hover {
        background: #f7ecec;
        border-color: #e2c2c0;
    }


.cust-grid {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 22px;
    align-items: start;
}

.info-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 14px;
}

    .info-row:last-child {
        border-bottom: none;
    }

    .info-row .k {
        color: var(--muted);
    }

    .info-row .v {
        font-weight: 600;
        text-align: left;
    }

@media (max-width:900px) {
    .cust-grid {
        grid-template-columns: 1fr;
    }
}


.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 22px;
}

.tab {
    padding: 11px 22px;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--navy);
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
}

    .tab.active {
        background: var(--navy);
        color: #fff;
        border-color: var(--navy);
    }

.perm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(230px,1fr));
    gap: 12px;
}

.perm-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fdfbf6;
}

.modal-back {
    position: fixed;
    inset: 0;
    background: rgba(10,20,35,.5);
    backdrop-filter: blur(2px);
    z-index: 40;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    overflow: auto;
}

.modal-card {
    background: #fff;
    border-radius: 16px;
    width: 640px;
    max-width: 100%;
    box-shadow: var(--shadow-lg);
}

.modal-head {
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .modal-head h3 {
        margin: 0;
        font-family: 'El Messiri',serif;
        color: var(--navy);
    }

.modal-body {
    padding: 24px;
}

.modal-foot {
    padding: 18px 24px;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

.modal-back {
    position: fixed;
    inset: 0;
    background: rgba(10,20,35,.5);
    backdrop-filter: blur(2px);
    z-index: 40;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    overflow: auto;
}

.modal-card {
    background: #fff;
    border-radius: 16px;
    width: 560px;
    max-width: 100%;
    box-shadow: var(--shadow-lg);
}

.modal-head {
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
}

    .modal-head h3 {
        margin: 0;
        font-family: 'El Messiri',serif;
        color: var(--navy);
    }

.modal-body {
    padding: 24px;
}

.modal-foot {
    padding: 18px 24px;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 10px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(150px,1fr));
    gap: 16px;
}

.media-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow);
}

    .media-item img {
        width: 100%;
        height: 150px;
        object-fit: cover;
        display: block;
    }

.media-name {
    padding: 8px 10px;
    font-size: 11px;
    color: var(--muted);
    direction: ltr;
    text-align: center;
    word-break: break-all;
    border-top: 1px solid var(--line);
    cursor: pointer;
}

    .media-name:hover {
        color: var(--gold-2);
    }

.grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.img-preview {
    width: 150px;
    height: 150px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid var(--line);
    background: #faf7f1;
}

.upload-note {
    font-size: 12px;
    color: var(--muted);
    margin-top: 8px;
}

@media (max-width:760px) {
    .grid2 {
        grid-template-columns: 1fr;
    }
}

.modal-back {
    position: fixed;
    inset: 0;
    background: rgba(10,20,35,.5);
    backdrop-filter: blur(2px);
    z-index: 40;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    overflow: auto;
}

.modal-card {
    background: #fff;
    border-radius: 16px;
    width: 580px;
    max-width: 100%;
    box-shadow: var(--shadow-lg);
}

.modal-head {
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
}

    .modal-head h3 {
        margin: 0;
        font-family: 'El Messiri',serif;
        color: var(--navy);
    }

.modal-body {
    padding: 24px;
}

.modal-foot {
    padding: 18px 24px;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 10px;
}

.modal-back {
    position: fixed;
    inset: 0;
    background: rgba(10,20,35,.5);
    backdrop-filter: blur(2px);
    z-index: 40;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    overflow: auto;
}

.modal-card {
    background: #fff;
    border-radius: 16px;
    width: 720px;
    max-width: 100%;
    box-shadow: var(--shadow-lg);
}

.modal-head {
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .modal-head h3 {
        margin: 0;
        font-family: 'El Messiri',serif;
        color: var(--navy);
        font-size: 16px;
    }

.modal-body {
    padding: 0;
}

.mail-frame {
    width: 100%;
    height: 60vh;
    border: none;
}

.modal-foot {
    padding: 16px 24px;
    border-top: 1px solid var(--line);
}

.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(170px,1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.kpi {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: var(--shadow);
}

    .kpi .v {
        font-family: 'El Messiri',serif;
        font-size: 26px;
        font-weight: 800;
        color: var(--navy);
    }

    .kpi .l {
        font-size: 12.5px;
        color: var(--muted);
        margin-top: 4px;
    }

.rep-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    align-items: start;
}

@media (max-width:900px) {
    .rep-cols {
        grid-template-columns: 1fr;
    }
}

@media print {
    .adm-side, .adm-top, .filter-bar, .no-print, .btn {
        display: none !important;
    }

    .adm-content, .adm-main, body {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }
}


/* ============================================================
   شريط الترقيم (Paging)
   ============================================================ */
.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 16px 2px 2px;
}

.pager-info {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
}

.pager-btns {
    display: flex;
    align-items: center;
    gap: 6px;
}

    .pager-btns a, .pager-btns span.cur {
        min-width: 38px;
        height: 38px;
        padding: 0 12px;
        border-radius: 9px;
        border: 1px solid var(--line);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 13px;
        background: #fff;
        color: var(--navy);
        text-decoration: none;
        cursor: pointer;
        transition: all .15s;
    }

        .pager-btns a:hover {
            background: var(--navy);
            color: #fff;
            border-color: var(--navy);
        }

    .pager-btns span.cur {
        background: var(--gold);
        color: #2a2410;
        border-color: var(--gold);
    }

    .pager-btns span.disabled {
        opacity: .4;
        pointer-events: none;
    }

.modal-back {
    position: fixed;
    inset: 0;
    background: rgba(10,20,35,.5);
    backdrop-filter: blur(2px);
    z-index: 40;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    overflow: auto;
}

.modal-card {
    background: #fff;
    border-radius: 16px;
    width: 720px;
    max-width: 100%;
    box-shadow: var(--shadow-lg);
}

.modal-head {
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .modal-head h3 {
        margin: 0;
        font-family: 'El Messiri',serif;
        color: var(--navy);
        font-size: 16px;
    }

.modal-body {
    padding: 0;
}

.mail-frame {
    width: 100%;
    height: 60vh;
    border: none;
}

.modal-foot {
    padding: 16px 24px;
    border-top: 1px solid var(--line);
}



.ord-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 22px;
    align-items: start;
}

.info-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 14px;
}

    .info-row:last-child {
        border-bottom: none;
    }

    .info-row .k {
        color: var(--muted);
    }

    .info-row .v {
        font-weight: 600;
        color: var(--ink);
        text-align: left;
    }

.timeline {
    position: relative;
    padding-right: 22px;
}

    .timeline::before {
        content: "";
        position: absolute;
        right: 6px;
        top: 6px;
        bottom: 6px;
        width: 2px;
        background: var(--line);
    }

.tl-item {
    position: relative;
    padding: 0 0 20px;
}

    .tl-item:last-child {
        padding-bottom: 0;
    }

.tl-dot {
    position: absolute;
    right: -22px;
    top: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--line);
}

.tl-status {
    font-weight: 700;
    color: var(--navy);
    font-size: 14px;
}

.tl-meta {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

@media (max-width:900px) {
    .ord-grid {
        grid-template-columns: 1fr;
    }
}