:root{
  --vw-bg:#05060a;
  --vw-bg-soft:#0b0d16;
  --vw-card:#101322;
  --vw-card-soft:#151930;
  --vw-purple:#7b3aed;
  --vw-purple-soft:rgba(123,58,237,0.35);
  --vw-text:#e5e7eb;
  --vw-muted:#9ca3af;
  --vw-border:#272a3a;
  --vw-good:#16a34a;
  --vw-bad:#ef4444;

  --vw-radius:20px;
  --vw-gap:22px;

  --vw-font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* مقاس الخلايا */
  --vw-cell-w:130px;
  --vw-cell-h:30px;
}


/* الحاوية الرئيسية */
.alh-vw-wrap{
  font-family:var(--vw-font);
  background:var(--vw-bg);
  color:var(--vw-text);
  padding:24px;
  border-radius:var(--vw-radius);
  border:1px solid var(--vw-purple-soft);
  box-shadow:0 18px 35px rgba(0,0,0,.45);
  display:flex;
  flex-direction:column;
  gap:var(--vw-gap);
}

/* الهيدر */
.alh-vw-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.alh-vw-title{
  font-size:20px;
  font-weight:600;
}

.alh-vw-active-box{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:14px;
  color:var(--vw-muted);
}

.alh-vw-active-name{
  color:var(--vw-purple);
  font-weight:600;
}

.alh-vw-header-buttons{
  display:flex;
  gap:10px;
}

/* الأزرار */
.alh-vw-btn{
  border-radius:999px;
  padding:8px 18px;
  font-size:14px;
  border:1px solid transparent;
  background:var(--vw-card-soft);
  color:var(--vw-text);
  cursor:pointer;
  transition:all .18s ease;
}

.alh-vw-btn.primary{
  background:var(--vw-purple);
  border-color:var(--vw-purple);
}

.alh-vw-btn.secondary{
  background:var(--vw-card-soft);
  border-color:var(--vw-border);
}

.alh-vw-btn.ghost{
  background:transparent;
  border-color:var(--vw-border);
}

.alh-vw-btn.danger{
  background:#451a1a;
  border-color:#b91c1c;
}

.alh-vw-btn.icon{
  width:36px;
  height:36px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  font-size:22px;
  background:var(--vw-card-soft);
  border-color:var(--vw-border);
}

.alh-vw-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 6px 12px rgba(0,0,0,.45);
  opacity:.95;
}

/* بطاقات الملخص */
.alh-vw-cards-row{
  display:flex;
  flex-direction:row;
  gap:var(--vw-gap);
}


.alh-vw-card{
  flex:1;
  background:radial-gradient(circle at top, rgba(123,58,237,.12), transparent 55%) , var(--vw-card);
  border-radius:var(--vw-radius);
  border:1px solid var(--vw-purple-soft);
  padding:18px 20px;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.alh-vw-card.small{
  padding:12px 14px;
}

.alh-vw-card-label{
  font-size:13px;
  color:var(--vw-muted);
}

.alh-vw-card-value{
  font-size:22px;
  font-weight:700;
  text-align:center;
}

/* جدول الصفقات */
.alh-vw-table-wrap{
  background:var(--vw-bg-soft);
  border-radius:var(--vw-radius);
  border:1px solid var(--vw-border);
  padding:18px 18px 16px;
  display:flex;
  flex-direction:column;
  gap:10px;
  overflow-x:auto;
}

/* ===========================================================
   تعديلات الجدول الرئيسي
   =========================================================== */

.alh-vw-table{
  border-collapse: collapse !important;
  border-spacing: 0;
  width: 100%;
  min-width: 1000px;
  table-layout: fixed;
  direction:rtl;
}

.alh-vw-table th,
.alh-vw-table td{
  text-align:center;
  vertical-align:middle;
  padding:4px 4px;
  font-size:13px;
  border: 1px solid rgba(123,58,237,0.25);
  height: 30px;
  overflow: hidden;
}

.alh-vw-table th{
  color:var(--vw-muted);
  font-weight:500;
  background: rgba(123,58,237,0.08);
  height: 32px;
}

/* === توزيع عرض الأعمدة للجدول الرئيسي === */

/* 1. عمود التاريخ */
.alh-vw-table th:nth-child(1),
.alh-vw-table td:nth-child(1){
  width: 115px !important;
  min-width: 115px !important;
}

/* 2. رمز العملة */
.alh-vw-table th:nth-child(2),
.alh-vw-table td:nth-child(2){
  width: 130px !important;
}

/* 6. عمود الاتجاه (السهم) */
.alh-vw-table th:nth-child(6),
.alh-vw-table td:nth-child(6){
  width: 60px !important;
}

/* 9. عمود الاختيار */
.alh-vw-table th:last-child,
.alh-vw-table td:last-child{
  width: 50px !important;
  min-width: 50px !important;
}

/* بقية الأعمدة: تأخذ المساحة المتبقية */
.alh-vw-table th:nth-child(3), .alh-vw-table td:nth-child(3),
.alh-vw-table th:nth-child(4), .alh-vw-table td:nth-child(4),
.alh-vw-table th:nth-child(5), .alh-vw-table td:nth-child(5),
.alh-vw-table th:nth-child(7), .alh-vw-table td:nth-child(7),
.alh-vw-table th:nth-child(8), .alh-vw-table td:nth-child(8) {
  width: auto;
}


/* === بقية التنسيقات === */

/* الصفوف */
.alh-vw-table tbody tr{
  background:transparent;
  box-shadow:none;
  border-bottom: 1px solid rgba(123,58,237,0.25);
}

/* ألوان الصفوف */
.alh-vw-table tbody tr:nth-child(odd) td,
.alh-vw-table tbody tr:nth-child(odd) td * {
  background-color: rgba(10, 12, 20, 0.95) !important;
}
.alh-vw-table tbody tr:nth-child(even) td,
.alh-vw-table tbody tr:nth-child(even) td * {
  background-color: rgba(16, 18, 30, 0.95) !important;
}
.alh-vw-table tbody tr:hover td,
.alh-vw-table tbody tr:hover td * {
  background-color: rgba(26, 28, 42, 0.98) !important;
  transition: background 0.2s ease-in-out;
}


/* المدخلات */
.alh-vw-input,
.alh-vw-select,
.alh-vw-chip{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:100% !important;
  height:30px !important;
  margin:0 auto !important;
  
  border-radius:0 !important;
  background:transparent !important;
  border:none !important;
  box-shadow:none !important;
  color:var(--vw-text) !important;
  text-align:center !important;
}

.alh-vw-input input,
.alh-vw-select select{
  text-align:center !important;
  text-align-last:center !important;
  width:100% !important;
  padding:0 !important;
}

.alh-vw-input:focus{ outline:none; }

/* سهم الاتجاه */
.alh-vw-direction{ font-size:20px; color:var(--vw-text); }
.alh-vw-direction.up{ color:var(--vw-good) !important; }
.alh-vw-direction.down{ color:var(--vw-bad) !important; }

/* الألوان */
.alh-vw-positive{ color:var(--vw-good) !important; }
.alh-vw-negative{ color:var(--vw-bad) !important; }

/* تصحيح ألوان الأرقام */
.alh-vw-table td:has(.alh-vw-input:contains("+")),
.alh-vw-table td:has(.alh-vw-chip:contains("+")){ color: var(--vw-good) !important; }

.alh-vw-table td:has(.alh-vw-input:contains("-")),
.alh-vw-table td:has(.alh-vw-chip:contains("-")){ color: var(--vw-bad) !important; }

/* خانة الاختيار */
.alh-vw-check{
  width:18px;
  height:18px;
  cursor: pointer;
}

/* سطر الأزرار + نتيجة المدة */
.alh-vw-bottom-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:4px;
}

.alh-vw-table-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

.alh-vw-summary-row{
  display:flex;
  align-items:center;
  gap:6px;
}

.alh-vw-summary-label{
  font-size:13px;
  color:var(--vw-muted);
}

.alh-vw-summary-chip{
  min-width:110px;
  height:38px;
  padding:0 14px;
  border-radius:999px;
  background:radial-gradient(circle at top, rgba(123,58,237,.12), transparent 55%), var(--vw-card);
  border:1px solid var(--vw-purple-soft);
  box-shadow:0 0 0 1px rgba(123,58,237,.18);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:13px;
}

/* ترقيم الصفحات */
.alh-vw-pagination{
  display:flex;
  justify-content:center;
  margin-top:6px;
  gap:6px;
}

.alh-vw-page-btn{
  min-width:32px;
  height:32px;
  border-radius:999px;
  border:1px solid var(--vw-border);
  background:var(--vw-card);
  color:var(--vw-text);
  font-size:13px;
  cursor:pointer;
}

.alh-vw-page-btn.active{
  border-color:var(--vw-purple);
  background:var(--vw-purple-soft);
}

/* النوافذ المنبثقة */
.alh-vw-modal{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9999;
}

.alh-vw-modal.open{ display:flex; }

.alh-vw-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.70);
}

.alh-vw-modal-content{
  position:relative;
  background:var(--vw-bg);
  border-radius:var(--vw-radius);
  border:1px solid var(--vw-purple-soft);
  padding:18px 20px 20px;
  max-width:1100px;
  width:94%;
  max-height:90vh;
  overflow:auto;
  box-shadow:0 18px 40px rgba(0,0,0,.75);
}

.alh-vw-modal-content.large{
  max-width:1400px;
  width:96%;
}

.alh-vw-modal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:14px;
}

.alh-vw-modal-header h3{ margin:0; font-size:18px; }

.alh-vw-settings-body{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.alh-vw-settings-footer-top{
  display:flex;
  justify-content:flex-start;
}

.alh-vw-settings-summary{
  margin-top:8px;
  padding:10px 14px;
  border-radius:999px;
  background:#050713;
  font-size:13px;
  color:var(--vw-muted);
}

.alh-vw-modal-footer{
  margin-top:14px;
  display:flex;
  justify-content:flex-end;
}

/* الرسم البياني */
.alh-vw-chart-tabs{
  display:flex;
  gap:8px;
  margin-bottom:12px;
}

.alh-vw-tab{
  border-radius:999px;
  padding:6px 14px;
  border:1px solid var(--vw-border);
  background:var(--vw-card);
  color:var(--vw-text);
  font-size:13px;
  cursor:pointer;
}

.alh-vw-tab.active{
  border-color:var(--vw-purple);
  background:var(--vw-purple-soft);
}

.alh-vw-chart-body{
  background:var(--vw-bg-soft);
  border-radius:var(--vw-radius);
  border:1px solid var(--vw-border);
  padding:12px;
  width:100%;
  height:420px;
  box-sizing:border-box;
}

#alh-vw-chart-canvas{
  width:100% !important;
  height:100% !important;
  display:block;
}

.alh-vw-chart-cards{
  margin-top:14px;
  display:flex;
  flex-direction:row-reverse;
  gap:var(--vw-gap);
}

.alh-vw-login-note{
  background:#111827;
  border-radius:var(--vw-radius);
  border:1px solid var(--vw-purple-soft);
  padding:18px;
  color:var(--vw-text);
  text-align:center;
  font-size:14px;
}

/* شريط فترات التداول */
.alh-vw-period-bar{
  background:var(--vw-bg-soft);
  border-radius:32px;
  padding:10px 18px;
  margin-bottom:16px;
  border:1px solid var(--vw-border);
}

.alh-vw-period-grid{
  display:flex;
  flex-direction:row-reverse;
  align-items:center;
  justify-content:center;
  gap:0.5px;
  flex-wrap:nowrap;
  overflow-x:auto;
  direction:rtl;
}

.alh-vw-period-bar .alh-vw-period-btn,
.alh-vw-period-bar .alh-vw-period-input{
  min-width:130px;
  height:var(--vw-cell-h);
  padding:0 16px;
  border-radius:var(--vw-radius);
  border:1px solid var(--vw-purple-soft);
  background:radial-gradient(circle at top, rgba(123,58,237,.12), transparent 55%), var(--vw-card);
  color:var(--vw-text);
  font-size:13px;
  font-weight:500;
  text-align:center;
  cursor:pointer;
  box-shadow:0 0 0 1px rgba(123,58,237,.18);
  appearance:none;
}

.alh-vw-period-bar .alh-vw-period-input{ cursor:text; }

.alh-vw-period-bar .alh-vw-period-btn:hover,
.alh-vw-period-bar .alh-vw-period-input:hover{
  border-color:var(--vw-purple);
  box-shadow:0 0 0 1px rgba(123,58,237,.45);
}

.alh-vw-period-bar .alh-vw-period-btn.active{
  background:radial-gradient(circle at top, rgba(123,58,237,.25), transparent 55%), var(--vw-card);
  border-color:var(--vw-purple);
  box-shadow:0 0 6px rgba(123,58,237,.3);
}

/* اتجاه الأرقام */
.alh-vw-table td:nth-child(3) .alh-vw-input,
.alh-vw-table td:nth-child(4) .alh-vw-input,
.alh-vw-table td:nth-child(5) .alh-vw-input{
  direction: ltr !important;
}

/* ظهور التاريخ */
.alh-vw-input input[type="date"] {
  display: block !important;
  margin: 0 auto !important;
  text-align: center !important;
  width: 100% !important;
  background: transparent !important;
  border: none !important;
}

/* ===============================================================
   تعديلات خاصة بجدول الإعدادات (توزيع النسب المئوية المتساوي)
   =============================================================== */

.alh-vw-settings-table {
    table-layout: fixed !important;
    width: 100% !important;
    border-collapse: collapse !important;
}

/* 1. عمود "نشطة": 8% */
.alh-vw-settings-table th:nth-child(1),
.alh-vw-settings-table td:nth-child(1) {
    width: 8% !important;
}

/* 2. عمود "اسم المحفظة": 20% */
.alh-vw-settings-table th:nth-child(2),
.alh-vw-settings-table td:nth-child(2) {
    width: 20% !important;
}

/* 3. عمود "مبلغ المحفظة": 15% */
.alh-vw-settings-table th:nth-child(3),
.alh-vw-settings-table td:nth-child(3) {
    width: 15% !important;
}

/* 4. عمود "عملة المحفظة": 12% */
.alh-vw-settings-table th:nth-child(4),
.alh-vw-settings-table td:nth-child(4) {
    width: 12% !important;
}

/* 5. عمود "الرموز": 35% (تم تقليص المساحة) */
.alh-vw-settings-table th:nth-child(5),
.alh-vw-settings-table td:nth-child(5) {
    width: 35% !important;
}

/* 6. عمود "حذف": 10% (لضمان ظهوره داخل الإطار) */
.alh-vw-settings-table th:last-child,
.alh-vw-settings-table td:last-child {
    width: 10% !important;
    visibility: visible !important;
    display: table-cell !important;
}