﻿/* =====================================================================
   معمل الجبن — طبقة شكل فوق Vellora (نفس الألوان: كحلي + ذهبي جبني)
   ملف شكل فقط: مفيش أي تغيير في البيانات أو الأحداث أو أسماء الكنترولز
   الطباعة مش بتتأثر (كل حاجة هنا جوه @media screen)
   ===================================================================== */

:root {
    --dl-cream:      #f2f5f9;   /* خلفية الصفحات: رمادي مزرق فاتح مريح للعين */
    --dl-cream-2:    #f8fafc;
    --dl-cheese:     #d9981c;   /* الذهبي */
    --dl-cheese-lt:  #f2c14e;
    --dl-cheese-bg:  #fdf4dd;
    --dl-navy:       #182d4b;
    --dl-navy-2:     #23406a;
    --dl-ink:        #1b2631;
    --dl-muted:      #5e6873;
    --dl-line:       #e2e8f0;
    --dl-shadow:     0 1px 2px rgba(24, 45, 75, .05), 0 6px 18px rgba(24, 45, 75, .06);
    --dl-header-h:   58px;
    --v-bg:          #f2f5f9;
    --v-line:        #e2e8f0;
    --v-hover:       #e8f0fa;   /* لون الوقوف على السطر */
    --v-surface-2:   #f6f8fb;
    --head-bg:       #f6f8fb;
    --head-line:     #cfd8e3;
    --v-row-line:    #e3e9f0;
    --v-input:       #cfd7e1;
    --dl-row-hover:  #e8f0fa;
}

@media screen {

/* ---------- الأساس ---------- */
html, body.v-ui { background-color: var(--dl-cream) !important; }
body.v-ui { zoom: normal !important; }
body.v-ui .wrapper { background-color: var(--dl-cream) !important; overflow-x: hidden; }
body.v-ui .wrapper > br { display: none; }
body.v-ui .content-wrapper { min-height: calc(100vh - var(--dl-header-h)) !important; }
body.v-ui .content-header { padding: 18px 22px 30px !important; }

/* ---------- السايد بار ---------- */
body.v-ui .main-sidebar { width: 230px; box-shadow: -6px 0 24px rgba(10, 20, 40, .12); }
/* المنيو ثابتة بطول الشاشة وبتعمل سكرول لوحدها (لو العناصر أطول من الشاشة) */
@media (min-width: 768px) {
    body.v-ui:not(.sidebar-collapse) .main-sidebar {
        position: fixed !important; top: 0 !important; bottom: 0; right: 0;
        height: 100vh; min-height: 0 !important;
        overflow-y: auto; overflow-x: hidden;
        overscroll-behavior: contain;
        scrollbar-width: thin; scrollbar-color: rgba(217, 152, 28, .5) transparent;
    }
    body.v-ui:not(.sidebar-collapse) .main-sidebar::-webkit-scrollbar { width: 6px; }
    body.v-ui:not(.sidebar-collapse) .main-sidebar::-webkit-scrollbar-thumb { background: rgba(217, 152, 28, .5); border-radius: 6px; }
    body.v-ui:not(.sidebar-collapse) .main-sidebar::after { position: fixed; width: 230px; right: 0; left: auto; }
}
/* التوب بار يبدأ بعد المنيو (مش تحتها) */
@media (min-width: 768px) {
    body.v-ui .main-header { margin-right: 230px !important; margin-left: 0 !important; }
    body.v-ui.sidebar-collapse .main-header { margin-right: 50px !important; }
    /* المنيو المقفولة: اللوجو بس */
    body.v-ui.sidebar-collapse .dl-brand { justify-content: center; padding: 10px 0; }
    body.v-ui.sidebar-collapse .dl-brand-text { display: none; }
    body.v-ui.sidebar-collapse .dl-brand-logo { flex-basis: 34px; width: 34px; height: 34px; border-radius: 9px; }
    body.v-ui.sidebar-collapse .dl-brand-logo svg { width: 22px; height: 22px; }
    body.v-ui.sidebar-collapse .sidebar-menu { padding: 8px 4px 30px !important; }
    body.v-ui.sidebar-collapse .sidebar-menu > li > a { padding: 8px 6px !important; text-align: center; }
    body.v-ui.sidebar-collapse .sidebar-menu > li > a > .fa { margin-left: 0; }
    body.v-ui.sidebar-collapse .main-sidebar::after { display: none; }
}
body.v-ui .main-sidebar .user-panel { padding: 0 !important; border-bottom: 0 !important; }
body.v-ui .main-sidebar .user-panel > img { display: none !important; }

/* نقش خفيف لخروم الجبنة تحت المنيو */
body.v-ui .main-sidebar::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 220px;
    pointer-events: none;
    background:
        radial-gradient(circle at 18% 40%, transparent 0 15px, rgba(242, 193, 78, .14) 16px 17px, transparent 18px),
        radial-gradient(circle at 70% 24%, transparent 0 8px, rgba(242, 193, 78, .12) 9px 10px, transparent 11px),
        radial-gradient(circle at 58% 74%, transparent 0 21px, rgba(242, 193, 78, .12) 22px 23px, transparent 24px),
        radial-gradient(circle at 88% 84%, rgba(242, 193, 78, .08) 0 5px, transparent 6px);
}

/* البراند فوق المنيو */
.dl-brand {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 16px 16px;
    border-bottom: 2px dashed rgba(217, 152, 28, .55);
    background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, 0));
    text-decoration: none !important;
}
.dl-brand-logo {
    flex: 0 0 46px;
    width: 46px; height: 46px;
    border-radius: 12px;
    background: linear-gradient(145deg, #f6cf6a, var(--dl-cheese));
    box-shadow: 0 6px 16px rgba(217, 152, 28, .35), inset 0 1px 0 rgba(255, 255, 255, .4);
    display: flex; align-items: center; justify-content: center;
}
.dl-brand-logo svg { width: 30px; height: 30px; display: block; }
.dl-brand-text { min-width: 0; line-height: 1.3; }
.dl-brand-name {
    display: block;
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dl-brand-sub { display: block; color: #b9c7da; font-size: 12px; font-weight: 600; margin-top: 2px; }
.dl-brand-close {
    display: none;
    position: absolute; left: 10px; top: 12px;
    width: 32px; height: 32px; border-radius: 8px;
    align-items: center; justify-content: center;
    color: #d3dcea !important; background: rgba(255, 255, 255, .06);
    font-size: 16px; text-decoration: none !important;
}

/* عناصر المنيو */
body.v-ui .sidebar-menu { padding: 10px 10px 30px !important; }
body.v-ui .sidebar-menu > li > a { padding: 10px 12px !important; font-weight: 700; font-size: 14.5px !important; }
body.v-ui .sidebar-menu > li > a > .fa,
body.v-ui .sidebar-menu > li > a > i:first-child {
    width: 30px !important; height: 30px; line-height: 30px;
    margin-left: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .06);
    color: var(--dl-cheese-lt) !important;
    opacity: 1 !important;
    font-size: 14px !important;
    text-align: center;
}
body.v-ui .sidebar-menu > li.menu-open > a > .fa,
body.v-ui .sidebar-menu > li.active > a > .fa { background: var(--dl-cheese); color: #2b1d00 !important; }
body.v-ui .sidebar-menu .treeview-menu { padding: 2px 18px 8px 0 !important; position: relative; }
body.v-ui .sidebar-menu .treeview-menu::before {
    content: ""; position: absolute; top: 4px; bottom: 12px; right: 26px;
    border-right: 1px dashed rgba(217, 152, 28, .35);
}
body.v-ui .sidebar-menu .treeview-menu > li > a { padding: 7px 26px 7px 10px !important; font-size: 13.5px !important; color: #c3cfdf !important; }
body.v-ui .sidebar-menu .treeview-menu > li > a > .fa { width: 18px; font-size: 12px; color: #8ea0b8 !important; }
body.v-ui .sidebar-menu .treeview-menu > li > a:hover > .fa,
body.v-ui .sidebar-menu .treeview-menu > li.active > a > .fa { color: var(--dl-cheese-lt) !important; }
body.v-ui .sidebar-menu li.dl-logout { margin-top: 12px; border-top: 1px solid rgba(255, 255, 255, .07); padding-top: 8px; background: transparent !important; }
body.v-ui .sidebar-menu li.dl-logout > a > .fa { background: rgba(176, 50, 61, .25) !important; color: #ffb3ba !important; }
body.v-ui .sidebar-menu li.dl-logout > a:hover { background: rgba(176, 50, 61, .18) !important; }
body.v-ui .sidebar-menu > br { display: none; }

/* ---------- التوب بار ---------- */
body.v-ui .main-header { position: sticky; top: 0; z-index: 1030; box-shadow: 0 1px 0 var(--dl-line), 0 4px 14px rgba(24, 45, 75, .05) !important; border-bottom: 0 !important; }
body.v-ui .main-header .navbar {
    display: flex !important;
    align-items: center;
    gap: 10px;
    min-height: var(--dl-header-h) !important;
    padding: 0 14px !important;
    margin: 0 !important;
    background: rgba(255, 255, 255, .96) !important;
}
body.v-ui .main-header .sidebar-toggle {
    display: inline-flex !important; align-items: center; justify-content: center;
    float: none !important;
    width: 40px; height: 40px; padding: 0 !important;
    border-radius: 10px;
    border: 1px solid var(--dl-line);
    color: var(--dl-navy-2) !important;
    background: #fff;
    order: 0;
}
body.v-ui .main-header .sidebar-toggle::before { content: "\f0c9"; font-family: FontAwesome; font-size: 17px; }
body.v-ui .main-header .sidebar-toggle:hover { border-color: var(--dl-cheese); color: var(--dl-cheese) !important; background: #fff !important; }
.dl-top-title { order: 1; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.dl-page-title { font-size: 18px; font-weight: 800; color: var(--dl-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-crumb { font-size: 12px; font-weight: 600; color: var(--dl-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-crumb .fa { color: var(--dl-cheese) !important; margin-left: 4px; }
.dl-date {
    order: 2;
    display: inline-flex; align-items: center; gap: 6px;
    height: 38px; padding: 0 12px;
    border-radius: 10px;
    background: var(--dl-cheese-bg);
    color: #7a5200;
    font-size: 13px; font-weight: 700; white-space: nowrap;
}
.dl-date .fa { color: var(--dl-cheese) !important; }
body.v-ui .main-header .navbar .v-search-btn,
body.v-ui .main-header .navbar .v-theme-toggle { order: 3; float: none !important; margin: 0 !important; flex: 0 0 auto; }

/* ---------- الكروت ---------- */
body.v-ui .card, body.v-ui .box, body.v-ui .panel {
    border: 1px solid var(--dl-line) !important;
    border-radius: 14px !important;
    box-shadow: var(--dl-shadow) !important;
    overflow: visible;
    margin-bottom: 20px;
}
body.v-ui .card > .card-header,
body.v-ui .box > .box-header {
    display: flex; align-items: center; gap: 10px;
    text-align: right !important;
    padding: 14px 18px !important;
    background: linear-gradient(180deg, var(--dl-cream-2), #fff) !important;
    border-bottom: 1px solid var(--dl-line) !important;
    border-radius: 14px 14px 0 0;
}
body.v-ui .card > .card-header::before,
body.v-ui .box > .box-header::before {
    content: "";
    flex: 0 0 6px; width: 6px; height: 22px;
    border-radius: 4px;
    background: linear-gradient(180deg, var(--dl-cheese-lt), var(--dl-cheese));
}
body.v-ui .card-header .card-title, body.v-ui .card-header strong { font-size: 18px; font-weight: 800; color: var(--dl-ink); }
body.v-ui .card-body { padding: 16px 18px !important; }
body.v-ui .card > .header, body.v-ui .content > .header { padding: 6px 18px 0; }
body.v-ui .card > .header > h4.title,
body.v-ui .header > h4.title {
    display: flex; align-items: center; gap: 10px;
    text-align: right !important;
    font-size: 16px !important; font-weight: 800 !important;
    color: var(--dl-navy-2) !important;
    margin: 10px 0 8px !important;
}
body.v-ui .header > h4.title::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--dl-line); }

/* ---------- الجداول ---------- */
body.v-ui .content-wrapper .table { border-radius: 10px; overflow: hidden; background: #fff; }
body.v-ui .content-wrapper .table > thead > tr > th { font-weight: 800 !important; font-size: 14px; padding: 11px 8px !important; border-left: 0 !important; }
body.v-ui .content-wrapper .table > tbody > tr > td { vertical-align: middle !important; }
body.v-ui .content-wrapper .table-striped > tbody > tr:nth-of-type(odd) > td { background-color: var(--dl-cream-2); }
html body.v-ui .content-wrapper table > tbody > tr:hover > td,
html body.v-ui .content-wrapper table > tbody > tr:hover > th,
html body.v-ui .content-wrapper .v-acc table.table.table > tbody > tr:hover > td { background-color: var(--dl-row-hover) !important; }
body.v-ui .content-wrapper .table-responsive { border: 0 !important; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- الحقول والأزرار ---------- */
body.v-ui .content-wrapper .form-control { border-radius: 9px !important; min-height: 40px; }
body.v-ui .content-wrapper .form-control:focus { border-color: var(--dl-cheese) !important; box-shadow: 0 0 0 3px rgba(217, 152, 28, .18) !important; }
body.v-ui .content-wrapper .btn { border-radius: 10px !important; font-weight: 700; padding-left: 22px; padding-right: 22px; box-shadow: 0 4px 12px rgba(217, 152, 28, .25); }
body.v-ui .content-wrapper .btn-danger { box-shadow: 0 4px 12px rgba(176, 50, 61, .2); }
body.v-ui .content-wrapper .btn-lg { min-width: 160px; }

/* مساحات فاضية ملهاش لازمة: AdminLTE بيدّي كل .content طول 250px حتى لو فاضي */
body.v-ui .content-wrapper .content { min-height: 0 !important; }
body.v-ui .content-wrapper .content > br:first-child,
body.v-ui .content-wrapper .card-body > br:first-child { display: none; }

/* حاويات بوتستراب الثابتة (1170px) تاخد عرض المساحة المتاحة بس */
body.v-ui .content-wrapper .container { width: 100% !important; max-width: 1170px; }

/* رسائل النتيجة */
body.v-ui #ResultMessagediv:not(:empty) { margin-bottom: 14px; }
body.v-ui #ResultMessagediv .alert { border-radius: 12px; border: 0; box-shadow: var(--dl-shadow); }

/* ---------- الصفحة الرئيسية ---------- */
.dl-home { max-width: 1200px; margin: 0 auto; }
.dl-hero {
    position: relative;
    overflow: hidden;
    display: flex; align-items: center; gap: 22px;
    padding: 26px 28px;
    border-radius: 18px;
    color: #fff;
    background:
        radial-gradient(circle at 10% 34%, transparent 0 44px, rgba(242, 193, 78, .22) 45px 46px, transparent 47px),
        radial-gradient(circle at 21% 76%, transparent 0 18px, rgba(242, 193, 78, .18) 19px 20px, transparent 21px),
        radial-gradient(circle at 4% 82%, transparent 0 9px, rgba(242, 193, 78, .16) 10px 11px, transparent 12px),
        radial-gradient(circle at 30% 22%, rgba(242, 193, 78, .10) 0 5px, transparent 6px),
        linear-gradient(120deg, var(--dl-navy) 0%, var(--dl-navy-2) 100%);
    box-shadow: 0 14px 34px rgba(24, 45, 75, .22);
    border-bottom: 4px solid var(--dl-cheese);
}
.dl-hero-logo {
    flex: 0 0 auto;
    width: 104px; height: 104px;
    border-radius: 20px;
    background: #fff;
    padding: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
    display: flex; align-items: center; justify-content: center;
}
.dl-hero-logo img { max-width: 100%; max-height: 100%; width: auto !important; height: auto !important; object-fit: contain; border-radius: 12px; }
.dl-hero-text { min-width: 0; }
.dl-hello { font-size: 14px; font-weight: 700; color: var(--dl-cheese-lt); margin: 0 0 4px; }
.dl-hero h1 { margin: 0 0 6px !important; font-size: 28px !important; font-weight: 800 !important; color: #fff !important; }
.dl-hero p { margin: 0; color: #c9d4e4; font-size: 14.5px; }
.dl-hero-date .fa { color: var(--dl-cheese-lt) !important; }
.dl-hero-date {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 12px; padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(242, 193, 78, .35);
    font-size: 13px; font-weight: 700; color: #f6dfa4;
}

.dl-section-title { display: flex; align-items: center; gap: 10px; margin: 26px 2px 12px; font-size: 16px; font-weight: 800; color: var(--dl-navy-2); }
.dl-section-title::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--dl-line); }
.dl-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
a.dl-tile {
    position: relative;
    display: flex; flex-direction: column; gap: 10px;
    padding: 18px 16px 16px;
    min-height: 128px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--dl-line);
    box-shadow: var(--dl-shadow);
    color: var(--dl-ink) !important;
    text-decoration: none !important;
    transition: box-shadow .15s ease, border-color .15s;
}
a.dl-tile:hover { border-color: var(--dl-cheese); box-shadow: 0 10px 26px rgba(24, 45, 75, .12); }
.dl-tile-ic .fa { color: inherit !important; }
.dl-tile-ic {
    width: 46px; height: 46px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    background: var(--dl-cheese-bg); color: #b07800;
}
.dl-tile.dl-navy .dl-tile-ic { background: #e6ecf4; color: var(--dl-navy-2); }
.dl-tile.dl-green .dl-tile-ic { background: #e3f2ea; color: #1e7a52; }
.dl-tile.dl-red .dl-tile-ic { background: #f8e4e6; color: #b0323d; }
.dl-tile-t { font-size: 15.5px; font-weight: 800; }
.dl-tile-d { font-size: 12.5px; color: var(--dl-muted); font-weight: 600; line-height: 1.5; }
.dl-tile::after {
    content: "\f104"; font-family: FontAwesome;
    position: absolute; left: 16px; top: 18px;
    color: #c3cad3; font-size: 18px; transition: color .15s;
}
.dl-tile:hover::after { color: var(--dl-cheese); }
.dl-flow {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0;
    margin-top: 6px; padding: 16px; border-radius: 14px;
    background: #fff; border: 1px solid var(--dl-line); box-shadow: var(--dl-shadow);
}
.dl-flow-step { position: relative; text-align: center; padding: 6px 8px; }
.dl-flow-step + .dl-flow-step::before {
    content: "\f104"; font-family: FontAwesome;
    position: absolute; right: -8px; top: 18px;
    color: var(--dl-cheese); font-size: 20px;
}
.dl-flow-step .fa { display: inline-flex; width: 42px; height: 42px; border-radius: 50%; align-items: center; justify-content: center; background: var(--dl-cream); color: var(--dl-navy-2) !important; font-size: 18px; border: 2px solid var(--dl-cheese-lt); }
.dl-flow-step b { display: block; margin-top: 6px; font-size: 14px; }
.dl-flow-step span { display: block; font-size: 12px; color: var(--dl-muted); }

/* خلفية شفافة ورا المنيو على الموبايل */
.dl-backdrop { display: none; }

/* ---------- لاب توب صغير ---------- */
@media (max-width: 1199px) {
    .dl-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- تابلت (768 - 991): المنيو بتتقفل لأيقونات بس، وبتفتح بالزرار ---------- */
@media (min-width: 768px) and (max-width: 991px) {
    body.v-ui .content-header { padding: 14px 14px 26px !important; }
    .dl-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dl-date .dl-date-long { display: none; }
}

/* ---------- موبايل + تابلت: الجداول العريضة بتتسحب يمين وشمال بدل ما تتقص ---------- */
@media (max-width: 991px) {
    body.v-ui .content-wrapper :has(> table.table:not(.v-stack)),
    body.v-ui .content-wrapper :has(> table[id$="GridView1"]:not(.v-stack)) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
    body.v-ui .content-wrapper table.table:not(.v-stack) > thead > tr > th { white-space: nowrap; }
    body.v-ui .content-wrapper table.table:not(.v-stack) > tbody > tr > td { padding: 9px 8px !important; }
    /* خانات الإضافة: كل زرار في سطر لوحده */
    body.v-ui table.v-stack > * > tr > td { white-space: normal !important; }
    body.v-ui table.v-stack input[type="submit"], body.v-ui table.v-stack input[type="button"],
    body.v-ui table.v-stack button, body.v-ui table.v-stack .btn { display: block !important; }
    /* صفوف بوتستراب: من غير ما تطلع بره الشاشة */
    body.v-ui .content-header .row { margin-left: -6px; margin-right: -6px; }
    body.v-ui .content-header .row > [class*="col-"] { padding-left: 6px; padding-right: 6px; }
}

/* ---------- موبايل وتابلت صغير ---------- */
@media (max-width: 767px) {
    body.v-ui .main-sidebar {
        width: 280px; max-width: 86vw;
        z-index: 1050 !important;
        position: fixed !important; top: 0; bottom: 0; right: 0;
        overflow-y: auto; padding-top: 0 !important;
        transform: translateX(105%) !important;
        transition: transform .28s ease !important;
        box-shadow: none;
    }
    body.v-ui.sidebar-open .main-sidebar { transform: none !important; box-shadow: -10px 0 30px rgba(0, 0, 0, .3); }
    body.v-ui.sidebar-open .content-wrapper, body.v-ui.sidebar-open .main-footer, body.v-ui.sidebar-open .main-header { transform: none !important; }
    body.v-ui .dl-brand-close { display: inline-flex; }
    body.v-ui.sidebar-open .dl-backdrop {
        display: block;
        position: fixed; inset: 0;
        z-index: 1045;
        background: rgba(12, 22, 38, .5);
        -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    }
    body.v-ui.sidebar-open { overflow: hidden; }
    body.v-ui .content-wrapper, body.v-ui .main-header .navbar { margin-right: 0 !important; margin-left: 0 !important; }
    body.v-ui .main-header .navbar { padding: 0 10px !important; gap: 8px; }
    .dl-page-title { font-size: 16px; }
    .dl-crumb { display: none; }
    .dl-date { display: none; }
    body.v-ui .content-header { padding: 12px 10px 24px !important; }
    body.v-ui .card-body { padding: 12px !important; }
    body.v-ui .card > .card-header { padding: 12px 14px !important; }
    body.v-ui .content-wrapper .btn-lg { width: 100%; }

    .dl-hero { flex-direction: column; align-items: flex-start; gap: 14px; padding: 20px 18px; }
    .dl-hero-logo { width: 74px; height: 74px; border-radius: 16px; }
    .dl-hero h1 { font-size: 22px !important; }
    .dl-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    a.dl-tile { min-height: 112px; padding: 14px 12px; }
    .dl-tile-d { display: none; }
    .dl-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; }
    .dl-flow-step:nth-child(3)::before { display: none; }
}
@media (max-width: 360px) {
    .dl-tiles { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- الوضع الليلي ---------- */
html[data-theme="dark"] body.v-ui .main-header .navbar { background: rgba(23, 33, 49, .96) !important; }
html[data-theme="dark"] .dl-page-title { color: #e3e9f2; }
html[data-theme="dark"] .dl-date { background: rgba(217, 152, 28, .14); color: #f6c35b; }
html[data-theme="dark"] body.v-ui .main-header .sidebar-toggle { background: transparent; border-color: #2a3850; color: #f5c46b !important; }
html[data-theme="dark"] a.dl-tile, html[data-theme="dark"] .dl-flow { background: #172131; border-color: #2a3850; color: #e3e9f2 !important; }
html[data-theme="dark"] body.v-ui .card > .card-header,
html[data-theme="dark"] body.v-ui .box > .box-header { background: #1b2638 !important; border-bottom-color: #2a3850 !important; }
html[data-theme="dark"] body.v-ui .card-header .card-title, html[data-theme="dark"] body.v-ui .card-header strong { color: #e3e9f2 !important; }
html[data-theme="dark"] body.v-ui .header > h4.title { color: #f5c46b !important; }
html[data-theme="dark"] body.v-ui .header > h4.title::after, html[data-theme="dark"] .dl-section-title::after { background: #2a3850; }
html[data-theme="dark"] body.v-ui .card, html[data-theme="dark"] body.v-ui .box, html[data-theme="dark"] body.v-ui .panel { border-color: #2a3850 !important; }
html[data-theme="dark"] body.v-ui .content-wrapper .table-striped > tbody > tr:nth-of-type(odd) > td { background-color: rgba(255, 255, 255, .02); }
html[data-theme="dark"] body.v-ui .content-wrapper table > tbody > tr:hover > td,
html[data-theme="dark"] body.v-ui .content-wrapper .v-acc table.table.table > tbody > tr:hover > td { background-color: rgba(120, 160, 220, .12) !important; }
html[data-theme="dark"] .dl-section-title { color: #f5c46b; }
html[data-theme="dark"] .dl-flow-step .fa { background: #0f1726; color: #f5c46b !important; }

} /* end @media screen */

/* =====================================================================
   عناوين الصفحات وعناوين التقارير (كل الصفحات)
   ===================================================================== */
@media screen {
    body.v-ui .content-header > div > .content > h2.title,
    body.v-ui .content-header > div > h2,
    body.v-ui .content-header > div > .content > h2:first-child,
    body.v-ui .content-header > div > div > h2.title {
        font-size: 26px !important; font-weight: 800 !important; color: var(--dl-ink) !important;
        margin: 6px 0 16px !important; line-height: 1.4;
    }
    body.v-ui .content-header > div > .content > h2.title::after,
    body.v-ui .content-header > div > h2::after,
    body.v-ui .content-header > div > .content > h2:first-child::after,
    body.v-ui .content-header > div > div > h2.title::after {
        content: ""; display: block; width: 46px; height: 4px; margin: 8px auto 0; border-radius: 3px;
        background: linear-gradient(90deg, var(--dl-cheese-lt), var(--dl-cheese));
    }
    /* أكتر من زرار في خلية واحدة في جداول البحث: تلف لسطر جديد بدل ما تطلع بره */
    body.v-ui .content-wrapper table td:has(> input[type="submit"] + input[type="submit"]),
    body.v-ui .content-wrapper table td:has(> .btn + .btn),
    body.v-ui .content-wrapper table td:has(> input[type="submit"] + .btn),
    body.v-ui .content-wrapper table td:has(> button + input[type="submit"]) { white-space: normal !important; }
    body.v-ui .content-wrapper table td > .btn + .btn,
    body.v-ui .content-wrapper table td > input[type="submit"] + input[type="submit"],
    body.v-ui .content-wrapper table td > button + input[type="submit"] { margin-top: 4px; }
}
@media screen and (max-width: 767px) {
    body.v-ui .content-header h2, body.v-ui .content-header h1,
    body.v-ui .content-header > div > .content > h2.title,
    body.v-ui .content-header > div > h2,
    body.v-ui .content-header > div > div > h2.title { font-size: 21px !important; }
    body.v-ui .content-header h3 { font-size: 18px !important; }
    body.v-ui .dl-prod-head h2 { font-size: 19px !important; }
    /* رأس التقرير (اللوجو | العنوان | اسم المعمل): العنوان سطر كامل والباقي نص ونص */
    body.v-ui .content-wrapper .row:has(> .col-xs-4[style*="outset"]) { display: flex; flex-wrap: wrap; margin: 0 0 6px !important; }
    body.v-ui .content-wrapper .row:has(> .col-xs-4[style*="outset"]) > .col-xs-4 { width: 50%; float: none; }
    body.v-ui .content-wrapper .row:has(> .col-xs-4[style*="outset"]) > .col-xs-4[style*="outset"] { width: 100%; order: -1; margin-bottom: 8px; }
    body.v-ui .content-wrapper div[style*="outset"] h3, body.v-ui .content-wrapper div[style*="outset"] h4 { font-size: 18px !important; margin: 6px 0 !important; }
}

/* =====================================================================
   فورم الإضافة اللي متقسم على أكتر من جدول خانات ورا بعض (زي تعديل المنتج) — الجداول اللي فيها أزرار (بحث/دفع) مش بتتدمج:
   كل الخانات بتترص مع بعض في نفس الصفوف بدل كل جدول في سطر لوحده وجنبه مساحة فاضية.
   اللاب: لحد 6 جنب بعض، وبتقل مع الشاشة لحد خانتين على الموبايل
   ===================================================================== */
@media screen {
    body.v-ui .content-wrapper .dl-merge {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        column-gap: 14px; row-gap: 0;
        align-items: start;
        background: var(--v-surface-2);
        border: 1px solid var(--v-line);
        border-radius: 12px;
        padding: 6px 14px 12px !important;
        margin-bottom: 14px;
    }
    body.v-ui .content-wrapper .dl-merge > :not(table.dl-mt) { grid-column: 1 / -1; }
    body.v-ui .content-wrapper .dl-merge > table.dl-mt,
    body.v-ui .content-wrapper .dl-merge > table.dl-mt > tbody,
    body.v-ui .content-wrapper .dl-merge > table.dl-mt > tfoot,
    body.v-ui .content-wrapper .dl-merge > table.dl-mt > tbody > tr,
    body.v-ui .content-wrapper .dl-merge > table.dl-mt > tfoot > tr { display: contents !important; }
    body.v-ui .content-wrapper .dl-merge > table.dl-mt > thead,
    body.v-ui .content-wrapper .dl-merge > table.dl-mt > * > tr > .v-rowline { display: none !important; }
    body.v-ui .content-wrapper .dl-merge > table.dl-mt > * > tr > td,
    body.v-ui .content-wrapper .dl-merge > table.dl-mt > * > tr > th {
        display: block !important; width: auto !important; min-width: 0 !important; height: auto !important;
        border: 0 !important; background: transparent !important;
        padding: 12px 0 6px !important; text-align: right !important;
    }
}
@media screen and (max-width: 420px) {
    body.v-ui .content-wrapper .dl-merge { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 10px; padding: 4px 10px 10px !important; }
}

/* =====================================================================
   شاشات التصنيع (dl-prod)
   ===================================================================== */
@media screen {
    .dl-prod { max-width: 1200px; margin: 0 auto; padding-bottom: 90px; }
    .dl-prod-head {
        display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
        padding: 20px 22px; margin-bottom: 16px;
        border-radius: 16px; color: #fff;
        background:
            radial-gradient(circle at 8% 30%, transparent 0 30px, rgba(242, 193, 78, .22) 31px 32px, transparent 33px),
            radial-gradient(circle at 16% 80%, transparent 0 12px, rgba(242, 193, 78, .18) 13px 14px, transparent 15px),
            linear-gradient(120deg, var(--dl-navy) 0%, var(--dl-navy-2) 100%);
        border-bottom: 4px solid var(--dl-cheese);
        box-shadow: 0 12px 28px rgba(24, 45, 75, .18);
    }
    .dl-prod-head-ic {
        flex: 0 0 56px; width: 56px; height: 56px; border-radius: 16px;
        display: flex; align-items: center; justify-content: center;
        background: linear-gradient(145deg, #f6cf6a, var(--dl-cheese));
        box-shadow: 0 6px 16px rgba(217, 152, 28, .4);
        font-size: 24px;
    }
    .dl-prod-head-ic .fa { color: #2b1d00 !important; }
    .dl-prod-head-t { flex: 1 1 260px; min-width: 0; }
    .dl-prod-head h2 { margin: 0 0 4px !important; font-size: 23px !important; font-weight: 800 !important; color: #fff !important; }
    .dl-prod-head p { margin: 0; color: #c9d4e4; font-size: 14px; }
    a.dl-prod-back {
        display: inline-flex; align-items: center; gap: 6px;
        padding: 8px 14px; border-radius: 10px;
        background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18);
        color: #fff !important; font-weight: 700; font-size: 14px; text-decoration: none !important;
    }
    a.dl-prod-back .fa { color: var(--dl-cheese-lt) !important; }
    a.dl-prod-back:hover { background: rgba(255, 255, 255, .18); }

    /* الخطوات */
    .dl-steps { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 16px; flex-wrap: wrap; }
    .dl-steps li {
        flex: 1 1 0; min-width: 120px;
        display: flex; align-items: center; gap: 8px;
        padding: 10px 12px; border-radius: 12px;
        background: #fff; border: 1px solid var(--dl-line);
        font-weight: 800; font-size: 14px; color: var(--dl-navy-2);
    }
    .dl-steps li span, .dl-num {
        display: inline-flex; align-items: center; justify-content: center;
        width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%;
        background: var(--dl-cheese-bg); color: #8a5a00; font-weight: 800; font-size: 14px;
        border: 2px solid var(--dl-cheese-lt);
    }
    body.v-ui .card.dl-step > .card-header::before { display: none; }
    body.v-ui .card.dl-step > .card-header { gap: 12px; flex-wrap: wrap; }
    .dl-step-out .dl-num { background: var(--dl-cheese); color: #fff; border-color: var(--dl-cheese); }

    /* الدفعة (تاريخ + فترة) */
    .dl-batch + .dl-batch { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--dl-line); }
    .dl-batch-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
    .dl-chip {
        display: inline-flex; align-items: center; gap: 6px;
        padding: 6px 12px; border-radius: 999px;
        background: var(--dl-cream); border: 1px solid var(--dl-line);
        font-weight: 700; font-size: 14px; color: var(--dl-ink);
    }
    .dl-chip .fa { color: var(--dl-navy-2) !important; }
    .dl-chip-day { background: #fff4d6; border-color: #f3d58a; }
    .dl-chip-day .fa { color: #d08a00 !important; }
    .dl-chip-night { background: #e6ecf4; border-color: #c7d3e4; }
    .dl-chip-night .fa { color: var(--dl-navy-2) !important; }

    /* خزانات اللبن */
    .dl-tanks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .dl-tank {
        position: relative; overflow: hidden;
        border-radius: 14px; border: 1px solid var(--dl-line);
        background: linear-gradient(180deg, #fff 0%, var(--dl-cream-2) 100%);
        padding: 14px;
    }
    .dl-tank::after {
        content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
        background: var(--dl-tank-c, var(--dl-navy-2)); opacity: .9;
    }
    .dl-tank-cow { --dl-tank-c: #3b6fb3; }
    .dl-tank-buffalo { --dl-tank-c: #5b4636; }
    .dl-tank-cool { --dl-tank-c: #2aa3c9; }
    .dl-tank-h { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; color: var(--dl-ink); margin-bottom: 12px; }
    .dl-tank-ic {
        width: 36px; height: 36px; border-radius: 10px;
        display: inline-flex; align-items: center; justify-content: center;
        background: var(--dl-tank-c); font-size: 16px;
    }
    .dl-tank-ic .fa { color: #fff !important; }

    /* الحقول */
    .dl-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .dl-field { min-width: 0; }
    .dl-field > label, .dl-field > .dl-unit {
        display: block; margin: 0 2px 5px;
        font-size: 12.5px; font-weight: 700; color: var(--dl-muted);
    }
    body.v-ui .dl-field .form-control { width: 100% !important; height: 44px; font-size: 17px !important; font-weight: 700; }
    body.v-ui .dl-field-ro .form-control,
    body.v-ui .dl-field .form-control[disabled] {
        background: var(--dl-cheese-bg) !important; border-color: #f1dca6 !important;
        color: #7a5200 !important; -webkit-text-fill-color: #7a5200; opacity: 1;
    }
    .dl-field > span[style*="color:Red"], .dl-field > span[style*="color: red"] { display: block; font-size: 12px; margin-top: 3px; }

    /* الخامات والمنتجات */
    .dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
    .dl-item {
        border-radius: 14px; border: 1px solid var(--dl-line); background: #fff;
        padding: 12px; transition: border-color .15s, box-shadow .15s;
    }
    .dl-item:focus-within { border-color: var(--dl-cheese); box-shadow: 0 0 0 3px rgba(217, 152, 28, .15); }
    .dl-item-h { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; margin-bottom: 10px; color: var(--dl-ink); min-width: 0; }
    .dl-item-h > span:not(.dl-item-ic) { min-width: 0; overflow-wrap: anywhere; line-height: 1.4; }
    .dl-item-ic {
        flex: 0 0 32px; width: 32px; height: 32px; border-radius: 9px;
        display: inline-flex; align-items: center; justify-content: center;
        background: #e6ecf4; font-size: 14px;
    }
    .dl-item-ic .fa { color: var(--dl-navy-2) !important; }
    .dl-item-prod .dl-item-ic { background: var(--dl-cheese-bg); }
    .dl-item-prod .dl-item-ic .fa { color: #b07800 !important; }

    .dl-extra { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--dl-line); }
    .dl-extra label { margin: 0; font-weight: 800; color: var(--dl-ink); }
    .dl-extra label .fa { color: #1e7a52 !important; margin-left: 4px; }
    body.v-ui .dl-extra .form-control { width: 220px !important; max-width: 100%; height: 44px; font-weight: 700; }

    /* المفتاح (استخدام المبرد) */
    .dl-switch { margin-right: auto; }
    .dl-switch input[type="checkbox"] {
        -webkit-appearance: none; appearance: none;
        width: 46px; height: 26px; border-radius: 999px; margin: 0 0 0 8px !important;
        background: #cfd4cc; position: relative; cursor: pointer; vertical-align: middle;
        transition: background .2s;
    }
    .dl-switch input[type="checkbox"]::after {
        content: ""; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
        background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: right .2s;
    }
    .dl-switch input[type="checkbox"]:checked { background: var(--dl-cheese); }
    .dl-switch input[type="checkbox"]:checked::after { right: 23px; }
    .dl-switch label { font-weight: 700; cursor: pointer; margin: 0; vertical-align: middle; }
    .dl-hint { color: var(--dl-muted); font-size: 13.5px; margin: 0 0 10px; }
    .dl-hint .fa { color: #2aa3c9 !important; }

    /* شريط الحفظ */
    .dl-savebar {
        position: sticky; bottom: 12px; z-index: 20;
        display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
        margin-top: 18px; padding: 12px 16px;
        border-radius: 16px; background: rgba(24, 45, 75, .96);
        box-shadow: 0 14px 30px rgba(24, 45, 75, .3);
    }
    .dl-savebar-t { color: #d3dcea; font-weight: 700; font-size: 14px; }
    .dl-savebar-t .fa { color: var(--dl-cheese-lt) !important; }
    body.v-ui .dl-savebar .btn { min-width: 220px; box-shadow: none; }

    /* اللبن المتاح للتصنيع */
    .dl-milk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
    .dl-milk-card {
        position: relative; overflow: hidden;
        border-radius: 16px; background: #fff; border: 1px solid var(--dl-line);
        box-shadow: var(--dl-shadow); padding: 16px;
        display: flex; flex-direction: column; gap: 12px;
        transition: box-shadow .15s, border-color .15s;
    }
    .dl-milk-card:hover { border-color: var(--dl-cheese); box-shadow: 0 12px 26px rgba(24, 45, 75, .12); }
    .dl-milk-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .dl-milk-date { font-size: 18px; font-weight: 800; color: var(--dl-ink); }
    .dl-milk-day { font-size: 13px; color: var(--dl-muted); font-weight: 600; }
    .dl-milk-amounts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .dl-milk-amt { border-radius: 12px; padding: 10px 12px; background: var(--dl-cream); border-bottom: 4px solid var(--dl-tank-c); }
    .dl-milk-amt small { display: block; font-size: 12.5px; font-weight: 700; color: var(--dl-muted); }
    .dl-milk-amt b { font-size: 22px; font-weight: 800; color: var(--dl-ink); }
    a.dl-milk-go {
        display: flex; align-items: center; justify-content: center; gap: 8px;
        padding: 11px 14px; border-radius: 12px;
        background: var(--dl-cheese); color: #fff !important; font-weight: 800; font-size: 15px;
        text-decoration: none !important; box-shadow: 0 6px 14px rgba(217, 152, 28, .3);
    }
    a.dl-milk-go:hover { background: #c2860f; }
    a.dl-milk-go .fa { color: #fff !important; }
    .dl-empty { text-align: center; padding: 40px 16px; color: var(--dl-muted); }
    .dl-empty .fa { font-size: 40px; color: #c3cad3 !important; display: block; margin-bottom: 10px; }

    /* تفاصيل أمر التصنيع */
    .dl-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
    .dl-stat { border-radius: 14px; padding: 12px 14px; background: var(--dl-cream); border: 1px solid var(--dl-line); border-bottom: 4px solid var(--dl-tank-c, var(--dl-cheese)); }
    .dl-stat small { display: block; font-size: 12.5px; font-weight: 700; color: var(--dl-muted); }
    .dl-stat b, .dl-stat span { font-size: 21px; font-weight: 800; color: var(--dl-ink); }

    @media (max-width: 767px) {
        .dl-prod-head { padding: 16px; }
        .dl-prod-head h2 { font-size: 19px !important; }
        .dl-prod-head p { font-size: 13px; }
        .dl-steps { display: none; }
        .dl-tanks { grid-template-columns: minmax(0, 1fr); }
        .dl-grid { grid-template-columns: minmax(0, 1fr); }
        .dl-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .dl-savebar { bottom: 8px; padding: 10px; }
        .dl-savebar-t { display: none; }
        body.v-ui .dl-savebar .btn { width: 100%; min-width: 0; }
        .dl-switch { margin-right: 0; width: 100%; }
    }
    @media (min-width: 768px) and (max-width: 991px) {
        .dl-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }

    html[data-theme="dark"] .dl-steps li, html[data-theme="dark"] .dl-item, html[data-theme="dark"] .dl-milk-card { background: #172131; border-color: #2a3850; color: #e3e9f2; }
    html[data-theme="dark"] .dl-tank { background: #172131; border-color: #2a3850; }
    html[data-theme="dark"] .dl-tank-h, html[data-theme="dark"] .dl-item-h, html[data-theme="dark"] .dl-milk-date, html[data-theme="dark"] .dl-extra label { color: #e3e9f2; }
    html[data-theme="dark"] .dl-chip, html[data-theme="dark"] .dl-milk-amt, html[data-theme="dark"] .dl-stat { background: #0f1726; border-color: #2a3850; color: #e3e9f2; }
    html[data-theme="dark"] .dl-milk-amt b, html[data-theme="dark"] .dl-stat b, html[data-theme="dark"] .dl-stat span { color: #f5c46b; }
}

/* =====================================================================
   شاشة الدخول
   ===================================================================== */
@media screen {
    body.dl-auth {
        background:
            radial-gradient(circle at 12% 18%, transparent 0 70px, rgba(242, 193, 78, .10) 71px 73px, transparent 74px),
            radial-gradient(circle at 86% 78%, transparent 0 110px, rgba(242, 193, 78, .08) 111px 113px, transparent 114px),
            radial-gradient(circle at 80% 14%, transparent 0 26px, rgba(242, 193, 78, .10) 27px 28px, transparent 29px),
            radial-gradient(circle at 20% 86%, rgba(242, 193, 78, .06) 0 12px, transparent 13px),
            linear-gradient(160deg, #1d3557 0%, var(--dl-navy) 55%, #12233b 100%) !important;
        background-attachment: fixed !important;
    }
    body.dl-auth .sz-head { gap: 14px; }
    body.dl-auth .sz-head .dl-brand-logo { flex-basis: 56px; width: 56px; height: 56px; border-radius: 16px; }
    body.dl-auth .sz-head .dl-brand-logo svg { width: 36px; height: 36px; }
    body.dl-auth .sz-head span:not(.dl-brand-logo) { font-family: "VCairo", "Cairo", Tahoma, sans-serif; font-weight: 800; font-size: 30px; }
    body.dl-auth .sz-head b { color: var(--dl-cheese-lt); }
    body.dl-auth .sz-greet { color: #c3cfe2; }
    body.dl-auth .container { background: var(--dl-cream-2) !important; outline-color: var(--dl-cheese) !important; }
    body.dl-auth .container h2::after { content: "سجّل دخولك عشان تبدأ شغل المعمل"; }
    body.dl-auth .submitButton, body.dl-auth .btn-primary { background-color: var(--dl-cheese) !important; color: #fff !important; box-shadow: 0 6px 16px rgba(217, 152, 28, .35) !important; }
    body.dl-auth .submitButton:hover { background-color: #c2860f !important; }
    body.dl-auth .form-control.login .form-control:focus { border-color: var(--dl-cheese) !important; box-shadow: 0 0 0 3px rgba(217, 152, 28, .18) !important; }
    body.dl-auth .sz-foot { color: #8fa1bd; }
}

@media print {
    .dl-backdrop, .dl-top-title, .dl-date, .dl-brand { display: none !important; }
    /* الطباعة بتاخد الجزء اللي جوه الـ div بس (من غير dir="rtl" بتاعه)، فلازم الصفحة كلها تبقى يمين لشمال */
    html, body { direction: rtl !important; }
    /* الطباعة كانت بتطلع مزاحة لجنب: صفوف بوتستراب (.row) بهامش -15px على الجنبين، وجداول عليها zoom:90%
       بتطلع بره عرض الورقة، فالطابعة بتصغّر الصفحة وتزحلقها. هنا كل حاجة بتتلم جوه عرض الورقة */
    body.v-ui .row { margin-left: 0 !important; margin-right: 0 !important; }
    body.v-ui [style*="zoom"] { zoom: 1 !important; }
    body.v-ui table { max-width: 100% !important; }
}
