/* styles.css */
:root {
  --gold: #c9a227;
  --dark: #111418;
  --white: #ffffff;
  --muted: #f5f5f7;
  --border: #dcdcdc;
  --blue: #0b5ed7;
}
* { box-sizing: border-box; }
html, body {
  max-width: 100%;
  overflow-x: hidden;
}
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji"; color: var(--dark); background: var(--muted); }
.header { display:flex; justify-content:space-between; align-items:center; padding: 14px 28px; background: var(--dark); color: var(--white); position: sticky; top: 0; border-bottom: 4px solid var(--gold); box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 2000; }
.brand { display:flex; align-items:center; gap: 16px; }
.logo { height: clamp(36px, 5vw, 54px); width: auto; background: transparent; }
.container { max-width: 1000px; margin: 24px auto; padding: 0 16px; }
.dashboard-container {
  max-width: min(1560px, 96vw);
  width: 100%;
  margin: 16px auto 36px;
  padding: 0 clamp(10px, 2vw, 24px);
}
.viewer-container {
  max-width: 100% !important;
  width: 100% !important;
  margin: 16px auto 32px;
  padding: 0 clamp(12px, 1.5vw, 24px);
}
.login-container { max-width: 1000px; margin: 0 auto; padding: 0 16px; min-height: calc(100vh - 140px); display: flex; align-items: center; justify-content: center; }
.card { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: clamp(14px, 1.8vw, 22px); box-shadow: 0 4px 14px rgba(0,0,0,0.05); }
.login-card { max-width: 420px; width: 100%; }
h1 { margin: 0; font-size: 24px; letter-spacing: 0.6px; }
h1 { font-size: clamp(18px, 3.5vw, 24px); }
h2 { margin-top: 0; font-size: 20px; }
/* Distinct card header using brand (logo) color */
.card > h2 {
  background: var(--gold);
  color: var(--dark);
  font-weight: 700;
  padding: 12px 16px;
  margin: -20px -20px 16px; /* stretch to card edges */
  border-radius: 12px 12px 0 0;
}
/* Entry headers inside cards use the same brand color */
.card > h3 {
  background: var(--gold);
  color: var(--dark);
  font-weight: 700;
  padding: 12px 16px;
  margin: -20px -20px 16px; /* stretch to card edges */
  border-radius: 12px 12px 0 0;
}
label { display:block; margin-bottom: 8px; font-weight: 600; }
input, select, textarea { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--border); outline: none; background: var(--white); }
select { color: var(--dark); }
select option { color: var(--dark); }
select:disabled { color: var(--dark); opacity: 1; }
.field.error input,
.field.error select,
.field.error textarea { border-color: #b00020; background: #fff5f5; }
.field.error label { color: #b00020; }
.btn { background: var(--dark); color: var(--white); padding: 10px 16px; border: none; border-radius: 8px; cursor: pointer; margin-right: 8px; }
.btn.primary { background: var(--gold); color: var(--dark); font-weight: 700; }
.btn:hover { opacity: 0.9; }
.btn:disabled, .btn[disabled] { opacity: 0.55; cursor: not-allowed !important; pointer-events: none !important; box-shadow: none !important; }
.footer { text-align:center; padding: 20px; color: #666; }
.msg { margin-top: 12px; color: #333; }
.msg.error { color: #b00020; }
.toast {
  position: fixed;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: 0 10px 26px rgba(0,0,0,0.18);
  z-index: 5000;
  max-width: min(92vw, 520px);
  width: max-content;
}
.toast.success { color: #0b6b2b; border-color: #0b6b2b33; }
.toast.error { color: #b00020; border-color: #b0002033; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 4500;
}


/* Utility */
/* Form & Modal Improvements */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input, 
.form-group select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--white);
  transition: border-color 0.2s;
}

.form-group input:focus, 
.form-group select:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.1);
}

.modal-card {
  max-width: 600px;
  width: 92%;
  max-height: calc(100vh - 48px);
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: none;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
  border-radius: 14px;
}

.modal-header {
  flex: 0 0 auto !important;
  background: var(--dark);
  color: var(--white);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--gold);
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: calc(100vh - 185px) !important;
}

#forgotPasswordModal .modal-body {
  padding: 0 24px;
}

#resetMsg:empty {
  display: none !important;
}

.modal-actions {
  flex: 0 0 auto !important;
  padding: 14px 24px;
  background: #f9fafb;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border);
  margin: 0 !important;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--white);
  font-size: 24px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.btn-close:hover {
  opacity: 1;
}

/* User Management Specifics */
#usersSection .card {
  padding: 24px;
  margin-bottom: 24px;
}

.action-btns {
  display: flex;
  gap: 8px;
}

.btn-edit {
  background: var(--gold);
  color: var(--dark);
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 12px;
  border: none;
  cursor: pointer;
}

.btn-delete {
  background: #fee2e2;
  color: #dc2626;
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 12px;
  border: 1px solid #fecaca;
  cursor: pointer;
}

.btn-delete:hover {
  background: #fecaca;
}

.hidden,
[hidden],
.form-select.hidden,
#formSelect.hidden,
.pending-timeouts.hidden,
#pendingTimeoutsSection.hidden,
.tabs.hidden {
  display: none !important;
}

.tabs { 
  display: flex; 
  gap: 8px; 
  margin-bottom: 20px; 
  border-bottom: 2px solid var(--border);
  padding-bottom: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.tab-btn { 
  flex: 0 0 auto;
  padding: 8px 16px; 
  border: 1.5px solid #888888; 
  background: var(--muted); 
  color: #000000;
  border-radius: 8px; 
  cursor: pointer; 
  font-weight: 600;
  transition: all 0.2s ease;
  font-size: 13.5px;
  white-space: nowrap;
}
.tab-btn:hover {
  background: #eee;
  border-color: #999;
}
.tab-btn.active { 
  background: var(--gold); 
  color: var(--dark); 
  border-color: var(--gold);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.tab { display:none; }
.tab.active { display:block; }
.card > h3 { display: flex; align-items: center; gap: 12px; }
.row-remove-x {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.15);
  background: rgba(255,255,255,0.85);
  color: var(--dark);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 0;
  flex: 0 0 auto;
}
.row-remove-x:hover { background: rgba(255,255,255,1); }

/* Mobile form selector (hidden on desktop) */
.form-selector { display: none; width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--white); }

.rows { display:flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.row { display:flex; flex-direction: column; gap: 8px; }
.row textarea { width: 100%; }

/* Time input with AM/PM indicator */
.time-input-wrap { display: flex; align-items: center; gap: 8px; }
.time-input-wrap input { flex: 1; }
.time-input-wrap .ampm { font-size: 12px; font-weight: 700; color: var(--dark); background: var(--muted); border: 1px solid var(--border); padding: 6px 8px; border-radius: 6px; }

/* Sales agent typeahead */
.typeahead { position: relative; }
.typeahead-list { position: absolute; left: 0; right: 0; top: 100%; margin-top: 6px; background: var(--white); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 24px rgba(0,0,0,0.12); max-height: 240px; overflow: auto; z-index: 3000; }
.typeahead-item { display: block; width: 100%; text-align: left; padding: 10px 12px; background: transparent; border: 0; cursor: pointer; }
.typeahead-item:hover { background: var(--muted); }
.typeahead-item.active, .typeahead-item:focus { background: var(--blue); color: var(--white); outline: none; }
.typeahead-empty { padding: 10px 12px; color: #666; }

/* Multi-agent select styles */
.multi-agent-select .selected-agents { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.multi-agent-select .selected-agents:empty { display: none; }
.agent-badge { background: var(--gold); color: var(--dark); padding: 4px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.agent-remove { cursor: pointer; font-size: 14px; font-weight: bold; line-height: 1; }
.agent-remove:hover { color: #b00020; }

.dropdown-up .typeahead-list { top: auto; bottom: 100%; margin-top: 0; margin-bottom: 6px; box-shadow: 0 -10px 24px rgba(0,0,0,0.12); }

/* Make form buttons stack neatly on small screens */
.card .btn { margin-top: 8px; }

.table table { width: 100%; border-collapse: collapse; }
.table th, .table td { border: 1px solid var(--border); padding: 8px; text-align: left; }
.table th { background: var(--muted); }

/* Viewer tables: enable horizontal scroll on small screens and prevent wrapping */
.table { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; touch-action: pan-x pan-y; }
.table .card { overflow: visible; display: inline-block; min-width: 100%; width: max-content; }
.table table { width: max-content; min-width: 100%; }
.table th, .table td { white-space: nowrap; }

/* Responsive Expandable Tables */
.report-table-section {
  margin-bottom: 24px;
}

.table-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.table-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
}

.table-count-badge {
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
  letter-spacing: 0.3px;
}

.btn-toggle-all-rows {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-toggle-all-rows:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-toggle-all-rows:active {
  transform: scale(0.98);
}

.table-scroll-wrap,
.table .card.table-card {
  padding: 0 !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--white);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  width: 100%;
}

.report-table,
.responsive-expandable-table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.report-table th,
.responsive-expandable-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.report-table td,
.responsive-expandable-table td {
  padding: 8px 14px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  color: #1e293b;
  white-space: nowrap;
}

.report-table tbody tr:hover,
.responsive-expandable-table tbody tr:hover {
  background-color: #f8fafc;
}

.report-table tbody tr:nth-child(even),
.responsive-expandable-table tbody tr:nth-child(even) {
  background-color: #fbfcfd;
}

.responsive-expandable-table .col-expand-toggle-th {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  text-align: center;
  padding: 8px 4px !important;
}

.responsive-expandable-table .col-expand-toggle {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  text-align: center;
  padding: 8px 4px !important;
  vertical-align: middle;
}

.btn-row-expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-row-expand:hover {
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
}

.expandable-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.expandable-row:hover {
  background-color: #f8fafc;
}

.expandable-row.row-is-expanded {
  background-color: #f0fdf4;
}

.expandable-row.row-is-expanded .btn-row-expand {
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
}

/* Sub-row detail drawer */
.row-details-row {
  background-color: #f8fafc;
}

.row-details-row.hidden {
  display: none !important;
}

.row-details-row td {
  padding: 0 !important;
  border-bottom: 2px solid #cbd5e1;
  white-space: normal !important;
}

.row-details-wrapper {
  padding: 14px 16px 16px;
  background: #f8fafc;
  border-left: 4px solid #16a34a;
  animation: slideDownFade 0.2s ease-out;
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.row-details-header {
  margin-bottom: 10px;
}

.row-details-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #15803d;
  background: #dcfce7;
  padding: 2px 8px;
  border-radius: 4px;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.detail-item.detail-primary {
  border-left: 3px solid #16a34a;
}

.detail-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.detail-value {
  font-size: 13px;
  color: #1e293b;
  font-weight: 500;
  word-break: break-word;
}

/* Tablet & Mobile Responsiveness: Smooth horizontal scroll for full table view */
@media (max-width: 992px) {
  .table .card.table-card,
  .table-scroll-wrap {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

.viewer-container .filters {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.viewer-container .filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.viewer-container .filters input,
.viewer-container .filters select {
  height: 38px;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--white);
}

.viewer-container .filters .btn {
  height: 38px;
  margin: 0;
  padding: 0 20px;
  font-weight: 700;
  align-self: flex-end;
}

@media (max-width: 600px) {
  .details-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .table-header-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-toggle-all-rows {
    width: 100%;
    justify-content: center;
  }
}

/* Header navigation */
nav { display: flex; align-items: center; gap: 16px; }
nav a { color: var(--white); text-decoration: none; margin-left: 0; }
/* Logout button on far right with white background */
nav a#logout { margin-left: auto; background: var(--white); color: var(--dark); padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border); font-weight: 700; }

/* Removed hamburger and mobile popover menu styles */

/* ==========================================================================
   FORMS LANDING PAGE & TABS STYLING (Matching User Screenshots 1 & 2)
   ========================================================================== */

.forms-container {
  max-width: 1000px;
  width: 100%;
  margin: 24px auto 40px;
  padding: 0 16px;
}

/* Cards-first form selection: Two in a column (2x2 grid matching Screenshot 1) */
.form-select {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.form-select.hidden,
#formSelect.hidden {
  display: none !important;
}
@media (max-width: 480px) {
  .form-select {
    gap: 10px;
  }
  .menu-card h3 {
    font-size: 14px;
    padding: 10px 12px;
  }
}

.menu-card {
  display: block;
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  cursor: pointer !important;
  overflow: hidden;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  pointer-events: auto !important;
  border: none;
  background: transparent;
}
.menu-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}
.menu-card:active {
  transform: translateY(1px);
}
.menu-card h3 {
  margin: 0;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  border-radius: 10px;
  pointer-events: none;
}
.menu-card[data-tab="plot_bookings"] h3 { background: #2B6CB0; color: #ffffff; }
.menu-card[data-tab="site_visits"] h3 { background: #2F855A; color: #ffffff; }
.menu-card[data-tab="incidents"] h3 { background: #C53030; color: #ffffff; }
.menu-card[data-tab="feedbacks"] h3 { background: #6B46C1; color: #ffffff; }

/* Hide cards during role-loading to prevent flash */
body[data-user-role="loading"] #formSelect,
body[data-user-role="loading"] #pendingTimeoutsSection {
  visibility: hidden;
}

/* Single card presentation for visitor_clerk */
body[data-user-role="visitor_clerk"] .form-select .menu-card[data-tab="site_visits"] {
  grid-column: 1 / -1;
  max-width: 480px;
  margin: 0 auto;
}

/* Dedicated Pending Time Outs Table Card (Screenshot 1) */
.pending-timeouts {
  margin-top: 16px;
  border-radius: 12px;
  border: 1px solid #111418;
  background: var(--white);
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  overflow: hidden;
}
.pending-timeouts h2 {
  margin: 0;
  color: var(--dark);
  background: var(--gold);
  padding: 14px 20px;
  border-bottom: 1px solid #111418;
  font-size: 18px;
  font-weight: 700;
}
.pending-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  flex-wrap: nowrap;
}
.pending-controls input {
  flex: 1;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 14px;
  outline: none;
}
.pending-controls select {
  width: auto;
  min-width: 80px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 14px;
}
.pending-controls .btn {
  background: #111418;
  color: #ffffff;
  border-radius: 6px;
  padding: 8px 16px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}
.pending-controls .btn:hover:not(:disabled) {
  background: #2a2e33;
}
.pending-controls .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.pending-controls .page-info {
  font-weight: 700;
  color: #111418;
  white-space: nowrap;
  font-size: 13px;
  padding: 0 4px;
}
@media (max-width: 600px) {
  .pending-controls {
    flex-wrap: wrap;
  }
}
.pending-timeouts .table {
  width: 100%;
  overflow-x: auto;
  padding: 0;
}
.pending-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.pending-table th {
  background: #111418;
  color: #ffffff;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 14px;
  border: none;
}
.pending-table td {
  padding: 12px 18px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 14px;
  color: #111418;
  vertical-align: middle;
}
.pending-table tbody tr:hover td {
  background: #fffdf5;
}
.sv-timeout-btn {
  background: #c9a227 !important;
  color: #111418 !important;
  font-weight: 700 !important;
  border: none !important;
  border-radius: 6px !important;
  padding: 6px 16px !important;
  cursor: pointer !important;
  font-size: 13px !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: opacity 0.15s ease;
}
.sv-timeout-btn:hover {
  opacity: 0.9;
}

/* ==========================================================================
   CLICKABLE TABS AT THE TOP (Screenshot 2)
   ========================================================================== */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.tabs.hidden {
  display: none !important;
}
.tab-btn {
  background: #ffffff;
  color: #111418;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px 22px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tab-btn:hover {
  border-color: #94a3b8;
}
.tab-btn.active {
  background: #c9a227;
  color: #111418;
  border-color: #c9a227;
  font-weight: 700;
}

#walkinsSection .filters { background: var(--muted); padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; }
#walkinsSection .filters label { flex: 1; min-width: 220px; }
#walkinsSection .filters #walkinsProjectWrap { flex: 0 0 auto; min-width: 220px; }
#walkinsSection .filters #walkinsStatus { margin: 0; flex: 1 1 100%; }
#walkinsSection .pager { background: transparent; }

.walkins-table table { border-collapse: separate; border-spacing: 0; border-radius: 12px; }
.walkins-table th { background: var(--dark); color: var(--white); border-color: #000000; }
.walkins-table td { border-color: var(--border); vertical-align: top; }
.walkins-table tbody tr:nth-child(even) { background: var(--muted); }
.walkins-table tbody tr:hover { background: #fff6d6; }
.walkins-table tbody tr.walkins-new { background: #eaf7ff; }

.walkins-client { display: flex; flex-direction: column; gap: 2px; }
.walkins-name { font-weight: 800; }
.walkins-sub { font-size: 12px; color: #555; }

.walkins-phone { color: var(--dark); text-decoration: none; font-weight: 700; }
.walkins-phone:hover { text-decoration: underline; }

/* Activity Logs Styling */
.logs-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--white);
  width: 100%;
}

.logs-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 13px;
}

.logs-table th {
  background: var(--dark);
  color: var(--white);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  font-size: 12.5px;
}

.logs-table td {
  padding: 9px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}

.logs-table tr:last-child td {
  border-bottom: none;
}

.logs-table tr:hover {
  background-color: #f8fafc;
}

.log-user {
  display: flex;
  flex-direction: column;
}

.log-user .email {
  font-weight: 600;
  color: var(--dark);
  font-size: 12.5px;
}

.log-user .role-sub {
  font-size: 11px;
  color: #64748b;
}

.log-user .ip {
  font-size: 11px;
  color: #888;
  font-family: monospace;
}

.log-description {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #475569;
  font-size: 12.5px;
}

.log-description:hover {
  white-space: normal;
  word-break: break-word;
}

.log-timestamp {
  white-space: nowrap;
  color: #555;
  font-weight: 500;
}

/* Activity Log Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.badge.LOGIN_SUCCESS { background: #28a745; color: #ffffff; border: 1px solid #1e7e34; }
.badge.LOGIN_FAILED { background: #dc3545; color: #ffffff; border: 1px solid #bd2130; }
.badge.PASSWORD_RESET_REQUEST { background: #ffc107; color: #212529; border: 1px solid #e0a800; }
.badge.PASSWORD_RESET_COMPLETE { background: #17a2b8; color: #ffffff; border: 1px solid #117a8b; }
.badge.FORM_SUBMISSION { background: #007bff; color: #ffffff; border: 1px solid #0069d9; }
.badge.WALKIN_ASSIGNED { background: #6f42c1; color: #ffffff; border: 1px solid #5a32a3; }
.badge.SITE_VISIT_TIMEOUT { background: #fd7e14; color: #ffffff; border: 1px solid #d96a12; }
.badge.SALES_AGENT_CREATED { background: #20c997; color: #ffffff; border: 1px solid #1ba37a; }
.badge.SALES_AGENT_UPDATED { background: #17a2b8; color: #ffffff; border: 1px solid #117a8b; }
.badge.SALES_AGENT_DELETED, .badge.SALES_AGENTS_CLEARED { background: #343a40; color: #ffffff; border: 1px solid #23272b; }
.badge.USER_CREATED { background: #28a745; color: #ffffff; border: 1px solid #1e7e34; }
.badge.USER_DELETED { background: #dc3545; color: #ffffff; border: 1px solid #bd2130; }

.badge.superadmin { background: #111418; color: #c9a227; border: 1px solid #c9a227; }
.badge.admin { background: #007bff; color: #ffffff; border: 1px solid #0056b3; }
.badge.manager { background: #6f42c1; color: #ffffff; border: 1px solid #4e2d8a; }
.badge.user { background: #6c757d; color: #ffffff; border: 1px solid #495057; }
.badge.visitor_clerk { background: #0284c7; color: #ffffff; border: 1px solid #0369a1; }

.walkins-badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; border: 1px solid rgba(0,0,0,0.12); background: rgba(255,255,255,0.9); }
.walkins-project { background: #fff6d6; border-color: rgba(201,162,39,0.6); }

.walkins-time { display: flex; flex-direction: column; gap: 2px; }
.walkins-date { font-size: 12px; color: #555; }
.walkins-clock { font-weight: 800; }

.agents-table,
.walkins-table,
.logs-table-wrap,
#usersListContainer {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  background: var(--white);
}

.agents-table table { width: 100%; min-width: 680px; border-collapse: separate; border-spacing: 0; border-radius: 12px; }
.agents-table th, .agents-table td { border: 0; padding: 10px 12px; vertical-align: middle; }
.agents-table thead th { position: sticky; top: 0; background: var(--dark); color: var(--white); z-index: 1; }
.agents-table tbody tr:nth-child(even) { background: var(--muted); }
.agents-table tbody tr:hover { background: #fff6d6; }
.agents-table td { white-space: normal; }
.agents-name { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.agents-badge { width: 34px; height: 34px; border-radius: 999px; background: var(--gold); color: var(--dark); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; flex: 0 0 auto; border: 1px solid rgba(0,0,0,0.08); }
.agents-actions { display: flex; justify-content: flex-end; gap: 8px; }
.agents-actions .btn { margin-right: 0; padding: 6px 10px; border-radius: 8px; font-size: 12px; }

.walkins-table table { width: 100%; min-width: 720px; border-collapse: separate; border-spacing: 0; border-radius: 12px; }
.walkins-table th, .walkins-table td { border: 0; padding: 10px 12px; vertical-align: middle; }
.walkins-table thead th { position: sticky; top: 0; background: var(--dark); color: var(--white); z-index: 1; }
.walkins-table tbody tr:nth-child(even) { background: var(--muted); }
.walkins-table tbody tr:hover { background: #fff6d6; }
.walkins-new { background: #eafff1 !important; }
.walkins-table .btn { margin-right: 0; padding: 6px 10px; border-radius: 8px; font-size: 12px; }
.walkins-table select { min-width: 180px; }
.walkins-table input.walkins-agent-input { min-width: 180px; width: 100%; }

.btn.cta {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(0,0,0,0.12);
}

/* Desktop adjustments: wider cards on forms page */
@media (min-width: 1024px) {
  /* Match dashboard container/card width */
  .forms-container { max-width: 1000px; }
  .forms-container .form-select { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .forms-container .menu-card h3 { padding: 14px 20px; }
  .forms-container .tab .card { padding: 16px; }
  .forms-container .rows { gap: 8px; }
}

@media (orientation: landscape) and (max-width: 1366px) {
  .container { max-width: 100%; }
  .forms-container { max-width: 100%; }
}

/* Back button shown at the end of the active form card */
.btn.back-btn {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  max-width: fit-content;
  padding: 10px 20px;
  margin-right: 0;
  background: var(--gold);
  color: var(--dark);
  border: 1px solid var(--gold);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  font-weight: 700;
  margin-top: 16px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn.back-btn:hover {
  background: #d4ac2b;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

/* Dashboard summary cards */
.summary { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); 
  gap: 16px; 
  margin-bottom: 20px; 
}
.summary-card { 
  background: var(--white); 
  border: 1px solid var(--border); 
  border-radius: 14px; 
  padding: 20px 22px; 
  min-height: 125px; 
  box-shadow: 0 4px 14px rgba(0,0,0,0.06); 
  cursor: pointer; 
  transition: transform 0.12s ease, box-shadow 0.12s ease; 
  position: relative; 
  overflow: hidden; 
}
.summary-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.09); }
.summary-card h3 { margin: 0 0 8px; font-size: 17px; }
.summary-card .count { font-size: 28px; font-weight: 800; color: var(--gold); }

/* Thin colored strip at top of cards */
.summary-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px; background: var(--gold); border-top-left-radius: 16px; border-top-right-radius: 16px; }
.summary-card[data-type="plot_bookings"]::before { background: #2B6CB0; }
.summary-card[data-type="site_visits"]::before { background: #2F855A; }
.summary-card[data-type="incidents"]::before { background: #C53030; }
.summary-card[data-type="feedbacks"]::before { background: #6B46C1; }

/* Compact filters on dashboard */
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filters label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; font-weight: 600; }
.filters input, .filters select { width: auto; padding: 6px 8px; border-radius: 6px; font-size: 13px; }
.filters select { min-width: 160px; }
.filters .btn { padding: 6px 10px; border-radius: 6px; font-size: 13px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; flex-wrap: wrap; }
.pager .pager-left { color: #333; font-size: 13px; }
.pager .pager-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pager select { width: auto; }
.pager .btn { margin-right: 0; }

@media (max-width: 768px) {
  .header { padding: 12px 16px; flex-direction: row; align-items: center; }
  .brand { width: auto; gap: 12px; justify-content: flex-start; }
  .logo { height: 32px; }
  h1 { font-size: 18px; }
  nav { margin-left: auto; display: flex; gap: 12px; flex-wrap: nowrap; }
  /* Keep logout pushed to far right on mobile */
  nav a#logout { margin-left: auto; }
  .container { padding: 0 12px; }
  .card { padding: 16px; }
  .card > h2 { margin: -16px -16px 12px; padding: 10px 14px; }
  .card > h3 { margin: -16px -16px 12px; padding: 10px 14px; }
  .filters { gap: 6px; }
  .filters input, .filters select { padding: 6px 8px; font-size: 12px; }
  .filters .btn { padding: 6px 10px; font-size: 12px; }
  /* Use tabs on mobile; hide dropdown selector */
  .form-selector { display: none; }
  .tabs { display: flex; position: static; z-index: auto; background: transparent; padding: 0; }
  /* One card per row on mobile/tablet for dashboard summary only */
  .summary { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  /* More compact, wrap-friendly header on small phones */
  .header { padding: 10px 12px; flex-direction: row; align-items: center; }
  .brand { width: auto; gap: 8px; align-items: center; flex-wrap: nowrap; }
  .logo { height: 28px; }
  .brand h1 { font-size: 16px; line-height: 1.2; margin: 0; }
  nav { margin-left: auto; gap: 8px; justify-content: flex-start; flex-wrap: nowrap; }
  nav a { padding: 6px 10px; font-size: 14px; }
  nav a#logout { padding: 6px 10px; margin-left: auto; }
  .summary { grid-template-columns: 1fr; gap: 16px; }
  .summary-card { padding: 20px; min-height: 140px; }
  .summary-card h3 { font-size: 18px; }
  .summary-card .count { font-size: 24px; }
}

/* Password Toggle Styles */
.password-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.password-field-wrapper input {
  padding-right: 42px !important;
}
.password-toggle-btn {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  z-index: 10;
  transition: color 0.15s ease;
}
.password-toggle-btn:hover {
  color: var(--dark);
}
.password-toggle-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}
.password-toggle-btn .eye-off-icon {
  display: none;
}
.password-toggle-btn.visible .eye-icon {
  display: none;
}
.password-toggle-btn.visible .eye-off-icon {
  display: block;
}

.btn-clear-sessions {
  background: #e0f2fe;
  color: #0369a1;
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 12px;
  border: 1px solid #bae6fd;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-clear-sessions:hover:not(:disabled) {
  background: #bae6fd;
}

.btn-clear-sessions:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  border-color: #e2e8f0;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Session count badge in user table */
.session-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.session-count-badge.active {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.session-count-badge.active::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

.session-count-badge.none {
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* ==========================================================================
   SYSTEM OBSERVABILITY, SMS MONITORING & DIAGNOSTICS SUITE
   ========================================================================== */

/* SMS Observability KPI Grid */
.sms-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.sms-stat-card {
  border-radius: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  position: relative;
  overflow: hidden;
}

.sms-stat-card:hover {
  transform: translateY(-3px);
}

.sms-stat-card .stat-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.sms-stat-card .stat-val {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 4px;
}

.sms-stat-card .stat-sub {
  font-size: 11.5px;
  font-weight: 500;
}

/* 1. Total SMS Tracked - Slate / Deep Navy Theme */
.sms-stat-card.stat-card-total,
.sms-stat-card:nth-child(1) {
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  border: 1px solid #94a3b8;
  border-top: 4px solid #334155;
}
.sms-stat-card.stat-card-total .stat-label,
.sms-stat-card:nth-child(1) .stat-label { color: #334155; font-weight: 800; }
.sms-stat-card.stat-card-total .stat-val,
.sms-stat-card:nth-child(1) .stat-val { color: #0f172a; }
.sms-stat-card.stat-card-total .stat-sub,
.sms-stat-card:nth-child(1) .stat-sub { color: #475569; font-weight: 600; }
.sms-stat-card.stat-card-total:hover,
.sms-stat-card:nth-child(1):hover {
  box-shadow: 0 6px 18px rgba(51, 65, 85, 0.25);
}

/* 2. Provider Accepted - Sky / Azure Theme */
.sms-stat-card.stat-card-accepted,
.sms-stat-card:nth-child(2) {
  background: linear-gradient(135deg, #bfdbfe 0%, #93c5fd 100%);
  border: 1px solid #60a5fa;
  border-top: 4px solid #1d4ed8;
}
.sms-stat-card.stat-card-accepted .stat-label,
.sms-stat-card:nth-child(2) .stat-label { color: #1e3a8a; font-weight: 800; }
.sms-stat-card.stat-card-accepted .stat-val,
.sms-stat-card:nth-child(2) .stat-val { color: #1e40af; }
.sms-stat-card.stat-card-accepted .stat-sub,
.sms-stat-card:nth-child(2) .stat-sub { color: #1e3a8a; font-weight: 600; }
.sms-stat-card.stat-card-accepted:hover,
.sms-stat-card:nth-child(2):hover {
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25);
}

/* 3. Pending Delivery - Indigo / Violet Theme */
.sms-stat-card.stat-card-pending,
.sms-stat-card:nth-child(3) {
  background: linear-gradient(135deg, #c7d2fe 0%, #a5b4fc 100%);
  border: 1px solid #818cf8;
  border-top: 4px solid #4338ca;
}
.sms-stat-card.stat-card-pending .stat-label,
.sms-stat-card:nth-child(3) .stat-label { color: #312e81; font-weight: 800; }
.sms-stat-card.stat-card-pending .stat-val,
.sms-stat-card:nth-child(3) .stat-val { color: #3730a3; }
.sms-stat-card.stat-card-pending .stat-sub,
.sms-stat-card:nth-child(3) .stat-sub { color: #312e81; font-weight: 600; }
.sms-stat-card.stat-card-pending:hover,
.sms-stat-card:nth-child(3):hover {
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.25);
}

/* 4. Network Delivered - Emerald / Green Theme */
.sms-stat-card.stat-card-delivered,
.sms-stat-card:nth-child(4) {
  background: linear-gradient(135deg, #bbf7d0 0%, #86efac 100%);
  border: 1px solid #4ade80;
  border-top: 4px solid #15803d;
}
.sms-stat-card.stat-card-delivered .stat-label,
.sms-stat-card:nth-child(4) .stat-label { color: #14532d; font-weight: 800; }
.sms-stat-card.stat-card-delivered .stat-val,
.sms-stat-card:nth-child(4) .stat-val { color: #166534; }
.sms-stat-card.stat-card-delivered .stat-sub,
.sms-stat-card:nth-child(4) .stat-sub { color: #14532d; font-weight: 600; }
.sms-stat-card.stat-card-delivered:hover,
.sms-stat-card:nth-child(4):hover {
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.25);
}

/* 5. Delivery Failed - Crimson / Red Theme */
.sms-stat-card.stat-card-failed,
.sms-stat-card:nth-child(5) {
  background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
  border: 1px solid #f87171;
  border-top: 4px solid #b91c1c;
}
.sms-stat-card.stat-card-failed .stat-label,
.sms-stat-card:nth-child(5) .stat-label { color: #7f1d1d; font-weight: 800; }
.sms-stat-card.stat-card-failed .stat-val,
.sms-stat-card:nth-child(5) .stat-val { color: #991b1b; }
.sms-stat-card.stat-card-failed .stat-sub,
.sms-stat-card:nth-child(5) .stat-sub { color: #7f1d1d; font-weight: 600; }
.sms-stat-card.stat-card-failed:hover,
.sms-stat-card:nth-child(5):hover {
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.25);
}

/* 6. Skipped Decisions - Amber / Warm Orange Theme */
.sms-stat-card.stat-card-skipped,
.sms-stat-card:nth-child(6) {
  background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
  border: 1px solid #fbbf24;
  border-top: 4px solid #b45309;
}
.sms-stat-card.stat-card-skipped .stat-label,
.sms-stat-card:nth-child(6) .stat-label { color: #78350f; font-weight: 800; }
.sms-stat-card.stat-card-skipped .stat-val,
.sms-stat-card:nth-child(6) .stat-val { color: #92400e; }
.sms-stat-card.stat-card-skipped .stat-sub,
.sms-stat-card:nth-child(6) .stat-sub { color: #78350f; font-weight: 600; }
.sms-stat-card.stat-card-skipped:hover,
.sms-stat-card:nth-child(6):hover {
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.25);
}

.text-info { color: #2563eb !important; }
.text-indigo { color: #4338ca !important; }
.text-success { color: #16a34a !important; }
.text-danger { color: #dc2626 !important; }
.text-warning { color: #d97706 !important; }

/* Category Quick-Filter Pill Buttons */
.category-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.cat-pill {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cat-pill:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.cat-pill.active {
  background: var(--gold, #c9a227);
  color: #000000;
  border-color: #b08d1e;
  box-shadow: 0 2px 6px rgba(201, 162, 39, 0.3);
}

/* Multi-dimensional Filters Row */
.logs-advanced-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: #f8fafc;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  margin-bottom: 16px;
  align-items: flex-end;
}

.logs-advanced-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.logs-advanced-filters input,
.logs-advanced-filters select {
  height: 38px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-size: 13px;
}

.logs-advanced-filters #logUniversalSearch {
  height: 42px;
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.logs-advanced-filters #logUniversalSearch:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: none;
}

/* Category & Event Badges */
.badge-cat {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: inline-block;
  margin-right: 4px;
}

.badge-cat-authentication { background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe; }
.badge-cat-user_management { background: #f3e8ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.badge-cat-walkins { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.badge-cat-site_visits { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.badge-cat-plot_bookings { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.badge-cat-feedback { background: #ffedd5; color: #9a3412; border: 1px solid #fed7aa; }
.badge-cat-sales_agents { background: #ccfbf1; color: #115e59; border: 1px solid #99f6e4; }
.badge-cat-sms { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }
.badge-cat-email { background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; }
.badge-cat-api { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }
.badge-cat-security { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.badge-cat-errors { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a5; }

.badge-evt {
  background: #f1f5f9;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}

/* Status Badges */
.badge-status {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.status-accepted { background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd; }
.status-delivered { background: #ecfdf5; color: #047857; border: 1px solid #6ee7b7; font-weight: 900; }
.status-failed { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.status-skipped { background: #fef3c7; color: #b45309; border: 1px solid #fcd34d; }
.status-warning { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }

/* Severity Badges */
.badge-sev {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.sev-info { background: #f1f5f9; color: #475569; }
.sev-warning { background: #fef3c7; color: #92400e; }
.sev-error { background: #fee2e2; color: #991b1b; }
.sev-critical { background: #7f1d1d; color: #ffffff; }

/* Correlation Badges */
.log-tag-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.badge-subtle {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
  font-size: 9px;
  font-family: monospace;
  padding: 1px 5px;
  border-radius: 3px;
}

.badge-sms {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  font-size: 9px;
  font-family: monospace;
  padding: 1px 5px;
  border-radius: 3px;
}

.badge-site {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
}

.btn-inspect-log {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-inspect-log:hover {
  background: var(--gold, #c9a227);
  color: #000000;
  border-color: #b08d1e;
}

/* Trace Modal Styling */
.event-modal-card {
  max-width: 820px;
  width: 94%;
  max-height: calc(100vh - 48px);
  border-radius: 14px;
}

.event-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  background: #f8fafc;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  font-weight: 700;
}

.detail-val {
  font-size: 13px;
  color: #0f172a;
  word-break: break-word;
}

.font-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.font-medium {
  font-weight: 600;
}

.json-viewer {
  background: #0f172a;
  color: #e2e8f0;
  padding: 14px;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #334155;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Request Trace Timeline Waterfall */
.trace-timeline {
  display: flex;
  flex-direction: column;
  position: relative;
  margin-left: 12px;
  border-left: 2px solid #e2e8f0;
  padding-left: 16px;
  gap: 14px;
}

.trace-step {
  position: relative;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  transition: border-color 0.15s ease;
}

.trace-step-current {
  border-color: var(--gold, #c9a227);
  background: #fefce8;
  box-shadow: 0 2px 6px rgba(201, 162, 39, 0.15);
}

.trace-step-indicator {
  position: absolute;
  left: -23px;
  top: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: #94a3b8;
}

.trace-step-indicator.status-success,
.trace-step-indicator.status-delivered { background: #16a34a; }
.trace-step-indicator.status-accepted { background: #2563eb; }
.trace-step-indicator.status-failed { background: #dc2626; }
.trace-step-indicator.status-skipped { background: #d97706; }

.trace-step-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.trace-step-type {
  font-size: 12px;
  color: #0f172a;
}

.trace-step-time {
  font-size: 11px;
  color: #64748b;
  margin-left: auto;
}

.trace-step-desc {
  font-size: 12px;
  color: #475569;
}

/* Sales Agent Import & Duplicate Review Modal */
.import-modal-card {
  max-width: 860px;
  width: 95%;
  border-radius: 14px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.import-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  max-height: calc(85vh - 130px);
}

.import-summary-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.summary-chip {
  padding: 12px 14px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: transform 0.15s ease;
}

.summary-chip:hover {
  transform: translateY(-2px);
}

.summary-chip .chip-count {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
}

.summary-chip .chip-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
  font-weight: 600;
}

.chip-total {
  background: #f1f5f9;
  color: #334155;
}

.chip-new {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.chip-duplicate {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

.chip-invalid {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.import-strategy-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.strategy-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.strategy-radio {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #ffffff;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.strategy-radio:hover {
  border-color: #3b82f6;
  background: #f8fafc;
}

.strategy-radio input[type="radio"] {
  margin-top: 3px;
  cursor: pointer;
}

.strategy-text {
  font-size: 13px;
  color: #1e293b;
  line-height: 1.4;
}

.strategy-text p {
  margin: 4px 0 0 0;
  font-size: 12px;
  color: #64748b;
}

.strategy-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 6px;
}

.badge-skip {
  background: #dcfce7;
  color: #166534;
}

.badge-merge {
  background: #e0f2fe;
  color: #0369a1;
}

.import-table-wrap {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.import-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}

.import-table th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  z-index: 1;
  padding: 8px 10px;
  font-weight: 600;
  text-align: left;
  border-bottom: 1px solid #cbd5e1;
}

.import-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #f1f5f9;
}

.badge-match-reason {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #fef3c7;
  color: #92400e;
}


/* Business Activity & Notification Chips */
.chip-notif {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.3;
}

.chip-success {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.chip-info {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.chip-warning {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.chip-danger {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.chip-neutral {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.status-partial {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}

.status-processing {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.activity-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
}

.activity-summary-text {
  font-size: 13px;
  color: #1e293b;
  font-weight: 500;
  line-height: 1.4;
}

.trace-step-details-toggle {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-top: 4px;
  text-decoration: underline;
}

.trace-step-details-toggle:hover {
  color: #1d4ed8;
}

.trace-step-payload {
  margin-top: 8px;
  background: #0f172a;
  color: #e2e8f0;
  padding: 10px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  line-height: 1.4;
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid #334155;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ========================================================
   MODERN EVENT OPERATIONS & SCHEDULING UI
   ======================================================== */

.events-section-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.events-header-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 4px;
}

.events-header-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.events-header-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #c9a227 0%, #dfb638 100%);
  color: #111418;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(201, 162, 39, 0.25);
  flex-shrink: 0;
}

.events-header-text h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.3px;
}

.events-header-text p {
  margin: 3px 0 0 0;
  font-size: 13px;
  color: #64748b;
}

.events-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-schedule-event {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #c9a227 0%, #b8911f 100%) !important;
  color: #111418 !important;
  font-weight: 700 !important;
  padding: 10px 18px !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 14px rgba(201, 162, 39, 0.3) !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
  border: none !important;
}

.btn-schedule-event:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(201, 162, 39, 0.4) !important;
}

/* Event KPI Summary Cards */
.events-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.events-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.events-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.kpi-icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon-circle.total { background: #f1f5f9; color: #475569; }
.kpi-icon-circle.active { background: #ecfdf5; color: #059669; }
.kpi-icon-circle.visitors { background: #eff6ff; color: #2563eb; }
.kpi-icon-circle.expiring { background: #fef3c7; color: #d97706; }

.kpi-content {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  margin-top: 2px;
}

.kpi-sub {
  font-size: 11px;
  margin-top: 2px;
}

/* Card 1: Total Events - Soft Indigo / Violet */
.events-kpi-card.card-total {
  background: linear-gradient(145deg, #f5f3ff 0%, #ede9fe 100%);
  border: 1px solid #ddd6fe;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.06);
}
.events-kpi-card.card-total:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.15);
  border-color: #c4b5fd;
}
.events-kpi-card.card-total .kpi-icon-circle {
  background: #ffffff;
  color: #6366f1;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}
.events-kpi-card.card-total .kpi-label {
  color: #6366f1;
}
.events-kpi-card.card-total .kpi-value {
  color: #312e81;
}
.events-kpi-card.card-total .kpi-sub {
  color: #6d28d9;
  opacity: 0.85;
}

/* Card 2: Active Live Events - Mint / Emerald Green */
.events-kpi-card.card-active {
  background: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid #a7f3d0;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.07);
}
.events-kpi-card.card-active:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.16);
  border-color: #6ee7b7;
}
.events-kpi-card.card-active .kpi-icon-circle {
  background: #ffffff;
  color: #059669;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.2);
}
.events-kpi-card.card-active .kpi-label {
  color: #047857;
}
.events-kpi-card.card-active .kpi-value {
  color: #064e3b;
}
.events-kpi-card.card-active .kpi-sub {
  color: #065f46;
  opacity: 0.85;
}

/* Card 3: Event Attendance - Sky / Ocean Blue */
.events-kpi-card.card-visitors {
  background: linear-gradient(145deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.07);
}
.events-kpi-card.card-visitors:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.16);
  border-color: #93c5fd;
}
.events-kpi-card.card-visitors .kpi-icon-circle {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}
.events-kpi-card.card-visitors .kpi-label {
  color: #1d4ed8;
}
.events-kpi-card.card-visitors .kpi-value {
  color: #1e3a8a;
}
.events-kpi-card.card-visitors .kpi-sub {
  color: #1e40af;
  opacity: 0.85;
}

/* Card 4: Ending Today - Warm Amber / Sunset Gold */
.events-kpi-card.card-expiring {
  background: linear-gradient(145deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.07);
}
.events-kpi-card.card-expiring:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(217, 119, 6, 0.16);
  border-color: #fcd34d;
}
.events-kpi-card.card-expiring .kpi-icon-circle {
  background: #ffffff;
  color: #d97706;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.2);
}
.events-kpi-card.card-expiring .kpi-label {
  color: #b45309;
}
.events-kpi-card.card-expiring .kpi-value {
  color: #78350f;
}
.events-kpi-card.card-expiring .kpi-sub {
  color: #92400e;
  opacity: 0.85;
}

/* Event Filters Card */
.events-filter-wrapper {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.events-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.events-filter-title {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 6px;
}

.events-filter-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1fr 1fr 1fr;
  gap: 12px;
  align-items: flex-end;
}

@media (max-width: 900px) {
  .events-filter-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .events-filter-grid {
    grid-template-columns: 1fr;
  }
}

.events-filter-field label {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 5px;
  display: block;
}

.events-filter-field input,
.events-filter-field select {
  height: 38px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 13px;
  background: #f8fafc;
  transition: all 0.15s ease;
}

.events-filter-field input:focus,
.events-filter-field select:focus {
  background: #ffffff;
  border-color: #c9a227;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

/* Event Table Enhancements */
.events-table-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.events-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.events-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.events-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  font-size: 13px;
}

.events-table tr:hover td {
  background-color: #fbfdff;
}

.events-table tr:last-child td {
  border-bottom: none;
}

/* Badges & Tags */
.event-code-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  background: #0f172a;
  color: #f8fafc;
  padding: 3px 7px;
  border-radius: 6px;
  display: inline-block;
}

.event-name-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.event-name-primary {
  font-weight: 700;
  color: #0f172a;
  font-size: 14px;
}

.event-name-secondary {
  font-size: 11px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 4px;
}

.event-timeline-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}

.timeline-date-row {
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 5px;
}

.timeline-time-row {
  color: #64748b;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Status Badges */
.status-pill-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 9999px;
}

.status-pill-inactive {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 9999px;
}

.pulse-dot-green {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-green 1.8s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.event-attendance-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.event-attendance-badge:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  transform: translateY(-1px);
}

/* Action Buttons */
.event-action-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-action-sm {
  height: 30px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.btn-action-edit {
  background: #f8fafc;
  color: #334155;
  border-color: #cbd5e1;
}
.btn-action-edit:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.btn-action-toggle-active {
  background: #fff1f2;
  color: #be123c;
  border-color: #fecdd3;
}
.btn-action-toggle-active:hover {
  background: #ffe4e6;
}

.btn-action-toggle-inactive {
  background: #f0fdf4;
  color: #15803d;
  border-color: #bbf7d0;
}
.btn-action-toggle-inactive:hover {
  background: #dcfce7;
}

.btn-action-report {
  background: #f0f9ff;
  color: #0284c7;
  border-color: #bae6fd;
}
.btn-action-report:hover {
  background: #e0f2fe;
  color: #0369a1;
}

.btn-action-delete {
  background: #fff1f2;
  color: #e11d48;
  border-color: #fecdd3;
}
.btn-action-delete:hover {
  background: #e11d48;
  color: #ffffff;
  border-color: #e11d48;
}

/* ========================================================
   MODERN DIALOG / MODAL NOTICE STYLES
   ======================================================== */

.modern-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10000;
  animation: dialog-fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dialog-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modern-dialog-card {
  background: #ffffff;
  border-radius: 16px;
  max-width: 440px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  animation: dialog-scale-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dialog-scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.dialog-header-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.dialog-icon-bubble {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.dialog-icon-bubble.warning {
  background: #fef3c7;
  color: #d97706;
  box-shadow: 0 0 0 6px #fffbeb;
}

.dialog-icon-bubble.danger {
  background: #fee2e2;
  color: #dc2626;
  box-shadow: 0 0 0 6px #fef2f2;
}

.dialog-icon-bubble.info {
  background: #e0f2fe;
  color: #0284c7;
  box-shadow: 0 0 0 6px #f0f9ff;
}

.dialog-title-text {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 6px 0;
}

.dialog-description-text {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  margin: 0;
}

.dialog-callout-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 16px 0;
  font-size: 13px;
  color: #334155;
  line-height: 1.45;
}

.dialog-actions-cluster {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}

.dialog-btn-primary {
  width: 100%;
  height: 40px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.dialog-btn-primary.warning {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.25);
}
.dialog-btn-primary.warning:hover {
  background: #b45309;
}

.dialog-btn-primary.danger {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}
.dialog-btn-primary.danger:hover {
  background: #b91c1c;
}

.dialog-btn-secondary {
  width: 100%;
  height: 38px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid #cbd5e1;
  transition: all 0.15s ease;
}

.dialog-btn-secondary:hover {
  background: #e2e8f0;
  color: #1e293b;
}

/* ==========================================================================
   Event Poster Banner & Lightbox Styles
   ========================================================================== */

/* Active Event Banner across all Forms */
.active-event-poster-banner {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 45%, #f0f9ff 100%);
  border: 1.5px solid #86efac;
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.08), 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.active-event-poster-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
}

.event-poster-showcase-card {
  flex-shrink: 0;
  cursor: pointer;
}

.event-poster-frame {
  position: relative;
  width: 95px;
  min-height: 110px;
  max-height: 130px;
  background: #ffffff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.04);
  border: 1.5px solid #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.event-poster-frame:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
}

.event-poster-frame img {
  max-width: 100%;
  max-height: 108px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 4px;
  image-rendering: auto;
}

.event-poster-expand-hint {
  width: 100%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 8.5px;
  font-weight: 600;
  text-align: center;
  padding: 2px 1px;
  letter-spacing: 0.2px;
  transition: background 0.2s ease;
}

.event-poster-frame:hover .event-poster-expand-hint {
  background: #059669;
}

.btn-view-flyer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #065f46;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 4px rgba(6, 95, 70, 0.2);
  margin-top: 4px;
}

.btn-view-flyer:hover {
  background: #047857;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(6, 95, 70, 0.3);
}

.event-banner-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.event-banner-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.live-pulse-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #059669;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 9px;
  border-radius: 9999px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  animation: pulse-green 1.8s infinite;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(52, 211, 153, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
  }
}

.project-badge {
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #bae6fd;
  padding: 3px 9px;
  border-radius: 9999px;
}

.event-banner-title {
  font-size: 17px;
  font-weight: 700;
  color: #064e3b;
  margin: 2px 0 0 0;
  line-height: 1.3;
}

.event-banner-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #047857;
  font-weight: 500;
  flex-wrap: wrap;
}

.event-banner-desc {
  font-size: 12.5px;
  color: #065f46;
  margin: 2px 0 0 0;
  line-height: 1.4;
  opacity: 0.92;
}

/* Event Poster Dropzone in Admin Modal */
.event-poster-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  background: #f8fafc;
  transition: all 0.2s ease;
  cursor: pointer;
}

.event-poster-dropzone:hover {
  border-color: #3b82f6;
  background: #f1f5f9;
}

.event-poster-dropzone.dragover {
  border-color: #2563eb;
  background: #eff6ff;
}

.event-poster-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  cursor: pointer;
}

.event-poster-preview-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 6px;
}

.event-poster-thumb-wrapper {
  position: relative;
  width: 200px;
  height: 230px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  margin: 0 auto;
}

.event-poster-thumb-wrapper img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.event-poster-thumb-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Mini thumbnail in Dashboard Table */
.event-poster-mini-thumb {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.event-poster-mini-thumb:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Fullscreen Lightbox Modal */
.lightbox-overlay {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
  box-sizing: border-box;
}

.lightbox-container {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: lightbox-fadein 0.2s ease-out;
}

@keyframes lightbox-fadein {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox-image-wrap {
  position: relative;
  max-width: 100%;
  max-height: 80vh;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image-wrap img {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.lightbox-caption {
  color: #f8fafc;
  font-size: 14px;
  font-weight: 600;
  margin-top: 10px;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.lightbox-close-btn {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  color: #0f172a;
  border: none;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: transform 0.15s ease, background 0.15s ease;
  z-index: 10;
}

.lightbox-close-btn:hover {
  background: #f1f5f9;
  transform: scale(1.1);
}

@media (max-width: 640px) {
  .active-event-poster-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px;
  }
  .event-poster-showcase-card {
    width: 100%;
    display: flex;
    justify-content: center;
  }
  .event-poster-frame {
    width: 95px;
    max-width: 120px;
    min-height: 110px;
    max-height: 130px;
  }
  .event-banner-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }
}

/* Site Visit Sub-Navigation Bar */
.sv-subnav-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid #e2e8f0;
}

.sv-subnav-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  line-height: 1.2;
}

.sv-subnav-pill:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.7);
}

.sv-subnav-pill.active {
  background: #ffffff;
  color: #0b2a4a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.sv-pending-count-badge {
  background: #d97706;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 9999px;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .sv-subnav-bar {
    width: 100%;
    display: flex;
  }
  .sv-subnav-pill {
    flex: 1;
    justify-content: center;
    padding: 8px 10px;
    font-size: 12px;
  }
}

