/* ================================
   Custom Dashboard Clean - Style
   ================================ */

/* ===== Base Layout ===== */
.cdc-wrap {
  display: flex;
  min-height: 100vh;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: #f5f7fa;
}
.cdc-sidebar {
  width: 240px;
  background: #23502a;
  color: #fff;
  padding: 18px 0;
  flex-shrink: 0;
}
.cdc-sidebar-inner ul { list-style: none; margin: 0; padding: 0; }
.cdc-sidebar-inner li {
  padding: 12px 20px;
  cursor: pointer;
  border-left: 4px solid transparent;
  transition: background 0.2s ease;
}
.cdc-sidebar-inner li:hover,
.cdc-sidebar-inner li.cdc-active {
  background: #2f6a36;
  border-left-color: #fff;
}

.cdc-main {
  flex: 1;
  padding: 28px;
  box-sizing: border-box;
}
.cdc-card {
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}
.cdc-btn {
  background: #23502a; color: #fff;
  border: none; padding: 10px 16px;
  border-radius: 8px; cursor: pointer;
}
.cdc-btn:hover { opacity: 0.95; }

/* ===== Carousel ===== */
.cdc-welcome h2 { color: #164a2c; margin: 0 0 6px; }
.cdc-carousel .cdc-slide {
  display: none;
  padding: 20px;
  border-radius: 10px;
  background: #eef9ef;
  text-align: center;
}
.cdc-carousel .cdc-slide.cdc-slide-active { display: block; }
.cdc-dots { text-align: center; margin-top: 12px; }
.cdc-dot {
  display: inline-block;
  width: 10px; height: 10px;
  background: #ccc; border-radius: 50%;
  margin: 0 6px; cursor: pointer;
}
.cdc-dot.cdc-active { background: #2e5f2e; }

/* ===== Dashboard Counters ===== */
.cdc-counters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  padding: 10px;
}

.cdc-counter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-radius: 10px;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease-in-out;
  border: 2px solid transparent;
}

.cdc-counter strong {
  font-size: 17px;
  font-weight: 700;
}

.cdc-counter .cdc-label {
  font-weight: 600;
}

/* Counter Colors */
.cdc-total {
  border-color: #007bff;
  color: #007bff;
  background: #eaf3ff;
}

.cdc-process {
  border-color: #ff9800;
  color: #ff9800;
  background: #fff5e6;
}

.cdc-approved {
  border-color: #4caf50;
  color: #4caf50;
  background: #edf9ef;
}

.cdc-rejected {
  border-color: #f44336;
  color: #f44336;
  background: #ffefef;
}

.cdc-login {
  border-color: #9c27b0;
  color: #9c27b0;
  background: #f8e9fb;
}

.cdc-complete {
  border-color: #009688;
  color: #009688;
  background: #e4f7f5;
}

/* Hover effect */
.cdc-counter:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

/* ===== Responsive: Mobile (only 4 counters) ===== */
@media (max-width: 768px) {
  .cdc-counters-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .cdc-counter.cdc-login,
  .cdc-counter.cdc-complete {
    display: none !important;
  }
  .cdc-counter {
    font-size: 12px;
    padding: 12px 15px;
  }
  .cdc-counter strong {
    font-size: 12px;
  }
}


/* ===== Leads Table ===== */
/* .cdc-table-wrap { overflow: auto; }
#cdc-leads-table { width: 100%; border-collapse: collapse; }
#cdc-leads-table th, #cdc-leads-table td {
  padding: 10px; border: 1px solid #eee;
  font-size: 14px; text-align: left;
}
#cdc-leads-table th { background: #f0f6f0; } */

/* ===== Services Grid ===== */
.cdc-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px; margin-top: 10px;
}
.cdc-service {
  background: #fff;
  border: 1px solid #0f3460;
  border-radius: 8px;
  text-align: center;
  overflow: hidden;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
}
.cdc-service img {
  width: 100%; height: 120px;
  object-fit: contain; padding: 10px;
}
.cdc-service span {
  display: block; background: #0f3460;
  color: #fff; font-weight: 600;
  font-size: 14px; padding: 10px 0;
}
.cdc-service:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  border-color: #1c5b9c;
}

/* ===== Forms ===== */
.cdc-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; color: #203247; }
input[type="text"], input[type="email"], input[type="password"], textarea {
  padding: 10px; border: 1px solid #ccc; border-radius: 8px;
}
textarea { resize: vertical; }

/* ===== Responsive Layout ===== */
@media (max-width:1100px) {
  .cdc-counters-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width:768px) {
  .cdc-carousel { display: none !important; }
  .cdc-services-grid { grid-template-columns: repeat(2, 1fr); }
  .cdc-grid-2 { grid-template-columns: 1fr; }
}

/* ===== Hide specific counters on mobile ===== */
@media (max-width: 768px) {
  .cdc-counter.cdc-login,
  .cdc-counter.cdc-complete {
    display: none !important;
  }
  .cdc-counters-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ===== Mobile Header ===== */
.cdc-mobile-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px; background: #fff; border-bottom: 1px solid #eee;
  position: sticky; top: 0; z-index: 1000;
}
.cdc-mobile-username { font-weight: 600; font-size: 16px; color: #1a1a1a; cursor: pointer; }
.cdc-mobile-wallet {
  display: flex; align-items: center; gap: 6px;
  background: #e9f8ef; border-radius: 20px;
  padding: 6px 12px; font-weight: 600; color: #155724;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.cdc-mobile-wallet .wallet-icon { font-size: 16px; }
.cdc-mobile-wallet .wallet-balance { font-weight: 700; }

/* ===== Mobile Footer & Sidebar ===== */

/* Hide footer on desktop */
@media (min-width: 901px) {
  .cdc-mobile-footer {
    display: none !important;
  }
}

@media (max-width:900px) {
  .cdc-mobile-footer {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 0; left: 0; width: 100%;
    background: #fff;
    border-top: 1px solid #eee;
    padding: 8px 0;
    z-index: 2000;
  }
  .cdc-footer-item {
    flex: 1;
    text-align: center;
    font-size: 12px;
    color: #444;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
  }
  .cdc-footer-item span { font-size: 11px; }
  .cdc-footer-item.active { color: #23502a; font-weight: 600; }
  .cdc-main { padding-bottom: 70px; }

  /* Sidebar slide-in on mobile */
  #cdc-sidebar {
    position: fixed;
    top: 0; bottom: 0;
    left: -260px;
    width: 240px;
    background: #23502a;
    color: #fff;
    z-index: 3001;
    transition: left .3s ease-in-out;
    box-shadow: 4px 0 16px rgba(0, 0, 0, .25);
  }
  #cdc-sidebar.open { left: 0; }

  /* Overlay fix - only visible while sidebar is open */
  body.sidebar-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 3000;
  }
}
/* ===== Leads Table – Mobile Card View (No Horizontal Scroll) ===== */
@media (max-width: 768px) {
  /* Hide the table header */
  #cdc-leads-table thead {
    display: none !important;
  }

  /* Each row acts like a card */
  #cdc-leads-table tbody tr {
    display: block;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 14px;
    padding: 10px 14px;
  }

  /* Each cell becomes a flex row with label + value */
  #cdc-leads-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    padding: 6px 0;
    font-size: 14px;
    border: none;
    border-bottom: 1px solid #f0f0f0;
  }

  #cdc-leads-table tbody td:last-child {
    border-bottom: none;
  }

  /* Add field labels manually using :before */
  #cdc-leads-table tbody td:nth-child(1)::before { content: "Name"; }
  #cdc-leads-table tbody td:nth-child(2)::before { content: "Phone"; }
  #cdc-leads-table tbody td:nth-child(3)::before { content: "PAN"; }
  #cdc-leads-table tbody td:nth-child(4)::before { content: "Email:"; }
  #cdc-leads-table tbody td:nth-child(5)::before { content: "Loan Type"; }
  #cdc-leads-table tbody td:nth-child(6)::before { content: "Status"; }

  #cdc-leads-table tbody td::before {
    font-weight: 600;
    color: #23502a;
    flex: 1;
    text-align: left;
    padding-right: 10px;
  }

  #cdc-leads-table tbody td {
    flex-wrap: wrap;
    gap: 6px;
  }

  #cdc-leads-table tbody td span,
  #cdc-leads-table tbody td {
    flex: 2;
    color: #333;
    text-align: right;
    word-break: break-word;
  }

  /* Table wrapper */
  .cdc-table-wrap {
    overflow-x: hidden !important;
  }

  /* DataTables search + dropdown cleanup */
  .dataTables_filter input[type="search"] {
    width: 50% !important;
    font-size: 10px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
  }

  .dataTables_length select {
    padding: 6px 10px;
    font-size: 14px;
    border-radius: 6px;
  }

  .dataTables_info,
  .dataTables_paginate {
    text-align: center;
    font-size: 12px;
    margin-top: 10px;
  }

  /* Optional: add colored badges for status */
  #cdc-leads-table tbody td:nth-child(6) {
    justify-content: space-between;
  }

  #cdc-leads-table tbody td:nth-child(6)::after {
    content: attr(data-status);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
  }

  #cdc-leads-table tbody td:nth-child(6)[data-status="approved"]::after {
    background: #e8f8ec;
    color: #1b7d2b;
  }
  #cdc-leads-table tbody td:nth-child(6)[data-status="rejected"]::after {
    background: #ffe8e8;
    color: #d93025;
  }
  #cdc-leads-table tbody td:nth-child(6)[data-status="process"]::after {
    background: #fff4e5;
    color: #e09c00;
  }
  #cdc-leads-table tbody td:nth-child(6)[data-status="login"]::after {
    background: #f3e6ff;
    color: #7e3ff2;
  }
  #cdc-leads-table tbody td:nth-child(6)[data-status="complete"]::after {
    background: #e5f6f5;
    color: #0b938d;
  }
}
