.erp-sidebar {
    width: 280px;
    background: linear-gradient(180deg, #0b2447, #071a2e);
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
}

/* Header */
.erp-sidebar-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.erp-sidebar-header .title {
    display: flex;
    gap: .6rem;
    align-items: center;
}

.erp-sidebar-header .main {
    font-weight: 600;
}

.erp-sidebar-header .sub {
    font-size: .75rem;
    opacity: .7;
}

/* Body */
.erp-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: .75rem;
}

/* Menu */
.menu-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .55rem .7rem;
    border-radius: 10px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: .95rem;
}

.menu-item:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}

.menu-item.active {
    background: #0ea5e9;
    color: #fff;
}

/* Groups */
.menu-group {
    margin-top: .8rem;
}

.menu-group-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .8rem;
    opacity: .8;
    padding: .4rem .6rem;
    cursor: pointer;
}

.menu-group-items {
    display: none;
    margin-top: .3rem;
}

.menu-group.open .menu-group-items {
    display: block;
}

/* RTL */
[dir="rtl"] .menu-item {
    flex-direction: row-reverse;
}
/* grid reset */
.kpi-grid {
    align-items: stretch;
}

/* Card */
.kpi-card {
    background: #fff;
    border-radius: 18px;
    padding: 1.75rem 2rem;   /* ⬅ مسافة أكبر من جميع الجهات */
    height: 100%;
    display: flex;
    align-items: center;
    gap: 1.4rem;             /* ⬅ مسافة أوضح بين الأيقونة والنص */
    box-shadow: 0 10px 30px rgba(0,0,0,.06);
}


/* Icon */
.kpi-icon {
    width: 56px;             /* ⬅ أكبر قليلًا */
    height: 56px;
    border-radius: 16px;
    font-size: 1.45rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}


/* Body */
.kpi-body {
    flex: 1;
}

.kpi-title {
    font-size: .82rem;
    color: #6b7280;
    margin-bottom: .35rem;   /* ⬅ فراغ أوضح */
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

.kpi-meta {
    font-size: .78rem;
    margin-top: .4rem;       /* ⬅ تنفّس أكثر */
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(0,0,0,.08);
    transition: all .25s ease;
}


/* Soft colors */
.bg-success-soft { background: #e6f7f1; color: #10b981; }
.bg-danger-soft  { background: #fdecec; color: #ef4444; }
.bg-info-soft    { background: #eef2ff; color: #6366f1; }
.bg-primary-soft { background: #e8f0ff; color: #2563eb; }

/* RTL */
[dir="rtl"] .kpi-card {
    flex-direction: row-reverse;
    text-align: right;
}


/* شارتات */
.report-card{
  background:#fff;
  border-radius:16px;
  box-shadow:0 10px 30px rgba(0,0,0,.06);
  padding:1.25rem 1.25rem;
  height:100%;
}

.report-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:.75rem;
}

.report-body{
  padding-top:.25rem;
}

.chart-wrap{
  height:320px;
}

.report-split{
  display:flex;
  gap:1rem;
  align-items:center;
}

.report-legend{
  width:40%;
  display:flex;
  flex-direction:column;
  gap:.5rem;
  padding: .5rem .25rem;
}

.report-legend .item{
  display:flex;
  align-items:center;
  gap:.6rem;
  font-size:.9rem;
  color:#111827;
}

.report-legend .dot{
  width:10px;
  height:10px;
  border-radius:50%;
  flex-shrink:0;
}

.report-legend .pct{
  margin-inline-start:auto;
  font-weight:600;
  color:#111827;
  opacity:.85;
}

/* RTL/LTR */
[dir="rtl"] .report-split{ flex-direction: row-reverse; }
[dir="rtl"] .report-legend .pct{ margin-inline-start:0; margin-inline-end:auto; }

@media (max-width: 992px){
  .report-split{ flex-direction:column; }
  .report-legend{ width:100%; }
}
/* شارتات */


/* الاجراءات السريعة */

.card-ui{
  background:#fff;
  border-radius:16px;
  padding:1.25rem;
  box-shadow:0 10px 30px rgba(0,0,0,.06);
  margin-bottom: 0; 
}

.card-ui-header{
  margin-bottom:1rem;
}

.quick-actions{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:1.2rem;
}

.qa-item{
  text-align:center;
  font-size:.85rem;
  color:#111827;
  text-decoration:none;
}

.qa-icon{
  width:46px;
  height:46px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  margin:0 auto .4rem;
  font-size:1.2rem;
}

/* soft colors */
.bg-blue{background:#e8f0ff;color:#2563eb;}
.bg-red{background:#fdecec;color:#ef4444;}
.bg-green{background:#e6f7f1;color:#10b981;}
.bg-teal{background:#e6fffa;color:#14b8a6;}
.bg-indigo{background:#eef2ff;color:#6366f1;}
.bg-yellow{background:#fff7ed;color:#f59e0b;}

/* الاجراءات السريعة */


/* اخر المعاملات */

.txn-list{
  display:flex;
  flex-direction:column;
  gap:1rem;
}

.txn-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
}

.txn-meta{
  font-size:.75rem;
  color:#6b7280;
}

.txn-amount{
  font-weight:700;
  white-space:nowrap;
}

.txn-icon{
  width:36px;
  height:36px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
}


/* اخر المعاملات */


/* Dashboard Sections */
.dashboard-section {
  margin-bottom: 2.5rem;   /* المسافة الأساسية */
}

.dashboard-section-lg {
  margin-bottom: 3.5rem;   /* للأقسام الكبيرة (Charts) */
}

/* Grid spacing refinement */
.dashboard-grid {
  display: grid;
  gap: 1.75rem;
}


/* ===== Sidebar Fix ===== */

.inv-sidebar {
  width: 260px;
  min-height: 100vh;
  background: #1f2937;
  color: #fff;
  flex-shrink: 0;
}

.inv-sidebar .inv-link {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  text-decoration: none;
  color: #e5e7eb;
  width: 100%;
}

.inv-sidebar .inv-link:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.inv-sidebar .inv-group-body {
  display: flex;
  flex-direction: column;
}

.app-wrapper {
  display: flex;
}

.app-content {
  flex: 1;
  padding: 20px;
  overflow-x: hidden;
}

/* ===============================
   HARPLINK Layout System
=================================*/

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.inv-sidebar {
    width: 260px;
    background: #1f2937;
    color: #fff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.inv-sidebar .inv-group-body {
    display: flex;
    flex-direction: column;
}

.inv-sidebar .inv-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    text-decoration: none;
    color: #e5e7eb;
    width: 100%;
    font-size: 14px;
}

.inv-sidebar .inv-link:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

/* Main Content */
.app-content {
    flex: 1;
    padding: 25px;
    background: #f3f4f6;
    overflow-x: hidden;
}

/* ===============================
   Mobile / Tablet Responsiveness
=================================*/

html {
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

img,
video,
canvas,
svg {
  max-width: 100%;
}

.table-responsive {
  -webkit-overflow-scrolling: touch;
}

.modal-dialog {
  max-width: calc(100vw - 20px);
}

@media (max-width: 1024px) {
  .app-wrapper {
    display: block;
  }

  .app-content {
    width: 100%;
    padding: 16px;
    overflow-x: hidden;
  }

  .hrm-sidebar,
  .inv-sidebar,
  .erp-sidebar {
    width: 100% !important;
    min-height: auto !important;
    position: relative !important;
  }

  .btn,
  .form-control,
  .form-select {
    min-height: 38px;
  }

  .modal-dialog {
    margin: 10px auto;
  }
}

@media (max-width: 640px) {
  .app-content {
    padding: 10px;
  }

  .d-flex.gap-2,
  .btn-toolbar,
  .input-group {
    flex-wrap: wrap;
  }

  .btn {
    white-space: normal;
  }

  table {
    font-size: 13px;
  }

  .modal-body,
  .modal-header,
  .modal-footer {
    padding: 12px;
  }
}
