/* ================================================
   شفاء — admin.css  (responsive edition)
   ================================================ */
:root {
    --honey: #C8760A;
    --amber: #A85A10;
    --gold: #E8A000;
    --light-gold: #FFD060;
    --cream: #FDF6E3;
    --warm-white: #FFFBF0;
    --beige: #EDD9A3;
    --dark-brown: #3D1C02;
    --text: #2C1504;
    --text-light: #7A5C3E;
    --shadow: rgba(61, 28, 2, 0.13);
    --card-bg: #FFFDF5;
    --border: #E8C97A;
    --sb-bg: #2C1504;
    --sb-hover: rgba(255, 255, 255, 0.07);
    --sb-active: rgba(200, 118, 10, 0.25);
    --sb-text: rgba(255, 255, 255, 0.82);
    --sb-w: 240px;
    --topbar-h: 62px;
    --status-new: #3182CE;
    --status-proc: #D97706;
    --status-done: #38A169;
    --status-canc: #E53E3E
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--cream);
    color: var(--text);
    direction: rtl;
    min-height: 100vh
}

/* LOGIN */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FFF9E6, #FFE8A0, #FFC030);
    padding: 1rem
}

.login-card {
    background: #fff;
    border-radius: 24px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(61, 28, 2, .18);
    border: 1px solid var(--border)
}

.login-logo .logo {
    height: 60px;
    width: auto;
    max-width: 100%;
    display: inline-block;
    object-fit: contain;
    filter: drop-shadow(0 3px 8px rgba(61, 28, 2, .12));
    transition: .3s
}

.login-title {
    font-family: 'Amiri', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--honey);
    margin-bottom: .2rem
}

.login-sub {
    color: var(--text-light);
    font-size: .9rem;
    margin-bottom: 2rem
}

.login-form {
    text-align: right
}

.lf-group {
    margin-bottom: 1.2rem
}

.lf-group label {
    display: block;
    font-weight: 700;
    font-size: .88rem;
    margin-bottom: .4rem;
    color: var(--text)
}

.lf-group input {
    width: 100%;
    padding: .8rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-family: 'Tajawal', sans-serif;
    font-size: .95rem;
    color: var(--text);
    outline: none;
    transition: border-color .2s, box-shadow .2s
}

.lf-group input:focus {
    border-color: var(--honey);
    box-shadow: 0 0 0 3px rgba(200, 118, 10, .15)
}

.lf-error {
    color: #E53E3E;
    font-size: .78rem;
    margin-top: .35rem;
    min-height: 1em;
    font-weight: 600
}

.pass-wrap {
    position: relative
}

.pass-wrap input {
    padding-left: 2.8rem
}

.pass-eye {
    position: absolute;
    left: .8rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    opacity: .6
}

.pass-eye:hover {
    opacity: 1
}

.login-btn {
    width: 100%;
    margin-top: .5rem;
    padding: 1rem;
    background: var(--honey);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 6px 20px rgba(200, 118, 10, .4)
}

.login-btn:hover {
    background: var(--amber);
    transform: translateY(-2px)
}

.login-hint {
    margin-top: 1.5rem;
    font-size: .78rem;
    color: var(--text-light)
}

/* LAYOUT */
.admin-panel {
    display: flex;
    min-height: 100vh
}

.sidebar {
    width: var(--sb-w);
    background: var(--sb-bg);
    color: var(--sb-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    transition: transform .3s
}

.sidebar.hidden {
    transform: translateX(100%)
}

.sb-logo {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    flex-shrink: 0
}

.sb-logo .logo {
    height: 60px;
    width: auto;
    max-width: 100%;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .2));
    transition: .3s
}

.sb-brand {
    font-family: 'Amiri', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--light-gold);
    line-height: 1
}

.sb-role {
    font-size: .72rem;
    color: rgba(255, 255, 255, .5);
    margin-top: .1rem
}

.sb-nav {
    flex: 1;
    padding: 1rem .7rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
    overflow-y: auto
}

.sb-link {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .75rem 1rem;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--sb-text);
    font-family: 'Tajawal', sans-serif;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    text-align: right;
    position: relative
}

.sb-link:hover {
    background: var(--sb-hover);
    color: #fff
}

.sb-link.active {
    background: var(--sb-active);
    color: var(--light-gold)
}

.sb-link span:first-child {
    font-size: 1.1rem
}

.orders-badge {
    margin-right: auto;
    background: #E53E3E;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: .7rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center
}

.sb-footer {
    padding: 1rem .7rem;
    border-top: 1px solid rgba(255, 255, 255, .1);
    display: flex;
    flex-direction: column;
    gap: .5rem
}

.sb-store-link {
    display: block;
    text-align: center;
    padding: .6rem;
    background: rgba(200, 118, 10, .2);
    color: var(--light-gold);
    border-radius: 10px;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s
}

.sb-store-link:hover {
    background: rgba(200, 118, 10, .35)
}

.sb-logout {
    width: 100%;
    padding: .6rem;
    background: rgba(229, 62, 62, .15);
    color: #FCA5A5;
    border: 1px solid rgba(229, 62, 62, .25);
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s
}

.sb-logout:hover {
    background: rgba(229, 62, 62, .3)
}

.admin-main {
    flex: 1;
    margin-right: var(--sb-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    transition: margin .3s
}

.admin-main::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
    z-index: 150
}

.admin-main.full {
    margin-right: 0
}

/* TOPBAR */
.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--topbar-h);
    background: rgba(253, 246, 227, .96);
    backdrop-filter: blur(14px);
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: 0 1.5rem
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text);
    display: none;
    flex-shrink: 0
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 700;
    flex: 1;
    color: var(--dark-brown);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.topbar-back-btn {
    display: flex;
    align-items: center;
    gap: .4rem;
    background: rgba(200, 118, 10, .1);
    color: var(--honey);
    border: 1.5px solid rgba(200, 118, 10, .25);
    border-radius: 10px;
    padding: .4rem .9rem;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    transition: all .2s;
    white-space: nowrap;
    flex-shrink: 0
}

.topbar-back-btn:hover {
    background: var(--honey);
    color: #fff;
    border-color: var(--honey)
}

.topbar-admin {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .82rem;
    color: var(--text-light);
    flex-shrink: 0
}

.mobile-admin-nav {
    display: none
}

.admin-avatar {
    width: 34px;
    height: 34px;
    background: var(--honey);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem
}

/* PAGES */
.page {
    display: none;
    padding: 1.5rem;
    animation: fadeIn .3s
}

.page.active {
    display: block
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: .8rem
}

.page-header h2 {
    font-family: 'Amiri', serif;
    font-size: 1.8rem;
    color: var(--dark-brown)
}

.settings-card {
    max-width: 640px;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    padding: 1.2rem;
    box-shadow: 0 3px 12px var(--shadow);
}

.page-actions {
    display: flex;
    gap: .8rem;
    align-items: center;
    flex-wrap: wrap
}

/* ORDERS */
.orders-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light)
}

.orders-empty p {
    font-size: 1.1rem;
    margin: .8rem 0 .3rem
}

.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.2rem
}

.order-card {
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 18px;
    padding: 1.2rem;
    transition: all .25s;
    box-shadow: 0 3px 12px var(--shadow)
}

.order-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px var(--shadow)
}

.order-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: .9rem
}

.order-id {
    font-size: .75rem;
    color: var(--text-light)
}

.order-time {
    font-size: .75rem;
    color: var(--text-light)
}

.order-status {
    display: inline-block;
    border-radius: 20px;
    padding: .2rem .7rem;
    font-size: .72rem;
    font-weight: 700;
    margin-top: .3rem
}

.status-new {
    background: rgba(49, 130, 206, .12);
    color: var(--status-new);
    border: 1px solid rgba(49, 130, 206, .3)
}

.status-processing {
    background: rgba(217, 119, 6, .12);
    color: var(--status-proc);
    border: 1px solid rgba(217, 119, 6, .3)
}

.status-done {
    background: rgba(56, 161, 105, .12);
    color: var(--status-done);
    border: 1px solid rgba(56, 161, 105, .3)
}

.status-cancelled {
    background: rgba(229, 62, 62, .12);
    color: var(--status-canc);
    border: 1px solid rgba(229, 62, 62, .3)
}

.order-customer {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: .2rem
}

.order-meta {
    font-size: .82rem;
    color: var(--text-light);
    margin-bottom: .7rem;
    line-height: 1.6
}

.order-items-preview {
    background: rgba(200, 118, 10, .06);
    border-radius: 10px;
    padding: .6rem .8rem;
    margin-bottom: .9rem;
    font-size: .8rem;
    line-height: 1.7;
    border: 1px solid rgba(200, 118, 10, .15)
}

.order-total {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--honey);
    margin-bottom: .9rem
}

.order-card-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap
}

.status-select {
    flex: 1;
    padding: .45rem .7rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-size: .82rem;
    color: var(--text);
    background: var(--card-bg);
    cursor: pointer;
    outline: none;
    min-width: 120px
}

.status-select:focus {
    border-color: var(--honey)
}

/* PRODUCTS TABLE */
.products-table-wrap {
    background: var(--card-bg);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 3px 12px var(--shadow);
    overflow-x: auto
}

.products-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px
}

.products-table thead tr {
    background: linear-gradient(135deg, var(--honey), var(--amber));
    color: #fff
}

.products-table th {
    padding: .9rem 1rem;
    text-align: right;
    font-size: .85rem;
    font-weight: 700;
    white-space: nowrap
}

.products-table td {
    padding: .9rem 1rem;
    font-size: .85rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word
}

.products-table tr:last-child td {
    border-bottom: none
}

.products-table tr:hover td {
    background: rgba(200, 118, 10, .04)
}

.prod-thumb {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--border);
    background: var(--beige);
    vertical-align: middle;
    flex-shrink: 0
}

.prod-thumb--empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    background: rgba(200, 118, 10, .12);
    color: var(--honey);
    box-sizing: border-box
}

.prod-name-cell {
    font-weight: 700;
    max-width: 160px
}

.prod-name-cell small {
    display: block;
    color: var(--text-light);
    font-size: .75rem;
    font-weight: 400;
    margin-top: .15rem
}

.price-pill {
    display: inline-block;
    background: rgba(200, 118, 10, .1);
    color: var(--honey);
    border: 1px solid rgba(200, 118, 10, .25);
    border-radius: 20px;
    padding: .15rem .6rem;
    font-size: .78rem;
    font-weight: 700;
    margin: .1rem
}

.tbl-actions {
    display: flex;
    gap: .4rem
}

/* BUTTONS */
.btn-add {
    background: var(--honey);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: .6rem 1.2rem;
    font-family: 'Tajawal', sans-serif;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 12px rgba(200, 118, 10, .3)
}

.btn-add:hover {
    background: var(--amber);
    transform: translateY(-2px)
}

.btn-edit {
    background: rgba(49, 130, 206, .1);
    color: #2B6CB0;
    border: 1px solid rgba(49, 130, 206, .3);
    border-radius: 8px;
    padding: .35rem .8rem;
    font-family: 'Tajawal', sans-serif;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s
}

.btn-edit:hover {
    background: #2B6CB0;
    color: #fff
}

.btn-del {
    background: rgba(229, 62, 62, .1);
    color: #C53030;
    border: 1px solid rgba(229, 62, 62, .3);
    border-radius: 8px;
    padding: .35rem .8rem;
    font-family: 'Tajawal', sans-serif;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s
}

.btn-del:hover {
    background: #C53030;
    color: #fff
}

.btn-view {
    background: rgba(56, 161, 105, .1);
    color: #276749;
    border: 1px solid rgba(56, 161, 105, .3);
    border-radius: 8px;
    padding: .35rem .8rem;
    font-family: 'Tajawal', sans-serif;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s
}

.btn-view:hover {
    background: #276749;
    color: #fff
}

.btn-danger-sm {
    background: rgba(229, 62, 62, .1);
    color: #C53030;
    border: 1px solid rgba(229, 62, 62, .3);
    border-radius: 10px;
    padding: .5rem 1rem;
    font-family: 'Tajawal', sans-serif;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s
}

.btn-danger-sm:hover {
    background: #C53030;
    color: #fff
}

.btn-cancel {
    background: var(--beige);
    color: var(--text);
    border: none;
    border-radius: 10px;
    padding: .7rem 1.5rem;
    font-family: 'Tajawal', sans-serif;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s
}

.btn-cancel:hover {
    background: var(--border)
}

.btn-save {
    width: 100%;
    padding: 1rem;
    background: var(--honey);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 14px rgba(200, 118, 10, .3);
    margin-top: .5rem
}

.btn-save:hover {
    background: var(--amber);
    transform: translateY(-2px)
}

.filter-select {
    padding: .5rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: .88rem;
    color: var(--text);
    background: var(--card-bg);
    cursor: pointer;
    outline: none
}

.filter-select:focus {
    border-color: var(--honey)
}

/* MODAL */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
    padding: 1rem
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all
}

.modal-box {
    background: var(--warm-white, #FFFBF0);
    border-radius: 22px;
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, .25);
    transform: scale(.93);
    transition: transform .25s;
    border: 1px solid var(--border)
}

.modal-overlay.open .modal-box {
    transform: scale(1)
}

.modal-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.6rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--honey), var(--amber));
    border-radius: 22px 22px 0 0
}

.modal-hdr h3 {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700
}

.modal-close {
    background: rgba(255, 255, 255, .2);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s
}

.modal-close:hover {
    background: rgba(255, 255, 255, .38)
}

.modal-body {
    padding: 1.5rem
}

.mf-group {
    margin-bottom: 1rem
}

.mf-label {
    display: block;
    font-weight: 700;
    font-size: .85rem;
    margin-bottom: .4rem;
    color: var(--text)
}

.mf-input,
.mf-select,
.mf-textarea {
    width: 100%;
    padding: .7rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 11px;
    font-family: 'Tajawal', sans-serif;
    font-size: .92rem;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: border-color .2s, box-shadow .2s
}

.mf-input:focus,
.mf-select:focus,
.mf-textarea:focus {
    border-color: var(--honey);
    box-shadow: 0 0 0 3px rgba(200, 118, 10, .15)
}

.mf-textarea {
    resize: vertical;
    min-height: 80px
}

.mf-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .8rem
}

.mf-hint {
    font-size: .75rem;
    color: var(--text-light);
    margin-top: .3rem
}

.mf-img-preview {
    width: 100%;
    height: 130px;
    border-radius: 12px;
    object-fit: cover;
    border: 1.5px solid var(--border);
    display: none;
    margin-top: .6rem
}

.mf-img-preview.visible {
    display: block
}

/* TESTIMONIALS (admin) */
.tst-subtitle {
    font-size: 1rem;
    font-weight: 800;
    color: var(--honey);
    margin: 0 0 .75rem
}

.tst-package-block {
    margin-bottom: 0
}

.tst-admin-section--package {
    margin-bottom: 1.6rem
}

.tst-admin-section--reviews {
    margin-top: .25rem;
    border-top: 3px dashed rgba(200, 118, 10, .3);
    padding-top: 1.2rem
}

.tst-section-heading {
    margin: 0 0 .35rem;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--honey)
}

.tst-section-lead {
    margin: 0 0 1rem;
    font-size: .86rem;
    color: var(--text-light);
    line-height: 1.6
}

.tst-slot-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem
}

.tst-move-btn {
    min-width: 2rem;
    height: 2rem;
    padding: 0 .4rem;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--card-bg);
    font-size: .95rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text)
}

.tst-move-btn:hover {
    border-color: var(--gold);
    background: rgba(212, 175, 55, .08)
}

.tst-img-upload {
    margin-bottom: 1rem
}

.tst-img-upload .mf-img-preview,
.tst-mf-preview {
    max-width: 100%
}

.tst-review-card {
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
    background: #fff;
    box-shadow: 0 2px 10px rgba(61, 28, 2, .06)
}

#tst-reviews-container {
    display: grid;
    gap: .95rem
}

.tst-review-card:not(:last-child) {
    border-bottom-width: 2px
}

.tst-review-card .tst-img-upload:last-of-type {
    margin-bottom: .35rem
}

.tst-review-imgs-block {
    margin-bottom: .5rem
}

.tst-review-imgs-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .65rem
}

.tst-btn-add-img {
    font-size: .82rem;
    padding: .35rem .75rem
}

.tst-img-slot {
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: .75rem .85rem;
    margin-bottom: .75rem;
    background: rgba(0, 0, 0, .02)
}

.tst-img-slot-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .5rem;
    flex-wrap: wrap
}

.tst-img-slot-label {
    font-size: .8rem;
    font-weight: 700;
    color: var(--honey)
}

.tst-slot-del {
    font-size: .75rem;
    padding: .25rem .5rem
}

.tst-no-imgs-hint {
    margin: 0 0 .75rem;
    font-size: .85rem;
    color: var(--text-light);
    line-height: 1.55
}

.tst-review-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem
}

.tst-review-badge {
    font-size: .78rem;
    font-weight: 800;
    color: var(--honey)
}

/* DISCOUNT SECTION */
.mf-discount-wrap {
    border: 1.5px solid var(--border);
    border-radius: 12px;
    overflow: hidden
}

.mf-discount-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .7rem 1rem;
    background: rgba(229, 62, 62, .05);
    cursor: pointer;
    font-size: .88rem;
    font-weight: 700;
    color: #C53030;
    user-select: none;
    border-bottom: 1px solid transparent;
    transition: background .2s
}

.mf-discount-header:hover {
    background: rgba(229, 62, 62, .1)
}

.mf-disc-arrow {
    font-size: .75rem
}

.mf-discount-body {
    padding: .9rem 1rem
}

.disc-preview {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-top: .6rem;
    padding: .6rem;
    background: rgba(229, 62, 62, .04);
    border-radius: 8px;
    border: 1px dashed rgba(229, 62, 62, .3)
}

/* SIZES / INGREDIENTS */
.sizes-builder,
.ingredients-builder {
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: .8rem
}

.size-row,
.ing-row {
    display: flex;
    gap: .6rem;
    align-items: center;
    margin-bottom: .6rem
}

.size-row input,
.ing-row input {
    flex: 1;
    padding: .55rem .8rem;
    border: 1.5px solid var(--border);
    border-radius: 9px;
    font-family: 'Tajawal', sans-serif;
    font-size: .88rem;
    outline: none
}

.size-row input:focus,
.ing-row input:focus {
    border-color: var(--honey)
}

.size-row .rm-size,
.ing-row .rm-ing {
    background: rgba(229, 62, 62, .1);
    color: #C53030;
    border: none;
    border-radius: 8px;
    padding: .4rem .7rem;
    cursor: pointer;
    font-size: .85rem;
    transition: background .2s;
    flex-shrink: 0
}

.size-row .rm-size:hover,
.ing-row .rm-ing:hover {
    background: #C53030;
    color: #fff
}

.add-size-btn,
.add-ing-btn {
    background: rgba(200, 118, 10, .1);
    color: var(--honey);
    border: 1px dashed var(--honey);
    border-radius: 9px;
    padding: .45rem .9rem;
    font-family: 'Tajawal', sans-serif;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s
}

.add-size-btn:hover,
.add-ing-btn:hover {
    background: var(--honey);
    color: #fff
}

/* IMAGE UPLOAD */
.img-source-tabs {
    display: flex;
    gap: .5rem;
    margin-bottom: .5rem
}

.img-src-btn {
    flex: 1;
    padding: .45rem .8rem;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    color: var(--text)
}

.img-src-btn:hover {
    border-color: var(--honey);
    color: var(--honey)
}

.img-src-btn.active {
    background: var(--honey);
    border-color: var(--honey);
    color: #fff
}

.file-upload-label {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .8rem 1rem;
    background: rgba(200, 118, 10, .06);
    border: 2px dashed var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all .2s;
    font-size: .9rem;
    color: var(--text-light)
}

.file-upload-label:hover {
    border-color: var(--honey);
    color: var(--honey);
    background: rgba(200, 118, 10, .1)
}

.file-upload-icon {
    font-size: 1.4rem
}

/* TOAST */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--dark-brown);
    color: var(--light-gold);
    padding: .8rem 1.8rem;
    border-radius: 30px;
    font-weight: 700;
    z-index: 9999;
    transition: transform .3s;
    white-space: nowrap;
    font-size: .92rem
}

.toast.show {
    transform: translateX(-50%) translateY(0)
}

/* RESPONSIVE */
@media(max-width:900px) {
    :root {
        --sb-w: 220px
    }

    html,
    body {
        overflow-x: hidden
    }

    .sidebar {
        display: none !important
    }

    .admin-main {
        margin-right: 0;
        width: 100%
    }

    .sidebar-toggle {
        display: none !important
    }

    .page {
        padding: 1.1rem
    }

    .page-header h2 {
        font-size: 1.45rem
    }

    .page-header {
        align-items: flex-start;
        gap: .7rem;
        margin-bottom: 1.1rem
    }

    .page-header h2 {
        line-height: 1.25
    }

    .page-header .page-actions,
    .page-header>.btn-add {
        margin-right: auto
    }

    .products-table {
        min-width: 760px;
        table-layout: auto
    }
}

@media(max-width:768px) {

    html,
    body {
        overflow-x: hidden
    }

    .mf-row {
        grid-template-columns: 1fr
    }

    .orders-grid {
        grid-template-columns: 1fr
    }

    .page {
        padding: 1rem
    }

    .page-header {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: .65rem;
        margin-bottom: .95rem
    }

    .page-header h2 {
        width: 100%;
        font-size: 1.2rem;
        margin: 0
    }

    .admin-topbar {
        padding: .5rem .8rem;
        gap: .5rem;
        height: auto;
        min-height: var(--topbar-h);
        flex-wrap: wrap;
        align-items: center
    }

    .topbar-title {
        font-size: .98rem;
        flex: 1 1 100%;
        order: 1
    }

    .topbar-back-btn {
        padding: .35rem .65rem;
        font-size: .78rem;
        order: 2
    }

    .topbar-admin {
        order: 3;
        margin-right: auto
    }

    .mobile-admin-nav {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .45rem;
        padding: .55rem .85rem .2rem;
        background: var(--warm-white);
        border-bottom: 1px solid var(--border)
    }

    .mnav-btn {
        border: 1.5px solid var(--border);
        background: #fff;
        color: var(--text);
        border-radius: 10px;
        min-height: 38px;
        padding: .35rem .6rem;
        font-family: 'Tajawal', sans-serif;
        font-size: .82rem;
        font-weight: 700;
        cursor: pointer
    }

    .mnav-btn.active {
        background: var(--honey);
        border-color: var(--honey);
        color: #fff
    }

    .page-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: .5rem
    }

    .page-actions .filter-select,
    .page-actions .btn-danger-sm,
    .page-actions .btn-add {
        width: 100%
    }

    .page-header>.btn-add {
        width: 100%;
        justify-content: center
    }

    .products-table-wrap {
        border-radius: 14px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        background: #fff
    }

    .products-table th,
    .products-table td {
        padding: .7rem .75rem;
        font-size: .81rem;
        white-space: nowrap
    }

    .modal-box {
        width: calc(100vw - 1rem) !important;
        max-width: calc(100vw - 1rem) !important;
        max-height: calc(100vh - 1rem);
        margin: .5rem auto
    }

    .modal-overlay {
        align-items: flex-start;
        overflow-y: auto;
        padding: .7rem
    }

    .modal-box {
        margin: .45rem auto;
        max-height: none;
        overflow-x: hidden
    }

    .modal-hdr {
        padding: .9rem 1rem
    }

    .modal-hdr h3 {
        font-size: 1rem
    }

    .modal-body {
        padding: .95rem
    }

    .mf-group {
        margin-bottom: .8rem
    }

    .mf-group .mf-label {
        font-size: .84rem
    }

    .mf-input,
    .mf-textarea,
    .mf-select {
        font-size: .9rem;
        padding: .62rem .75rem
    }

    .size-row,
    .ing-row {
        flex-wrap: wrap;
        align-items: stretch
    }

    .size-row input,
    .ing-row input {
        min-width: 0;
        flex: 1 1 140px
    }

    .size-row .rm-size,
    .ing-row .rm-ing {
        width: 100%
    }

    .topbar-admin span:last-child {
        display: none
    }
}

@media(max-width:480px) {
    .login-card {
        padding: 2rem 1.2rem
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: .5rem;
        margin-bottom: .8rem
    }

    .page-header h2 {
        font-size: 1.06rem;
        line-height: 1.3
    }

    .page-header .btn-add,
    .page-header .filter-select,
    .page-header .btn-danger-sm {
        min-height: 42px
    }

    .admin-topbar {
        height: auto;
        min-height: var(--topbar-h);
        padding: .5rem .65rem
    }

    .topbar-title {
        font-size: .9rem
    }

    .orders-grid {
        grid-template-columns: 1fr
    }

    .modal-box {
        width: 96vw;
        max-height: 95vh;
        border-radius: 14px
    }

    .modal-body {
        padding: .9rem
    }

    .products-table {
        min-width: 700px;
        table-layout: auto
    }

    .products-table th,
    .products-table td {
        padding: .62rem .6rem;
        font-size: .78rem;
        white-space: nowrap
    }

    .mobile-admin-nav {
        grid-template-columns: 1fr;
        padding: .45rem .65rem .15rem
    }

    .tbl-actions {
        flex-direction: column
    }

    .tbl-actions .btn-edit,
    .tbl-actions .btn-del {
        width: 100%
    }

    .order-card-actions {
        flex-direction: column
    }

    .status-select {
        width: 100%
    }

    .topbar-back-btn {
        padding: .3rem .55rem;
        font-size: .72rem
    }

    .toast {
        width: calc(100vw - 1.2rem);
        max-width: 420px;
        white-space: normal;
        text-align: center;
        padding: .72rem .9rem;
        border-radius: 14px
    }
}

/* هيدر كل قسم (عنوان + زر الحفظ جنب بعض) */
.tst-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
    flex-wrap: wrap;
}

.tst-section-header>div {
    flex: 1;
    min-width: 0;
}

/* زر حفظ القسم (التغليف أو الآراء) */
.btn-save-section {
    flex-shrink: 0;
    padding: .55rem 1.1rem;
    background: var(--honey);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: 'Tajawal', sans-serif;
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 3px 10px rgba(200, 118, 10, .3);
    white-space: nowrap;
    align-self: flex-start;
}

.btn-save-section:hover {
    background: var(--amber);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(200, 118, 10, .4);
}

.btn-save-section:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* نسخة خضراء لزر حفظ الآراء */
.btn-save-section--green {
    background: #38A169;
    box-shadow: 0 3px 10px rgba(56, 161, 105, .3);
}

.btn-save-section--green:hover {
    background: #276749;
    box-shadow: 0 6px 16px rgba(56, 161, 105, .4);
}

/* زر "حفظ الكل" في هيدر الصفحة */
.btn-save-all {
    padding: .6rem 1.3rem;
    background: linear-gradient(135deg, var(--honey), var(--amber));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: 'Tajawal', sans-serif;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 14px rgba(200, 118, 10, .35);
    white-space: nowrap;
}

.btn-save-all:hover {
    opacity: .9;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(200, 118, 10, .45);
}

/* تحسين مسافة بين الكارتين */
.tst-admin-section--package {
    margin-bottom: 1.25rem;
}

.tst-admin-section--reviews {
    margin-top: 0;
}

/* على الموبايل: الأزرار تاخد العرض الكامل */
@media (max-width: 600px) {
    .tst-section-header {
        flex-direction: column;
        gap: .6rem;
    }

    .btn-save-section,
    .btn-save-all {
        width: 100%;
        justify-content: center;
    }
}

/* ================================================
   SCROLLBAR & DISCOUNT & ACCORDION
   ================================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(207, 119, 4, 0.747);
    border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(200, 118, 10, 0.5);
}

.price-pill.discounted {
    background: #FFF5F5;
    color: #E53E3E;
    border-color: #FEB2B2;
}

details.tst-accordion {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 0.8rem;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
details.tst-accordion:hover {
    box-shadow: 0 4px 12px var(--shadow);
}
details.tst-accordion > summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    background: rgba(200, 118, 10, 0.05);
    font-weight: 700;
    user-select: none;
    list-style: none;
}
details.tst-accordion > summary::-webkit-details-marker {
    display: none;
}
details.tst-accordion > summary::after {
    content: '▼';
    font-size: 0.8rem;
    color: var(--honey);
    transition: transform 0.3s;
}
details.tst-accordion[open] > summary::after {
    transform: rotate(180deg);
}
.tst-accordion-content {
    padding: 1.2rem;
    border-top: 1px solid var(--border);
}