/* خطة التداول — واجهة داكنة مع بنفسجي */

:root{
  --kt-bg: #050610;
  --kt-card-bg:#111321;
  --kt-card-soft:#171a2a;
  --kt-purple:#7b3aed;
  --kt-purple-soft:rgba(123,58,237,0.35);
  --kt-border:#26293a;
  --kt-text:#e7e9f4;
  --kt-muted:#9ca3b5;
  --kt-good:#16a34a;
  --kt-bad:#ef4444;
  --kt-surplus:#facc15;
  --kt-radius:16px;
  --kt-gap:18px;
  --kt-font: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

/* الحاوية العامة */
.kt-wrap{
  direction: rtl;
  font-family: var(--kt-font);
  background: radial-gradient(circle at top, #15172a 0, #050610 55%);
  color: var(--kt-text);
  padding: 24px;
  border-radius: var(--kt-radius);
  border: 1px solid var(--kt-border);
  box-shadow: 0 24px 60px rgba(0,0,0,0.65);
  max-width: 100%;
  overflow-x: auto;
}

/* للزائر */
.kt-wrap-guest{
  text-align:center;
  background:#111321;
}

/* الهيدر */
.kt-header{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:18px;
}
.kt-title{
  font-size:20px;
  font-weight:700;
  color:#fff;
}
.kt-header-buttons{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

/* الأزرار */
.kt-btn{
  border-radius:999px;
  padding:8px 18px;
  font-size:13px;
  border:1px solid transparent;
  cursor:pointer;
  transition:.18s ease-in-out;
  white-space:nowrap;
}
.kt-btn-primary{
  background:linear-gradient(135deg,var(--kt-purple),#b375ff);
  color:#fff;
  border-color:var(--kt-purple-soft);
}
.kt-btn-primary:hover{ filter:brightness(1.07); }
.kt-btn-secondary{
  background:var(--kt-card-soft);
  color:var(--kt-text);
  border-color:var(--kt-border);
}
.kt-btn-secondary:hover{ border-color:var(--kt-purple); }
.kt-btn-outline{
  background:transparent;
  color:var(--kt-purple);
  border-color:var(--kt-purple-soft);
}
.kt-btn-outline:hover{ background:var(--kt-purple-soft); }

/* البطاقات العلوية */
.kt-summary{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:var(--kt-gap);
  margin-bottom:18px;
}
.kt-card{
  background:var(--kt-card-bg);
  border-radius:var(--kt-radius);
  padding:10px 10px;
  border:1px solid var(--kt-border);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
}
.kt-card-label{
  font-size:11px;
  color:var(--kt-muted);
  white-space:nowrap;
}
.kt-card-value{
  font-size:16px;
  font-weight:600;
  text-align:center;
}

/* الحالات اللونية العامة */
.kt-pos{ color:var(--kt-good); }
.kt-neg{ color:var(--kt-bad); }
.kt-surplus-color{ color:var(--kt-surplus); }
.kt-neutral{ color:#e5e7eb; }

/* الجدول الرئيسي */
.kt-table-wrap{
  background:var(--kt-card-bg);
  border-radius:var(--kt-radius);
  border:1px solid var(--kt-border);
  padding:10px;
  overflow-x:auto;
  margin-bottom:18px;
}

.kt-table-stats{
  margin-top:12px;
  font-size:12px;
  color:var(--kt-muted);
  text-align:right;
}

.kt-stat-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:8px;
}

.kt-stat-row-last{
  margin-bottom:0;
}

.kt-stat-card{
  flex:1 1 0;
  min-width:180px;
  background:var(--kt-card);
  border-radius:12px;
  border:1px solid var(--kt-border);
  padding:8px 10px;
}

.kt-stat-label{
  font-size:11px;
  color:var(--kt-muted);
  margin-bottom:3px;
}

.kt-stat-value{
  font-size:14px;
  font-weight:600;
  color:var(--kt-text);
  display:flex;
  align-items:baseline;
  gap:4px;
}

.kt-stat-sub{
  font-size:11px;
  color:var(--kt-muted);
  margin-top:2px;
}

.kt-stat-unit{
  font-size:11px;
  color:var(--kt-muted);
}

.kt-stat-win{
  color:var(--kt-good);
}

.kt-stat-loss{
  color:var(--kt-bad);
}

.kt-stat-neutral{
  color:var(--kt-text);
}

.kt-stat-sep{
  color:var(--kt-muted);
}

.kt-table{
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;
  font-size:13px;
}
.kt-table th,
.kt-table td{
  padding:8px 6px;
  text-align:center;
  border-bottom:1px solid rgba(38,41,58,0.9);
  vertical-align:middle;
}
.kt-table thead th{
  background:linear-gradient(180deg,#1f2235,#151729);
  color:#f3f4ff;
  font-weight:600;
  position:sticky;
  top:0;
  z-index:1;
}
.kt-table tbody tr:nth-child(odd){
  background:rgba(17,19,33,0.85);
}
.kt-table tbody tr:nth-child(even){
  background:rgba(8,10,22,0.9);
}
.kt-table tbody tr:hover{
  background:rgba(123,58,237,0.14);
}

/* مدخلات الجدول */
.kt-input{
  width:100%;
  box-sizing:border-box;
  background:rgba(6,7,18,0.8);
  border-radius:8px;
  border:1px solid #2a2d3f;
  padding:4px 6px;
  color:var(--kt-text);
  font-size:12px;
  text-align:center;
}
.kt-input:focus{
  outline:none;
  border-color:var(--kt-purple);
  box-shadow:0 0 0 1px rgba(123,58,237,0.65);
}

/* خانات القراءة فقط */
.kt-cell-readonly{
  font-weight:500;
}

/* زر حذف */
.kt-delete-btn{
  background:transparent;
  border:none;
  color:#f87171;
  cursor:pointer;
  font-size:16px;
  line-height:1;
}
.kt-delete-btn:hover{ color:#fecaca; }

/* سجل السحب الشهري */
.kt-withdraw-wrap{
  background:var(--kt-card-bg);
  border-radius:var(--kt-radius);
  border:1px solid var(--kt-border);
  padding:10px;
}
.kt-withdraw-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}
.kt-withdraw-title{
  font-size:14px;
  font-weight:600;
}
.kt-withdraw-stats{
  font-size:12px;
  color:var(--kt-muted);
  margin:4px 0 10px;
}
.kt-withdraw-stats span{
  font-weight:600;
  color:#fff;
}

/* النوافذ المنبثقة */
.kt-modal{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,0.70);
  z-index:9999;
}
.kt-modal[aria-hidden="false"]{ display:flex; }

.kt-modal-dialog{
  background:#050612;
  border-radius:var(--kt-radius);
  border:1px solid var(--kt-border);
  min-width:320px;
  max-width:640px;
  width:100%;
  max-height:90vh;
  display:flex;
  flex-direction:column;
  box-shadow:0 24px 80px rgba(0,0,0,0.85);
}
.kt-modal-lg{ max-width:980px; }

.kt-modal-header{
  padding:12px 16px;
  border-bottom:1px solid var(--kt-border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.kt-modal-title{
  font-size:16px;
  font-weight:600;
}
.kt-modal-close{
  background:transparent;
  border:none;
  color:var(--kt-muted);
  font-size:20px;
  cursor:pointer;
}
.kt-modal-close:hover{ color:#fff; }

.kt-modal-body{
  padding:14px 16px;
  overflow:auto;
}
.kt-modal-footer{
  padding:10px 16px 12px;
  border-top:1px solid var(--kt-border);
  display:flex;
  justify-content:flex-start;
  gap:10px;
}

/* نموذج الإعدادات */
.kt-form-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px 14px;
}
.kt-field{
  display:flex;
  flex-direction:column;
  gap:4px;
  font-size:12px;
}
.kt-field span{
  color:var(--kt-muted);
}
.kt-field input,
.kt-field select{
  border-radius:10px;
  border:1px solid #2a2d3f;
  background:#050610;
  color:var(--kt-text);
  padding:6px 8px;
  font-size:12px;
}
.kt-field input:focus,
.kt-field select:focus{
  outline:none;
  border-color:var(--kt-purple);
  box-shadow:0 0 0 1px rgba(123,58,237,0.55);
}

.kt-note{
  font-size:11px;
  color:var(--kt-muted);
  margin-top:10px;
}

/* الرسم البياني */
.kt-chart-body{
  direction:ltr;
}
#kt-chart-canvas{
  width:100%!important;
  height:360px!important;
}

.kt-chart-summary{
  margin-top:16px;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:var(--kt-gap);
}
.kt-chart-card{
  background:var(--kt-card-bg);
  border-radius:var(--kt-radius);
  border:1px solid var(--kt-border);
  padding:10px 12px;
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap:4px;
}
  background:var(--kt-card-bg);
  border-radius:var(--kt-radius);
  border:1px solid var(--kt-border);
  padding:10px 12px;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.kt-chart-label{
  font-size:12px;
  color:var(--kt-muted);
  text-align:center;
}
  font-size:12px;
  color:var(--kt-muted);
}
.kt-chart-value{
  font-size:16px;
  font-weight:600;
  text-align:center;
}
  font-size:16px;
  font-weight:600;
}

/* الصفحات (pagination) */
.kt-pagination{
  margin-top:10px;
  display:flex;
  justify-content:center;
  gap:6px;
}
.kt-page-btn{
  min-width:26px;
  height:26px;
  border-radius:999px;
  border:1px solid var(--kt-border);
  background:var(--kt-card-soft);
  color:var(--kt-text);
  font-size:12px;
  cursor:pointer;
  padding:0 8px;
}
.kt-page-btn.active{
  background:var(--kt-purple);
  border-color:var(--kt-purple-soft);
  color:#fff;
}

/* إستجابة للجوال */
@media (max-width:900px){
  .kt-summary{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .kt-chart-summary{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media (max-width:600px){
  .kt-header{
    flex-direction:column;
    align-items:flex-start;
  }
  .kt-summary{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .kt-form-grid{
    grid-template-columns:1fr;
  }
  .kt-chart-summary{
    grid-template-columns:1fr;
  }
}