* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f6f7fb;
  color: #1d2433;
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: 500;
  font-style: normal;
  font-size: 15px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 20;
}

.app-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  background: #f8fafc;
  color: #1e293b;
  border-right: 1px solid #e2e8f0;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar h2 {
  font-size: 18px;
  margin: 0;
}

.sidebar-header {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-divider {
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 12px;
}

.stripe-balance-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 12px;
}

.stripe-balance-label {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stripe-balance-value {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}

.stripe-balance-row {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stripe-pending-inline {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.stripe-pending-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #64748b;
  line-height: 1.2;
}

.stripe-pending-item .material-symbols-outlined {
  font-size: 13px;
  line-height: 1;
}

.stripe-pending-item.inbound {
  color: #0369a1;
}

.stripe-pending-item.outbound {
  color: #b45309;
}

.stripe-open-btn {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-color: #cbd5e1;
  background: #ffffff;
  color: #1f2937;
  text-decoration: none;
}

.stripe-open-btn:hover {
  background: #f8fafc;
}

.stripe-secondary-balance {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.sidebar-dashboard-btn {
  width: 100%;
  margin-bottom: 8px;
}

.sidebar-add-btn {
  width: 100%;
  margin-bottom: 6px;
}

.creator-sort-menu-wrap {
  position: relative;
  width: 100%;
  margin-bottom: 8px;
}

.sidebar-sort-btn {
  width: 100%;
  min-width: 0;
  font-size: 11px;
  line-height: 1.1;
  border: 0px solid #fff!important;
  padding: 0px!important;
  background-color: transparent!important;
}

.sidebar-sort-btn:focus,
.sidebar-sort-btn:focus-visible {
  outline: none;
  box-shadow: none;
}

.creator-sort-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  width: 100%;
  padding: 4px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  z-index: 30;
}

.creator-sort-option {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #334155;
  text-align: left;
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
}

.creator-sort-option:hover {
  background: #f1f5f9;
}

.creator-sort-option.is-active {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

#creator-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

#creator-list li {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid transparent;
  border-radius: 8px;
  margin-bottom: 10px;
  padding: 10px;
  cursor: pointer;
}

.creator-list-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#creator-list li.active {
  border-color: #93c5fd;
  background: #eff6ff;
}

#creator-list .platforms {
  color: #64748b;
  font-size: 12px;
  margin-top: 6px;
}

.creator-status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
}

.creator-status-pill.status-needs_review {
  color: #9a3412;
  background: #ffedd5;
  border-color: #fed7aa;
}

.creator-status-pill.status-ready_to_pay {
  color: #166534;
  background: #dcfce7;
  border-color: #bbf7d0;
}

.creator-status-pill.status-archived {
  color: #334155;
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.main-content {
  padding: 28px;
  height: 100vh;
  overflow-y: auto;
}

.main-content h1 {
  margin-top: 0;
}

.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-mobile-toggle,
.sidebar-mobile-close {
  display: none !important;
}

.sidebar-mobile-toggle-floating {
  position: fixed;
  left: 14px;
  top: 14px;
  z-index: 55;
  border-color: #cbd5e1;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 45;
}

.stats-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.dashboard-calendar-wrap {
  margin-top: 18px;
}

.dashboard-calendar-grid {
  display: grid;
  gap: 8px;
}

.creator-calendar-grid {
  margin-bottom: 16px;
}

.dashboard-calendar-actions {
  margin-top: 10px;
}

#dashboard-payout-list .payout-card {
  margin-bottom: 10px;
}

.calendar-week-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 6px;
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-week-label {
  font-size: 11px;
  color: #64748b;
  display: flex;
  align-items: center;
}

.calendar-day-cell {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  min-height: 66px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calendar-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 11px;
  color: #64748b;
}

.calendar-day-name {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calendar-day-number {
  font-weight: 600;
  color: #334155;
}

.calendar-icon-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 16px;
}

.calendar-icon {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
}

.calendar-icon.content-tiktok {
  background: #111827;
}

.calendar-icon.content-instagram {
  background: #db2777;
}

.calendar-icon.content-other {
  background: #64748b;
}

.calendar-icon.payout {
  background: #2563eb;
}

.calendar-icon.more {
  background: #94a3b8;
}

.calendar-icon.content-avatar {
  width: 12px;
  height: 16px;
  border-radius: 4px;
  font-size: 8px;
  overflow: hidden;
  background: #475569;
}

.calendar-icon.content-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.calendar-event-btn {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  line-height: 0;
}

.calendar-payout-row {
  margin-top: 1px;
}

@media (max-width: 980px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(84vw, 320px);
    max-width: 320px;
    z-index: 60;
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.25);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }

  .sidebar-mobile-toggle,
  .sidebar-mobile-close {
    display: inline-flex !important;
  }

  #overall-stats-header .sidebar-mobile-toggle {
    display: none !important;
  }

  .sidebar-header {
    justify-content: space-between;
  }

  .main-content {
    height: auto;
    min-height: 100vh;
    padding: 16px;
  }

  .calendar-week-row {
    grid-template-columns: 1fr;
  }

  .calendar-week-label {
    margin-bottom: -2px;
  }

  .calendar-week-row .calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
  }
}

.stat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
}

.stat-card h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: #6b7280;
}

.stat-card p {
  margin: 0;
  font-size: 28px;
  font-weight: bold;
}

.btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}

.btn-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-icon-only {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.action-icon {
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
}

.btn-primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.btn-danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

.btn-social {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  border-radius: 999px;
  border: none;
  color: #fff;
  font-weight: 600;
}

.btn-social:hover {
  opacity: 0.92;
}

.btn-social-tiktok {
  background: linear-gradient(135deg, #111827 0%, #ec4899 100%);
}

.btn-social-instagram {
  background: linear-gradient(135deg, #f97316 0%, #db2777 55%, #7c3aed 100%);
}

.social-icon {
  width: 14px;
  height: 14px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.2;
}

.creator-detail {
  margin-top: 28px;
}

.creator-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.creator-identity-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 14px;
  min-width: 320px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.creator-avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
}

.creator-avatar-sm {
  width: 24px;
  height: 24px;
  font-size: 12px;
  border-color: #475569;
  background: #334155;
  color: #e2e8f0;
}

.creator-avatar-fallback {
  line-height: 1;
}

.creator-identity-card h2 {
  margin: 0 0 8px;
}

.identity-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.creator-status-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  padding: 3px;
}

.creator-status-option {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  cursor: pointer;
}

.creator-status-option.is-active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.identity-line {
  margin-top: 8px;
  font-size: 13px;
  color: #475569;
}

.identity-chip-row {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.identity-icon-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 4px 10px;
}

.identity-icon-chip.is-connected {
  color: #166534;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.identity-icon-chip svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.identity-icon-chip .material-symbols-outlined {
  font-size: 15px;
}

.trackster-line a {
  font-weight: 600;
  color: #2563eb;
}

.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-bottom: 24px;
}

.pricing-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
}

.stat-value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pricing-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
}

.pricing-list li:last-child {
  border-bottom: none;
}

.pricing-key {
  color: #64748b;
}

.content-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.content-list li {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 10px;
  padding: 12px;
}

.weekly-card {
  padding: 14px;
}

.weekly-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.weekly-range,
.weekly-bundle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.weekly-range svg,
.weekly-bundle svg,
.weekly-range .material-symbols-outlined,
.weekly-bundle .material-symbols-outlined {
  width: 14px;
  height: 14px;
  color: #64748b;
  fill: #64748b;
  font-size: 14px;
  line-height: 1;
}

.weekly-bundle {
  font-size: 12px;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 4px 8px;
}

.weekly-breakdown {
  margin-top: 8px;
  color: #475569;
  font-size: 13px;
}

.weekly-money-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.money-chip {
  font-size: 12px;
  border-radius: 999px;
  padding: 4px 8px;
  border: 1px solid;
}

.money-chip.due {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.money-chip.paid {
  color: #166534;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.money-chip.remaining {
  color: #92400e;
  background: #fffbeb;
  border-color: #fde68a;
}

.weekly-status {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.weekly-status.status-good {
  color: #166534;
}

.weekly-status.status-good .status-dot {
  background: #16a34a;
}

.weekly-status.status-warn {
  color: #b45309;
}

.weekly-status.status-warn .status-dot {
  background: #f59e0b;
}

.content-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.content-header-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.content-header-title strong {
  overflow-wrap: anywhere;
}

.content-item-header > div:last-child {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.content-meta-row {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.platform-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid;
}

.platform-summary-chip.tiktok {
  color: #be185d;
  background: #fdf2f8;
  border-color: #fbcfe8;
}

.platform-summary-chip.instagram {
  color: #7c2d92;
  background: #faf5ff;
  border-color: #e9d5ff;
}

.platform-summary-chip.other {
  color: #334155;
  background: #f8fafc;
  border-color: #cbd5e1;
}

.platform-summary-chip svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.platform-summary-chip .material-symbols-outlined {
  font-size: 14px;
  line-height: 1;
}

.engagement-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.engagement-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 4px 8px;
}

.engagement-chip svg,
.engagement-chip .material-symbols-outlined {
  width: 13px;
  height: 13px;
  fill: #64748b;
  color: #64748b;
  font-size: 13px;
  line-height: 1;
}

.content-card {
  padding: 14px;
}

.content-card-layout {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  column-gap: 12px;
  align-items: flex-start;
}

.content-card-layout.no-image {
  grid-template-columns: 1fr;
}

.content-media-col {
  width: 112px;
}

.content-info-col {
  min-width: 0;
}

.content-info-col > a {
  display: inline-block;
  margin-top: 10px;
  word-break: break-word;
}

.payout-card {
  padding: 14px;
}

.payout-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.payout-chip-row {
  margin-top: 10px;
}

.payout-proof-row {
  margin-top: 10px;
  color: #475569;
  font-size: 13px;
}

.api-error {
  color: #b91c1c;
  font-size: 12px;
  margin-top: 4px;
}

.content-thumb {
  width: 100px;
  height: 200px;
  object-fit: cover;
  aspect-ratio: 9 / 16;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

@media (max-width: 860px) {
  .creator-detail-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .creator-identity-card {
    width: 100%;
    min-width: 0;
  }

  .detail-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .detail-actions .btn,
  .detail-actions .btn-social {
    width: 100%;
    justify-content: center;
  }

  .detail-actions .btn-icon-only {
    height: auto;
    min-height: 42px;
    padding: 10px 12px;
  }

  .content-card-layout {
    display: block;
  }

  .content-media-col {
    width: auto;
    margin-bottom: 10px;
  }

  .content-thumb {
    width: 100%;
    max-height: 360px;
    height: auto;
  }
}

.hidden {
  display: none;
}

dialog {
  border: none;
  border-radius: 10px;
  width: min(560px, 95vw);
  padding: 0;
}

dialog form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
}

dialog label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

dialog input,
dialog textarea,
dialog select {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px;
  font: inherit;
}

.file-dropzone {
  border: 1.5px dashed #93c5fd;
  background: #eff6ff;
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  cursor: pointer;
}

.file-dropzone.is-dragover {
  border-color: #2563eb;
  background: #dbeafe;
}

.file-dropzone-title {
  font-weight: 600;
  color: #1e3a8a;
}

.file-dropzone-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: #475569;
}

.file-dropzone-selected {
  margin-top: 8px;
  font-size: 12px;
  color: #0f172a;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.portal-auth-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #dbe7ff;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.08);
  margin-bottom: 16px;
}

.portal-auth-head h2 {
  margin: 6px 0 6px;
  font-size: 24px;
  color: #0f172a;
}

.portal-auth-head p {
  margin: 0;
  font-size: 14px;
  color: #475569;
}

.portal-auth-kicker {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1d4ed8;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 4px 8px;
}

.portal-auth-grid {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(280px, 1fr) auto;
  align-items: end;
}

.portal-auth-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #475569;
  font-weight: 600;
}

.portal-auth-label input {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #ffffff;
}

.portal-auth-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.portal-auth-divider {
  margin-top: 12px;
  border-top: 1px solid #dbe7ff;
}

.portal-auth-message {
  margin-top: 4px;
  color: #b91c1c;
  font-size: 13px;
}

@media (max-width: 760px) {
  .portal-auth-grid {
    grid-template-columns: 1fr;
  }
}
