/* ==========================================================================
   AlphaCommerce Cart Recovery — Premium SaaS UI
   Scoped under .accr-admin
   ========================================================================== */

.accr-admin {
  /* Design Tokens - Modern Indigo & Slate */
  --accr-primary: #6366F1;
  --accr-primary-hover: #4F46E5;
  --accr-primary-soft: rgba(99, 102, 241, 0.08);

  --accr-bg-app: #f4f7fa;
  --accr-bg-surface: #ffffff;
  --accr-bg-glass: rgba(255, 255, 255, 0.7);
  --accr-bg-subtle: #f8fafc;

  --accr-text-main: #0f172a;
  --accr-text-secondary: #475569;
  --accr-text-muted: #94a3b8;

  --accr-border: #e2e8f0;
  --accr-border-subtle: rgba(226, 232, 240, 0.6);

  --accr-success: #10b981;
  --accr-success-soft: #ecfdf5;
  --accr-danger: #ef4444;
  --accr-danger-soft: #fef2f2;
  --accr-warning: #f59e0b;
  --accr-warning-soft: #fffbeb;

  --accr-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --accr-shadow-lg:
    0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);

  --accr-radius: 12px;
  --accr-radius-sm: 8px;

  font-family: "Figtree", system-ui, sans-serif;
  color: var(--accr-text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.accr-admin * {
  box-sizing: border-box;
}

/* -------------------------------------------------------------------------- */
/* Layout Structure                                                           */
/* -------------------------------------------------------------------------- */

.accr-wrap {
  max-width: 1300px;
  margin: 32px auto;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  padding: 0 20px;
}

/* Sidebar */
.accr-sidebar {
  position: sticky;
  top: 60px;
  height: fit-content;
}

.accr-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.accr-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--accr-radius-sm);
  color: var(--accr-text-secondary);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 14px;
}

.accr-nav-item:hover {
  background: var(--accr-primary-soft);
  color: var(--accr-primary);
}

.accr-nav-item.is-active {
  background: var(--accr-primary);
  color: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.2);
}

.accr-nav-item svg {
  width: 20px;
  height: 20px;
}

/* -------------------------------------------------------------------------- */
/* Dashboard Components                                                       */
/* -------------------------------------------------------------------------- */

/* Header Area */
.accr-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 32px;
}

.accr-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.accr-date-range {
  font-size: 13px;
  color: var(--accr-text-muted);
  background: #ffffff;
  padding: 8px 16px;
  border-radius: 99px;
  border: 1px solid var(--accr-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Metric Bar - 6 Columns */
.accr-metrics-bar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.accr-metric-card {
  background: var(--accr-bg-surface);
  padding: 24px;
  border-radius: var(--accr-radius);
  border: 1px solid var(--accr-border-subtle);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Softer shadow */
  transition: all 0.2s ease;
}

.accr-metric-card:hover {
  transform: translateY(-2px);
}

.accr-metric-label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8; /* Lighter label */
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  display: block;
}
.accr-metric-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--accr-text-main);
  line-height: 1;
  display: flex;
  align-items: baseline;
}

.accr-currency {
  font-size: 0.6em; /* Responsive to parent size (24px cards or 14px table) */
  font-weight: 500;
  color: #94a3b8 !important; /* Consistent slate-400 gray */
  margin-right: 4px;
  vertical-align: 0.25em; /* Raised like a superscript for premium feel */
  line-height: 0;
  display: inline-block;
  opacity: 0.8;
}

/* Ensure currency doesn't inherit success colors in cards */
.accr-metric-value.is-success .accr-currency {
  color: #94a3b8 !important;
}

.accr-metric-value.is-success {
  color: var(--accr-success);
}

/* Main Chart Area */
.accr-chart-card {
  background: var(--accr-bg-surface);
  border-radius: var(--accr-radius);
  border: 1px solid var(--accr-border-subtle);
  box-shadow: var(--accr-shadow);
  padding: 32px;
  margin-bottom: 32px;
  min-height: 300px;
  position: relative;
}

.accr-chart-legend {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
}

.accr-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accr-text-secondary);
}

.accr-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* SVG Visualization */
.accr-viz {
  width: 100%;
  height: 200px;
  overflow: visible;
}

.accr-viz path {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Tables & Activity */
.accr-section-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 20px 0;
}

.accr-table-card {
  background: var(--accr-bg-surface);
  border-radius: var(--accr-radius);
  border: 1px solid var(--accr-border-subtle);
  box-shadow: var(--accr-shadow);
  overflow: hidden;
}

.accr-table {
  width: 100%;
  border-collapse: collapse;
}

.accr-table th {
  background: #f8fafc;
  padding: 16px 24px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--accr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--accr-border);
}

.accr-table td {
  padding: 18px 24px;
  border-bottom: 1px solid var(--accr-border-subtle);
  font-size: 14px;
}

.accr-table tr:hover td {
  background: #fcfdfe;
}

/* Avatars & Email */
.accr-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.accr-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accr-primary-soft);
  color: var(--accr-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
}

/* Status Pills */
.accr-pill {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
}

.accr-pill.status-captured {
  background: #eef2ff;
  color: #4f46e5;
} /* Monitoring: Indigo */
.accr-pill.status-abandoned {
  background: #fffbeb;
  color: #d97706;
} /* Abandoned: Amber */
.accr-pill.status-sent {
  background: #faf5ff;
  color: #9333ea;
} /* Recovering: Purple */
.accr-pill.status-recovered {
  background: #ecfdf5;
  color: #059669;
} /* Recovered: Green */
.accr-pill.status-expired {
  background: #f1f5f9;
  color: #64748b;
} /* Expired: Muted Slate */

/* System Pulse */
.accr-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--accr-text-secondary);
}

.accr-pulse {
  width: 8px;
  height: 8px;
  background: var(--accr-success);
  border-radius: 50%;
  position: relative;
}

.accr-pulse::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background: var(--accr-success);
  animation: accr-pulse 2s infinite;
}

@keyframes accr-pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(3);
    opacity: 0;
  }
}

/* Toggle Switch */
.accr-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.accr-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.accr-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.4s;
  border-radius: 24px;
}

.accr-toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.accr-toggle input:checked + .accr-toggle-slider {
  background-color: var(--accr-primary);
}

.accr-toggle input:focus + .accr-toggle-slider {
  box-shadow: 0 0 1px var(--accr-primary);
}

.accr-toggle input:checked + .accr-toggle-slider:before {
  transform: translateX(20px);
}

/* Support Center */
.accr-support-center {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid var(--accr-border-subtle);
  width: 100%;
}

.accr-support-card-custom {
  background: var(--accr-bg-surface);
  border: 1px solid var(--accr-border-subtle);
  border-radius: var(--accr-radius);
  padding: 40px;
  box-shadow: var(--accr-shadow);
  max-width: 650px;
}

.accr-support-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.accr-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.accr-form-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--accr-text-main);
  display: block;
}

.accr-form-control {
  width: 100% !important;
  max-width: 100% !important;
  padding: 12px 16px !important;
  border: 1px solid var(--accr-border) !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  background: #f8fafc !important;
  transition: all 0.2s ease !important;
  outline: none !important;
  font-family: inherit !important;
  height: auto !important;
  box-shadow: none !important;
}

.accr-form-control:focus {
  border-color: var(--accr-primary) !important;
  background: white !important;
  box-shadow: 0 0 0 3px var(--accr-primary-soft) !important;
}

select.accr-form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 16px !important;
  padding-right: 40px !important;
}

.accr-support-btn {
  background: var(--accr-primary) !important;
  color: white !important;
  font-weight: 600 !important;
  font-size: 15px !important;
  padding: 14px 28px !important;
  border-radius: 8px !important;
  text-align: center !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border: none !important;
  cursor: pointer !important;
  box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.2) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: fit-content !important;
}

.accr-support-btn:hover {
  background: var(--accr-primary-hover) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3) !important;
}

.accr-support-btn:active {
  transform: translateY(0) !important;
}
