/* ── Torgify Partner Portal CSS Stylesheet ── */

:root {
  --primary-glow: rgba(255, 107, 0, 0.15);
  --purple-glow: rgba(147, 51, 234, 0.15);
  --teal-glow: rgba(20, 184, 166, 0.15);
  --sky-glow: rgba(14, 165, 233, 0.15);

  --purple-brand: #9333ea;
  --teal-brand: #14b8a6;
  --sky-brand: #0ea5e9;
}

body.partner-portal {
  background-color: #080b11;
  color: #f1f5f9;
  font-family: 'Outfit', sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* ── Blur Blobs ── */
.blur-blob {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.15;
  pointer-events: none;
  animation: float 25s infinite alternate;
}
.blob-purple {
  background: var(--purple-brand);
  top: -100px;
  right: -50px;
}
.blob-orange {
  background: var(--primary);
  bottom: -150px;
  left: -50px;
  animation-delay: -10s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 60px) scale(1.1); }
  100% { transform: translate(-20px, -40px) scale(0.9); }
}

/* ── Layout ── */
.portal-container {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.portal-sidebar {
  width: 280px;
  background: rgba(17, 24, 39, 0.55);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  box-sizing: border-box;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 35px;
  padding-left: 6px;
}
.brand-logo {
  height: 38px;
  width: auto;
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-text .t-main {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-text .t-sub {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 1px;
}

.partner-profile-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  margin-bottom: 30px;
}
.profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, #f97316 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.profile-info h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}
.profile-info p {
  margin: 2px 0 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
  word-break: break-all;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  padding: 12px 16px;
  color: #94a3b8;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}
.menu-item i {
  font-size: 1.1rem;
  transition: transform 0.25s;
}
.menu-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
}
.menu-item:hover i {
  transform: translateX(2px);
}
.menu-item.active {
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.1) 0%, rgba(249, 115, 22, 0.05) 100%);
  color: var(--primary);
  border: 1px solid rgba(255, 107, 0, 0.18);
  box-shadow: inset 0 0 12px rgba(255, 107, 0, 0.05);
}

.btn-logout {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
  color: #f87171;
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-logout:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.1);
}

/* ── Content ── */
.portal-content {
  margin-left: 280px;
  flex-grow: 1;
  padding: 40px;
  box-sizing: border-box;
  max-width: calc(100vw - 280px);
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 35px;
}
.header-title h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.header-title p {
  margin: 6px 0 0 0;
  font-size: 0.9rem;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #34d399;
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 700;
}
.status-indicator.online .pulse {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { transform: scale(0.9); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.4; }
  100% { transform: scale(0.9); opacity: 1; }
}

/* ── Tab Management ── */
.tab-content {
  display: none;
  animation: fadeIn 0.4s ease-out;
}
.tab-content.active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Glass Cards ── */
.glass-card {
  background: rgba(22, 28, 45, 0.45);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
  margin-bottom: 24px;
  transition: border-color 0.25s, transform 0.25s;
}
.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.08);
}

.card-header {
  margin-bottom: 20px;
}
.card-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}
.card-header p {
  margin: 4px 0 0 0;
  font-size: 0.85rem;
}

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}
.icon-purple {
  background: rgba(147, 51, 234, 0.12);
  color: var(--purple-brand);
  border: 1px solid rgba(147, 51, 234, 0.25);
  box-shadow: 0 0 15px var(--purple-glow);
}
.icon-orange {
  background: rgba(255, 107, 0, 0.12);
  color: var(--primary);
  border: 1px solid rgba(255, 107, 0, 0.25);
  box-shadow: 0 0 15px var(--primary-glow);
}
.icon-teal {
  background: rgba(20, 184, 166, 0.12);
  color: var(--teal-brand);
  border: 1px solid rgba(20, 184, 166, 0.25);
  box-shadow: 0 0 15px var(--teal-glow);
}
.icon-sky {
  background: rgba(14, 165, 233, 0.12);
  color: var(--sky-brand);
  border: 1px solid rgba(14, 165, 233, 0.25);
  box-shadow: 0 0 15px var(--sky-glow);
}

.stat-details h3 {
  margin: 0;
  font-size: 0.88rem;
  color: #94a3b8;
  font-weight: 600;
}
.stat-val {
  margin: 8px 0 0 0;
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}
.stat-footer {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: auto;
}
.trend.up {
  color: #10b981;
  font-weight: 600;
}

/* ── Grids ── */
.portal-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}
.grid-col-12 { grid-column: span 12; }
.grid-col-8 { grid-column: span 8; }
.grid-col-7 { grid-column: span 7; }
.grid-col-6 { grid-column: span 6; }
.grid-col-5 { grid-column: span 5; }
.grid-col-4 { grid-column: span 4; }

/* ── Connect Guide ── */
.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.guide-step {
  display: flex;
  gap: 16px;
}
.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 107, 0, 0.12);
  border: 1px solid rgba(255, 107, 0, 0.3);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.step-info h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}
.step-info p {
  margin: 4px 0 0 0;
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.4;
}

/* ── Health List ── */
.health-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.health-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}
.h-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e2e8f0;
}
.h-status {
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Premium Tables ── */
.flex-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.inline-control {
  max-width: 240px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}
.premium-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.premium-table th {
  padding: 14px 20px;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  letter-spacing: 0.5px;
}
.premium-table td {
  padding: 16px 20px;
  font-size: 0.88rem;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.premium-table tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

.seller-profile-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.seller-avatar {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary);
  font-size: 1.1rem;
}
.seller-meta h4 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}
.seller-meta p {
  margin: 2px 0 0 0;
  font-size: 0.78rem;
  color: #94a3b8;
}

.permission-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.perm-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-blue {
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.2);
  color: var(--sky-brand);
}
.badge-purple {
  background: rgba(147, 51, 234, 0.1);
  border: 1px solid rgba(147, 51, 234, 0.2);
  color: var(--purple-brand);
}

/* ── Form Controls ── */
.form-group {
  margin-bottom: 20px;
}
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 8px;
}
.form-control {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 16px;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
  transition: all 0.2s;
}
.form-control:focus {
  border-color: var(--primary);
  outline: none;
  background: rgba(15, 23, 42, 0.8);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-readonly {
  font-family: monospace;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.02);
}

.input-copy-group {
  display: flex;
  gap: 10px;
}
.btn-icon {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

/* ── API Credentials Cards ── */
.large-code {
  font-size: 2.2rem;
  font-weight: 900;
  font-family: monospace;
  color: var(--primary);
  letter-spacing: 4px;
  background: rgba(255, 107, 0, 0.08);
  padding: 12px 24px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 107, 0, 0.3);
  display: inline-block;
  text-shadow: 0 0 15px var(--primary-glow);
}

.info-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.18);
  color: #f87171;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* ── Sandbox ── */
.console-box {
  background: #090c15;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 16px;
  color: #38bdf8;
  font-family: monospace;
  font-size: 0.8rem;
  overflow: auto;
  max-height: 180px;
  margin-top: 10px;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.5);
}

/* ── Spinner ── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Toast Container ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}
.toast {
  background: rgba(17, 24, 39, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 18px;
  border-radius: 8px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  animation: slideIn 0.3s ease-out forwards;
}
.toast.success {
  border-left: 3px solid #10b981;
}
.toast.error {
  border-left: 3px solid #ef4444;
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 1024px) {
  .portal-sidebar {
    width: 80px;
    padding: 24px 10px;
  }
  .brand-text, .profile-info, .sidebar-footer button span {
    display: none;
  }
  .menu-item span {
    display: none;
  }
  .portal-content {
    margin-left: 80px;
    max-width: calc(100vw - 80px);
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ── Split Screen Seller Context UI ── */
.partner-split-layout {
  display: flex;
  gap: 24px;
  align-items: stretch;
  min-height: 500px;
}

.seller-list-pane {
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.pane-header h3 {
  margin: 0 0 15px 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
}

.seller-cards-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: 550px;
  margin-top: 15px;
  padding-right: 4px;
}

.seller-list-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px 15px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.seller-list-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(3px);
}

.seller-list-card.active {
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.1) 0%, rgba(249, 115, 22, 0.05) 100%);
  border-color: var(--primary);
  box-shadow: 0 4px 15px rgba(255, 107, 0, 0.1);
}

.seller-list-card .card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255, 107, 0, 0.08);
  border: 1px solid rgba(255, 107, 0, 0.2);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
}

.seller-list-card .card-meta {
  flex-grow: 1;
}

.seller-list-card .card-meta h4 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

.seller-list-card .card-meta p {
  margin: 2px 0 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
}

.seller-ops-pane {
  flex: 1;
  padding: 24px;
}

.seller-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.info-badge-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-badge-item i {
  color: var(--primary);
}

.section-subtitle {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 6px;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.op-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.op-card:not(.disabled):hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.op-card .op-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 107, 0, 0.08);
  border: 1px solid rgba(255, 107, 0, 0.2);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.op-card .op-details h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.op-card .op-details p {
  margin: 6px 0 0 0;
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.4;
}

/* Disabled operation card styling */
.op-card.disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.op-card.disabled .op-icon-wrap {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
  color: #64748b;
}

.op-card.disabled .op-details h4 {
  color: #64748b;
}

/* Modals overlays styling */
.modal-overlay {
  transition: opacity 0.3s ease;
}


/* Tooltip Helper Style */
.tooltip-helper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: #94a3b8;
  cursor: help;
  margin-left: 6px;
  line-height: 1;
  vertical-align: middle;
  transition: all 0.2s ease;
}
.tooltip-helper:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.tooltip-helper::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: #0f172a;
  color: #f1f5f9;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: normal;
  text-transform: none;
  width: 220px;
  white-space: normal;
  line-height: 1.4;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 1000;
  text-align: center;
}
.tooltip-helper::before {
  content: "";
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 1000;
}
.tooltip-helper:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) scale(1);
}
.tooltip-helper:hover::before {
  opacity: 1;
  visibility: visible;
}
