/* --- STATS CARDS --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.stat-data {
  display: flex;
  flex-direction: column; 
}

.stat-label {
  font-size: 13px;
  color: #6B7280;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: #111;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

/* Updated Icon Colors to Johnson's Palette */
.icon-pink { background: #FCE4EC; color: #F06292; } /* Light Pink & Classic Pink */
.icon-blue { background: #E1F5FE; color: #0056A4; } /* Soft Blue & Logo Blue */
.icon-green { background: #E6F9F0; color: #16A34A; }
.icon-orange { background: #FFF7ED; color: #F59E0B; }
.icon-purple { background: #F5F3FF; color: #7C3AED; }

/* --- FILTER BAR --- */
.filter-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  background: white;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.filter-bar-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 16px 20px;
  align-items: end;
  width: 100%;
}

.filter-bar-fields .filter-group {
  flex: unset;
  min-width: 0;
}

.filter-group--search {
  grid-column: span 2;
  min-width: 0;
}

@media (max-width: 520px) {
  .filter-group--search {
    grid-column: span 1;
  }
}

.filter-bar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 20px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #F3F4F6;
  width: 100%;
  box-sizing: border-box;
}

.filter-bar-actions-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.filter-bar-actions-right {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.filter-bar-actions .btn {
  min-height: 40px;
  padding-left: 18px;
  padding-right: 18px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.filter-bar-actions-link {
  text-decoration: none;
}

.btn-filter {
  background: linear-gradient(135deg, #F06292, #ec407a);
  color: #fff;
  border: none;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(240, 98, 146, 0.35);
  transition: filter 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.btn-filter:hover {
  filter: brightness(1.06);
  box-shadow: 0 4px 14px rgba(240, 98, 146, 0.45);
}

.btn-filter:active {
  transform: scale(0.98);
}

.btn-filter-reset {
  background: #fff;
  color: #F06292;
  border: 2px solid #F8BBD9;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-filter-reset:hover {
  background: #FDF2F8;
  border-color: #F06292;
  color: #d81b60;
}

.btn-filter:focus-visible,
.btn-filter-reset:focus-visible {
  outline: 2px solid #F06292;
  outline-offset: 2px;
}

@media (max-width: 520px) {
  .filter-bar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar-actions-right {
    margin-left: 0;
  }

  .filter-bar-actions-left {
    order: 1;
  }

  .filter-bar-actions-right {
    order: 2;
  }

  .filter-bar-actions-right .btn {
    width: 100%;
  }
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 140px;
}

.filter-group label {
  font-size: 12px;
  font-weight: 700;
  color: #4B5563;
  text-transform: uppercase;
}

.filter-group input, .filter-group select {
  padding: 10px 12px;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

/* --- TABLE & AVATARS --- */
.table-container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

.table.table-compact {
  min-width: 36rem;
}

.table th {
  background: #FCE4EC; /* Soft Light Pink header */
  color: #F06292;      /* Classic Pink text */
  padding: 15px 20px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.table td {
  padding: 15px 20px;
  border-bottom: 1px solid #F3F4F6;
  color: #374151;
}

.td-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.td-circle, .user-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #FFFFFF;
    flex-shrink: 0;
    text-transform: uppercase;
}

/* Avatar Color Variants */
/* Avatar Color Variants - 20 Light/Soft Options */
.td-circle.c1  { background-color: #F87171; } /* Soft Red */
.td-circle.c2  { background-color: #FB923C; } /* Soft Orange */
.td-circle.c3  { background-color: #FBBF24; } /* Amber */
.td-circle.c4  { background-color: #34D399; } /* Emerald */
.td-circle.c5  { background-color: #2DD4BF; } /* Teal */
.td-circle.c6  { background-color: #38BDF8; } /* Sky Blue */
.td-circle.c7  { background-color: #60A5FA; } /* Blue */
.td-circle.c8  { background-color: #818CF8; } /* Indigo */
.td-circle.c9  { background-color: #A78BFA; } /* Violet */
.td-circle.c10 { background-color: #C084FC; } /* Purple */
.td-circle.c11 { background-color: #F472B6; } /* Pink */
.td-circle.c12 { background-color: #FB7185; } /* Rose */
.td-circle.c13 { background-color: #94A3B8; } /* Blue Gray */
.td-circle.c14 { background-color: #A3A3A3; } /* Neutral */
.td-circle.c15 { background-color: #A8A29E; } /* Stone */
.td-circle.c16 { background-color: #4ADE80; } /* Light Green */
.td-circle.c17 { background-color: #22D3EE; } /* Cyan */
.td-circle.c18 { background-color: #86EFAC; } /* Mint */
.td-circle.c19 { background-color: #FDA4AF; } /* Light Rose */
.td-circle.c20 { background-color: #0056A4; } /* Johnson's Logo Blue (kept for brand) */

.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success { background: #E6F9F0; color: #16A34A; }
.badge-inactive { background: #F3F4F6; color: #6B7280; }

/* --- PAGINATION --- */
.pagination {
  padding: 15px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #F3F4F6;
  background: #fff;
}

.pag-info { font-size: 13px; color: #6B7280; }
.pag-btns { display: flex; gap: 8px; }
.pag-btn {
  min-width: 34px;
  height: 34px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.pag-btn.active {
  background: #F06292;
  color: white;
  border-color: #F06292;
}

/* --- MODAL --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 3000;
  padding: max(24px, 5vh) 24px 24px;
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal {
  width: 100%;
  max-width: 450px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  overflow: hidden;
  margin: auto;
}

.modal-wide {
  max-width: 560px;
}

/* Tall forms: limit height, scroll body, keep header + footer visible */
.modal-scrollable {
  max-height: min(90vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-scrollable .modal-header-sticky {
  flex-shrink: 0;
}

.modal-scrollable .modal-title {
  flex: 1;
  min-width: 0;
  padding-right: 12px;
}

.modal-form-column {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.modal-body-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
}

.modal-scrollable .modal-footer {
  margin-top: auto;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.modal-title { margin: 0; font-size: 18px; color: #111; }
.modal-close {
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #6B7280;
  padding: 0;
  flex-shrink: 0;
}

button.modal-close-solid {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: #F3F4F6;
  color: #374151;
  font-size: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

button.modal-close-solid:hover {
  background: #E5E7EB;
  color: #111827;
}

.modal-body { padding: 24px; }

.modal-footer {
  flex-shrink: 0;
  padding: 16px 24px 20px;
  border-top: 1px solid #f3f4f6;
  background: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* --- BUTTONS --- */
.btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}

.btn-primary { 
  background: linear-gradient(135deg, #F06292, #ec407a); 
  color: white; 
}

.btn-light { background: #F3F4F6; color: #4B5563; }
.w-full { width: 100%; }

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #6B7280;
}

.checkbox-container input {
    accent-color: #F06292;
    width: 16px;
    height: 16px;
}

.btn-primary:active {
    transform: scale(0.98);
}

/* Error Styling */
.error-field {
    border: 1px solid #ef4444 !important;
    background-color: #fef2f2 !important;
}

.error-field::placeholder {
    color: #f87171;
}

/* Shake Animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.2s ease-in-out 0s 2;
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Base Toast Style - Johnson's Aesthetic */
.toast {
    padding: 14px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 320px;
    color: #4a4a4a; /* Darker text for better readability on bright backgrounds */
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    animation: toastSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.toast-exit {
    animation: toastSlideOut 0.4s forwards;
}

/* Success - Johnson's Golden Yellow */
.toast-success {
    background: linear-gradient(135deg, #FFD700 0%, #FFCC00 100%);
    border-left: 6px solid #E6B800;
}

/* Error - Soft Rose Red */
.toast-error {
    background: linear-gradient(135deg, #FFB3BA 0%, #FF8C94 100%);
    border-left: 6px solid #FF5C67;
}

/* Icon Circle */
.toast-icon-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.4);
    font-size: 18px;
    color: #333;
}

.toast-content {
    font-size: 15px;
    font-weight: 700;
    color: #2D2D2D;
}

/* Animations */
@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastSlideOut {
    to { opacity: 0; transform: scale(0.9); }
}

/* --- TABLE ROW ACTIONS (Recce / Influencers) --- */
.table-action-icons {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease, color 0.15s ease;
  background: #fff;
}

.icon-btn svg {
  flex-shrink: 0;
}

.icon-btn:active {
  transform: scale(0.96);
}

.icon-btn:focus-visible {
  outline: 2px solid #F06292;
  outline-offset: 2px;
}

.icon-btn-view {
  color: #0056A4;
  background: #EFF6FF;
  border-color: #BFDBFE;
}

a.table-link {
  color: #0056A4;
  font-weight: 600;
  text-decoration: none;
}

a.table-link:hover {
  color: #F06292;
  text-decoration: underline;
}

.icon-btn-view:hover {
  background: #DBEAFE;
  border-color: #93C5FD;
}

.icon-btn-edit {
  color: #C2410C;
  background: #FFF7ED;
  border-color: #FDBA74;
}

.icon-btn-edit:hover {
  background: #FFEDD5;
  border-color: #FB923C;
}

.icon-btn-delete {
  color: #B91C1C;
  background: #FEF2F2;
  border-color: #FECACA;
}

.icon-btn-delete:hover {
  background: #FEE2E2;
  border-color: #F87171;
}

/* --- VIEW MODAL DETAIL LIST (Johnson’s pink theme) --- */
.modal-detail-body {
  padding-top: 8px;
}

.recce-dl {
  margin: 0;
}

.recce-dl dt {
  margin: 14px 0 6px 0;
  padding: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #F06292;
}

.recce-dl dt:first-child {
  margin-top: 0;
}

.recce-dl dd {
  margin: 0;
  padding: 11px 14px;
  font-size: 15px;
  font-weight: 500;
  color: #111827;
  background: linear-gradient(135deg, #FDF2F8 0%, #FCE4EC 100%);
  border-radius: 10px;
  border-left: 4px solid #F06292;
  line-height: 1.5;
  box-shadow: 0 1px 2px rgba(240, 98, 146, 0.08);
}

#recce_view_remark {
  white-space: pre-wrap;
  word-break: break-word;
}

/* Master data — status column switch */
input.master-status-toggle {
  appearance: none;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #d1d5db;
  border: 1px solid #bfc4cc;
  cursor: pointer;
  position: relative;
  vertical-align: middle;
  transition: background 0.15s ease, border-color 0.15s ease;
}

input.master-status-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
}

input.master-status-toggle:checked {
  background: #10b981;
  border-color: #059669;
}

input.master-status-toggle:checked::after {
  transform: translateX(20px);
}

input.master-status-toggle:focus-visible {
  outline: 2px solid #0056a4;
  outline-offset: 2px;
}

/* Master data — form status row + confirm modals */
.filter-group-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #374151;
  margin-bottom: 8px;
}

.master-form-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.master-form-status-caption {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.modal-overlay--danger {
  background: rgba(17, 24, 39, 0.58);
}

.modal.modal-confirm-card {
  max-width: 440px;
  width: calc(100% - 32px);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.22);
  padding: 0;
  overflow: hidden;
}

.modal.modal-confirm-card .modal-header,
.modal.modal-confirm-card .modal-body,
.modal.modal-confirm-card .modal-footer {
  padding-left: 24px;
  padding-right: 24px;
}

.modal.modal-confirm-card .modal-header {
  padding-top: 20px;
  padding-bottom: 0;
  border-bottom: 0;
}

.modal-confirm-visual {
  width: 56px;
  height: 56px;
  margin: 24px auto 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-confirm-visual--status {
  background: linear-gradient(145deg, #dbeafe 0%, #e0efff 100%);
  color: #0056a4;
}

.modal-confirm-visual--delete {
  background: linear-gradient(145deg, #fee2e2 0%, #fecaca 100%);
  color: #b91c1c;
}

.modal-confirm-header .modal-title {
  text-align: center;
  width: 100%;
}

.modal-confirm-body {
  padding-top: 12px;
  padding-bottom: 8px;
}

.modal-confirm-entity {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 700;
  color: #111827;
  text-align: center;
  line-height: 1.35;
}

.modal-confirm-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: #4b5563;
  text-align: center;
}

.modal-confirm-lead {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  line-height: 1.45;
}

.modal-confirm-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #6b7280;
}

.modal-confirm-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
  padding-bottom: 22px;
  border-top: 1px solid #f3f4f6;
}

.btn-danger-solid {
  background: #dc2626;
  color: #fff;
  border: 1px solid #b91c1c;
  font-weight: 600;
}

.btn-danger-solid:hover {
  background: #b91c1c;
  border-color: #991b1b;
  color: #fff;
}