/* Affiliate Link Hub – pretty dashboard CSS */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  background: radial-gradient(circle at top left, #eef2ff 0, #f4f5fb 40%, #f9fafb 100%);
  color: #0f172a;
}

.shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px;
}

/* HEADER */

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.top-header h1 {
  font-size: 24px;
  font-weight: 700;
}

.top-header p {
  font-size: 14px;
  color: #6b7280;
  margin-top: 2px;
}

.badge-version {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.08);
  color: #4f46e5;
  border: 1px solid rgba(79, 70, 229, 0.18);
}

/* TOP FILTER BAR */

.filter-bar {
  background: #ffffff;
  border-radius: 18px;
  padding: 16px 18px;
  margin-bottom: 18px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.filter-row-1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.filter-label {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 4px;
  display: inline-block;
}

.chip-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip-btn {
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip-outline {
  background: #f3f4ff;
  color: #4f46e5;
}

.chip-outline.active {
  background: #4f46e5;
  color: #ffffff;
}

.chip-outline:hover {
  background: #e0e7ff;
}

.filter-row-2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 6px;
}

.scope-selector {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.scope-pill {
  border-radius: 16px;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  min-width: 180px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.scope-pill .scope-title {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  display: block;
}

.scope-pill .scope-sub {
  font-size: 11px;
  color: #6b7280;
}

.scope-pill.active {
  border-color: transparent;
  background: linear-gradient(90deg, #4f46e5, #6366f1);
  color: #ffffff;
}

.scope-pill.active .scope-title,
.scope-pill.active .scope-sub {
  color: #ffffff;
}

.subtab-toggle {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: #f3f4ff;
}

.subtab-btn {
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  border: none;
  cursor: pointer;
  color: #4f46e5;
  background: transparent;
}

.subtab-btn.active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.15);
}

/* MAIN LAYOUT */

.main-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
}

/* TAB BAR LEFT */

.tab-bar {
  background: #ffffff;
  border-radius: 18px;
  padding: 10px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 16px;
  align-self: flex-start;
}

.tab-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #4b5563;
  background: transparent;
  transition: all 0.15s ease;
}

.tab-button .tab-icon {
  font-size: 16px;
}

.tab-button:hover {
  background: #f3f4ff;
}

.tab-button.active {
  background: radial-gradient(circle at left, #4f46e5, #6366f1);
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.35);
}

/* CONTENT AREA */

.tab-container {
  display: block;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* PANEL / CARD CONTAINER */

.panel {
  background: #ffffff;
  border-radius: 18px;
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.panel h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
}

.hint {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 10px;
}

.small-hint {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 4px;
}

/* FORM ELEMENTS */

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  color: #374151;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  background: #f9fafb;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #4f46e5;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.15);
}

textarea {
  resize: vertical;
}

.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #374151;
}

.buttons-row {
  justify-content: flex-start;
  margin-top: 4px;
}

/* BUTTONS */

button {
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
}

button.primary {
  background: linear-gradient(90deg, #4f46e5, #6366f1);
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.35);
}

button.primary:hover {
  filter: brightness(1.02);
}

button.secondary {
  background: #e5e7eb;
  color: #111827;
}

button.secondary:hover {
  background: #d1d5db;
}

button.ghost {
  background: transparent;
  color: #4b5563;
}

button.ghost:hover {
  background: #f3f4ff;
  color: #111827;
}

button.danger {
  background: #ef4444;
  color: #ffffff;
}

button.danger:hover {
  background: #dc2626;
}

button:active {
  transform: translateY(1px);
}

.btn-small {
  padding: 4px 10px;
  font-size: 12px;
}

/* STAT CARDS */

.cards-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  border-radius: 18px;
  padding: 14px 16px;
  color: #ffffff;
  box-shadow: 0 16px 35px rgba(15, 23, 42, 0.18);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 80px;
  height: 80px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.stat-label {
  font-size: 13px;
  opacity: 0.9;
}

.stat-value {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 700;
}

.stat-sub {
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.9;
}

.stat-blue {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
}

.stat-purple {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

/* OVERVIEW FILTERS */

.overview-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
}

.overview-filter-block {
  flex: 1;
  min-width: 260px;
}

.overview-label {
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 6px;
}

.overview-custom-range {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.range-separator {
  font-size: 13px;
  color: #6b7280;
}

.pill-toggle {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: #f3f4ff;
}

.pill-btn {
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  border: none;
  cursor: pointer;
  background: transparent;
  color: #4f46e5;
}

.pill-btn.active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.15);
}

.overview-channel-hint {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 4px;
}

/* TABLES */

.table-wrapper {
  margin-top: 8px;
  max-height: 340px;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
}

.small-table-wrapper {
  max-height: 240px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead {
  background: #f9fafb;
  position: sticky;
  top: 0;
  z-index: 1;
}

th, td {
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
}

th {
  font-weight: 600;
  text-align: left;
  color: #374151;
}

td {
  color: #4b5563;
}

.filter-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.filter-row input {
  flex: 1;
}

.bulk-actions,
.report-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.summary-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.summary-item {
  font-size: 14px;
}

.summary-label {
  color: #6b7280;
  margin-right: 4px;
}

.summary-value {
  font-weight: 600;
}

/* RESPONSIVE */

@media (max-width: 1100px) {
  .main-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .tab-bar {
    flex-direction: row;
    flex-wrap: wrap;
    border-radius: 18px;
    position: static;
  }

  .tab-button {
    flex: 1 1 45%;
  }
}

@media (max-width: 768px) {
  .shell {
    padding: 12px;
  }

  .filter-bar {
    padding: 12px;
  }

  .cards-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .overview-filter-row {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .cards-row {
    grid-template-columns: minmax(0, 1fr);
  }
}



.hidden {
  display: none !important;
}

/* Login screen */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 18px;
  padding: 24px 22px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

.login-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #111827;
}

.login-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 18px;
}

.login-form-group {
  margin-bottom: 14px;
}

.login-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  color: #374151;
}

.login-form-group input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  padding: 8px 12px;
  font-size: 14px;
}

.login-form-group input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.1);
}

.login-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 10px;
}

.login-btn {
  border-radius: 999px;
  padding: 8px 18px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
}

.login-api-url {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 8px;
}

.login-error {
  font-size: 12px;
  color: #dc2626;
  margin-top: 6px;
}
