/* =========================================================
   نظام المحاسبة والمبيعات - التصميم العام (لوحة تحكم عصرية ملوّنة)
   ========================================================= */

:root {
    --sidebar-width: 264px;
    --sidebar-width-collapsed: 78px;
    --navbar-height: 68px;

    --primary: #4680FF;
    --primary-dark: #2F5FDB;
    --primary-light: #E3ECFF;
    --primary-soft: #F2F6FF;
    --background: #F5F6FA;
    --surface: #FFFFFF;
    --sidebar-bg: #FFFFFF;
    --sidebar-bg-active: #4680FF;
    --sidebar-text: #566A7F;
    --text-primary: #1F2937;
    --text-secondary: #7B8794;
    --border: #EBEDF3;
    --success: #2CA87F;
    --warning: #E0A62F;
    --danger: #E5544F;
    --card-radius: 18px;
    --btn-radius: 10px;
}

:root[data-theme="dark"] {
    --background: #0F1420;
    --surface: #171E2E;
    --sidebar-bg: #171E2E;
    --sidebar-bg-active: #4680FF;
    --sidebar-text: #A6B0C3;
    --text-primary: #E9ECF3;
    --text-secondary: #8993A6;
    --border: #2A3345;
    --primary-soft: #1A2440;
    --primary-light: #24325A;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --background: #0F1420;
        --surface: #171E2E;
        --sidebar-bg: #171E2E;
        --sidebar-bg-active: #4680FF;
        --sidebar-text: #A6B0C3;
        --text-primary: #E9ECF3;
        --text-secondary: #8993A6;
        --border: #2A3345;
        --primary-soft: #1A2440;
        --primary-light: #24325A;
    }
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Cairo', 'Tajawal', 'Segoe UI', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    transition: background-color .2s ease, color .2s ease;
}

a {
    text-decoration: none;
}

.text-muted {
    color: var(--text-secondary) !important;
}

/* أرقام مالية بعرض ثابت (تصطف بدقة في الجداول وبطاقات الإحصائيات) */
table, .stat-value, .pos-total-big, .pos-grand-total, .fw-bold {
    font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------
   تخطيط الصفحة العام
   --------------------------------------------------------- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    border-left: 1px solid var(--border);
    box-shadow: 4px 0 24px rgba(31,41,55,0.04);
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1030;
    transition: width 0.2s ease, transform 0.25s ease;
}

.app-sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-brand i {
    color: var(--primary);
}

.sidebar-collapse-btn {
    color: var(--text-secondary);
    opacity: .85;
    background: transparent;
    border: none;
    padding: 4px 8px;
}
.sidebar-collapse-btn:hover { opacity: 1; color: var(--primary); }

.sidebar-nav {
    padding: 14px 12px 30px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-section-title {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.85;
    padding: 16px 10px 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
}

.app-sidebar.collapsed .nav-section-title,
.app-sidebar.collapsed .sidebar-brand span,
.app-sidebar.collapsed .nav-label,
.app-sidebar.collapsed .nav-counter {
    display: none;
}

.sidebar-nav .nav-link {
    color: var(--sidebar-text);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 10px;
    white-space: nowrap;
    overflow: hidden;
    font-weight: 600;
    font-size: .92rem;
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.nav-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-counter {
    margin-right: auto;
    background: var(--danger);
    color: #fff;
    border-radius: 20px;
    padding: 1px 9px;
    font-size: .72rem;
    font-weight: 700;
}

.sidebar-nav .nav-link:hover {
    background: var(--primary-soft);
    color: var(--primary);
}
.sidebar-nav .nav-link:hover i {
    color: var(--primary);
}

.sidebar-nav .nav-link.active {
    background: var(--sidebar-bg-active);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 8px 16px rgba(70,128,255,.28);
}

.sidebar-nav .nav-link.active i {
    color: #fff;
}

.app-content {
    margin-right: var(--sidebar-width);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
    transition: margin-right 0.2s ease, width 0.2s ease;
}

.app-content.sidebar-collapsed {
    margin-right: var(--sidebar-width-collapsed);
    width: calc(100% - var(--sidebar-width-collapsed));
}

.app-navbar {
    height: var(--navbar-height);
    background: var(--surface);
    box-shadow: 0 1px 4px rgba(15,23,42,0.06);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 22px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.navbar-spacer {
    flex-grow: 1;
}

.page-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-primary);
}

.navbar-datetime {
    color: var(--text-secondary);
    font-size: .85rem;
    white-space: nowrap;
}

.sidebar-toggle {
    display: none;
}

.page-content {
    padding: 24px;
    flex-grow: 1;
}

.app-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1025;
}

.navbar-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: var(--primary-soft);
    border: none;
}

.navbar-icon-btn .badge-dot {
    position: absolute;
    top: 2px;
    left: 2px;
    background: var(--danger);
    color: #fff;
    border-radius: 20px;
    font-size: .62rem;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

.avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* ---------------------------------------------------------
   بطاقات الإحصائيات
   --------------------------------------------------------- */
.stat-card {
    background: var(--surface);
    border-radius: var(--card-radius);
    padding: 20px 22px;
    box-shadow: 0 4px 20px rgba(31,41,55,0.06);
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
    border: 1px solid var(--border);
    transition: transform .15s ease, box-shadow .15s ease;
}

a.stat-card-link {
    display: block;
    height: 100%;
    color: inherit;
}
a.stat-card-link:hover .stat-card {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(31,41,55,0.1);
}

.stat-card .stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    flex-shrink: 0;
}

.stat-card .stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-primary);
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

.bg-icon-green   { background: var(--success); }
.bg-icon-blue    { background: var(--primary); }
.bg-icon-orange  { background: var(--warning); }
.bg-icon-red     { background: var(--danger); }
.bg-icon-purple  { background: #8250df; }
.bg-icon-teal    { background: #0aa398; }

/* ---------------------------------------------------------
   البطاقات والجداول العامة
   --------------------------------------------------------- */
.card {
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    box-shadow: 0 4px 20px rgba(31,41,55,0.05);
    background: var(--surface);
    color: var(--text-primary);
}

.card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    padding: 16px 22px;
    border-top-right-radius: var(--card-radius) !important;
    border-top-left-radius: var(--card-radius) !important;
}

.card-header > i:first-child,
.card-header i.bi:first-child {
    color: var(--primary);
    margin-left: 8px;
}

.card-body {
    padding: 22px;
}

.card-body.p-0 {
    padding: 0 !important;
}

/* ---------------------------------------------------------
   عناصر النماذج (فورمات الإضافة والتعديل في كل الصفحات)
   --------------------------------------------------------- */
.form-label {
    font-weight: 600;
    font-size: .86rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control, .form-select {
    border-radius: var(--btn-radius);
    border-color: var(--border);
    background-color: var(--surface);
    color: var(--text-primary);
    padding: 9px 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 .2rem rgba(70,128,255,.15);
}
.form-control::placeholder {
    color: var(--text-secondary);
    opacity: .6;
}

.input-group-text {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: var(--border);
    border-radius: var(--btn-radius);
}
.input-group > .form-control:not(:first-child),
.input-group > .input-group-text:not(:first-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.input-group > .form-control:not(:last-child),
.input-group > .input-group-text:not(:last-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}
.form-check-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 .2rem rgba(70,128,255,.15);
}
.form-switch .form-check-input {
    width: 2.4em;
    height: 1.3em;
}

.form-check-label {
    color: var(--text-primary);
    font-size: .92rem;
}

.btn {
    border-radius: var(--btn-radius);
    font-weight: 600;
    transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.btn-success { background-color: var(--success); border-color: var(--success); }
.btn-danger { background-color: var(--danger); border-color: var(--danger); }
.btn-warning { background-color: var(--warning); border-color: var(--warning); }
.btn-primary, .btn-outline-primary:hover { background-color: var(--primary); border-color: var(--primary); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }

.btn-primary:hover, .btn-success:hover, .btn-danger:hover, .btn-warning:hover {
    filter: brightness(0.94);
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(31,41,55,0.14);
}
.btn:active {
    transform: translateY(0);
}

.table {
    vertical-align: middle;
    color: var(--text-primary);
}

.table thead th {
    background: var(--primary-soft);
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
    border-bottom: 2px solid var(--border);
}

.table-hover tbody tr:hover {
    background-color: var(--primary-soft);
}

.badge-debt-over {
    background: var(--danger) !important;
}

/* بطاقات الجدول على الهاتف (بديل عن التمرير الأفقي عند الحاجة) */
@media (max-width: 767.98px) {
    table.table-mobile-cards thead {
        display: none;
    }
    table.table-mobile-cards, table.table-mobile-cards tbody, table.table-mobile-cards tr, table.table-mobile-cards td {
        display: block;
        width: 100%;
    }
    table.table-mobile-cards tr {
        margin-bottom: 12px;
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 8px 4px;
    }
    table.table-mobile-cards td {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        border: none !important;
        padding: 6px 10px;
    }
    table.table-mobile-cards td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-secondary);
    }
}

/* ---------------------------------------------------------
   نقطة البيع - التصميم اللمسي
   --------------------------------------------------------- */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 460px;
    gap: 18px;
    align-items: start;
}

.btn-touch {
    min-height: 48px;
    font-size: 1rem;
    padding: 10px 16px;
}

.pos-search-bar {
    margin-bottom: 12px;
}

.pos-category-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.cat-tab {
    flex-shrink: 0;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    border-radius: 999px;
    padding: 10px 18px;
    font-weight: 600;
    min-height: 44px;
}

.cat-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pos-product-grid {
    display: grid;
    grid-template-columns: repeat(var(--pos-cols, 5), minmax(0, 1fr));
    gap: 12px;
    max-height: calc(100vh - 260px);
    overflow-y: auto;
    padding-bottom: 10px;
}

.pos-product-card {
    cursor: pointer;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px;
    text-align: center;
    background: var(--surface);
    transition: box-shadow .15s ease, transform .1s ease;
    position: relative;
    user-select: none;
}

.pos-product-card:hover {
    box-shadow: 0 6px 18px rgba(15,23,42,0.1);
}
.pos-product-card:active {
    transform: scale(0.97);
}

.pos-product-card.disabled {
    opacity: .45;
    cursor: not-allowed;
}

.pos-product-card img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 6px;
}

.pos-product-card .p-name {
    font-size: 0.85rem;
    font-weight: 700;
    min-height: 2.4em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pos-product-card .p-price {
    font-size: 0.85rem;
    color: var(--primary-dark);
    font-weight: 800;
}

.pos-product-card .p-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: .65rem;
    padding: 2px 7px;
    border-radius: 20px;
    font-weight: 700;
}

.pos-cart {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 14px;
    position: sticky;
    top: 82px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.pos-cart-customer {
    margin-bottom: 12px;
}

.pos-dropdown {
    position: absolute;
    z-index: 40;
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(15,23,42,.12);
}

.pos-customer-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-soft);
    border: 1px solid var(--primary-light);
    border-radius: 12px;
    padding: 10px 12px;
}

.pos-customer-chip-avatar {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.pos-customer-chip-body {
    flex: 1 1 auto;
    min-width: 0;
}

.pos-customer-chip-name {
    font-weight: 700;
    font-size: .95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-customer-chip-meta {
    font-size: .78rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.pos-customer-chip-meta .badge {
    font-size: .72rem;
}

.pos-customer-result {
    padding: 8px 12px;
}

.pos-cart-list {
    max-height: 320px;
    overflow-y: auto;
    overflow-x: auto;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}

.pos-cart-table {
    table-layout: fixed;
    width: 100%;
    min-width: 420px;
}

.pos-cart-table th,
.pos-cart-table td {
    vertical-align: middle;
    padding: 6px 4px;
}

.pos-cart-table col.col-name { width: 30%; }
.pos-cart-table col.col-qty { width: 26%; }
.pos-cart-table col.col-price { width: 22%; }
.pos-cart-table col.col-total { width: 16%; }
.pos-cart-table col.col-actions { width: 6%; }

.pos-cart-table .item-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .85rem;
}

.pos-cart-table .qty-controls {
    display: flex;
    align-items: center;
    gap: 3px;
}

.pos-cart-table .qty-controls button {
    width: 26px;
    height: 26px;
    min-width: 26px;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.pos-cart-table input.qty-input {
    width: 100%;
    min-width: 40px;
    max-width: 52px;
    text-align: center;
    padding: 2px 2px;
}

.pos-cart-table input.price-input {
    width: 100%;
    min-width: 70px;
    text-align: center;
    padding: 4px 4px;
    font-weight: 700;
}

.pos-cart-table td.total-cell {
    font-size: .9rem;
    white-space: nowrap;
}

.pos-cart-table .remove-item {
    width: 30px;
    height: 30px;
    padding: 0;
}

.pos-cart-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.pos-invoice-discount {
    margin-bottom: 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
}

.pos-discount-row {
    display: grid;
    grid-template-columns: 42% 1fr;
    gap: 8px;
}

.pos-discount-row select,
.pos-discount-row input {
    height: 42px;
    font-size: .95rem;
    text-align: center;
}

.pos-cart-totals {
    border-top: 1px dashed var(--border);
    padding-top: 10px;
    margin-bottom: 12px;
}

.pos-grand-total {
    color: var(--primary-dark);
    border-top: 1px solid var(--border);
    padding-top: 6px;
    margin-top: 4px;
}

.pos-checkout-btn {
    font-size: 1.1rem;
}

.pos-checkout-customer {
    background: var(--primary-soft);
    border: 1px solid var(--primary-light);
    border-radius: 12px;
    padding: 8px 14px;
    font-size: .9rem;
}

.pos-total-box {
    background: var(--primary-soft);
    border-radius: 14px;
    padding: 14px;
    text-align: center;
    margin-bottom: 12px;
}

.pos-total-big {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.pos-numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.numpad-key {
    min-height: 48px;
    font-size: 1.1rem;
    font-weight: 700;
}

.pos-quick-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.pos-quick-amounts button {
    flex: 1 1 auto;
    min-height: 44px;
}

.pos-touch-mode .btn-touch {
    min-height: 56px;
    font-size: 1.1rem;
}
.pos-touch-mode .pos-product-card {
    padding: 14px;
}
.pos-touch-mode .cat-tab {
    min-height: 50px;
    font-size: 1.05rem;
}
.pos-touch-mode .numpad-key {
    min-height: 58px;
    font-size: 1.3rem;
}

@media (max-width: 1199.98px) {
    .pos-layout {
        grid-template-columns: 1fr;
    }
    .pos-cart {
        position: static;
        max-height: none;
    }
    .pos-product-grid {
        max-height: none;
        --pos-cols: 3;
    }
}

@media (max-width: 575.98px) {
    .pos-product-grid { --pos-cols: 2; }
    .pos-cart-actions { grid-template-columns: 1fr 1fr; }
}

/* ---------------------------------------------------------
   الفاتورة القابلة للطباعة
   --------------------------------------------------------- */
.invoice-box {
    background: #fff;
    max-width: 210mm;
    margin: 0 auto;
    padding: 15mm;
    color: #111;
}

.invoice-box-a5 {
    max-width: 148mm;
    padding: 8mm;
    font-size: 0.85rem;
}
.invoice-box-a5 .invoice-header h4 { font-size: 1.1rem; }
.invoice-box-a5 .invoice-header h5 { font-size: 1rem; }
.invoice-box-a5 .signature-box { margin-top: 30px; }
.invoice-box-a5 .signature-box div { width: 120px; }

@media print {
    .invoice-box-a4 { width: 210mm; }
    .invoice-box-a5 { width: 148mm; }
}

.invoice-box .invoice-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid #333;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.invoice-box table {
    width: 100%;
}

.signature-box {
    margin-top: 60px;
    display: flex;
    justify-content: space-between;
}

.signature-box div {
    border-top: 1px solid #333;
    width: 200px;
    text-align: center;
    padding-top: 6px;
}

/* ---------------------------------------------------------
   صفحة تسجيل الدخول
   --------------------------------------------------------- */
.auth-page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(120% 120% at 20% 15%, var(--primary-light) 0%, var(--background) 55%);
    padding: 20px;
}

.auth-card {
    background: var(--surface);
    border-radius: var(--card-radius);
    box-shadow: 0 24px 60px rgba(31,41,55,0.12);
    width: 100%;
    max-width: 400px;
    padding: 34px 30px;
}

.auth-card .auth-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 16px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 10px 20px rgba(70,128,255,.3);
}

.auth-card h1 {
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 26px;
    color: var(--text-primary);
}

/* ---------------------------------------------------------
   Skeleton Loading
   --------------------------------------------------------- */
.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, var(--primary-light) 37%, var(--border) 63%);
    background-size: 400% 100%;
    animation: skeleton-loading 1.4s ease infinite;
    border-radius: 8px;
}
@keyframes skeleton-loading {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: .75;
}
.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    right: 50%;
    margin-top: -8px;
    margin-right: -8px;
    border: 2px solid rgba(255,255,255,.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin .6s linear infinite;
}
@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

/* ---------------------------------------------------------
   الاستجابة للهاتف
   --------------------------------------------------------- */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(100%);
        width: var(--sidebar-width) !important;
    }
    .app-sidebar.show {
        transform: translateX(0);
    }
    .app-content, .app-content.sidebar-collapsed {
        margin-right: 0;
        width: 100%;
    }
    .sidebar-toggle {
        display: inline-flex;
    }
    .sidebar-backdrop.show {
        display: block;
    }
    .navbar-datetime {
        display: none;
    }
}

/* ---------------------------------------------------------
   الطباعة
   --------------------------------------------------------- */
@media print {
    .no-print {
        display: none !important;
    }
    .app-sidebar, .app-navbar, .app-footer, .sidebar-backdrop {
        display: none !important;
    }
    .app-content, .app-content.sidebar-collapsed {
        margin-right: 0 !important;
        width: 100% !important;
    }
    body {
        background: #fff !important;
    }
    .page-content {
        padding: 0 !important;
    }
}
