/* ═══════════════════════════════════════════════════════════
   نظام أمان المحاسب الشامل - الأنماط الكاملة
   ═══════════════════════════════════════════════════════════ */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Tahoma', 'Segoe UI', Arial, sans-serif;
    direction: rtl;
    background: #f0f0f0;
    font-size: 13px;
    overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════════
   1) شاشة تسجيل الدخول
   ═══════════════════════════════════════════════════════════ */
.login-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #4a7ba7, #6b9dc9);
}
.login-window {
    width: 480px; background: #f5f5f5;
    border: 1px solid #999;
    box-shadow: 0 8px 25px rgba(0,0,0,0.35);
}
.login-titlebar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 10px; background: #f5f5f5;
    border-bottom: 1px solid #ddd;
}
.title-text { font-weight: bold; font-size: 14px; }
.title-icons { display: flex; gap: 8px; align-items: center; }
.sa-badge {
    background: #c0392b; color: white;
    width: 22px; height: 22px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: bold;
}
.close-btn { cursor: pointer; color: #666; font-size: 16px; }
.login-content { padding: 20px 30px; }
.login-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px;
}
.icon-lock, .icon-key { font-size: 40px; }
.login-msg { font-size: 13px; color: #333; text-align: center; flex: 1; }
.login-form .form-row { display: flex; align-items: center; margin-bottom: 12px; }
.login-form label { width: 110px; text-align: right; font-weight: bold; }
.input-field {
    flex: 1; padding: 6px 8px;
    border: 1px solid #7f9db9; background: white;
    font-family: inherit; font-size: 13px;
}
.error-msg { color: #c0392b; text-align: center; margin-bottom: 10px; font-weight: bold; }
.login-actions { display: flex; justify-content: center; gap: 15px; margin-top: 20px; }
.btn-cancel, .btn-ok {
    padding: 6px 25px; border: 1px solid #999;
    background: #e8e8e8; cursor: pointer;
    font-family: inherit; font-size: 13px;
}
.btn-ok { background: #d4e4f7; font-weight: bold; }
.btn-cancel:hover, .btn-ok:hover { background: #d0d0d0; }
.login-footer { text-align: left; margin-top: 15px; }
.login-footer a { color: #0645ad; text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════
   2) الشريط العلوي الأزرق
   ═══════════════════════════════════════════════════════════ */
.topbar {
    background: linear-gradient(to bottom, #4a7ba7, #3a6890);
    color: white;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    position: relative;
    z-index: 100;
}
.company-name { font-weight: bold; font-size: 15px; }
.topbar-center { display: flex; align-items: center; gap: 15px; }
.topbar-logo { height: 40px; }
.topbar-icons { display: flex; gap: 8px; }
.tb-icon {
    width: 34px; height: 34px; border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: white; cursor: pointer; font-size: 16px;
}
.tb-icon:hover { background: rgba(255,255,255,0.25); }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.user-name { font-weight: bold; }
.lang-btn {
    background: white; color: #3a6890;
    border: none; padding: 5px 12px; border-radius: 4px;
    cursor: pointer; font-weight: bold; font-family: inherit;
}

/* ═══════════════════════════════════════════════════════════
   3) شريط القوائم الرئيسي
   ═══════════════════════════════════════════════════════════ */
.main-menu {
    background: #f0f0f0;
    border-bottom: 1px solid #ccc;
    padding: 0 10px;
    display: flex;
    gap: 3px;
    position: relative;
    z-index: 900;
}
.main-menu > .menu-item {
    padding: 8px 15px;
    cursor: pointer;
    position: relative;
    border: 1px solid transparent;
    border-bottom: none;
    font-size: 13px;
}
.main-menu > .menu-item:hover {
    background: #e0e0e0;
    border-color: #bbb;
    border-radius: 4px 4px 0 0;
}

/* القوائم المنسدلة */
.dropdown {
    position: absolute;
    top: 100%; right: 0;
    background: #f9f9f9;
    border: 1px solid #999;
    min-width: 240px;
    box-shadow: 2px 4px 8px rgba(0,0,0,0.2);
    display: none;
    z-index: 999;
}
.menu-item:hover > .dropdown { display: block; }
.dropdown a {
    display: block; padding: 6px 12px;
    color: #222; text-decoration: none;
    font-size: 12px;
    border-bottom: 1px solid #eee;
}
.dropdown a:hover { background: #d4e4f7; color: #000; }
.dropdown .divider {
    height: 1px;
    background: #d0d0d0;
    margin: 3px 6px;
}
.dropdown .shortcut {
    color: #666;
    font-size: 11px;
    float: left;
}

/* ═══════════════════════════════════════════════════════════
   4) التخطيط
   ═══════════════════════════════════════════════════════════ */
.layout {
    display: flex;
    min-height: calc(100vh - 90px);
}

/* القائمة الجانبية */
.sidebar {
    width: 220px;
    background: #e8eef5;
    border-left: 1px solid #b0c4de;
    padding: 8px;
    overflow-y: auto;
}
.side-group { margin-bottom: 8px; }
.side-title {
    background: linear-gradient(to bottom, #5b8db8, #4a7ba7);
    color: white;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: bold;
    display: flex; justify-content: space-between; align-items: center;
    border-radius: 3px;
    font-size: 13px;
}
.side-title:hover { background: linear-gradient(to bottom, #4a7ba7, #3a6890); }
.side-items { display: block; background: white; }
.side-items.collapsed { display: none; }
.side-items a {
    display: block;
    padding: 7px 25px 7px 12px;
    color: #1a3a5c;
    text-decoration: none;
    font-size: 12.5px;
    border-bottom: 1px solid #eef3f8;
    background: #f5f9fd;
}
.side-items a:hover { background: #d4e4f7; }

/* المحتوى */
.content {
    flex: 1;
    padding: 15px;
    background: #f0f0f0;
    overflow-y: auto;
}

/* ═══════════════════════════════════════════════════════════
   5) الشريط السفلي
   ═══════════════════════════════════════════════════════════ */
.status-bar {
    background: linear-gradient(to bottom, #5b8db8, #4a7ba7);
    color: white;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    font-size: 11px;
}
.status-bar a { color: white; text-decoration: underline; }
.sb-right, .sb-center, .sb-left { display: flex; gap: 15px; }

/* ═══════════════════════════════════════════════════════════
   6) بطاقات الداشبورد
   ═══════════════════════════════════════════════════════════ */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}
.dash-card {
    background: white;
    border: 1px solid #cfd9e3;
    border-radius: 5px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.dash-card .icon {
    width: 50px; height: 50px;
    border-radius: 50%;
    background: #4a7ba7;
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
}
.dash-card .info h4 { font-size: 12px; color: #666; margin-bottom: 4px; font-weight: normal; }
.dash-card .info .value { font-size: 20px; font-weight: bold; color: #1a3a5c; }
.dash-card.green .icon { background: #27ae60; }
.dash-card.red .icon { background: #c0392b; }
.dash-card.orange .icon { background: #e67e22; }
.dash-card.purple .icon { background: #8e44ad; }

/* ═══════════════════════════════════════════════════════════
   7) الجداول
   ═══════════════════════════════════════════════════════════ */
.table-box {
    background: white;
    border: 1px solid #cfd9e3;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 15px;
}
.table-box h3 {
    background: linear-gradient(to bottom, #e8eef5, #d4e0ec);
    padding: 10px 15px;
    font-size: 13px;
    color: #1a3a5c;
    border-bottom: 1px solid #b0c4de;
}
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}
table.data th {
    background: #4a7ba7; color: white;
    padding: 8px; text-align: right;
    font-weight: bold;
}
table.data td {
    padding: 7px 8px;
    border-bottom: 1px solid #eef3f8;
}
table.data tr:nth-child(even) { background: #f5f9fd; }
table.data tr:hover { background: #d4e4f7; }

/* ═══════════════════════════════════════════════════════════
   8) أزرار الأدوات
   ═══════════════════════════════════════════════════════════ */
.toolbar {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    background: linear-gradient(to bottom, #e8eef5, #d4e0ec);
    border: 1px solid #b0c4de;
    border-top: none;
}
.toolbar .tb-group { display: flex; gap: 5px; }
.btn-tool {
    padding: 6px 12px;
    border: 1px solid #999;
    background: linear-gradient(to bottom, #f8f8f8, #e0e0e0);
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    display: inline-flex; align-items: center; gap: 5px;
    border-radius: 3px;
}
.btn-tool:hover { background: #d4e4f7; border-color: #4a7ba7; }
.btn-tool.primary { background: linear-gradient(to bottom, #5b8db8, #4a7ba7); color: white; border-color: #3a6890; }
.btn-tool.primary:hover { background: linear-gradient(to bottom, #4a7ba7, #3a6890); }
.btn-tool.danger { background: linear-gradient(to bottom, #e74c3c, #c0392b); color: white; border-color: #a93226; }
.btn-tool .key {
    background: #333; color: white;
    padding: 1px 5px; border-radius: 3px;
    font-size: 10px; font-weight: bold;
}

/* ═══════════════════════════════════════════════════════════
   9) Tabs Bar
   ═══════════════════════════════════════════════════════════ */
.tabs-bar {
    display: flex; align-items: center; gap: 5px;
    background: #e8eef5;
    border: 1px solid #b0c4de;
    padding: 5px 10px;
    margin-bottom: 10px;
    border-radius: 4px;
}
.pager { font-weight: bold; color: #1a3a5c; }
.tabs-bar .tab {
    padding: 5px 15px;
    background: #f5f5f5; border: 1px solid #999;
    cursor: pointer; font-family: inherit; font-size: 12.5px;
    border-radius: 3px;
}
.tabs-bar .tab.active { background: #4a7ba7; color: white; font-weight: bold; }

/* ═══════════════════════════════════════════════════════════
   10) Split View + Tree
   ═══════════════════════════════════════════════════════════ */
.split-view {
    display: flex;
    gap: 12px;
    min-height: calc(100vh - 180px);
}
.tree-panel, .detail-panel {
    background: #f5f5f5;
    border: 1px solid #b0c4de;
    border-radius: 4px;
    padding: 10px;
}
.tree-panel { width: 320px; overflow-y: auto; }
.detail-panel { flex: 1; }

.tree-search { display: flex; gap: 5px; margin-bottom: 10px; }
.tree-search input { flex: 1; }
.btn-icon {
    width: 32px; border: 1px solid #999; background: #e8e8e8;
    cursor: pointer; border-radius: 3px;
}
.tree-tabs {
    display: flex; gap: 2px; margin-bottom: 10px;
    border-bottom: 1px solid #b0c4de;
}
.ttab {
    padding: 4px 12px; border: 1px solid #999;
    background: #e8e8e8; cursor: pointer;
    font-size: 12px; border-bottom: none;
    border-radius: 3px 3px 0 0;
}
.ttab.active { background: #fff8b0; font-weight: bold; border-color: #c9a800; }

.tree-list { list-style: none; font-size: 12.5px; padding: 0; }
.tree-node {
    padding: 4px 6px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    display: flex; gap: 6px; align-items: center;
    background: white;
}
.tree-node:hover { background: #e6f0fa; }
.tree-node.selected { background: #ffe9a8; font-weight: bold; }
.tree-node .toggle { color: #666; width: 14px; text-align: center; }
.tree-node .num { color: #3a6890; font-weight: bold; min-width: 30px; }
.tree-sub { list-style: none; padding-right: 20px; }

/* ═══════════════════════════════════════════════════════════
   11) النماذج العمودية
   ═══════════════════════════════════════════════════════════ */
.form-vertical .form-row-v {
    display: flex; align-items: center;
    margin-bottom: 8px; gap: 10px;
}
.form-vertical .form-row-v > label:first-child {
    width: 130px;
    text-align: right;
    font-weight: bold;
    color: #1a3a5c;
    font-size: 12.5px;
}
.form-vertical .input-field { flex: 1; }
.input-field.highlight { background: #fff8b0; }
.checkbox-line { display: inline-flex; align-items: center; gap: 5px; font-weight: normal; }
.radio-group { display: flex; gap: 15px; align-items: center; font-size: 12.5px; }
.radio-group label { display: inline-flex; align-items: center; gap: 4px; }

/* ═══════════════════════════════════════════════════════════
   12) Modal العام
   ═══════════════════════════════════════════════════════════ */
.modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 999;
}
.modal-content {
    background: white; padding: 20px;
    width: 500px; max-width: 90%;
    border-radius: 5px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.modal-content h3 { margin-bottom: 10px; color: #1a3a5c; }
#searchResults { list-style: none; }

/* Simple list */
.simple-list { list-style: none; padding: 0; }
.simple-list li { cursor: pointer; }
.simple-list li:hover { background: #e6f0fa !important; }

/* Notice Blue */
.notice-blue {
    background: #d4f0d4;
    border: 1px solid #27ae60;
    color: #145a32;
    padding: 8px 12px;
    margin: 10px 0;
    border-radius: 3px;
    font-size: 12px;
    line-height: 1.7;
}

/* ═══════════════════════════════════════════════════════════
   13) الفواتير
   ═══════════════════════════════════════════════════════════ */
.invoice-header {
    background: #f9f9f9;
    border: 1px solid #b0c4de;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
}
.ih-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 8px;
}
.ih-field { display: flex; flex-direction: column; }
.ih-field label {
    font-size: 12px;
    font-weight: bold;
    color: #1a3a5c;
    margin-bottom: 3px;
    text-align: right;
}
.ih-field .input-field {
    font-size: 12.5px;
    padding: 5px 8px;
    border: 1px solid #7f9db9;
}

.invoice-items-wrap {
    background: white;
    border: 1px solid #b0c4de;
    border-radius: 4px;
    margin-bottom: 10px;
    overflow: hidden;
}
.invoice-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.invoice-items-table thead th {
    background: linear-gradient(to bottom, #5b8db8, #4a7ba7);
    color: white;
    padding: 8px 4px;
    text-align: center;
    font-weight: bold;
    border-left: 1px solid rgba(255,255,255,0.3);
}
.invoice-items-table tbody tr {
    background: #fefefe;
    border-bottom: 1px solid #e0e8f0;
}
.invoice-items-table tbody tr:nth-child(even) { background: #f5f9fd; }
.invoice-items-table tbody tr:nth-child(odd) { background: #fff8e8; }
.invoice-items-table td {
    padding: 2px;
    border-left: 1px solid #e0e8f0;
}
.invoice-items-table td input,
.invoice-items-table td select {
    width: 100%;
    padding: 4px;
    border: 1px solid #ddd;
    font-size: 12px;
    font-family: inherit;
    background: transparent;
    text-align: center;
}
.invoice-items-table td input:focus,
.invoice-items-table td select:focus {
    background: #fff8b0;
    border-color: #c9a800;
    outline: none;
}
.invoice-items-table .row-num {
    text-align: center;
    background: #e8eef5;
    font-weight: bold;
    color: #1a3a5c;
}
.invoice-items-table .in-item-name { text-align: right; }
.btn-del-row {
    background: #c0392b; color: white; border: none;
    width: 26px; height: 26px;
    border-radius: 3px; cursor: pointer;
    font-size: 14px; font-weight: bold;
}
.btn-add-row {
    display: block; width: 100%;
    background: #e8eef5; border: none;
    padding: 6px; cursor: pointer;
    color: #1a3a5c; font-weight: bold;
    border-top: 1px solid #b0c4de;
    font-family: inherit;
}
.btn-add-row:hover { background: #d4e4f7; }

.invoice-totals {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    background: #f0f5fa;
    border: 1px solid #b0c4de;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 10px;
}
.tot-row {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}
.tot-row label {
    width: 140px;
    font-size: 12.5px;
    font-weight: bold;
    color: #1a3a5c;
}
.tot-row input {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid #7f9db9;
    font-family: inherit;
    font-size: 12.5px;
    background: white;
}
.highlight-total input {
    background: #fff8b0;
    font-weight: bold;
    font-size: 14px;
}
.totals-word {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    border-top: 1px dashed #b0c4de;
    padding-top: 10px;
    margin-top: 5px;
}
.totals-word label {
    width: 140px;
    font-weight: bold;
    color: #1a3a5c;
}
.totals-word input {
    flex: 1;
    background: #fffdf0;
    border: 1px solid #c9a800;
    padding: 6px 10px;
    font-weight: bold;
    color: #7a5c00;
}

/* ═══════════════════════════════════════════════════════════
   14) الصلاحيات والإعدادات
   ═══════════════════════════════════════════════════════════ */
.permissions-box {
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.perm-check, .gperm-check {
    width: 15px;
    height: 15px;
    accent-color: #4a7ba7;
    cursor: pointer;
}
.perm-check:checked + span,
label:has(.perm-check:checked) {
    color: #1a3a5c;
    font-weight: bold;
}
.setting-row {
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #e0e8f0;
    border-radius: 4px;
}
.setting-row:hover {
    background: #f0f5fa;
    border-color: #b0c4de;
}

/* ═══════════════════════════════════════════════════════════
   15) نافذة اختيار الأصناف - النسخة النهائية (Modal Overlay)
   ═══════════════════════════════════════════════════════════ */

/* حاوية النافذة المنبثقة - تغطي الشاشة كاملة */
#itemsPickerModal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 20px !important;
    background: rgba(0, 0, 0, 0.7) !important;
    z-index: 9999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    animation: ipFadeIn 0.2s ease !important;
}

/* منع تمرير الصفحة عند فتح النافذة */
body:has(#itemsPickerModal) {
    overflow: hidden !important;
}

/* نافذة المحتوى */
#itemsPickerModal .ip-dialog {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    width: 950px !important;
    max-width: 95vw !important;
    height: 700px !important;
    max-height: 90vh !important;
    background: #ffffff !important;
    border-radius: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6) !important;
    animation: ipSlideUp 0.25s ease !important;
}

/* الرأس */
#itemsPickerModal .ip-header {
    background: linear-gradient(to bottom, #5b8db8, #3a7ba7) !important;
    color: #ffffff !important;
    padding: 14px 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 3px solid #2c5a7d !important;
    flex-shrink: 0 !important;
}
#itemsPickerModal .ip-title {
    font-weight: bold !important;
    font-size: 16px !important;
    color: #ffffff !important;
}
#itemsPickerModal .ip-close {
    background: rgba(255,255,255,0.15) !important;
    border: 1px solid rgba(255,255,255,0.3) !important;
    color: #ffffff !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    font-size: 15px !important;
    font-weight: bold !important;
    transition: all 0.15s !important;
}
#itemsPickerModal .ip-close:hover {
    background: #c0392b !important;
    border-color: #c0392b !important;
}

/* شريط البحث */
#itemsPickerModal .ip-toolbar {
    display: flex !important;
    gap: 12px !important;
    padding: 14px 20px !important;
    background: #f0f4f8 !important;
    border-bottom: 1px solid #d0d9e3 !important;
    align-items: center !important;
    flex-shrink: 0 !important;
}
#itemsPickerModal .ip-search-box {
    flex: 1 !important;
    position: relative !important;
}
#itemsPickerModal .ip-search-input {
    width: 100% !important;
    padding: 12px 45px 12px 15px !important;
    border: 2px solid #b0c4de !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    box-sizing: border-box !important;
}
#itemsPickerModal .ip-search-input:focus {
    outline: none !important;
    border-color: #4a7ba7 !important;
    box-shadow: 0 0 0 4px rgba(74,123,167,0.15) !important;
    background: #fffdf5 !important;
}
#itemsPickerModal .ip-search-icon {
    position: absolute !important;
    left: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 18px !important;
    color: #4a7ba7 !important;
    pointer-events: none !important;
}
#itemsPickerModal .ip-counter {
    background: #4a7ba7 !important;
    color: #ffffff !important;
    padding: 10px 18px !important;
    border-radius: 6px !important;
    font-weight: bold !important;
    font-size: 13px !important;
    white-space: nowrap !important;
}
#itemsPickerModal .ip-counter span {
    background: #ffffff !important;
    color: #4a7ba7 !important;
    padding: 2px 10px !important;
    border-radius: 12px !important;
    font-weight: bold !important;
}

/* الفلاتر */
#itemsPickerModal .ip-filters {
    display: flex !important;
    gap: 15px !important;
    padding: 12px 20px !important;
    background: #f8fafc !important;
    border-bottom: 1px solid #e0e8f0 !important;
    align-items: center !important;
    font-size: 13px !important;
    flex-shrink: 0 !important;
    flex-wrap: wrap !important;
}
#itemsPickerModal .ip-filters label {
    font-weight: bold !important;
    color: #1a3a5c !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}
#itemsPickerModal .ip-group-select {
    padding: 8px 12px !important;
    border: 1px solid #b0c4de !important;
    border-radius: 5px !important;
    font-family: inherit !important;
    font-size: 13px !important;
    min-width: 220px !important;
    background: #ffffff !important;
    cursor: pointer !important;
}

/* الجدول */
#itemsPickerModal .ip-body {
    flex: 1 !important;
    overflow-y: auto !important;
    background: #ffffff !important;
    min-height: 0 !important;
}
#itemsPickerModal .ip-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 13px !important;
}
#itemsPickerModal .ip-table thead th {
    background: linear-gradient(to bottom, #4a7ba7, #3a6890) !important;
    color: #ffffff !important;
    padding: 12px 10px !important;
    text-align: right !important;
    font-weight: bold !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    border-left: 1px solid rgba(255,255,255,0.2) !important;
    font-size: 12.5px !important;
}
#itemsPickerModal .ip-table tbody tr {
    border-bottom: 1px solid #eef3f8 !important;
    cursor: pointer !important;
    transition: background 0.1s !important;
}
#itemsPickerModal .ip-table tbody tr:nth-child(even) {
    background: #fafcfe !important;
}
#itemsPickerModal .ip-table tbody tr:hover {
    background: #e6f0fa !important;
}
#itemsPickerModal .ip-table tbody tr.ip-selected {
    background: #ffe9a8 !important;
    box-shadow: inset 4px 0 0 #d4a800 !important;
}
#itemsPickerModal .ip-table td {
    padding: 10px !important;
    border-left: 1px solid #eef3f8 !important;
    vertical-align: middle !important;
}
#itemsPickerModal .ip-table td:first-child {
    background: #f0f4f8 !important;
    text-align: center !important;
    font-weight: bold !important;
    color: #4a7ba7 !important;
}

/* التذييل */
#itemsPickerModal .ip-footer {
    background: #f0f4f8 !important;
    border-top: 2px solid #d0d9e3 !important;
    padding: 12px 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-shrink: 0 !important;
}
#itemsPickerModal .ip-hint {
    font-size: 12px !important;
    color: #666 !important;
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
}
#itemsPickerModal .ip-hint > span:first-child {
    background: #fff8dc !important;
    padding: 4px 10px !important;
    border-radius: 4px !important;
    border: 1px solid #d4a800 !important;
    color: #7a5c00 !important;
    font-weight: bold !important;
}
#itemsPickerModal .ip-actions {
    display: flex !important;
    gap: 10px !important;
}
#itemsPickerModal .ip-btn {
    padding: 10px 28px !important;
    border-radius: 5px !important;
    border: 1px solid #999 !important;
    cursor: pointer !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: bold !important;
    transition: all 0.15s !important;
}
#itemsPickerModal .ip-btn-cancel {
    background: linear-gradient(to bottom, #f0f0f0, #e0e0e0) !important;
    color: #333 !important;
}
#itemsPickerModal .ip-btn-ok {
    background: linear-gradient(to bottom, #5fa0d4, #4a8bc2) !important;
    color: #ffffff !important;
    border-color: #3a7ba7 !important;
}

/* حقل اسم الصنف */
.in-item-name {
    cursor: pointer !important;
    background: #f8fbff !important;
    position: relative;
}
.in-item-name:hover {
    background: #e6f0fa !important;
}
.in-item-name:focus {
    background: #fff8b0 !important;
}
.in-barcode {
    font-family: monospace;
    font-size: 12px;
}

/* Animations */
@keyframes ipFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes ipSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   16) الطباعة
   ═══════════════════════════════════════════════════════════ */
@media print {
    .topbar, .main-menu, .sidebar, .status-bar, .toolbar, .tabs-bar { display: none !important; }
    .content { padding: 0; }
    .invoice-items-table td input { border: none; }
    #itemsPickerModal { display: none !important; }
}
/* ═══════════════════════════════════════════════════════════
   نافذة الأصناف - التصميم الكامل مع مجموعات جانبية
   ═══════════════════════════════════════════════════════════ */

#itemsPickerModal,
#partnersPickerModal,
#accountsPickerModal {
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    right: 0 !important; bottom: 0 !important;
    width: 100% !important; height: 100% !important;
    margin: 0 !important; padding: 20px !important;
    background: rgba(0, 0, 0, 0.7) !important;
    z-index: 9999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

body:has(#itemsPickerModal),
body:has(#partnersPickerModal),
body:has(#accountsPickerModal) {
    overflow: hidden !important;
}

/* ─────────── نافذة الأصناف ─────────── */
.ip-dialog {
    width: 1200px !important;
    max-width: 97vw !important;
    height: 750px !important;
    max-height: 92vh !important;
    background: #fff !important;
    border-radius: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-shadow: 0 25px 80px rgba(0,0,0,0.6) !important;
}

.ip-header {
    background: linear-gradient(to bottom, #5b8db8, #3a7ba7) !important;
    color: #fff !important;
    padding: 14px 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 3px solid #2c5a7d !important;
    flex-shrink: 0 !important;
}
.ip-title { font-weight: bold !important; font-size: 16px !important; }
.ip-close {
    background: rgba(255,255,255,0.15) !important;
    border: 1px solid rgba(255,255,255,0.3) !important;
    color: #fff !important;
    width: 30px !important; height: 30px !important;
    border-radius: 5px !important; cursor: pointer !important;
    font-size: 15px !important; font-weight: bold !important;
}
.ip-close:hover { background: #c0392b !important; }

/* الحاوية الرئيسية: مجموعات + محتوى */
.ip-main {
    flex: 1 !important;
    display: flex !important;
    overflow: hidden !important;
    min-height: 0 !important;
}

/* الشريط الجانبي للمجموعات */
.ip-sidebar {
    width: 250px !important;
    background: #f0f4f8 !important;
    border-left: 1px solid #d0d9e3 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
}
.ip-sidebar-title {
    background: linear-gradient(to bottom, #4a7ba7, #3a6890) !important;
    color: #fff !important;
    padding: 10px 15px !important;
    font-weight: bold !important;
    font-size: 13px !important;
    flex-shrink: 0 !important;
}
.ip-groups-list {
    list-style: none !important;
    padding: 5px !important;
    margin: 0 !important;
    overflow-y: auto !important;
    flex: 1 !important;
}
.ip-groups-list li {
    padding: 8px 12px !important;
    cursor: pointer !important;
    border-radius: 4px !important;
    font-size: 12.5px !important;
    color: #1a3a5c !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 2px !important;
    transition: all 0.15s !important;
}
.ip-groups-list li:hover {
    background: #e0ecf7 !important;
}
.ip-groups-list li.active {
    background: #4a7ba7 !important;
    color: #fff !important;
    font-weight: bold !important;
}
.ip-groups-list .ip-badge {
    background: rgba(255,255,255,0.5) !important;
    color: #1a3a5c !important;
    padding: 2px 8px !important;
    border-radius: 10px !important;
    font-size: 11px !important;
    font-weight: bold !important;
    min-width: 25px !important;
    text-align: center !important;
}
.ip-groups-list li.active .ip-badge {
    background: rgba(255,255,255,0.9) !important;
    color: #3a6890 !important;
}

/* المحتوى الرئيسي */
.ip-content {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    min-width: 0 !important;
}

.ip-toolbar {
    display: flex !important;
    gap: 12px !important;
    padding: 14px 20px !important;
    background: #f8fafc !important;
    border-bottom: 1px solid #e0e8f0 !important;
    align-items: center !important;
    flex-shrink: 0 !important;
}
.ip-search-box { flex: 1 !important; position: relative !important; }
.ip-search-input {
    width: 100% !important;
    padding: 11px 45px 11px 15px !important;
    border: 2px solid #b0c4de !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    box-sizing: border-box !important;
}
.ip-search-input:focus {
    outline: none !important;
    border-color: #4a7ba7 !important;
    box-shadow: 0 0 0 4px rgba(74,123,167,0.15) !important;
}
.ip-search-icon {
    position: absolute !important;
    left: 15px !important; top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 18px !important; color: #4a7ba7 !important;
    pointer-events: none !important;
}
.ip-counter {
    background: #4a7ba7 !important;
    color: #fff !important;
    padding: 10px 18px !important;
    border-radius: 6px !important;
    font-weight: bold !important;
    font-size: 13px !important;
    white-space: nowrap !important;
}
.ip-counter span {
    background: #fff !important;
    color: #4a7ba7 !important;
    padding: 2px 10px !important;
    border-radius: 12px !important;
    font-weight: bold !important;
}

/* شريط التحديد المتعدد */
.ip-multi-toolbar {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 20px !important;
    background: #fff8dc !important;
    border-bottom: 2px solid #d4a800 !important;
    font-size: 13px !important;
    color: #7a5c00 !important;
    flex-shrink: 0 !important;
}
.ip-multi-toolbar label {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    cursor: pointer !important;
    font-weight: bold !important;
}
.ip-selected-info {
    background: #d4a800 !important;
    color: #fff !important;
    padding: 4px 12px !important;
    border-radius: 15px !important;
    font-weight: bold !important;
}
.ip-selected-info span {
    background: #fff !important;
    color: #d4a800 !important;
    padding: 1px 8px !important;
    border-radius: 10px !important;
    margin-right: 3px !important;
}

.ip-table-wrap {
    flex: 1 !important;
    overflow-y: auto !important;
    background: #fff !important;
    min-height: 0 !important;
}
.ip-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 12.5px !important;
}
.ip-table thead th {
    background: linear-gradient(to bottom, #4a7ba7, #3a6890) !important;
    color: #fff !important;
    padding: 10px 8px !important;
    text-align: right !important;
    font-weight: bold !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    border-left: 1px solid rgba(255,255,255,0.2) !important;
}
.ip-table tbody tr {
    border-bottom: 1px solid #eef3f8 !important;
    cursor: pointer !important;
    transition: background 0.1s !important;
}
.ip-table tbody tr:nth-child(even) { background: #fafcfe !important; }
.ip-table tbody tr:hover { background: #e6f0fa !important; }
.ip-table tbody tr.ip-selected { background: #ffe9a8 !important; }
.ip-table td {
    padding: 8px !important;
    border-left: 1px solid #eef3f8 !important;
    vertical-align: middle !important;
}
.ip-row-check {
    width: 18px !important;
    height: 18px !important;
    cursor: pointer !important;
    accent-color: #27ae60 !important;
}

.ip-footer {
    background: #f0f4f8 !important;
    border-top: 2px solid #d0d9e3 !important;
    padding: 12px 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-shrink: 0 !important;
}
.ip-hint { font-size: 12px !important; color: #666 !important; }
.ip-hint > span:first-child {
    background: #fff8dc !important;
    padding: 4px 10px !important;
    border-radius: 4px !important;
    border: 1px solid #d4a800 !important;
    color: #7a5c00 !important;
    font-weight: bold !important;
    margin-left: 5px !important;
}
.ip-actions { display: flex !important; gap: 10px !important; }
.ip-btn {
    padding: 10px 25px !important;
    border-radius: 5px !important;
    border: 1px solid #999 !important;
    cursor: pointer !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: bold !important;
}
.ip-btn-cancel { background: linear-gradient(to bottom, #f0f0f0, #e0e0e0) !important; color: #333 !important; }
.ip-btn-ok { background: linear-gradient(to bottom, #27ae60, #1e8449) !important; color: #fff !important; border-color: #145a32 !important; }

/* ─────────── نافذة العملاء ─────────── */
.pp-dialog {
    width: 900px !important;
    max-width: 95vw !important;
    height: 650px !important;
    max-height: 90vh !important;
    background: #fff !important;
    border-radius: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-shadow: 0 25px 80px rgba(0,0,0,0.6) !important;
}
.pp-header {
    background: linear-gradient(to bottom, #27ae60, #1e8449) !important;
    color: #fff !important;
    padding: 14px 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 3px solid #145a32 !important;
}
.pp-title { font-weight: bold !important; font-size: 16px !important; }
.pp-close {
    background: rgba(255,255,255,0.15) !important;
    border: 1px solid rgba(255,255,255,0.3) !important;
    color: #fff !important;
    width: 30px !important; height: 30px !important;
    border-radius: 5px !important; cursor: pointer !important;
    font-size: 15px !important;
}
.pp-close:hover { background: #c0392b !important; }
.pp-toolbar {
    display: flex !important;
    gap: 12px !important;
    padding: 14px 20px !important;
    background: #f0f9f3 !important;
    border-bottom: 1px solid #b8e0c8 !important;
    align-items: center !important;
}
.pp-search-box { flex: 1 !important; position: relative !important; }
.pp-search-input {
    width: 100% !important;
    padding: 11px 45px 11px 15px !important;
    border: 2px solid #a8d8b8 !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    box-sizing: border-box !important;
}
.pp-search-input:focus {
    outline: none !important;
    border-color: #27ae60 !important;
    box-shadow: 0 0 0 4px rgba(39,174,96,0.15) !important;
}
.pp-search-icon {
    position: absolute !important;
    left: 15px !important; top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 18px !important; color: #27ae60 !important;
    pointer-events: none !important;
}
.pp-counter {
    background: #27ae60 !important;
    color: #fff !important;
    padding: 10px 18px !important;
    border-radius: 6px !important;
    font-weight: bold !important;
    font-size: 13px !important;
}
.pp-counter span {
    background: #fff !important;
    color: #27ae60 !important;
    padding: 2px 10px !important;
    border-radius: 12px !important;
    font-weight: bold !important;
}
.pp-body { flex: 1 !important; overflow-y: auto !important; background: #fff !important; }
.pp-table { width: 100% !important; border-collapse: collapse !important; font-size: 12.5px !important; }
.pp-table thead th {
    background: linear-gradient(to bottom, #27ae60, #1e8449) !important;
    color: #fff !important;
    padding: 12px 10px !important;
    text-align: right !important;
    font-weight: bold !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
}
.pp-table tbody tr {
    border-bottom: 1px solid #eef8f0 !important;
    cursor: pointer !important;
}
.pp-table tbody tr:nth-child(even) { background: #f5fdf7 !important; }
.pp-table tbody tr:hover { background: #e0f5e8 !important; }
.pp-table td { padding: 10px !important; }

.pp-footer {
    background: #f0f9f3 !important;
    border-top: 2px solid #b8e0c8 !important;
    padding: 12px 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}
.pp-hint { font-size: 12px !important; color: #666 !important; }
.pp-actions { display: flex !important; gap: 10px !important; }
.pp-btn {
    padding: 10px 25px !important;
    border-radius: 5px !important;
    border: 1px solid #999 !important;
    cursor: pointer !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: bold !important;
}
.pp-btn-cancel { background: linear-gradient(to bottom, #f0f0f0, #e0e0e0) !important; color: #333 !important; }
.pp-btn-ok { background: linear-gradient(to bottom, #27ae60, #1e8449) !important; color: #fff !important; border-color: #145a32 !important; }

/* ─────────── نافذة الحسابات ─────────── */
.ap-dialog {
    width: 850px !important;
    max-width: 95vw !important;
    height: 650px !important;
    max-height: 90vh !important;
    background: #fff !important;
    border-radius: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-shadow: 0 25px 80px rgba(0,0,0,0.6) !important;
}
.ap-header {
    background: linear-gradient(to bottom, #e67e22, #ca6f1e) !important;
    color: #fff !important;
    padding: 14px 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 3px solid #a04000 !important;
}
.ap-title { font-weight: bold !important; font-size: 16px !important; }
.ap-close {
    background: rgba(255,255,255,0.15) !important;
    border: 1px solid rgba(255,255,255,0.3) !important;
    color: #fff !important;
    width: 30px !important; height: 30px !important;
    border-radius: 5px !important; cursor: pointer !important;
    font-size: 15px !important;
}
.ap-close:hover { background: #c0392b !important; }
.ap-toolbar {
    display: flex !important;
    gap: 12px !important;
    padding: 14px 20px !important;
    background: #fff8f0 !important;
    border-bottom: 1px solid #f0d8b8 !important;
    align-items: center !important;
}
.ap-search-box { flex: 1 !important; position: relative !important; }
.ap-search-input {
    width: 100% !important;
    padding: 11px 45px 11px 15px !important;
    border: 2px solid #f0c890 !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    box-sizing: border-box !important;
}
.ap-search-input:focus {
    outline: none !important;
    border-color: #e67e22 !important;
    box-shadow: 0 0 0 4px rgba(230,126,34,0.15) !important;
}
.ap-search-icon {
    position: absolute !important;
    left: 15px !important; top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 18px !important; color: #e67e22 !important;
    pointer-events: none !important;
}
.ap-counter {
    background: #e67e22 !important;
    color: #fff !important;
    padding: 10px 18px !important;
    border-radius: 6px !important;
    font-weight: bold !important;
    font-size: 13px !important;
}
.ap-counter span {
    background: #fff !important;
    color: #e67e22 !important;
    padding: 2px 10px !important;
    border-radius: 12px !important;
    font-weight: bold !important;
}
.ap-filters {
    display: flex !important;
    gap: 12px !important;
    padding: 10px 20px !important;
    background: #fffbf5 !important;
    border-bottom: 1px solid #f0d8b8 !important;
    align-items: center !important;
    font-size: 13px !important;
}
.ap-filters label { font-weight: bold !important; color: #7a3f00 !important; }
.ap-type-select {
    padding: 8px 12px !important;
    border: 1px solid #f0c890 !important;
    border-radius: 5px !important;
    font-family: inherit !important;
    font-size: 13px !important;
    min-width: 180px !important;
}
.ap-body { flex: 1 !important; overflow-y: auto !important; background: #fff !important; }
.ap-table { width: 100% !important; border-collapse: collapse !important; font-size: 12.5px !important; }
.ap-table thead th {
    background: linear-gradient(to bottom, #e67e22, #ca6f1e) !important;
    color: #fff !important;
    padding: 12px 10px !important;
    text-align: right !important;
    font-weight: bold !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
}
.ap-table tbody tr {
    border-bottom: 1px solid #fef5ec !important;
    cursor: pointer !important;
}
.ap-table tbody tr:nth-child(even) { background: #fefcf9 !important; }
.ap-table tbody tr:hover { background: #fff3e0 !important; }
.ap-table tbody tr.ap-selected { background: #ffe0b2 !important; }
.ap-table td { padding: 10px !important; }

.ap-footer {
    background: #fff8f0 !important;
    border-top: 2px solid #f0d8b8 !important;
    padding: 12px 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}
.ap-hint { font-size: 12px !important; color: #666 !important; }
.ap-actions { display: flex !important; gap: 10px !important; }
.ap-btn {
    padding: 10px 25px !important;
    border-radius: 5px !important;
    border: 1px solid #999 !important;
    cursor: pointer !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: bold !important;
}
.ap-btn-cancel { background: linear-gradient(to bottom, #f0f0f0, #e0e0e0) !important; color: #333 !important; }
.ap-btn-ok { background: linear-gradient(to bottom, #e67e22, #ca6f1e) !important; color: #fff !important; border-color: #a04000 !important; }

/* ═══ حقول الاختيار المنبثقة ═══ */
.picker-field {
    cursor: pointer !important;
    background: #f8fbff !important;
    position: relative !important;
    padding-left: 30px !important;
}
.picker-field:hover { background: #e6f0fa !important; }
.picker-field:focus { background: #fff8b0 !important; }
.picker-field::after {
    content: '▼' !important;
    position: absolute !important;
    left: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 9px !important;
    color: #4a7ba7 !important;
    pointer-events: none !important;
}
/* ═══════════════════════════════════════════════════════
   نافذة مراكز التكلفة
   ═══════════════════════════════════════════════════════ */
#ccPickerModal {
    position: fixed !important;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7) !important;
    z-index: 9999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px;
    box-sizing: border-box;
}
body:has(#ccPickerModal) { overflow: hidden !important; }

.cc-dialog {
    width: 750px; max-width: 95vw;
    height: 600px; max-height: 90vh;
    background: #fff; border-radius: 10px;
    display: flex; flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0,0,0,0.6);
}
.cc-header {
    background: linear-gradient(to bottom, #8e44ad, #6c3483);
    color: #fff; padding: 14px 20px;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 3px solid #4a235a;
}
.cc-title { font-weight: bold; font-size: 16px; }
.cc-close {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff; width: 30px; height: 30px;
    border-radius: 5px; cursor: pointer; font-size: 15px;
}
.cc-close:hover { background: #c0392b; }

/* زر جديد */
.cc-new-btn, .ip-new-btn, .pp-new-btn, .ap-new-btn {
    background: #27ae60; color: #fff;
    border: none; padding: 6px 14px;
    border-radius: 5px; cursor: pointer;
    font-family: inherit; font-size: 12.5px;
    font-weight: bold; display: flex; align-items: center; gap: 4px;
}
.cc-new-btn:hover, .ip-new-btn:hover, .pp-new-btn:hover, .ap-new-btn:hover {
    background: #1e8449;
}

.cc-toolbar {
    display: flex; gap: 12px;
    padding: 14px 20px;
    background: #f9f4fc;
    border-bottom: 1px solid #e0d0e8;
    align-items: center;
}
.cc-search-box { flex: 1; position: relative; }
.cc-search-input {
    width: 100%; padding: 11px 45px 11px 15px;
    border: 2px solid #d5b8e0; border-radius: 6px;
    font-size: 14px; font-family: inherit;
    box-sizing: border-box;
}
.cc-search-input:focus {
    outline: none; border-color: #8e44ad;
    box-shadow: 0 0 0 4px rgba(142,68,173,0.15);
}
.cc-search-icon {
    position: absolute; left: 15px; top: 50%;
    transform: translateY(-50%);
    font-size: 18px; color: #8e44ad;
    pointer-events: none;
}
.cc-counter {
    background: #8e44ad; color: #fff;
    padding: 10px 18px; border-radius: 6px;
    font-weight: bold; font-size: 13px;
}
.cc-counter span {
    background: #fff; color: #8e44ad;
    padding: 2px 10px; border-radius: 12px;
    font-weight: bold;
}

.cc-body { flex: 1; overflow-y: auto; background: #fff; }
.cc-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cc-table thead th {
    background: linear-gradient(to bottom, #8e44ad, #6c3483);
    color: #fff; padding: 12px 10px;
    text-align: right; font-weight: bold;
    position: sticky; top: 0; z-index: 10;
}
.cc-table tbody tr { border-bottom: 1px solid #f5f0f8; cursor: pointer; }
.cc-table tbody tr:nth-child(even) { background: #fcfafd; }
.cc-table tbody tr:hover { background: #f3e8f8; }
.cc-table tbody tr.cc-selected { background: #e6d0f0 !important; }
.cc-table td { padding: 10px; }

.cc-footer {
    background: #f9f4fc;
    border-top: 2px solid #e0d0e8;
    padding: 12px 20px;
    display: flex; justify-content: space-between; align-items: center;
}
.cc-hint { font-size: 12px; color: #666; }
.cc-actions { display: flex; gap: 10px; }
.cc-btn {
    padding: 10px 25px; border-radius: 5px;
    border: 1px solid #999; cursor: pointer;
    font-family: inherit; font-size: 13px; font-weight: bold;
}
.cc-btn-cancel { background: linear-gradient(to bottom, #f0f0f0, #e0e0e0); color: #333; }
.cc-btn-ok { background: linear-gradient(to bottom, #8e44ad, #6c3483); color: #fff; border-color: #4a235a; }

/* ═══════════════════════════════════════════════════════
   نافذة خيارات الطباعة
   ═══════════════════════════════════════════════════════ */
.po-modal {
    position: fixed !important;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.75) !important;
    z-index: 99999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px;
    box-sizing: border-box;
}
.po-dialog {
    width: 800px; max-width: 95vw;
    background: #fff; border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0,0,0,0.6);
    animation: poSlideIn 0.3s ease;
}
@keyframes poSlideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
.po-header {
    background: linear-gradient(to bottom, #27ae60, #1e8449);
    color: #fff; padding: 16px 24px;
    display: flex; justify-content: space-between; align-items: center;
    font-weight: bold; font-size: 16px;
}
.po-close {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff; width: 30px; height: 30px;
    border-radius: 5px; cursor: pointer; font-size: 15px;
}
.po-close:hover { background: #c0392b; }

.po-body { padding: 25px 30px; }
.po-message {
    text-align: center; font-size: 16px;
    color: #1a3a5c; font-weight: bold;
    margin-bottom: 25px;
}

.po-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}
.po-option {
    background: #f8fafc;
    border: 2px solid #e0e8f0;
    border-radius: 10px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.po-option:hover {
    background: #e6f0fa;
    border-color: #4a7ba7;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(74,123,167,0.25);
}
.po-opt-icon { font-size: 40px; margin-bottom: 10px; }
.po-opt-title {
    font-weight: bold; color: #1a3a5c;
    font-size: 14px; margin-bottom: 5px;
}
.po-opt-desc {
    font-size: 11.5px; color: #666;
}

.po-footer {
    background: #f0f4f8;
    padding: 12px 24px;
    border-top: 1px solid #d0d9e3;
    font-size: 13px;
    color: #555;
}
.po-footer label {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer;
}
/* ═══════════════════════════════════════════════════════
   السندات - التصميم المطابق للصور
   ═══════════════════════════════════════════════════════ */

/* ─────── الحاوية الرئيسية ─────── */
.vc-header {
    background: #f5f9fd;
    border: 1px solid #b0c4de;
    border-radius: 4px;
    padding: 12px 15px;
    margin-bottom: 8px;
}
.vc-header-row {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    align-items: flex-end;
}
.vc-header-row:last-child { margin-bottom: 0; }

.vc-field-group {
    display: flex;
    gap: 8px;
    flex: 1;
}
.vc-field-group.wide {
    flex: 1.8;
}

.vc-field {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 100px;
}
.vc-field label {
    font-size: 11.5px;
    color: #1a3a5c;
    font-weight: bold;
    margin-bottom: 3px;
    text-align: right;
}

.vc-input {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #7f9db9;
    background: #fff;
    font-family: inherit;
    font-size: 12.5px;
    color: #000;
    box-sizing: border-box;
    height: 26px;
}
.vc-input:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 2px #a8c8e8;
}
.vc-input.yellow { background: #ffffcc; }
.vc-input[readonly] { background: #f5f5f5; }

.vc-icon-btn {
    width: 28px;
    height: 26px;
    border: 1px solid #7f9db9;
    background: #e8e8e8;
    cursor: pointer;
    border-radius: 3px;
    font-size: 13px;
}
.vc-icon-btn:hover { background: #d4e4f7; }

/* زر تحويل السند */
.vc-transfer-btn {
    padding: 6px 20px;
    background: linear-gradient(to bottom, #5b8db8, #4a7ba7);
    color: #fff;
    border: 1px solid #3a6890;
    border-radius: 3px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: bold;
    height: 26px;
}
.vc-transfer-btn:hover { background: linear-gradient(to bottom, #4a7ba7, #3a6890); }

/* ─────── جدول السطور ─────── */
.vc-table-wrap {
    background: #fff;
    border: 1px solid #b0c4de;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
    max-height: 430px;
    overflow-y: auto;
}

.vc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
    background: #fff;
}

.vc-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.vc-table thead th {
    background: linear-gradient(to bottom, #a8d0e8, #7fb8d8);
    color: #000;
    padding: 6px 4px;
    text-align: center;
    font-weight: bold;
    border: 1px solid #6aa0c0;
    font-size: 11px;
    white-space: nowrap;
}

.vc-table tbody tr {
    border-bottom: 1px solid #c9e4f5;
}
.vc-table tbody tr:nth-child(odd) {
    background: #e0f2fb;
}
.vc-table tbody tr:nth-child(even) {
    background: #f0f8fc;
}
.vc-table tbody tr:hover {
    background: #fff8b0 !important;
}

.vc-table td {
    padding: 0;
    border: 1px solid #b8d8e8;
    vertical-align: middle;
    height: 26px;
}

.vc-row-num {
    text-align: center;
    font-weight: bold;
    color: #1a3a5c;
    background: #c9e4f5 !important;
    font-size: 11.5px;
}

.vc-cell-center {
    text-align: center;
    padding: 0 4px;
}

.vc-cell-input {
    width: 100%;
    padding: 4px 6px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 11.5px;
    color: #000;
    text-align: center;
    box-sizing: border-box;
    height: 26px;
}
.vc-cell-input:focus {
    background: #fff8b0;
    outline: 1px solid #c9a800;
}
.vc-cell-input.picker-field {
    cursor: pointer;
    text-align: right;
    padding-right: 6px;
}
.vc-cell-input.picker-field:hover {
    background: #fff8b0;
}
.vc-cell-input[readonly] {
    background: transparent;
}

.vc-use-tax {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #4a7ba7;
}

.vc-del-btn {
    width: 22px;
    height: 22px;
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
}
.vc-del-btn:hover { background: #a93226; }

/* صفوف التذييل */
.vc-total-row td {
    background: linear-gradient(to bottom, #a8d0e8, #90c0dc) !important;
    color: #1a3a5c;
    border: 1px solid #6aa0c0;
    font-weight: bold;
    padding: 8px 10px !important;
    font-size: 13px;
}
.vc-tax-row td {
    background: linear-gradient(to bottom, #d4edda, #b8e0c8) !important;
    color: #145a32;
    border: 1px solid #8fbfa3;
    font-weight: bold;
    padding: 6px 10px !important;
    font-size: 12.5px;
}
.vc-words-row td {
    background: #fff8dc !important;
    color: #7a5c00;
    border: 1px solid #d4a800;
    font-size: 13px;
    padding: 10px !important;
}

/* ─────── شريط الأدوات السفلي ─────── */
.vc-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, #e8eef5, #d4e0ec);
    border: 1px solid #b0c4de;
    border-radius: 4px;
    padding: 6px 10px;
}

.vc-toolbar-left {
    display: flex;
    gap: 4px;
}

.vc-toolbar-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

.vc-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    padding: 4px 8px;
    background: linear-gradient(to bottom, #f8f8f8, #e0e0e0);
    border: 1px solid #999;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    color: #333;
    line-height: 1.2;
    transition: all 0.15s;
}
.vc-btn:hover {
    background: linear-gradient(to bottom, #d4e4f7, #b0c8e0);
    border-color: #4a7ba7;
}
.vc-btn:active {
    background: linear-gradient(to bottom, #a8c0d8, #90b0c8);
}

.vc-btn-icon {
    font-size: 16px;
    margin-bottom: 2px;
}
.vc-btn-key {
    font-size: 9px;
    color: #666;
    background: #f0f0f0;
    padding: 0 4px;
    border-radius: 2px;
    margin-top: 2px;
}

.vc-btn-sm {
    padding: 6px 14px;
    background: linear-gradient(to bottom, #f8f8f8, #e0e0e0);
    border: 1px solid #999;
    border-radius: 3px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    color: #333;
}
.vc-btn-sm:hover {
    background: linear-gradient(to bottom, #d4e4f7, #b0c8e0);
}

.vc-check {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #1a3a5c;
    font-weight: bold;
    cursor: pointer;
}

/* pager buttons */
.pager-btn {
    padding: 2px 8px;
    background: #f0f0f0;
    border: 1px solid #999;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    margin: 0 2px;
}
.pager-btn:hover {
    background: #d4e4f7;
}
/* ═══════════════════════════════════════════════════════
   الدليل المحاسبي - شاشة كاملة
   ═══════════════════════════════════════════════════════ */

.acc-split {
    display: flex;
    gap: 10px;
    min-height: calc(100vh - 140px);
}

/* ─────────── الجانب الأيسر: النموذج ─────────── */
.acc-form {
    width: 360px;
    background: #f5f9fd;
    border: 1px solid #b0c4de;
    border-radius: 4px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.acc-form-inner {
    flex: 1;
    overflow-y: auto;
}

.acc-row {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    gap: 8px;
    min-height: 28px;
}

.acc-row > label:first-child {
    width: 110px;
    font-size: 12px;
    font-weight: bold;
    color: #1a3a5c;
    text-align: right;
    flex-shrink: 0;
}

.acc-input {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid #7f9db9;
    background: #fff;
    font-family: inherit;
    font-size: 12.5px;
    height: 26px;
    box-sizing: border-box;
}

.acc-input:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 2px #a8c8e8;
}

.acc-input.yellow {
    background: #ffffcc;
}

.acc-icon-btn {
    width: 26px;
    height: 26px;
    border: 1px solid #7f9db9;
    background: #e8e8e8;
    cursor: pointer;
    border-radius: 3px;
    font-size: 12px;
    padding: 0;
}
.acc-icon-btn:hover { background: #d4e4f7; }

.acc-radio-group {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 12px;
    flex: 1;
}
.acc-radio-group label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-weight: normal;
    color: #333;
}

/* ─────────── شريط الأدوات السفلي ─────────── */
.acc-toolbar {
    display: flex;
    justify-content: space-around;
    gap: 3px;
    padding: 8px 5px;
    background: linear-gradient(to bottom, #e8eef5, #d4e0ec);
    border: 1px solid #b0c4de;
    border-radius: 4px;
    margin-top: 10px;
}

.acc-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 4px 6px;
    background: linear-gradient(to bottom, #f8f8f8, #e0e0e0);
    border: 1px solid #999;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 10.5px;
    color: #333;
    line-height: 1.2;
    transition: all 0.15s;
}

.acc-btn:hover {
    background: linear-gradient(to bottom, #d4e4f7, #b0c8e0);
    border-color: #4a7ba7;
}

.acc-btn:active {
    background: linear-gradient(to bottom, #a8c0d8, #90b0c8);
    transform: translateY(1px);
}

.acc-btn-icon {
    font-size: 15px;
    margin-bottom: 2px;
}

.acc-btn-key {
    font-size: 9px;
    color: #666;
    background: #f0f0f0;
    padding: 0 4px;
    border-radius: 2px;
    margin-top: 2px;
}

/* ─────────── الجانب الأيمن: الشجرة ─────────── */
.acc-tree {
    flex: 1;
    background: #fff;
    border: 1px solid #b0c4de;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.acc-tree-toolbar {
    display: flex;
    gap: 5px;
    padding: 8px;
    background: #f0f4f8;
    border-bottom: 1px solid #d0d9e3;
}

.acc-tree-search {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #b0c4de;
    border-radius: 4px;
    font-family: inherit;
    font-size: 12.5px;
}
.acc-tree-search:focus {
    outline: none;
    border-color: #4a7ba7;
    box-shadow: 0 0 0 2px #a8c8e8;
}

.acc-tree-icon {
    width: 30px;
    height: 28px;
    border: 1px solid #999;
    background: #e8e8e8;
    cursor: pointer;
    border-radius: 3px;
    font-size: 14px;
    font-weight: bold;
}
.acc-tree-icon:hover { background: #d4e4f7; }

.acc-tree-tabs {
    display: flex;
    gap: 2px;
    padding: 4px 8px;
    background: #f0f4f8;
    border-bottom: 1px solid #d0d9e3;
}

.acc-tree-tab {
    padding: 4px 12px;
    background: #fff;
    border: 1px solid #999;
    border-bottom: none;
    border-radius: 3px 3px 0 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    color: #333;
    min-width: 30px;
    transition: all 0.15s;
}

.acc-tree-tab:hover {
    background: #e6f0fa;
}

.acc-tree-tab.active {
    background: #ffe4b5;
    border-color: #c9a800;
    color: #7a5c00;
}

.acc-tree-body {
    flex: 1;
    overflow-y: auto;
    padding: 5px;
    background: #fff;
}

.acc-tree-body::-webkit-scrollbar { width: 10px; }
.acc-tree-body::-webkit-scrollbar-track { background: #f0f4f8; }
.acc-tree-body::-webkit-scrollbar-thumb {
    background: #b0c4de;
    border-radius: 5px;
}
.acc-tree-body::-webkit-scrollbar-thumb:hover { background: #4a7ba7; }

.acc-tree-node {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 12.5px;
    color: #1a3a5c;
    transition: background 0.1s;
    user-select: none;
}

.acc-tree-node:hover {
    background: #e6f0fa;
}

.acc-tree-node.selected {
    background: #ffe9a8;
    font-weight: bold;
    box-shadow: inset 3px 0 0 #d4a800;
}

.acc-tree-arrow {
    width: 14px;
    text-align: center;
    color: #4a7ba7;
    font-weight: bold;
    font-size: 11px;
}

.acc-tree-no {
    color: #4a7ba7;
    font-weight: bold;
    min-width: 50px;
    font-size: 12px;
}

.acc-tree-name {
    flex: 1;
    color: #1a3a5c;
}

.acc-tree-stopped {
    color: #c0392b;
    font-size: 12px;
}

.acc-tree-children {
    /* تُعرض افتراضياً */
}
/* ═══════════════════════════════════════════════════════════
   التحسينات النهائية الموحدة - كبر كل شيء
   ═══════════════════════════════════════════════════════════ */

/* ═══════════ الأساسيات ═══════════ */
body {
    font-size: 15px !important;
    line-height: 1.5 !important;
}

/* ═══════════ الحقول العامة ═══════════ */
.input-field,
.acc-input,
.vc-input,
.vc-cell-input,
.pt-input,
input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="password"],
select,
textarea {
    font-size: 15px !important;
    padding: 9px 12px !important;
    min-height: 40px !important;
    line-height: 1.4 !important;
    border-radius: 4px !important;
    font-family: inherit !important;
}

/* ═══════════ القوائم والتبويبات ═══════════ */

/* شريط التبويبات العلوي - ثابت دائماً */
.tabs-bar {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 12px 18px !important;
    min-height: 60px !important;
    background: #e8eef5 !important;
    border: 2px solid #b0c4de !important;
    border-radius: 6px !important;
    margin-bottom: 15px !important;
    flex-wrap: wrap !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.tabs-bar .tab {
    padding: 12px 25px !important;
    font-size: 15px !important;
    min-height: 44px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    background: #f5f5f5 !important;
    border: 2px solid #999 !important;
    border-radius: 5px !important;
    font-family: inherit !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.tabs-bar .tab.active {
    background: #4a7ba7 !important;
    color: #fff !important;
    border-color: #3a6890 !important;
}

.pager {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-weight: bold !important;
    color: #1a3a5c !important;
    font-size: 15px !important;
}

.pager-btn {
    padding: 8px 14px !important;
    font-size: 15px !important;
    min-width: 42px !important;
    min-height: 40px !important;
    background: #f0f0f0 !important;
    border: 2px solid #999 !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    font-weight: bold !important;
}

.pager-btn:hover {
    background: #d4e4f7 !important;
    border-color: #4a7ba7 !important;
}

#recInfo {
    font-size: 15px !important;
    font-weight: bold !important;
    padding: 0 10px !important;
    color: #1a3a5c !important;
    min-width: 90px !important;
    text-align: center !important;
}

/* ═══════════ الشريط العلوي الأزرق ═══════════ */
.topbar {
    height: 68px !important;
    padding: 0 20px !important;
}

.company-name {
    font-size: 17px !important;
}

.user-name {
    font-size: 15.5px !important;
}

.tb-icon {
    width: 44px !important;
    height: 44px !important;
    font-size: 22px !important;
    border-radius: 8px !important;
}

.lang-btn {
    padding: 9px 18px !important;
    font-size: 14px !important;
}

/* ═══════════ القوائم الرئيسية ═══════════ */
.main-menu {
    height: 40px !important;
    padding: 0 15px !important;
}

.main-menu > .menu-item {
    padding: 10px 20px !important;
    font-size: 15px !important;
    font-weight: bold !important;
}

.dropdown {
    min-width: 280px !important;
}

.dropdown a {
    padding: 11px 16px !important;
    font-size: 14.5px !important;
    line-height: 1.5 !important;
}

.dropdown .shortcut {
    font-size: 12.5px !important;
}

/* ═══════════ القائمة الجانبية ═══════════ */
.sidebar {
    width: 260px !important;
    padding: 10px !important;
}

.side-title {
    padding: 13px 16px !important;
    font-size: 15px !important;
    min-height: 46px !important;
}

.side-items a {
    padding: 12px 28px 12px 16px !important;
    font-size: 14.5px !important;
    min-height: 42px !important;
    line-height: 1.5 !important;
    display: flex !important;
    align-items: center !important;
}

/* ═══════════ الشريط السفلي ═══════════ */
.status-bar {
    height: 42px !important;
    font-size: 13.5px !important;
    padding: 0 20px !important;
}

/* ═══════════ الجداول ═══════════ */
table.data th {
    font-size: 15px !important;
    padding: 14px 14px !important;
    font-weight: bold !important;
}

table.data td {
    font-size: 14.5px !important;
    padding: 12px 14px !important;
    line-height: 1.5 !important;
}

/* جدول الأصناف في الفواتير */
.invoice-items-table thead th {
    font-size: 14px !important;
    padding: 13px 8px !important;
}

.invoice-items-table td input,
.invoice-items-table td select {
    font-size: 14px !important;
    min-height: 36px !important;
    padding: 8px 6px !important;
}

/* جدول السندات */
.vc-table thead th {
    font-size: 13.5px !important;
    padding: 12px 8px !important;
}

.vc-table td {
    height: 38px !important;
}

.vc-cell-input {
    font-size: 14px !important;
    height: 38px !important;
    padding: 8px 10px !important;
}

.vc-row-num {
    font-size: 14px !important;
}

/* ═══════════ النماذج العمودية ═══════════ */
.form-vertical .form-row-v {
    margin-bottom: 14px !important;
    gap: 14px !important;
    min-height: 42px !important;
}

.form-vertical .form-row-v > label:first-child {
    font-size: 15px !important;
    width: 160px !important;
    line-height: 1.5 !important;
}

/* ═══════════ رأس الفاتورة ═══════════ */
.ih-field label {
    font-size: 14.5px !important;
    margin-bottom: 6px !important;
}

.ih-field .input-field {
    font-size: 15px !important;
    padding: 9px 12px !important;
    min-height: 40px !important;
}

/* ═══════════ الإجماليات ═══════════ */
.tot-row {
    margin-bottom: 11px !important;
}

.tot-row label {
    font-size: 15px !important;
    width: 170px !important;
}

.tot-row input {
    font-size: 15px !important;
    padding: 9px 12px !important;
    min-height: 40px !important;
}

.highlight-total input {
    font-size: 16.5px !important;
}

.totals-word label {
    font-size: 15px !important;
    width: 170px !important;
}

.totals-word input {
    font-size: 15.5px !important;
    padding: 10px 14px !important;
    min-height: 44px !important;
}

/* ═══════════ أزرار الأدوات ═══════════ */
.btn-tool {
    padding: 10px 18px !important;
    font-size: 14.5px !important;
    min-height: 40px !important;
    border-radius: 5px !important;
    font-weight: bold !important;
}

.btn-tool .key {
    font-size: 11.5px !important;
    padding: 2px 7px !important;
}

/* ═══════════ أزرار الدليل المحاسبي ═══════════ */
.acc-btn {
    min-width: 72px !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    min-height: 66px !important;
    font-weight: bold !important;
}

.acc-btn-icon {
    font-size: 22px !important;
    margin-bottom: 3px !important;
}

.acc-btn-key {
    font-size: 11px !important;
    padding: 2px 6px !important;
}

/* ═══════════ أزرار السندات ═══════════ */
.vc-btn {
    min-width: 80px !important;
    padding: 8px 12px !important;
    font-size: 13.5px !important;
    min-height: 68px !important;
    font-weight: bold !important;
}

.vc-btn-icon {
    font-size: 22px !important;
    margin-bottom: 3px !important;
}

.vc-btn-key {
    font-size: 11px !important;
}

.vc-btn-sm {
    padding: 10px 18px !important;
    font-size: 14px !important;
    min-height: 44px !important;
}

/* ═══════════ شجرة الحسابات ═══════════ */
.acc-tree-node {
    padding: 10px 12px !important;
    font-size: 15px !important;
    min-height: 38px !important;
    line-height: 1.5 !important;
}

.acc-tree-no {
    font-size: 14.5px !important;
    min-width: 65px !important;
}

.acc-tree-name {
    font-size: 15px !important;
}

.acc-tree-arrow {
    font-size: 15px !important;
    width: 20px !important;
}

.acc-tree-search {
    padding: 10px 14px !important;
    font-size: 15px !important;
    min-height: 42px !important;
}

.acc-tree-tab {
    padding: 10px 18px !important;
    font-size: 15px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    font-weight: bold !important;
}

.acc-tree-icon {
    width: 42px !important;
    height: 42px !important;
    font-size: 18px !important;
}

/* ═══════════ بطاقات الداشبورد ═══════════ */
.dash-card {
    padding: 22px !important;
}

.dash-card .icon {
    width: 66px !important;
    height: 66px !important;
    font-size: 30px !important;
}

.dash-card .info h4 {
    font-size: 15px !important;
    margin-bottom: 8px !important;
}

.dash-card .info .value {
    font-size: 26px !important;
}

/* ═══════════ عناوين الجداول ═══════════ */
.table-box h3 {
    padding: 15px 18px !important;
    font-size: 16px !important;
}

/* ═══════════ العناوين العامة ═══════════ */
h1 { font-size: 28px !important; }
h2 { font-size: 24px !important; }
h3 { font-size: 20px !important; }
h4 { font-size: 17px !important; }

/* ═══════════ النوافذ المنبثقة ═══════════ */
#itemsPickerModal .ip-table tbody tr,
#partnersPickerModal .pp-table tbody tr,
#accountsPickerModal .ap-table tbody tr,
#ccPickerModal .cc-table tbody tr {
    font-size: 14.5px !important;
}

#itemsPickerModal .ip-table td,
#partnersPickerModal .pp-table td,
#accountsPickerModal .ap-table td,
#ccPickerModal .cc-table td {
    padding: 13px 12px !important;
    font-size: 14.5px !important;
}

#itemsPickerModal .ip-table thead th,
#partnersPickerModal .pp-table thead th,
#accountsPickerModal .ap-table thead th,
#ccPickerModal .cc-table thead th {
    padding: 15px 12px !important;
    font-size: 15px !important;
}

/* أزرار النوافذ المنبثقة */
.ip-btn,
.pp-btn,
.ap-btn,
.cc-btn {
    padding: 14px 32px !important;
    font-size: 15px !important;
    min-height: 46px !important;
    font-weight: bold !important;
}

/* حقول البحث في النوافذ */
.ip-search-input,
.pp-search-input,
.ap-search-input,
.cc-search-input {
    padding: 16px 55px 16px 20px !important;
    font-size: 15.5px !important;
    min-height: 50px !important;
}

/* ═══════════════════════════════════════════════════════
   بطاقة عميل/مورد - محدثة
   ═══════════════════════════════════════════════════════ */

.pt-layout {
    display: flex !important;
    gap: 15px !important;
    align-items: flex-start !important;
}

.pt-form-wrap {
    flex: 1 !important;
    background: #ffffff !important;
    border: 2px solid #b0c4de !important;
    border-radius: 6px !important;
    padding: 20px !important;
}

.pt-side {
    width: 170px !important;
    background: #f5f9fd !important;
    border: 2px solid #b0c4de !important;
    border-radius: 6px !important;
    padding: 14px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
}

.pt-side-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 24px 14px !important;
    background: linear-gradient(to bottom, #f8f8f8, #e0e8f0) !important;
    border: 2px solid #999 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    text-align: center !important;
    font-size: 14.5px !important;
    font-weight: bold !important;
    color: #1a3a5c !important;
    line-height: 1.4 !important;
    transition: all 0.15s !important;
}

.pt-side-item:hover {
    background: linear-gradient(to bottom, #d4e4f7, #b0c8e0) !important;
    border-color: #4a7ba7 !important;
    transform: translateY(-2px) !important;
}

.pt-side-item span:first-child {
    font-size: 36px !important;
    margin-bottom: 8px !important;
}

.pt-header-grid {
    display: grid !important;
    grid-template-columns: 1fr 1.4fr 1fr !important;
    gap: 20px !important;
    margin-bottom: 20px !important;
    padding-bottom: 20px !important;
    border-bottom: 2px solid #d0d9e3 !important;
}

.pt-col {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

.pt-row {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    min-height: 44px !important;
}

.pt-row > label:first-child {
    width: 150px !important;
    text-align: right !important;
    font-size: 15px !important;
    font-weight: bold !important;
    color: #1a3a5c !important;
    flex-shrink: 0 !important;
    line-height: 1.4 !important;
}

.pt-input {
    flex: 1 !important;
    padding: 10px 14px !important;
    border: 2px solid #7f9db9 !important;
    background: #fff !important;
    font-family: inherit !important;
    font-size: 15.5px !important;
    height: 44px !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    border-radius: 4px !important;
    line-height: 1.4 !important;
    transition: all 0.15s !important;
}

.pt-input:focus {
    outline: none !important;
    border-color: #2c5aa0 !important;
    box-shadow: 0 0 0 3px #a8c8e8 !important;
    background: #fff8b0 !important;
}

.pt-input[readonly] {
    background: #f8fbff !important;
}

.pt-input.yellow {
    background: #ffffcc !important;
}

textarea.pt-input {
    height: auto !important;
    min-height: 110px !important;
    padding: 12px 14px !important;
    line-height: 1.5 !important;
}

.pt-icon-btn {
    width: 44px !important;
    height: 44px !important;
    border: 2px solid #7f9db9 !important;
    background: linear-gradient(to bottom, #f8f8f8, #e0e0e0) !important;
    cursor: pointer !important;
    border-radius: 4px !important;
    font-size: 20px !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    transition: all 0.15s !important;
}

.pt-icon-btn:hover {
    background: linear-gradient(to bottom, #d4e4f7, #b0c8e0) !important;
    border-color: #4a7ba7 !important;
}

.pt-inner-tabs {
    display: flex !important;
    gap: 6px !important;
    margin-bottom: 20px !important;
    border-bottom: 3px solid #b0c4de !important;
    padding-bottom: 0 !important;
}

.pt-inner-tab {
    padding: 14px 32px !important;
    background: linear-gradient(to bottom, #f8f8f8, #e0e0e0) !important;
    border: 2px solid #999 !important;
    border-bottom: none !important;
    border-radius: 6px 6px 0 0 !important;
    cursor: pointer !important;
    font-family: inherit !important;
    font-size: 15.5px !important;
    font-weight: bold !important;
    color: #333 !important;
    transition: all 0.15s !important;
    min-height: 48px !important;
}

.pt-inner-tab:hover {
    background: linear-gradient(to bottom, #e6f0fa, #d4e4f7) !important;
}

.pt-inner-tab.active {
    background: linear-gradient(to bottom, #ffe4b5, #ffcc80) !important;
    border-color: #c9a800 !important;
    color: #7a5c00 !important;
    font-size: 16px !important;
}

.pt-main-grid {
    display: grid !important;
    grid-template-columns: 1.2fr 1fr 1.2fr !important;
    gap: 20px !important;
    margin-bottom: 20px !important;
    padding-bottom: 20px !important;
    border-bottom: 2px solid #d0d9e3 !important;
}

.pt-main-col {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

.pt-notice-green {
    background: linear-gradient(to bottom, #2e8b57, #1f6b3f) !important;
    color: #ffffff !important;
    padding: 20px 28px !important;
    margin: 20px 0 !important;
    border-radius: 6px !important;
    font-size: 15.5px !important;
    line-height: 1.9 !important;
    text-align: center !important;
    font-weight: bold !important;
    box-shadow: 0 3px 10px rgba(46,139,87,0.3) !important;
}

.pt-tax-grid {
    display: grid !important;
    grid-template-columns: 1.2fr 1fr 1fr !important;
    gap: 20px !important;
}

.pt-tax-col {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

.pt-radio-group {
    display: flex !important;
    gap: 20px !important;
    align-items: center !important;
    font-size: 15px !important;
    flex: 1 !important;
    flex-wrap: wrap !important;
}

.pt-radio-group label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    cursor: pointer !important;
    font-weight: normal !important;
    color: #333 !important;
    font-size: 15px !important;
    padding: 6px 12px !important;
    border-radius: 4px !important;
    transition: background 0.15s !important;
}

.pt-radio-group label:hover {
    background: #e6f0fa !important;
}

.pt-radio-group input[type="checkbox"],
.pt-radio-group input[type="radio"] {
    width: 22px !important;
    height: 22px !important;
    cursor: pointer !important;
    accent-color: #4a7ba7 !important;
}

.pt-toolbar {
    display: flex !important;
    gap: 10px !important;
    padding: 18px 22px !important;
    background: linear-gradient(to bottom, #e8eef5, #d4e0ec) !important;
    border: 2px solid #b0c4de !important;
    border-radius: 6px !important;
    margin-top: 20px !important;
    align-items: center !important;
    flex-wrap: wrap !important;
}

.pt-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 95px !important;
    padding: 12px 18px !important;
    background: linear-gradient(to bottom, #f8f8f8, #e0e0e0) !important;
    border: 2px solid #999 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-family: inherit !important;
    font-size: 14.5px !important;
    font-weight: bold !important;
    color: #333 !important;
    line-height: 1.3 !important;
    transition: all 0.15s !important;
    min-height: 80px !important;
}

.pt-btn:hover {
    background: linear-gradient(to bottom, #d4e4f7, #b0c8e0) !important;
    border-color: #4a7ba7 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 10px rgba(74,123,167,0.25) !important;
}

.pt-btn:active {
    transform: translateY(0) !important;
}

.pt-btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.pt-btn.primary {
    background: linear-gradient(to bottom, #27ae60, #1e8449) !important;
    color: #fff !important;
    border-color: #145a32 !important;
}

.pt-btn.primary:hover:not(:disabled) {
    background: linear-gradient(to bottom, #1e8449, #145a32) !important;
}

.pt-btn.danger {
    background: linear-gradient(to bottom, #e74c3c, #c0392b) !important;
    color: #fff !important;
    border-color: #a93226 !important;
}

.pt-btn-icon {
    font-size: 26px !important;
    margin-bottom: 4px !important;
}

.pt-btn-key {
    font-size: 12px !important;
    color: #666 !important;
    background: #f0f0f0 !important;
    padding: 2px 10px !important;
    border-radius: 3px !important;
    margin-top: 4px !important;
    font-weight: bold !important;
}

.pt-btn.primary .pt-btn-key,
.pt-btn.danger .pt-btn-key {
    background: rgba(255,255,255,0.3) !important;
    color: #fff !important;
}

.pt-btn-sm {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 14px 22px !important;
    background: linear-gradient(to bottom, #f8f8f8, #e0e0e0) !important;
    border: 2px solid #999 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-family: inherit !important;
    font-size: 15px !important;
    font-weight: bold !important;
    color: #333 !important;
    transition: all 0.15s !important;
    min-height: 54px !important;
}

.pt-btn-sm:hover {
    background: linear-gradient(to bottom, #d4e4f7, #b0c8e0) !important;
    border-color: #4a7ba7 !important;
}

/* ═══════════════════════════════════════════════════════════
   Responsive - التوافق مع الشاشات
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 1600px) {
    .pt-main-grid,
    .pt-tax-grid {
        gap: 15px !important;
    }
    .pt-row > label:first-child {
        width: 130px !important;
        font-size: 14.5px !important;
    }
    .pt-input {
        font-size: 15px !important;
        min-height: 42px !important;
    }
}

@media (max-width: 1400px) {
    .pt-header-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    .pt-main-grid,
    .pt-tax-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    .pt-row > label:first-child {
        width: 120px !important;
        font-size: 14px !important;
    }
    .pt-input {
        font-size: 14.5px !important;
        min-height: 40px !important;
        padding: 9px 12px !important;
    }
    .pt-btn {
        min-width: 85px !important;
        min-height: 72px !important;
        font-size: 13.5px !important;
    }
}

/* ═══════════════ تحسين للشاشات الكبيرة جداً ═══════════════ */
@media (min-width: 1920px) {
    body {
        font-size: 16px !important;
    }
    .pt-input {
        font-size: 16.5px !important;
        min-height: 48px !important;
        padding: 12px 16px !important;
    }
    .pt-row > label:first-child {
        font-size: 16px !important;
        width: 165px !important;
    }
    .pt-btn {
        min-width: 110px !important;
        min-height: 90px !important;
        font-size: 15.5px !important;
    }
    .pt-btn-icon {
        font-size: 30px !important;
    }
    .pt-side-item {
        font-size: 16px !important;
        padding: 30px 16px !important;
    }
    .pt-side-item span:first-child {
        font-size: 42px !important;
    }
}/* فرض ظهور شريط التبويبات */
.tabs-bar,
div.tabs-bar {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    position: relative !important;
    z-index: 100 !important;
}

/* في حالة الطباعة فقط أخفيه */
@media print {
    .tabs-bar {
        display: none !important;
    }
}
/* ═══════════════════════════════════════════════════════
   دفتر اليومية - عرض القيود
   ═══════════════════════════════════════════════════════ */

.je-filters {
    display: flex;
    gap: 15px;
    padding: 18px 22px;
    background: #f0f4f8;
    border: 2px solid #b0c4de;
    border-radius: 6px;
    margin-bottom: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.je-filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
}

.je-filter-item label {
    font-size: 14px;
    font-weight: bold;
    color: #1a3a5c;
}

.je-table-wrap {
    background: #fff;
    border: 2px solid #b0c4de;
    border-radius: 6px;
    padding: 15px;
    max-height: calc(100vh - 320px);
    overflow-y: auto;
}

/* ─── بطاقة القيد ─── */
.je-entry {
    margin-bottom: 12px;
    border: 2px solid #b0c4de;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    transition: all 0.15s;
}

.je-entry:hover {
    border-color: #4a7ba7;
    box-shadow: 0 3px 12px rgba(74,123,167,0.15);
}

.je-entry-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(to bottom, #e8eef5, #d4e0ec);
    cursor: pointer;
    font-size: 15px;
    border-bottom: 1px solid #b0c4de;
    transition: background 0.15s;
    flex-wrap: wrap;
}

.je-entry-header:hover {
    background: linear-gradient(to bottom, #d4e4f7, #b8cfe0);
}

.je-toggle {
    font-size: 16px;
    color: #4a7ba7;
    font-weight: bold;
    width: 20px;
    text-align: center;
}

.je-no {
    font-weight: bold;
    color: #1a3a5c;
    font-size: 15.5px;
    min-width: 120px;
}

.je-date {
    color: #4a7ba7;
    font-weight: bold;
    font-size: 14.5px;
}

.je-desc {
    flex: 1;
    color: #333;
    font-size: 14.5px;
}

.je-total {
    font-weight: bold;
    color: #27ae60;
    font-size: 15px;
    background: #e8f5e9;
    padding: 4px 12px;
    border-radius: 15px;
}

.je-badge {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12.5px;
    font-weight: bold;
    color: #fff;
    background: #95a5a6;
}

.je-badge.badge-invoice {
    background: #e67e22;
}

.je-badge.badge-voucher {
    background: #3498db;
}

/* ─── جدول سطور القيد ─── */
.je-entry-body {
    padding: 0;
    background: #fafcfe;
}

.je-lines-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.je-lines-table thead th {
    background: linear-gradient(to bottom, #a8d0e8, #7fb8d8);
    color: #1a3a5c;
    padding: 12px 10px;
    text-align: right;
    font-weight: bold;
    border: 1px solid #6aa0c0;
    font-size: 14px;
}

.je-lines-table tbody tr {
    border-bottom: 1px solid #e0e8f0;
    background: #fff;
}

.je-lines-table tbody tr:nth-child(even) {
    background: #f5f9fd;
}

.je-lines-table tbody tr:hover {
    background: #fff8b0;
}

.je-lines-table td {
    padding: 10px;
    border: 1px solid #e0e8f0;
    font-size: 14px;
}

.je-lines-table .je-debit {
    text-align: center;
    color: #c0392b;
    font-weight: bold;
    background: #fdf2f2;
}

.je-lines-table .je-credit {
    text-align: center;
    color: #27ae60;
    font-weight: bold;
    background: #f2fdf5;
}

.je-lines-table .je-total-row td {
    background: linear-gradient(to bottom, #d4edda, #b8e0c8);
    color: #145a32;
    font-weight: bold;
    font-size: 15px;
    border-top: 2px solid #27ae60;
}
/* ═══════════════ القائمة الرئيسية ═══════════════ */
.main-menu {
    background: #f0f0f0;
    border-bottom: 1px solid #ccc;
    padding: 0 10px;
    display: flex;
    gap: 3px;
    position: relative;
    z-index: 900;
}

.main-menu > .menu-item {
    padding: 8px 15px;
    cursor: pointer;
    position: relative;
    border: 1px solid transparent;
    border-bottom: none;
    font-size: 14px;
    font-weight: bold;
    color: #1a3a5c;
}

.main-menu > .menu-item:hover {
    background: #d0e3f5;
    border-color: #4a7ba7;
    border-radius: 4px 4px 0 0;
}

/* القوائم المنسدلة */
.dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #f9f9f9;
    border: 1px solid #999;
    min-width: 280px;
    box-shadow: 2px 4px 8px rgba(0,0,0,0.25);
    display: none;
    z-index: 9999;
    padding: 3px 0;
}

.menu-item:hover > .dropdown { display: block; }

.dropdown a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    color: #222;
    text-decoration: none;
    font-size: 13.5px;
    border-bottom: 1px solid #eee;
    transition: background 0.15s;
}

.dropdown a:hover { 
    background: #d4e4f7; 
    color: #000; 
}

.dropdown .divider {
    height: 1px;
    background: #d0d0d0;
    margin: 3px 8px;
}

.dropdown .shortcut {
    color: #888;
    font-size: 12px;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 3px;
    margin-right: auto;
    padding-left: 20px;
}

.dropdown a:hover .shortcut {
    background: #fff;
    color: #333;
}
/* ═══════════════════════════════════════════════════════
   بطاقة صنف
   ═══════════════════════════════════════════════════════ */

.it-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    background: #f5f9fd;
    border: 2px solid #b0c4de;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
}

.it-header-left, .it-header-right {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.it-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
}

.it-row > label:first-child {
    width: 110px;
    font-weight: bold;
    font-size: 12.5px;
    color: #1a3a5c;
    text-align: right;
    flex-shrink: 0;
}

.it-row .input-field {
    flex: 1;
    padding: 6px 10px;
    min-height: 30px;
    font-size: 13px;
}

/* ═══════════════ التبويبات الداخلية ═══════════════ */
.it-inner-tabs {
    display: flex;
    gap: 3px;
    margin-bottom: 10px;
    border-bottom: 2px solid #b0c4de;
}

.it-tab {
    padding: 8px 18px;
    background: linear-gradient(to bottom, #f8f8f8, #e0e0e0);
    border: 2px solid #999;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: bold;
    color: #333;
    transition: all 0.15s;
}

.it-tab:hover {
    background: linear-gradient(to bottom, #e6f0fa, #d4e4f7);
}

.it-tab.active {
    background: linear-gradient(to bottom, #ffe4b5, #ffcc80);
    border-color: #c9a800;
    color: #7a5c00;
}

.it-tab-content {
    padding: 12px;
    background: #fafcfe;
    border: 2px solid #b0c4de;
    border-radius: 0 0 6px 6px;
    min-height: 400px;
}

/* ═══════════════ 3 وحدات ═══════════════ */
.it-units-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 15px;
}

.it-unit-box {
    background: #fff;
    border: 2px solid #b0c4de;
    border-radius: 6px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.it-unit-header {
    background: linear-gradient(to bottom, #e8eef5, #d4e0ec);
    padding: 6px 10px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 12.5px;
    color: #1a3a5c;
    margin-bottom: 5px;
}

.it-radio {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: normal;
    font-size: 11.5px;
    cursor: pointer;
}

.it-radio input { cursor: pointer; }

.it-unit-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
}

.it-unit-row > label:first-child {
    width: 75px;
    font-size: 11.5px;
    color: #1a3a5c;
    text-align: right;
    flex-shrink: 0;
}

.it-unit-row .input-field {
    flex: 1;
    padding: 4px 6px;
    min-height: 24px;
    font-size: 12px;
    text-align: center;
}

.it-unit-row select { text-align: right; }

/* ═══════════════ الباركود ═══════════════ */
.it-barcode-list {
    margin-top: 5px;
    border: 1px solid #b0c4de;
    border-radius: 4px;
    overflow: hidden;
}

.it-bar-head {
    background: linear-gradient(to bottom, #e8eef5, #d4e0ec);
    padding: 5px 10px;
    font-weight: bold;
    font-size: 12px;
    color: #1a3a5c;
    text-align: center;
    border-bottom: 1px solid #b0c4de;
}

.it-bar-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-bottom: 1px solid #eef3f8;
    background: #fff;
    cursor: pointer;
    min-height: 22px;
}

.it-bar-row:hover { background: #e6f0fa; }

.it-bar-row.active {
    background: #4a7ba7;
    color: #fff;
    font-weight: bold;
}

.it-bar-num {
    width: 20px;
    text-align: center;
    font-weight: bold;
    font-size: 11.5px;
}

.it-bar-text {
    flex: 1;
    font-family: monospace;
    font-size: 11.5px;
}

/* ═══════════════ الصف السفلي ═══════════════ */
.it-bottom-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.it-box-small {
    background: #fff;
    border: 2px solid #b0c4de;
    border-radius: 6px;
    padding: 8px;
    min-height: 180px;
}

.it-box-header {
    background: linear-gradient(to bottom, #e8eef5, #d4e0ec);
    padding: 5px 8px;
    font-weight: bold;
    font-size: 12px;
    color: #1a3a5c;
    text-align: center;
    border-radius: 3px;
    margin-bottom: 6px;
}

.it-row-tight {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
    min-height: 26px;
}

.it-row-tight > label:first-child {
    width: 90px;
    font-size: 11.5px;
    color: #1a3a5c;
    text-align: right;
    flex-shrink: 0;
}

.it-row-tight .input-field {
    flex: 1;
    padding: 4px 6px;
    min-height: 24px;
    font-size: 12px;
    text-align: center;
}

.it-row-tight .checkbox-line {
    font-size: 11px;
}

/* ═══════════════ تبويب البيانات ═══════════════ */
.it-details-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 15px;
}

.it-details-left {
    background: #fff;
    border: 1px solid #b0c4de;
    border-radius: 6px;
    padding: 10px;
}

.it-details-right {
    background: #fff;
    border: 1px solid #b0c4de;
    border-radius: 6px;
    padding: 10px;
    overflow-x: auto;
}

.it-details-right .items-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 12px;
}

.it-details-right .items-table th {
    background: linear-gradient(to bottom, #4a7ba7, #3a6890);
    color: #fff;
    padding: 8px 6px;
    text-align: center;
    border: 1px solid #2c5a7d;
    font-size: 11.5px;
}

.it-details-right .items-table td {
    padding: 4px;
    border: 1px solid #d0d9e3;
    text-align: center;
    height: 28px;
}

/* ═══════════════ تبويب المعلومات ═══════════════ */
.it-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.it-info-box {
    background: #fff;
    border: 2px solid #b0c4de;
    border-radius: 6px;
    padding: 10px;
    min-height: 240px;
}

.it-info-title {
    background: linear-gradient(to bottom, #e8eef5, #d4e0ec);
    padding: 6px 10px;
    font-weight: bold;
    font-size: 12.5px;
    color: #1a3a5c;
    text-align: center;
    border-radius: 4px;
    margin-bottom: 8px;
}

.it-img-box {
    width: 100%;
    height: 180px;
    background: #f5f5f5;
    border: 2px dashed #b0c4de;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ═══════════════ الخيارات السفلية ═══════════════ */
.it-options-section {
    background: #fff;
    border: 2px solid #b0c4de;
    border-radius: 6px;
    padding: 10px;
}

.it-options-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-bottom: 8px;
}

.it-options-grid .checkbox-line {
    font-size: 11.5px;
}

/* ═══════════════ شريط الأدوات السفلي ═══════════════ */
.it-toolbar {
    display: flex;
    gap: 5px;
    padding: 10px;
    background: linear-gradient(to bottom, #e8eef5, #d4e0ec);
    border: 2px solid #b0c4de;
    border-radius: 6px;
    margin-top: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.it-tb-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 75px;
    padding: 8px 12px;
    background: linear-gradient(to bottom, #f8f8f8, #e0e0e0);
    border: 2px solid #999;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    color: #333;
    line-height: 1.3;
    transition: all 0.15s;
    min-height: 60px;
}

.it-tb-btn:hover {
    background: linear-gradient(to bottom, #d4e4f7, #b0c8e0);
    border-color: #4a7ba7;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(74,123,167,0.25);
}

.it-tb-btn.primary {
    background: linear-gradient(to bottom, #27ae60, #1e8449);
    color: #fff;
    border-color: #145a32;
}

.it-tb-btn.primary:hover {
    background: linear-gradient(to bottom, #1e8449, #145a32);
}

.it-tb-btn.danger {
    background: linear-gradient(to bottom, #e74c3c, #c0392b);
    color: #fff;
    border-color: #a93226;
}

.it-tb-btn.danger:hover {
    background: linear-gradient(to bottom, #c0392b, #922b21);
}

.it-tb-icon {
    font-size: 20px;
    margin-bottom: 2px;
}

.it-tb-key {
    font-size: 10px;
    color: #666;
    background: #f0f0f0;
    padding: 1px 6px;
    border-radius: 3px;
    margin-top: 2px;
}

.it-tb-btn.primary .it-tb-key,
.it-tb-btn.danger .it-tb-key {
    background: rgba(255,255,255,0.3);
    color: #fff;
}

.it-tb-btn-sm {
    padding: 8px 14px;
    background: linear-gradient(to bottom, #f8f8f8, #e0e0e0);
    border: 2px solid #999;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    color: #333;
}

.it-tb-btn-sm:hover {
    background: linear-gradient(to bottom, #d4e4f7, #b0c8e0);
    border-color: #4a7ba7;
}

/* ═══════════════ Responsive ═══════════════ */
@media (max-width: 1400px) {
    .it-units-grid { gap: 8px; }
    .it-bottom-row { grid-template-columns: repeat(3, 1fr); }
    .it-options-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1100px) {
    .it-header { grid-template-columns: 1fr; }
    .it-units-grid { grid-template-columns: 1fr; }
    .it-details-grid { grid-template-columns: 1fr; }
    .it-info-grid { grid-template-columns: 1fr; }
}
/* ═══════════════════════════════════════════════════════
   نافذة بطاقات الدفع المنبثقة
   ═══════════════════════════════════════════════════════ */
#cardsPickerModal .cards-dialog {
    width: 1000px;
    max-width: 95vw;
    height: 650px;
    max-height: 90vh;
    background: #fff;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0,0,0,0.6);
    animation: cardsSlideIn 0.25s ease;
}
@keyframes cardsSlideIn {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

#cardsPickerModal .cards-header {
    background: linear-gradient(135deg, #8e44ad 0%, #6c3483 100%);
    color: #fff;
    padding: 16px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #4a235a;
}
#cardsPickerModal .cards-title { font-weight: bold; font-size: 16px; }
#cardsPickerModal .cards-close {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    transition: all 0.15s;
}
#cardsPickerModal .cards-close:hover { background: #c0392b; border-color: #c0392b; }

#cardsPickerModal .cards-toolbar {
    display: flex;
    gap: 12px;
    padding: 14px 22px;
    background: #f9f4fc;
    border-bottom: 1px solid #e0d0e8;
    align-items: center;
}
#cardsPickerModal .cards-search-box {
    flex: 1;
    position: relative;
}
#cardsPickerModal .cards-search-input {
    width: 100%;
    padding: 12px 48px 12px 18px;
    border: 2px solid #d5b8e0;
    border-radius: 8px;
    font-size: 14.5px;
    font-family: inherit;
    box-sizing: border-box;
}
#cardsPickerModal .cards-search-input:focus {
    outline: none;
    border-color: #8e44ad;
    box-shadow: 0 0 0 4px rgba(142,68,173,0.15);
    background: #fffdf5;
}
#cardsPickerModal .cards-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #8e44ad;
    pointer-events: none;
}
#cardsPickerModal .cards-counter {
    background: #8e44ad;
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 13px;
    white-space: nowrap;
}
#cardsPickerModal .cards-counter span {
    background: #fff;
    color: #8e44ad;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: bold;
}
#cardsPickerModal .cards-new-btn {
    background: linear-gradient(to bottom, #27ae60, #1e8449);
    color: #fff;
    border: none;
    padding: 11px 22px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    transition: all 0.15s;
}
#cardsPickerModal .cards-new-btn:hover {
    background: linear-gradient(to bottom, #1e8449, #145a32);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39,174,96,0.35);
}

#cardsPickerModal .cards-body {
    flex: 1;
    overflow-y: auto;
    background: #fff;
}
#cardsPickerModal .cards-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
#cardsPickerModal .cards-table thead th {
    background: linear-gradient(to bottom, #8e44ad, #6c3483);
    color: #fff;
    padding: 14px 12px;
    text-align: right;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 13px;
}
#cardsPickerModal .cards-table tbody tr {
    border-bottom: 1px solid #f0e8f5;
    cursor: pointer;
    transition: background 0.1s;
}
#cardsPickerModal .cards-table tbody tr:nth-child(even) { background: #fcfafd; }
#cardsPickerModal .cards-table tbody tr:hover { background: #f3e8f8; }
#cardsPickerModal .cards-table tbody tr.selected {
    background: #e6d0f0 !important;
    box-shadow: inset 4px 0 0 #8e44ad;
}
#cardsPickerModal .cards-table td {
    padding: 12px;
    vertical-align: middle;
}
#cardsPickerModal .cards-table td:first-child {
    background: #f5f0f8;
    text-align: center;
    font-weight: bold;
    color: #8e44ad;
}

#cardsPickerModal .cards-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}
#cardsPickerModal .cards-empty-icon { font-size: 80px; opacity: 0.3; margin-bottom: 20px; }
#cardsPickerModal .cards-empty-title {
    font-size: 20px; font-weight: bold; color: #1a3a5c; margin-bottom: 8px;
}
#cardsPickerModal .cards-empty-desc { font-size: 14px; color: #888; margin-bottom: 10px; }
#cardsPickerModal .cards-btn-new {
    background: linear-gradient(to bottom, #27ae60, #1e8449);
    color: #fff;
    border: none;
    padding: 14px 30px;
    font-size: 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-family: inherit;
    transition: all 0.15s;
}
#cardsPickerModal .cards-btn-new:hover {
    background: linear-gradient(to bottom, #1e8449, #145a32);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(39,174,96,0.4);
}

#cardsPickerModal .cards-footer {
    background: #f9f4fc;
    border-top: 2px solid #e0d0e8;
    padding: 14px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#cardsPickerModal .cards-hint { font-size: 12.5px; color: #666; }
#cardsPickerModal .cards-actions { display: flex; gap: 10px; }
#cardsPickerModal .cards-btn {
    padding: 12px 28px;
    border-radius: 8px;
    border: 1px solid #999;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.15s;
}
#cardsPickerModal .cards-btn-cancel {
    background: linear-gradient(to bottom, #f0f0f0, #e0e0e0);
    color: #333;
}
#cardsPickerModal .cards-btn-ok {
    background: linear-gradient(to bottom, #27ae60, #1e8449);
    color: #fff;
    border-color: #145a32;
}
#cardsPickerModal .cards-btn-ok:hover {
    background: linear-gradient(to bottom, #1e8449, #145a32);
    transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════
   صفحة بطاقة ائتمان (payment_cards.php)
   ═══════════════════════════════════════════════════════ */
.pc-layout {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}
.pc-side {
    width: 170px;
    background: #f5f9fd;
    border: 2px solid #b0c4de;
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}
.pc-side-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 22px 10px;
    background: linear-gradient(to bottom, #f8f8f8, #e0e8f0);
    border: 2px solid #999;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    color: #1a3a5c;
    transition: all 0.15s;
}
.pc-side-item:hover {
    background: linear-gradient(to bottom, #d4e4f7, #b0c8e0);
    border-color: #4a7ba7;
    transform: translateY(-2px);
}
.pc-side-item span:first-child {
    font-size: 32px;
    margin-bottom: 6px;
}
.pc-form-wrap {
    flex: 1;
    background: #fff;
    border: 2px solid #b0c4de;
    border-radius: 8px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.pc-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
}
.pc-row > label:first-child {
    width: 190px;
    font-weight: bold;
    font-size: 14.5px;
    color: #1a3a5c;
    text-align: right;
    flex-shrink: 0;
}
.pc-row .input-field {
    flex: 1;
    padding: 10px 14px;
    min-height: 42px;
    font-size: 14.5px;
    border: 2px solid #7f9db9;
    border-radius: 6px;
}
.pc-row .input-field:focus {
    outline: none;
    border-color: #4a7ba7;
    box-shadow: 0 0 0 3px rgba(74,123,167,0.15);
    background: #fff8e0;
}
.pc-row-check {
    display: flex;
    gap: 25px;
    padding: 12px 15px;
    background: #f0f4f8;
    border-radius: 6px;
    border: 1px solid #d0d9e3;
    flex-wrap: wrap;
}
.pc-check-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 14px;
    color: #1a3a5c;
    cursor: pointer;
}
.pc-check-line input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}/* روابط الأقسام المحجوبة بصلاحيات المستخدم */
[hidden]{display:none!important}
/* Search buttons inside invoice and voucher line fields. */
.line-picker { display: flex; align-items: stretch; width: 100%; min-width: 0; }
.line-picker > input { flex: 1 1 auto; min-width: 0; width: 100%; }
.line-picker-button {
    flex: 0 0 28px; width: 28px; padding: 0; border: 1px solid #b7c9d6;
    background: #edf5fa; color: #244d69; cursor: pointer; font-size: 14px;
    line-height: 1; border-radius: 3px;
}
.line-picker-button:hover, .line-picker-button:focus-visible { background: #d5eafb; }
