.card {
  background: var(--panel);
  border: 1px solid #e4e7ef;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 2px 10px rgba(0, 0, 0, 0.04);
  padding: 18px;
  position: relative;
  z-index: 0;
  transition: box-shadow 0.16s ease, transform 0.16s ease;
}

.card:hover {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card h3 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0.01em;
  color: var(--text);
}

/* ========== Stat Card Component ========== */
/* Metric card with unified dashboard design across all pages */

/* Grid container for stat cards - unified with db-kpi layout */
.dashboard-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.dashboard-grid.small {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* KPI Row Grid - 4-column responsive grid for KPI cards */
.db-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

/* Activity cards variant: force maximum 2 columns on desktop */
.activity-cards-two {
  grid-template-columns: repeat(2, 1fr) !important;
}

@media (max-width: 1100px) {
  .db-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .db-kpi-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .dashboard-grid.small {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (max-width: 600px) {
  .dashboard-grid.small {
    grid-template-columns: 1fr;
  }
}

/* Unified stat/metric card - shared styling for stat-card and db-kpi */
.stat-card,
.db-kpi {
  background: var(--panel);
  border: 1px solid #e4e7ef;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 2px 10px rgba(0, 0, 0, 0.04);
  padding: 14px 16px 12px;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.16s ease, transform 0.16s ease;
}

.stat-card:hover,
.db-kpi:hover {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

/* Top colored bar - shared for both card types */
.stat-card::before,
.db-kpi::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #0e6fba;
}

/* Color variants - unified for both stat-card and db-kpi */
.stat-card.c-blue::before,
.db-kpi.c-blue::before {
  background: #0e6fba;
}

.stat-card.c-teal::before,
.db-kpi.c-teal::before {
  background: #00b8d4;
}

.stat-card.c-purple::before,
.db-kpi.c-purple::before {
  background: #7c5cbf;
}

.stat-card.c-amber::before,
.db-kpi.c-amber::before {
  background: #f4a100;
}

.stat-card.c-green::before,
.db-kpi.c-green::before {
  background: #1e8e4e;
}

.stat-card.c-orange::before,
.db-kpi.c-orange::before {
  background: #d4640a;
}

.stat-card.c-red::before,
.db-kpi.c-red::before {
  background: #c8302e;
}

.stat-card.c-indigo::before,
.db-kpi.c-indigo::before {
  background: #3f51b5;
}

/* Icon styling - unified for both card types */
.stat-icon,
.db-kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  float: right;
  margin-left: 8px;
}

.stat-icon {
  background: #f0f2f7;
}

/* Color-specific icon backgrounds for db-kpi */
.db-kpi.c-blue .db-kpi-icon {
  background: #deeef9;
}

.db-kpi.c-teal .db-kpi-icon {
  background: #e0f8fc;
}

.db-kpi.c-purple .db-kpi-icon {
  background: #f0ecfb;
}

.db-kpi.c-amber .db-kpi-icon {
  background: #fff3d1;
}

.db-kpi.c-green .db-kpi-icon {
  background: #d7f5e5;
}

.db-kpi.c-orange .db-kpi-icon {
  background: #fdecd5;
}

.db-kpi.c-red .db-kpi-icon {
  background: #fde8e8;
}

.db-kpi.c-indigo .db-kpi-icon {
  background: #e8ebf9;
}

/* Label styling - preserved old system color */
.stat-label,
.db-kpi-label {
  font-size: 11px;
  color: #000;
  /* card name: black to match aggregated card style */
  font-weight: 500;
  line-height: 1.3;
  padding-top: 2px;
}

/* Value styling - preserved old system color */
.stat-value,
.db-kpi-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.8px;
  line-height: 1.1;
  margin: 5px 0 3px;
  color: var(--muted);
  /* value: lighter/muted color to match other aggregated cards */
}

/* Footer with sub-text and trend/delta - shared styling */
.stat-footer,
.db-kpi-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.stat-sub,
.db-kpi-sub {
  font-size: 10.5px;
  color: var(--text-2);
  font-weight: 600;
  /* slightly bolder */
}

/* Trend and Delta indicators - unified styling */
.stat-trend,
.db-kpi-delta {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.stat-trend.up,
.db-kpi-delta.up {
  background: #d7f5e5;
  color: #1e8e4e;
}

.stat-trend.down,
.db-kpi-delta.down {
  background: #fde8e8;
  color: #c8302e;
}

.stat-trend.flat,
.db-kpi-delta.flat {
  background: #f0f2f7;
  color: #a8aec8;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two-col {
  grid-template-columns: 1fr 1fr;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid.single {
  grid-template-columns: 1fr;
}

.actions-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.actions-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.actions-wrap.vertical {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.top-space {
  margin-top: 12px;
}

/* Button Styles - using Button component */

/* Base Button Style */
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger,
.btn-icon {
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  min-height: 40px;
  font-weight: 400;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Button Variants - Flat Colors */
.btn-primary {
  background: #06b6d4;
  color: #fff;
}

.btn-secondary {
  background: #64748b;
  color: #fff;
}

.btn-ghost {
  background: #e2e8f0;
  color: #334155;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
}

.btn-icon {
  padding: 8px 12px;
  min-height: 36px;
  background: #e2e8f0;
  color: #334155;
}

.btn-icon-danger {
  background: #fee2e2;
  color: #dc2626;
}

.btn-icon-danger:hover:not(:disabled) {
  background: #fecaca;
}

/* Button Sizes */
.btn-sm {
  padding: 8px 12px;
  min-height: 34px;
  font-size: 14px;
}

.btn-md {
  padding: 10px 14px;
  min-height: 40px;
  font-size: 14px;
}

.btn-lg {
  padding: 12px 18px;
  min-height: 44px;
  font-size: 14px;
}

/* Button Full Width */
.btn-full-width {
  width: 100%;
}

/* Button with Loading Spinner */
.btn-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-primary .btn-spinner {
  border-top-color: #fff;
}

.btn-secondary .btn-spinner {
  border-top-color: #fff;
}

/* Temporary/compat visual for selected KOC rows when native checkbox indicator is not visible */
.kb-checked td {
  background: rgba(6, 182, 212, 0.06);
}

.kb-checked .koc-picker-checkbox {
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.08);
  border-radius: 4px;
}

/* Ensure picker checkbox has a baseline size and pointer */
.koc-picker-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Robust custom checkbox visuals to avoid relying on UA rendering */
.koc-picker-checkbox {
  -webkit-appearance: none;
  appearance: none;
  display: inline-block;
  width: 18px;
  height: 18px;
  margin: 0;
  vertical-align: middle;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  position: relative;
}

.koc-picker-checkbox:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12);
}

/* Checked state: colored background + svg checkmark */
.koc-picker-checkbox:checked {
  background-color: #06b6d4 !important;
  border-color: #06b6d4 !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><polyline points='20 6 9 17 4 12' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 12px 12px !important;
}

/* Also ensure .kb-checked row's checkbox shows checked state */
.kb-checked .koc-picker-checkbox:checked {
  background-color: #06b6d4 !important;
  border-color: #06b6d4 !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><polyline points='20 6 9 17 4 12' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 12px 12px !important;
}

/* Hover state */
.koc-picker-checkbox:hover {
  border-color: #94a3b8;
}

.btn-ghost .btn-spinner,
.btn-icon .btn-spinner {
  border-top-color: #334155;
}

.btn-danger .btn-spinner {
  border-top-color: #fff;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-primary:hover:not(:disabled) {
  background: #0891b2;
}

.btn-secondary:hover:not(:disabled) {
  background: #475569;
}

.btn-ghost:hover:not(:disabled) {
  background: #cbd5e1;
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.btn-icon:hover:not(:disabled) {
  background: #cbd5e1;
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-ghost:focus-visible,
.btn-danger:focus-visible,
.btn-icon:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-ghost:disabled,
.btn-danger:disabled,
.btn-icon:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.hint.strong {
  color: #fe2c55;
  font-weight: 700;
}

.error-text {
  margin-top: 8px;
  color: #b91c1c;
  font-size: 12px;
}

.bullet-list {
  margin: 0;
  padding-left: 18px;
  color: #374151;
  line-height: 1.7;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: 12px;
  background: #fff;
}

.check-grid label {
  margin: 0;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: #374151;
}

.check-grid input[type='checkbox'] {
  width: auto;
}

/* Make table and modal checkboxes visually consistent with booking filters */
.table-wrap input[type="checkbox"],
.modal-card input[type="checkbox"],
.modal input[type="checkbox"],
.koc-picker-checkbox,
#koc-picker-select-all,
#select-all-kocs {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #06b6d4;
  /* same as filter inputs */
}

/* Stronger overrides for picker checkboxes in case deploy CSS overrides earlier rules */
.koc-picker-checkbox,
.modal .koc-picker-checkbox,
.modal-card .koc-picker-checkbox,
#koc-picker-select-all,
.table-wrap #select-all-kocs,
.table-wrap .koc-picker-checkbox {
  width: 16px !important;
  height: 16px !important;
  cursor: pointer !important;
  accent-color: #06b6d4 !important;
  -webkit-appearance: auto !important;
  appearance: auto !important;
}

/* Ensure checked state shows the accent color background / border where supported */
.koc-picker-checkbox:checked,
.modal .koc-picker-checkbox:checked,
.modal-card .koc-picker-checkbox:checked {
  background-color: #06b6d4 !important;
  border-color: #06b6d4 !important;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 12px;
  border-radius: 50%;
  background: #f3f4f6;
}

.muted {
  color: #d1d5db;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0f172a;
  text-decoration: none;
  border: 1px solid #dbe3ef;
  background: #f8fafd;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-weight: 600;
}

.btn-link:hover {
  background: #eef4ff;
  border-color: #c9d8ef;
}

.scroll-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #06b6d4;
  color: #000;
  border: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 999;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  background: #0891b2;
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.16);
}

/* KOC Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.badge-not_contacted {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-pending {
  background-color: #fed7aa;
  color: #92400e;
}

.badge-negotiating {
  background-color: #bae6fd;
  color: #0c4a6e;
}

.badge-confirmed {
  background-color: #bbf7d0;
  color: #065f46;
}

.badge-completed {
  background-color: #86efac;
  color: #166534;
}

.badge-cancelled {
  background-color: #f87171;
  color: #7f1d1d;
}

.badge-rejected {
  background-color: #fca5a5;
  color: #7f1d1d;
}

/* Consistent small link style used for KOC social links across views */
.links-wrap a {
  font-size: 13px;
  color: #0284c7;
  text-decoration: none;
}

.links-wrap a:hover {
  text-decoration: underline;
}

/* Additional class for social links rendered outside of .links-wrap */
.social-link {
  font-size: 13px;
  color: #0284c7;
  text-decoration: none;
}

.social-link:hover {
  text-decoration: underline;
}

/* ========== Dashboard Grid Utilities ========== */
/* Responsive grid system for dashboard layouts */

.db-grid-4col {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.db-grid-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  /* equal-width columns for dashboard */
  gap: 12px;
  margin-bottom: 14px;
}

.db-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.db-grid-full {
  margin-bottom: 14px;
}

@media (max-width: 960px) {

  .db-grid-4col,
  .db-grid-3col,
  .db-grid-2col {
    grid-template-columns: 1fr;
  }
}

/* ========== Dashboard Panel Component ========== */
/* Unified panel styling for all dashboard sections */

.db-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.db-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-lt);
}

.db-panel-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
}

.db-panel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.db-panel-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.3px;
  background: var(--blue-lt);
  color: var(--blue);
}

.db-panel-body {
  padding: 16px;
}

.db-panel-body.np {
  padding: 0;
}