/* ========================= */
/* DASHBOARD TOP */
/* ========================= */

/* ========================= */
/* STICKY NAVBAR (DASHBOARD ONLY)
/* ========================= */

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;

  background: linear-gradient(135deg, #1f2d3d, #2f4f6f);

  box-shadow: 0 4px 12px rgba(0,0,0,0.15);

  /* overflow: hidden;  ✅ ADD THIS */
}

.dashboard-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}
.dashboard-top {
  margin-top: 0px;   /* 🔥 space below navbar */
}

/* LEFT */
.fy-left {
  display: flex;
  align-items: center;
  gap: 12px;

  background: rgb(202, 155, 155);
  padding: 10px 14px;

  border-radius: 12px;

  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.fy-label {
  font-size: 14px;
  font-weight: 600;
  color: #2c3e50;

  display: flex;
  align-items: center;
  gap: 8px;

  white-space: nowrap;
}

.fy-label i {
  width: 28px;
  height: 28px;

  border-radius: 50%;

  background: linear-gradient(135deg, #e74c3c, #c0392b);

  color: white;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 13px;

  box-shadow: 0 3px 8px rgba(231, 76, 60, 0.3);
}

.fy-left select {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #dcdcdc;

  font-size: 14px;
  background: white;

  min-width: 180px;
}

.fy-left select:hover {
  border-color: #3498db;
}

/* FY BADGE */
.fy-badge {
  background: linear-gradient(135deg, #2c3e50, #34495e);

  color: white;
  padding: 12px 22px;

  border-radius: 30px;

  font-size: 14px;
  font-weight: 600;

  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ========================= */
/* CARDS */
/* ========================= */

.dashboard-cards {
  display: flex;
  gap: 20px;
}

/* CARD */
.dash-card {
  flex: 1;

  display: flex;
  align-items: center;
  gap: 18px;

  padding: 24px;
  border-radius: 16px;

  color: rgb(22, 2, 2);

  box-shadow: 0 6px 16px rgba(0,0,0,0.15);

  transition: 0.2s;
}

.dash-card:hover {
  transform: translateY(-2px);
}

/* ICON */
.card-icon {
  width: 60px;
  height: 60px;

  border-radius: 14px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(255,255,255,0.15);
}

.card-icon i {
  font-size: 24px;
}

/* TEXT */
.card-info h2 {
  margin: 0;
  font-size: 32px;
}

.card-info p {
  margin: 6px 0 0;
  font-size: 14px;

  opacity: 0.9;
}

/* COLORS */
.deals-card {
  background: linear-gradient(135deg, #3498db, #2980b9);
}

.brokerage-card {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
}

/* ========================= */
/* STICKY HEADER */
/* ========================= */

.sticky-dashboard {
  position: sticky;
  top: 70px;
  z-index: 20;

  background: linear-gradient(135deg, #566b8a, #f7fbff);

  padding: 10px 0;
}

/* ========================= */
/* RIGHT SECTION */
/* ========================= */

.dashboard-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* LIVE TIME */
.live-time {
  background: rgb(226, 139, 139);

  padding: 10px 16px;
  border-radius: 12px;

  font-size: 14px;
  font-weight: 600;

  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

/* GLOW DOT */
.glow-dot {
  width: 10px;
  height: 10px;

  border-radius: 50%;

  background: #2ecc71;

  box-shadow:
    0 0 5px #2ecc71,
    0 0 10px #2ecc71,
    0 0 15px #2ecc71;
}

/* FY BADGE */
.fy-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ========================= */
/* QUICK BUTTONS */
/* ========================= */

.quick-actions {
  display: flex;
  gap: 12px;
}

.quick-btn {
  background: linear-gradient(135deg, #3498db, #2980b9);

  color: white;
  text-decoration: none;

  padding: 10px 18px;

  border-radius: 30px;

  display: flex;
  align-items: center;
  gap: 8px;

  font-size: 14px;
  font-weight: 600;

  transition: 0.2s;

  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.quick-btn:hover {
  transform: translateY(-2px);
}

/* ========================= */
/* PERFORMANCE */
/* ========================= */

.performance-card {
  margin-top: 25px;

  background: white;

  padding: 20px;

  border-radius: 16px;

  display: flex;
  justify-content: space-between;
  align-items: center;

  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.performance-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.performance-left i {
  width: 50px;
  height: 50px;

  border-radius: 50%;

  background: #2ecc71;
  color: white;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 20px;
}

.performance-right {
  color: #2ecc71;
  font-size: 28px;
  font-weight: bold;
}

/* ========================= */
/* CHARTS */
/* ========================= */

.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;

  margin-top: 25px;
}

.chart-card {
  background: white;

  padding: 20px;

  border-radius: 16px;

  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* ========================= */
/* TODAY TABLE */
/* ========================= */

.today-card {
  margin-top: 25px;

  background: white;

  border-radius: 16px;

  padding: 20px;

  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.today-header {
  margin-bottom: 15px;
}

#todayDealsTable {
  width: 100%;
  border-collapse: collapse;
}

#todayDealsTable th {
  background: #2c3e50;
  color: white;

  padding: 10px;
}

#todayDealsTable td {
  padding: 10px;
  border: 1px solid #ddd;
}

/* ========================= */
/* DASHBOARD DEAL MODAL */
/* ========================= */

.dashboard-modal {
  display: none;
  position: fixed;
  z-index: 9999;

  inset: 0;

  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(5px);

  justify-content: center;
  align-items: center;
}

.dashboard-modal.show {
  display: flex;
}

/* BOX */
.dashboard-modal-box {
  background: white;

  width: 600px;
  border-radius: 10px;

  overflow: hidden;

  box-shadow: 0 10px 35px rgba(0,0,0,0.25);

  animation: dashboardFade 0.25s ease;
}

/* HEADER */
.dashboard-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 16px 20px;

  border-bottom: 1px solid #eee;
}

.dashboard-modal-header h3 {
  margin: 0;

  display: flex;
  align-items: center;
  gap: 8px;

  font-size: 22px;
}

/* CLOSE */
.dashboard-close-btn {
  font-size: 24px;
  cursor: pointer;
  font-weight: bold;
}

/* BODY */
.dashboard-modal-body {
  padding: 20px;
}

/* GRID */
.dashboard-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

/* INPUT GROUP */
.dashboard-input-group {
  display: flex;
  align-items: center;

  border: 1px solid #dcdcdc;
  border-radius: 8px;

  background: #fafafa;

  padding: 10px 12px;
}

.dashboard-input-group i {
  color: #666;
  margin-right: 10px;
}

.dashboard-input-group input {
  border: none;
  outline: none;

  width: 100%;

  background: transparent;
  font-size: 14px;
}

/* FOOTER */
.dashboard-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;

  padding: 16px 20px;

  border-top: 1px solid #eee;
}

/* BUTTONS */
.dashboard-btn {
  border: none;
  border-radius: 8px;

  padding: 10px 18px;

  font-size: 14px;
  font-weight: 600;

  cursor: pointer;
}

.dashboard-btn.cancel {
  background: #34495e;
  color: white;
}

.dashboard-btn.save {
  background: #4CAF50;
  color: white;
}

@keyframes dashboardFade {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ==========================================================================
   MOBILE & RESPONSIVE DASHBOARD OVERRIDES (<= 768px)
   ========================================================================== */

@media (max-width: 992px) {
  .chart-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 768px) {
  /* Disable sticky headers on mobile dashboard to maximize screen height */
  .sticky-dashboard {
    position: relative;
    top: auto;
    background: transparent;
    padding: 0;
    margin-bottom: 16px;
    box-shadow: none;
    z-index: 1;
  }

  .dashboard-top {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .fy-left {
    width: 100%;
    justify-content: space-between;
    padding: 8px 12px;
  }

  .fy-left select {
    min-width: 130px;
    flex-grow: 1;
    max-width: 200px;
  }

  .dashboard-right {
    width: 100%;
    justify-content: space-between;
  }

  .live-time {
    flex-grow: 1;
    text-align: center;
    padding: 8px 12px;
  }

  .fy-badge {
    padding: 8px 16px;
  }

  /* Stack Dashboard Metric Cards */
  .dashboard-cards {
    flex-direction: column;
    gap: 14px;
  }

  .dash-card {
    padding: 16px 20px;
    gap: 14px;
  }

  .card-icon {
    width: 50px;
    height: 50px;
  }

  .card-icon i {
    font-size: 20px;
  }

  .card-info h2 {
    font-size: 26px;
  }

  /* Performance Panel */
  .performance-card {
    margin-top: 16px;
    padding: 14px;
  }

  .performance-left i {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .performance-left h3 {
    font-size: 14px;
  }

  .performance-left p {
    font-size: 11px;
  }

  .performance-right {
    font-size: 22px;
  }

  /* Table responsiveness */
  .today-card {
    margin-top: 16px;
    padding: 14px;
  }

  .today-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid #eee;
  }

  #todayDealsTable {
    font-size: 12px;
    min-width: 600px; /* Force minimum table width to trigger scrollbar */
  }

  /* Dashboard modal scaling */
  .dashboard-modal-box {
    width: 92%;
    margin: 15px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
  }

  .dashboard-modal-body {
    overflow-y: auto;
    max-height: calc(90vh - 120px);
  }

  .dashboard-form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
