/* ============================================================
   DASHBOARD — Professional Modern UI
   Primary: #123B6E | Accent: #49BEFF | Font: Plus Jakarta Sans
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --db-primary:       #123B6E;
  --db-primary-light: #ECF2FF;
  --db-accent:        #49BEFF;
  --db-success:       #13DEB9;
  --db-success-light: #E6FFFA;
  --db-warning:       #FFAE1F;
  --db-warning-light: #FEF5E5;
  --db-danger:        #FA896B;
  --db-danger-light:  #FBF2EF;
  --db-info:          #539BFF;
  --db-info-light:    #EBF3FE;
  --db-purple:        #7C5CFC;
  --db-purple-light:  #F0EBFF;
  --db-text-dark:     #2A3547;
  --db-text-muted:    #5A6A85;
  --db-border:        #ebf1f6;
  --db-bg:            #F6F9FC;
  --db-card-shadow:   0 0 2px rgba(145,158,171,.2), 0 12px 24px -4px rgba(145,158,171,.12);
  --db-radius:        12px;
  --db-radius-sm:     8px;
  --db-transition:    0.22s ease;
}

/* ── Filter Bar ─────────────────────────────────────────────── */
.db-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  background: #fff;
  border-radius: var(--db-radius);
  box-shadow: var(--db-card-shadow);
  padding: 12px 18px;
  flex-wrap: wrap;
  border: 1.5px solid var(--db-border);
}
.db-filter-bar .react-datepicker-wrapper { width: auto; }
.db-filter-bar .react-datepicker-wrapper input { width: 132px; }

.db-filter-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--db-text-muted);
  text-transform: uppercase;
  letter-spacing: .7px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  padding-right: 6px;
}

.db-filter-pills {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  flex: 1;
}

.db-filter-pill {
  background: var(--db-bg);
  border: 1.5px solid transparent;
  border-radius: 20px;
  color: var(--db-text-muted);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 14px;
  transition: all var(--db-transition);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
}
.db-filter-pill i { font-size: 13px; }
.db-filter-pill:hover {
  border-color: var(--db-primary);
  color: var(--db-primary);
  background: var(--db-primary-light);
}
.db-filter-pill.active {
  background: var(--db-primary);
  border-color: var(--db-primary);
  color: #fff;
  box-shadow: 0 3px 10px rgba(18,59,110,.28);
}
.db-filter-pill.active i { opacity: .9; }

.db-filter-divider {
  width: 1px;
  height: 30px;
  background: var(--db-border);
  flex-shrink: 0;
}

.db-filter-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.db-filter-custom .db-date-input {
  background: var(--db-bg);
  border: 1.5px solid var(--db-border);
  border-radius: 20px;
  color: var(--db-text-dark);
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 14px;
  width: 132px;
  outline: none;
  transition: border-color var(--db-transition), box-shadow var(--db-transition);
}
.db-filter-custom .db-date-input:focus {
  border-color: var(--db-accent);
  box-shadow: 0 0 0 3px rgba(73,190,255,.15);
}

.db-filter-select:focus {
  outline: none;
  border-color: var(--db-accent);
  box-shadow: 0 0 0 3px rgba(73,190,255,.15);
}

.db-date-input {
  border: 1.5px solid var(--db-border);
  border-radius: var(--db-radius-sm);
  color: var(--db-text-dark);
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 14px;
  width: 140px;
  transition: border-color var(--db-transition), box-shadow var(--db-transition);
}
.db-date-input:focus {
  outline: none;
  border-color: var(--db-accent);
  box-shadow: 0 0 0 3px rgba(73,190,255,.15);
}

.db-btn-apply {
  background: var(--db-primary);
  border: none;
  border-radius: var(--db-radius-sm);
  color: #fff;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--db-transition), transform var(--db-transition);
}
.db-btn-apply:hover  { background: #0d2d56; transform: translateY(-1px); }
.db-btn-apply:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.db-btn-reset {
  background: transparent;
  border: 1.5px solid var(--db-border);
  border-radius: var(--db-radius-sm);
  color: var(--db-text-muted);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 16px;
  transition: border-color var(--db-transition), color var(--db-transition);
}
.db-btn-reset:hover { border-color: var(--db-danger); color: var(--db-danger); }

/* ── Metric Cards ───────────────────────────────────────────── */
.db-metric-card {
  background: #fff;
  border-radius: var(--db-radius);
  box-shadow: var(--db-card-shadow);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  text-decoration: none;
  color: inherit;
  transition: transform var(--db-transition), box-shadow var(--db-transition);
  border: 1.5px solid var(--db-border);
  position: relative;
  overflow: hidden;
}
.db-metric-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(18,59,110,.13);
  color: inherit;
  text-decoration: none;
}

.db-metric-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  background: var(--db-icon-bg, var(--db-primary-light));
  color: var(--db-icon-color, var(--db-primary));
}

.db-metric-body { flex: 1; min-width: 0; }
.db-metric-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--db-text-dark);
  line-height: 1.1;
  margin-bottom: 4px;
}
.db-metric-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--db-text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ── Earnings Strip ─────────────────────────────────────────── */
/* ── Distribution Status List (inside Distribution card) ─────── */
.db-dist-status-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1.5px solid var(--db-border);
}
.db-dist-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--db-radius-sm);
  background: var(--db-bg);
  transition: background var(--db-transition);
}
.db-dist-status-row:hover { background: color-mix(in srgb, var(--sc) 8%, white); }
.db-dist-status-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--sc) 15%, white);
  color: var(--sc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.db-dist-status-lbl {
  flex: 1;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--db-text-muted);
}
.db-dist-status-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--db-text-dark);
  min-width: 32px;
  text-align: right;
}

.db-earnings-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.db-earn-card {
  background: linear-gradient(135deg, var(--db-earn-from, #123B6E), var(--db-earn-to, #1a5296));
  border-radius: var(--db-radius);
  padding: 20px 22px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.db-earn-card::after {
  content: '';
  position: absolute;
  right: -18px; top: -18px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.db-earn-period {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  opacity: .8;
  margin-bottom: 8px;
}
.db-earn-amount {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}
.db-earn-icon {
  position: absolute;
  right: 18px; bottom: 14px;
  font-size: 28px;
  opacity: .25;
}

/* ── Section Card (charts / table) ─────────────────────────── */
.db-section-card {
  background: #fff;
  border-radius: var(--db-radius);
  box-shadow: var(--db-card-shadow);
  padding: 24px;
  height: 100%;
}

.db-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.db-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--db-text-dark);
  margin: 0;
}
.db-section-subtitle {
  font-size: 12.5px;
  color: var(--db-text-muted);
  margin: 2px 0 0;
}

/* Chart period tabs */
.db-period-tabs {
  display: flex;
  gap: 4px;
  background: var(--db-bg);
  border-radius: 8px;
  padding: 3px;
}
.db-period-tab {
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--db-text-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  transition: background var(--db-transition), color var(--db-transition);
}
.db-period-tab.active {
  background: #fff;
  color: var(--db-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

/* ── Recent Bookings Table ──────────────────────────────────── */
.db-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.db-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.db-table thead th {
  background: var(--db-bg);
  color: var(--db-text-muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 10px 14px;
  white-space: nowrap;
  border-bottom: 1.5px solid var(--db-border);
}
.db-table tbody tr {
  border-bottom: 1px solid var(--db-border);
  transition: background var(--db-transition);
}
.db-table tbody tr:last-child { border-bottom: none; }
.db-table tbody tr:hover { background: var(--db-bg); }
.db-table td {
  padding: 12px 14px;
  color: var(--db-text-dark);
  vertical-align: middle;
  white-space: nowrap;
}

/* Customer cell */
.db-customer-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.db-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--db-primary-light);
}
.db-avatar-placeholder {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--db-primary-light);
  color: var(--db-primary);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.db-customer-name  { font-weight: 600; color: var(--db-text-dark); font-size: 13px; }
.db-customer-email { font-size: 11.5px; color: var(--db-text-muted); }

/* Booking ID */
.db-booking-id {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--db-primary);
  background: var(--db-primary-light);
  padding: 3px 8px;
  border-radius: 5px;
  white-space: nowrap;
}

/* Status badges */
.db-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.db-badge-upcoming  { background: var(--db-info-light);    color: var(--db-info); }
.db-badge-ongoing   { background: var(--db-warning-light); color: #b07800; }
.db-badge-delivered { background: var(--db-success-light); color: #0a9e85; }
.db-badge-cancelled { background: var(--db-danger-light);  color: #c0432a; }
.db-badge-pending   { background: var(--db-warning-light); color: #b07800; }
.db-badge-paid      { background: var(--db-success-light); color: #0a9e85; }
.db-badge-failed    { background: var(--db-danger-light);  color: #c0432a; }
.db-badge-refunded  { background: var(--db-purple-light);  color: var(--db-purple); }
.db-badge-urgent    { background: #FFF0EB; color: #c0432a; }
.db-badge-scheduled { background: var(--db-info-light);    color: var(--db-info); }

/* Location cell */
.db-location-cell { max-width: 180px; }
.db-location-row  { display: flex; align-items: flex-start; gap: 5px; font-size: 12.5px; line-height: 1.4; }
.db-location-row + .db-location-row { margin-top: 3px; }
.db-loc-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.db-loc-dot.pickup  { background: var(--db-success); }
.db-loc-dot.dropoff { background: var(--db-danger); }
.db-loc-text { color: var(--db-text-muted); white-space: normal; }

/* Amount */
.db-amount { font-weight: 700; color: var(--db-text-dark); }

/* ── Loading skeleton ───────────────────────────────────────── */
.db-skeleton {
  background: linear-gradient(90deg, #f0f4f8 25%, #e2e8f0 50%, #f0f4f8 75%);
  background-size: 200% 100%;
  animation: db-shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes db-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Chart container ────────────────────────────────────────── */
.db-chart-container { position: relative; width: 100%; }

/* ── Empty state ────────────────────────────────────────────── */
.db-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--db-text-muted);
  font-size: 13.5px;
}
.db-empty i { font-size: 36px; opacity: .35; display: block; margin-bottom: 10px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 767px) {
  .db-metric-value { font-size: 22px; }
  .db-earn-amount  { font-size: 18px; }
  .db-section-card { padding: 16px; }
  .db-table td, .db-table thead th { padding: 10px 10px; }
  .db-filter-bar { justify-content: flex-start; flex-wrap: wrap; }
  .db-date-input, .db-filter-select { width: 130px; }
}

@media (max-width: 480px) {
  .db-metric-card { padding: 16px; gap: 12px; }
  .db-metric-icon { width: 44px; height: 44px; font-size: 18px; }
  .db-earnings-strip { grid-template-columns: repeat(2, 1fr); }
}
