:root {
  --bg: #f4f7ff;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e6ecff;

  --brand: #2563eb;
  --brand2: #22c55e;
  --brand3: #f97316;
  --brand4: #a855f7;
  --danger: #ef4444;

  --shadow: 0 18px 50px rgba(2, 6, 23, .08);
  --shadow2: 0 10px 30px rgba(2, 6, 23, .06);
  --r: 18px;
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Cairo", system-ui, -apple-system, Segoe UI, Arial
}

.dash-shell {
  width: 100%;
  padding: 18px;
  background:
    linear-gradient(180deg, #f6f9ff, #eef3ff);
}

.dash-shell .dash-wrap {
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow:
    0 30px 80px rgba(2, 6, 23, .08),
    inset 0 1px 0 rgba(255, 255, 255, .6);
}



.dash-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 200px at 10% 0%, rgba(37, 99, 235, .12), transparent 60%),
    radial-gradient(500px 180px at 90% 0%, rgba(34, 197, 94, .10), transparent 60%);
  pointer-events: none;
}

.content .dash-wrap {
  max-width: none;
  margin: 0;
}


.muted {
  color: var(--muted)
}

.dash-wrap {
  padding: 18px 24px;
  max-width: none;
  width: 100%;
}

@media (min-width:1600px) {
  .dash-wrap {
    padding-left: 48px;
    padding-right: 48px;
  }
}



/* Top */
.dash-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.dash-title h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: .2px;
}

.dash-title p {
  margin: 6px 0 0;
  font-size: 13px
}

.dash-filters {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-width: 320px;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .9);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  transition: .18s ease;
  box-shadow: 0 8px 18px rgba(2, 6, 23, .05);
}

.chip:hover {
  transform: translateY(-1px)
}

.chip.active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #60a5fa);
}

.custom-range {
  width: 100%;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: flex-end;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .85);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow2);
}

.custom-range label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.custom-range input {
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0 10px;
  background: #fff;
  outline: none;
}

.btn {
  height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #60a5fa);
  box-shadow: 0 10px 25px rgba(37, 99, 235, .25);
  transition: .18s ease;
}

.btn:hover {
  transform: translateY(-1px)
}

.btn.ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn.ghost:hover {
  background: #f8fbff
}

/* Warehouses */
.wh-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 16px;
}

.wh-tab {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 900;
  font-size: 12px;
  box-shadow: 0 10px 25px rgba(2, 6, 23, .05);
}

.wh-tab.active {
  color: #0b1220;
  border-color: rgba(37, 99, 235, .25);
  background: linear-gradient(135deg, rgba(37, 99, 235, .12), rgba(96, 165, 250, .10));
}

.wh-scroll {
  display: flex;
  gap: 10px;
  overflow: auto;
  padding-bottom: 6px;
  flex: 1;
}

.wh-scroll::-webkit-scrollbar {
  height: 8px
}

.wh-scroll::-webkit-scrollbar-thumb {
  background: #dbe7ff;
  border-radius: 999px
}

/* Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.kpi {
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow2);
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.kpi:before {
  content: "";
  position: absolute;
  inset: -40px -40px auto auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  filter: blur(0px);
  opacity: .18;
}

.kpi-sales:before {
  background: radial-gradient(circle at 30% 30%, #60a5fa, transparent 70%)
}

.kpi-returns:before {
  background: radial-gradient(circle at 30% 30%, #fb7185, transparent 70%)
}

.kpi-collected:before {
  background: radial-gradient(circle at 30% 30%, #34d399, transparent 70%)
}

.kpi-profit:before {
  background: radial-gradient(circle at 30% 30%, #c084fc, transparent 70%)
}

.kpi-expenses:before {
  background: radial-gradient(circle at 30% 30%, #f59e0b, transparent 70%)
}

.kpi-inv:before {
  background: radial-gradient(circle at 30% 30%, #38bdf8, transparent 70%)
}

.kpi-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.kpi-ic {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, .04);
  font-size: 20px;
}

.kpi-title {
  font-weight: 1000;
  font-size: 13px
}

.kpi-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px
}

.kpi-val {
  font-size: 22px;
  font-weight: 1000;
  letter-spacing: .2px;
  margin-top: 2px;
}

.kpi-val.small {
  font-size: 18px
}

.kpi-foot {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
}

.kpi-foot.two {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(2, 6, 23, .04);
}

.pill.subtle {
  background: rgba(37, 99, 235, .08);
  color: #0b3aa8;
}

/* Charts */
.charts-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.chart-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chart-head {
  padding: 14px 14px 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.chart-title {
  font-weight: 1000
}

.chart-sub {
  font-size: 12px;
  margin-top: 4px
}

.chart-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding-top: 2px;
}

.leg {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 900;
  color: var(--muted);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #000;
}

.mini-note {
  font-weight: 1000;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

.chart-body {
  padding: 8px 12px 14px
}

.chart-body.donut {
  padding: 6px 12px 18px
}

/* Table */
.table-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-head {
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.table-wrap {
  overflow: auto
}

.dash-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 980px;
}

.dash-table thead th {
  position: sticky;
  top: 0;
  background: #f7faff;
  border-bottom: 1px solid var(--line);
  padding: 10px;
  font-size: 12px;
  text-align: right;
  color: #0f172a;
}

.dash-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(226, 232, 240, .8);
  font-size: 12px;
  color: #0f172a;
  white-space: nowrap;
}

.dash-table tr:hover td {
  background: #fbfdff
}

.td-muted {
  color: var(--muted);
  text-align: center
}

/* Loading */
.dash-loading {
  position: absolute;
  inset: 0;
  background: rgba(244, 247, 255, .7);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9;
}

.loader-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 12px;
  align-items: center;
}

.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid #dbe7ff;
  border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

.ld-title {
  font-weight: 1000
}

.ld-sub {
  font-size: 12px
}

/* Responsive */
@media (max-width: 1100px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .dash-filters {
    min-width: auto
  }
}

@media (max-width: 640px) {
  .dash-wrap {
    padding: 12px
  }

  .dash-top {
    flex-direction: column;
    align-items: stretch
  }

  .dash-filters {
    align-items: flex-start
  }

  .chips {
    justify-content: flex-start
  }

  .custom-range {
    justify-content: flex-start;
    flex-wrap: wrap
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .wh-tabs {
    flex-direction: column;
    align-items: stretch
  }

  .wh-scroll {
    width: 100%
  }
}

/* ===== Net Profit Card ===== */
.dash-card.net-profit {
  background: linear-gradient(135deg, #eafff2, #f5fffb);
  border: 1px solid #d7f5e6;
}

.dash-card.net-profit .icon {
  background: #e0fff0;
  color: #16a34a;
}

.dash-card.net-profit.positive .dash-card-value {
  color: #16a34a;
}

.dash-card.net-profit.negative .dash-card-value {
  color: #dc2626;
}

.dash-card.net-profit.zero .dash-card-value {
  color: #64748b;
}

/* ================= Date Time Widget ================= */
.dash-datetime {
  text-align: left;
  min-width: 180px;
  padding: 12px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0f2a5f74, #003ca4);
  color: #fff;
  box-shadow: 0 8px 25px rgba(0, 0, 0, .15);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  font-family: 'Cairo', sans-serif;
}

.dt-date {
  font-size: 13px;
  opacity: .8;
  letter-spacing: .5px;
}

.dt-time {
  font-size: 22px;
  font-weight: 700;
  margin-top: 4px;
}